@rspack/core 0.7.6-canary-f272bd8-20240625122346 → 1.0.0-alpha.0

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 (66) hide show
  1. package/README.md +2 -2
  2. package/compiled/webpack-sources/index.d.ts +130 -0
  3. package/compiled/webpack-sources/index.js +3520 -0
  4. package/compiled/webpack-sources/license +21 -0
  5. package/compiled/webpack-sources/package.json +1 -0
  6. package/dist/Chunk.d.ts +19 -14
  7. package/dist/Chunk.js +22 -17
  8. package/dist/ChunkGraph.d.ts +1 -1
  9. package/dist/ChunkGraph.js +5 -5
  10. package/dist/ChunkGroup.d.ts +17 -7
  11. package/dist/ChunkGroup.js +12 -2
  12. package/dist/Compilation.d.ts +19 -23
  13. package/dist/Compilation.js +20 -43
  14. package/dist/Compiler.d.ts +1 -1
  15. package/dist/Compiler.js +40 -2
  16. package/dist/Entrypoint.d.ts +1 -1
  17. package/dist/Entrypoint.js +2 -2
  18. package/dist/Module.d.ts +12 -7
  19. package/dist/Module.js +1 -0
  20. package/dist/NormalModule.d.ts +0 -1
  21. package/dist/NormalModule.js +0 -7
  22. package/dist/NormalModuleFactory.d.ts +1 -0
  23. package/dist/NormalModuleFactory.js +1 -22
  24. package/dist/RspackError.d.ts +8 -0
  25. package/dist/RspackError.js +21 -0
  26. package/dist/Stats.d.ts +2 -2
  27. package/dist/Template.d.ts +1 -1
  28. package/dist/Template.js +2 -2
  29. package/dist/builtin-loader/swc/index.d.ts +0 -4
  30. package/dist/builtin-loader/swc/index.js +1 -5
  31. package/dist/builtin-loader/swc/preact.d.ts +3 -4
  32. package/dist/builtin-loader/swc/types.d.ts +2 -17
  33. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -0
  34. package/dist/builtin-plugin/BundlerInfoRspackPlugin.js +1 -0
  35. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +15 -9
  36. package/dist/builtin-plugin/JavascriptModulesPlugin.js +50 -1
  37. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +0 -28
  38. package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +20 -69
  39. package/dist/builtin-plugin/css-extract/index.d.ts +2 -2
  40. package/dist/config/adapter.js +23 -10
  41. package/dist/config/adapterRuleUse.js +0 -11
  42. package/dist/config/defaults.js +22 -30
  43. package/dist/config/normalization.js +13 -5
  44. package/dist/config/zod.d.ts +168 -43
  45. package/dist/config/zod.js +23 -11
  46. package/dist/container/ModuleFederationPlugin.js +1 -1
  47. package/dist/container/default.runtime.js +1 -170
  48. package/dist/exports.d.ts +3 -2
  49. package/dist/exports.js +5 -2
  50. package/dist/lite-tapable/index.js +2 -2
  51. package/dist/loader-runner/index.js +28 -7
  52. package/dist/rspackOptionsApply.js +3 -0
  53. package/dist/stats/DefaultStatsFactoryPlugin.js +35 -11
  54. package/dist/stats/DefaultStatsPrinterPlugin.js +2 -2
  55. package/dist/stats/statsFactoryUtils.d.ts +13 -4
  56. package/dist/util/index.d.ts +2 -2
  57. package/dist/util/index.js +4 -3
  58. package/dist/util/memoize.js +5 -1
  59. package/dist/util/source.d.ts +1 -1
  60. package/dist/util/source.js +1 -1
  61. package/package.json +12 -7
  62. package/dist/builtin-loader/swc/emotion.d.ts +0 -17
  63. package/dist/builtin-loader/swc/emotion.js +0 -22
  64. package/dist/builtin-loader/swc/relay.d.ts +0 -5
  65. package/dist/builtin-loader/swc/relay.js +0 -48
  66. package/dist/container/default.runtime.d.ts +0 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <picture>
