-
Notifications
You must be signed in to change notification settings - Fork 343
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(*): migrate rollup to tsup, support esm correctly, remove *.spec.* for dist #21
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ | |
node_modules | ||
coverage | ||
dist | ||
esm | ||
.junit | ||
out | ||
*.d.ts | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,49 +17,84 @@ | |
"./package.json": "./package.json" | ||
}, | ||
"files": [ | ||
"dist/**/*", | ||
"esm/**/*", | ||
"dist", | ||
"*.d.ts" | ||
], | ||
"publishConfig": { | ||
"access": "public", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./esm/index.mjs", | ||
"require": "./dist/index.js" | ||
"import": { | ||
"types": "./dist/index.d.mts", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. *.d.mts is generated by tsup default |
||
"default": "./dist/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
} | ||
}, | ||
"./array": { | ||
"types": "./dist/array/index.d.ts", | ||
"import": "./esm/array/index.mjs", | ||
"require": "./dist/array/index.js" | ||
"import": { | ||
"types": "./dist/array/index.d.mts", | ||
"default": "./dist/array/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/array/index.d.ts", | ||
"default": "./dist/array/index.js" | ||
} | ||
}, | ||
"./function": { | ||
"types": "./dist/function/index.d.ts", | ||
"import": "./esm/function/index.mjs", | ||
"require": "./dist/function/index.js" | ||
"import": { | ||
"types": "./dist/function/index.d.mts", | ||
"default": "./dist/function/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/function/index.d.ts", | ||
"default": "./dist/function/index.js" | ||
} | ||
}, | ||
"./math": { | ||
"types": "./dist/math/index.d.ts", | ||
"import": "./esm/math/index.mjs", | ||
"require": "./dist/math/index.js" | ||
"import": { | ||
"types": "./dist/math/index.d.mts", | ||
"default": "./dist/math/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/math/index.d.ts", | ||
"default": "./dist/math/index.js" | ||
} | ||
}, | ||
"./object": { | ||
"types": "./dist/object/index.d.ts", | ||
"import": "./esm/object/index.mjs", | ||
"require": "./dist/object/index.js" | ||
"import": { | ||
"types": "./dist/object/index.d.mts", | ||
"default": "./dist/object/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/object/index.d.ts", | ||
"default": "./dist/object/index.js" | ||
} | ||
}, | ||
"./predicate": { | ||
"types": "./dist/predicate/index.d.ts", | ||
"import": "./esm/predicate/index.mjs", | ||
"require": "./dist/predicate/index.js" | ||
"import": { | ||
"types": "./dist/predicate/index.d.mts", | ||
"default": "./dist/predicate/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/predicate/index.d.ts", | ||
"default": "./dist/predicate/index.js" | ||
} | ||
}, | ||
"./promise": { | ||
"types": "./dist/promise/index.d.ts", | ||
"import": "./esm/promise/index.mjs", | ||
"require": "./dist/promise/index.js" | ||
"import": { | ||
"types": "./dist/promise/index.d.mts", | ||
"default": "./dist/promise/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/promise/index.d.ts", | ||
"default": "./dist/promise/index.js" | ||
} | ||
}, | ||
"./package.json": "./package.json" | ||
} | ||
|
@@ -70,7 +105,6 @@ | |
"@babel/preset-typescript": "^7.24.1", | ||
"@changesets/changelog-github": "^0.5.0", | ||
"@changesets/cli": "^2.27.1", | ||
"@toss/rollup-config": "0.2.0-canary.0", | ||
"@types/babel__core": "^7", | ||
"@types/babel__preset-env": "^7", | ||
"@types/broken-link-checker": "^0", | ||
|
@@ -84,14 +118,14 @@ | |
"eslint-config-prettier": "^8.5.0", | ||
"lodash": "^4.17.21", | ||
"prettier": "^3.2.5", | ||
"rollup": "^2.78.0", | ||
"tsup": "^8.1.0", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.5.2" | ||
}, | ||
"sideEffects": false, | ||
"scripts": { | ||
"prepack": "yarn build", | ||
"build": "rm -rf dist esm && tsc -p tsconfig.json --declaration --emitDeclarationOnly --declarationDir dist && rollup -c rollup.config.js && ./.scripts/postbuild.sh", | ||
"build": "tsup && ./.scripts/postbuild.sh", | ||
"test": "vitest run --coverage --typecheck" | ||
} | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from 'tsup' | ||
|
||
export default defineConfig({ | ||
format: ['cjs', 'esm'], | ||
entry: ['src/*.ts', 'src/*/*.ts', '!**/*.{spec,test,test-d}.*'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #19 |
||
sourcemap: true, | ||
dts: true, | ||
clean: true, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module field for yarn berry
https://yarnpkg.com/configuration/manifest#module