@rspack/core 1.0.0-alpha.0 → 1.0.0-alpha.2

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 (49) hide show
  1. package/compiled/enhanced-resolve/index.js +11 -11
  2. package/compiled/zod-validation-error/index.d.ts +4 -170
  3. package/compiled/zod-validation-error/index.js +4 -4154
  4. package/dist/Compilation.d.ts +12 -10
  5. package/dist/Compilation.js +13 -10
  6. package/dist/Compiler.d.ts +25 -27
  7. package/dist/Compiler.js +42 -24
  8. package/dist/ContextModuleFactory.d.ts +1 -1
  9. package/dist/ContextModuleFactory.js +1 -1
  10. package/dist/MultiCompiler.d.ts +11 -11
  11. package/dist/MultiCompiler.js +30 -13
  12. package/dist/NormalModule.d.ts +7 -3
  13. package/dist/NormalModule.js +27 -4
  14. package/dist/NormalModuleFactory.d.ts +2 -1
  15. package/dist/NormalModuleFactory.js +2 -1
  16. package/dist/ResolverFactory.d.ts +3 -3
  17. package/dist/ResolverFactory.js +1 -1
  18. package/dist/Stats.d.ts +2 -0
  19. package/dist/Stats.js +6 -0
  20. package/dist/Watching.d.ts +1 -1
  21. package/dist/builtin-loader/swc/index.d.ts +0 -2
  22. package/dist/builtin-loader/swc/index.js +1 -3
  23. package/dist/builtin-loader/swc/types.d.ts +0 -2
  24. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  25. package/dist/builtin-plugin/JavascriptModulesPlugin.js +1 -1
  26. package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +1 -1
  27. package/dist/builtin-plugin/SplitChunksPlugin.js +11 -2
  28. package/dist/config/adapter.js +7 -6
  29. package/dist/config/adapterRuleUse.js +0 -3
  30. package/dist/config/zod.d.ts +585 -162
  31. package/dist/config/zod.js +4 -2
  32. package/dist/exports.d.ts +8 -1
  33. package/dist/exports.js +10 -5
  34. package/dist/lib/Cache.d.ts +3 -3
  35. package/dist/lib/Cache.js +1 -1
  36. package/dist/loader-runner/index.js +9 -5
  37. package/dist/node/nodeConsole.js +26 -3
  38. package/dist/rspack.d.ts +1 -1
  39. package/dist/stats/StatsFactory.d.ts +2 -2
  40. package/dist/stats/StatsFactory.js +12 -12
  41. package/dist/stats/StatsPrinter.d.ts +1 -1
  42. package/dist/stats/StatsPrinter.js +8 -8
  43. package/dist/util/SplitChunkSize.d.ts +5 -0
  44. package/dist/util/SplitChunkSize.js +18 -0
  45. package/package.json +6 -6
  46. package/dist/builtin-loader/swc/preact.d.ts +0 -6
  47. package/dist/builtin-loader/swc/preact.js +0 -15
  48. package/dist/lite-tapable/index.d.ts +0 -146
  49. package/dist/lite-tapable/index.js +0 -752
