Last 12 weeks ยท 0 commits
6 of 6 standards met
I'm no longer watching this repo. This babel plugin is pretty much done and I'm no longer using it much. If you really need something changed, then I suggest you fork it. Unfortunately, this plugin is so widely used that it would be irresponsible for me to hand over publish rights to someone I don't know and trust. So I'm basically freezing development unless someone who fits that description wants to take it over. I might be willing to accept a PR to keep this project up-to-date for compatibility reasons with babel. But in general, there's no more maintenance that will happen on this package. Thanks for understanding.
What: cosmiconfig is a massive package which recently got a small alternative without dependencies lilconfig. https://github.com/antonk52/lilconfig https://packagephobia.com/result?p=cosmiconfig https://packagephobia.com/result?p=lilconfig Though still a big part of cosmiconfig is package. https://packagephobia.com/result?p=yaml This package is important piece of relay and emotion. Would be good to make it as small as possible. Why: Node modules are bloated with large dependencies. I'm trying to help with this. How: Just switch to alternative. Checklist: [ ] Documentation [x] Tests [x] Ready to be merged
Summary As discussed, this grew from the original lilconfig migration into a full modernization pass. Happy to break it up if you'd prefer smaller pieces, but everything here felt like it belonged together. Breaking change: This package is now ESM-only and requires Node.js >= 22. What changed Converted from CJS to ESM (/, ) Replaced cosmiconfig with lilconfig + yaml for config loading Replaced kcd-scripts with ESLint 10 (flat config), Prettier 3, Vitest 4, Husky 9, lint-staged Added config file variants so users with projects can still write CJS configs Renamed all CJS test fixtures and mock modules from to Migrated tests from Jest to Vitest โ 34 tests passing, fixed some assertions that weren't actually testing what they looked like they were testing Modernized CI: Node 22/24 matrix, latest GitHub Actions, codecov v5 coverage, semantic-release v25 Updated all docs with ESM examples and the Node 22+ requirement Dropped (replaced with ), (unused), and old babel-es2015 plugin Why Node 22? Per your suggestion โ Babel 7 loads plugins via , and Node 22.12+ supports natively, so going ESM-only doesn't require a build step. Notes kept at v10 for now โ v11/v12 changed how is resolved in a way that may conflict with fixture paths. Worth upgrading separately. kept at ^1.x โ still needed for custom extension resolution (, , ) Test plan [x] passes (lint + format + 34/34 tests) [x] generates v8 coverage [x] ESM import and CJS require both work on Node 22+ [x] CI tests against Node 22 and 24 Summary by CodeRabbit Breaking Changes ESM-only release: requires Node.js โฅ 22 and updates public exports (modern ESM-style API). New Features Config discovery now supports YAML and .cjs variants. Testing moved to Vitest; pre-commit lint/format hooks added. Documentation Examples and guides updated to ESM import/export and lilconfig guidance. Links updated to point to main branch. Chores** Modernized tooling, scripts, linting/formatting and CI workflows.
As per the recent snyk reports the yaml package has a security vulnerability. Snyk issue: https://security.snyk.io/vuln/SNYK-JS-YAML-5458867 But this is fixed in latest version of yaml. For the moment babel-plugin-macro library is dependant on "cosmiconfig@7.0.0" which has another dependency to "yaml@1.10.0". But the newer version of "cosmiconfig" doesn't use "yaml" as a dependency so if we can bump up "cosmiconfig" to its latest it will be helpful. I am not sure that how much of vulnerable features of "yaml" is used in "cosmoconfig" and how it can affect this package, just creating this issue for the library to evaluate this issue and fix this if its possible.
Repository: kentcdodds/babel-plugin-macros. Description: ๐ฃ Allows you to build simple compile-time libraries Stars: 2633, Forks: 138. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Homepage: https://npm.im/babel-plugin-macros Topics: babel, babel-macros, babel-plugin. Latest release: v3.1.0 (5y ago). Open PRs: 3, open issues: 9. Last activity: 3y ago. Community health: 85%. Top contributors: allcontributors[bot], tricoder42, conartist6, kentcdodds, Andarist, InvictusMB, sergeysova, jiiinCho, stevemao, MichaelDeBoey and others.