Repository navigation
refactor: generate the options check with schema-utils precompile - #5809
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 174 KB to 54 KB.
🦋 Changeset detectedLatest commit: cc31692 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 schema lint and fix scripts now use minified schema-utils precompilation. The standalone Ajv generator and the Ajv development dependency are removed. The generated validator and its declarations are updated. String minimum-length validation now counts Unicode code points. A patch changeset documents the precompilation command. Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5809 +/- ##
=======================================
Coverage 95.91% 95.91%
=======================================
Files 6 6
Lines 5707 5709 +2
=======================================
+ Hits 5474 5476 +2
Misses 233 233 ☔ 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 lib/options.json, as the other webpack repos do.fixruns it first.schema-utilshandlesinstanceof(Buffer,Function) itself and drops the documentation-onlycli/linkkeywords. The custom generator re-implemented both."type": "module". It keeps the same path and default export, and imports no runtime helper. It goes from 174 KB to 54 KB.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.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:schema, types and spelling.test/*.test.jspasses in full (376 tests).test/serverpasses apart from the two'::'/'::1'host tests. Those fail locally withEAFNOSUPPORTonly because the container has no IPv6.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