weiran-zsd / dts-cli

Zero-config CLI for TypeScript package development
MIT License
442 stars 23 forks source link

Missing dependency babel-jest #197

Closed dcastil closed 1 year ago

dcastil commented 1 year ago

Thanks for all your work on dts-cli, really appreciate it! I got into an issue while upgrading to v2, it seems like babel-jest is missing in the package dependencies.

Current Behavior

After upgrading to fts-cli@2.0.2 and running dts test, I get the error

Error: Cannot find module 'babel-jest'
Require stack:
- /home/runner/work/tailwind-merge/tailwind-merge/node_modules/dts-cli/dist/utils.js
- /home/runner/work/tailwind-merge/tailwind-merge/node_modules/dts-cli/dist/constants.js
- /home/runner/work/tailwind-merge/tailwind-merge/node_modules/dts-cli/dist/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
    at Function.resolve (node:internal/modules/cjs/helpers:[11](https://github.com/dcastil/tailwind-merge/actions/runs/4859688240/jobs/8662615486#step:7:12)4:19)
    at resolve (/home/runner/work/tailwind-merge/tailwind-merge/node_modules/dts-cli/dist/utils.js:53:20)
    at createJestConfig (/home/runner/work/tailwind-merge/tailwind-merge/node_modules/dts-cli/dist/createJestConfig.js:9:47)
    at /home/runner/work/tailwind-merge/tailwind-merge/node_modules/dts-cli/dist/index.js:452:94
    at o.parse (/home/runner/work/tailwind-merge/tailwind-merge/node_modules/sade/lib/index.js:1:3402)
    at Object.<anonymous> (/home/runner/work/tailwind-merge/tailwind-merge/node_modules/dts-cli/dist/index.js:540:6)
    at Module._compile (node:internal/modules/cjs/loader:1196:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:[12](https://github.com/dcastil/tailwind-merge/actions/runs/4859688240/jobs/8662615486#step:7:13)50:10)
    at Module.load (node:internal/modules/cjs/loader:1074:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/tailwind-merge/tailwind-merge/node_modules/dts-cli/dist/utils.js',
    '/home/runner/work/tailwind-merge/tailwind-merge/node_modules/dts-cli/dist/constants.js',
    '/home/runner/work/tailwind-merge/tailwind-merge/node_modules/dts-cli/dist/index.js'
  ]
}

Expected behavior

No error

Suggested solution(s)

I think babel-jest needs to be included as a dependency or peerDependency of dts-cli.

Additional context

Happened in PR https://github.com/dcastil/tailwind-merge/pull/223, in workflow run https://github.com/dcastil/tailwind-merge/actions/runs/4859688240/jobs/8662615486.

Your environment

  System:
    OS: macOS 13.3.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 2.51 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.14.2 - ~/.asdf/installs/nodejs/18.14.2/bin/node
    Yarn: 1.22.19 - ~/.npm-global/bin/yarn
    npm: 9.5.0 - ~/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Chrome: 112.0.5615.137
    Chrome Canary: 115.0.5744.0
    Firefox: 110.0.1
    Safari: 16.4
  npmPackages:
    dts-cli: ^2.0.2 => 2.0.2 
    typescript: ^5.0.4 => 5.0.4