@@ -1267,7 +1267,7 @@ module.exports = class DirectoryExistsPlugin {
1267
1267
  const path = __nccwpck_require__(17);
1268
1268
  const DescriptionFileUtils = __nccwpck_require__(702);
1269
1269
  const forEachBail = __nccwpck_require__(266);
1270
- const { processExportsField } = __nccwpck_require__(348);
1270
+ const { processExportsField } = __nccwpck_require__(302);
1271
1271
  const { parseIdentifier } = __nccwpck_require__(780);
1272
1272
  const { checkImportsExportsFieldTarget } = __nccwpck_require__(11);
1273
1273
 
@@ -1563,7 +1563,7 @@ module.exports = class FileExistsPlugin {
1563
1563
  const path = __nccwpck_require__(17);
1564
1564
  const DescriptionFileUtils = __nccwpck_require__(702);
1565
1565
  const forEachBail = __nccwpck_require__(266);
1566
- const { processImportsField } = __nccwpck_require__(348);
1566
+ const { processImportsField } = __nccwpck_require__(302);
1567
1567
  const { parseIdentifier } = __nccwpck_require__(780);
1568
1568
  const { checkImportsExportsFieldTarget } = __nccwpck_require__(11);
1569
1569
 
@@ -2381,7 +2381,7 @@ module.exports = class PnpPlugin {
2381
2381
 
2382
2382
 
2383
2383
 
2384
- const { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = __nccwpck_require__(267);
2384
+ const { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = __nccwpck_require__(348);
2385
2385
  const createInnerContext = __nccwpck_require__(478);
2386
2386
  const { parseIdentifier } = __nccwpck_require__(780);
2387
2387
  const {
@@ -4545,7 +4545,7 @@ module.exports = mergeExports(resolve, {
4545
4545
 
4546
4546
  /***/ }),
4547
4547
 
4548
- /***/ 348:
4548
+ /***/ 302:
4549
4549
  /***/ ((module) => {
4550
4550
 
4551
4551
  /*
@@ -5489,6 +5489,13 @@ module.exports = require("../graceful-fs/index.js");
5489
5489
 
5490
5490
  /***/ }),
5491
5491
 
5492
+ /***/ 348:
5493
+ /***/ ((module) => {
5494
+
5495
+ module.exports = require("@rspack/lite-tapable");
5496
+
5497
+ /***/ }),
5498
+
5492
5499
  /***/ 17:
5493
5500
  /***/ ((module) => {
5494
5501
 
@@ -5508,13 +5515,6 @@ module.exports = require("pnpapi");
5508
5515
 
5509
5516
  module.exports = require("process");
5510
5517
 
5511
- /***/ }),
5512
-
5513
- /***/ 267:
5514
- /***/ ((module) => {
5515
-
5516
- module.exports = require("tapable");
5517
-
5518
5518
  /***/ })
5519
5519
 
5520
5520
  /******/ });
@@ -1,178 +1,12 @@
1
- declare type Primitive = string | number | symbol | bigint | boolean | null | undefined;
2
-
3
- declare const ZodParsedType: {
4
- function: "function";
5
- number: "number";
6
- string: "string";
7
- nan: "nan";
8
- integer: "integer";
9
- float: "float";
10
- boolean: "boolean";
11
- date: "date";
12
- bigint: "bigint";
13
- symbol: "symbol";
14
- undefined: "undefined";
15
- null: "null";
16
- array: "array";
17
- object: "object";
18
- unknown: "unknown";
19
- promise: "promise";
20
- void: "void";
21
- never: "never";
22
- map: "map";
23
- set: "set";
24
- };
25
- declare type ZodParsedType = keyof typeof ZodParsedType;
26
-
27
- declare type allKeys<T> = T extends any ? keyof T : never;
28
- declare type typeToFlattenedError<T, U = string> = {
29
- formErrors: U[];
30
- fieldErrors: {
31
- [P in allKeys<T>]?: U[];
32
- };
33
- };
34
- declare const ZodIssueCode: {
35
- invalid_type: "invalid_type";
36
- invalid_literal: "invalid_literal";
37
- custom: "custom";
38
- invalid_union: "invalid_union";
39
- invalid_union_discriminator: "invalid_union_discriminator";
40
- invalid_enum_value: "invalid_enum_value";
41
- unrecognized_keys: "unrecognized_keys";
42
- invalid_arguments: "invalid_arguments";
43
- invalid_return_type: "invalid_return_type";
44
- invalid_date: "invalid_date";
45
- invalid_string: "invalid_string";
46
- too_small: "too_small";
47
- too_big: "too_big";
48
- invalid_intersection_types: "invalid_intersection_types";
49
- not_multiple_of: "not_multiple_of";
50
- not_finite: "not_finite";
51
- };
52
- declare type ZodIssueCode = keyof typeof ZodIssueCode;
53
- declare type ZodIssueBase = {
54
- path: (string | number)[];
55
- message?: string;
56
- };
57
- interface ZodInvalidTypeIssue extends ZodIssueBase {
58
- code: typeof ZodIssueCode.invalid_type;
59
- expected: ZodParsedType;
60
- received: ZodParsedType;
61
- }
62
- interface ZodInvalidLiteralIssue extends ZodIssueBase {
63
- code: typeof ZodIssueCode.invalid_literal;
64
- expected: unknown;
65
- received: unknown;
66
- }
67
- interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
68
- code: typeof ZodIssueCode.unrecognized_keys;
69
- keys: string[];
70
- }
71
- interface ZodInvalidUnionIssue extends ZodIssueBase {
72
- code: typeof ZodIssueCode.invalid_union;
73
- unionErrors: ZodError$1[];
74
- }
75
- interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
76
- code: typeof ZodIssueCode.invalid_union_discriminator;
77
- options: Primitive[];
78
- }
79
- interface ZodInvalidEnumValueIssue extends ZodIssueBase {
80
- received: string | number;
81
- code: typeof ZodIssueCode.invalid_enum_value;
82
- options: (string | number)[];
83
- }
84
- interface ZodInvalidArgumentsIssue extends ZodIssueBase {
85
- code: typeof ZodIssueCode.invalid_arguments;
86
- argumentsError: ZodError$1;
87
- }
88
- interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
89
- code: typeof ZodIssueCode.invalid_return_type;
90
- returnTypeError: ZodError$1;
91
- }
92
- interface ZodInvalidDateIssue extends ZodIssueBase {
93
- code: typeof ZodIssueCode.invalid_date;
94
- }
95
- declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "ip" | {
96
- includes: string;
97
- position?: number;
98
- } | {
99
- startsWith: string;
100
- } | {
101
- endsWith: string;
102
- };
103
- interface ZodInvalidStringIssue extends ZodIssueBase {
104
- code: typeof ZodIssueCode.invalid_string;
105
- validation: StringValidation;
106
- }
107
- interface ZodTooSmallIssue extends ZodIssueBase {
108
- code: typeof ZodIssueCode.too_small;
109
- minimum: number | bigint;
110
- inclusive: boolean;
111
- exact?: boolean;
112
- type: "array" | "string" | "number" | "set" | "date" | "bigint";
113
- }
114
- interface ZodTooBigIssue extends ZodIssueBase {
115
- code: typeof ZodIssueCode.too_big;
116
- maximum: number | bigint;
117
- inclusive: boolean;
118
- exact?: boolean;
119
- type: "array" | "string" | "number" | "set" | "date" | "bigint";
120
- }
121
- interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
122
- code: typeof ZodIssueCode.invalid_intersection_types;
123
- }
124
- interface ZodNotMultipleOfIssue extends ZodIssueBase {
125
- code: typeof ZodIssueCode.not_multiple_of;
126
- multipleOf: number | bigint;
127
- }
128
- interface ZodNotFiniteIssue extends ZodIssueBase {
129
- code: typeof ZodIssueCode.not_finite;
130
- }
131
- interface ZodCustomIssue extends ZodIssueBase {
132
- code: typeof ZodIssueCode.custom;
133
- params?: {
134
- [k: string]: any;
135
- };
136
- }
137
- declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
138
- declare type ZodIssue = ZodIssueOptionalMessage & {
139
- fatal?: boolean;
140
- message: string;
141
- };
142
- declare type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
143
- [K in keyof T]?: ZodFormattedError<T[K]>;
144
- } : T extends any[] ? {
145
- [k: number]: ZodFormattedError<T[number]>;
146
- } : T extends object ? {
147
- [K in keyof T]?: ZodFormattedError<T[K]>;
148
- } : unknown;
149
- declare type ZodFormattedError<T, U = string> = {
150
- _errors: U[];
151
- } & recursiveZodFormattedError<NonNullable<T>>;
152
- declare class ZodError$1<T = any> extends Error {
153
- issues: ZodIssue[];
154
- get errors(): ZodIssue[];
155
- constructor(issues: ZodIssue[]);
156
- format(): ZodFormattedError<T>;
157
- format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
158
- static create: (issues: ZodIssue[]) => ZodError$1<any>;
159
- toString(): string;
160
- get message(): string;
161
- get isEmpty(): boolean;
162
- addIssue: (sub: ZodIssue) => void;
163
- addIssues: (subs?: ZodIssue[]) => void;
164
- flatten(): typeToFlattenedError<T>;
165
- flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
166
- get formErrors(): typeToFlattenedError<T, string>;
167
- }
1
+ import * as zod from 'zod';
168
2
 
169
3
  declare class ValidationError extends Error {
170
- details: Array<ZodIssue>;
4
+ details: Array<zod.ZodIssue>;
171
5
  name: 'ZodValidationError';
172
- constructor(message: string, details?: Array<ZodIssue> | undefined);
6
+ constructor(message: string, details?: Array<zod.ZodIssue> | undefined);
173
7
  toString(): string;
174
8
  }
175
- type ZodError = ZodError$1;
9
+ type ZodError = zod.ZodError;
176
10
  type FromZodErrorOptions = {
177
11
  maxIssuesInMessage?: number;
178
12
  issueSeparator?: string;