@rspack-canary/test-tools 1.6.0-canary-6cd722f4-20251022123039 → 1.6.0-canary-e28e40e9-20251022173516

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/case/builtin.d.ts +3 -2
  2. package/dist/case/cache.d.ts +2 -2
  3. package/dist/case/cache.js +4 -1
  4. package/dist/case/common.d.ts +11 -10
  5. package/dist/case/common.js +2 -5
  6. package/dist/case/compiler.d.ts +9 -8
  7. package/dist/case/config.d.ts +6 -5
  8. package/dist/case/defaults.d.ts +5 -4
  9. package/dist/case/defaults.js +1 -1
  10. package/dist/case/error.d.ts +5 -5
  11. package/dist/case/hash.d.ts +2 -2
  12. package/dist/case/hook.d.ts +4 -3
  13. package/dist/case/hot-step.d.ts +2 -2
  14. package/dist/case/hot-step.js +1 -2
  15. package/dist/case/hot.d.ts +5 -4
  16. package/dist/case/incremental.d.ts +2 -2
  17. package/dist/case/index.d.ts +0 -1
  18. package/dist/case/index.js +1 -3
  19. package/dist/case/multi-compiler.d.ts +9 -8
  20. package/dist/case/runner.d.ts +5 -4
  21. package/dist/case/serial.d.ts +2 -2
  22. package/dist/case/stats-api.d.ts +6 -5
  23. package/dist/case/stats-api.js +1 -2
  24. package/dist/case/stats-output.d.ts +3 -2
  25. package/dist/case/watch.d.ts +6 -6
  26. package/dist/case/watch.js +2 -1
  27. package/dist/compiler.d.ts +15 -17
  28. package/dist/compiler.js +4 -11
  29. package/dist/helper/legacy/checkArrayExpectation.js +1 -1
  30. package/dist/helper/read-config-file.d.ts +3 -2
  31. package/dist/index.d.ts +0 -1
  32. package/dist/index.js +0 -1
  33. package/dist/plugin/index.d.ts +0 -3
  34. package/dist/plugin/index.js +0 -3
  35. package/dist/runner/node/index.d.ts +9 -8
  36. package/dist/runner/node/index.js +3 -1
  37. package/dist/runner/web/index.d.ts +5 -5
  38. package/dist/test/context.d.ts +4 -4
  39. package/dist/test/context.js +5 -13
  40. package/dist/test/creator.d.ts +14 -14
  41. package/dist/test/creator.js +3 -4
  42. package/dist/type.d.ts +27 -40
  43. package/dist/type.js +1 -6
  44. package/package.json +4 -9
  45. package/dist/case/diff.d.ts +0 -19
  46. package/dist/case/diff.js +0 -274
  47. package/dist/compare/comparator.d.ts +0 -17
  48. package/dist/compare/comparator.js +0 -52
  49. package/dist/compare/compare.d.ts +0 -17
  50. package/dist/compare/compare.js +0 -178
  51. package/dist/compare/format-code.d.ts +0 -16
  52. package/dist/compare/format-code.js +0 -244
  53. package/dist/compare/index.d.ts +0 -5
  54. package/dist/compare/index.js +0 -21
  55. package/dist/compare/replace-module-argument.d.ts +0 -1
  56. package/dist/compare/replace-module-argument.js +0 -8
  57. package/dist/compare/replace-runtime-module-name.d.ts +0 -1
  58. package/dist/compare/replace-runtime-module-name.js +0 -71
  59. package/dist/plugin/rspack-diff-config-plugin.d.ts +0 -7
  60. package/dist/plugin/rspack-diff-config-plugin.js +0 -42
  61. package/dist/plugin/webpack-diff-config-plugin.d.ts +0 -7
  62. package/dist/plugin/webpack-diff-config-plugin.js +0 -41
  63. package/dist/plugin/webpack-module-placeholder-plugin.d.ts +0 -3
  64. package/dist/plugin/webpack-module-placeholder-plugin.js +0 -106
  65. package/template/diff.bundle.css +0 -1
  66. package/template/diff.bundle.js +0 -144
  67. package/template/diff.html +0 -14
  68. package/template/editor.worker.js +0 -1
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RspackDiffConfigPlugin = void 0;
4
- const PLUGIN_NAME = "RspackDiffConfigPlugin";
5
- class RspackDiffConfigPlugin {
6
- constructor(modifier) {
7
- this.modifier = modifier;
8
- this.name = PLUGIN_NAME;
9
- process.env.RSPACK_DIFF = "true"; // enable rspack diff
10
- }
11
- apply(compiler) {
12
- const { options } = compiler;
13
- options.mode = "development";
14
- options.devtool = false;
15
- options.optimization ??= {};
16
- options.optimization.minimize = false;
17
- options.optimization.chunkIds = "named";
18
- options.optimization.moduleIds = "named";
19
- options.optimization.mangleExports ??= false;
20
- options.optimization.concatenateModules ??= false;
21
- options.output ??= {};
22
- options.output.pathinfo ??= false;
23
- options.output.environment ??= {};
24
- options.output.environment.arrowFunction ??= false;
25
- options.output.environment.bigIntLiteral ??= false;
26
- options.output.environment.const ??= false;
27
- options.output.environment.destructuring ??= false;
28
- options.output.environment.dynamicImport ??= false;
29
- options.output.environment.dynamicImportInWorker ??= false;
30
- options.output.environment.forOf ??= false;
31
- options.output.environment.globalThis ??= false;
32
- options.output.environment.module ??= false;
33
- options.output.environment.optionalChaining ??= false;
34
- options.output.environment.templateLiteral ??= false;
35
- options.experiments ??= {};
36
- options.experiments.rspackFuture ??= {};
37
- if (typeof this.modifier === "function") {
38
- this.modifier(compiler.options);
39
- }
40
- }
41
- }
42
- exports.RspackDiffConfigPlugin = RspackDiffConfigPlugin;
@@ -1,7 +0,0 @@
1
- import type { Compiler, WebpackOptionsNormalized } from "webpack";
2
- export declare class WebpackDiffConfigPlugin {
3
- private modifier?;
4
- name: string;
5
- constructor(modifier?: ((options: WebpackOptionsNormalized) => WebpackOptionsNormalized) | undefined);
6
- apply(compiler: Compiler): void;
7
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebpackDiffConfigPlugin = void 0;
4
- const webpack_module_placeholder_plugin_1 = require("./webpack-module-placeholder-plugin");
5
- const PLUGIN_NAME = "WebpackDiffConfigPlugin";
6
- class WebpackDiffConfigPlugin {
7
- constructor(modifier) {
8
- this.modifier = modifier;
9
- this.name = PLUGIN_NAME;
10
- }
11
- apply(compiler) {
12
- const { options } = compiler;
13
- options.mode = "development";
14
- options.devtool = false;
15
- options.optimization ??= {};
16
- options.optimization.minimize = false;
17
- options.optimization.chunkIds = "named";
18
- options.optimization.moduleIds = "named";
19
- options.optimization.mangleExports ??= false;
20
- options.optimization.concatenateModules ??= false;
21
- options.output ??= {};
22
- options.output.pathinfo ??= false;
23
- options.output.environment ??= {};
24
- options.output.environment.arrowFunction ??= false;
25
- options.output.environment.bigIntLiteral ??= false;
26
- options.output.environment.const ??= false;
27
- options.output.environment.destructuring ??= false;
28
- options.output.environment.dynamicImport ??= false;
29
- options.output.environment.dynamicImportInWorker ??= false;
30
- options.output.environment.forOf ??= false;
31
- options.output.environment.globalThis ??= false;
32
- options.output.environment.module ??= false;
33
- options.output.environment.optionalChaining ??= false;
34
- options.output.environment.templateLiteral ??= false;
35
- if (typeof this.modifier === "function") {
36
- this.modifier(compiler.options);
37
- }
38
- new webpack_module_placeholder_plugin_1.WebpackModulePlaceholderPlugin().apply(compiler);
39
- }
40
- }
41
- exports.WebpackDiffConfigPlugin = WebpackDiffConfigPlugin;
@@ -1,3 +0,0 @@
1
- export declare class WebpackModulePlaceholderPlugin {
2
- apply(compiler: any): void;
3
- }
@@ -1,106 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebpackModulePlaceholderPlugin = void 0;
4
- // @ts-nocheck
5
- const { ConcatSource, RawSource, CachedSource, PrefixSource } = require("webpack-sources");
6
- function createRenderRuntimeModulesFn(Template) {
7
- return function renderRuntimeModules(runtimeModules, renderContext) {
8
- const source = new ConcatSource();
9
- for (const module of runtimeModules) {
10
- const codeGenerationResults = renderContext.codeGenerationResults;
11
- let runtimeSource;
12
- if (codeGenerationResults) {
13
- runtimeSource = codeGenerationResults.getSource(module, renderContext.chunk.runtime, "runtime");
14
- }
15
- else {
16
- const codeGenResult = module.codeGeneration({
17
- chunkGraph: renderContext.chunkGraph,
18
- dependencyTemplates: renderContext.dependencyTemplates,
19
- moduleGraph: renderContext.moduleGraph,
20
- runtimeTemplate: renderContext.runtimeTemplate,
21
- runtime: renderContext.chunk.runtime,
22
- codeGenerationResults
23
- });
24
- if (!codeGenResult)
25
- continue;
26
- runtimeSource = codeGenResult.sources.get("runtime");
27
- }
28
- if (runtimeSource) {
29
- const identifier = module.identifier();
30
- source.add(`${Template.toNormalComment(`start::${identifier}`)}\n`);
31
- if (!module.shouldIsolate()) {
32
- source.add(runtimeSource);
33
- source.add("\n\n");
34
- }
35
- else if (renderContext.runtimeTemplate.supportsArrowFunction()) {
36
- source.add("(() => {\n");
37
- source.add(new PrefixSource("\t", runtimeSource));
38
- source.add("\n})();\n\n");
39
- }
40
- else {
41
- source.add("!function() {\n");
42
- source.add(new PrefixSource("\t", runtimeSource));
43
- source.add("\n}();\n\n");
44
- }
45
- source.add(`${Template.toNormalComment(`end::${identifier}`)}\n`);
46
- }
47
- }
48
- return source;
49
- };
50
- }
51
- const caches = new WeakMap();
52
- class WebpackModulePlaceholderPlugin {
53
- apply(compiler) {
54
- const { webpack } = compiler;
55
- const { Template, javascript: { JavascriptModulesPlugin } } = webpack;
56
- Template.renderRuntimeModules = createRenderRuntimeModulesFn(Template);
57
- compiler.hooks.compilation.tap("RuntimeDiffPlugin", compilation => {
58
- const hooks = JavascriptModulesPlugin.getCompilationHooks(compilation);
59
- hooks.inlineInRuntimeBailout.tap("RuntimeDiffPlugin", () => "not allow inline startup");
60
- hooks.renderModulePackage.tap("RuntimeDiffPlugin", (moduleSource, module) => {
61
- let cacheEntry;
62
- let cache = caches.get(compilation);
63
- if (cache === undefined) {
64
- caches.set(compilation, (cache = new WeakMap()));
65
- cache.set(module, (cacheEntry = {
66
- header: undefined,
67
- footer: undefined,
68
- full: new WeakMap()
69
- }));
70
- }
71
- else {
72
- cacheEntry = cache.get(module);
73
- if (cacheEntry === undefined) {
74
- cache.set(module, (cacheEntry = {
75
- header: undefined,
76
- footer: undefined,
77
- full: new WeakMap()
78
- }));
79
- }
80
- else {
81
- const cachedSource = cacheEntry.full.get(moduleSource);
82
- if (cachedSource !== undefined)
83
- return cachedSource;
84
- }
85
- }
86
- const source = new ConcatSource();
87
- let header = cacheEntry.header;
88
- let footer = cacheEntry.footer;
89
- if (header === undefined) {
90
- const identifier = module.identifier();
91
- header = new RawSource(`\n${Template.toNormalComment(`start::${identifier}`)}\n`);
92
- footer = new RawSource(`\n${Template.toNormalComment(`end::${identifier}`)}\n`);
93
- cacheEntry.header = header;
94
- cacheEntry.footer = footer;
95
- }
96
- source.add(header);
97
- source.add(moduleSource);
98
- source.add(footer);
99
- const cachedSource = new CachedSource(source);
100
- cacheEntry.full.set(moduleSource, cachedSource);
101
- return cachedSource;
102
- });
103
- });
104
- }
105
- }
106
- exports.WebpackModulePlaceholderPlugin = WebpackModulePlaceholderPlugin;