Description
Steps to Reproduce
I have some custom scripting, which accesses one of the @commitlint/config-conventional
rules to do something with.
It gets this by doing:
import commitLintConfig from '@commitlint/config-conventional';
This works fine in v18.6.0. Dependabot recently opened a PR to upgrade to latest and we started hitting this issue.
Current Behavior
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/drewb/workspace/alloy-react/node_modules/@commitlint/config-conventional/wrapper.mjs' imported from /Users/drewb/workspace/alloy-react/scripts/verifyCommits.js
Did you mean to import @commitlint/config-conventional/lib/index.js?
Expected Behavior
Config can be imported and used
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
Include ./wrapper.mjs
in the files
property of the package.json
Context
This looks like it was introduced in #3911, which added wrapper.mjs
, however it is not being included in the built/published package.
https://unpkg.com/browse/@commitlint/config-conventional@18.6.2/
commitlint --version
@commitlint/cli@18.6.1 @commitlint/config-conventional@18.6.2
git --version
git version 2.39.2 (Apple Git-143)
node --version
v20.9.0