feat: export main cli & add tsup-node command (#290)

* export main cli & add tsup-node

* update docs

* update tests

* refactor external-plugin to support skipNodeModulesBundle directly

* update docs

Co-authored-by: EGOIST <0x142857@gmail.com>
This commit is contained in:
Pablo Sáez 2021-04-27 05:13:50 -04:00 committed by GitHub
parent 5f0ce9f339
commit c7773e9a3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 213 additions and 168 deletions

View File

@ -40,6 +40,18 @@ Code splitting is enabled by default and supported in `cjs` and `esm` format.
By default tsup bundles all `import`-ed modules but `dependencies` and `peerDependencies` in your `packages.json` are always excluded, you can also use `--external <module>` flag to mark other packages as external.
### Excluding all packages
If you are using **tsup** to build for **Node.js** applications/APIs, usually bundling dependencies is not needed, and it can even break things, for instance, while outputting to [ESM](https://nodejs.org/api/esm.html).
tsup automatically excludes packages specified in the `dependencies` and `peerDependencies` fields in the `packages.json`, but if it somehow doesn't exclude some packages, this library also has a special executable `tsup-node` that automatically skips bundling any Node.js package.
```bash
tsup-node src/index.ts
```
All other CLI flags still apply to this command.
### Generate declaration file
```bash

View File

@ -2,7 +2,10 @@
"name": "tsup",
"version": "0.0.0-semantic-release",
"main": "dist/index.js",
"bin": "dist/cli.js",
"bin": {
"tsup": "dist/cli-default.js",
"tsup-node": "dist/cli-node.js"
},
"types": "dist/index.d.ts",
"files": [
"dist"
@ -13,12 +16,12 @@
"url": "https://github.com/egoist/tsup.git"
},
"scripts": {
"build": "npm run tsup -- src/cli.ts src/index.ts src/rollup.ts --clean --dts-resolve",
"build": "npm run tsup -- src/cli-*.ts src/index.ts src/rollup.ts --clean --dts-resolve",
"prepublishOnly": "npm run build",
"test": "npm run build:simple && jest",
"//": "Building without dts for speed",
"build:simple": "npm run tsup -- src/cli.ts src/index.ts src/rollup.ts --clean",
"tsup": "node -r sucrase/register src/cli.ts"
"build:simple": "npm run tsup -- src/cli-*.ts src/index.ts src/rollup.ts --clean",
"tsup": "node -r sucrase/register src/cli-default.ts"
},
"dependencies": {
"cac": "^6.7.2",

303
pnpm-lock.yaml generated
View File

@ -42,11 +42,11 @@ specifiers:
wait-for-expect: ^3.0.2
dependencies:
cac: 6.7.2
chalk: 4.1.0
cac: 6.7.3
chalk: 4.1.1
chokidar: 3.5.1
debug: 4.3.1
esbuild: 0.11.12
esbuild: 0.11.14
execa: 5.0.0
globby: 11.0.3
joycon: 3.0.1
@ -57,7 +57,7 @@ dependencies:
tree-kill: 1.2.2
devDependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@rollup/plugin-json': 4.1.0_rollup@2.45.2
'@types/buble': 0.19.2
'@types/debug': 4.1.5
@ -70,8 +70,8 @@ devDependencies:
fs-extra: 9.1.0
jest: 26.6.3
jju: 1.4.0
postcss: 8.2.10
postcss-simple-vars: 6.0.3_postcss@8.2.10
postcss: 8.2.12
postcss-simple-vars: 6.0.3_postcss@8.2.12
prettier: 2.2.1
resolve: 1.20.0
rollup-plugin-dts: 3.0.1_rollup@2.45.2+typescript@4.2.4
@ -95,19 +95,19 @@ packages:
resolution: {integrity: sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA==}
dev: true
/@babel/core/7.13.15:
resolution: {integrity: sha512-6GXmNYeNjS2Uz+uls5jalOemgIhnTMeaXo+yBUA72kC2uX/8VW6XyhVIo2L8/q0goKQA3EVKx0KOQpVKSeWadQ==}
/@babel/core/7.13.16:
resolution: {integrity: sha512-sXHpixBiWWFti0AV2Zq7avpTasr6sIAu7Y396c608541qAU2ui4a193m0KSQmfPSKFZLnQ3cvlKDOm3XkuXm3Q==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/code-frame': 7.12.13
'@babel/generator': 7.13.9
'@babel/helper-compilation-targets': 7.13.13_@babel+core@7.13.15
'@babel/generator': 7.13.16
'@babel/helper-compilation-targets': 7.13.16_@babel+core@7.13.16
'@babel/helper-module-transforms': 7.13.14
'@babel/helpers': 7.13.10
'@babel/parser': 7.13.15
'@babel/helpers': 7.13.17
'@babel/parser': 7.13.16
'@babel/template': 7.12.13
'@babel/traverse': 7.13.15
'@babel/types': 7.13.14
'@babel/traverse': 7.13.17
'@babel/types': 7.13.17
convert-source-map: 1.7.0
debug: 4.3.1
gensync: 1.0.0-beta.2
@ -118,23 +118,23 @@ packages:
- supports-color
dev: true
/@babel/generator/7.13.9:
resolution: {integrity: sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw==}
/@babel/generator/7.13.16:
resolution: {integrity: sha512-grBBR75UnKOcUWMp8WoDxNsWCFl//XCK6HWTrBQKTr5SV9f5g0pNOjdyzi/DTBv12S9GnYPInIXQBTky7OXEMg==}
dependencies:
'@babel/types': 7.13.14
'@babel/types': 7.13.17
jsesc: 2.5.2
source-map: 0.5.7
dev: true
/@babel/helper-compilation-targets/7.13.13_@babel+core@7.13.15:
resolution: {integrity: sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ==}
/@babel/helper-compilation-targets/7.13.16_@babel+core@7.13.16:
resolution: {integrity: sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA==}
peerDependencies:
'@babel/core': ^7.0.0
dependencies:
'@babel/compat-data': 7.13.15
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-validator-option': 7.12.17
browserslist: 4.16.4
browserslist: 4.16.5
semver: 6.3.0
dev: true
@ -143,25 +143,25 @@ packages:
dependencies:
'@babel/helper-get-function-arity': 7.12.13
'@babel/template': 7.12.13
'@babel/types': 7.13.14
'@babel/types': 7.13.17
dev: true
/@babel/helper-get-function-arity/7.12.13:
resolution: {integrity: sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==}
dependencies:
'@babel/types': 7.13.14
'@babel/types': 7.13.17
dev: true
/@babel/helper-member-expression-to-functions/7.13.12:
resolution: {integrity: sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==}
dependencies:
'@babel/types': 7.13.14
'@babel/types': 7.13.17
dev: true
/@babel/helper-module-imports/7.13.12:
resolution: {integrity: sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==}
dependencies:
'@babel/types': 7.13.14
'@babel/types': 7.13.17
dev: true
/@babel/helper-module-transforms/7.13.14:
@ -173,8 +173,8 @@ packages:
'@babel/helper-split-export-declaration': 7.12.13
'@babel/helper-validator-identifier': 7.12.11
'@babel/template': 7.12.13
'@babel/traverse': 7.13.15
'@babel/types': 7.13.14
'@babel/traverse': 7.13.17
'@babel/types': 7.13.17
transitivePeerDependencies:
- supports-color
dev: true
@ -182,7 +182,7 @@ packages:
/@babel/helper-optimise-call-expression/7.12.13:
resolution: {integrity: sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==}
dependencies:
'@babel/types': 7.13.14
'@babel/types': 7.13.17
dev: true
/@babel/helper-plugin-utils/7.13.0:
@ -194,8 +194,8 @@ packages:
dependencies:
'@babel/helper-member-expression-to-functions': 7.13.12
'@babel/helper-optimise-call-expression': 7.12.13
'@babel/traverse': 7.13.15
'@babel/types': 7.13.14
'@babel/traverse': 7.13.17
'@babel/types': 7.13.17
transitivePeerDependencies:
- supports-color
dev: true
@ -203,13 +203,13 @@ packages:
/@babel/helper-simple-access/7.13.12:
resolution: {integrity: sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==}
dependencies:
'@babel/types': 7.13.14
'@babel/types': 7.13.17
dev: true
/@babel/helper-split-export-declaration/7.12.13:
resolution: {integrity: sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==}
dependencies:
'@babel/types': 7.13.14
'@babel/types': 7.13.17
dev: true
/@babel/helper-validator-identifier/7.12.11:
@ -219,12 +219,12 @@ packages:
resolution: {integrity: sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==}
dev: true
/@babel/helpers/7.13.10:
resolution: {integrity: sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ==}
/@babel/helpers/7.13.17:
resolution: {integrity: sha512-Eal4Gce4kGijo1/TGJdqp3WuhllaMLSrW6XcL0ulyUAQOuxHcCafZE8KHg9857gcTehsm/v7RcOx2+jp0Ryjsg==}
dependencies:
'@babel/template': 7.12.13
'@babel/traverse': 7.13.15
'@babel/types': 7.13.14
'@babel/traverse': 7.13.17
'@babel/types': 7.13.17
transitivePeerDependencies:
- supports-color
dev: true
@ -236,117 +236,117 @@ packages:
chalk: 2.4.2
js-tokens: 4.0.0
/@babel/parser/7.13.15:
resolution: {integrity: sha512-b9COtcAlVEQljy/9fbcMHpG+UIW9ReF+gpaxDHTlZd0c6/UU9ng8zdySAW9sRTzpvcdCHn6bUcbuYUgGzLAWVQ==}
/@babel/parser/7.13.16:
resolution: {integrity: sha512-6bAg36mCwuqLO0hbR+z7PHuqWiCeP7Dzg73OpQwsAB1Eb8HnGEz5xYBzCfbu+YjoaJsJs+qheDxVAuqbt3ILEw==}
engines: {node: '>=6.0.0'}
hasBin: true
dev: true
/@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.13.15:
/@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.13.16:
resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-bigint/7.8.3_@babel+core@7.13.15:
/@babel/plugin-syntax-bigint/7.8.3_@babel+core@7.13.16:
resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.13.15:
/@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.13.16:
resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.13.15:
/@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.13.16:
resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.13.15:
/@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.13.16:
resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.13.15:
/@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.13.16:
resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.13.15:
/@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.13.16:
resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.13.15:
/@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.13.16:
resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.13.15:
/@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.13.16:
resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.13.15:
/@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.13.16:
resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.13.15:
/@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.13.16:
resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
/@babel/plugin-syntax-top-level-await/7.12.13_@babel+core@7.13.15:
/@babel/plugin-syntax-top-level-await/7.12.13_@babel+core@7.13.16:
resolution: {integrity: sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@babel/helper-plugin-utils': 7.13.0
dev: true
@ -354,30 +354,29 @@ packages:
resolution: {integrity: sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==}
dependencies:
'@babel/code-frame': 7.12.13
'@babel/parser': 7.13.15
'@babel/types': 7.13.14
'@babel/parser': 7.13.16
'@babel/types': 7.13.17
dev: true
/@babel/traverse/7.13.15:
resolution: {integrity: sha512-/mpZMNvj6bce59Qzl09fHEs8Bt8NnpEDQYleHUPZQ3wXUMvXi+HJPLars68oAbmp839fGoOkv2pSL2z9ajCIaQ==}
/@babel/traverse/7.13.17:
resolution: {integrity: sha512-BMnZn0R+X6ayqm3C3To7o1j7Q020gWdqdyP50KEoVqaCO2c/Im7sYZSmVgvefp8TTMQ+9CtwuBp0Z1CZ8V3Pvg==}
dependencies:
'@babel/code-frame': 7.12.13
'@babel/generator': 7.13.9
'@babel/generator': 7.13.16
'@babel/helper-function-name': 7.12.13
'@babel/helper-split-export-declaration': 7.12.13
'@babel/parser': 7.13.15
'@babel/types': 7.13.14
'@babel/parser': 7.13.16
'@babel/types': 7.13.17
debug: 4.3.1
globals: 11.12.0
transitivePeerDependencies:
- supports-color
dev: true
/@babel/types/7.13.14:
resolution: {integrity: sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==}
/@babel/types/7.13.17:
resolution: {integrity: sha512-RawydLgxbOPDlTLJNtoIypwdmAy//uQIzlKt2+iBiJaRlVuI6QLUxVAyWGNfOzp8Yu4L4lLIacoCyTNtpb4wiA==}
dependencies:
'@babel/helper-validator-identifier': 7.12.11
lodash: 4.17.21
to-fast-properties: 2.0.0
dev: true
@ -416,7 +415,7 @@ packages:
dependencies:
'@jest/types': 26.6.2
'@types/node': 14.14.41
chalk: 4.1.0
chalk: 4.1.1
jest-message-util: 26.6.2
jest-util: 26.6.2
slash: 3.0.0
@ -433,7 +432,7 @@ packages:
'@jest/types': 26.6.2
'@types/node': 14.14.41
ansi-escapes: 4.3.2
chalk: 4.1.0
chalk: 4.1.1
exit: 0.1.2
graceful-fs: 4.2.6
jest-changed-files: 26.6.2
@ -502,7 +501,7 @@ packages:
'@jest/test-result': 26.6.2
'@jest/transform': 26.6.2
'@jest/types': 26.6.2
chalk: 4.1.0
chalk: 4.1.1
collect-v8-coverage: 1.0.1
exit: 0.1.2
glob: 7.1.6
@ -567,10 +566,10 @@ packages:
resolution: {integrity: sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==}
engines: {node: '>= 10.14.2'}
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@jest/types': 26.6.2
babel-plugin-istanbul: 6.0.0
chalk: 4.1.0
chalk: 4.1.1
convert-source-map: 1.7.0
fast-json-stable-stringify: 2.1.0
graceful-fs: 4.2.6
@ -594,7 +593,7 @@ packages:
'@types/istanbul-reports': 3.0.0
'@types/node': 14.14.41
'@types/yargs': 15.0.13
chalk: 4.1.0
chalk: 4.1.1
dev: true
/@nodelib/fs.scandir/2.1.4:
@ -654,8 +653,8 @@ packages:
/@types/babel__core/7.1.14:
resolution: {integrity: sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g==}
dependencies:
'@babel/parser': 7.13.15
'@babel/types': 7.13.14
'@babel/parser': 7.13.16
'@babel/types': 7.13.17
'@types/babel__generator': 7.6.2
'@types/babel__template': 7.4.0
'@types/babel__traverse': 7.11.1
@ -664,20 +663,20 @@ packages:
/@types/babel__generator/7.6.2:
resolution: {integrity: sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ==}
dependencies:
'@babel/types': 7.13.14
'@babel/types': 7.13.17
dev: true
/@types/babel__template/7.4.0:
resolution: {integrity: sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A==}
dependencies:
'@babel/parser': 7.13.15
'@babel/types': 7.13.14
'@babel/parser': 7.13.16
'@babel/types': 7.13.17
dev: true
/@types/babel__traverse/7.11.1:
resolution: {integrity: sha512-Vs0hm0vPahPMYi9tDjtP66llufgO3ST16WXaSTtDGEl9cewAl3AibmxWw6TINOqHPT9z0uABKAYjT9jNSg4npw==}
dependencies:
'@babel/types': 7.13.14
'@babel/types': 7.13.17
dev: true
/@types/buble/0.19.2:
@ -807,8 +806,8 @@ packages:
hasBin: true
dev: true
/acorn/8.1.1:
resolution: {integrity: sha512-xYiIVjNuqtKXMxlRMDc6mZUhXehod4a3gbZ1qRlM7icK4EbxUFNLhWoPblCvFtB2Y9CIqHP3CF/rdxLItaQv8g==}
/acorn/8.2.1:
resolution: {integrity: sha512-z716cpm5TX4uzOzILx8PavOE6C6DKshHDw1aQN52M/yNSqE9s5O8SMfyhCCfCJ3HmTL0NkVOi+8a/55T7YB3bg==}
engines: {node: '>=0.4.0'}
hasBin: true
dev: true
@ -934,19 +933,19 @@ packages:
resolution: {integrity: sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==}
dev: true
/babel-jest/26.6.3_@babel+core@7.13.15:
/babel-jest/26.6.3_@babel+core@7.13.16:
resolution: {integrity: sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==}
engines: {node: '>= 10.14.2'}
peerDependencies:
'@babel/core': ^7.0.0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@jest/transform': 26.6.2
'@jest/types': 26.6.2
'@types/babel__core': 7.1.14
babel-plugin-istanbul: 6.0.0
babel-preset-jest: 26.6.2_@babel+core@7.13.15
chalk: 4.1.0
babel-preset-jest: 26.6.2_@babel+core@7.13.16
chalk: 4.1.1
graceful-fs: 4.2.6
slash: 3.0.0
transitivePeerDependencies:
@ -971,40 +970,40 @@ packages:
engines: {node: '>= 10.14.2'}
dependencies:
'@babel/template': 7.12.13
'@babel/types': 7.13.14
'@babel/types': 7.13.17
'@types/babel__core': 7.1.14
'@types/babel__traverse': 7.11.1
dev: true
/babel-preset-current-node-syntax/1.0.1_@babel+core@7.13.15:
/babel-preset-current-node-syntax/1.0.1_@babel+core@7.13.16:
resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==}
peerDependencies:
'@babel/core': ^7.0.0
dependencies:
'@babel/core': 7.13.15
'@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.13.15
'@babel/plugin-syntax-bigint': 7.8.3_@babel+core@7.13.15
'@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.13.15
'@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.13.15
'@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.13.15
'@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.13.15
'@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.13.15
'@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.13.15
'@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.13.15
'@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.13.15
'@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.13.15
'@babel/plugin-syntax-top-level-await': 7.12.13_@babel+core@7.13.15
'@babel/core': 7.13.16
'@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.13.16
'@babel/plugin-syntax-bigint': 7.8.3_@babel+core@7.13.16
'@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.13.16
'@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.13.16
'@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.13.16
'@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.13.16
'@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.13.16
'@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.13.16
'@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.13.16
'@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.13.16
'@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.13.16
'@babel/plugin-syntax-top-level-await': 7.12.13_@babel+core@7.13.16
dev: true
/babel-preset-jest/26.6.2_@babel+core@7.13.15:
/babel-preset-jest/26.6.2_@babel+core@7.13.16:
resolution: {integrity: sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==}
engines: {node: '>= 10.14.2'}
peerDependencies:
'@babel/core': ^7.0.0
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
babel-plugin-jest-hoist: 26.6.2
babel-preset-current-node-syntax: 1.0.1_@babel+core@7.13.15
babel-preset-current-node-syntax: 1.0.1_@babel+core@7.13.16
dev: true
/balanced-match/1.0.2:
@ -1066,14 +1065,14 @@ packages:
resolution: {integrity: sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==}
dev: true
/browserslist/4.16.4:
resolution: {integrity: sha512-d7rCxYV8I9kj41RH8UKYnvDYCRENUlHRgyXy/Rhr/1BaeLGfiCptEdFE8MIrvGfWbBFNjVYx76SQWvNX1j+/cQ==}
/browserslist/4.16.5:
resolution: {integrity: sha512-C2HAjrM1AI/djrpAUU/tr4pml1DqLIzJKSLDBXBrNErl9ZCCTXdhwxdJjYc16953+mBWf7Lw+uUJgpgb8cN71A==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
dependencies:
caniuse-lite: 1.0.30001209
caniuse-lite: 1.0.30001214
colorette: 1.2.2
electron-to-chromium: 1.3.717
electron-to-chromium: 1.3.720
escalade: 3.1.1
node-releases: 1.1.71
dev: true
@ -1108,8 +1107,8 @@ packages:
resolution: {integrity: sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==}
dev: true
/cac/6.7.2:
resolution: {integrity: sha512-w0bH1IF9rEjdi0a6lTtlXYT+vBZEJL9oytaXXRdsD68MH6+SrZGOGsu7s2saHQvYXqwo/wBdkW75tt8wFpj+mw==}
/cac/6.7.3:
resolution: {integrity: sha512-ECVqVZh74qgSuZG9YOt2OJPI3wGcf+EwwuF/XIOYqZBD0KZYLtgPWqFPxmDPQ6joxI1nOlvVgRV6VT53Ooyocg==}
engines: {node: '>=8'}
dev: false
@ -1142,8 +1141,8 @@ packages:
engines: {node: '>=10'}
dev: true
/caniuse-lite/1.0.30001209:
resolution: {integrity: sha512-2Ktt4OeRM7EM/JaOZjuLzPYAIqmbwQMNnYbgooT+icoRGrKOyAxA1xhlnotBD1KArRSPsuJp3TdYcZYrL7qNxA==}
/caniuse-lite/1.0.30001214:
resolution: {integrity: sha512-O2/SCpuaU3eASWVaesQirZv1MSjUNOvmugaD8zNSJqw6Vv5SGwoOpA9LJs3pNPfM745nxqPvfZY3MQKY4AKHYg==}
dev: true
/capture-exit/2.0.0:
@ -1165,8 +1164,8 @@ packages:
escape-string-regexp: 1.0.5
supports-color: 5.5.0
/chalk/4.1.0:
resolution: {integrity: sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==}
/chalk/4.1.1:
resolution: {integrity: sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==}
engines: {node: '>=10'}
dependencies:
ansi-styles: 4.3.0
@ -1453,8 +1452,8 @@ packages:
safer-buffer: 2.1.2
dev: true
/electron-to-chromium/1.3.717:
resolution: {integrity: sha512-OfzVPIqD1MkJ7fX+yTl2nKyOE4FReeVfMCzzxQS+Kp43hZYwHwThlGP+EGIZRXJsxCM7dqo8Y65NOX/HP12iXQ==}
/electron-to-chromium/1.3.720:
resolution: {integrity: sha512-B6zLTxxaOFP4WZm6DrvgRk8kLFYWNhQ5TrHMC0l5WtkMXhU5UbnvWoTfeEwqOruUSlNMhVLfYak7REX6oC5Yfw==}
dev: true
/emittery/0.7.2:
@ -1477,8 +1476,8 @@ packages:
dependencies:
is-arrayish: 0.2.1
/esbuild/0.11.12:
resolution: {integrity: sha512-c8cso/1RwVj+fbDvLtUgSG4ZJQ0y9Zdrl6Ot/GAjyy4pdMCHaFnDMts5gqFnWRPLajWtEnI+3hlET4R9fVoZng==}
/esbuild/0.11.14:
resolution: {integrity: sha512-ejheEPkqhq5y0LM9rG9e+3yDihPtqeeE4NZmG7VQiSGJ3CjO4HvPOHmhhttSksfSztjLAGo2+0/zSIvlqj4JOQ==}
hasBin: true
requiresBuild: true
dev: false
@ -2027,8 +2026,8 @@ packages:
ci-info: 2.0.0
dev: true
/is-core-module/2.2.0:
resolution: {integrity: sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==}
/is-core-module/2.3.0:
resolution: {integrity: sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==}
dependencies:
has: 1.0.3
dev: true
@ -2186,7 +2185,7 @@ packages:
resolution: {integrity: sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==}
engines: {node: '>=8'}
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@istanbuljs/schema': 0.1.3
istanbul-lib-coverage: 3.0.0
semver: 6.3.0
@ -2239,7 +2238,7 @@ packages:
'@jest/core': 26.6.3
'@jest/test-result': 26.6.2
'@jest/types': 26.6.2
chalk: 4.1.0
chalk: 4.1.1
exit: 0.1.2
graceful-fs: 4.2.6
import-local: 3.0.2
@ -2266,11 +2265,11 @@ packages:
ts-node:
optional: true
dependencies:
'@babel/core': 7.13.15
'@babel/core': 7.13.16
'@jest/test-sequencer': 26.6.3
'@jest/types': 26.6.2
babel-jest: 26.6.3_@babel+core@7.13.15
chalk: 4.1.0
babel-jest: 26.6.3_@babel+core@7.13.16
chalk: 4.1.1
deepmerge: 4.2.2
glob: 7.1.6
graceful-fs: 4.2.6
@ -2295,7 +2294,7 @@ packages:
resolution: {integrity: sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==}
engines: {node: '>= 10.14.2'}
dependencies:
chalk: 4.1.0
chalk: 4.1.1
diff-sequences: 26.6.2
jest-get-type: 26.3.0
pretty-format: 26.6.2
@ -2313,7 +2312,7 @@ packages:
engines: {node: '>= 10.14.2'}
dependencies:
'@jest/types': 26.6.2
chalk: 4.1.0
chalk: 4.1.1
jest-get-type: 26.3.0
jest-util: 26.6.2
pretty-format: 26.6.2
@ -2378,13 +2377,13 @@ packages:
resolution: {integrity: sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==}
engines: {node: '>= 10.14.2'}
dependencies:
'@babel/traverse': 7.13.15
'@babel/traverse': 7.13.17
'@jest/environment': 26.6.2
'@jest/source-map': 26.6.2
'@jest/test-result': 26.6.2
'@jest/types': 26.6.2
'@types/node': 14.14.41
chalk: 4.1.0
chalk: 4.1.1
co: 4.6.0
expect: 26.6.2
is-generator-fn: 2.1.0
@ -2416,7 +2415,7 @@ packages:
resolution: {integrity: sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==}
engines: {node: '>= 10.14.2'}
dependencies:
chalk: 4.1.0
chalk: 4.1.1
jest-diff: 26.6.2
jest-get-type: 26.3.0
pretty-format: 26.6.2
@ -2429,7 +2428,7 @@ packages:
'@babel/code-frame': 7.12.13
'@jest/types': 26.6.2
'@types/stack-utils': 2.0.0
chalk: 4.1.0
chalk: 4.1.1
graceful-fs: 4.2.6
micromatch: 4.0.4
pretty-format: 26.6.2
@ -2476,7 +2475,7 @@ packages:
engines: {node: '>= 10.14.2'}
dependencies:
'@jest/types': 26.6.2
chalk: 4.1.0
chalk: 4.1.1
graceful-fs: 4.2.6
jest-pnp-resolver: 1.2.2_jest-resolve@26.6.2
jest-util: 26.6.2
@ -2494,7 +2493,7 @@ packages:
'@jest/test-result': 26.6.2
'@jest/types': 26.6.2
'@types/node': 14.14.41
chalk: 4.1.0
chalk: 4.1.1
emittery: 0.7.2
exit: 0.1.2
graceful-fs: 4.2.6
@ -2531,7 +2530,7 @@ packages:
'@jest/transform': 26.6.2
'@jest/types': 26.6.2
'@types/yargs': 15.0.13
chalk: 4.1.0
chalk: 4.1.1
cjs-module-lexer: 0.6.0
collect-v8-coverage: 1.0.1
exit: 0.1.2
@ -2569,11 +2568,11 @@ packages:
resolution: {integrity: sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==}
engines: {node: '>= 10.14.2'}
dependencies:
'@babel/types': 7.13.14
'@babel/types': 7.13.17
'@jest/types': 26.6.2
'@types/babel__traverse': 7.11.1
'@types/prettier': 2.2.3
chalk: 4.1.0
chalk: 4.1.1
expect: 26.6.2
graceful-fs: 4.2.6
jest-diff: 26.6.2
@ -2593,7 +2592,7 @@ packages:
dependencies:
'@jest/types': 26.6.2
'@types/node': 14.14.41
chalk: 4.1.0
chalk: 4.1.1
graceful-fs: 4.2.6
is-ci: 2.0.0
micromatch: 4.0.4
@ -2605,7 +2604,7 @@ packages:
dependencies:
'@jest/types': 26.6.2
camelcase: 6.2.0
chalk: 4.1.0
chalk: 4.1.1
jest-get-type: 26.3.0
leven: 3.1.0
pretty-format: 26.6.2
@ -2619,7 +2618,7 @@ packages:
'@jest/types': 26.6.2
'@types/node': 14.14.41
ansi-escapes: 4.3.2
chalk: 4.1.0
chalk: 4.1.1
jest-util: 26.6.2
string-length: 4.0.2
dev: true
@ -2683,7 +2682,7 @@ packages:
optional: true
dependencies:
abab: 2.0.5
acorn: 8.1.1
acorn: 8.2.1
acorn-globals: 6.0.0
cssom: 0.4.4
cssstyle: 2.3.0
@ -2706,7 +2705,7 @@ packages:
whatwg-encoding: 1.0.5
whatwg-mimetype: 2.3.0
whatwg-url: 8.5.0
ws: 7.4.4
ws: 7.4.5
xml-name-validator: 3.0.0
transitivePeerDependencies:
- bufferutil
@ -3219,17 +3218,17 @@ packages:
import-cwd: 3.0.0
dev: false
/postcss-simple-vars/6.0.3_postcss@8.2.10:
/postcss-simple-vars/6.0.3_postcss@8.2.12:
resolution: {integrity: sha512-fkNn4Zio8vN4vIig9IFdb8lVlxWnYR769RgvxCM6YWlFKie/nQaOcaMMMFz/s4gsfHW4/5bJW+i57zD67mQU7g==}
engines: {node: '>=10.0'}
peerDependencies:
postcss: ^8.2.1
dependencies:
postcss: 8.2.10
postcss: 8.2.12
dev: true
/postcss/8.2.10:
resolution: {integrity: sha512-b/h7CPV7QEdrqIxtAf2j31U5ef05uBDuvoXv6L51Q4rcS1jdlXAVKJv+atCFdUXYl9dyTHGyoMzIepwowRJjFw==}
/postcss/8.2.12:
resolution: {integrity: sha512-BJnGT5+0q2tzvs6oQfnY2NpEJ7rIXNfBnZtQOKCIsweeWXBXeDd5k31UgTdS3d/c02ouspufn37mTaHWkJyzMQ==}
engines: {node: ^10 || ^12 || >=14}
dependencies:
colorette: 1.2.2
@ -3460,7 +3459,7 @@ packages:
/resolve/1.20.0:
resolution: {integrity: sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==}
dependencies:
is-core-module: 2.2.0
is-core-module: 2.3.0
path-parse: 1.0.6
dev: true
@ -4250,8 +4249,8 @@ packages:
typedarray-to-buffer: 3.1.5
dev: true
/ws/7.4.4:
resolution: {integrity: sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==}
/ws/7.4.5:
resolution: {integrity: sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==}
engines: {node: '>=8.3.0'}
peerDependencies:
bufferutil: ^4.0.1

5
src/cli-default.ts Normal file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env node
import { handleError } from './errors'
import { main } from './cli-main'
main().catch(handleError)

View File

@ -1,15 +1,13 @@
#!/usr/bin/env node
import { readFileSync } from 'fs'
import { join } from 'path'
import { cac } from 'cac'
import { handleError } from './errors'
import { Format, Options } from './'
import { Format, Options } from '.'
function ensureArray(input: string): string[] {
return Array.isArray(input) ? input : input.split(',')
}
async function main() {
export async function main(options: Options = {}) {
const cli = cac('tsup')
cli
@ -70,10 +68,10 @@ async function main() {
'Supress non-error logs (excluding "onSuccess" process output)'
)
.action(async (files: string[], flags) => {
const { build } = await import('./')
const options: Options = {
const { build } = await import('.')
Object.assign(options, {
...flags,
}
})
if (files.length > 0) {
options.entryPoints = files
}
@ -105,5 +103,3 @@ async function main() {
cli.parse(process.argv, { run: false })
await cli.runMatchedCommand()
}
main().catch(handleError)

7
src/cli-node.ts Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env node
import { handleError } from './errors'
import { main } from './cli-main'
main({
skipNodeModulesBundle: true,
}).catch(handleError)

View File

@ -1,10 +1,26 @@
import { Plugin } from 'esbuild'
export const externalPlugin = (patterns?: (string | RegExp)[]): Plugin => {
// Must not start with "/" or "./" or "../"
const NON_NODE_MODULE_RE = /^[^.\/]|^\.[^.\/]|^\.\.[^\/]/
export const externalPlugin = ({
patterns,
skipNodeModulesBundle,
}: {
patterns?: (string | RegExp)[]
skipNodeModulesBundle?: boolean
}): Plugin => {
return {
name: `external`,
setup(build) {
if (skipNodeModulesBundle) {
build.onResolve({ filter: NON_NODE_MODULE_RE }, (args) => ({
path: args.path,
external: true,
}))
}
if (!patterns || patterns.length === 0) return
build.onResolve({ filter: /.*/ }, (args) => {

View File

@ -100,6 +100,10 @@ export type Options = {
* Supress non-error logs (excluding "onSuccess" process output)
*/
silent?: boolean
/**
* Skip node_modules bundling
*/
skipNodeModulesBundle?: boolean
}
export type NormalizedOptions = MarkRequired<
@ -172,7 +176,10 @@ export async function runEsbuild(
plugins: [
// esbuild's `external` option doesn't support RegExp
// So here we use a custom plugin to implement it
externalPlugin(external),
externalPlugin({
patterns: external,
skipNodeModulesBundle: options.skipNodeModulesBundle,
}),
postcssPlugin({ css }),
sveltePlugin({ css }),
...(options.esbuildPlugins || []),

View File

@ -8,7 +8,7 @@ import { debouncePromise } from '../src/utils'
jest.setTimeout(60000)
const cacheDir = resolve(__dirname, '.cache')
const bin = resolve(__dirname, '../dist/cli.js')
const bin = resolve(__dirname, '../dist/cli-default.js')
beforeAll(async () => {
await fs.remove(cacheDir)