From b6609a4f6b47db143dd8204a4de67ca36af2fefd Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 4 Aug 2021 15:55:58 +0200 Subject: [PATCH] add `experiments.buildHttp` allows to build remote resources stores remote resources in a lockfile --- .eslintrc.js | 2 +- .gitattributes | 1 + cspell.json | 8 +- declarations/WebpackOptions.d.ts | 25 + .../plugins/schemes/HttpUriPlugin.d.ts | 29 + examples/build-http/README.md | 81 ++ examples/build-http/build.js | 2 + examples/build-http/example.js | 6 + examples/build-http/template.md | 25 + examples/build-http/webpack.config.js | 9 + examples/build-http/webpack.lock | 26 + .../p-map_9a051b191b6af4b352ba | 3 + ...15_aggregate-error_89888e7f244a2b227be9.js | 3 + ...es2015_clean-stack_512fad7a42bd85149e06.js | 3 + ...cape-string-regexp_22382d8d9f837184e161.js | 1 + ...2015_indent-string_6103e1cfb4ff573a03ed.js | 1 + ...3.0_es2015_browser_92a2351b7a3273e492dd.js | 2 + ...5.1.0_es2015_p-map_2e9e4310942f189ff123.js | 1 + ...ed_aggregate-error_779b7ff863afd770cb5e.js | 54 + ...imized_clean-stack_94a61d495a23573d704d.js | 31 + ...cape-string-regexp_c6f22ceb2f8b90740447.js | 7 + ...ized_indent-string_dc30873279e41ccf7b43.js | 24 + ...ts_optimized_p-map_2f29b65de28b7340c85e.js | 79 ++ ...aggregate-error_4.0_3f9c2db11addffc62c35.0 | 48 + ...npm_aggregate-error_4_2480c41192a10211937a | 3 + ...npm_clean-stack_4.1_9c285d25bf0385cc2256.0 | 52 + .../npm_clean-stack_4_3f532a3a3a391ea3d5d5 | 3 + ...e-string-regexp_5.0_1a21bfa9008fa676b2a6.0 | 15 + ...m_indent-string_5.0_d9938d6e86a9a0febbeb.0 | 42 + .../npm_indent-string_5_c2208743332044a73298 | 1 + ....0-beta_2b28d9456b8c8ef4d6fb.8_nodelibs_os | 97 ++ ...pm_core_2_nodelibs_os_cf88df9df31061bcb921 | 2 + .../npm_p-map_5.1_bd0dfdcf7f62202ed19e.0 | 103 ++ .../https_jspm.dev/p-map_6fa685460a5a6deb568e | 3 + lib/Compilation.js | 1 + lib/Module.js | 1 + lib/MultiCompiler.js | 2 - lib/NormalModule.js | 49 +- lib/NormalModuleFactory.js | 200 ++-- lib/WebpackOptionsApply.js | 8 + lib/asset/AssetModulesPlugin.js | 1 - lib/config/defaults.js | 31 +- lib/config/normalization.js | 7 +- lib/index.js | 3 - lib/schemes/HttpUriPlugin.js | 963 +++++++++++++++++- lib/schemes/HttpsUriPlugin.js | 63 -- lib/serialization/BinaryMiddleware.js | 2 - schemas/WebpackOptions.check.js | 2 +- schemas/WebpackOptions.json | 43 + .../plugins/schemes/HttpUriPlugin.check.d.ts | 7 + .../plugins/schemes/HttpUriPlugin.check.js | 6 + schemas/plugins/schemes/HttpUriPlugin.json | 42 + test/Defaults.unittest.js | 5 + test/__snapshots__/Cli.test.js.snap | 74 ++ .../http-url/dev-defaults.webpack.lock | 16 + .../asset_46e6c8f1b2a5b24fb643.txt | 1 + .../fallback_8ab931cdbc2812bdc302.js | 1 + .../folder_dependency_ba99384fb6c83b67f435.js | 2 + ...er_sub-dependency2_fe244ae613f6967e2f8b.js | 1 + ...der_sub-dependency_f335316192eeeb416b57.js | 1 + .../index_cache_071c12a46730e2dedd60.css | 1 + .../index_query_004fef5280e02f70d9a7.css | 1 + .../redirect_06486fd663ea9c13ee91.js | 1 + .../resolve_e754563143efbab1c458.js | 1 + ...in_CODE_OF_CONDUCT_134f75ac3260537b8472.md | 1 + .../asset-modules/http-url/errors.js | 18 + .../http-url/errors.webpack.lock | 13 + .../fallback_8ab931cdbc2812bdc302.js | 1 + .../index_f3181eddde77a03ff311.css | 1 + .../index_query_004fef5280e02f70d9a7.css | 1 + .../redirect_06486fd663ea9c13ee91.js | 1 + .../resolve_e754563143efbab1c458.js | 1 + ...in_CODE_OF_CONDUCT_134f75ac3260537b8472.md | 1 + .../http-url/frozen-verify.webpack.lock | 16 + .../asset_46e6c8f1b2a5b24fb643.txt | 1 + .../fallback_8ab931cdbc2812bdc302.js | 1 + .../folder_dependency_ba99384fb6c83b67f435.js | 2 + ...er_sub-dependency2_fe244ae613f6967e2f8b.js | 1 + ...der_sub-dependency_f335316192eeeb416b57.js | 1 + .../index_cache_071c12a46730e2dedd60.css | 1 + .../index_query_004fef5280e02f70d9a7.css | 1 + .../redirect_06486fd663ea9c13ee91.js | 1 + .../resolve_e754563143efbab1c458.js | 1 + ...in_CODE_OF_CONDUCT_134f75ac3260537b8472.md | 1 + .../asset-modules/http-url/index.errors.js | 32 + .../asset-modules/http-url/index.js | 23 + .../loaders/md-loader.js | 0 .../http-url/no-cache.webpack.lock | 16 + .../http-url/node_modules/fallback-package.js | 1 + .../http-url/prod-defaults.webpack.lock | 16 + .../asset_46e6c8f1b2a5b24fb643.txt | 1 + .../fallback_8ab931cdbc2812bdc302.js | 1 + .../folder_dependency_ba99384fb6c83b67f435.js | 2 + ...er_sub-dependency2_fe244ae613f6967e2f8b.js | 1 + ...der_sub-dependency_f335316192eeeb416b57.js | 1 + .../index_cache_071c12a46730e2dedd60.css | 1 + .../index_query_004fef5280e02f70d9a7.css | 1 + .../redirect_06486fd663ea9c13ee91.js | 1 + .../resolve_e754563143efbab1c458.js | 1 + ...in_CODE_OF_CONDUCT_134f75ac3260537b8472.md | 1 + .../asset-modules/http-url/server/asset.txt | 1 + .../asset-modules/http-url/server/fallback.js | 1 + .../http-url/server/folder/dependency.js | 2 + .../http-url/server/folder/sub-dependency.js | 1 + .../http-url/server/folder/sub-dependency2.js | 1 + .../asset-modules/http-url/server/index.js | 78 +- .../asset-modules/http-url/server/redirect.js | 1 + .../asset-modules/http-url/server/resolve.js | 1 + .../asset-modules/http-url/webpack.config.js | 75 +- .../asset-modules/https-url/index.js | 5 - .../asset-modules/https-url/webpack.config.js | 19 - types.d.ts | 61 +- 112 files changed, 2478 insertions(+), 260 deletions(-) create mode 100644 declarations/plugins/schemes/HttpUriPlugin.d.ts create mode 100644 examples/build-http/README.md create mode 100644 examples/build-http/build.js create mode 100644 examples/build-http/example.js create mode 100644 examples/build-http/template.md create mode 100644 examples/build-http/webpack.config.js create mode 100644 examples/build-http/webpack.lock create mode 100644 examples/build-http/webpack.lock.data/https_cdn.esm.sh/p-map_9a051b191b6af4b352ba create mode 100644 examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_aggregate-error_4.0.0_es2015_aggregate-error_89888e7f244a2b227be9.js create mode 100644 examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_clean-stack_4.1.0_es2015_clean-stack_512fad7a42bd85149e06.js create mode 100644 examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_escape-string-regexp_5.0.0_es2015_escape-string-regexp_22382d8d9f837184e161.js create mode 100644 examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_indent-string_5.0.0_es2015_indent-string_6103e1cfb4ff573a03ed.js create mode 100644 examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_os-browserify_0.3.0_es2015_browser_92a2351b7a3273e492dd.js create mode 100644 examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_p-map_5.1.0_es2015_p-map_2e9e4310942f189ff123.js create mode 100644 examples/build-http/webpack.lock.data/https_cdn.skypack.dev/aggregate-error_v4.0.0-rCH8s5R9g4kQQ807o58j_dist_es2020_mode_imports_optimized_aggregate-error_779b7ff863afd770cb5e.js create mode 100644 examples/build-http/webpack.lock.data/https_cdn.skypack.dev/clean-stack_v4.1.0-DgWUKXHVzThBBZtsHXhC_dist_es2020_mode_imports_optimized_clean-stack_94a61d495a23573d704d.js create mode 100644 examples/build-http/webpack.lock.data/https_cdn.skypack.dev/escape-string-regexp_v5.0.0-SUDdAhYOdAgXIYndxZss_dist_es2020_mode_imports_optimized_escape-string-regexp_c6f22ceb2f8b90740447.js create mode 100644 examples/build-http/webpack.lock.data/https_cdn.skypack.dev/indent-string_v5.0.0-VgKPSgi4hUX5NbF4n3aC_dist_es2020_mode_imports_optimized_indent-string_dc30873279e41ccf7b43.js create mode 100644 examples/build-http/webpack.lock.data/https_cdn.skypack.dev/p-map_v5.1.0-7ixXvZxXPKKt9unR9LT0_dist_es2020_mode_imports_optimized_p-map_2f29b65de28b7340c85e.js create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/npm_aggregate-error_4.0_3f9c2db11addffc62c35.0 create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/npm_aggregate-error_4_2480c41192a10211937a create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/npm_clean-stack_4.1_9c285d25bf0385cc2256.0 create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/npm_clean-stack_4_3f532a3a3a391ea3d5d5 create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/npm_escape-string-regexp_5.0_1a21bfa9008fa676b2a6.0 create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/npm_indent-string_5.0_d9938d6e86a9a0febbeb.0 create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/npm_indent-string_5_c2208743332044a73298 create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2.0.0-beta_2b28d9456b8c8ef4d6fb.8_nodelibs_os create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2_nodelibs_os_cf88df9df31061bcb921 create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/npm_p-map_5.1_bd0dfdcf7f62202ed19e.0 create mode 100644 examples/build-http/webpack.lock.data/https_jspm.dev/p-map_6fa685460a5a6deb568e delete mode 100644 lib/schemes/HttpsUriPlugin.js create mode 100644 schemas/plugins/schemes/HttpUriPlugin.check.d.ts create mode 100644 schemas/plugins/schemes/HttpUriPlugin.check.js create mode 100644 schemas/plugins/schemes/HttpUriPlugin.json create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js create mode 100644 test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md create mode 100644 test/configCases/asset-modules/http-url/errors.js create mode 100644 test/configCases/asset-modules/http-url/errors.webpack.lock create mode 100644 test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js create mode 100644 test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/index_f3181eddde77a03ff311.css create mode 100644 test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css create mode 100644 test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js create mode 100644 test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js create mode 100644 test/configCases/asset-modules/http-url/errors.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js create mode 100644 test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md create mode 100644 test/configCases/asset-modules/http-url/index.errors.js rename test/configCases/asset-modules/{https-url => http-url}/loaders/md-loader.js (100%) create mode 100644 test/configCases/asset-modules/http-url/no-cache.webpack.lock create mode 100644 test/configCases/asset-modules/http-url/node_modules/fallback-package.js create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js create mode 100644 test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md create mode 100644 test/configCases/asset-modules/http-url/server/asset.txt create mode 100644 test/configCases/asset-modules/http-url/server/fallback.js create mode 100644 test/configCases/asset-modules/http-url/server/folder/dependency.js create mode 100644 test/configCases/asset-modules/http-url/server/folder/sub-dependency.js create mode 100644 test/configCases/asset-modules/http-url/server/folder/sub-dependency2.js create mode 100644 test/configCases/asset-modules/http-url/server/redirect.js create mode 100644 test/configCases/asset-modules/http-url/server/resolve.js delete mode 100644 test/configCases/asset-modules/https-url/index.js delete mode 100644 test/configCases/asset-modules/https-url/webpack.config.js diff --git a/.eslintrc.js b/.eslintrc.js index 28d47e83d..0ea462631 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,7 +25,7 @@ module.exports = { "no-process-exit": "warn", "no-use-before-define": "off", "no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }], - "no-loop-func": "warn", + "no-loop-func": "off", "node/no-missing-require": ["error", { allowModules: ["webpack"] }], "jsdoc/check-indentation": "error", "jsdoc/check-param-names": "error", diff --git a/.gitattributes b/.gitattributes index 46ada865c..523549285 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,4 @@ test/statsCases/** eol=lf examples/* eol=lf bin/* eol=lf *.svg eol=lf +**/*webpack.lock.data/** -text diff --git a/cspell.json b/cspell.json index b9a68cb9d..ddccec492 100644 --- a/cspell.json +++ b/cspell.json @@ -186,6 +186,7 @@ "redeclaration", "kaios", "parallelism", + "gitattributes", "webassemblyjs", "fsevents", @@ -201,6 +202,7 @@ "atlaskit", "xxhashjs", "systemjs", + "skypack", "sokra", "Koppers", @@ -228,5 +230,9 @@ "pnpm" ], "ignoreRegExpList": ["/Author.+/", "/data:.*/", "/\"mappings\":\".+\"/"], - "ignorePaths": ["**/dist/**", "examples/**/README.md"] + "ignorePaths": [ + "**/dist/**", + "examples/**/README.md", + "**/webpack.lock.data/**" + ] } diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index eac4bd8af..600bd17b4 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -1102,6 +1102,10 @@ export interface Experiments { * Support WebAssembly as asynchronous EcmaScript Module. */ asyncWebAssembly?: boolean; + /** + * Build http(s): urls using a lockfile and resource content cache. + */ + buildHttp?: boolean | HttpUriOptions; /** * Enable build-time execution of modules from the module graph for plugins and loaders. */ @@ -1159,6 +1163,27 @@ export interface Experiments { */ topLevelAwait?: boolean; } +/** + * Options for building http resources. + */ +export interface HttpUriOptions { + /** + * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false. + */ + cacheLocation?: false | string; + /** + * When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error. + */ + frozen?: boolean; + /** + * Location of the lockfile. + */ + lockfileLocation?: string; + /** + * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed. + */ + upgrade?: boolean; +} /** * Enable presets of externals for specific targets. */ diff --git a/declarations/plugins/schemes/HttpUriPlugin.d.ts b/declarations/plugins/schemes/HttpUriPlugin.d.ts new file mode 100644 index 000000000..8f4e64502 --- /dev/null +++ b/declarations/plugins/schemes/HttpUriPlugin.d.ts @@ -0,0 +1,29 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + +export type HttpUriPluginOptions = HttpUriOptions; + +/** + * Options for building http resources. + */ +export interface HttpUriOptions { + /** + * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false. + */ + cacheLocation?: false | string; + /** + * When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error. + */ + frozen?: boolean; + /** + * Location of the lockfile. + */ + lockfileLocation?: string; + /** + * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed. + */ + upgrade?: boolean; +} diff --git a/examples/build-http/README.md b/examples/build-http/README.md new file mode 100644 index 000000000..18b887ce4 --- /dev/null +++ b/examples/build-http/README.md @@ -0,0 +1,81 @@ +# example.js + +```javascript +import pMap1 from "https://cdn.skypack.dev/p-map"; +import pMap2 from "https://cdn.esm.sh/p-map"; +import pMap3 from "https://jspm.dev/p-map"; +console.log(pMap1); +console.log(pMap2); +console.log(pMap3); +``` + +# webpack.config.js + +```javascript +module.exports = { + // enable debug logging to see network requests! + // stats: { + // loggingDebug: /HttpUriPlugin/ + // }, + experiments: { + buildHttp: true + } +}; +``` + +# Info + +## Unoptimized + +``` +asset output.js 58.1 KiB [emitted] (name: main) +runtime modules 670 bytes 3 modules +modules by path https:// 20.9 KiB + modules by path https://jspm.dev/ 8.43 KiB + modules by path https://jspm.dev/*.0 6.04 KiB 5 modules + modules by path https://jspm.dev/npm:@jspm/ 1.99 KiB 2 modules + modules by path https://cdn.esm.sh/ 5.72 KiB 7 modules + modules by path https://cdn.skypack.dev/ 6.72 KiB + https://cdn.skypack.dev/p-map 2.29 KiB [built] [code generated] + [exports: default, pMapSkip] + [used exports unknown] + harmony side effect evaluation https://cdn.skypack.dev/p-map ./example.js 1:0-50 + harmony import specifier https://cdn.skypack.dev/p-map ./example.js 4:12-17 + https://cdn.skypack.dev/-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js 1.99 KiB [built] [code generated] + [exports: default] + [used exports unknown] + harmony side effect evaluation /-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js https://cdn.skypack.dev/p-map 1:0-130 + harmony import specifier /-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js https://cdn.skypack.dev/p-map 32:23-37 + https://cdn.skypack.dev/-/indent-string@v5.0.0-VgKPSgi4hUX5NbF4n3aC/dist=es2020,mode=imports/optimized/indent-string.js 827 bytes [built] [code generated] + [exports: default] + [used exports unknown] + harmony side effect evaluation /-/indent-string@v5.0.0-VgKPSgi4hUX5NbF4n3aC/dist=es2020,mode=imports/optimized/indent-string.js https://cdn.skypack.dev/-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js 23:0-124 + harmony import specifier /-/indent-string@v5.0.0-VgKPSgi4hUX5NbF4n3aC/dist=es2020,mode=imports/optimized/indent-string.js https://cdn.skypack.dev/-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js 45:21-33 + https://cdn.skypack.dev/-/clean-stack@v4.1.0-DgWUKXHVzThBBZtsHXhC/dist=es2020,mode=imports/optimized/clean-stack.js 1.4 KiB [built] [code generated] + [exports: default] + [used exports unknown] + harmony side effect evaluation /-/clean-stack@v4.1.0-DgWUKXHVzThBBZtsHXhC/dist=es2020,mode=imports/optimized/clean-stack.js https://cdn.skypack.dev/-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js 24:0-118 + harmony import specifier /-/clean-stack@v4.1.0-DgWUKXHVzThBBZtsHXhC/dist=es2020,mode=imports/optimized/clean-stack.js https://cdn.skypack.dev/-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js 43:66-76 + https://cdn.skypack.dev/-/escape-string-regexp@v5.0.0-SUDdAhYOdAgXIYndxZss/dist=es2020,mode=imports/optimized/escape-string-regexp.js 240 bytes [built] [code generated] + [exports: default] + [used exports unknown] + harmony side effect evaluation /-/escape-string-regexp@v5.0.0-SUDdAhYOdAgXIYndxZss/dist=es2020,mode=imports/optimized/escape-string-regexp.js https://cdn.skypack.dev/-/clean-stack@v4.1.0-DgWUKXHVzThBBZtsHXhC/dist=es2020,mode=imports/optimized/clean-stack.js 1:0-144 + harmony import specifier /-/escape-string-regexp@v5.0.0-SUDdAhYOdAgXIYndxZss/dist=es2020,mode=imports/optimized/escape-string-regexp.js https://cdn.skypack.dev/-/clean-stack@v4.1.0-DgWUKXHVzThBBZtsHXhC/dist=es2020,mode=imports/optimized/clean-stack.js 7:60-78 +./example.js 201 bytes [built] [code generated] + [no exports] + [used exports unknown] + entry ./example.js main +webpack 5.48.0 compiled successfully +``` + +## Production mode + +``` +asset output.js 11.3 KiB [emitted] [minimized] (name: main) +orphan modules 20.9 KiB [orphan] 23 modules +./example.js + 22 modules 21 KiB [built] [code generated] + [no exports] + [no exports used] + entry ./example.js main +webpack 5.48.0 compiled successfully +``` diff --git a/examples/build-http/build.js b/examples/build-http/build.js new file mode 100644 index 000000000..1d8b07db1 --- /dev/null +++ b/examples/build-http/build.js @@ -0,0 +1,2 @@ +global.NO_STATS_OPTIONS = true; +require("../build-common"); diff --git a/examples/build-http/example.js b/examples/build-http/example.js new file mode 100644 index 000000000..52f25159e --- /dev/null +++ b/examples/build-http/example.js @@ -0,0 +1,6 @@ +import pMap1 from "https://cdn.skypack.dev/p-map"; +import pMap2 from "https://cdn.esm.sh/p-map"; +import pMap3 from "https://jspm.dev/p-map"; +console.log(pMap1); +console.log(pMap2); +console.log(pMap3); diff --git a/examples/build-http/template.md b/examples/build-http/template.md new file mode 100644 index 000000000..2df3585bd --- /dev/null +++ b/examples/build-http/template.md @@ -0,0 +1,25 @@ +# example.js + +```javascript +_{{example.js}}_ +``` + +# webpack.config.js + +```javascript +_{{webpack.config.js}}_ +``` + +# Info + +## Unoptimized + +``` +_{{stdout}}_ +``` + +## Production mode + +``` +_{{production:stdout}}_ +``` diff --git a/examples/build-http/webpack.config.js b/examples/build-http/webpack.config.js new file mode 100644 index 000000000..e0508207e --- /dev/null +++ b/examples/build-http/webpack.config.js @@ -0,0 +1,9 @@ +module.exports = { + // enable debug logging to see network requests! + // stats: { + // loggingDebug: /HttpUriPlugin/ + // }, + experiments: { + buildHttp: true + } +}; diff --git a/examples/build-http/webpack.lock b/examples/build-http/webpack.lock new file mode 100644 index 000000000..ef9247769 --- /dev/null +++ b/examples/build-http/webpack.lock @@ -0,0 +1,26 @@ +{ + "https://cdn.esm.sh/p-map": { "resolved": "https://cdn.esm.sh/p-map", "integrity": "sha512-Q1RsGrT9Fl5eqmmFQbaCy4PcXRx90TZQCcHDWC6sN0vfEnco9o66mi1DNjaWD2HE40qn0cNTWoZ21RIH+jmeiQ==", "contentType": "application/javascript; charset=utf-8" }, + "https://cdn.esm.sh/v43/aggregate-error@4.0.0/es2015/aggregate-error.js": { "resolved": "https://cdn.esm.sh/v43/aggregate-error@4.0.0/es2015/aggregate-error.js", "integrity": "sha512-nnqEIbQNpkAb5idk+07Wbc8lNzPloQrPAs+SOjccU+va8qftYFcn0htGVwUqwvkWJHZaJn9/B5bXB2YZVzwvUg==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/v43/clean-stack@4.1.0/es2015/clean-stack.js": { "resolved": "https://cdn.esm.sh/v43/clean-stack@4.1.0/es2015/clean-stack.js", "integrity": "sha512-B6h1ZeTzVvZeNUbWJUvEIBPaTvyUnbNEaO+V0aREh7nR1OrFUON/xnG+jwJwEzLWACqQNKFeFiPBOlFowUZ5FQ==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/v43/escape-string-regexp@5.0.0/es2015/escape-string-regexp.js": { "resolved": "https://cdn.esm.sh/v43/escape-string-regexp@5.0.0/es2015/escape-string-regexp.js", "integrity": "sha512-e6uaGCpjIjNgUN5K6nm+BQ3HrIKj59Z/ySJDt86eOM1j7ri1PFvpRFq7JwyjGZ0mhNq/j4ywqNmmk7HEji1Chg==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/v43/indent-string@5.0.0/es2015/indent-string.js": { "resolved": "https://cdn.esm.sh/v43/indent-string@5.0.0/es2015/indent-string.js", "integrity": "sha512-yNbq6+IcXe6jW+HIM/dCPxvi1+NJRxo5msNe0Vdg4NqVVUV4DF8U2eJPehmKT0Xhv1viyaTiReidhB1BmE1f/A==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/v43/os-browserify@0.3.0/es2015/browser.js": { "resolved": "https://cdn.esm.sh/v43/os-browserify@0.3.0/es2015/browser.js", "integrity": "sha512-/BeiBawWpXZlWTjmXwtmrZbBeYgD0BqB9LE3EDf4yxBYqASwZ7Xj2dYNruM3/WMbJYyjP/TSRdwuKMsNLWdZbw==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/v43/p-map@5.1.0/es2015/p-map.js": { "resolved": "https://cdn.esm.sh/v43/p-map@5.1.0/es2015/p-map.js", "integrity": "sha512-DLSkffQJHasMXlosBDDFEIn7zgcLUW5KrTHy5/3IFsrmQO+9zlYjlWQbDJEShfvDzFEhXJc9D4ppP6zykBK/ZA==", "contentType": "application/javascript" }, + "https://cdn.skypack.dev/-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js": { "resolved": "https://cdn.skypack.dev/-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js", "integrity": "sha512-E5rN3mgPTqyfHSovQ++ZyZWQkMUniuyjbeHHX+E4G3MStEx6TfObScB8tfHeIyuawSp86nVsFfMZjCruD61rdg==", "contentType": "application/javascript; charset=utf-8" }, + "https://cdn.skypack.dev/-/clean-stack@v4.1.0-DgWUKXHVzThBBZtsHXhC/dist=es2020,mode=imports/optimized/clean-stack.js": { "resolved": "https://cdn.skypack.dev/-/clean-stack@v4.1.0-DgWUKXHVzThBBZtsHXhC/dist=es2020,mode=imports/optimized/clean-stack.js", "integrity": "sha512-1nEMT4Vc2YLu3EbeBnck7Traj0/D6G9MMSGraGpsoQIMKVuhQjq4gP76X6RxUn5GoiHv90KfrFMSWlbBn26Dhw==", "contentType": "application/javascript; charset=utf-8" }, + "https://cdn.skypack.dev/-/escape-string-regexp@v5.0.0-SUDdAhYOdAgXIYndxZss/dist=es2020,mode=imports/optimized/escape-string-regexp.js": { "resolved": "https://cdn.skypack.dev/-/escape-string-regexp@v5.0.0-SUDdAhYOdAgXIYndxZss/dist=es2020,mode=imports/optimized/escape-string-regexp.js", "integrity": "sha512-54oHYow5obgsKb0twQZMNLvCH2tV5MCOY4YHB0LQH+zVonIAn7JYZseUPWhC3MMkJFK5EkeNWDAX7P2camp27g==", "contentType": "application/javascript; charset=utf-8" }, + "https://cdn.skypack.dev/-/indent-string@v5.0.0-VgKPSgi4hUX5NbF4n3aC/dist=es2020,mode=imports/optimized/indent-string.js": { "resolved": "https://cdn.skypack.dev/-/indent-string@v5.0.0-VgKPSgi4hUX5NbF4n3aC/dist=es2020,mode=imports/optimized/indent-string.js", "integrity": "sha512-lSZAs06jEHkVlPMEeMtKbygGhrSmJUMVmpB6/2ChdG2F0694vRU1v6N12bUyqR5uGbbteTJ7atP5PmPtTVmlcw==", "contentType": "application/javascript; charset=utf-8" }, + "https://cdn.skypack.dev/p-map": { "resolved": "https://cdn.skypack.dev/-/p-map@v5.1.0-7ixXvZxXPKKt9unR9LT0/dist=es2020,mode=imports/optimized/p-map.js", "integrity": "sha512-mZyhNJe8VlqEqafSkUGTooFrKcQPSwVjB3UxAAPqywSFD+age77uTRP6ul8uAMEQ3lllmengXX1q45igRxRcDw==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:@jspm/core@2.0.0-beta.8/nodelibs/os": { "resolved": "https://jspm.dev/npm:@jspm/core@2.0.0-beta.8/nodelibs/os", "integrity": "sha512-bNMLa9/IfXCZprEMIuXuHM/9s4OFAl4ZKy8r6EdXNkduLNLHQ626srFqLRdWHx6ZWGIgppc1bI9+tRJT3FzfAw==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:@jspm/core@2/nodelibs/os": { "resolved": "https://jspm.dev/npm:@jspm/core@2/nodelibs/os", "integrity": "sha512-rPwqsk0nq0tqTCdbeGoopnlzAVh5BsaVUsXoFKQCcb04LWJrXmOhQEwj1Yj/WHfNj2ZIPzODlZdKtWZl5bbIpA==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:aggregate-error@4": { "resolved": "https://jspm.dev/npm:aggregate-error@4", "integrity": "sha512-XfXd6EZ09/SKLmWFFvjPCSkqv0E08IxKc8mFm9mePyLIiEiGyAKokeFt1wql+kG8ikGmI7YqKBsDf07/I31VvA==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:aggregate-error@4.0.0": { "resolved": "https://jspm.dev/npm:aggregate-error@4.0.0", "integrity": "sha512-HEobsVYXVCp5H4Z+6qAlKno8XAJwHQrfF4ivR4PHrp4ttM0Yg0zDfOcsjqJOnTP5hEnKR1K6OzQdPfR2r9of4g==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:clean-stack@4": { "resolved": "https://jspm.dev/npm:clean-stack@4", "integrity": "sha512-3wh/QTJY4tw/GInIcn5I+0hsHSirJi8Tf3kmH85hzQsuwB5k2lghBFZyKZPO7/Ql3muvZeDgN02pYkZap59Qrw==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:clean-stack@4.1.0": { "resolved": "https://jspm.dev/npm:clean-stack@4.1.0", "integrity": "sha512-VgNMH/ju9thH4YuxxA5trzs0u66nzRZhMa43jkhk8q6jxlEBhd7G6ZZxswy2a0ZXiXjPQVhzXfFkAIkY/pxTOg==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:escape-string-regexp@5.0.0": { "resolved": "https://jspm.dev/npm:escape-string-regexp@5.0.0", "integrity": "sha512-Hz7n4npzwf0UgkdjQvLN2HxudnAzllTEM9AzJPlnzf9ktGhkwlFltPQBjEM3xyDHeTj1xI1nYpBSRVQmMCl6bw==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:indent-string@5": { "resolved": "https://jspm.dev/npm:indent-string@5", "integrity": "sha512-hjMQ8+LX0q8xe2sCp/DEBJW2MrVFbiDv20pK0PWwENkYCkRlyP5L4t5AUiXLEXfJLUhTVrUfZtf+hmrnGJB/zA==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:indent-string@5.0.0": { "resolved": "https://jspm.dev/npm:indent-string@5.0.0", "integrity": "sha512-1KRJ7I1gDWWBAXz+NpwQnlJXDiSpaxaftugln1zHywLbqhA/akcZYM6+nTdfSSuQ7wiVong69R5X9l/QKWqO7g==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:p-map@5.1.0": { "resolved": "https://jspm.dev/npm:p-map@5.1.0", "integrity": "sha512-Ml4ozElyzZEvq3G61nmeDVjEPVbjNzhWwIfvVcEr0OsUu58yT/ieSJWr6VSSHbNGY8B1IYjJCEO2zFrgIT9plQ==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/p-map": { "resolved": "https://jspm.dev/p-map", "integrity": "sha512-Ztuu37YpSElOGm1OnAmLzhgTuTSyeDXCudBO94yRDDicb2zwUTIDEaVnHMJ6Gb7AVnKk26uubHB+Hw0XxKRnrw==", "contentType": "application/javascript; charset=utf-8" }, + "version": 1 +} diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/p-map_9a051b191b6af4b352ba b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/p-map_9a051b191b6af4b352ba new file mode 100644 index 000000000..09db00063 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/p-map_9a051b191b6af4b352ba @@ -0,0 +1,3 @@ +/* esm.sh - p-map@5.1.0 */ +export * from "https://cdn.esm.sh/v43/p-map@5.1.0/es2015/p-map.js"; +export { default } from "https://cdn.esm.sh/v43/p-map@5.1.0/es2015/p-map.js"; diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_aggregate-error_4.0.0_es2015_aggregate-error_89888e7f244a2b227be9.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_aggregate-error_4.0.0_es2015_aggregate-error_89888e7f244a2b227be9.js new file mode 100644 index 000000000..0fa8ce043 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_aggregate-error_4.0.0_es2015_aggregate-error_89888e7f244a2b227be9.js @@ -0,0 +1,3 @@ +var f=Object.defineProperty;var l=(e,t,n)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var i=(e,t,n)=>(l(e,typeof t!="symbol"?t+"":t,n),n),g=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var c=(e,t,n)=>(g(e,t,"read from private field"),n?n.call(e):t.get(e)),o=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},p=(e,t,n,a)=>(g(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n);import u from"/v43/indent-string@5.0.0/es2015/indent-string.js";import m from"/v43/clean-stack@4.1.0/es2015/clean-stack.js";var d=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),r,s=class extends Error{constructor(t){o(this,r,void 0);i(this,"name","AggregateError");if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=t.map(a=>a instanceof Error?a:a!==null&&typeof a=="object"?Object.assign(new Error(a.message),a):new Error(a));let n=t.map(a=>typeof a.stack=="string"?d(m(a.stack)):String(a)).join(` +`);n=` +`+u(n,4),super(n),p(this,r,t)}get errors(){return c(this,r).slice()}};r=new WeakMap;export{s as default}; \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_clean-stack_4.1.0_es2015_clean-stack_512fad7a42bd85149e06.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_clean-stack_4.1.0_es2015_clean-stack_512fad7a42bd85149e06.js new file mode 100644 index 000000000..d2024661d --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_clean-stack_4.1.0_es2015_clean-stack_512fad7a42bd85149e06.js @@ -0,0 +1,3 @@ +import s from"/v43/os-browserify@0.3.0/es2015/browser.js";import i from"/v43/escape-string-regexp@5.0.0/es2015/escape-string-regexp.js";var p=/\s+at.*[(\s](.*)\)?/,f=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/,u=typeof s.homedir=="undefined"?"":s.homedir().replace(/\\/g,"/");function c(a,{pretty:l=!1,basePath:n}={}){let o=n&&new RegExp(`(at | \\()${i(n.replace(/\\/g,"/"))}`,"g");if(typeof a=="string")return a.replace(/\\/g,"/").split(` +`).filter(e=>{let r=e.match(p);if(r===null||!r[1])return!0;let t=r[1];return t.includes(".app/Contents/Resources/electron.asar")||t.includes(".app/Contents/Resources/default_app.asar")?!1:!f.test(t)}).filter(e=>e.trim()!=="").map(e=>(o&&(e=e.replace(o,"$1")),l&&(e=e.replace(p,(r,t)=>r.replace(t,t.replace(u,"~")))),e)).join(` +`)}export{c as default}; \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_escape-string-regexp_5.0.0_es2015_escape-string-regexp_22382d8d9f837184e161.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_escape-string-regexp_5.0.0_es2015_escape-string-regexp_22382d8d9f837184e161.js new file mode 100644 index 000000000..4c87ee6f3 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_escape-string-regexp_5.0.0_es2015_escape-string-regexp_22382d8d9f837184e161.js @@ -0,0 +1 @@ +function r(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}export{r as default}; \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_indent-string_5.0.0_es2015_indent-string_6103e1cfb4ff573a03ed.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_indent-string_5.0.0_es2015_indent-string_6103e1cfb4ff573a03ed.js new file mode 100644 index 000000000..67abd53ae --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_indent-string_5.0.0_es2015_indent-string_6103e1cfb4ff573a03ed.js @@ -0,0 +1 @@ +function o(t,e=1,n={}){let{indent:r=" ",includeEmptyLines:p=!1}=n;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof r!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r}\``);if(e===0)return t;let i=p?/^/gm:/^(?!\s*$)/gm;return t.replace(i,r.repeat(e))}export{o as default}; \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_os-browserify_0.3.0_es2015_browser_92a2351b7a3273e492dd.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_os-browserify_0.3.0_es2015_browser_92a2351b7a3273e492dd.js new file mode 100644 index 000000000..2d987fbea --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_os-browserify_0.3.0_es2015_browser_92a2351b7a3273e492dd.js @@ -0,0 +1,2 @@ +var f=Object.create;var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var d=e=>o(e,"__esModule",{value:!0});var l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var w=(e,t,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of m(t))!p.call(e,n)&&n!=="default"&&o(e,n,{get:()=>t[n],enumerable:!(i=s(t,n))||i.enumerable});return e},a=e=>w(d(o(e!=null?f(c(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var u=l(r=>{r.endianness=function(){return"LE"};r.hostname=function(){return typeof location!="undefined"?location.hostname:""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){return typeof navigator!="undefined"?navigator.appVersion:""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL=` +`;r.homedir=function(){return"/"}});var b=a(u()),h=a(u()),{cpus:v,release:E,tmpDir:L,loadavg:k,uptime:A,totalmem:I,arch:N,tmpdir:_,homedir:V,endianness:x,hostname:D,type:M,freemem:O,networkInterfaces:U,getNetworkInterfaces:X,platform:j,EOL:B}=b;var export_default=h.default;export{B as EOL,N as arch,v as cpus,export_default as default,x as endianness,O as freemem,X as getNetworkInterfaces,V as homedir,D as hostname,k as loadavg,U as networkInterfaces,j as platform,E as release,L as tmpDir,_ as tmpdir,I as totalmem,M as type,A as uptime}; \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_p-map_5.1.0_es2015_p-map_2e9e4310942f189ff123.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_p-map_5.1.0_es2015_p-map_2e9e4310942f189ff123.js new file mode 100644 index 000000000..0202cd3f6 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_p-map_5.1.0_es2015_p-map_2e9e4310942f189ff123.js @@ -0,0 +1 @@ +var m=(p,s,e)=>new Promise((f,x)=>{var h=t=>{try{o(e.next(t))}catch(r){x(r)}},l=t=>{try{o(e.throw(t))}catch(r){x(r)}},o=t=>t.done?f(t.value):Promise.resolve(t.value).then(h,l);o((e=e.apply(p,s)).next())});import S from"/v43/aggregate-error@4.0.0/es2015/aggregate-error.js";function N(x,h){return m(this,arguments,function*(p,s,{concurrency:e=Number.POSITIVE_INFINITY,stopOnError:f=!0}={}){return new Promise((l,o)=>{if(typeof s!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(e)||e===Number.POSITIVE_INFINITY)&&e>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${e}\` (${typeof e})`);let t=[],r=[],g=[],y=p[Symbol.iterator](),u=!1,c=!1,a=0,b=0,I=()=>{if(u)return;let i=y.next(),d=b;if(b++,i.done){if(c=!0,a===0)if(!f&&r.length>0)o(new S(r));else{for(let n of g)t.splice(n,1);l(t)}return}a++,(()=>m(this,null,function*(){try{let n=yield i.value;if(u)return;let w=yield s(n,d);w===T?g.push(d):t[d]=w,a--,I()}catch(n){f?(u=!0,o(n)):(r.push(n),a--,I())}}))()};for(let i=0;i { + if (typeof key !== "symbol") + key += ""; + if (key in obj) + return __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}); + return obj[key] = value; +}; +var __accessCheck = (obj, member, msg) => { + if (!member.has(obj)) + throw TypeError("Cannot " + msg); +}; +var __privateGet = (obj, member, getter) => { + __accessCheck(obj, member, "read from private field"); + return getter ? getter.call(obj) : member.get(obj); +}; +var __privateSet = (obj, member, value, setter) => { + __accessCheck(obj, member, "write to private field"); + setter ? setter.call(obj, value) : member.set(obj, value); + return value; +}; +var _errors; +import indentString from "/-/indent-string@v5.0.0-VgKPSgi4hUX5NbF4n3aC/dist=es2020,mode=imports/optimized/indent-string.js"; +import cleanStack from "/-/clean-stack@v4.1.0-DgWUKXHVzThBBZtsHXhC/dist=es2020,mode=imports/optimized/clean-stack.js"; +const cleanInternalStack = (stack) => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, ""); +class AggregateError extends Error { + constructor(errors) { + _errors.set(this, void 0); + __publicField(this, "name", "AggregateError"); + if (!Array.isArray(errors)) { + throw new TypeError(`Expected input to be an Array, got ${typeof errors}`); + } + errors = errors.map((error) => { + if (error instanceof Error) { + return error; + } + if (error !== null && typeof error === "object") { + return Object.assign(new Error(error.message), error); + } + return new Error(error); + }); + let message = errors.map((error) => { + return typeof error.stack === "string" ? cleanInternalStack(cleanStack(error.stack)) : String(error); + }).join("\n"); + message = "\n" + indentString(message, 4); + super(message); + __privateSet(this, _errors, errors); + } + get errors() { + return __privateGet(this, _errors).slice(); + } +} +_errors = new WeakMap(); +export default AggregateError; diff --git a/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/clean-stack_v4.1.0-DgWUKXHVzThBBZtsHXhC_dist_es2020_mode_imports_optimized_clean-stack_94a61d495a23573d704d.js b/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/clean-stack_v4.1.0-DgWUKXHVzThBBZtsHXhC_dist_es2020_mode_imports_optimized_clean-stack_94a61d495a23573d704d.js new file mode 100644 index 000000000..d8afc7bdf --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/clean-stack_v4.1.0-DgWUKXHVzThBBZtsHXhC_dist_es2020_mode_imports_optimized_clean-stack_94a61d495a23573d704d.js @@ -0,0 +1,31 @@ +import escapeStringRegexp from "/-/escape-string-regexp@v5.0.0-SUDdAhYOdAgXIYndxZss/dist=es2020,mode=imports/optimized/escape-string-regexp.js"; +var os = {}; +const extractPathRegex = /\s+at.*[(\s](.*)\)?/; +const pathRegex = /^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/; +const homeDir = typeof os.homedir === "undefined" ? "" : os.homedir().replace(/\\/g, "/"); +function cleanStack(stack, {pretty = false, basePath} = {}) { + const basePathRegex = basePath && new RegExp(`(at | \\()${escapeStringRegexp(basePath.replace(/\\/g, "/"))}`, "g"); + if (typeof stack !== "string") { + return void 0; + } + return stack.replace(/\\/g, "/").split("\n").filter((line) => { + const pathMatches = line.match(extractPathRegex); + if (pathMatches === null || !pathMatches[1]) { + return true; + } + const match = pathMatches[1]; + if (match.includes(".app/Contents/Resources/electron.asar") || match.includes(".app/Contents/Resources/default_app.asar")) { + return false; + } + return !pathRegex.test(match); + }).filter((line) => line.trim() !== "").map((line) => { + if (basePathRegex) { + line = line.replace(basePathRegex, "$1"); + } + if (pretty) { + line = line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, "~"))); + } + return line; + }).join("\n"); +} +export default cleanStack; diff --git a/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/escape-string-regexp_v5.0.0-SUDdAhYOdAgXIYndxZss_dist_es2020_mode_imports_optimized_escape-string-regexp_c6f22ceb2f8b90740447.js b/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/escape-string-regexp_v5.0.0-SUDdAhYOdAgXIYndxZss_dist_es2020_mode_imports_optimized_escape-string-regexp_c6f22ceb2f8b90740447.js new file mode 100644 index 000000000..d0aaf2eea --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/escape-string-regexp_v5.0.0-SUDdAhYOdAgXIYndxZss_dist_es2020_mode_imports_optimized_escape-string-regexp_c6f22ceb2f8b90740447.js @@ -0,0 +1,7 @@ +function escapeStringRegexp(string) { + if (typeof string !== "string") { + throw new TypeError("Expected a string"); + } + return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} +export default escapeStringRegexp; diff --git a/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/indent-string_v5.0.0-VgKPSgi4hUX5NbF4n3aC_dist_es2020_mode_imports_optimized_indent-string_dc30873279e41ccf7b43.js b/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/indent-string_v5.0.0-VgKPSgi4hUX5NbF4n3aC_dist_es2020_mode_imports_optimized_indent-string_dc30873279e41ccf7b43.js new file mode 100644 index 000000000..307e1901f --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/indent-string_v5.0.0-VgKPSgi4hUX5NbF4n3aC_dist_es2020_mode_imports_optimized_indent-string_dc30873279e41ccf7b43.js @@ -0,0 +1,24 @@ +function indentString(string, count = 1, options = {}) { + const { + indent = " ", + includeEmptyLines = false + } = options; + if (typeof string !== "string") { + throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof string}\``); + } + if (typeof count !== "number") { + throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``); + } + if (count < 0) { + throw new RangeError(`Expected \`count\` to be at least 0, got \`${count}\``); + } + if (typeof indent !== "string") { + throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof indent}\``); + } + if (count === 0) { + return string; + } + const regex = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; + return string.replace(regex, indent.repeat(count)); +} +export default indentString; diff --git a/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/p-map_v5.1.0-7ixXvZxXPKKt9unR9LT0_dist_es2020_mode_imports_optimized_p-map_2f29b65de28b7340c85e.js b/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/p-map_v5.1.0-7ixXvZxXPKKt9unR9LT0_dist_es2020_mode_imports_optimized_p-map_2f29b65de28b7340c85e.js new file mode 100644 index 000000000..921f352df --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.skypack.dev/p-map_v5.1.0-7ixXvZxXPKKt9unR9LT0_dist_es2020_mode_imports_optimized_p-map_2f29b65de28b7340c85e.js @@ -0,0 +1,79 @@ +import AggregateError from "/-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js"; +async function pMap(iterable, mapper, { + concurrency = Number.POSITIVE_INFINITY, + stopOnError = true +} = {}) { + return new Promise((resolve, reject) => { + if (typeof mapper !== "function") { + throw new TypeError("Mapper function is required"); + } + if (!((Number.isSafeInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency >= 1)) { + throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); + } + const result = []; + const errors = []; + const skippedIndexes = []; + const iterator = iterable[Symbol.iterator](); + let isRejected = false; + let isIterableDone = false; + let resolvingCount = 0; + let currentIndex = 0; + const next = () => { + if (isRejected) { + return; + } + const nextItem = iterator.next(); + const index = currentIndex; + currentIndex++; + if (nextItem.done) { + isIterableDone = true; + if (resolvingCount === 0) { + if (!stopOnError && errors.length > 0) { + reject(new AggregateError(errors)); + } else { + for (const skippedIndex of skippedIndexes) { + result.splice(skippedIndex, 1); + } + resolve(result); + } + } + return; + } + resolvingCount++; + (async () => { + try { + const element = await nextItem.value; + if (isRejected) { + return; + } + const value = await mapper(element, index); + if (value === pMapSkip) { + skippedIndexes.push(index); + } else { + result[index] = value; + } + resolvingCount--; + next(); + } catch (error) { + if (stopOnError) { + isRejected = true; + reject(error); + } else { + errors.push(error); + resolvingCount--; + next(); + } + } + })(); + }; + for (let index = 0; index < concurrency; index++) { + next(); + if (isIterableDone) { + break; + } + } + }); +} +const pMapSkip = Symbol("skip"); +export default pMap; +export {pMapSkip}; diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_aggregate-error_4.0_3f9c2db11addffc62c35.0 b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_aggregate-error_4.0_3f9c2db11addffc62c35.0 new file mode 100644 index 000000000..65063d105 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_aggregate-error_4.0_3f9c2db11addffc62c35.0 @@ -0,0 +1,48 @@ +import indentString from './npm:indent-string@5'; +import cleanStack from './npm:clean-stack@4'; + +const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, ''); + +class AggregateError extends Error { + #errors; + + name = 'AggregateError'; + + constructor(errors) { + if (!Array.isArray(errors)) { + throw new TypeError(`Expected input to be an Array, got ${typeof errors}`); + } + + errors = errors.map(error => { + if (error instanceof Error) { + return error; + } + + if (error !== null && typeof error === 'object') { + // Handle plain error objects with message property and/or possibly other metadata + return Object.assign(new Error(error.message), error); + } + + return new Error(error); + }); + + let message = errors + .map(error => { + // The `stack` property is not standardized, so we can't assume it exists + return typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error); + }) + .join('\n'); + message = '\n' + indentString(message, 4); + super(message); + + this.#errors = errors; + } + + get errors() { + return this.#errors.slice(); + } +} + +export default AggregateError; + +//# sourceMappingURL=npm:aggregate-error@4.0.0.map \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_aggregate-error_4_2480c41192a10211937a b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_aggregate-error_4_2480c41192a10211937a new file mode 100644 index 000000000..511f78a97 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_aggregate-error_4_2480c41192a10211937a @@ -0,0 +1,3 @@ +import "/npm:indent-string@5"; +import "/npm:clean-stack@4"; +export { default } from "/npm:aggregate-error@4.0.0"; diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_clean-stack_4.1_9c285d25bf0385cc2256.0 b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_clean-stack_4.1_9c285d25bf0385cc2256.0 new file mode 100644 index 000000000..8d14e04d2 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_clean-stack_4.1_9c285d25bf0385cc2256.0 @@ -0,0 +1,52 @@ +import os from './npm:@jspm/core@2/nodelibs/os'; +import escapeStringRegexp from './npm:escape-string-regexp@5.0.0'; + +const extractPathRegex = /\s+at.*[(\s](.*)\)?/; +const pathRegex = /^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/; +const homeDir = typeof os.homedir === 'undefined' ? '' : os.homedir().replace(/\\/g, '/'); + +function cleanStack(stack, {pretty = false, basePath} = {}) { + const basePathRegex = basePath && new RegExp(`(at | \\()${escapeStringRegexp(basePath.replace(/\\/g, '/'))}`, 'g'); + + if (typeof stack !== 'string') { + return undefined; + } + + return stack.replace(/\\/g, '/') + .split('\n') + .filter(line => { + const pathMatches = line.match(extractPathRegex); + if (pathMatches === null || !pathMatches[1]) { + return true; + } + + const match = pathMatches[1]; + + // Electron + if ( + match.includes('.app/Contents/Resources/electron.asar') || + match.includes('.app/Contents/Resources/default_app.asar') + ) { + return false; + } + + return !pathRegex.test(match); + }) + .filter(line => line.trim() !== '') + .map(line => { + if (basePathRegex) { + line = line.replace(basePathRegex, '$1'); + } + + if (pretty) { + line = line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, '~'))); + } + + return line; + }) + .join('\n'); +} + +export default cleanStack; + +//# sourceMappingURL=npm:clean-stack@4.1.0.map \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_clean-stack_4_3f532a3a3a391ea3d5d5 b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_clean-stack_4_3f532a3a3a391ea3d5d5 new file mode 100644 index 000000000..256472ccd --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_clean-stack_4_3f532a3a3a391ea3d5d5 @@ -0,0 +1,3 @@ +import "/npm:@jspm/core@2/nodelibs/os"; +import "/npm:escape-string-regexp@5.0.0"; +export { default } from "/npm:clean-stack@4.1.0"; diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_escape-string-regexp_5.0_1a21bfa9008fa676b2a6.0 b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_escape-string-regexp_5.0_1a21bfa9008fa676b2a6.0 new file mode 100644 index 000000000..3e1c303b1 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_escape-string-regexp_5.0_1a21bfa9008fa676b2a6.0 @@ -0,0 +1,15 @@ +function escapeStringRegexp(string) { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } + + // Escape characters with special meaning either inside or outside character sets. + // Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. + return string + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') + .replace(/-/g, '\\x2d'); +} + +export default escapeStringRegexp; + +//# sourceMappingURL=npm:escape-string-regexp@5.0.0.map \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_indent-string_5.0_d9938d6e86a9a0febbeb.0 b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_indent-string_5.0_d9938d6e86a9a0febbeb.0 new file mode 100644 index 000000000..f4ccda81d --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_indent-string_5.0_d9938d6e86a9a0febbeb.0 @@ -0,0 +1,42 @@ +function indentString(string, count = 1, options = {}) { + const { + indent = ' ', + includeEmptyLines = false + } = options; + + if (typeof string !== 'string') { + throw new TypeError( + `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` + ); + } + + if (typeof count !== 'number') { + throw new TypeError( + `Expected \`count\` to be a \`number\`, got \`${typeof count}\`` + ); + } + + if (count < 0) { + throw new RangeError( + `Expected \`count\` to be at least 0, got \`${count}\`` + ); + } + + if (typeof indent !== 'string') { + throw new TypeError( + `Expected \`options.indent\` to be a \`string\`, got \`${typeof indent}\`` + ); + } + + if (count === 0) { + return string; + } + + const regex = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; + + return string.replace(regex, indent.repeat(count)); +} + +export default indentString; + +//# sourceMappingURL=npm:indent-string@5.0.0.map \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_indent-string_5_c2208743332044a73298 b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_indent-string_5_c2208743332044a73298 new file mode 100644 index 000000000..f8b934807 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_indent-string_5_c2208743332044a73298 @@ -0,0 +1 @@ +export { default } from "/npm:indent-string@5.0.0"; diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2.0.0-beta_2b28d9456b8c8ef4d6fb.8_nodelibs_os b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2.0.0-beta_2b28d9456b8c8ef4d6fb.8_nodelibs_os new file mode 100644 index 000000000..a1ed1ea46 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2.0.0-beta_2b28d9456b8c8ef4d6fb.8_nodelibs_os @@ -0,0 +1,97 @@ +var exports = {}, + _dewExec = false; +function dew() { + if (_dewExec) return exports; + _dewExec = true; + + exports.endianness = function () { + return "LE"; + }; + + exports.hostname = function () { + if (typeof location !== "undefined") { + return location.hostname; + } else return ""; + }; + + exports.loadavg = function () { + return []; + }; + + exports.uptime = function () { + return 0; + }; + + exports.freemem = function () { + return Number.MAX_VALUE; + }; + + exports.totalmem = function () { + return Number.MAX_VALUE; + }; + + exports.cpus = function () { + return []; + }; + + exports.type = function () { + return "Browser"; + }; + + exports.release = function () { + if (typeof navigator !== "undefined") { + return navigator.appVersion; + } + + return ""; + }; + + exports.networkInterfaces = exports.getNetworkInterfaces = function () { + return {}; + }; + + exports.arch = function () { + return "javascript"; + }; + + exports.platform = function () { + return "browser"; + }; + + exports.tmpdir = exports.tmpDir = function () { + return "/tmp"; + }; + + exports.EOL = "\n"; + + exports.homedir = function () { + return "/"; + }; + + return exports; +} + +var os = dew(); + +var EOL = os.EOL; +var arch = os.arch; +var cpus = os.cpus; +var endianness = os.endianness; +var freemem = os.freemem; +var getNetworkInterfaces = os.getNetworkInterfaces; +var homedir = os.homedir; +var hostname = os.hostname; +var loadavg = os.loadavg; +var networkInterfaces = os.networkInterfaces; +var platform = os.platform; +var release = os.release; +var tmpDir = os.tmpDir; +var tmpdir = os.tmpdir; +var totalmem = os.totalmem; +var type = os.type; +var uptime = os.uptime; + +export default os; +export { EOL, arch, cpus, endianness, freemem, getNetworkInterfaces, homedir, hostname, loadavg, networkInterfaces, platform, release, tmpDir, tmpdir, totalmem, type, uptime }; + +//# sourceMappingURL=os.map \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2_nodelibs_os_cf88df9df31061bcb921 b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2_nodelibs_os_cf88df9df31061bcb921 new file mode 100644 index 000000000..69dc15e2f --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2_nodelibs_os_cf88df9df31061bcb921 @@ -0,0 +1,2 @@ +export * from "/npm:@jspm/core@2.0.0-beta.8/nodelibs/os"; +export { default } from "/npm:@jspm/core@2.0.0-beta.8/nodelibs/os"; diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_p-map_5.1_bd0dfdcf7f62202ed19e.0 b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_p-map_5.1_bd0dfdcf7f62202ed19e.0 new file mode 100644 index 000000000..5166d7447 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_p-map_5.1_bd0dfdcf7f62202ed19e.0 @@ -0,0 +1,103 @@ +import AggregateError from './npm:aggregate-error@4'; + +async function pMap( + iterable, + mapper, + { + concurrency = Number.POSITIVE_INFINITY, + stopOnError = true + } = {} +) { + return new Promise((resolve, reject) => { + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } + + if (!((Number.isSafeInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency >= 1)) { + throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); + } + + const result = []; + const errors = []; + const skippedIndexes = []; + const iterator = iterable[Symbol.iterator](); + let isRejected = false; + let isIterableDone = false; + let resolvingCount = 0; + let currentIndex = 0; + + const next = () => { + if (isRejected) { + return; + } + + const nextItem = iterator.next(); + const index = currentIndex; + currentIndex++; + + if (nextItem.done) { + isIterableDone = true; + + if (resolvingCount === 0) { + if (!stopOnError && errors.length > 0) { + reject(new AggregateError(errors)); + } else { + for (const skippedIndex of skippedIndexes) { + result.splice(skippedIndex, 1); + } + + resolve(result); + } + } + + return; + } + + resolvingCount++; + + (async () => { + try { + const element = await nextItem.value; + + if (isRejected) { + return; + } + + const value = await mapper(element, index); + if (value === pMapSkip) { + skippedIndexes.push(index); + } else { + result[index] = value; + } + + resolvingCount--; + next(); + } catch (error) { + if (stopOnError) { + isRejected = true; + reject(error); + } else { + errors.push(error); + resolvingCount--; + next(); + } + } + })(); + }; + + for (let index = 0; index < concurrency; index++) { + next(); + + if (isIterableDone) { + break; + } + } + }); +} + +const pMapSkip = Symbol('skip'); + +export default pMap; +export { pMapSkip }; + +//# sourceMappingURL=npm:p-map@5.1.0.map \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/p-map_6fa685460a5a6deb568e b/examples/build-http/webpack.lock.data/https_jspm.dev/p-map_6fa685460a5a6deb568e new file mode 100644 index 000000000..95b490c45 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/p-map_6fa685460a5a6deb568e @@ -0,0 +1,3 @@ +import "/npm:aggregate-error@4"; +export * from "/npm:p-map@5.1.0"; +export { default } from "/npm:p-map@5.1.0"; diff --git a/lib/Compilation.js b/lib/Compilation.js index 787021275..9a6c74040 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -1302,6 +1302,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si module.needBuild( { + compilation: this, fileSystemInfo: this.fileSystemInfo, valueCacheVersions: this.valueCacheVersions }, diff --git a/lib/Module.js b/lib/Module.js index 0fdda4322..eb6d3013c 100644 --- a/lib/Module.js +++ b/lib/Module.js @@ -93,6 +93,7 @@ const makeSerializable = require("./util/makeSerializable"); /** * @typedef {Object} NeedBuildContext + * @property {Compilation} compilation * @property {FileSystemInfo} fileSystemInfo * @property {Map>} valueCacheVersions */ diff --git a/lib/MultiCompiler.js b/lib/MultiCompiler.js index 1c73ecc39..b28cb110d 100644 --- a/lib/MultiCompiler.js +++ b/lib/MultiCompiler.js @@ -87,7 +87,6 @@ module.exports = class MultiCompiler { const compiler = this.compilers[index]; const compilerIndex = index; let compilerDone = false; - // eslint-disable-next-line no-loop-func compiler.hooks.done.tap("MultiCompiler", stats => { if (!compilerDone) { compilerDone = true; @@ -98,7 +97,6 @@ module.exports = class MultiCompiler { this.hooks.done.call(new MultiStats(compilerStats)); } }); - // eslint-disable-next-line no-loop-func compiler.hooks.invalid.tap("MultiCompiler", () => { if (compilerDone) { compilerDone = false; diff --git a/lib/NormalModule.js b/lib/NormalModule.js index f4a99add2..772a2171f 100644 --- a/lib/NormalModule.js +++ b/lib/NormalModule.js @@ -16,6 +16,7 @@ const { SourceMapSource } = require("webpack-sources"); const Compilation = require("./Compilation"); +const HookWebpackError = require("./HookWebpackError"); const Module = require("./Module"); const ModuleBuildError = require("./ModuleBuildError"); const ModuleError = require("./ModuleError"); @@ -178,6 +179,7 @@ makeSerializable( * @property {SyncHook<[object, NormalModule]>} loader * @property {SyncHook<[LoaderItem[], NormalModule, object]>} beforeLoaders * @property {HookMap>} readResourceForScheme + * @property {AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>} needBuild */ /** @type {WeakMap} */ @@ -201,7 +203,8 @@ class NormalModule extends Module { beforeLoaders: new SyncHook(["loaders", "module", "loaderContext"]), readResourceForScheme: new HookMap( () => new AsyncSeriesBailHook(["resource", "module"]) - ) + ), + needBuild: new AsyncSeriesBailHook(["module", "context"]) }; compilationHooksMap.set(compilation, hooks); } @@ -751,6 +754,13 @@ class NormalModule extends Module { const hooks = NormalModule.getCompilationHooks(compilation); + this.buildInfo.fileDependencies = new LazySet(); + this.buildInfo.contextDependencies = new LazySet(); + this.buildInfo.missingDependencies = new LazySet(); + if (this.loaders.length > 0) { + this.buildInfo.buildDependencies = new LazySet(); + } + this.buildInfo.cacheable = true; try { hooks.beforeLoaders.call(this.loaders, this, loaderContext); } catch (err) { @@ -762,7 +772,8 @@ class NormalModule extends Module { resource: this.resource, loaders: this.loaders, context: loaderContext, - processResource: (loaderContext, resource, callback) => { + processResource: (loaderContext, resourcePath, callback) => { + const resource = loaderContext.resource; const scheme = getScheme(resource); if (scheme) { hooks.readResourceForScheme @@ -775,8 +786,8 @@ class NormalModule extends Module { return callback(null, result); }); } else { - loaderContext.addDependency(resource); - fs.readFile(resource, callback); + loaderContext.addDependency(resourcePath); + fs.readFile(resourcePath, callback); } } }, @@ -789,27 +800,19 @@ class NormalModule extends Module { undefined; if (!result) { + this.buildInfo.cacheable = false; return processResult( err || new Error("No result from loader-runner processing"), null ); } - this.buildInfo.fileDependencies = new LazySet(); this.buildInfo.fileDependencies.addAll(result.fileDependencies); - this.buildInfo.contextDependencies = new LazySet(); this.buildInfo.contextDependencies.addAll(result.contextDependencies); - this.buildInfo.missingDependencies = new LazySet(); this.buildInfo.missingDependencies.addAll(result.missingDependencies); - if ( - this.loaders.length > 0 && - this.buildInfo.buildDependencies === undefined - ) { - this.buildInfo.buildDependencies = new LazySet(); - } for (const loader of this.loaders) { this.buildInfo.buildDependencies.add(loader.loader); } - this.buildInfo.cacheable = result.cacheable; + this.buildInfo.cacheable = this.buildInfo.cacheable && result.cacheable; processResult(err, result.result); } ); @@ -1178,7 +1181,8 @@ class NormalModule extends Module { * @param {function(WebpackError=, boolean=): void} callback callback function, returns true, if the module needs a rebuild * @returns {void} */ - needBuild({ fileSystemInfo, valueCacheVersions }, callback) { + needBuild(context, callback) { + const { fileSystemInfo, compilation, valueCacheVersions } = context; // build if enforced if (this._forceBuild) return callback(null, true); @@ -1213,7 +1217,20 @@ class NormalModule extends Module { // check snapshot for validity fileSystemInfo.checkSnapshotValid(this.buildInfo.snapshot, (err, valid) => { - callback(err, !valid); + if (err) return callback(err); + if (!valid) return callback(null, true); + const hooks = NormalModule.getCompilationHooks(compilation); + hooks.needBuild.callAsync(this, context, (err, needBuild) => { + if (err) { + return callback( + HookWebpackError.makeWebpackError( + err, + "NormalModule.getCompilationHooks().needBuild" + ) + ); + } + callback(null, !!needBuild); + }); }); } diff --git a/lib/NormalModuleFactory.js b/lib/NormalModuleFactory.js index 40b5d123c..8d54a948d 100644 --- a/lib/NormalModuleFactory.js +++ b/lib/NormalModuleFactory.js @@ -66,6 +66,7 @@ const { parseResource } = require("./util/identifier"); const EMPTY_RESOLVE_OPTIONS = {}; const EMPTY_PARSER_OPTIONS = {}; const EMPTY_GENERATOR_OPTIONS = {}; +const EMPTY_ELEMENTS = []; const MATCH_RESOURCE_REGEX = /^([^!]+)!=!/; @@ -220,6 +221,10 @@ class NormalModuleFactory extends ModuleFactory { resolveForScheme: new HookMap( () => new AsyncSeriesBailHook(["resourceData", "resolveData"]) ), + /** @type {HookMap>} */ + resolveInScheme: new HookMap( + () => new AsyncSeriesBailHook(["resourceData", "resolveData"]) + ), /** @type {AsyncSeriesBailHook<[ResolveData], TODO>} */ factorize: new AsyncSeriesBailHook(["resolveData"]), /** @type {AsyncSeriesBailHook<[ResolveData], TODO>} */ @@ -354,42 +359,71 @@ class NormalModuleFactory extends ModuleFactory { /** @type {ResourceData | undefined} */ let matchResourceData = undefined; /** @type {string} */ - let requestWithoutMatchResource = request; - const matchResourceMatch = MATCH_RESOURCE_REGEX.exec(request); - if (matchResourceMatch) { - let matchResource = matchResourceMatch[1]; - if (matchResource.charCodeAt(0) === 46) { - // 46 === ".", 47 === "/" - const secondChar = matchResource.charCodeAt(1); - if ( - secondChar === 47 || - (secondChar === 46 && matchResource.charCodeAt(2) === 47) - ) { - // if matchResources startsWith ../ or ./ - matchResource = join(this.fs, context, matchResource); - } - } - matchResourceData = { - resource: matchResource, - ...cacheParseResource(matchResource) - }; - requestWithoutMatchResource = request.substr( - matchResourceMatch[0].length - ); - } + let unresolvedResource; + /** @type {{loader: string, options: string|undefined}[]} */ + let elements; + let noPreAutoLoaders = false; + let noAutoLoaders = false; + let noPrePostAutoLoaders = false; - const firstChar = requestWithoutMatchResource.charCodeAt(0); - const secondChar = requestWithoutMatchResource.charCodeAt(1); - const noPreAutoLoaders = firstChar === 45 && secondChar === 33; // startsWith "-!" - const noAutoLoaders = noPreAutoLoaders || firstChar === 33; // startsWith "!" - const noPrePostAutoLoaders = firstChar === 33 && secondChar === 33; // startsWith "!!"; - const rawElements = requestWithoutMatchResource - .slice( - noPreAutoLoaders || noPrePostAutoLoaders ? 2 : noAutoLoaders ? 1 : 0 - ) - .split(/!+/); - const unresolvedResource = rawElements.pop(); - const elements = rawElements.map(identToLoaderRequest); + const contextScheme = getScheme(context); + /** @type {string | undefined} */ + let scheme = getScheme(request); + + if (!scheme) { + /** @type {string} */ + let requestWithoutMatchResource = request; + const matchResourceMatch = MATCH_RESOURCE_REGEX.exec(request); + if (matchResourceMatch) { + let matchResource = matchResourceMatch[1]; + if (matchResource.charCodeAt(0) === 46) { + // 46 === ".", 47 === "/" + const secondChar = matchResource.charCodeAt(1); + if ( + secondChar === 47 || + (secondChar === 46 && matchResource.charCodeAt(2) === 47) + ) { + // if matchResources startsWith ../ or ./ + matchResource = join(this.fs, context, matchResource); + } + } + matchResourceData = { + resource: matchResource, + ...cacheParseResource(matchResource) + }; + requestWithoutMatchResource = request.substr( + matchResourceMatch[0].length + ); + } + + scheme = getScheme(requestWithoutMatchResource); + + if (!scheme && !contextScheme) { + const firstChar = requestWithoutMatchResource.charCodeAt(0); + const secondChar = requestWithoutMatchResource.charCodeAt(1); + noPreAutoLoaders = firstChar === 45 && secondChar === 33; // startsWith "-!" + noAutoLoaders = noPreAutoLoaders || firstChar === 33; // startsWith "!" + noPrePostAutoLoaders = firstChar === 33 && secondChar === 33; // startsWith "!!"; + const rawElements = requestWithoutMatchResource + .slice( + noPreAutoLoaders || noPrePostAutoLoaders + ? 2 + : noAutoLoaders + ? 1 + : 0 + ) + .split(/!+/); + unresolvedResource = rawElements.pop(); + elements = rawElements.map(identToLoaderRequest); + scheme = getScheme(unresolvedResource); + } else { + unresolvedResource = requestWithoutMatchResource; + elements = EMPTY_ELEMENTS; + } + } else { + unresolvedResource = request; + elements = EMPTY_ELEMENTS; + } const resolveContext = { fileDependencies, @@ -399,8 +433,6 @@ class NormalModuleFactory extends ModuleFactory { /** @type {ResourceDataWithData} */ let resourceData; - /** @type {string | undefined} */ - const scheme = getScheme(unresolvedResource); let loaders; @@ -594,7 +626,7 @@ class NormalModuleFactory extends ModuleFactory { this.resolveRequestArray( contextInfo, - context, + contextScheme ? this.context : context, elements, loaderResolver, resolveContext, @@ -605,6 +637,49 @@ class NormalModuleFactory extends ModuleFactory { } ); + const defaultResolve = context => { + if (/^($|\?)/.test(unresolvedResource)) { + resourceData = { + resource: unresolvedResource, + data: {}, + ...cacheParseResource(unresolvedResource) + }; + continueCallback(); + } + + // resource without scheme and with path + else { + const normalResolver = this.getResolver( + "normal", + dependencyType + ? cachedSetProperty( + resolveOptions || EMPTY_RESOLVE_OPTIONS, + "dependencyType", + dependencyType + ) + : resolveOptions + ); + this.resolveResource( + contextInfo, + context, + unresolvedResource, + normalResolver, + resolveContext, + (err, resolvedResource, resolvedResourceResolveData) => { + if (err) return continueCallback(err); + if (resolvedResource !== false) { + resourceData = { + resource: resolvedResource, + data: resolvedResourceResolveData, + ...cacheParseResource(resolvedResource) + }; + } + continueCallback(); + } + ); + } + }; + // resource with scheme if (scheme) { resourceData = { @@ -622,47 +697,26 @@ class NormalModuleFactory extends ModuleFactory { }); } - // resource without scheme and without path - else if (/^($|\?)/.test(unresolvedResource)) { + // resource within scheme + else if (contextScheme) { resourceData = { resource: unresolvedResource, data: {}, - ...cacheParseResource(unresolvedResource) + path: undefined, + query: undefined, + fragment: undefined }; - continueCallback(); + this.hooks.resolveInScheme + .for(contextScheme) + .callAsync(resourceData, data, (err, handled) => { + if (err) return continueCallback(err); + if (!handled) return defaultResolve(this.context); + continueCallback(); + }); } - // resource without scheme and with path - else { - const normalResolver = this.getResolver( - "normal", - dependencyType - ? cachedSetProperty( - resolveOptions || EMPTY_RESOLVE_OPTIONS, - "dependencyType", - dependencyType - ) - : resolveOptions - ); - this.resolveResource( - contextInfo, - context, - unresolvedResource, - normalResolver, - resolveContext, - (err, resolvedResource, resolvedResourceResolveData) => { - if (err) return continueCallback(err); - if (resolvedResource !== false) { - resourceData = { - resource: resolvedResource, - data: resolvedResourceResolveData, - ...cacheParseResource(resolvedResource) - }; - } - continueCallback(); - } - ); - } + // resource without scheme and without path + else defaultResolve(context); } ); } diff --git a/lib/WebpackOptionsApply.js b/lib/WebpackOptionsApply.js index 93954dfbc..2b1fc4309 100644 --- a/lib/WebpackOptionsApply.js +++ b/lib/WebpackOptionsApply.js @@ -276,6 +276,14 @@ class WebpackOptionsApply extends OptionsApply { }).apply(compiler); } + if (options.experiments.buildHttp) { + const HttpUriPlugin = require("./schemes/HttpUriPlugin"); + const httpOptions = options.experiments.buildHttp; + if (httpOptions === true) + throw new Error("Unexpected due to normalization"); + new HttpUriPlugin(httpOptions).apply(compiler); + } + new EntryOptionPlugin().apply(compiler); compiler.hooks.entryOption.call(options.context, options.entry); diff --git a/lib/asset/AssetModulesPlugin.js b/lib/asset/AssetModulesPlugin.js index c2d27acf2..0ceef1df0 100644 --- a/lib/asset/AssetModulesPlugin.js +++ b/lib/asset/AssetModulesPlugin.js @@ -120,7 +120,6 @@ class AssetModulesPlugin { for (const type of ["asset", "asset/inline", "asset/resource"]) { normalModuleFactory.hooks.createGenerator .for(type) - // eslint-disable-next-line no-loop-func .tap(plugin, generatorOptions => { validateGeneratorOptions[type](generatorOptions); diff --git a/lib/config/defaults.js b/lib/config/defaults.js index a3800d7cb..a7d5f56d7 100644 --- a/lib/config/defaults.js +++ b/lib/config/defaults.js @@ -171,7 +171,7 @@ const applyWebpackOptionsDefaults = options => { applySnapshotDefaults(options.snapshot, { production }); - applyExperimentsDefaults(options.experiments); + applyExperimentsDefaults(options.experiments, { production, development }); applyModuleDefaults(options.module, { cache, @@ -193,7 +193,10 @@ const applyWebpackOptionsDefaults = options => { module: options.module }); - applyExternalsPresetsDefaults(options.externalsPresets, { targetProperties }); + applyExternalsPresetsDefaults(options.externalsPresets, { + targetProperties, + buildHttp: !!options.experiments.buildHttp + }); applyLoaderDefaults(options.loader, { targetProperties }); @@ -245,13 +248,26 @@ const applyWebpackOptionsDefaults = options => { /** * @param {Experiments} experiments options + * @param {Object} options options + * @param {boolean} options.production is production + * @param {boolean} options.development is development mode * @returns {void} */ -const applyExperimentsDefaults = experiments => { +const applyExperimentsDefaults = (experiments, { production, development }) => { D(experiments, "topLevelAwait", false); D(experiments, "syncWebAssembly", false); D(experiments, "asyncWebAssembly", false); D(experiments, "outputModule", false); + D(experiments, "asset", false); + D(experiments, "executeModule", false); + D(experiments, "layers", false); + D(experiments, "lazyCompilation", false); + D(experiments, "buildHttp", false); + + if (typeof experiments.buildHttp === "object") { + D(experiments.buildHttp, "frozen", production); + D(experiments.buildHttp, "upgrade", development); + } }; /** @@ -860,13 +876,18 @@ const applyOutputDefaults = ( * @param {ExternalsPresets} externalsPresets options * @param {Object} options options * @param {TargetProperties | false} options.targetProperties target properties + * @param {boolean} options.buildHttp buildHttp experiment enabled * @returns {void} */ const applyExternalsPresetsDefaults = ( externalsPresets, - { targetProperties } + { targetProperties, buildHttp } ) => { - D(externalsPresets, "web", targetProperties && targetProperties.web); + D( + externalsPresets, + "web", + !buildHttp && targetProperties && targetProperties.web + ); D(externalsPresets, "node", targetProperties && targetProperties.node); D(externalsPresets, "nwjs", targetProperties && targetProperties.nwjs); D( diff --git a/lib/config/normalization.js b/lib/config/normalization.js index 144a26451..73cffb622 100644 --- a/lib/config/normalization.js +++ b/lib/config/normalization.js @@ -171,7 +171,12 @@ const getNormalizedWebpackOptions = config => { Promise.resolve().then(fn).then(getNormalizedEntryStatic) )(config.entry) : getNormalizedEntryStatic(config.entry), - experiments: cloneObject(config.experiments), + experiments: nestedConfig(config.experiments, experiments => ({ + ...experiments, + buildHttp: optionalNestedConfig(experiments.buildHttp, options => + options === true ? {} : options + ) + })), externals: config.externals, externalsPresets: cloneObject(config.externalsPresets), externalsType: config.externalsType, diff --git a/lib/index.js b/lib/index.js index d9df92ce1..91146933d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -554,9 +554,6 @@ module.exports = mergeExports(fn, { schemes: { get HttpUriPlugin() { return require("./schemes/HttpUriPlugin"); - }, - get HttpsUriPlugin() { - return require("./schemes/HttpsUriPlugin"); } } } diff --git a/lib/schemes/HttpUriPlugin.js b/lib/schemes/HttpUriPlugin.js index 92985f9c6..a3dc87667 100644 --- a/lib/schemes/HttpUriPlugin.js +++ b/lib/schemes/HttpUriPlugin.js @@ -5,56 +5,963 @@ "use strict"; +const { resolve, extname, dirname } = require("path"); const { URL } = require("url"); +const { createGunzip, createBrotliDecompress, createInflate } = require("zlib"); const NormalModule = require("../NormalModule"); +const createHash = require("../util/createHash"); +const { mkdirp } = require("../util/fs"); +const memoize = require("../util/memoize"); +/** @typedef {import("../../declarations/plugins/schemes/HttpUriPlugin").HttpUriPluginOptions} HttpUriPluginOptions */ /** @typedef {import("../Compiler")} Compiler */ +const getHttp = memoize(() => require("http")); +const getHttps = memoize(() => require("https")); + +const toSafePath = str => + str + .replace(/^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$/g, "") + .replace(/[^a-zA-Z0-9._-]+/g, "_"); + +const computeIntegrity = content => { + const hash = createHash("sha512"); + hash.update(content); + const integrity = "sha512-" + hash.digest("base64"); + return integrity; +}; + +const verifyIntegrity = (content, integrity) => { + if (integrity === "ignore") return true; + return computeIntegrity(content) === integrity; +}; + +/** + * @param {string} str input + * @returns {Record} parsed + */ +const parseKeyValuePairs = str => { + /** @type {Record} */ + const result = {}; + for (const item of str.split(",")) { + const i = item.indexOf("="); + if (i >= 0) { + const key = item.slice(0, i).trim(); + const value = item.slice(i + 1).trim(); + result[key] = value; + } else { + const key = item.trim(); + if (!key) continue; + result[key] = key; + } + } + return result; +}; + +const parseCacheControl = (cacheControl, requestTime) => { + // When false resource is not stored in cache + let storeCache = true; + // When false resource is not stored in lockfile cache + let storeLock = true; + // Resource is only revalidated, after that timestamp and when upgrade is chosen + let validUntil = 0; + if (cacheControl) { + const parsed = parseKeyValuePairs(cacheControl); + if (parsed["no-cache"]) storeCache = storeLock = false; + if (parsed["max-age"] && !isNaN(+parsed["max-age"])) { + validUntil = requestTime + +parsed["max-age"] * 1000; + } + if (parsed["must-revalidate"]) validUntil = 0; + } + return { + storeLock, + storeCache, + validUntil + }; +}; + +/** + * @typedef {Object} LockfileEntry + * @property {string} resolved + * @property {string} integrity + * @property {string} contentType + */ + +const areLockfileEntriesEqual = (a, b) => { + return ( + a.resolved === b.resolved && + a.integrity === b.integrity && + a.contentType === b.contentType + ); +}; + +const entryToString = entry => { + return `resolved: ${entry.resolved}, integrity: ${entry.integrity}, contentType: ${entry.contentType}`; +}; + +class Lockfile { + constructor() { + this.version = 1; + /** @type {Map} */ + this.entries = new Map(); + this.outdated = false; + } + + static parse(content) { + // TODO handle merge conflicts + const data = JSON.parse(content); + if (data.version !== 1) + throw new Error(`Unsupported lockfile version ${data.version}`); + const lockfile = new Lockfile(); + for (const key of Object.keys(data)) { + if (key === "version") continue; + const entry = data[key]; + lockfile.entries.set(key, entry); + } + return lockfile; + } + + toString() { + let str = "{\n"; + const entries = Array.from(this.entries).sort(([a], [b]) => + a < b ? -1 : 1 + ); + for (const [key, entry] of entries) { + if (typeof entry === "string") { + str += ` ${JSON.stringify(key)}: ${JSON.stringify(entry)},\n`; + } else { + str += ` ${JSON.stringify(key)}: { "resolved": ${JSON.stringify( + entry.resolved + )}, "integrity": ${JSON.stringify( + entry.integrity + )}, "contentType": ${JSON.stringify(entry.contentType)} },\n`; + } + } + str += ` "version": ${this.version}\n}\n`; + return str; + } +} + +/** + * @template R + * @param {function(function(Error=, R=): void): void} fn function + * @returns {function(function(Error=, R=): void): void} cached function + */ +const cachedWithoutKey = fn => { + let inFlight = false; + /** @type {Error | undefined} */ + let cachedError = undefined; + /** @type {R | undefined} */ + let cachedResult = undefined; + /** @type {(function(Error=, R=): void)[] | undefined} */ + let cachedCallbacks = undefined; + return callback => { + if (inFlight) { + if (cachedResult !== undefined) return callback(null, cachedResult); + if (cachedError !== undefined) return callback(cachedError); + if (cachedCallbacks === undefined) cachedCallbacks = [callback]; + else cachedCallbacks.push(callback); + return; + } + inFlight = true; + fn((err, result) => { + if (err) cachedError = err; + else cachedResult = result; + const callbacks = cachedCallbacks; + cachedCallbacks = undefined; + callback(err, result); + if (callbacks !== undefined) for (const cb of callbacks) cb(err, result); + }); + }; +}; + +/** + * @template T + * @template R + * @param {function(T, function(Error=, R=): void): void} fn function + * @param {function(T, function(Error=, R=): void): void=} forceFn function for the second try + * @returns {(function(T, function(Error=, R=): void): void) & { force: function(T, function(Error=, R=): void): void }} cached function + */ +const cachedWithKey = (fn, forceFn = fn) => { + /** @typedef {{ result?: R, error?: Error, callbacks?: (function(Error=, R=): void)[], force?: true }} CacheEntry */ + /** @type {Map} */ + const cache = new Map(); + const resultFn = (arg, callback) => { + const cacheEntry = cache.get(arg); + if (cacheEntry !== undefined) { + if (cacheEntry.result !== undefined) + return callback(null, cacheEntry.result); + if (cacheEntry.error !== undefined) return callback(cacheEntry.error); + if (cacheEntry.callbacks === undefined) cacheEntry.callbacks = [callback]; + else cacheEntry.callbacks.push(callback); + return; + } + /** @type {CacheEntry} */ + const newCacheEntry = { + result: undefined, + error: undefined, + callbacks: undefined + }; + cache.set(arg, newCacheEntry); + fn(arg, (err, result) => { + if (err) newCacheEntry.error = err; + else newCacheEntry.result = result; + const callbacks = newCacheEntry.callbacks; + newCacheEntry.callbacks = undefined; + callback(err, result); + if (callbacks !== undefined) for (const cb of callbacks) cb(err, result); + }); + }; + resultFn.force = (arg, callback) => { + const cacheEntry = cache.get(arg); + if (cacheEntry !== undefined && cacheEntry.force) { + if (cacheEntry.result !== undefined) + return callback(null, cacheEntry.result); + if (cacheEntry.error !== undefined) return callback(cacheEntry.error); + if (cacheEntry.callbacks === undefined) cacheEntry.callbacks = [callback]; + else cacheEntry.callbacks.push(callback); + return; + } + /** @type {CacheEntry} */ + const newCacheEntry = { + result: undefined, + error: undefined, + callbacks: undefined, + force: true + }; + cache.set(arg, newCacheEntry); + forceFn(arg, (err, result) => { + if (err) newCacheEntry.error = err; + else newCacheEntry.result = result; + const callbacks = newCacheEntry.callbacks; + newCacheEntry.callbacks = undefined; + callback(err, result); + if (callbacks !== undefined) for (const cb of callbacks) cb(err, result); + }); + }; + return resultFn; +}; + +/** + * @typedef {Object} HttpUriPluginAdvancedOptions + * @property {string | typeof import("../util/Hash")=} hashFunction + * @property {string=} hashDigest + * @property {number=} hashDigestLength + */ + class HttpUriPlugin { + /** + * @param {HttpUriPluginOptions & HttpUriPluginAdvancedOptions} options options + */ + constructor(options = {}) { + this._lockfileLocation = options.lockfileLocation; + this._cacheLocation = options.cacheLocation; + this._upgrade = options.upgrade; + this._frozen = options.frozen; + this._hashFunction = options.hashFunction; + this._hashDigest = options.hashDigest; + this._hashDigestLength = options.hashDigestLength; + } + /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { + const schemes = [ + { + scheme: "http", + fetch: (url, options, callback) => getHttp().get(url, options, callback) + }, + { + scheme: "https", + fetch: (url, options, callback) => + getHttps().get(url, options, callback) + } + ]; + let lockfileCache; compiler.hooks.compilation.tap( "HttpUriPlugin", (compilation, { normalModuleFactory }) => { - normalModuleFactory.hooks.resolveForScheme - .for("http") - .tap("HttpUriPlugin", resourceData => { - const url = new URL(resourceData.resource); - resourceData.path = url.origin + url.pathname; - resourceData.query = url.search; - resourceData.fragment = url.hash; - return /** @type {true} */ (true); - }); - NormalModule.getCompilationHooks(compilation) - .readResourceForScheme.for("http") - .tapAsync("HttpUriPlugin", (resource, module, callback) => { - return require("http").get(new URL(resource), res => { - if (res.statusCode !== 200) { - res.destroy(); - return callback( - new Error(`http request status code = ${res.statusCode}`) - ); - } + const intermediateFs = compiler.intermediateFileSystem; + const fs = compilation.inputFileSystem; + const cache = compilation.getCache("webpack.HttpUriPlugin"); + const logger = compilation.getLogger("webpack.HttpUriPlugin"); + const lockfileLocation = + this._lockfileLocation || + resolve( + compiler.context, + compiler.name + ? `${toSafePath(compiler.name)}.webpack.lock` + : "webpack.lock" + ); + const cacheLocation = + this._cacheLocation !== undefined + ? this._cacheLocation + : lockfileLocation + ".data"; + const upgrade = this._upgrade || false; + const frozen = this._frozen || false; + const hashFunction = + this._hashFunction || compilation.outputOptions.hashFunction; + const hashDigest = + this._hashDigest || compilation.outputOptions.hashDigest; + const hashDigestLength = + this._hashDigestLength || compilation.outputOptions.hashDigestLength; - const bufferArr = []; + let warnedAboutEol = false; - res.on("data", chunk => { - bufferArr.push(chunk); - }); + const cacheKeyCache = new Map(); + /** + * @param {string} url the url + * @returns {string} the key + */ + const getCacheKey = url => { + const cachedResult = cacheKeyCache.get(url); + if (cachedResult !== undefined) return cachedResult; + const result = _getCacheKey(url); + cacheKeyCache.set(url, result); + return result; + }; - res.on("end", () => { - if (!res.complete) { - return callback(new Error("http request was terminated")); + /** + * @param {string} url the url + * @returns {string} the key + */ + const _getCacheKey = url => { + const parsedUrl = new URL(url); + const folder = toSafePath(parsedUrl.origin); + const name = toSafePath(parsedUrl.pathname); + const query = toSafePath(parsedUrl.search); + let ext = extname(name); + if (ext.length > 20) ext = ""; + const basename = ext ? name.slice(0, -ext.length) : name; + const hash = createHash(hashFunction); + hash.update(url); + const digest = hash.digest(hashDigest).slice(0, hashDigestLength); + return `${folder.slice(-50)}/${`${basename}${ + query ? `_${query}` : "" + }`.slice(0, 150)}_${digest}${ext}`; + }; + + const getLockfile = cachedWithoutKey( + /** + * @param {function(Error=, Lockfile=): void} callback callback + * @returns {void} + */ + callback => { + const readLockfile = () => { + intermediateFs.readFile(lockfileLocation, (err, buffer) => { + if (err && err.code !== "ENOENT") { + compilation.missingDependencies.add(lockfileLocation); + return callback(err); } + compilation.fileDependencies.add(lockfileLocation); + compilation.fileSystemInfo.createSnapshot( + compiler.fsStartTime, + buffer ? [lockfileLocation] : [], + [], + buffer ? [] : [lockfileLocation], + { timestamp: true }, + (err, snapshot) => { + if (err) return callback(err); + const lockfile = buffer + ? Lockfile.parse(buffer.toString("utf-8")) + : new Lockfile(); + lockfileCache = { + lockfile, + snapshot + }; + callback(null, lockfile); + } + ); + }); + }; + if (lockfileCache) { + compilation.fileSystemInfo.checkSnapshotValid( + lockfileCache.snapshot, + (err, valid) => { + if (err) return callback(err); + if (!valid) return readLockfile(); + callback(null, lockfileCache.lockfile); + } + ); + } else { + readLockfile(); + } + } + ); - callback(null, Buffer.concat(bufferArr)); + let outdatedLockfile = undefined; + const storeLockEntry = (lockfile, url, entry) => { + const oldEntry = lockfile.entries.get(url); + lockfile.entries.set(url, entry); + outdatedLockfile = lockfile; + if (!oldEntry) { + logger.log(`${url} added to lockfile`); + } else if (typeof oldEntry === "string") { + if (typeof entry === "string") { + logger.log(`${url} updated in lockfile: ${oldEntry} -> ${entry}`); + } else { + logger.log( + `${url} updated in lockfile: ${oldEntry} -> ${entry.resolved}` + ); + } + } else if (typeof entry === "string") { + logger.log( + `${url} updated in lockfile: ${oldEntry.resolved} -> ${entry}` + ); + } else if (oldEntry.resolved !== entry.resolved) { + logger.log( + `${url} updated in lockfile: ${oldEntry.resolved} -> ${entry.resolved}` + ); + } else if (oldEntry.integrity !== entry.integrity) { + logger.log(`${url} updated in lockfile: content changed`); + } else if (oldEntry.contentType !== entry.contentType) { + logger.log( + `${url} updated in lockfile: ${oldEntry.contentType} -> ${entry.contentType}` + ); + } else { + logger.log(`${url} updated in lockfile`); + } + }; + + const storeResult = (lockfile, url, result, callback) => { + if (result.storeLock) { + storeLockEntry(lockfile, url, result.entry); + if (!cacheLocation || !result.content) + return callback(null, result); + const key = getCacheKey(result.entry.resolved); + const filePath = resolve(cacheLocation, key); + mkdirp(intermediateFs, dirname(filePath), err => { + if (err) return callback(err); + intermediateFs.writeFile(filePath, result.content, err => { + if (err) return callback(err); + callback(null, result); }); }); - }); + } else { + storeLockEntry(lockfile, url, "no-cache"); + callback(null, result); + } + }; + + for (const { scheme, fetch } of schemes) { + /** + * + * @param {string} url URL + * @param {string} integrity integrity + * @param {function(Error=, { entry: LockfileEntry, content: Buffer, storeLock: boolean }=): void} callback callback + */ + const resolveContent = (url, integrity, callback) => { + const handleResult = (err, result) => { + if (err) return callback(err); + if ("location" in result) { + return resolveContent( + result.location, + integrity, + (err, innerResult) => { + if (err) return callback(err); + callback(null, { + entry: innerResult.entry, + content: innerResult.content, + storeLock: innerResult.storeLock && result.storeLock + }); + } + ); + } else { + if ( + !result.fresh && + integrity && + result.entry.integrity !== integrity && + !verifyIntegrity(result.content, integrity) + ) { + return fetchContent.force(url, handleResult); + } + return callback(null, { + entry: result.entry, + content: result.content, + storeLock: result.storeLock + }); + } + }; + fetchContent(url, handleResult); + }; + + /** @typedef {{ storeCache: boolean, storeLock: boolean, validUntil: number, etag: string | undefined, fresh: boolean }} FetchResultMeta */ + /** @typedef {FetchResultMeta & { location: string }} RedirectFetchResult */ + /** @typedef {FetchResultMeta & { entry: LockfileEntry, content: Buffer }} ContentFetchResult */ + /** @typedef {RedirectFetchResult | ContentFetchResult} FetchResult */ + + /** + * @param {string} url URL + * @param {FetchResult} cachedResult result from cache + * @param {function(Error=, FetchResult=): void} callback callback + * @returns {void} + */ + const fetchContentRaw = (url, cachedResult, callback) => { + const requestTime = Date.now(); + fetch( + new URL(url), + { + headers: { + "accept-encoding": "gzip, deflate, br", + "user-agent": "webpack", + "if-none-match": cachedResult + ? cachedResult.etag || null + : null + } + }, + res => { + const etag = res.headers["etag"]; + const location = res.headers["location"]; + const cacheControl = res.headers["cache-control"]; + const { storeLock, storeCache, validUntil } = parseCacheControl( + cacheControl, + requestTime + ); + /** + * @param {Partial> & (Pick | Pick)} partialResult result + * @returns {void} + */ + const finishWith = partialResult => { + if ("location" in partialResult) { + logger.debug( + `GET ${url} [${res.statusCode}] -> ${partialResult.location}` + ); + } else { + logger.debug( + `GET ${url} [${res.statusCode}] ${Math.ceil( + partialResult.content.length / 1024 + )} kB${!storeLock ? " no-cache" : ""}` + ); + } + const result = { + ...partialResult, + fresh: true, + storeLock, + storeCache, + validUntil, + etag + }; + if (!storeCache) { + logger.log( + `${url} can't be stored in cache, due to Cache-Control header: ${cacheControl}` + ); + return callback(null, result); + } + cache.store( + url, + null, + { + ...result, + fresh: false + }, + err => { + if (err) { + logger.warn( + `${url} can't be stored in cache: ${err.message}` + ); + logger.debug(err.stack); + } + callback(null, result); + } + ); + }; + if (res.statusCode === 304) { + if ( + cachedResult.validUntil < validUntil || + cachedResult.storeLock !== storeLock || + cachedResult.storeCache !== storeCache || + cachedResult.etag !== etag + ) { + return finishWith(cachedResult); + } else { + logger.debug(`GET ${url} [${res.statusCode}] (unchanged)`); + return callback(null, { + ...cachedResult, + fresh: true + }); + } + } + if ( + location && + res.statusCode >= 301 && + res.statusCode <= 308 + ) { + return finishWith({ + location: new URL(location, url).href + }); + } + // Skypack uses this header to specify the final url + const importUrl = + res.statusCode === 200 && res.headers["x-import-url"]; + if (importUrl) { + return finishWith({ + location: new URL(importUrl, url).href + }); + } + const contentType = res.headers["content-type"] || ""; + const bufferArr = []; + + const contentEncoding = res.headers["content-encoding"]; + let stream = res; + if (contentEncoding === "gzip") { + stream = stream.pipe(createGunzip()); + } else if (contentEncoding === "br") { + stream = stream.pipe(createBrotliDecompress()); + } else if (contentEncoding === "deflate") { + stream = stream.pipe(createInflate()); + } + + stream.on("data", chunk => { + bufferArr.push(chunk); + }); + + stream.on("end", () => { + if (!res.complete) { + logger.log(`GET ${url} [${res.statusCode}] (terminated)`); + return callback(new Error(`${url} request was terminated`)); + } + + const content = Buffer.concat(bufferArr); + + if (res.statusCode !== 200) { + logger.log(`GET ${url} [${res.statusCode}]`); + return callback( + new Error( + `${url} request status code = ${ + res.statusCode + }\n${content.toString("utf-8")}` + ) + ); + } + + const integrity = computeIntegrity(content); + const entry = { resolved: url, integrity, contentType }; + + finishWith({ + entry, + content + }); + }); + } + ).on("error", err => { + logger.log(`GET ${url} (error)`); + err.message += `\nwhile fetching ${url}`; + callback(err); + }); + }; + + const fetchContent = cachedWithKey( + /** + * @param {string} url URL + * @param {function(Error=, { validUntil: number, etag?: string, entry: LockfileEntry, content: Buffer, fresh: boolean } | { validUntil: number, etag?: string, location: string, fresh: boolean }=): void} callback callback + * @returns {void} + */ (url, callback) => { + cache.get(url, null, (err, cachedResult) => { + if (err) return callback(err); + if (cachedResult) { + const isValid = cachedResult.validUntil >= Date.now(); + if (isValid) return callback(null, cachedResult); + } + fetchContentRaw(url, cachedResult, callback); + }); + }, + (url, callback) => fetchContentRaw(url, undefined, callback) + ); + + const getInfo = cachedWithKey( + /** + * @param {string} url the url + * @param {function(Error=, { entry: LockfileEntry, content: Buffer }=): void} callback callback + * @returns {void} + */ + (url, callback) => { + getLockfile((err, lockfile) => { + if (err) return callback(err); + const entryOrString = lockfile.entries.get(url); + if (!entryOrString) { + if (frozen) { + return callback( + new Error( + `${url} has no lockfile entry and lockfile is frozen` + ) + ); + } + resolveContent(url, null, (err, result) => { + if (err) return callback(err); + storeResult(lockfile, url, result, callback); + }); + return; + } + if (typeof entryOrString === "string") { + const entryTag = entryOrString; + resolveContent(url, null, (err, result) => { + if (err) return callback(err); + if (!result.storeLock || entryTag === "ignore") + return callback(null, result); + if (frozen) { + return callback( + new Error( + `${url} used to have ${entryTag} lockfile entry and has content now, but lockfile is frozen` + ) + ); + } + if (!upgrade) { + return callback( + new Error( + `${url} used to have ${entryTag} lockfile entry and has content now. +This should be reflected in the lockfile, so this lockfile entry must be upgraded, but upgrading is not enabled. +Remove this line from the lockfile to force upgrading.` + ) + ); + } + storeResult(lockfile, url, result, callback); + }); + return; + } + let entry = entryOrString; + const doFetch = lockedContent => { + resolveContent(url, entry.integrity, (err, result) => { + if (err) { + if (lockedContent) { + logger.warn( + `Upgrade request to ${url} failed: ${err.message}` + ); + logger.debug(err.stack); + return callback(null, { + entry, + content: lockedContent + }); + } + return callback(err); + } + if (!result.storeLock) { + // When the lockfile entry should be no-cache + // we need to update the lockfile + if (frozen) { + return callback( + new Error( + `${url} has a lockfile entry and is no-cache now, but lockfile is frozen\nLockfile: ${entryToString( + entry + )}` + ) + ); + } + storeResult(lockfile, url, result, callback); + return; + } + if (!areLockfileEntriesEqual(result.entry, entry)) { + // When the lockfile entry is outdated + // we need to update the lockfile + if (frozen) { + return callback( + new Error( + `${url} has an outdated lockfile entry, but lockfile is frozen\nLockfile: ${entryToString( + entry + )}\nExpected: ${entryToString(result.entry)}` + ) + ); + } + storeResult(lockfile, url, result, callback); + return; + } + if (!lockedContent && cacheLocation) { + // When the lockfile cache content is missing + // we need to update the lockfile + if (frozen) { + return callback( + new Error( + `${url} is missing content in the lockfile cache, but lockfile is frozen\nLockfile: ${entryToString( + entry + )}` + ) + ); + } + storeResult(lockfile, url, result, callback); + return; + } + return callback(null, result); + }); + }; + if (cacheLocation) { + // When there is a lockfile cache + // we read the content from there + const key = getCacheKey(entry.resolved); + const filePath = resolve(cacheLocation, key); + fs.readFile(filePath, (err, result) => { + const content = /** @type {Buffer} */ (result); + if (err) { + if (err.code === "ENOENT") return doFetch(); + return callback(err); + } + const continueWithCachedContent = result => { + if (!upgrade) { + // When not in upgrade mode, we accept the result from the lockfile cache + return callback(null, { entry, content }); + } + return doFetch(content); + }; + if (!verifyIntegrity(content, entry.integrity)) { + let contentWithChangedEol; + let isEolChanged = false; + try { + contentWithChangedEol = Buffer.from( + content.toString("utf-8").replace(/\r\n/g, "\n") + ); + isEolChanged = verifyIntegrity( + contentWithChangedEol, + entry.integrity + ); + } catch (e) { + // ignore + } + if (isEolChanged) { + if (!warnedAboutEol) { + const explainer = `Incorrect end of line sequence was detected in the lockfile cache. +The lockfile cache is protected by integrity checks, so any external modification will lead to a corrupted lockfile cache. +When using git make sure to configure .gitattributes correctly for the lockfile cache: + **/*webpack.lock.data/** -text +This will avoid that the end of line sequence is changed by git on Windows.`; + if (frozen) { + logger.error(explainer); + } else { + logger.warn(explainer); + logger.info( + "Lockfile cache will be automatically fixed now, but when lockfile is frozen this would result in an error." + ); + } + warnedAboutEol = true; + } + if (!frozen) { + // "fix" the end of line sequence of the lockfile content + logger.log( + `${filePath} fixed end of line sequence (\\r\\n instead of \\n).` + ); + intermediateFs.writeFile( + filePath, + contentWithChangedEol, + err => { + if (err) return callback(err); + continueWithCachedContent(contentWithChangedEol); + } + ); + return; + } + } + if (frozen) { + return callback( + new Error( + `${ + entry.resolved + } integrity mismatch, expected content with integrity ${ + entry.integrity + } but got ${computeIntegrity(content)}. +Lockfile corrupted (${ + isEolChanged + ? "end of line sequence was unexpectedly changed" + : "incorrectly merged? changed by other tools?" + }). +Run build with un-frozen lockfile to automatically fix lockfile.` + ) + ); + } else { + // "fix" the lockfile entry to the correct integrity + // the content has priority over the integrity value + entry = { + ...entry, + integrity: computeIntegrity(content) + }; + storeLockEntry(lockfile, url, entry); + } + } + continueWithCachedContent(result); + }); + } else { + doFetch(); + } + }); + } + ); + + normalModuleFactory.hooks.resolveForScheme + .for(scheme) + .tapAsync( + "HttpUriPlugin", + (resourceData, resolveData, callback) => { + getInfo(resourceData.resource, (err, result) => { + if (err) return callback(err); + const url = new URL(resourceData.resource); + resourceData.path = url.origin + url.pathname; + resourceData.query = url.search; + resourceData.fragment = url.hash; + resourceData.data.mimetype = result.entry.contentType; + callback(null, true); + }); + } + ); + normalModuleFactory.hooks.resolveInScheme + .for(scheme) + .tapAsync("HttpUriPlugin", (resourceData, data, callback) => { + // Only handle relative urls (./xxx, ../xxx, /xxx, //xxx) + if (!/^\.{0,2}\//.test(resourceData.resource)) { + return callback(); + } + const url = new URL(resourceData.resource, data.context + "/"); + getInfo(url.href, (err, result) => { + if (err) return callback(err); + resourceData.resource = url.href; + resourceData.path = url.origin + url.pathname; + resourceData.query = url.search; + resourceData.fragment = url.hash; + resourceData.data.mimetype = result.entry.contentType; + callback(null, true); + }); + }); + const hooks = NormalModule.getCompilationHooks(compilation); + hooks.readResourceForScheme + .for(scheme) + .tapAsync("HttpUriPlugin", (resource, module, callback) => { + return getInfo(resource, (err, result) => { + if (err) return callback(err); + callback(null, result.content); + }); + }); + hooks.needBuild.tapAsync( + "HttpUriPlugin", + (module, context, callback) => { + if ( + module.resource && + module.resource.startsWith(`${scheme}://`) + ) { + getInfo(module.resource, (err, result) => { + if (err) return callback(err); + if ( + result.entry.integrity !== + module.buildInfo.resourceIntegrity + ) { + return callback(null, true); + } + callback(); + }); + } else { + return callback(); + } + } + ); + } + compilation.hooks.finishModules.tapAsync( + "HttpUriPlugin", + (modules, callback) => { + if (!outdatedLockfile) return callback(); + intermediateFs.writeFile( + lockfileLocation, + outdatedLockfile.toString(), + callback + ); + } + ); } ); } diff --git a/lib/schemes/HttpsUriPlugin.js b/lib/schemes/HttpsUriPlugin.js deleted file mode 100644 index ced48b7b8..000000000 --- a/lib/schemes/HttpsUriPlugin.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const { URL } = require("url"); -const NormalModule = require("../NormalModule"); - -/** @typedef {import("../Compiler")} Compiler */ - -class HttpsUriPlugin { - /** - * Apply the plugin - * @param {Compiler} compiler the compiler instance - * @returns {void} - */ - apply(compiler) { - compiler.hooks.compilation.tap( - "HttpsUriPlugin", - (compilation, { normalModuleFactory }) => { - normalModuleFactory.hooks.resolveForScheme - .for("https") - .tap("HttpsUriPlugin", resourceData => { - const url = new URL(resourceData.resource); - resourceData.path = url.origin + url.pathname; - resourceData.query = url.search; - resourceData.fragment = url.hash; - return /** @type {true} */ (true); - }); - NormalModule.getCompilationHooks(compilation) - .readResourceForScheme.for("https") - .tapAsync("HttpsUriPlugin", (resource, module, callback) => { - return require("https").get(new URL(resource), res => { - if (res.statusCode !== 200) { - res.destroy(); - return callback( - new Error(`https request status code = ${res.statusCode}`) - ); - } - - const bufferArr = []; - - res.on("data", chunk => { - bufferArr.push(chunk); - }); - - res.on("end", () => { - if (!res.complete) { - return callback(new Error("https request was terminated")); - } - - callback(null, Buffer.concat(bufferArr)); - }); - }); - }); - } - ); - } -} - -module.exports = HttpsUriPlugin; diff --git a/lib/serialization/BinaryMiddleware.js b/lib/serialization/BinaryMiddleware.js index 4008cca8b..5228c9ccf 100644 --- a/lib/serialization/BinaryMiddleware.js +++ b/lib/serialization/BinaryMiddleware.js @@ -10,8 +10,6 @@ const SerializerMiddleware = require("./SerializerMiddleware"); /** @typedef {import("./types").BufferSerializableType} BufferSerializableType */ /** @typedef {import("./types").PrimitiveSerializableType} PrimitiveSerializableType */ -/* eslint-disable no-loop-func */ - /* Format: diff --git a/schemas/WebpackOptions.check.js b/schemas/WebpackOptions.check.js index 7e8f21780..8bf4ac7b8 100644 --- a/schemas/WebpackOptions.check.js +++ b/schemas/WebpackOptions.check.js @@ -3,4 +3,4 @@ * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ -const e=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;module.exports=Se,module.exports.default=Se;const t={amd:{$ref:"#/definitions/Amd"},bail:{$ref:"#/definitions/Bail"},cache:{$ref:"#/definitions/CacheOptions"},context:{$ref:"#/definitions/Context"},dependencies:{$ref:"#/definitions/Dependencies"},devServer:{$ref:"#/definitions/DevServer"},devtool:{$ref:"#/definitions/DevTool"},entry:{$ref:"#/definitions/Entry"},experiments:{$ref:"#/definitions/Experiments"},externals:{$ref:"#/definitions/Externals"},externalsPresets:{$ref:"#/definitions/ExternalsPresets"},externalsType:{$ref:"#/definitions/ExternalsType"},ignoreWarnings:{$ref:"#/definitions/IgnoreWarnings"},infrastructureLogging:{$ref:"#/definitions/InfrastructureLogging"},loader:{$ref:"#/definitions/Loader"},mode:{$ref:"#/definitions/Mode"},module:{$ref:"#/definitions/ModuleOptions"},name:{$ref:"#/definitions/Name"},node:{$ref:"#/definitions/Node"},optimization:{$ref:"#/definitions/Optimization"},output:{$ref:"#/definitions/Output"},parallelism:{$ref:"#/definitions/Parallelism"},performance:{$ref:"#/definitions/Performance"},plugins:{$ref:"#/definitions/Plugins"},profile:{$ref:"#/definitions/Profile"},recordsInputPath:{$ref:"#/definitions/RecordsInputPath"},recordsOutputPath:{$ref:"#/definitions/RecordsOutputPath"},recordsPath:{$ref:"#/definitions/RecordsPath"},resolve:{$ref:"#/definitions/Resolve"},resolveLoader:{$ref:"#/definitions/ResolveLoader"},snapshot:{$ref:"#/definitions/SnapshotOptions"},stats:{$ref:"#/definitions/StatsValue"},target:{$ref:"#/definitions/Target"},watch:{$ref:"#/definitions/Watch"},watchOptions:{$ref:"#/definitions/WatchOptions"}},n=Object.prototype.hasOwnProperty,r={allowCollectingMemory:{type:"boolean"},buildDependencies:{type:"object",additionalProperties:{type:"array",items:{type:"string",minLength:1}}},cacheDirectory:{type:"string",absolutePath:!0},cacheLocation:{type:"string",absolutePath:!0},compression:{enum:[!1,"gzip","brotli"]},hashAlgorithm:{type:"string"},idleTimeout:{type:"number",minimum:0},idleTimeoutAfterLargeChanges:{type:"number",minimum:0},idleTimeoutForInitialStore:{type:"number",minimum:0},immutablePaths:{type:"array",items:{type:"string",absolutePath:!0,minLength:1}},managedPaths:{type:"array",items:{type:"string",absolutePath:!0,minLength:1}},maxAge:{type:"number",minimum:0},maxMemoryGenerations:{type:"number",minimum:0},name:{type:"string"},profile:{type:"boolean"},store:{enum:["pack"]},type:{enum:["filesystem"]},version:{type:"string"}};function s(t,{instancePath:o="",parentData:a,parentDataProperty:i,rootData:l=t}={}){let p=null,f=0;const u=f;let c=!1;const m=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var y=m===f;if(c=c||y,!c){const s=f;if(f==f)if(t&&"object"==typeof t&&!Array.isArray(t)){let e;if(void 0===t.type&&(e="type")){const t={params:{missingProperty:e}};null===p?p=[t]:p.push(t),f++}else{const e=f;for(const e in t)if("maxGenerations"!==e&&"type"!==e){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),f++;break}if(e===f){if(void 0!==t.maxGenerations){let e=t.maxGenerations;const n=f;if(f===n)if("number"==typeof e&&isFinite(e)){if(e<1||isNaN(e)){const e={params:{comparison:">=",limit:1}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}var h=n===f}else h=!0;if(h)if(void 0!==t.type){const e=f;if("memory"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}if(y=s===f,c=c||y,!c){const s=f;if(f==f)if(t&&"object"==typeof t&&!Array.isArray(t)){let s;if(void 0===t.type&&(s="type")){const e={params:{missingProperty:s}};null===p?p=[e]:p.push(e),f++}else{const s=f;for(const e in t)if(!n.call(r,e)){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),f++;break}if(s===f){if(void 0!==t.allowCollectingMemory){const e=f;if("boolean"!=typeof t.allowCollectingMemory){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}var d=e===f}else d=!0;if(d){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=f;if(f===r)if(Array.isArray(n)){const e=n.length;for(let t=0;t=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.idleTimeoutAfterLargeChanges){let e=t.idleTimeoutAfterLargeChanges;const n=f;if(f===n)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.idleTimeoutForInitialStore){let e=t.idleTimeoutForInitialStore;const n=f;if(f===n)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r)if(Array.isArray(n)){const t=n.length;for(let r=0;r=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.maxMemoryGenerations){let e=t.maxMemoryGenerations;const n=f;if(f===n)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.name){const e=f;if("string"!=typeof t.name){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d){if(void 0!==t.profile){const e=f;if("boolean"!=typeof t.profile){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d){if(void 0!==t.store){const e=f;if("pack"!==t.store){const e={params:{}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d){if(void 0!==t.type){const e=f;if("filesystem"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d)if(void 0!==t.version){const e=f;if("string"!=typeof t.version){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0}}}}}}}}}}}}}}}}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}y=s===f,c=c||y}}if(!c){const e={params:{}};return null===p?p=[e]:p.push(e),f++,s.errors=p,!1}return f=u,null!==p&&(u?p.length=u:p=null),s.errors=p,0===f}function o(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:a=e}={}){let i=null,l=0;const p=l;let f=!1;const u=l;if(!0!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var c=u===l;if(f=f||c,!f){const o=l;s(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:a})||(i=null===i?s.errors:i.concat(s.errors),l=i.length),c=o===l,f=f||c}if(!f){const e={params:{}};return null===i?i=[e]:i.push(e),l++,o.errors=i,!1}return l=p,null!==i&&(p?i.length=p:i=null),o.errors=i,0===l}const a={chunkLoading:{$ref:"#/definitions/ChunkLoading"},dependOn:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},{type:"string",minLength:1}]},filename:{$ref:"#/definitions/EntryFilename"},import:{$ref:"#/definitions/EntryItem"},layer:{$ref:"#/definitions/Layer"},library:{$ref:"#/definitions/LibraryOptions"},publicPath:{$ref:"#/definitions/PublicPath"},runtime:{$ref:"#/definitions/EntryRuntime"},wasmLoading:{$ref:"#/definitions/WasmLoading"}};function i(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const l=a;let p=!1;const f=a;if(!1!==e){const e={params:{}};null===o?o=[e]:o.push(e),a++}var u=f===a;if(p=p||u,!p){const t=a,n=a;let r=!1;const s=a;if("jsonp"!==e&&"import-scripts"!==e&&"require"!==e&&"async-node"!==e&&"import"!==e){const e={params:{}};null===o?o=[e]:o.push(e),a++}var c=s===a;if(r=r||c,!r){const t=a;if("string"!=typeof e){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a,r=r||c}if(r)a=n,null!==o&&(n?o.length=n:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}u=t===a,p=p||u}if(!p){const e={params:{}};return null===o?o=[e]:o.push(e),a++,i.errors=o,!1}return a=l,null!==o&&(l?o.length=l:o=null),i.errors=o,0===a}function l(t,{instancePath:n="",parentData:r,parentDataProperty:s,rootData:o=t}={}){let a=null,i=0;const p=i;let f=!1,u=null;const c=i,m=i;let y=!1;const h=i;if(i===h)if("string"==typeof t){if(t.includes("!")||!1!==e.test(t)){const e={params:{}};null===a?a=[e]:a.push(e),i++}else if(t.length<1){const e={params:{}};null===a?a=[e]:a.push(e),i++}}else{const e={params:{type:"string"}};null===a?a=[e]:a.push(e),i++}var d=h===i;if(y=y||d,!y){const e=i;if(!(t instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),i++}d=e===i,y=y||d}if(y)i=m,null!==a&&(m?a.length=m:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),i++}if(c===i&&(f=!0,u=0),!f){const e={params:{passingSchemas:u}};return null===a?a=[e]:a.push(e),i++,l.errors=a,!1}return i=p,null!==a&&(p?a.length=p:a=null),l.errors=a,0===i}function p(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const f=a;if("string"!=typeof e){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}var u=f===a;if(l=l||u,!l){const t=a;if(a==a)if(e&&"object"==typeof e&&!Array.isArray(e)){const t=a;for(const t in e)if("amd"!==t&&"commonjs"!==t&&"commonjs2"!==t&&"root"!==t){const e={params:{additionalProperty:t}};null===o?o=[e]:o.push(e),a++;break}if(t===a){if(void 0!==e.amd){const t=a;if("string"!=typeof e.amd){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}var c=t===a}else c=!0;if(c){if(void 0!==e.commonjs){const t=a;if("string"!=typeof e.commonjs){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0;if(c){if(void 0!==e.commonjs2){const t=a;if("string"!=typeof e.commonjs2){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0;if(c)if(void 0!==e.root){const t=a;if("string"!=typeof e.root){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0}}}}else{const e={params:{type:"object"}};null===o?o=[e]:o.push(e),a++}u=t===a,l=l||u}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,p.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),p.errors=o,0===a}function f(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;if(a===p)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{const t=e.length;for(let n=0;n1){const r={};for(;n--;){let s=t[n];if("string"==typeof s){if("number"==typeof r[s]){e=r[s];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var g=o===f;if(s=s||g,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}g=e===f,s=s||g}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,y.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h){if(void 0!==e.filename){const n=f;l(e.filename,{instancePath:t+"/filename",parentData:e,parentDataProperty:"filename",rootData:o})||(p=null===p?l.errors:p.concat(l.errors),f=p.length),h=n===f}else h=!0;if(h){if(void 0!==e.import){let t=e.import;const n=f,r=f;let s=!1;const o=f;if(f===o)if(Array.isArray(t))if(t.length<1){const e={params:{limit:1}};null===p?p=[e]:p.push(e),f++}else{var b=!0;const e=t.length;for(let n=0;n1){const r={};for(;n--;){let s=t[n];if("string"==typeof s){if("number"==typeof r[s]){e=r[s];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var v=o===f;if(s=s||v,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=e===f,s=s||v}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,y.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h){if(void 0!==e.layer){let t=e.layer;const n=f,r=f;let s=!1;const o=f;if(null!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var D=o===f;if(s=s||D,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}D=e===f,s=s||D}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,y.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h){if(void 0!==e.library){const n=f;u(e.library,{instancePath:t+"/library",parentData:e,parentDataProperty:"library",rootData:o})||(p=null===p?u.errors:p.concat(u.errors),f=p.length),h=n===f}else h=!0;if(h){if(void 0!==e.publicPath){const n=f;c(e.publicPath,{instancePath:t+"/publicPath",parentData:e,parentDataProperty:"publicPath",rootData:o})||(p=null===p?c.errors:p.concat(c.errors),f=p.length),h=n===f}else h=!0;if(h){if(void 0!==e.runtime){let t=e.runtime;const n=f,r=f;let s=!1;const o=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var P=o===f;if(s=s||P,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}P=e===f,s=s||P}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,y.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h)if(void 0!==e.wasmLoading){const n=f;m(e.wasmLoading,{instancePath:t+"/wasmLoading",parentData:e,parentDataProperty:"wasmLoading",rootData:o})||(p=null===p?m.errors:p.concat(m.errors),f=p.length),h=n===f}else h=!0}}}}}}}}}}}return y.errors=p,0===f}function h(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;if(0===a){if(!e||"object"!=typeof e||Array.isArray(e))return h.errors=[{params:{type:"object"}}],!1;for(const n in e){let r=e[n];const f=a,u=a;let c=!1;const m=a,d=a;let g=!1;const b=a;if(a===b)if(Array.isArray(r))if(r.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{var i=!0;const e=r.length;for(let t=0;t1){const n={};for(;t--;){let s=r[t];if("string"==typeof s){if("number"==typeof n[s]){e=n[s];const r={params:{i:t,j:e}};null===o?o=[r]:o.push(r),a++;break}n[s]=t}}}}}else{const e={params:{type:"array"}};null===o?o=[e]:o.push(e),a++}var l=b===a;if(g=g||l,!g){const e=a;if(a===e)if("string"==typeof r){if(r.length<1){const e={params:{}};null===o?o=[e]:o.push(e),a++}}else{const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}l=e===a,g=g||l}if(g)a=d,null!==o&&(d?o.length=d:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}var p=m===a;if(c=c||p,!c){const i=a;y(r,{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:s})||(o=null===o?y.errors:o.concat(y.errors),a=o.length),p=i===a,c=c||p}if(!c){const e={params:{}};return null===o?o=[e]:o.push(e),a++,h.errors=o,!1}if(a=u,null!==o&&(u?o.length=u:o=null),f!==a)break}}return h.errors=o,0===a}function d(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1,p=null;const f=a,u=a;let c=!1;const m=a;if(a===m)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{var y=!0;const t=e.length;for(let n=0;n1){const r={};for(;n--;){let s=e[n];if("string"==typeof s){if("number"==typeof r[s]){t=r[s];const e={params:{i:n,j:t}};null===o?o=[e]:o.push(e),a++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===o?o=[e]:o.push(e),a++}var h=m===a;if(c=c||h,!c){const t=a;if(a===t)if("string"==typeof e){if(e.length<1){const e={params:{}};null===o?o=[e]:o.push(e),a++}}else{const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}h=t===a,c=c||h}if(c)a=u,null!==o&&(u?o.length=u:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}if(f===a&&(l=!0,p=0),!l){const e={params:{passingSchemas:p}};return null===o?o=[e]:o.push(e),a++,d.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),d.errors=o,0===a}function g(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;h(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?h.errors:o.concat(h.errors),a=o.length);var f=p===a;if(l=l||f,!l){const i=a;d(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?d.errors:o.concat(d.errors),a=o.length),f=i===a,l=l||f}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,g.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),g.errors=o,0===a}function b(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;if(!(e instanceof Function)){const e={params:{}};null===o?o=[e]:o.push(e),a++}var f=p===a;if(l=l||f,!l){const i=a;g(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?g.errors:o.concat(g.errors),a=o.length),f=i===a,l=l||f}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,b.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),b.errors=o,0===a}const v={validate:D};function D(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;if(!(e instanceof RegExp)){const e={params:{}};null===o?o=[e]:o.push(e),a++}var f=p===a;if(l=l||f,!l){const n=a;if("string"!=typeof e){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}if(f=n===a,l=l||f,!l){const n=a;if(a===n)if(e&&"object"==typeof e&&!Array.isArray(e)){const n=a;for(const t in e)if("byLayer"!==t){let n=e[t];const r=a,s=a;let i=!1;const l=a;if(a===l)if(Array.isArray(n)){const e=n.length;for(let t=0;t=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var u=m===l;if(c=c||u,!c){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}u=t===l,c=c||u}if(c)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,s=l;let o=!1;const a=l;if(l===a)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===i?i=[e]:i.push(e),l++}else if(n.length<1){const e={params:{}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}var c=a===l;if(o=o||c,!o){const e=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}c=e===l,o=o||c}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=s,null!==i&&(s?i.length=s:i=null),p=r===l}else p=!0;if(p){if(void 0!==t.idHint){const e=l;if("string"!=typeof t.idHint)return re.errors=[{params:{type:"string"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.layer){let e=t.layer;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var m=o===l;if(s=s||m,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(m=t===l,s=s||m,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}m=t===l,s=s||m}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return re.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return re.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var y=c===l;if(u=u||y,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}y=t===l,u=u||y}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return re.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return re.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var h=c===l;if(u=u||h,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}h=t===l,u=u||h}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var d=c===l;if(u=u||d,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}d=t===l,u=u||d}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return re.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return re.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var g=c===l;if(u=u||g,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}g=t===l,u=u||g}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var b=c===l;if(u=u||b,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}b=t===l,u=u||b}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let s=!1;const o=l;if(!1!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var v=o===l;if(s=s||v,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(v=t===l,s=s||v,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}v=t===l,s=s||v}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.priority){let e=t.priority;const n=l;if("number"!=typeof e||!isFinite(e))return re.errors=[{params:{type:"number"}}],!1;p=n===l}else p=!0;if(p){if(void 0!==t.reuseExistingChunk){const e=l;if("boolean"!=typeof t.reuseExistingChunk)return re.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.test){let e=t.test;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var D=o===l;if(s=s||D,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(D=t===l,s=s||D,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}D=t===l,s=s||D}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.type){let e=t.type;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var P=o===l;if(s=s||P,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(P=t===l,s=s||P,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}P=t===l,s=s||P}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,re.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return re.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}}}return re.errors=i,0===l}function se(t,{instancePath:r="",parentData:s,parentDataProperty:o,rootData:a=t}={}){let i=null,l=0;if(0===l){if(!t||"object"!=typeof t||Array.isArray(t))return se.errors=[{params:{type:"object"}}],!1;{const s=l;for(const e in t)if(!n.call(te,e))return se.errors=[{params:{additionalProperty:e}}],!1;if(s===l){if(void 0!==t.automaticNameDelimiter){let e=t.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof e)return se.errors=[{params:{type:"string"}}],!1;if(e.length<1)return se.errors=[{params:{}}],!1}var p=n===l}else p=!0;if(p){if(void 0!==t.cacheGroups){let e=t.cacheGroups;const n=l,s=l,o=l;if(l===o)if(e&&"object"==typeof e&&!Array.isArray(e)){let t;if(void 0===e.test&&(t="test")){const e={};null===i?i=[e]:i.push(e),l++}else if(void 0!==e.test){let t=e.test;const n=l;let r=!1;const s=l;if(!(t instanceof RegExp)){const e={};null===i?i=[e]:i.push(e),l++}var f=s===l;if(r=r||f,!r){const e=l;if("string"!=typeof t){const e={};null===i?i=[e]:i.push(e),l++}if(f=e===l,r=r||f,!r){const e=l;if(!(t instanceof Function)){const e={};null===i?i=[e]:i.push(e),l++}f=e===l,r=r||f}}if(r)l=n,null!==i&&(n?i.length=n:i=null);else{const e={};null===i?i=[e]:i.push(e),l++}}}else{const e={};null===i?i=[e]:i.push(e),l++}if(o===l)return se.errors=[{params:{}}],!1;if(l=s,null!==i&&(s?i.length=s:i=null),l===n){if(!e||"object"!=typeof e||Array.isArray(e))return se.errors=[{params:{type:"object"}}],!1;for(const t in e){let n=e[t];const s=l,o=l;let p=!1;const f=l;if(!1!==n){const e={params:{}};null===i?i=[e]:i.push(e),l++}var u=f===l;if(p=p||u,!p){const s=l;if(!(n instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}if(u=s===l,p=p||u,!p){const s=l;if("string"!=typeof n){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(u=s===l,p=p||u,!p){const s=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}if(u=s===l,p=p||u,!p){const s=l;re(n,{instancePath:r+"/cacheGroups/"+t.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:t,rootData:a})||(i=null===i?re.errors:i.concat(re.errors),l=i.length),u=s===l,p=p||u}}}}if(!p){const e={params:{}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}if(l=o,null!==i&&(o?i.length=o:i=null),s!==l)break}}p=n===l}else p=!0;if(p){if(void 0!==t.chunks){let e=t.chunks;const n=l,r=l;let s=!1;const o=l;if("initial"!==e&&"async"!==e&&"all"!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var c=o===l;if(s=s||c,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}c=t===l,s=s||c}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.defaultSizeTypes){let e=t.defaultSizeTypes;const n=l;if(l===n){if(!Array.isArray(e))return se.errors=[{params:{type:"array"}}],!1;if(e.length<1)return se.errors=[{params:{limit:1}}],!1;{const t=e.length;for(let n=0;n=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var m=c===l;if(u=u||m,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}m=t===l,u=u||m}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.fallbackCacheGroup){let e=t.fallbackCacheGroup;const n=l;if(l===n){if(!e||"object"!=typeof e||Array.isArray(e))return se.errors=[{params:{type:"object"}}],!1;{const t=l;for(const t in e)if("automaticNameDelimiter"!==t&&"maxAsyncSize"!==t&&"maxInitialSize"!==t&&"maxSize"!==t&&"minSize"!==t)return se.errors=[{params:{additionalProperty:t}}],!1;if(t===l){if(void 0!==e.automaticNameDelimiter){let t=e.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof t)return se.errors=[{params:{type:"string"}}],!1;if(t.length<1)return se.errors=[{params:{}}],!1}var y=n===l}else y=!0;if(y){if(void 0!==e.maxAsyncSize){let t=e.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t&&isFinite(t)){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var h=u===l;if(f=f||h,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){let n=t[e];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}h=e===l,f=f||h}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y){if(void 0!==e.maxInitialSize){let t=e.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t&&isFinite(t)){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var d=u===l;if(f=f||d,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){let n=t[e];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}d=e===l,f=f||d}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y){if(void 0!==e.maxSize){let t=e.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t&&isFinite(t)){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var g=u===l;if(f=f||g,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){let n=t[e];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}g=e===l,f=f||g}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y)if(void 0!==e.minSize){let t=e.minSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t&&isFinite(t)){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var b=u===l;if(f=f||b,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){let n=t[e];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}b=e===l,f=f||b}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0}}}}}}p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,s=l;let o=!1;const a=l;if(l===a)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===i?i=[e]:i.push(e),l++}else if(n.length<1){const e={params:{}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}var v=a===l;if(o=o||v,!o){const e=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}v=e===l,o=o||v}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=s,null!==i&&(s?i.length=s:i=null),p=r===l}else p=!0;if(p){if(void 0!==t.hidePathInfo){const e=l;if("boolean"!=typeof t.hidePathInfo)return se.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return se.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return se.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var D=c===l;if(u=u||D,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}D=t===l,u=u||D}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return se.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return se.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var P=c===l;if(u=u||P,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}P=t===l,u=u||P}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var A=c===l;if(u=u||A,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}A=t===l,u=u||A}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return se.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return se.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var x=c===l;if(u=u||x,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}x=t===l,u=u||x}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var k=c===l;if(u=u||k,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}k=t===l,u=u||k}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let s=!1;const o=l;if(!1!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var j=o===l;if(s=s||j,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(j=t===l,s=s||j,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}j=t===l,s=s||j}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,se.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return se.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}return se.errors=i,0===l}function oe(e,{instancePath:t="",parentData:r,parentDataProperty:s,rootData:o=e}={}){let a=null,i=0;if(0===i){if(!e||"object"!=typeof e||Array.isArray(e))return oe.errors=[{params:{type:"object"}}],!1;{const r=i;for(const t in e)if(!n.call(ee,t))return oe.errors=[{params:{additionalProperty:t}}],!1;if(r===i){if(void 0!==e.checkWasmTypes){const t=i;if("boolean"!=typeof e.checkWasmTypes)return oe.errors=[{params:{type:"boolean"}}],!1;var l=t===i}else l=!0;if(l){if(void 0!==e.chunkIds){let t=e.chunkIds;const n=i;if("natural"!==t&&"named"!==t&&"deterministic"!==t&&"size"!==t&&"total-size"!==t&&!1!==t)return oe.errors=[{params:{}}],!1;l=n===i}else l=!0;if(l){if(void 0!==e.concatenateModules){const t=i;if("boolean"!=typeof e.concatenateModules)return oe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.emitOnErrors){const t=i;if("boolean"!=typeof e.emitOnErrors)return oe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.flagIncludedChunks){const t=i;if("boolean"!=typeof e.flagIncludedChunks)return oe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.innerGraph){const t=i;if("boolean"!=typeof e.innerGraph)return oe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.mangleExports){let t=e.mangleExports;const n=i,r=i;let s=!1;const o=i;if("size"!==t&&"deterministic"!==t){const e={params:{}};null===a?a=[e]:a.push(e),i++}var p=o===i;if(s=s||p,!s){const e=i;if("boolean"!=typeof t){const e={params:{type:"boolean"}};null===a?a=[e]:a.push(e),i++}p=e===i,s=s||p}if(!s){const e={params:{}};return null===a?a=[e]:a.push(e),i++,oe.errors=a,!1}i=r,null!==a&&(r?a.length=r:a=null),l=n===i}else l=!0;if(l){if(void 0!==e.mangleWasmImports){const t=i;if("boolean"!=typeof e.mangleWasmImports)return oe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.mergeDuplicateChunks){const t=i;if("boolean"!=typeof e.mergeDuplicateChunks)return oe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.minimize){const t=i;if("boolean"!=typeof e.minimize)return oe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.minimizer){let t=e.minimizer;const n=i;if(i===n){if(!Array.isArray(t))return oe.errors=[{params:{type:"array"}}],!1;{const e=t.length;for(let n=0;n=",limit:1}}],!1}y=n===f}else y=!0;if(y){if(void 0!==t.hashFunction){let e=t.hashFunction;const n=f,r=f;let s=!1;const o=f;if(f===o)if("string"==typeof e){if(e.length<1){const e={params:{}};null===l?l=[e]:l.push(e),f++}}else{const e={params:{type:"string"}};null===l?l=[e]:l.push(e),f++}var v=o===f;if(s=s||v,!s){const t=f;if(!(e instanceof Function)){const e={params:{}};null===l?l=[e]:l.push(e),f++}v=t===f,s=s||v}if(!s){const e={params:{}};return null===l?l=[e]:l.push(e),f++,ye.errors=l,!1}f=r,null!==l&&(r?l.length=r:l=null),y=n===f}else y=!0;if(y){if(void 0!==t.hashSalt){let e=t.hashSalt;const n=f;if(f==f){if("string"!=typeof e)return ye.errors=[{params:{type:"string"}}],!1;if(e.length<1)return ye.errors=[{params:{}}],!1}y=n===f}else y=!0;if(y){if(void 0!==t.hotUpdateChunkFilename){let n=t.hotUpdateChunkFilename;const r=f;if(f==f){if("string"!=typeof n)return ye.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return ye.errors=[{params:{}}],!1}y=r===f}else y=!0;if(y){if(void 0!==t.hotUpdateGlobal){const e=f;if("string"!=typeof t.hotUpdateGlobal)return ye.errors=[{params:{type:"string"}}],!1;y=e===f}else y=!0;if(y){if(void 0!==t.hotUpdateMainFilename){let n=t.hotUpdateMainFilename;const r=f;if(f==f){if("string"!=typeof n)return ye.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return ye.errors=[{params:{}}],!1}y=r===f}else y=!0;if(y){if(void 0!==t.iife){const e=f;if("boolean"!=typeof t.iife)return ye.errors=[{params:{type:"boolean"}}],!1;y=e===f}else y=!0;if(y){if(void 0!==t.importFunctionName){const e=f;if("string"!=typeof t.importFunctionName)return ye.errors=[{params:{type:"string"}}],!1;y=e===f}else y=!0;if(y){if(void 0!==t.importMetaName){const e=f;if("string"!=typeof t.importMetaName)return ye.errors=[{params:{type:"string"}}],!1;y=e===f}else y=!0;if(y){if(void 0!==t.library){const e=f;me(t.library,{instancePath:r+"/library",parentData:t,parentDataProperty:"library",rootData:a})||(l=null===l?me.errors:l.concat(me.errors),f=l.length),y=e===f}else y=!0;if(y){if(void 0!==t.libraryExport){let e=t.libraryExport;const n=f,r=f;let s=!1,o=null;const a=f,i=f;let p=!1;const u=f;if(f===u)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:1}}],!1}c=t===f}else c=!0;if(c){if(void 0!==r.performance){const e=f;he(r.performance,{instancePath:s+"/performance",parentData:r,parentDataProperty:"performance",rootData:l})||(p=null===p?he.errors:p.concat(he.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.plugins){const e=f;de(r.plugins,{instancePath:s+"/plugins",parentData:r,parentDataProperty:"plugins",rootData:l})||(p=null===p?de.errors:p.concat(de.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.profile){const e=f;if("boolean"!=typeof r.profile)return Se.errors=[{params:{type:"boolean"}}],!1;c=e===f}else c=!0;if(c){if(void 0!==r.recordsInputPath){let t=r.recordsInputPath;const n=f,s=f;let o=!1;const a=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var k=a===f;if(o=o||k,!o){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}k=n===f,o=o||k}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,Se.errors=p,!1}f=s,null!==p&&(s?p.length=s:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsOutputPath){let t=r.recordsOutputPath;const n=f,s=f;let o=!1;const a=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var j=a===f;if(o=o||j,!o){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}j=n===f,o=o||j}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,Se.errors=p,!1}f=s,null!==p&&(s?p.length=s:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsPath){let t=r.recordsPath;const n=f,s=f;let o=!1;const a=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var S=a===f;if(o=o||S,!o){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}S=n===f,o=o||S}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,Se.errors=p,!1}f=s,null!==p&&(s?p.length=s:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.resolve){const e=f;ge(r.resolve,{instancePath:s+"/resolve",parentData:r,parentDataProperty:"resolve",rootData:l})||(p=null===p?ge.errors:p.concat(ge.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.resolveLoader){const e=f;be(r.resolveLoader,{instancePath:s+"/resolveLoader",parentData:r,parentDataProperty:"resolveLoader",rootData:l})||(p=null===p?be.errors:p.concat(be.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.snapshot){let t=r.snapshot;const n=f;if(f==f){if(!t||"object"!=typeof t||Array.isArray(t))return Se.errors=[{params:{type:"object"}}],!1;{const n=f;for(const e in t)if("buildDependencies"!==e&&"immutablePaths"!==e&&"managedPaths"!==e&&"module"!==e&&"resolve"!==e&&"resolveBuildDependencies"!==e)return Se.errors=[{params:{additionalProperty:e}}],!1;if(n===f){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n){if(!e||"object"!=typeof e||Array.isArray(e))return Se.errors=[{params:{type:"object"}}],!1;{const t=f;for(const t in e)if("hash"!==t&&"timestamp"!==t)return Se.errors=[{params:{additionalProperty:t}}],!1;if(t===f){if(void 0!==e.hash){const t=f;if("boolean"!=typeof e.hash)return Se.errors=[{params:{type:"boolean"}}],!1;var C=t===f}else C=!0;if(C)if(void 0!==e.timestamp){const t=f;if("boolean"!=typeof e.timestamp)return Se.errors=[{params:{type:"boolean"}}],!1;C=t===f}else C=!0}}}var F=n===f}else F=!0;if(F){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r){if(!Array.isArray(n))return Se.errors=[{params:{type:"array"}}],!1;{const t=n.length;for(let r=0;r=",limit:1}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}var h=n===f}else h=!0;if(h)if(void 0!==t.type){const e=f;if("memory"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}if(m=s===f,c=c||m,!c){const s=f;if(f==f)if(t&&"object"==typeof t&&!Array.isArray(t)){let s;if(void 0===t.type&&(s="type")){const e={params:{missingProperty:s}};null===p?p=[e]:p.push(e),f++}else{const s=f;for(const e in t)if(!n.call(r,e)){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),f++;break}if(s===f){if(void 0!==t.allowCollectingMemory){const e=f;if("boolean"!=typeof t.allowCollectingMemory){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}var d=e===f}else d=!0;if(d){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=f;if(f===r)if(Array.isArray(n)){const e=n.length;for(let t=0;t=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.idleTimeoutAfterLargeChanges){let e=t.idleTimeoutAfterLargeChanges;const n=f;if(f===n)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.idleTimeoutForInitialStore){let e=t.idleTimeoutForInitialStore;const n=f;if(f===n)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r)if(Array.isArray(n)){const t=n.length;for(let r=0;r=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.maxMemoryGenerations){let e=t.maxMemoryGenerations;const n=f;if(f===n)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.name){const e=f;if("string"!=typeof t.name){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d){if(void 0!==t.profile){const e=f;if("boolean"!=typeof t.profile){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d){if(void 0!==t.store){const e=f;if("pack"!==t.store){const e={params:{}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d){if(void 0!==t.type){const e=f;if("filesystem"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d)if(void 0!==t.version){const e=f;if("string"!=typeof t.version){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0}}}}}}}}}}}}}}}}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}m=s===f,c=c||m}}if(!c){const e={params:{}};return null===p?p=[e]:p.push(e),f++,s.errors=p,!1}return f=u,null!==p&&(u?p.length=u:p=null),s.errors=p,0===f}function o(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:a=e}={}){let i=null,l=0;const p=l;let f=!1;const u=l;if(!0!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var c=u===l;if(f=f||c,!f){const o=l;s(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:a})||(i=null===i?s.errors:i.concat(s.errors),l=i.length),c=o===l,f=f||c}if(!f){const e={params:{}};return null===i?i=[e]:i.push(e),l++,o.errors=i,!1}return l=p,null!==i&&(p?i.length=p:i=null),o.errors=i,0===l}const a={chunkLoading:{$ref:"#/definitions/ChunkLoading"},dependOn:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},{type:"string",minLength:1}]},filename:{$ref:"#/definitions/EntryFilename"},import:{$ref:"#/definitions/EntryItem"},layer:{$ref:"#/definitions/Layer"},library:{$ref:"#/definitions/LibraryOptions"},publicPath:{$ref:"#/definitions/PublicPath"},runtime:{$ref:"#/definitions/EntryRuntime"},wasmLoading:{$ref:"#/definitions/WasmLoading"}};function i(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const l=a;let p=!1;const f=a;if(!1!==e){const e={params:{}};null===o?o=[e]:o.push(e),a++}var u=f===a;if(p=p||u,!p){const t=a,n=a;let r=!1;const s=a;if("jsonp"!==e&&"import-scripts"!==e&&"require"!==e&&"async-node"!==e&&"import"!==e){const e={params:{}};null===o?o=[e]:o.push(e),a++}var c=s===a;if(r=r||c,!r){const t=a;if("string"!=typeof e){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a,r=r||c}if(r)a=n,null!==o&&(n?o.length=n:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}u=t===a,p=p||u}if(!p){const e={params:{}};return null===o?o=[e]:o.push(e),a++,i.errors=o,!1}return a=l,null!==o&&(l?o.length=l:o=null),i.errors=o,0===a}function l(t,{instancePath:n="",parentData:r,parentDataProperty:s,rootData:o=t}={}){let a=null,i=0;const p=i;let f=!1,u=null;const c=i,y=i;let m=!1;const h=i;if(i===h)if("string"==typeof t){if(t.includes("!")||!1!==e.test(t)){const e={params:{}};null===a?a=[e]:a.push(e),i++}else if(t.length<1){const e={params:{}};null===a?a=[e]:a.push(e),i++}}else{const e={params:{type:"string"}};null===a?a=[e]:a.push(e),i++}var d=h===i;if(m=m||d,!m){const e=i;if(!(t instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),i++}d=e===i,m=m||d}if(m)i=y,null!==a&&(y?a.length=y:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),i++}if(c===i&&(f=!0,u=0),!f){const e={params:{passingSchemas:u}};return null===a?a=[e]:a.push(e),i++,l.errors=a,!1}return i=p,null!==a&&(p?a.length=p:a=null),l.errors=a,0===i}function p(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const f=a;if("string"!=typeof e){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}var u=f===a;if(l=l||u,!l){const t=a;if(a==a)if(e&&"object"==typeof e&&!Array.isArray(e)){const t=a;for(const t in e)if("amd"!==t&&"commonjs"!==t&&"commonjs2"!==t&&"root"!==t){const e={params:{additionalProperty:t}};null===o?o=[e]:o.push(e),a++;break}if(t===a){if(void 0!==e.amd){const t=a;if("string"!=typeof e.amd){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}var c=t===a}else c=!0;if(c){if(void 0!==e.commonjs){const t=a;if("string"!=typeof e.commonjs){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0;if(c){if(void 0!==e.commonjs2){const t=a;if("string"!=typeof e.commonjs2){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0;if(c)if(void 0!==e.root){const t=a;if("string"!=typeof e.root){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0}}}}else{const e={params:{type:"object"}};null===o?o=[e]:o.push(e),a++}u=t===a,l=l||u}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,p.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),p.errors=o,0===a}function f(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;if(a===p)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{const t=e.length;for(let n=0;n1){const r={};for(;n--;){let s=t[n];if("string"==typeof s){if("number"==typeof r[s]){e=r[s];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var g=o===f;if(s=s||g,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}g=e===f,s=s||g}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h){if(void 0!==e.filename){const n=f;l(e.filename,{instancePath:t+"/filename",parentData:e,parentDataProperty:"filename",rootData:o})||(p=null===p?l.errors:p.concat(l.errors),f=p.length),h=n===f}else h=!0;if(h){if(void 0!==e.import){let t=e.import;const n=f,r=f;let s=!1;const o=f;if(f===o)if(Array.isArray(t))if(t.length<1){const e={params:{limit:1}};null===p?p=[e]:p.push(e),f++}else{var b=!0;const e=t.length;for(let n=0;n1){const r={};for(;n--;){let s=t[n];if("string"==typeof s){if("number"==typeof r[s]){e=r[s];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var v=o===f;if(s=s||v,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=e===f,s=s||v}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h){if(void 0!==e.layer){let t=e.layer;const n=f,r=f;let s=!1;const o=f;if(null!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var D=o===f;if(s=s||D,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}D=e===f,s=s||D}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h){if(void 0!==e.library){const n=f;u(e.library,{instancePath:t+"/library",parentData:e,parentDataProperty:"library",rootData:o})||(p=null===p?u.errors:p.concat(u.errors),f=p.length),h=n===f}else h=!0;if(h){if(void 0!==e.publicPath){const n=f;c(e.publicPath,{instancePath:t+"/publicPath",parentData:e,parentDataProperty:"publicPath",rootData:o})||(p=null===p?c.errors:p.concat(c.errors),f=p.length),h=n===f}else h=!0;if(h){if(void 0!==e.runtime){let t=e.runtime;const n=f,r=f;let s=!1;const o=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var P=o===f;if(s=s||P,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}P=e===f,s=s||P}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h)if(void 0!==e.wasmLoading){const n=f;y(e.wasmLoading,{instancePath:t+"/wasmLoading",parentData:e,parentDataProperty:"wasmLoading",rootData:o})||(p=null===p?y.errors:p.concat(y.errors),f=p.length),h=n===f}else h=!0}}}}}}}}}}}return m.errors=p,0===f}function h(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;if(0===a){if(!e||"object"!=typeof e||Array.isArray(e))return h.errors=[{params:{type:"object"}}],!1;for(const n in e){let r=e[n];const f=a,u=a;let c=!1;const y=a,d=a;let g=!1;const b=a;if(a===b)if(Array.isArray(r))if(r.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{var i=!0;const e=r.length;for(let t=0;t1){const n={};for(;t--;){let s=r[t];if("string"==typeof s){if("number"==typeof n[s]){e=n[s];const r={params:{i:t,j:e}};null===o?o=[r]:o.push(r),a++;break}n[s]=t}}}}}else{const e={params:{type:"array"}};null===o?o=[e]:o.push(e),a++}var l=b===a;if(g=g||l,!g){const e=a;if(a===e)if("string"==typeof r){if(r.length<1){const e={params:{}};null===o?o=[e]:o.push(e),a++}}else{const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}l=e===a,g=g||l}if(g)a=d,null!==o&&(d?o.length=d:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}var p=y===a;if(c=c||p,!c){const i=a;m(r,{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:s})||(o=null===o?m.errors:o.concat(m.errors),a=o.length),p=i===a,c=c||p}if(!c){const e={params:{}};return null===o?o=[e]:o.push(e),a++,h.errors=o,!1}if(a=u,null!==o&&(u?o.length=u:o=null),f!==a)break}}return h.errors=o,0===a}function d(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1,p=null;const f=a,u=a;let c=!1;const y=a;if(a===y)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{var m=!0;const t=e.length;for(let n=0;n1){const r={};for(;n--;){let s=e[n];if("string"==typeof s){if("number"==typeof r[s]){t=r[s];const e={params:{i:n,j:t}};null===o?o=[e]:o.push(e),a++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===o?o=[e]:o.push(e),a++}var h=y===a;if(c=c||h,!c){const t=a;if(a===t)if("string"==typeof e){if(e.length<1){const e={params:{}};null===o?o=[e]:o.push(e),a++}}else{const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}h=t===a,c=c||h}if(c)a=u,null!==o&&(u?o.length=u:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}if(f===a&&(l=!0,p=0),!l){const e={params:{passingSchemas:p}};return null===o?o=[e]:o.push(e),a++,d.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),d.errors=o,0===a}function g(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;h(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?h.errors:o.concat(h.errors),a=o.length);var f=p===a;if(l=l||f,!l){const i=a;d(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?d.errors:o.concat(d.errors),a=o.length),f=i===a,l=l||f}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,g.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),g.errors=o,0===a}function b(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;if(!(e instanceof Function)){const e={params:{}};null===o?o=[e]:o.push(e),a++}var f=p===a;if(l=l||f,!l){const i=a;g(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?g.errors:o.concat(g.errors),a=o.length),f=i===a,l=l||f}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,b.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),b.errors=o,0===a}const v={asset:{type:"boolean"},asyncWebAssembly:{type:"boolean"},buildHttp:{anyOf:[{type:"boolean"},{$ref:"#/definitions/HttpUriOptions"}]},executeModule:{type:"boolean"},layers:{type:"boolean"},lazyCompilation:{anyOf:[{type:"boolean"},{type:"object",additionalProperties:!1,properties:{backend:{instanceof:"Function"},client:{type:"string"},entries:{type:"boolean"},imports:{type:"boolean"},test:{anyOf:[{instanceof:"RegExp"},{type:"string"},{instanceof:"Function"}]}}}]},outputModule:{type:"boolean"},syncWebAssembly:{type:"boolean"},topLevelAwait:{type:"boolean"}};function D(t,{instancePath:r="",parentData:s,parentDataProperty:o,rootData:a=t}={}){let i=null,l=0;if(0===l){if(!t||"object"!=typeof t||Array.isArray(t))return D.errors=[{params:{type:"object"}}],!1;{const r=l;for(const e in t)if(!n.call(v,e))return D.errors=[{params:{additionalProperty:e}}],!1;if(r===l){if(void 0!==t.asset){const e=l;if("boolean"!=typeof t.asset)return D.errors=[{params:{type:"boolean"}}],!1;var p=e===l}else p=!0;if(p){if(void 0!==t.asyncWebAssembly){const e=l;if("boolean"!=typeof t.asyncWebAssembly)return D.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.buildHttp){let n=t.buildHttp;const r=l,s=l;let o=!1;const a=l;if("boolean"!=typeof n){const e={params:{type:"boolean"}};null===i?i=[e]:i.push(e),l++}var f=a===l;if(o=o||f,!o){const t=l;if(l==l)if(n&&"object"==typeof n&&!Array.isArray(n)){const t=l;for(const e in n)if("cacheLocation"!==e&&"frozen"!==e&&"lockfileLocation"!==e&&"upgrade"!==e){const t={params:{additionalProperty:e}};null===i?i=[t]:i.push(t),l++;break}if(t===l){if(void 0!==n.cacheLocation){let t=n.cacheLocation;const r=l,s=l;let o=!1;const a=l;if(!1!==t){const e={params:{}};null===i?i=[e]:i.push(e),l++}var u=a===l;if(o=o||u,!o){const n=l;if(l===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}u=n===l,o=o||u}if(o)l=s,null!==i&&(s?i.length=s:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}var c=r===l}else c=!0;if(c){if(void 0!==n.frozen){const e=l;if("boolean"!=typeof n.frozen){const e={params:{type:"boolean"}};null===i?i=[e]:i.push(e),l++}c=e===l}else c=!0;if(c){if(void 0!==n.lockfileLocation){let t=n.lockfileLocation;const r=l;if(l===r)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}c=r===l}else c=!0;if(c)if(void 0!==n.upgrade){const e=l;if("boolean"!=typeof n.upgrade){const e={params:{type:"boolean"}};null===i?i=[e]:i.push(e),l++}c=e===l}else c=!0}}}}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}f=t===l,o=o||f}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),l++,D.errors=i,!1}l=s,null!==i&&(s?i.length=s:i=null),p=r===l}else p=!0;if(p){if(void 0!==t.executeModule){const e=l;if("boolean"!=typeof t.executeModule)return D.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.layers){const e=l;if("boolean"!=typeof t.layers)return D.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.lazyCompilation){let e=t.lazyCompilation;const n=l,r=l;let s=!1;const o=l;if("boolean"!=typeof e){const e={params:{type:"boolean"}};null===i?i=[e]:i.push(e),l++}var y=o===l;if(s=s||y,!s){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e)){const t=l;for(const t in e)if("backend"!==t&&"client"!==t&&"entries"!==t&&"imports"!==t&&"test"!==t){const e={params:{additionalProperty:t}};null===i?i=[e]:i.push(e),l++;break}if(t===l){if(void 0!==e.backend){const t=l;if(!(e.backend instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var m=t===l}else m=!0;if(m){if(void 0!==e.client){const t=l;if("string"!=typeof e.client){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}m=t===l}else m=!0;if(m){if(void 0!==e.entries){const t=l;if("boolean"!=typeof e.entries){const e={params:{type:"boolean"}};null===i?i=[e]:i.push(e),l++}m=t===l}else m=!0;if(m){if(void 0!==e.imports){const t=l;if("boolean"!=typeof e.imports){const e={params:{type:"boolean"}};null===i?i=[e]:i.push(e),l++}m=t===l}else m=!0;if(m)if(void 0!==e.test){let t=e.test;const n=l,r=l;let s=!1;const o=l;if(!(t instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var h=o===l;if(s=s||h,!s){const e=l;if("string"!=typeof t){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(h=e===l,s=s||h,!s){const e=l;if(!(t instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}h=e===l,s=s||h}}if(s)l=r,null!==i&&(r?i.length=r:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}m=n===l}else m=!0}}}}}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}y=t===l,s=s||y}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,D.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.outputModule){const e=l;if("boolean"!=typeof t.outputModule)return D.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.syncWebAssembly){const e=l;if("boolean"!=typeof t.syncWebAssembly)return D.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p)if(void 0!==t.topLevelAwait){const e=l;if("boolean"!=typeof t.topLevelAwait)return D.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}return D.errors=i,0===l}const P={validate:A};function A(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;if(!(e instanceof RegExp)){const e={params:{}};null===o?o=[e]:o.push(e),a++}var f=p===a;if(l=l||f,!l){const n=a;if("string"!=typeof e){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}if(f=n===a,l=l||f,!l){const n=a;if(a===n)if(e&&"object"==typeof e&&!Array.isArray(e)){const n=a;for(const t in e)if("byLayer"!==t){let n=e[t];const r=a,s=a;let i=!1;const l=a;if(a===l)if(Array.isArray(n)){const e=n.length;for(let t=0;t=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var u=y===l;if(c=c||u,!c){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}u=t===l,c=c||u}if(c)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,s=l;let o=!1;const a=l;if(l===a)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===i?i=[e]:i.push(e),l++}else if(n.length<1){const e={params:{}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}var c=a===l;if(o=o||c,!o){const e=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}c=e===l,o=o||c}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=s,null!==i&&(s?i.length=s:i=null),p=r===l}else p=!0;if(p){if(void 0!==t.idHint){const e=l;if("string"!=typeof t.idHint)return oe.errors=[{params:{type:"string"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.layer){let e=t.layer;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var y=o===l;if(s=s||y,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(y=t===l,s=s||y,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}y=t===l,s=s||y}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return oe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return oe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var m=c===l;if(u=u||m,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}m=t===l,u=u||m}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return oe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return oe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var h=c===l;if(u=u||h,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}h=t===l,u=u||h}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var d=c===l;if(u=u||d,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}d=t===l,u=u||d}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return oe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return oe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var g=c===l;if(u=u||g,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}g=t===l,u=u||g}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var b=c===l;if(u=u||b,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}b=t===l,u=u||b}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let s=!1;const o=l;if(!1!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var v=o===l;if(s=s||v,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(v=t===l,s=s||v,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}v=t===l,s=s||v}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.priority){let e=t.priority;const n=l;if("number"!=typeof e||!isFinite(e))return oe.errors=[{params:{type:"number"}}],!1;p=n===l}else p=!0;if(p){if(void 0!==t.reuseExistingChunk){const e=l;if("boolean"!=typeof t.reuseExistingChunk)return oe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.test){let e=t.test;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var D=o===l;if(s=s||D,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(D=t===l,s=s||D,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}D=t===l,s=s||D}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.type){let e=t.type;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var P=o===l;if(s=s||P,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(P=t===l,s=s||P,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}P=t===l,s=s||P}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,oe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return oe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}}}return oe.errors=i,0===l}function ae(t,{instancePath:r="",parentData:s,parentDataProperty:o,rootData:a=t}={}){let i=null,l=0;if(0===l){if(!t||"object"!=typeof t||Array.isArray(t))return ae.errors=[{params:{type:"object"}}],!1;{const s=l;for(const e in t)if(!n.call(re,e))return ae.errors=[{params:{additionalProperty:e}}],!1;if(s===l){if(void 0!==t.automaticNameDelimiter){let e=t.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof e)return ae.errors=[{params:{type:"string"}}],!1;if(e.length<1)return ae.errors=[{params:{}}],!1}var p=n===l}else p=!0;if(p){if(void 0!==t.cacheGroups){let e=t.cacheGroups;const n=l,s=l,o=l;if(l===o)if(e&&"object"==typeof e&&!Array.isArray(e)){let t;if(void 0===e.test&&(t="test")){const e={};null===i?i=[e]:i.push(e),l++}else if(void 0!==e.test){let t=e.test;const n=l;let r=!1;const s=l;if(!(t instanceof RegExp)){const e={};null===i?i=[e]:i.push(e),l++}var f=s===l;if(r=r||f,!r){const e=l;if("string"!=typeof t){const e={};null===i?i=[e]:i.push(e),l++}if(f=e===l,r=r||f,!r){const e=l;if(!(t instanceof Function)){const e={};null===i?i=[e]:i.push(e),l++}f=e===l,r=r||f}}if(r)l=n,null!==i&&(n?i.length=n:i=null);else{const e={};null===i?i=[e]:i.push(e),l++}}}else{const e={};null===i?i=[e]:i.push(e),l++}if(o===l)return ae.errors=[{params:{}}],!1;if(l=s,null!==i&&(s?i.length=s:i=null),l===n){if(!e||"object"!=typeof e||Array.isArray(e))return ae.errors=[{params:{type:"object"}}],!1;for(const t in e){let n=e[t];const s=l,o=l;let p=!1;const f=l;if(!1!==n){const e={params:{}};null===i?i=[e]:i.push(e),l++}var u=f===l;if(p=p||u,!p){const s=l;if(!(n instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}if(u=s===l,p=p||u,!p){const s=l;if("string"!=typeof n){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(u=s===l,p=p||u,!p){const s=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}if(u=s===l,p=p||u,!p){const s=l;oe(n,{instancePath:r+"/cacheGroups/"+t.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:t,rootData:a})||(i=null===i?oe.errors:i.concat(oe.errors),l=i.length),u=s===l,p=p||u}}}}if(!p){const e={params:{}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}if(l=o,null!==i&&(o?i.length=o:i=null),s!==l)break}}p=n===l}else p=!0;if(p){if(void 0!==t.chunks){let e=t.chunks;const n=l,r=l;let s=!1;const o=l;if("initial"!==e&&"async"!==e&&"all"!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var c=o===l;if(s=s||c,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}c=t===l,s=s||c}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.defaultSizeTypes){let e=t.defaultSizeTypes;const n=l;if(l===n){if(!Array.isArray(e))return ae.errors=[{params:{type:"array"}}],!1;if(e.length<1)return ae.errors=[{params:{limit:1}}],!1;{const t=e.length;for(let n=0;n=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var y=c===l;if(u=u||y,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}y=t===l,u=u||y}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.fallbackCacheGroup){let e=t.fallbackCacheGroup;const n=l;if(l===n){if(!e||"object"!=typeof e||Array.isArray(e))return ae.errors=[{params:{type:"object"}}],!1;{const t=l;for(const t in e)if("automaticNameDelimiter"!==t&&"maxAsyncSize"!==t&&"maxInitialSize"!==t&&"maxSize"!==t&&"minSize"!==t)return ae.errors=[{params:{additionalProperty:t}}],!1;if(t===l){if(void 0!==e.automaticNameDelimiter){let t=e.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof t)return ae.errors=[{params:{type:"string"}}],!1;if(t.length<1)return ae.errors=[{params:{}}],!1}var m=n===l}else m=!0;if(m){if(void 0!==e.maxAsyncSize){let t=e.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t&&isFinite(t)){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var h=u===l;if(f=f||h,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){let n=t[e];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}h=e===l,f=f||h}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxInitialSize){let t=e.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t&&isFinite(t)){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var d=u===l;if(f=f||d,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){let n=t[e];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}d=e===l,f=f||d}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxSize){let t=e.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t&&isFinite(t)){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var g=u===l;if(f=f||g,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){let n=t[e];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}g=e===l,f=f||g}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),m=n===l}else m=!0;if(m)if(void 0!==e.minSize){let t=e.minSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t&&isFinite(t)){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var b=u===l;if(f=f||b,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){let n=t[e];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}b=e===l,f=f||b}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),m=n===l}else m=!0}}}}}}p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,s=l;let o=!1;const a=l;if(l===a)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===i?i=[e]:i.push(e),l++}else if(n.length<1){const e={params:{}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}var v=a===l;if(o=o||v,!o){const e=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}v=e===l,o=o||v}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=s,null!==i&&(s?i.length=s:i=null),p=r===l}else p=!0;if(p){if(void 0!==t.hidePathInfo){const e=l;if("boolean"!=typeof t.hidePathInfo)return ae.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return ae.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ae.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var D=c===l;if(u=u||D,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}D=t===l,u=u||D}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return ae.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ae.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var P=c===l;if(u=u||P,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}P=t===l,u=u||P}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var A=c===l;if(u=u||A,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}A=t===l,u=u||A}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e||!isFinite(e))return ae.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ae.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var x=c===l;if(u=u||x,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}x=t===l,u=u||x}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e&&isFinite(e)){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var k=c===l;if(u=u||k,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=l;if("number"!=typeof n||!isFinite(n)){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(r!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}k=t===l,u=u||k}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let s=!1;const o=l;if(!1!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var j=o===l;if(s=s||j,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(j=t===l,s=s||j,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}j=t===l,s=s||j}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,ae.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return ae.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}return ae.errors=i,0===l}function ie(e,{instancePath:t="",parentData:r,parentDataProperty:s,rootData:o=e}={}){let a=null,i=0;if(0===i){if(!e||"object"!=typeof e||Array.isArray(e))return ie.errors=[{params:{type:"object"}}],!1;{const r=i;for(const t in e)if(!n.call(ne,t))return ie.errors=[{params:{additionalProperty:t}}],!1;if(r===i){if(void 0!==e.checkWasmTypes){const t=i;if("boolean"!=typeof e.checkWasmTypes)return ie.errors=[{params:{type:"boolean"}}],!1;var l=t===i}else l=!0;if(l){if(void 0!==e.chunkIds){let t=e.chunkIds;const n=i;if("natural"!==t&&"named"!==t&&"deterministic"!==t&&"size"!==t&&"total-size"!==t&&!1!==t)return ie.errors=[{params:{}}],!1;l=n===i}else l=!0;if(l){if(void 0!==e.concatenateModules){const t=i;if("boolean"!=typeof e.concatenateModules)return ie.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.emitOnErrors){const t=i;if("boolean"!=typeof e.emitOnErrors)return ie.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.flagIncludedChunks){const t=i;if("boolean"!=typeof e.flagIncludedChunks)return ie.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.innerGraph){const t=i;if("boolean"!=typeof e.innerGraph)return ie.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.mangleExports){let t=e.mangleExports;const n=i,r=i;let s=!1;const o=i;if("size"!==t&&"deterministic"!==t){const e={params:{}};null===a?a=[e]:a.push(e),i++}var p=o===i;if(s=s||p,!s){const e=i;if("boolean"!=typeof t){const e={params:{type:"boolean"}};null===a?a=[e]:a.push(e),i++}p=e===i,s=s||p}if(!s){const e={params:{}};return null===a?a=[e]:a.push(e),i++,ie.errors=a,!1}i=r,null!==a&&(r?a.length=r:a=null),l=n===i}else l=!0;if(l){if(void 0!==e.mangleWasmImports){const t=i;if("boolean"!=typeof e.mangleWasmImports)return ie.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.mergeDuplicateChunks){const t=i;if("boolean"!=typeof e.mergeDuplicateChunks)return ie.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.minimize){const t=i;if("boolean"!=typeof e.minimize)return ie.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.minimizer){let t=e.minimizer;const n=i;if(i===n){if(!Array.isArray(t))return ie.errors=[{params:{type:"array"}}],!1;{const e=t.length;for(let n=0;n=",limit:1}}],!1}m=n===f}else m=!0;if(m){if(void 0!==t.hashFunction){let e=t.hashFunction;const n=f,r=f;let s=!1;const o=f;if(f===o)if("string"==typeof e){if(e.length<1){const e={params:{}};null===l?l=[e]:l.push(e),f++}}else{const e={params:{type:"string"}};null===l?l=[e]:l.push(e),f++}var v=o===f;if(s=s||v,!s){const t=f;if(!(e instanceof Function)){const e={params:{}};null===l?l=[e]:l.push(e),f++}v=t===f,s=s||v}if(!s){const e={params:{}};return null===l?l=[e]:l.push(e),f++,de.errors=l,!1}f=r,null!==l&&(r?l.length=r:l=null),m=n===f}else m=!0;if(m){if(void 0!==t.hashSalt){let e=t.hashSalt;const n=f;if(f==f){if("string"!=typeof e)return de.errors=[{params:{type:"string"}}],!1;if(e.length<1)return de.errors=[{params:{}}],!1}m=n===f}else m=!0;if(m){if(void 0!==t.hotUpdateChunkFilename){let n=t.hotUpdateChunkFilename;const r=f;if(f==f){if("string"!=typeof n)return de.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return de.errors=[{params:{}}],!1}m=r===f}else m=!0;if(m){if(void 0!==t.hotUpdateGlobal){const e=f;if("string"!=typeof t.hotUpdateGlobal)return de.errors=[{params:{type:"string"}}],!1;m=e===f}else m=!0;if(m){if(void 0!==t.hotUpdateMainFilename){let n=t.hotUpdateMainFilename;const r=f;if(f==f){if("string"!=typeof n)return de.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return de.errors=[{params:{}}],!1}m=r===f}else m=!0;if(m){if(void 0!==t.iife){const e=f;if("boolean"!=typeof t.iife)return de.errors=[{params:{type:"boolean"}}],!1;m=e===f}else m=!0;if(m){if(void 0!==t.importFunctionName){const e=f;if("string"!=typeof t.importFunctionName)return de.errors=[{params:{type:"string"}}],!1;m=e===f}else m=!0;if(m){if(void 0!==t.importMetaName){const e=f;if("string"!=typeof t.importMetaName)return de.errors=[{params:{type:"string"}}],!1;m=e===f}else m=!0;if(m){if(void 0!==t.library){const e=f;he(t.library,{instancePath:r+"/library",parentData:t,parentDataProperty:"library",rootData:a})||(l=null===l?he.errors:l.concat(he.errors),f=l.length),m=e===f}else m=!0;if(m){if(void 0!==t.libraryExport){let e=t.libraryExport;const n=f,r=f;let s=!1,o=null;const a=f,i=f;let p=!1;const u=f;if(f===u)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:1}}],!1}c=t===f}else c=!0;if(c){if(void 0!==r.performance){const e=f;ge(r.performance,{instancePath:s+"/performance",parentData:r,parentDataProperty:"performance",rootData:l})||(p=null===p?ge.errors:p.concat(ge.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.plugins){const e=f;be(r.plugins,{instancePath:s+"/plugins",parentData:r,parentDataProperty:"plugins",rootData:l})||(p=null===p?be.errors:p.concat(be.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.profile){const e=f;if("boolean"!=typeof r.profile)return Fe.errors=[{params:{type:"boolean"}}],!1;c=e===f}else c=!0;if(c){if(void 0!==r.recordsInputPath){let t=r.recordsInputPath;const n=f,s=f;let o=!1;const a=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var g=a===f;if(o=o||g,!o){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}g=n===f,o=o||g}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,Fe.errors=p,!1}f=s,null!==p&&(s?p.length=s:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsOutputPath){let t=r.recordsOutputPath;const n=f,s=f;let o=!1;const a=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var v=a===f;if(o=o||v,!o){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=n===f,o=o||v}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,Fe.errors=p,!1}f=s,null!==p&&(s?p.length=s:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsPath){let t=r.recordsPath;const n=f,s=f;let o=!1;const a=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var P=a===f;if(o=o||P,!o){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}P=n===f,o=o||P}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,Fe.errors=p,!1}f=s,null!==p&&(s?p.length=s:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.resolve){const e=f;ve(r.resolve,{instancePath:s+"/resolve",parentData:r,parentDataProperty:"resolve",rootData:l})||(p=null===p?ve.errors:p.concat(ve.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.resolveLoader){const e=f;De(r.resolveLoader,{instancePath:s+"/resolveLoader",parentData:r,parentDataProperty:"resolveLoader",rootData:l})||(p=null===p?De.errors:p.concat(De.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.snapshot){let t=r.snapshot;const n=f;if(f==f){if(!t||"object"!=typeof t||Array.isArray(t))return Fe.errors=[{params:{type:"object"}}],!1;{const n=f;for(const e in t)if("buildDependencies"!==e&&"immutablePaths"!==e&&"managedPaths"!==e&&"module"!==e&&"resolve"!==e&&"resolveBuildDependencies"!==e)return Fe.errors=[{params:{additionalProperty:e}}],!1;if(n===f){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n){if(!e||"object"!=typeof e||Array.isArray(e))return Fe.errors=[{params:{type:"object"}}],!1;{const t=f;for(const t in e)if("hash"!==t&&"timestamp"!==t)return Fe.errors=[{params:{additionalProperty:t}}],!1;if(t===f){if(void 0!==e.hash){const t=f;if("boolean"!=typeof e.hash)return Fe.errors=[{params:{type:"boolean"}}],!1;var A=t===f}else A=!0;if(A)if(void 0!==e.timestamp){const t=f;if("boolean"!=typeof e.timestamp)return Fe.errors=[{params:{type:"boolean"}}],!1;A=t===f}else A=!0}}}var k=n===f}else k=!0;if(k){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r){if(!Array.isArray(n))return Fe.errors=[{params:{type:"array"}}],!1;{const t=n.length;for(let r=0;r boolean; +export = check; diff --git a/schemas/plugins/schemes/HttpUriPlugin.check.js b/schemas/plugins/schemes/HttpUriPlugin.check.js new file mode 100644 index 000000000..422c5c311 --- /dev/null +++ b/schemas/plugins/schemes/HttpUriPlugin.check.js @@ -0,0 +1,6 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +const o=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function t(e,{instancePath:n="",parentData:s,parentDataProperty:l,rootData:a=e}={}){let i=null,r=0;const c=r;let p=!1,u=null;const f=r;if(r==r)if(e&&"object"==typeof e&&!Array.isArray(e)){const t=r;for(const o in e)if("cacheLocation"!==o&&"frozen"!==o&&"lockfileLocation"!==o&&"upgrade"!==o){const t={params:{additionalProperty:o}};null===i?i=[t]:i.push(t),r++;break}if(t===r){if(void 0!==e.cacheLocation){let t=e.cacheLocation;const n=r,s=r;let l=!1;const a=r;if(!1!==t){const o={params:{}};null===i?i=[o]:i.push(o),r++}var h=a===r;if(l=l||h,!l){const e=r;if(r===e)if("string"==typeof t){if(t.includes("!")||!0!==o.test(t)){const o={params:{}};null===i?i=[o]:i.push(o),r++}}else{const o={params:{type:"string"}};null===i?i=[o]:i.push(o),r++}h=e===r,l=l||h}if(l)r=s,null!==i&&(s?i.length=s:i=null);else{const o={params:{}};null===i?i=[o]:i.push(o),r++}var d=n===r}else d=!0;if(d){if(void 0!==e.frozen){const o=r;if("boolean"!=typeof e.frozen){const o={params:{type:"boolean"}};null===i?i=[o]:i.push(o),r++}d=o===r}else d=!0;if(d){if(void 0!==e.lockfileLocation){let t=e.lockfileLocation;const n=r;if(r===n)if("string"==typeof t){if(t.includes("!")||!0!==o.test(t)){const o={params:{}};null===i?i=[o]:i.push(o),r++}}else{const o={params:{type:"string"}};null===i?i=[o]:i.push(o),r++}d=n===r}else d=!0;if(d)if(void 0!==e.upgrade){const o=r;if("boolean"!=typeof e.upgrade){const o={params:{type:"boolean"}};null===i?i=[o]:i.push(o),r++}d=o===r}else d=!0}}}}else{const o={params:{type:"object"}};null===i?i=[o]:i.push(o),r++}if(f===r&&(p=!0,u=0),!p){const o={params:{passingSchemas:u}};return null===i?i=[o]:i.push(o),r++,t.errors=i,!1}return r=c,null!==i&&(c?i.length=c:i=null),t.errors=i,0===r}module.exports=t,module.exports.default=t; \ No newline at end of file diff --git a/schemas/plugins/schemes/HttpUriPlugin.json b/schemas/plugins/schemes/HttpUriPlugin.json new file mode 100644 index 000000000..67dde00a7 --- /dev/null +++ b/schemas/plugins/schemes/HttpUriPlugin.json @@ -0,0 +1,42 @@ +{ + "definitions": { + "HttpUriOptions": { + "description": "Options for building http resources.", + "type": "object", + "additionalProperties": false, + "properties": { + "cacheLocation": { + "description": "Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.", + "anyOf": [ + { + "enum": [false] + }, + { + "type": "string", + "absolutePath": true + } + ] + }, + "frozen": { + "description": "When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error.", + "type": "boolean" + }, + "lockfileLocation": { + "description": "Location of the lockfile.", + "type": "string", + "absolutePath": true + }, + "upgrade": { + "description": "When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.", + "type": "boolean" + } + } + } + }, + "title": "HttpUriPluginOptions", + "oneOf": [ + { + "$ref": "#/definitions/HttpUriOptions" + } + ] +} diff --git a/test/Defaults.unittest.js b/test/Defaults.unittest.js index e509d4ff7..0c8af5506 100644 --- a/test/Defaults.unittest.js +++ b/test/Defaults.unittest.js @@ -91,7 +91,12 @@ describe("Defaults", () => { }, }, "experiments": Object { + "asset": false, "asyncWebAssembly": false, + "buildHttp": false, + "executeModule": false, + "layers": false, + "lazyCompilation": false, "outputModule": false, "syncWebAssembly": false, "topLevelAwait": false, diff --git a/test/__snapshots__/Cli.test.js.snap b/test/__snapshots__/Cli.test.js.snap index 18644eb5a..909ce3dc1 100644 --- a/test/__snapshots__/Cli.test.js.snap +++ b/test/__snapshots__/Cli.test.js.snap @@ -450,6 +450,80 @@ Object { "multiple": false, "simpleType": "boolean", }, + "experiments-build-http": Object { + "configs": Array [ + Object { + "description": "Build http(s): urls using a lockfile and resource content cache.", + "multiple": false, + "path": "experiments.buildHttp", + "type": "boolean", + }, + ], + "description": "Build http(s): urls using a lockfile and resource content cache.", + "multiple": false, + "simpleType": "boolean", + }, + "experiments-build-http-cache-location": Object { + "configs": Array [ + Object { + "description": "Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.", + "multiple": false, + "path": "experiments.buildHttp.cacheLocation", + "type": "enum", + "values": Array [ + false, + ], + }, + Object { + "description": "Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.", + "multiple": false, + "path": "experiments.buildHttp.cacheLocation", + "type": "path", + }, + ], + "description": "Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.", + "multiple": false, + "simpleType": "string", + }, + "experiments-build-http-frozen": Object { + "configs": Array [ + Object { + "description": "When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error.", + "multiple": false, + "path": "experiments.buildHttp.frozen", + "type": "boolean", + }, + ], + "description": "When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error.", + "multiple": false, + "simpleType": "boolean", + }, + "experiments-build-http-lockfile-location": Object { + "configs": Array [ + Object { + "description": "Location of the lockfile.", + "multiple": false, + "path": "experiments.buildHttp.lockfileLocation", + "type": "path", + }, + ], + "description": "Location of the lockfile.", + "multiple": false, + "simpleType": "string", + }, + "experiments-build-http-upgrade": Object { + "configs": Array [ + Object { + "description": "When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.", + "multiple": false, + "path": "experiments.buildHttp.upgrade", + "type": "boolean", + }, + ], + "description": "When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.", + "multiple": false, + "simpleType": "boolean", + }, "experiments-execute-module": Object { "configs": Array [ Object { diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock new file mode 100644 index 000000000..ab0def338 --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock @@ -0,0 +1,16 @@ +{ + "http://localhost:9990/asset.txt": { "resolved": "http://localhost:9990/asset.txt", "integrity": "sha512-LHT9F+2v2A6ER7DUZ0HuJDt+t03SFJoKsbkkb7MDgvJ+hT2FhXGeDmfL2g2qj1FnEGRhXWRa4nrLFb+xRH9Fmw==", "contentType": "text/css" }, + "http://localhost:9990/fallback.js": { "resolved": "http://localhost:9990/fallback.js", "integrity": "sha512-BCkBS4Wb0EreudEceuobqZZwTE7SeVUJ2vVHxDQKm8xW6dGJRcUrrSWcjd/61zijOeYAW0P+boOg7u0vxrGwYg==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/dependency.js": { "resolved": "http://localhost:9990/folder/dependency.js", "integrity": "sha512-N0En4W3aNPY82MPu16+50P4PqLLyPLI6l33wR2a3ue8VCRjY8RJl8erRB8ztWSEYNad7yRDPrqlYT+IBtoOA9w==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/sub-dependency.js": { "resolved": "http://localhost:9990/folder/sub-dependency.js", "integrity": "sha512-Jjmwazwmg67EwNPViCBwvSIxhENfS6gwufXoQLrB0B/JDA4v1p+p2S5Y6IGP4SzZqqVTsROlU8meD6ep3q6MTA==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/sub-dependency2.js": { "resolved": "http://localhost:9990/folder/sub-dependency2.js", "integrity": "sha512-BDZKEwlnwBabeHEwmMd02NxFEjYy+QwKAKP0S8zMMesX7dUsvh11hM7LUOPPFOS+nIEFZPtnc7kFwmnojVUw5A==", "contentType": "text/javascript" }, + "http://localhost:9990/index.css?cache": { "resolved": "http://localhost:9990/index.css?cache", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, + "http://localhost:9990/index.css?no-cache": "no-cache", + "http://localhost:9990/index.css?query#fragment": { "resolved": "http://localhost:9990/index.css?query#fragment", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, + "http://localhost:9990/redirect": { "resolved": "http://localhost:9990/redirect.js", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, + "http://localhost:9990/redirect.js": { "resolved": "http://localhost:9990/redirect.js", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, + "http://localhost:9990/resolve.js": { "resolved": "http://localhost:9990/resolve.js", "integrity": "sha512-6J9zBO2hXSMTO1EtXJOxSRB2nVPHCoNmNHS8an1QeehzJFc3uoBPRWu6hqHPc54gv2/QME9RBR/BXIan68virg==", "contentType": "text/javascript" }, + "https://raw.githubusercontent.com//webpack//webpack//main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, + "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, + "version": 1 +} diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt new file mode 100644 index 000000000..5e1c309da --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt @@ -0,0 +1 @@ +Hello World \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js new file mode 100644 index 000000000..e5dfb6da9 --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js @@ -0,0 +1 @@ +export * from "fallback-package"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js new file mode 100644 index 000000000..e3e81f78e --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js @@ -0,0 +1,2 @@ +export * from "./sub-dependency.js"; +export * from "/folder/sub-dependency2.js"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js new file mode 100644 index 000000000..72fdbad6c --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js @@ -0,0 +1 @@ +export const value2 = 42; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js new file mode 100644 index 000000000..b7159db48 --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js @@ -0,0 +1 @@ +export const value = 42; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css new file mode 100644 index 000000000..b978c1b59 --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css @@ -0,0 +1 @@ +a {} \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css new file mode 100644 index 000000000..b978c1b59 --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css @@ -0,0 +1 @@ +a {} \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js new file mode 100644 index 000000000..d31cf81a3 --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js @@ -0,0 +1 @@ +export default { ok: true }; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js new file mode 100644 index 000000000..7a369ecb8 --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js @@ -0,0 +1 @@ +export * from "./folder/dependency.js"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md new file mode 100644 index 000000000..4faf227c4 --- /dev/null +++ b/test/configCases/asset-modules/http-url/dev-defaults.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md @@ -0,0 +1 @@ +[Code of Conduct](https://github.com/openjs-foundation/code-and-learn/blob/master/CODE_OF_CONDUCT.md) diff --git a/test/configCases/asset-modules/http-url/errors.js b/test/configCases/asset-modules/http-url/errors.js new file mode 100644 index 000000000..4e46c1949 --- /dev/null +++ b/test/configCases/asset-modules/http-url/errors.js @@ -0,0 +1,18 @@ +module.exports = [ + [ + /http:\/\/localhost:9990\/index\.css\?cache used to have no-cache lockfile entry and has content now, but lockfile is frozen/ + ], + [ + /http:\/\/localhost:9990\/index\.css\?no-cache has a lockfile entry and is no-cache now, but lockfile is frozen/ + ], + [ + /http:\/\/localhost:9990\/index\.css has an outdated lockfile entry, but lockfile is frozen/ + ], + [/http:\/\/localhost:9990\/resolve\.js integrity mismatch/], + [ + /http:\/\/localhost:9990\/fallback\.js has no lockfile entry and lockfile is frozen/ + ], + [ + /http:\/\/localhost:9990\/redirect has an outdated lockfile entry, but lockfile is frozen/ + ] +]; diff --git a/test/configCases/asset-modules/http-url/errors.webpack.lock b/test/configCases/asset-modules/http-url/errors.webpack.lock new file mode 100644 index 000000000..a123e5a3e --- /dev/null +++ b/test/configCases/asset-modules/http-url/errors.webpack.lock @@ -0,0 +1,13 @@ +{ + "http://localhost:9990/asset.txt?ignore": "ignore", + "http://localhost:9990/index.css": { "resolved": "http://localhost:9990/index.css", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "invalid" }, + "http://localhost:9990/index.css?query#fragment": { "resolved": "http://localhost:9990/index.css?query#fragment", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, + "http://localhost:9990/index.css?no-cache": { "resolved": "http://localhost:9990/index.css?no-cache", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, + "http://localhost:9990/index.css?cache": "no-cache", + "http://localhost:9990/redirect": { "resolved": "http://localhost:9990/redirect", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, + "http://localhost:9990/redirect.js": { "resolved": "http://localhost:9990/redirect.js", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, + "http://localhost:9990/resolve.js": { "resolved": "http://localhost:9990/resolve.js", "integrity": "sha512-SHOULD_BE_INVALID", "contentType": "text/javascript" }, + "https://raw.githubusercontent.com//webpack//webpack//main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, + "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, + "version": 1 +} diff --git a/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js new file mode 100644 index 000000000..e5dfb6da9 --- /dev/null +++ b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js @@ -0,0 +1 @@ +export * from "fallback-package"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/index_f3181eddde77a03ff311.css b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/index_f3181eddde77a03ff311.css new file mode 100644 index 000000000..b978c1b59 --- /dev/null +++ b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/index_f3181eddde77a03ff311.css @@ -0,0 +1 @@ +a {} \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css new file mode 100644 index 000000000..b978c1b59 --- /dev/null +++ b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css @@ -0,0 +1 @@ +a {} \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js new file mode 100644 index 000000000..d31cf81a3 --- /dev/null +++ b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js @@ -0,0 +1 @@ +export default { ok: true }; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js new file mode 100644 index 000000000..7a369ecb8 --- /dev/null +++ b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js @@ -0,0 +1 @@ +export * from "./folder/dependency.js"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/errors.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md new file mode 100644 index 000000000..4faf227c4 --- /dev/null +++ b/test/configCases/asset-modules/http-url/errors.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md @@ -0,0 +1 @@ +[Code of Conduct](https://github.com/openjs-foundation/code-and-learn/blob/master/CODE_OF_CONDUCT.md) diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock new file mode 100644 index 000000000..ab0def338 --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock @@ -0,0 +1,16 @@ +{ + "http://localhost:9990/asset.txt": { "resolved": "http://localhost:9990/asset.txt", "integrity": "sha512-LHT9F+2v2A6ER7DUZ0HuJDt+t03SFJoKsbkkb7MDgvJ+hT2FhXGeDmfL2g2qj1FnEGRhXWRa4nrLFb+xRH9Fmw==", "contentType": "text/css" }, + "http://localhost:9990/fallback.js": { "resolved": "http://localhost:9990/fallback.js", "integrity": "sha512-BCkBS4Wb0EreudEceuobqZZwTE7SeVUJ2vVHxDQKm8xW6dGJRcUrrSWcjd/61zijOeYAW0P+boOg7u0vxrGwYg==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/dependency.js": { "resolved": "http://localhost:9990/folder/dependency.js", "integrity": "sha512-N0En4W3aNPY82MPu16+50P4PqLLyPLI6l33wR2a3ue8VCRjY8RJl8erRB8ztWSEYNad7yRDPrqlYT+IBtoOA9w==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/sub-dependency.js": { "resolved": "http://localhost:9990/folder/sub-dependency.js", "integrity": "sha512-Jjmwazwmg67EwNPViCBwvSIxhENfS6gwufXoQLrB0B/JDA4v1p+p2S5Y6IGP4SzZqqVTsROlU8meD6ep3q6MTA==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/sub-dependency2.js": { "resolved": "http://localhost:9990/folder/sub-dependency2.js", "integrity": "sha512-BDZKEwlnwBabeHEwmMd02NxFEjYy+QwKAKP0S8zMMesX7dUsvh11hM7LUOPPFOS+nIEFZPtnc7kFwmnojVUw5A==", "contentType": "text/javascript" }, + "http://localhost:9990/index.css?cache": { "resolved": "http://localhost:9990/index.css?cache", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, + "http://localhost:9990/index.css?no-cache": "no-cache", + "http://localhost:9990/index.css?query#fragment": { "resolved": "http://localhost:9990/index.css?query#fragment", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, + "http://localhost:9990/redirect": { "resolved": "http://localhost:9990/redirect.js", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, + "http://localhost:9990/redirect.js": { "resolved": "http://localhost:9990/redirect.js", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, + "http://localhost:9990/resolve.js": { "resolved": "http://localhost:9990/resolve.js", "integrity": "sha512-6J9zBO2hXSMTO1EtXJOxSRB2nVPHCoNmNHS8an1QeehzJFc3uoBPRWu6hqHPc54gv2/QME9RBR/BXIan68virg==", "contentType": "text/javascript" }, + "https://raw.githubusercontent.com//webpack//webpack//main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, + "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, + "version": 1 +} diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt new file mode 100644 index 000000000..5e1c309da --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt @@ -0,0 +1 @@ +Hello World \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js new file mode 100644 index 000000000..e5dfb6da9 --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js @@ -0,0 +1 @@ +export * from "fallback-package"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js new file mode 100644 index 000000000..e3e81f78e --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js @@ -0,0 +1,2 @@ +export * from "./sub-dependency.js"; +export * from "/folder/sub-dependency2.js"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js new file mode 100644 index 000000000..72fdbad6c --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js @@ -0,0 +1 @@ +export const value2 = 42; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js new file mode 100644 index 000000000..b7159db48 --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js @@ -0,0 +1 @@ +export const value = 42; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css new file mode 100644 index 000000000..b978c1b59 --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css @@ -0,0 +1 @@ +a {} \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css new file mode 100644 index 000000000..b978c1b59 --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css @@ -0,0 +1 @@ +a {} \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js new file mode 100644 index 000000000..d31cf81a3 --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js @@ -0,0 +1 @@ +export default { ok: true }; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js new file mode 100644 index 000000000..7a369ecb8 --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js @@ -0,0 +1 @@ +export * from "./folder/dependency.js"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md new file mode 100644 index 000000000..4faf227c4 --- /dev/null +++ b/test/configCases/asset-modules/http-url/frozen-verify.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md @@ -0,0 +1 @@ +[Code of Conduct](https://github.com/openjs-foundation/code-and-learn/blob/master/CODE_OF_CONDUCT.md) diff --git a/test/configCases/asset-modules/http-url/index.errors.js b/test/configCases/asset-modules/http-url/index.errors.js new file mode 100644 index 000000000..ee4a379b4 --- /dev/null +++ b/test/configCases/asset-modules/http-url/index.errors.js @@ -0,0 +1,32 @@ +it("error when lockfile is outdated/invalid", () => { + expect(() => { + require("http://localhost:9990/index.css?cache"); + }).toThrowError(); + expect(() => { + require("http://localhost:9990/index.css?no-cache"); + }).toThrowError(); + expect(() => { + require("http://localhost:9990/index.css"); + }).toThrowError(); + expect(() => { + require("http://localhost:9990/resolve.js"); + }).toThrowError(); + expect(() => { + require("http://localhost:9990/fallback.js"); + }).toThrowError(); + expect(() => { + require("http://localhost:9990/redirect"); + }).toThrowError(); +}); + +import text from "http://localhost:9990/asset.txt?ignore"; + +it("should allow to ignore lockfile entries", () => { + expect(text.trim()).toBe("Hello World"); +}); + +import cssContent from "http://localhost:9990/index.css?query#fragment"; + +it("should use the entry with query and fragment", () => { + expect(cssContent).toBe("a {}.webpack{}"); +}); diff --git a/test/configCases/asset-modules/http-url/index.js b/test/configCases/asset-modules/http-url/index.js index 2dea8140c..828be4d81 100644 --- a/test/configCases/asset-modules/http-url/index.js +++ b/test/configCases/asset-modules/http-url/index.js @@ -1,5 +1,28 @@ import cssContent from "http://localhost:9990/index.css?query#fragment"; +import noCacheCssContent from "http://localhost:9990/index.css?no-cache"; +import cachedCssContent from "http://localhost:9990/index.css?cache"; +import { value, value2 } from "http://localhost:9990/resolve.js"; +import { fallback } from "http://localhost:9990/fallback.js"; +import redirect1 from "http://localhost:9990/redirect"; +import redirect2 from "http://localhost:9990/redirect.js"; +import text from "http://localhost:9990/asset.txt"; +import codeOfConduct1 from "https://raw.githubusercontent.com//webpack//webpack//main/CODE_OF_CONDUCT.md"; +import codeOfConduct2 from "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md"; it("http url request should be supported", () => { expect(cssContent).toBe("a {}.webpack{}"); + expect(noCacheCssContent).toBe("a {}.webpack{}"); + expect(cachedCssContent).toBe("a {}.webpack{}"); + expect(value).toBe(42); + expect(value2).toBe(42); + expect(fallback).toBe(42); + expect(redirect1).toEqual({ ok: true }); + expect(redirect2).toEqual({ ok: true }); + expect(redirect2).not.toBe(redirect1); + expect(text.trim()).toBe("Hello World"); +}); + +it("https url request should be supported", () => { + expect(codeOfConduct1.includes("CODE_OF_CONDUCT")).toBeTruthy(); + expect(codeOfConduct2.includes("CODE_OF_CONDUCT")).toBeTruthy(); }); diff --git a/test/configCases/asset-modules/https-url/loaders/md-loader.js b/test/configCases/asset-modules/http-url/loaders/md-loader.js similarity index 100% rename from test/configCases/asset-modules/https-url/loaders/md-loader.js rename to test/configCases/asset-modules/http-url/loaders/md-loader.js diff --git a/test/configCases/asset-modules/http-url/no-cache.webpack.lock b/test/configCases/asset-modules/http-url/no-cache.webpack.lock new file mode 100644 index 000000000..ab0def338 --- /dev/null +++ b/test/configCases/asset-modules/http-url/no-cache.webpack.lock @@ -0,0 +1,16 @@ +{ + "http://localhost:9990/asset.txt": { "resolved": "http://localhost:9990/asset.txt", "integrity": "sha512-LHT9F+2v2A6ER7DUZ0HuJDt+t03SFJoKsbkkb7MDgvJ+hT2FhXGeDmfL2g2qj1FnEGRhXWRa4nrLFb+xRH9Fmw==", "contentType": "text/css" }, + "http://localhost:9990/fallback.js": { "resolved": "http://localhost:9990/fallback.js", "integrity": "sha512-BCkBS4Wb0EreudEceuobqZZwTE7SeVUJ2vVHxDQKm8xW6dGJRcUrrSWcjd/61zijOeYAW0P+boOg7u0vxrGwYg==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/dependency.js": { "resolved": "http://localhost:9990/folder/dependency.js", "integrity": "sha512-N0En4W3aNPY82MPu16+50P4PqLLyPLI6l33wR2a3ue8VCRjY8RJl8erRB8ztWSEYNad7yRDPrqlYT+IBtoOA9w==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/sub-dependency.js": { "resolved": "http://localhost:9990/folder/sub-dependency.js", "integrity": "sha512-Jjmwazwmg67EwNPViCBwvSIxhENfS6gwufXoQLrB0B/JDA4v1p+p2S5Y6IGP4SzZqqVTsROlU8meD6ep3q6MTA==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/sub-dependency2.js": { "resolved": "http://localhost:9990/folder/sub-dependency2.js", "integrity": "sha512-BDZKEwlnwBabeHEwmMd02NxFEjYy+QwKAKP0S8zMMesX7dUsvh11hM7LUOPPFOS+nIEFZPtnc7kFwmnojVUw5A==", "contentType": "text/javascript" }, + "http://localhost:9990/index.css?cache": { "resolved": "http://localhost:9990/index.css?cache", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, + "http://localhost:9990/index.css?no-cache": "no-cache", + "http://localhost:9990/index.css?query#fragment": { "resolved": "http://localhost:9990/index.css?query#fragment", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, + "http://localhost:9990/redirect": { "resolved": "http://localhost:9990/redirect.js", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, + "http://localhost:9990/redirect.js": { "resolved": "http://localhost:9990/redirect.js", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, + "http://localhost:9990/resolve.js": { "resolved": "http://localhost:9990/resolve.js", "integrity": "sha512-6J9zBO2hXSMTO1EtXJOxSRB2nVPHCoNmNHS8an1QeehzJFc3uoBPRWu6hqHPc54gv2/QME9RBR/BXIan68virg==", "contentType": "text/javascript" }, + "https://raw.githubusercontent.com//webpack//webpack//main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, + "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, + "version": 1 +} diff --git a/test/configCases/asset-modules/http-url/node_modules/fallback-package.js b/test/configCases/asset-modules/http-url/node_modules/fallback-package.js new file mode 100644 index 000000000..fb9f84be3 --- /dev/null +++ b/test/configCases/asset-modules/http-url/node_modules/fallback-package.js @@ -0,0 +1 @@ +export const fallback = 42; diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock new file mode 100644 index 000000000..ab0def338 --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock @@ -0,0 +1,16 @@ +{ + "http://localhost:9990/asset.txt": { "resolved": "http://localhost:9990/asset.txt", "integrity": "sha512-LHT9F+2v2A6ER7DUZ0HuJDt+t03SFJoKsbkkb7MDgvJ+hT2FhXGeDmfL2g2qj1FnEGRhXWRa4nrLFb+xRH9Fmw==", "contentType": "text/css" }, + "http://localhost:9990/fallback.js": { "resolved": "http://localhost:9990/fallback.js", "integrity": "sha512-BCkBS4Wb0EreudEceuobqZZwTE7SeVUJ2vVHxDQKm8xW6dGJRcUrrSWcjd/61zijOeYAW0P+boOg7u0vxrGwYg==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/dependency.js": { "resolved": "http://localhost:9990/folder/dependency.js", "integrity": "sha512-N0En4W3aNPY82MPu16+50P4PqLLyPLI6l33wR2a3ue8VCRjY8RJl8erRB8ztWSEYNad7yRDPrqlYT+IBtoOA9w==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/sub-dependency.js": { "resolved": "http://localhost:9990/folder/sub-dependency.js", "integrity": "sha512-Jjmwazwmg67EwNPViCBwvSIxhENfS6gwufXoQLrB0B/JDA4v1p+p2S5Y6IGP4SzZqqVTsROlU8meD6ep3q6MTA==", "contentType": "text/javascript" }, + "http://localhost:9990/folder/sub-dependency2.js": { "resolved": "http://localhost:9990/folder/sub-dependency2.js", "integrity": "sha512-BDZKEwlnwBabeHEwmMd02NxFEjYy+QwKAKP0S8zMMesX7dUsvh11hM7LUOPPFOS+nIEFZPtnc7kFwmnojVUw5A==", "contentType": "text/javascript" }, + "http://localhost:9990/index.css?cache": { "resolved": "http://localhost:9990/index.css?cache", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, + "http://localhost:9990/index.css?no-cache": "no-cache", + "http://localhost:9990/index.css?query#fragment": { "resolved": "http://localhost:9990/index.css?query#fragment", "integrity": "sha512-sqhF9JAEi5h3ziP48SBnzQnaeei8cf/pfYJBdKL4F7xdu3v5yr71eQ0kCL11/jWRFjLG4TKOudUnS/u6WLMqYw==", "contentType": "text/css" }, + "http://localhost:9990/redirect": { "resolved": "http://localhost:9990/redirect.js", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, + "http://localhost:9990/redirect.js": { "resolved": "http://localhost:9990/redirect.js", "integrity": "sha512-BV/MK/QTq+NHRve1XpZyQ8V6cjRP/fwbtJvENRdm5C73qNYZ4i2/fw+soj7J4qxzBXMHDbvOnA6E0ShnX2hc1w==", "contentType": "text/javascript" }, + "http://localhost:9990/resolve.js": { "resolved": "http://localhost:9990/resolve.js", "integrity": "sha512-6J9zBO2hXSMTO1EtXJOxSRB2nVPHCoNmNHS8an1QeehzJFc3uoBPRWu6hqHPc54gv2/QME9RBR/BXIan68virg==", "contentType": "text/javascript" }, + "https://raw.githubusercontent.com//webpack//webpack//main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, + "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md": { "resolved": "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md", "integrity": "sha512-OLJ9q6iSO652hVBkTLsMLtQnFBBTzEbFqLGyWD62nPga/0DZ9bc3oOFb5OYT8RIPzmlOX4WzK2uiLgc1NSGtBA==", "contentType": "text/plain; charset=utf-8" }, + "version": 1 +} diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt new file mode 100644 index 000000000..5e1c309da --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/asset_46e6c8f1b2a5b24fb643.txt @@ -0,0 +1 @@ +Hello World \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js new file mode 100644 index 000000000..e5dfb6da9 --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/fallback_8ab931cdbc2812bdc302.js @@ -0,0 +1 @@ +export * from "fallback-package"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js new file mode 100644 index 000000000..e3e81f78e --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_dependency_ba99384fb6c83b67f435.js @@ -0,0 +1,2 @@ +export * from "./sub-dependency.js"; +export * from "/folder/sub-dependency2.js"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js new file mode 100644 index 000000000..72fdbad6c --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency2_fe244ae613f6967e2f8b.js @@ -0,0 +1 @@ +export const value2 = 42; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js new file mode 100644 index 000000000..b7159db48 --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/folder_sub-dependency_f335316192eeeb416b57.js @@ -0,0 +1 @@ +export const value = 42; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css new file mode 100644 index 000000000..b978c1b59 --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/index_cache_071c12a46730e2dedd60.css @@ -0,0 +1 @@ +a {} \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css new file mode 100644 index 000000000..b978c1b59 --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/index_query_004fef5280e02f70d9a7.css @@ -0,0 +1 @@ +a {} \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js new file mode 100644 index 000000000..d31cf81a3 --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/redirect_06486fd663ea9c13ee91.js @@ -0,0 +1 @@ +export default { ok: true }; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js new file mode 100644 index 000000000..7a369ecb8 --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/http_localhost_9990/resolve_e754563143efbab1c458.js @@ -0,0 +1 @@ +export * from "./folder/dependency.js"; \ No newline at end of file diff --git a/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md new file mode 100644 index 000000000..4faf227c4 --- /dev/null +++ b/test/configCases/asset-modules/http-url/prod-defaults.webpack.lock.data/https_raw.githubusercontent.com/webpack_webpack_main_CODE_OF_CONDUCT_134f75ac3260537b8472.md @@ -0,0 +1 @@ +[Code of Conduct](https://github.com/openjs-foundation/code-and-learn/blob/master/CODE_OF_CONDUCT.md) diff --git a/test/configCases/asset-modules/http-url/server/asset.txt b/test/configCases/asset-modules/http-url/server/asset.txt new file mode 100644 index 000000000..557db03de --- /dev/null +++ b/test/configCases/asset-modules/http-url/server/asset.txt @@ -0,0 +1 @@ +Hello World diff --git a/test/configCases/asset-modules/http-url/server/fallback.js b/test/configCases/asset-modules/http-url/server/fallback.js new file mode 100644 index 000000000..4dda52bd8 --- /dev/null +++ b/test/configCases/asset-modules/http-url/server/fallback.js @@ -0,0 +1 @@ +export * from "fallback-package"; diff --git a/test/configCases/asset-modules/http-url/server/folder/dependency.js b/test/configCases/asset-modules/http-url/server/folder/dependency.js new file mode 100644 index 000000000..aaefe3bf3 --- /dev/null +++ b/test/configCases/asset-modules/http-url/server/folder/dependency.js @@ -0,0 +1,2 @@ +export * from "./sub-dependency.js"; +export * from "/folder/sub-dependency2.js"; diff --git a/test/configCases/asset-modules/http-url/server/folder/sub-dependency.js b/test/configCases/asset-modules/http-url/server/folder/sub-dependency.js new file mode 100644 index 000000000..46d3ca8c6 --- /dev/null +++ b/test/configCases/asset-modules/http-url/server/folder/sub-dependency.js @@ -0,0 +1 @@ +export const value = 42; diff --git a/test/configCases/asset-modules/http-url/server/folder/sub-dependency2.js b/test/configCases/asset-modules/http-url/server/folder/sub-dependency2.js new file mode 100644 index 000000000..0eb474a6b --- /dev/null +++ b/test/configCases/asset-modules/http-url/server/folder/sub-dependency2.js @@ -0,0 +1 @@ +export const value2 = 42; diff --git a/test/configCases/asset-modules/http-url/server/index.js b/test/configCases/asset-modules/http-url/server/index.js index 1ab7e59e6..46ee3e219 100644 --- a/test/configCases/asset-modules/http-url/server/index.js +++ b/test/configCases/asset-modules/http-url/server/index.js @@ -1,34 +1,44 @@ const http = require("http"); const fs = require("fs"); +const path = require("path"); /** - * @param {number} port port - * @returns {Promise} server instance + * @returns {import("http").Server} server instance */ -function createServer(port) { - const file = fs - .readFileSync("./test/configCases/asset-modules/http-url/server/index.css") - .toString() - .trim(); - +function createServer() { const server = http.createServer((req, res) => { - if (req.url !== "/index.css") { + let file; + const pathname = "." + req.url.replace(/\?.*$/, ""); + if (req.url.endsWith("?no-cache")) { + res.setHeader("Cache-Control", "no-cache, max-age=60"); + } else { + res.setHeader("Cache-Control", "public, immutable, max-age=600"); + } + try { + file = fs + .readFileSync(path.resolve(__dirname, pathname)) + .toString() + .replace(/\r\n?/g, "\n") + .trim(); + } catch (e) { + if (fs.existsSync(path.resolve(__dirname, pathname + ".js"))) { + res.statusCode = 301; + res.setHeader("Location", pathname.slice(1) + ".js"); + res.end(); + return; + } res.statusCode = 404; res.end(); - } else { - res.end(file); + return; } + res.setHeader( + "Content-Type", + pathname.endsWith(".js") ? "text/javascript" : "text/css" + ); + res.end(file); }); - - return new Promise((resolve, reject) => { - server.listen(port, err => { - if (err) { - reject(err); - } else { - resolve(server); - } - }); - }); + server.unref(); + return server; } class ServerPlugin { @@ -37,28 +47,38 @@ class ServerPlugin { */ constructor(port) { this.port = port; + this.refs = 0; + this.server = undefined; } /** * @param {import("../../../../../").Compiler} compiler */ apply(compiler) { - let server; - compiler.hooks.beforeRun.tapPromise( "ServerPlugin", async (compiler, callback) => { - if (!server) { - server = await createServer(this.port); - server.unref(); + this.refs++; + if (!this.server) { + this.server = createServer(); + await new Promise((resolve, reject) => { + this.server.listen(this.port, err => { + if (err) { + reject(err); + } else { + resolve(); + } + }); + }); } } ); compiler.hooks.done.tapAsync("ServerPlugin", (stats, callback) => { - if (server) { - server.close(callback); - server = undefined; + const s = this.server; + if (s && --this.refs === 0) { + this.server = undefined; + s.close(callback); } else { callback(); } diff --git a/test/configCases/asset-modules/http-url/server/redirect.js b/test/configCases/asset-modules/http-url/server/redirect.js new file mode 100644 index 000000000..47362862d --- /dev/null +++ b/test/configCases/asset-modules/http-url/server/redirect.js @@ -0,0 +1 @@ +export default { ok: true }; diff --git a/test/configCases/asset-modules/http-url/server/resolve.js b/test/configCases/asset-modules/http-url/server/resolve.js new file mode 100644 index 000000000..b181699cf --- /dev/null +++ b/test/configCases/asset-modules/http-url/server/resolve.js @@ -0,0 +1 @@ +export * from "./folder/dependency.js"; diff --git a/test/configCases/asset-modules/http-url/webpack.config.js b/test/configCases/asset-modules/http-url/webpack.config.js index 4c3a2d4c1..c9a220638 100644 --- a/test/configCases/asset-modules/http-url/webpack.config.js +++ b/test/configCases/asset-modules/http-url/webpack.config.js @@ -5,16 +5,85 @@ const { } = require("../../../../"); const ServerPlugin = require("./server"); +const serverPlugin = new ServerPlugin(9990); /** @type {import("../../../../").Configuration} */ -module.exports = { +const base = { mode: "development", module: { rules: [ { test: /\.css$/, loader: "./loaders/css-loader" + }, + { + test: /\.md$/, + loader: "./loaders/md-loader" + }, + { + test: /\.txt$/, + type: "asset/source" } ] - }, - plugins: [new ServerPlugin(9990), new HttpUriPlugin()] + } }; + +const frozen = true; + +module.exports = [ + { + name: "frozen-verify", + ...base, + plugins: [ + serverPlugin, + new HttpUriPlugin({ + upgrade: true, + frozen + }) + ] + }, + { + name: "dev-defaults", + ...base, + plugins: [ + serverPlugin, + new HttpUriPlugin({ + upgrade: true, + frozen: false + }) + ] + }, + { + name: "prod-defaults", + ...base, + plugins: [ + serverPlugin, + new HttpUriPlugin({ + upgrade: false, + frozen + }) + ] + }, + { + name: "no-cache", + ...base, + plugins: [ + serverPlugin, + new HttpUriPlugin({ + cacheLocation: false, + frozen + }) + ] + }, + { + name: "errors", + ...base, + entry: "./index.errors.js", + plugins: [ + serverPlugin, + new HttpUriPlugin({ + upgrade: true, + frozen: true + }) + ] + } +]; diff --git a/test/configCases/asset-modules/https-url/index.js b/test/configCases/asset-modules/https-url/index.js deleted file mode 100644 index 62f542173..000000000 --- a/test/configCases/asset-modules/https-url/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import codeOfConduct from "https://raw.githubusercontent.com/webpack/webpack/main/CODE_OF_CONDUCT.md"; - -it("https url request should be supported", () => { - expect(codeOfConduct.includes("CODE_OF_CONDUCT")).toBeTruthy(); -}); diff --git a/test/configCases/asset-modules/https-url/webpack.config.js b/test/configCases/asset-modules/https-url/webpack.config.js deleted file mode 100644 index 6375d2a4f..000000000 --- a/test/configCases/asset-modules/https-url/webpack.config.js +++ /dev/null @@ -1,19 +0,0 @@ -const { - experiments: { - schemes: { HttpsUriPlugin } - } -} = require("../../../../"); - -/** @type {import("../../../../").Configuration} */ -module.exports = { - mode: "development", - module: { - rules: [ - { - test: /\.md$/, - loader: "./loaders/md-loader" - } - ] - }, - plugins: [new HttpsUriPlugin()] -}; diff --git a/types.d.ts b/types.d.ts index 72d859884..9a1c36dbb 100644 --- a/types.d.ts +++ b/types.d.ts @@ -3249,6 +3249,11 @@ declare interface Experiments { */ asyncWebAssembly?: boolean; + /** + * Build http(s): urls using a lockfile and resource content cache. + */ + buildHttp?: boolean | HttpUriOptions; + /** * Enable build-time execution of modules from the module graph for plugins and loaders. */ @@ -4285,16 +4290,53 @@ declare interface HotModuleReplacementPluginLoaderContext { declare class HotUpdateChunk extends Chunk { constructor(); } -declare class HttpUriPlugin { - constructor(); + +/** + * Options for building http resources. + */ +declare interface HttpUriOptions { + /** + * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false. + */ + cacheLocation?: string | false; /** - * Apply the plugin + * When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error. */ - apply(compiler: Compiler): void; + frozen?: boolean; + + /** + * Location of the lockfile. + */ + lockfileLocation?: string; + + /** + * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed. + */ + upgrade?: boolean; } -declare class HttpsUriPlugin { - constructor(); +declare class HttpUriPlugin { + constructor(options?: { + /** + * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false. + */ + cacheLocation?: string | false; + /** + * When set, anything that would lead to an modification of the lockfile or any resource content, will result in an error. + */ + frozen?: boolean; + /** + * Location of the lockfile. + */ + lockfileLocation?: string; + /** + * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed. + */ + upgrade?: boolean; + hashFunction?: string | typeof Hash; + hashDigest?: string; + hashDigestLength?: number; + }); /** * Apply the plugin @@ -6961,6 +7003,7 @@ declare class NaturalModuleIdsPlugin { apply(compiler: Compiler): void; } declare interface NeedBuildContext { + compilation: Compilation; fileSystemInfo: FileSystemInfo; valueCacheVersions: Map>; } @@ -7227,6 +7270,7 @@ declare interface NormalModuleCompilationHooks { readResourceForScheme: HookMap< AsyncSeriesBailHook<[string, NormalModule], string | Buffer> >; + needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>; } declare abstract class NormalModuleFactory extends ModuleFactory { hooks: Readonly<{ @@ -7234,6 +7278,9 @@ declare abstract class NormalModuleFactory extends ModuleFactory { resolveForScheme: HookMap< AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void> >; + resolveInScheme: HookMap< + AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void> + >; factorize: AsyncSeriesBailHook<[ResolveData], any>; beforeResolve: AsyncSeriesBailHook<[ResolveData], any>; afterResolve: AsyncSeriesBailHook<[ResolveData], any>; @@ -12194,7 +12241,7 @@ declare namespace exports { } export namespace experiments { export namespace schemes { - export { HttpUriPlugin, HttpsUriPlugin }; + export { HttpUriPlugin }; } } export type WebpackPluginFunction = (