mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 03:34:26 +03:00
fix(package.json): Provide correct types for moduleResolution: node, node10, and node16 (#16)
* fix: remove unnecessary exports overriding
* Revert "fix: remove unnecessary exports overriding"
This reverts commit f8534a14c1
.
* chore(package.json): add types field in publishConfig.exports
* build: Support moduleResolution: node10 and node16 (nodenext)
* build: Support moduleResolution: node10 and node16 (nodenext)
* build: Support moduleResolution: node10 and node16 (nodenext)
* fix delay
* Update .gitignore
Co-authored-by: Jonghyeon Ko <jonghyeon@toss.im>
* Update .scripts/postbuild.sh
Co-authored-by: Jonghyeon Ko <jonghyeon@toss.im>
---------
Co-authored-by: raon0211 <raon0211@toss.im>
This commit is contained in:
parent
17096774e7
commit
848f2c66ff
2
.gitignore
vendored
2
.gitignore
vendored
@ -16,3 +16,5 @@ dist
|
||||
esm
|
||||
.junit
|
||||
out
|
||||
*.d.ts
|
||||
*.tgz
|
||||
|
6
.scripts/postbuild.sh
Executable file
6
.scripts/postbuild.sh
Executable file
@ -0,0 +1,6 @@
|
||||
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
|
14
package.json
14
package.json
@ -18,36 +18,46 @@
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"esm/**/*"
|
||||
"esm/**/*",
|
||||
"*.d.ts"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./esm/index.mjs",
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"./array": {
|
||||
"types": "./dist/array/index.d.ts",
|
||||
"import": "./esm/array/index.mjs",
|
||||
"require": "./dist/array/index.js"
|
||||
},
|
||||
"./function": {
|
||||
"types": "./dist/function/index.d.ts",
|
||||
"import": "./esm/function/index.mjs",
|
||||
"require": "./dist/function/index.js"
|
||||
},
|
||||
"./math": {
|
||||
"types": "./dist/math/index.d.ts",
|
||||
"import": "./esm/math/index.mjs",
|
||||
"require": "./dist/math/index.js"
|
||||
},
|
||||
"./object": {
|
||||
"types": "./dist/object/index.d.ts",
|
||||
"import": "./esm/object/index.mjs",
|
||||
"require": "./dist/object/index.js"
|
||||
},
|
||||
"./predicate": {
|
||||
"types": "./dist/predicate/index.d.ts",
|
||||
"import": "./esm/predicate/index.mjs",
|
||||
"require": "./dist/predicate/index.js"
|
||||
},
|
||||
"./promise": {
|
||||
"types": "./dist/promise/index.d.ts",
|
||||
"import": "./esm/promise/index.mjs",
|
||||
"require": "./dist/promise/index.js"
|
||||
},
|
||||
@ -81,7 +91,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 && rollup -c rollup.config.js && ./.scripts/postbuild.sh",
|
||||
"test": "vitest run --coverage --typecheck"
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,6 @@ describe('delay', () => {
|
||||
await delay(100);
|
||||
const end = performance.now()
|
||||
|
||||
expect(end - start).greaterThanOrEqual(100)
|
||||
expect(end - start).greaterThanOrEqual(99)
|
||||
});
|
||||
})
|
Loading…
Reference in New Issue
Block a user