Skip to content

Commit b77c2d8

Browse files
build: precompile schemas with schema-utils (#22774)
* build: precompile schemas with schema-utils tooling/precompile-schemas.js now calls schema-utils' precompile with minify instead of carrying its own ajv keywords, error stripping and terser pass, so webpack's checks are built the same way as every plugin's and loader's. The checks are minified with webpack's own minifier, so the lint job links webpack like the test jobs do. Drops the ajv and commondir devDependencies. * build: keep types.d.ts as main generates it The schema-utils imports moved only with a stale local node_modules; a clean install generates the same types.d.ts as main. * build: update schema-utils to 4.8.1 4.8.1 bundles without errors or warnings, which test/cases/large/big-assets needs now that the tooling uses schema-utils precompile. * build: regenerate schema checks with main's minifier #22754 changed what webpack's minifier writes, which the checks are now minified with.
1 parent f9705a6 commit b77c2d8

50 files changed

Lines changed: 168 additions & 417 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack": patch
3+
---
4+
5+
Update schema-utils to 4.8.1.

‎.github/workflows/test.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ jobs:
6464
key: lint-tsc-${{ runner.os }}-node-${{ hashFiles('**/yarn.lock', '**/tsconfig*.json') }}
6565
restore-keys: lint-tsc-
6666

67+
# The schema checks are minified with webpack's own minifier, which
68+
# `schema-utils precompile` loads as `webpack`
69+
- run: yarn link --frozen-lockfile || true
70+
71+
- run: yarn link webpack --frozen-lockfile
72+
6773
- run: yarn lint
6874

6975
- name: Validate types using old typescript version

‎cspell.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
"Collet's",
8080
"combinators",
8181
"commithash",
82-
"commondir",
8382
"compat",
8483
"concated",
8584
"containedfile",

‎declarations.d.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ type EXPECTED_OBJECT = object;
55
declare module "*.json";
66
declare module "rimraf";
77

8-
declare module "commondir" {
9-
function commonDir(paths: string[]): string;
10-
function commonDir(basedir: string, relativePaths: string[]): string;
11-
export = commonDir;
12-
}
13-
148
declare module "color-name" {
159
const colors: { [name: string]: [number, number, number] };
1610
export = colors;

‎package.json‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"graceful-fs": "^4.2.11",
145145
"mime-db": "^1.54.0",
146146
"minimizer-webpack-plugin": "^5.13.0",
147-
"schema-utils": "^4.5.0",
147+
"schema-utils": "^4.8.1",
148148
"tapable": "^2.3.0",
149149
"watchpack": "^2.6.3",
150150
"webpack-sources": "^3.6.0"
@@ -168,14 +168,12 @@
168168
"@webref/elements": "^2.8.0",
169169
"@webref/idl": "^3.83.1",
170170
"acorn": "^8.16.0",
171-
"ajv": "^8.20.0",
172171
"assemblyscript": "^0.28.18",
173172
"babel-loader": "^10.0.0",
174173
"bundle-loader": "^0.5.6",
175174
"coffee-loader": "^5.0.0",
176175
"coffeescript": "^2.5.1",
177176
"color-name": "^2.1.1",
178-
"commondir": "^1.0.1",
179177
"core-js": "^3.47.0",
180178
"cspell": "^10.0.1",
181179
"css-loader": "^7.1.2",

‎schemas/WebpackOptions.check.js‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎schemas/plugins/BannerPlugin.check.js‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎schemas/plugins/HtmlGeneratorOptions.check.js‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)