Skip to content
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

refactor!: convert library to ESM #99

Merged
merged 5 commits into from
Jun 11, 2024
Merged

refactor!: convert library to ESM #99

merged 5 commits into from
Jun 11, 2024

Conversation

sheerlox
Copy link
Member

@sheerlox sheerlox commented Nov 16, 2023

Current state

Error log

$ npm run test:commitlint

> @insurgent/[email protected] test:commitlint
> commitlint --from HEAD~1 --to HEAD --verbose

/home/sherlox/workspace/INSURGENT_LAB/commitlint-config/node_modules/@commitlint/cli/lib/cli.js:123
        throw err;
        ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/sherlox/workspace/INSURGENT_LAB/commitlint-config/index.js from /home/sherlox/workspace/INSURGENT_LAB/commitlint-config/node_modules/@commitlint/resolve-extends/lib/index.js not supported.
Instead change the require of /home/sherlox/workspace/INSURGENT_LAB/commitlint-config/index.js in /home/sherlox/workspace/INSURGENT_LAB/commitlint-config/node_modules/@commitlint/resolve-extends/lib/index.js to a dynamic import() which is available in all CommonJS modules.
    at /home/sherlox/workspace/INSURGENT_LAB/commitlint-config/node_modules/@commitlint/resolve-extends/lib/index.js:48:19
    at Array.reduce (<anonymous>)
    at loadExtends (/home/sherlox/workspace/INSURGENT_LAB/commitlint-config/node_modules/@commitlint/resolve-extends/lib/index.js:45:16)
    at resolveExtends (/home/sherlox/workspace/INSURGENT_LAB/commitlint-config/node_modules/@commitlint/resolve-extends/lib/index.js:25:22)
    at load (/home/sherlox/workspace/INSURGENT_LAB/commitlint-config/node_modules/@commitlint/load/lib/load.js:42:52)
    at async main (/home/sherlox/workspace/INSURGENT_LAB/commitlint-config/node_modules/@commitlint/cli/lib/cli.js:189:20) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v20.9.0

BREAKING CHANGE: the package is now pure ESM
@sheerlox sheerlox force-pushed the refactor/migrate-to-esm branch 2 times, most recently from 9189163 to 6239f55 Compare June 11, 2024 09:36
@sheerlox sheerlox force-pushed the refactor/migrate-to-esm branch from 99910cc to 7cdc4e5 Compare June 11, 2024 10:13
@sheerlox sheerlox merged commit 5744a34 into main Jun 11, 2024
10 checks passed
@sheerlox sheerlox deleted the refactor/migrate-to-esm branch June 11, 2024 10:21
@sheerlox
Copy link
Member Author

🎉 This PR is included in version 20.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant