From f8534a14c18fc4e176b3587fac44797b7407402b Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Fri, 31 May 2024 22:06:02 +0900 Subject: [PATCH 1/9] fix: remove unnecessary exports overriding --- package.json | 68 ++++++++++++++++++++++------------------------------ 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index d33d9ba8a..a68c82f20 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,34 @@ ], "packageManager": "yarn@4.2.2", "exports": { - ".": "./src/index.ts", - "./array": "./src/array/index.ts", - "./function": "./src/function/index.ts", - "./math": "./src/math/index.ts", - "./object": "./src/object/index.ts", - "./predicate": "./src/predicate/index.ts", - "./promise": "./src/promise/index.ts", + ".": { + "import": "./esm/index.mjs", + "require": "./dist/index.js" + }, + "./array": { + "import": "./esm/array/index.mjs", + "require": "./dist/array/index.js" + }, + "./function": { + "import": "./esm/function/index.mjs", + "require": "./dist/function/index.js" + }, + "./math": { + "import": "./esm/math/index.mjs", + "require": "./dist/math/index.js" + }, + "./object": { + "import": "./esm/object/index.mjs", + "require": "./dist/object/index.js" + }, + "./predicate": { + "import": "./esm/predicate/index.mjs", + "require": "./dist/predicate/index.js" + }, + "./promise": { + "import": "./esm/promise/index.mjs", + "require": "./dist/promise/index.js" + }, "./package.json": "./package.json" }, "files": [ @@ -21,38 +42,7 @@ "esm/**/*" ], "publishConfig": { - "access": "public", - "exports": { - ".": { - "import": "./esm/index.mjs", - "require": "./dist/index.js" - }, - "./array": { - "import": "./esm/array/index.mjs", - "require": "./dist/array/index.js" - }, - "./function": { - "import": "./esm/function/index.mjs", - "require": "./dist/function/index.js" - }, - "./math": { - "import": "./esm/math/index.mjs", - "require": "./dist/math/index.js" - }, - "./object": { - "import": "./esm/object/index.mjs", - "require": "./dist/object/index.js" - }, - "./predicate": { - "import": "./esm/predicate/index.mjs", - "require": "./dist/predicate/index.js" - }, - "./promise": { - "import": "./esm/promise/index.mjs", - "require": "./dist/promise/index.js" - }, - "./package.json": "./package.json" - } + "access": "public" }, "devDependencies": { "@babel/core": "^7.24.5", From 3281a7a9e0d5ba337d19386637561b997dde8343 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Sun, 2 Jun 2024 00:36:16 +0900 Subject: [PATCH 2/9] Revert "fix: remove unnecessary exports overriding" This reverts commit f8534a14c18fc4e176b3587fac44797b7407402b. --- package.json | 68 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index a68c82f20..d33d9ba8a 100644 --- a/package.json +++ b/package.json @@ -7,34 +7,13 @@ ], "packageManager": "yarn@4.2.2", "exports": { - ".": { - "import": "./esm/index.mjs", - "require": "./dist/index.js" - }, - "./array": { - "import": "./esm/array/index.mjs", - "require": "./dist/array/index.js" - }, - "./function": { - "import": "./esm/function/index.mjs", - "require": "./dist/function/index.js" - }, - "./math": { - "import": "./esm/math/index.mjs", - "require": "./dist/math/index.js" - }, - "./object": { - "import": "./esm/object/index.mjs", - "require": "./dist/object/index.js" - }, - "./predicate": { - "import": "./esm/predicate/index.mjs", - "require": "./dist/predicate/index.js" - }, - "./promise": { - "import": "./esm/promise/index.mjs", - "require": "./dist/promise/index.js" - }, + ".": "./src/index.ts", + "./array": "./src/array/index.ts", + "./function": "./src/function/index.ts", + "./math": "./src/math/index.ts", + "./object": "./src/object/index.ts", + "./predicate": "./src/predicate/index.ts", + "./promise": "./src/promise/index.ts", "./package.json": "./package.json" }, "files": [ @@ -42,7 +21,38 @@ "esm/**/*" ], "publishConfig": { - "access": "public" + "access": "public", + "exports": { + ".": { + "import": "./esm/index.mjs", + "require": "./dist/index.js" + }, + "./array": { + "import": "./esm/array/index.mjs", + "require": "./dist/array/index.js" + }, + "./function": { + "import": "./esm/function/index.mjs", + "require": "./dist/function/index.js" + }, + "./math": { + "import": "./esm/math/index.mjs", + "require": "./dist/math/index.js" + }, + "./object": { + "import": "./esm/object/index.mjs", + "require": "./dist/object/index.js" + }, + "./predicate": { + "import": "./esm/predicate/index.mjs", + "require": "./dist/predicate/index.js" + }, + "./promise": { + "import": "./esm/promise/index.mjs", + "require": "./dist/promise/index.js" + }, + "./package.json": "./package.json" + } }, "devDependencies": { "@babel/core": "^7.24.5", From 4948f2e2c242958f6c16a690bb6ca7dbf5203d96 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Sun, 2 Jun 2024 00:43:35 +0900 Subject: [PATCH 3/9] chore(package.json): add types field in publishConfig.exports --- package.json | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d33d9ba8a..4cd0f43a4 100644 --- a/package.json +++ b/package.json @@ -25,31 +25,38 @@ "exports": { ".": { "import": "./esm/index.mjs", - "require": "./dist/index.js" + "require": "./dist/index.js", + "types": "./dist/index.d.ts" }, "./array": { "import": "./esm/array/index.mjs", - "require": "./dist/array/index.js" + "require": "./dist/array/index.js", + "types": "./dist/array/index.d.ts" }, "./function": { "import": "./esm/function/index.mjs", - "require": "./dist/function/index.js" + "require": "./dist/function/index.js", + "types": "./dist/function/index.d.ts" }, "./math": { "import": "./esm/math/index.mjs", - "require": "./dist/math/index.js" + "require": "./dist/math/index.js", + "types": "./dist/math/index.d.ts" }, "./object": { "import": "./esm/object/index.mjs", - "require": "./dist/object/index.js" + "require": "./dist/object/index.js", + "types": "./dist/object/index.d.ts" }, "./predicate": { "import": "./esm/predicate/index.mjs", - "require": "./dist/predicate/index.js" + "require": "./dist/predicate/index.js", + "types": "./dist/predicate/index.d.ts" }, "./promise": { "import": "./esm/promise/index.mjs", - "require": "./dist/promise/index.js" + "require": "./dist/promise/index.js", + "types": "./dist/promise/index.d.ts" }, "./package.json": "./package.json" } From a14bcb1ae34da1bba9a4bac1f7135f902322b5c8 Mon Sep 17 00:00:00 2001 From: raon0211 Date: Mon, 3 Jun 2024 21:33:44 +0900 Subject: [PATCH 4/9] build: Support moduleResolution: node10 and node16 (nodenext) --- .gitignore | 4 +++- .scripts/postbuild.sh | 7 +++++++ package.json | 42 ++++++++++++++++++------------------------ yarn.lock | 2 +- 4 files changed, 29 insertions(+), 26 deletions(-) create mode 100755 .scripts/postbuild.sh diff --git a/.gitignore b/.gitignore index a9fb4a118..6599e6d15 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,6 @@ coverage dist esm .junit -out \ No newline at end of file +out +*.d.ts +*.tgz \ No newline at end of file diff --git a/.scripts/postbuild.sh b/.scripts/postbuild.sh new file mode 100755 index 000000000..dd5125a6c --- /dev/null +++ b/.scripts/postbuild.sh @@ -0,0 +1,7 @@ +echo "export * from './dist/array';" > array.d.ts +echo "export * from './dist/function';" > function.d.ts +echo "export * from './dist/math';" > math.d.ts +echo "export * from './dist/object';" > object.d.ts +echo "export * from './dist/predicate';" > predicate.d.ts +echo "export * from './dist/promise';" > promise.d.ts +echo "{\"type\":\"module\"}" > ./esm/package.json \ No newline at end of file diff --git a/package.json b/package.json index 4cd0f43a4..1933a4f5d 100644 --- a/package.json +++ b/package.json @@ -18,45 +18,39 @@ }, "files": [ "dist/**/*", - "esm/**/*" + "esm/**/*", + "*.d.ts" ], "publishConfig": { "access": "public", "exports": { ".": { - "import": "./esm/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" + "import": "./esm/index.js", + "require": "./dist/index.js" }, "./array": { - "import": "./esm/array/index.mjs", - "require": "./dist/array/index.js", - "types": "./dist/array/index.d.ts" + "import": "./esm/array/index.js", + "require": "./dist/array/index.js" }, "./function": { - "import": "./esm/function/index.mjs", - "require": "./dist/function/index.js", - "types": "./dist/function/index.d.ts" + "import": "./esm/function/index.js", + "require": "./dist/function/index.js" }, "./math": { - "import": "./esm/math/index.mjs", - "require": "./dist/math/index.js", - "types": "./dist/math/index.d.ts" + "import": "./esm/math/index.js", + "require": "./dist/math/index.js" }, "./object": { - "import": "./esm/object/index.mjs", - "require": "./dist/object/index.js", - "types": "./dist/object/index.d.ts" + "import": "./esm/object/index.js", + "require": "./dist/object/index.js" }, "./predicate": { - "import": "./esm/predicate/index.mjs", - "require": "./dist/predicate/index.js", - "types": "./dist/predicate/index.d.ts" + "import": "./esm/predicate/index.js", + "require": "./dist/predicate/index.js" }, "./promise": { - "import": "./esm/promise/index.mjs", - "require": "./dist/promise/index.js", - "types": "./dist/promise/index.d.ts" + "import": "./esm/promise/index.js", + "require": "./dist/promise/index.js" }, "./package.json": "./package.json" } @@ -88,7 +82,7 @@ "sideEffects": false, "scripts": { "prepack": "yarn build", - "build": "rm -rf dist esm && tsc -p tsconfig.json --declaration --emitDeclarationOnly --declarationDir dist && rollup -c rollup.config.js", + "build": "rm -rf dist esm && tsc -p tsconfig.json --declaration --emitDeclarationOnly --declarationDir dist && tsc -p tsconfig.json --declaration --emitDeclarationOnly --declarationDir esm && rollup -c rollup.config.js && ./.scripts/postbuild.sh", "test": "vitest run --coverage --typecheck" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index d43059390..9b02fe338 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1842,7 +1842,7 @@ __metadata: tty-table: "npm:^4.1.5" bin: changeset: bin.js - checksum: 10c0/0fca2a81b41dd07a955a60dfa6c9ec9e8b336dc564f39f3e570185ad946dff317de79249808a0f60fa5226990a498fcebc0b09cfe14d17ccfb17259c8e684caf + checksum: 10c0/d7a6bc37831a77458a315dc1ba5d471793f55f74c21542776abffab006b934dfed64212dcc8b58267af62726d5641820cc52b66fc0eaa8baa09aef666bfd0c11 languageName: node linkType: hard From 8d96b0ed872bb420bda9a6fb5885a294cf690a97 Mon Sep 17 00:00:00 2001 From: raon0211 Date: Mon, 3 Jun 2024 22:04:35 +0900 Subject: [PATCH 5/9] build: Support moduleResolution: node10 and node16 (nodenext) --- .scripts/postbuild.sh | 3 +-- package.json | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.scripts/postbuild.sh b/.scripts/postbuild.sh index dd5125a6c..9d7e95720 100755 --- a/.scripts/postbuild.sh +++ b/.scripts/postbuild.sh @@ -3,5 +3,4 @@ echo "export * from './dist/function';" > function.d.ts echo "export * from './dist/math';" > math.d.ts echo "export * from './dist/object';" > object.d.ts echo "export * from './dist/predicate';" > predicate.d.ts -echo "export * from './dist/promise';" > promise.d.ts -echo "{\"type\":\"module\"}" > ./esm/package.json \ No newline at end of file +echo "export * from './dist/promise';" > promise.d.ts \ No newline at end of file diff --git a/package.json b/package.json index 1933a4f5d..cb004467f 100644 --- a/package.json +++ b/package.json @@ -23,33 +23,42 @@ ], "publishConfig": { "access": "public", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { ".": { - "import": "./esm/index.js", + "types": "./dist/index.d.ts", + "import": "./esm/index.mjs", "require": "./dist/index.js" }, "./array": { - "import": "./esm/array/index.js", + "types": "./dist/array/index.d.ts", + "import": "./esm/array/index.mjs", "require": "./dist/array/index.js" }, "./function": { - "import": "./esm/function/index.js", + "types": "./dist/function/index.d.ts", + "import": "./esm/function/index.mjs", "require": "./dist/function/index.js" }, "./math": { - "import": "./esm/math/index.js", + "types": "./dist/math/index.d.ts", + "import": "./esm/math/index.mjs", "require": "./dist/math/index.js" }, "./object": { - "import": "./esm/object/index.js", + "types": "./dist/object/index.d.ts", + "import": "./esm/object/index.mjs", "require": "./dist/object/index.js" }, "./predicate": { - "import": "./esm/predicate/index.js", + "types": "./dist/predicate/index.d.ts", + "import": "./esm/predicate/index.mjs", "require": "./dist/predicate/index.js" }, "./promise": { - "import": "./esm/promise/index.js", + "types": "./dist/promise/index.d.ts", + "import": "./esm/promise/index.mjs", "require": "./dist/promise/index.js" }, "./package.json": "./package.json" @@ -82,7 +91,7 @@ "sideEffects": false, "scripts": { "prepack": "yarn build", - "build": "rm -rf dist esm && tsc -p tsconfig.json --declaration --emitDeclarationOnly --declarationDir dist && tsc -p tsconfig.json --declaration --emitDeclarationOnly --declarationDir esm && rollup -c rollup.config.js && ./.scripts/postbuild.sh", + "build": "rm -rf dist esm && tsc -p tsconfig.json --declaration --emitDeclarationOnly --declarationDir dist && rollup -c rollup.config.js && ./.scripts/postbuild.sh", "test": "vitest run --coverage --typecheck" } -} \ No newline at end of file +} From a00ed8d7cf5768f05dfe1bc6aa583a7dff11f8ba Mon Sep 17 00:00:00 2001 From: raon0211 Date: Mon, 3 Jun 2024 22:06:28 +0900 Subject: [PATCH 6/9] build: Support moduleResolution: node10 and node16 (nodenext) --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 9b02fe338..d43059390 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1842,7 +1842,7 @@ __metadata: tty-table: "npm:^4.1.5" bin: changeset: bin.js - checksum: 10c0/d7a6bc37831a77458a315dc1ba5d471793f55f74c21542776abffab006b934dfed64212dcc8b58267af62726d5641820cc52b66fc0eaa8baa09aef666bfd0c11 + checksum: 10c0/0fca2a81b41dd07a955a60dfa6c9ec9e8b336dc564f39f3e570185ad946dff317de79249808a0f60fa5226990a498fcebc0b09cfe14d17ccfb17259c8e684caf languageName: node linkType: hard From c2b2a470e38c6d7b9021719659d1ed4ad31bb014 Mon Sep 17 00:00:00 2001 From: raon0211 Date: Mon, 3 Jun 2024 22:09:05 +0900 Subject: [PATCH 7/9] fix delay --- src/promise/delay.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/promise/delay.spec.ts b/src/promise/delay.spec.ts index f04d3fb6d..0ef2d1903 100644 --- a/src/promise/delay.spec.ts +++ b/src/promise/delay.spec.ts @@ -8,6 +8,6 @@ describe('delay', () => { await delay(100); const end = performance.now() - expect(end - start).greaterThanOrEqual(100) + expect(end - start).greaterThanOrEqual(99) }); }) \ No newline at end of file From 7974c90ba72c70b7ec5aabb04032b5df59e5fb7a Mon Sep 17 00:00:00 2001 From: Sojin Park Date: Mon, 3 Jun 2024 22:09:22 +0900 Subject: [PATCH 8/9] Update .gitignore Co-authored-by: Jonghyeon Ko --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6599e6d15..9eec46e78 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ esm .junit out *.d.ts -*.tgz \ No newline at end of file +*.tgz From 4987ef9ff35968a334b2983c287a949aca6725ba Mon Sep 17 00:00:00 2001 From: Sojin Park Date: Mon, 3 Jun 2024 22:09:27 +0900 Subject: [PATCH 9/9] Update .scripts/postbuild.sh Co-authored-by: Jonghyeon Ko --- .scripts/postbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/postbuild.sh b/.scripts/postbuild.sh index 9d7e95720..82329ce2e 100755 --- a/.scripts/postbuild.sh +++ b/.scripts/postbuild.sh @@ -3,4 +3,4 @@ echo "export * from './dist/function';" > function.d.ts echo "export * from './dist/math';" > math.d.ts echo "export * from './dist/object';" > object.d.ts echo "export * from './dist/predicate';" > predicate.d.ts -echo "export * from './dist/promise';" > promise.d.ts \ No newline at end of file +echo "export * from './dist/promise';" > promise.d.ts