Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(package.json): Provide correct types for moduleResolution: node, node10, and node16 #16

Merged
merged 11 commits into from
Jun 3, 2024
Prev Previous commit
Next Next commit
build: Support moduleResolution: node10 and node16 (nodenext)
  • Loading branch information
raon0211 committed Jun 3, 2024
commit a14bcb1ae34da1bba9a4bac1f7135f902322b5c8
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ coverage
dist
esm
.junit
out
out
*.d.ts
*.tgz
raon0211 marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 7 additions & 0 deletions .scripts/postbuild.sh
Original file line number Diff line number Diff line change
@@ -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
42 changes: 18 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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"
}
}
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down