Skip to content

wrapper.mjs is not included in published @commitlint/config-conventional package #3958

Closed
@drewbrend

Description

@drewbrend

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions