Repository navigation
refactor: generate the options check with schema-utils precompile - #2511
Conversation
Replace the custom `scripts/generate-schema-check.mjs` with `schema-utils precompile --minify`, which handles the `instanceof` keyword and the documentation-only keywords itself, and minifies the check from 95 KB to 29 KB.
🦋 Changeset detectedLatest commit: 6b7754f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
No actionable comments were generated in the recent review. WalkthroughThe options validator workflow now uses Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2511 +/- ##
=======================================
Coverage 96.97% 96.97%
=======================================
Files 25 25
Lines 2711 2711
=======================================
Hits 2629 2629
Misses 82 82 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
This replaces the custom
scripts/generate-schema-check.mjswithschema-utils precompile --minify. That command now ships inschema-utils4.8.5, so the repo no longer needs its own generator.lint:schemaandfix:schema(renamed fromlint:schema-check/fix:schema-check) runschema-utils precompile [--check] --minify src/options.json, as the other webpack repos do.fixruns it first.schema-utilshandlesinstanceofitself, includingBuffer,FunctionandRegExp. It also drops the documentation-only keywords. The custom generator re-implemented both of these.src/options.check.jsgoes from 95 KB to 29 KB, because the minified check leaves out the error objects a check never reports. It stays CommonJS, at the same path, and needs no runtime helper.schema-utilsis bumped to^4.8.5.ajvdevDependency is removed, since only the script used it.webpackdevDependency is bumped to^5.113.0, which the minifier needs. Theloggingsnapshots losewebpack/runtime/global, which 5.113 no longer emits for these builds.What kind of change does this PR introduce?
refactor
Did you add tests for your changes?
The existing
test/schema-check.test.jscovers the new check.npm run lintpasses, includinglint:schemaand types. The jest suite without e2e passes except twowriteToDiskEACCES tests. Those fail locally only because the tests ran as root, wherechmoddoesn't block writes.Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Nothing.
Generated by Claude Code
Summary by CodeRabbit