2
- <source media="(prefers-color-scheme: dark)" srcset="https://lf3-static.bytednsdoc.com/obj/eden-cn/rjhwzy/ljhwZthlaukjlkulzlp/rspack-banner-1610-dark.png">
3
- <img alt="Rspack Banner" src="https://lf3-static.bytednsdoc.com/obj/eden-cn/rjhwzy/ljhwZthlaukjlkulzlp/rspack-banner-1610.png">
2
+ <source media="(prefers-color-scheme: dark)" srcset="https://assets.rspack.dev/rspack/rspack-banner-plain-dark.png">
3
+ <img alt="Rspack Banner" src="https://assets.rspack.dev/rspack/rspack-banner-plain-light.png">
4
4
  </picture>
5
5
 
6
6
  # @rspack/core
@@ -0,0 +1,130 @@
1
+ declare class Hash {
2
+ constructor();
3
+
4
+ /**
5
+ * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
6
+ */
7
+ update(data: string | Buffer, inputEncoding?: string): Hash;
8
+
9
+ /**
10
+ * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
11
+ */
12
+ digest(encoding?: string): string | Buffer;
13
+ }
14
+
15
+ export type MapOptions = { columns?: boolean; module?: boolean };
16
+
17
+ export type RawSourceMap = {
18
+ version: number;
19
+ sources: string[];
20
+ names: string[];
21
+ sourceRoot?: string;
22
+ sourcesContent?: string[];
23
+ mappings: string;
24
+ file: string;
25
+ };
26
+
27
+ export abstract class Source {
28
+ size(): number;
29
+
30
+ map(options?: MapOptions): RawSourceMap | null;
31
+
32
+ sourceAndMap(options?: MapOptions): {
33
+ source: string | Buffer;
34
+ map: Object;
35
+ };
36
+
37
+ updateHash(hash: Hash): void;
38
+
39
+ source(): string | Buffer;
40
+
41
+ buffer(): Buffer;
42
+ }
43
+
44
+ export class RawSource extends Source {
45
+ constructor(source: string | Buffer, convertToString?: boolean);
46
+
47
+ isBuffer(): boolean;
48
+ }
49
+
50
+ export class OriginalSource extends Source {
51
+ constructor(source: string | Buffer, name: string);
52
+
53
+ getName(): string;
54
+ }
55
+
56
+ export class ReplaceSource extends Source {
57
+ constructor(source: Source, name?: string);
58
+
59
+ replace(start: number, end: number, newValue: string, name?: string): void;
60
+ insert(pos: number, newValue: string, name?: string): void;
61
+
62
+ getName(): string;
63
+ original(): string;
64
+ getReplacements(): {
65
+ start: number;
66
+ end: number;
67
+ content: string;
68
+ insertIndex: number;
69
+ name: string;
70
+ }[];
71
+ }
72
+
73
+ export class SourceMapSource extends Source {
74
+ constructor(
75
+ source: string | Buffer,
76
+ name: string,
77
+ sourceMap: Object | string | Buffer,
78
+ originalSource?: string | Buffer,
79
+ innerSourceMap?: Object | string | Buffer,
80
+ removeOriginalSource?: boolean
81
+ );
82
+
83
+ getArgsAsBuffers(): [
84
+ Buffer,
85
+ string,
86
+ Buffer,
87
+ Buffer | undefined,
88
+ Buffer | undefined,
89
+ boolean
90
+ ];
91
+ }
92
+
93
+ export class ConcatSource extends Source {
94
+ constructor(...args: (string | Source)[]);
95
+
96
+ getChildren(): Source[];
97
+
98
+ add(item: string | Source): void;
99
+ addAllSkipOptimizing(items: Source[]): void;
100
+ }
101
+
102
+ export class PrefixSource extends Source {
103
+ constructor(prefix: string, source: string | Source);
104
+
105
+ original(): Source;
106
+ getPrefix(): string;
107
+ }
108
+
109
+ export class CachedSource extends Source {
110
+ constructor(source: Source);
111
+ constructor(source: Source | (() => Source), cachedData?: any);
112
+
113
+ original(): Source;
114
+ originalLazy(): Source | (() => Source);
115
+ getCachedData(): any;
116
+ }
117
+
118
+ export class SizeOnlySource extends Source {
119
+ constructor(size: number);
120
+ }
121
+
122
+ interface SourceLike {
123
+ source(): string | Buffer;
124
+ }
125
+
126
+ export class CompatSource extends Source {
127
+ constructor(sourceLike: SourceLike);
128
+
129
+ static from(sourceLike: SourceLike): Source;
130
+ }