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

feat: ES Module #411

Open
wants to merge 20 commits into
base: beta
Choose a base branch
from
Open

feat: ES Module #411

wants to merge 20 commits into from

Conversation

babblebey
Copy link
Member

@babblebey babblebey commented Oct 8, 2024

This PR converts the plugin to ESM only.

Related to semantic-release/semantic-release#2133

BREAKING CHANGE: @semantic-release/exec is now a native ES Module. It has named exports for each plugin hook (verifyConditions, analyzeCommits, verifyRelease, generateNotes, prepare, publish, addChannel, success, fail)

BREAKING CHANGE: the minimum required version of semantic-release to use @semantic-release/exec is now v24.1.0; the warn logger method/function is now available to use in plugin

Other Changes Made

  • Replaced xo with prettier with default configuration; following newly established convention
  • Replaced nyc with c8 for code coverage
  • Replaced lodash with lodash-es for proper esm support

Related Issues/PR

Closes #283
Closes #406
Closes #407

Screencast

screencast-github_com-2024_10_17-20_48_14.mp4

@babblebey babblebey changed the base branch from beta to master October 8, 2024 19:51
Update the Node.js versions in the test workflow to include 20.8.1, 20, and 21. This ensures compatibility with different versions of Node.js during testing.

Also, replace the deprecated "npm ci" command with "npm clean-install" to install dependencies.

Additionally, add a step to run "npm audit signatures" to check for any security issues in the dependencies.

Finally, include a step to scan the lockfile for security issues using "lockfile-lint".
@babblebey babblebey changed the base branch from master to beta October 9, 2024 17:36
@babblebey babblebey marked this pull request as ready for review October 17, 2024 20:06
Copy link
Member

@travi travi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great! thanks so much for taking this step!

just a few minor details that i spotted that i think could use tweaks, but excited to get this merged :)

- 16
- 20.8.1
- 20
- 21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 21
- 22

since v21 is EOL at this point and v22 becomes LTS before the end of october

Comment on lines +46 to +48
# https://github.com/lirantal/lockfile-lint#readme
- name: Scan lockfile for security issues
run: npx lockfile-lint --path package-lock.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the other repos with more recent changes, we've moved this into the scripts in package.json that end up getting called from npm t

this changeset is a good reference for the group of changes that are related to what i'm highlighting here. i would also be ok with these changes being a follow-up to this PR, but the changes you are making in this PR set us up for those changes to make sense whichever way you decide is best

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after a little more thought, i think it may make sense to hold off on changing this for a follow-up instead of adding into this one. still open to either option, but i think splitting from this isolates things a little better

Comment on lines +25 to +26
"c8": "^10.1.2",
"semantic-release": "^24.1.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super minor since renovate will pin these after they are merged anyway, but more for awareness, our typical practice is to pin dev-deps to exact versions and leave prod-deps as ranges

"parse-json": "^5.0.0"
"lodash-es": "^4.17.21",
"parse-json": "^5.0.0",
"prettier": "^3.3.3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier should be under dev-deps

],
"all": true
},
"exports": "./index.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know main isnt strictly needed after switching to exports, but i've hit enough snags with removing it from other projects, that i think it is still best to keep around for backward compatibility for now. lets have both exports and main set to the same value

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

Successfully merging this pull request may close these issues.

2 participants