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: Migrate to v9 #13

Closed
wants to merge 13 commits into from
Closed

feat: Migrate to v9 #13

wants to merge 13 commits into from

Conversation

kevintyj
Copy link
Owner

@kevintyj kevintyj commented Jun 23, 2024

Migrates commitment to v9 (ESM support migration)

BREAKING!: Drops CJS support (will try to add CJS support again later)

Copy link

codecov bot commented Jun 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.83%. Comparing base (59797d1) to head (1ad28ed).

Additional details and impacted files
@@             Coverage Diff             @@
##              main      #13      +/-   ##
===========================================
- Coverage   100.00%   98.83%   -1.17%     
===========================================
  Files            4        4              
  Lines          123      172      +49     
  Branches        23       28       +5     
===========================================
+ Hits           123      170      +47     
- Misses           0        2       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kevintyj kevintyj force-pushed the feat/cjs branch 2 times, most recently from 5684442 to a633b2d Compare June 23, 2024 11:26
@kevintyj kevintyj force-pushed the feat/cjs branch 14 times, most recently from 13faa99 to 6c41a76 Compare June 23, 2024 16:13
@kevintyj kevintyj changed the title feat: Force CJS using node runner feat: Migrate to v9 Jun 23, 2024
@kevintyj kevintyj marked this pull request as draft June 23, 2024 23:40
@kevintyj
Copy link
Owner Author

kevintyj commented Jun 23, 2024

Welp that was a nice try...

Edit: I may have over engineered the solution from the beginning, with all of the dependencies like ncc, cosmiconfig, v19 commitlint update, esm <-> cjs backwards compatibility, and a lot of other minor issues added a lot of unwanted complexity to the problem. The problem being why I had to be the one trying to parse the configuration file when there already are built in exported functions.

Solution:
I will be releasing a breaking change v2 which will update the commitlint version to v19 as referenced to #12 as well as adding support for descriptions as referenced here: #11. However, this will drop the support for:

  • Custom configuration file names:
    • This will be easily mitigated by the next solution offered in the section below, however, if you do really need support for custom commitlint specification file names such as my-awesome-config-file.jsx, either way you need to be setting up custom commitlint configurations on your environment (which I do not recommend you to do), you could easily just create a symlink pointing to a valid name such as commitlint.config.mjs, this action will be able to work in your workflow without any further setup.

Thats it. But to be honest, it was kind of the only feature as well... so... I came up with a compromise, which I genuinely think is a better solution:

  • ESM & CJS configuration file compatibility
    • One of the main reasons why I had to make this tool (and initially, I thought it was only me and my company using it) was because there were no solutions out there that did this without any additional configuration step. This was important to a lot of our projects rely on CJS and ESM simultaneous support in a single repository because of miscellaneous dependencies and plugins. The up coming update will add zero config support for both ESM and CJS config files for commitlint.
  • Automatic configuration detection
    • While support for custom configuration file names were dropped, I also discovered a neat little hidden gem in the commitlint repo to leverage their automatic configuration detection directly. This means that if you named your configuration files as one of the many options commitlint gives you, then this action will most likely work for you without any added configuration step at all. No inputs.
  • Other little things like actions version upgrades, etc.

I will try to implement these features in the upcoming days will start raising new PRs

@kevintyj kevintyj closed this Jun 26, 2024
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.

1 participant