@rspack/core 1.3.5 → 1.3.6

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.
package/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  <picture>
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">
2
+ <img alt="Rspack Banner" src="https://assets.rspack.dev/rspack/rspack-banner.png">
4
3
  </picture>
5
4
 
6
5
  # @rspack/core
@@ -605,7 +605,7 @@ interface JscConfig {
605
605
  *
606
606
  * Second parameter of tuple is JSON based configuration for the plugin.
607
607
  */
608
- plugins?: Array<[string, Record<string, any>]>;
608
+ plugins?: WasmPlugin[];
609
609
  /**
610
610
  * Run Wasm plugins before stripping TypeScript or decorators.
611
611
  *
@@ -2096,5 +2096,14 @@ type Accessibility = "public" | "protected" | "private";
2096
2096
  interface Invalid extends Node, HasSpan {
2097
2097
  type: "Invalid";
2098
2098
  }
2099
+ type WasmAnalysisOptions = {
2100
+ parser?: ParserConfig;
2101
+ module?: true | false | 'unknown';
2102
+ filename?: string;
2103
+ errorFormat?: 'json' | 'normal';
2104
+ cacheRoot?: string;
2105
+ plugins: WasmPlugin[];
2106
+ };
2107
+ type WasmPlugin = [wasmPackage: string, config: Record<string, any>];
2099
2108
 
2100
- export type { Accessibility, AmdConfig, Argument, ArrayExpression, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentOperator, AssignmentPattern, AssignmentPatternProperty, AssignmentProperty, AwaitExpression, BaseModuleConfig, BigIntLiteral, BinaryExpression, BinaryOperator, BindingIdentifier, BlockStatement, BooleanLiteral, BreakStatement, CallExpression, CallerOptions, CatchClause, Class, ClassDeclaration, ClassExpression, ClassMember, ClassMethod, ClassMethodBase, ClassProperty, ClassPropertyBase, CommonJsConfig, ComputedPropName, ConditionalExpression, Config, ConstModulesConfig, Constructor, ContinueStatement, DebuggerStatement, Declaration, Decorator, DefaultDecl, DoWhileStatement, EmptyStatement, EnvConfig, Es6Config, EsParserConfig, ExportAllDeclaration, ExportDeclaration, ExportDefaultDeclaration, ExportDefaultExpression, ExportDefaultSpecifier, ExportNamedDeclaration, ExportNamespaceSpecifier, ExportSpecifier, ExprOrSpread, Expression, ExpressionStatement, Fn, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, GetterProperty, GlobalPassOption, HasDecorator, HasSpan, Identifier, IfStatement, Import, ImportDeclaration, ImportDefaultSpecifier, ImportNamespaceSpecifier, ImportSpecifier, Invalid, JSXAttrValue, JSXAttribute, JSXAttributeName, JSXAttributeOrSpread, JSXClosingElement, JSXClosingFragment, JSXElement, JSXElementChild, JSXElementName, JSXEmptyExpression, JSXExpression, JSXExpressionContainer, JSXFragment, JSXMemberExpression, JSXNamespacedName, JSXObject, JSXOpeningElement, JSXOpeningFragment, JSXSpreadChild, JSXText, JsFormatOptions, JsMinifyOptions, JscConfig, JscTarget, KeyValuePatternProperty, KeyValueProperty, LabeledStatement, Literal, MatchPattern, MemberExpression, MetaProperty, MethodKind, MethodProperty, Module, ModuleConfig, ModuleDeclaration, ModuleExportName, ModuleItem, NamedExportSpecifier, NamedImportSpecifier, NewExpression, Node, NodeNextConfig, NullLiteral, NumericLiteral, ObjectExpression, ObjectPattern, ObjectPatternProperty, OptimizerConfig, OptionalChainingCall, OptionalChainingExpression, Options, Output, Param, ParenthesisExpression, ParseOptions, ParserConfig, Pattern, Plugin, PrivateMethod, PrivateName, PrivateProperty, Program, Property, PropertyName, ReactConfig, RegExpLiteral, RestElement, ReturnStatement, Script, SequenceExpression, SetterProperty, Span, SpreadElement, Statement, StaticBlock, StringLiteral, Super, SuperPropExpression, Swcrc, SwitchCase, SwitchStatement, SystemjsConfig, TaggedTemplateExpression, TemplateElement, TemplateLiteral, TerserCompressOptions, TerserEcmaVersion, TerserMangleOptions, TerserManglePropertiesOptions, ThisExpression, ThrowStatement, TransformConfig, TruePlusMinus, TryStatement, TsArrayType, TsAsExpression, TsCallSignatureDeclaration, TsConditionalType, TsConstAssertion, TsConstructSignatureDeclaration, TsConstructorType, TsEntityName, TsEnumDeclaration, TsEnumMember, TsEnumMemberId, TsExportAssignment, TsExpressionWithTypeArguments, TsExternalModuleReference, TsFnOrConstructorType, TsFnParameter, TsFunctionType, TsGetterSignature, TsImportEqualsDeclaration, TsImportType, TsIndexSignature, TsIndexedAccessType, TsInferType, TsInstantiation, TsInterfaceBody, TsInterfaceDeclaration, TsIntersectionType, TsKeywordType, TsKeywordTypeKind, TsLiteral, TsLiteralType, TsMappedType, TsMethodSignature, TsModuleBlock, TsModuleDeclaration, TsModuleName, TsModuleReference, TsNamespaceBody, TsNamespaceDeclaration, TsNamespaceExportDeclaration, TsNonNullExpression, TsOptionalType, TsParameterProperty, TsParameterPropertyParameter, TsParenthesizedType, TsParserConfig, TsPropertySignature, TsQualifiedName, TsRestType, TsSatisfiesExpression, TsSetterSignature, TsTemplateLiteralType, TsThisType, TsThisTypeOrIdent, TsTupleElement, TsTupleType, TsType, TsTypeAliasDeclaration, TsTypeAnnotation, TsTypeAssertion, TsTypeElement, TsTypeLiteral, TsTypeOperator, TsTypeOperatorOp, TsTypeParameter, TsTypeParameterDeclaration, TsTypeParameterInstantiation, TsTypePredicate, TsTypeQuery, TsTypeQueryExpr, TsTypeReference, TsUnionOrIntersectionType, TsUnionType, UmdConfig, UnaryExpression, UnaryOperator, UpdateExpression, UpdateOperator, VariableDeclaration, VariableDeclarationKind, VariableDeclarator, WhileStatement, WithStatement, YieldExpression };
2109
+ export type { Accessibility, AmdConfig, Argument, ArrayExpression, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentOperator, AssignmentPattern, AssignmentPatternProperty, AssignmentProperty, AwaitExpression, BaseModuleConfig, BigIntLiteral, BinaryExpression, BinaryOperator, BindingIdentifier, BlockStatement, BooleanLiteral, BreakStatement, CallExpression, CallerOptions, CatchClause, Class, ClassDeclaration, ClassExpression, ClassMember, ClassMethod, ClassMethodBase, ClassProperty, ClassPropertyBase, CommonJsConfig, ComputedPropName, ConditionalExpression, Config, ConstModulesConfig, Constructor, ContinueStatement, DebuggerStatement, Declaration, Decorator, DefaultDecl, DoWhileStatement, EmptyStatement, EnvConfig, Es6Config, EsParserConfig, ExportAllDeclaration, ExportDeclaration, ExportDefaultDeclaration, ExportDefaultExpression, ExportDefaultSpecifier, ExportNamedDeclaration, ExportNamespaceSpecifier, ExportSpecifier, ExprOrSpread, Expression, ExpressionStatement, Fn, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, GetterProperty, GlobalPassOption, HasDecorator, HasSpan, Identifier, IfStatement, Import, ImportDeclaration, ImportDefaultSpecifier, ImportNamespaceSpecifier, ImportSpecifier, Invalid, JSXAttrValue, JSXAttribute, JSXAttributeName, JSXAttributeOrSpread, JSXClosingElement, JSXClosingFragment, JSXElement, JSXElementChild, JSXElementName, JSXEmptyExpression, JSXExpression, JSXExpressionContainer, JSXFragment, JSXMemberExpression, JSXNamespacedName, JSXObject, JSXOpeningElement, JSXOpeningFragment, JSXSpreadChild, JSXText, JsFormatOptions, JsMinifyOptions, JscConfig, JscTarget, KeyValuePatternProperty, KeyValueProperty, LabeledStatement, Literal, MatchPattern, MemberExpression, MetaProperty, MethodKind, MethodProperty, Module, ModuleConfig, ModuleDeclaration, ModuleExportName, ModuleItem, NamedExportSpecifier, NamedImportSpecifier, NewExpression, Node, NodeNextConfig, NullLiteral, NumericLiteral, ObjectExpression, ObjectPattern, ObjectPatternProperty, OptimizerConfig, OptionalChainingCall, OptionalChainingExpression, Options, Output, Param, ParenthesisExpression, ParseOptions, ParserConfig, Pattern, Plugin, PrivateMethod, PrivateName, PrivateProperty, Program, Property, PropertyName, ReactConfig, RegExpLiteral, RestElement, ReturnStatement, Script, SequenceExpression, SetterProperty, Span, SpreadElement, Statement, StaticBlock, StringLiteral, Super, SuperPropExpression, Swcrc, SwitchCase, SwitchStatement, SystemjsConfig, TaggedTemplateExpression, TemplateElement, TemplateLiteral, TerserCompressOptions, TerserEcmaVersion, TerserMangleOptions, TerserManglePropertiesOptions, ThisExpression, ThrowStatement, TransformConfig, TruePlusMinus, TryStatement, TsArrayType, TsAsExpression, TsCallSignatureDeclaration, TsConditionalType, TsConstAssertion, TsConstructSignatureDeclaration, TsConstructorType, TsEntityName, TsEnumDeclaration, TsEnumMember, TsEnumMemberId, TsExportAssignment, TsExpressionWithTypeArguments, TsExternalModuleReference, TsFnOrConstructorType, TsFnParameter, TsFunctionType, TsGetterSignature, TsImportEqualsDeclaration, TsImportType, TsIndexSignature, TsIndexedAccessType, TsInferType, TsInstantiation, TsInterfaceBody, TsInterfaceDeclaration, TsIntersectionType, TsKeywordType, TsKeywordTypeKind, TsLiteral, TsLiteralType, TsMappedType, TsMethodSignature, TsModuleBlock, TsModuleDeclaration, TsModuleName, TsModuleReference, TsNamespaceBody, TsNamespaceDeclaration, TsNamespaceExportDeclaration, TsNonNullExpression, TsOptionalType, TsParameterProperty, TsParameterPropertyParameter, TsParenthesizedType, TsParserConfig, TsPropertySignature, TsQualifiedName, TsRestType, TsSatisfiesExpression, TsSetterSignature, TsTemplateLiteralType, TsThisType, TsThisTypeOrIdent, TsTupleElement, TsTupleType, TsType, TsTypeAliasDeclaration, TsTypeAnnotation, TsTypeAssertion, TsTypeElement, TsTypeLiteral, TsTypeOperator, TsTypeOperatorOp, TsTypeParameter, TsTypeParameterDeclaration, TsTypeParameterInstantiation, TsTypePredicate, TsTypeQuery, TsTypeQueryExpr, TsTypeReference, TsUnionOrIntersectionType, TsUnionType, UmdConfig, UnaryExpression, UnaryOperator, UpdateExpression, UpdateOperator, VariableDeclaration, VariableDeclarationKind, VariableDeclarator, WasmAnalysisOptions, WasmPlugin, WhileStatement, WithStatement, YieldExpression };
@@ -1 +1 @@
1
- {"name":"@swc/types","author":"강동윤 <kdy1997.dev@gmail.com>","version":"0.1.20","license":"Apache-2.0","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"@swc/types","author":"강동윤 <kdy1997.dev@gmail.com>","version":"0.1.21","license":"Apache-2.0","types":"index.d.ts","type":"commonjs"}
@@ -928,7 +928,7 @@ declare interface ResolveOptionsResolverFactoryObject_2 {
928
928
  */
929
929
  preferAbsolute?: boolean;
930
930
  }
931
- export type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
931
+ type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
932
932
  declare abstract class Resolver {
933
933
  fileSystem: FileSystem;
934
934
  options: ResolveOptionsResolverFactoryObject_1;
@@ -25,7 +25,7 @@ declare namespace util {
25
25
  export {};
26
26
  }
27
27
  declare namespace objectUtil {
28
- export type MergeShapes<U, V> = {
28
+ export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : {
29
29
  [k in Exclude<keyof U, keyof V>]: U[k];
30
30
  } & V;
31
31
  type optionalKeys<T extends object> = {
@@ -52,7 +52,7 @@ declare namespace objectUtil {
52
52
  [k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
53
53
  }>;
54
54
  export const mergeShapes: <U, T>(first: U, second: T) => T & U;
55
- export type extendShape<A extends object, B extends object> = {
55
+ export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : {
56
56
  [K in keyof A as K extends keyof B ? never : K]: A[K];
57
57
  } & {
58
58
  [K in keyof B]: B[K];
@@ -2,13 +2,13 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ 106:
5
+ /***/ 705:
6
6
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10
10
  exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
11
- const util_1 = __nccwpck_require__(241);
11
+ const util_1 = __nccwpck_require__(46);
12
12
  exports.ZodIssueCode = util_1.util.arrayToEnum([
13
13
  "invalid_type",
14
14
  "invalid_literal",
@@ -146,7 +146,7 @@ ZodError.create = (issues) => {
146
146
 
147
147
  /***/ }),
148
148
 
149
- /***/ 508:
149
+ /***/ 503:
150
150
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
151
151
 
152
152
 
@@ -155,7 +155,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
155
155
  };
156
156
  Object.defineProperty(exports, "__esModule", ({ value: true }));
157
157
  exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0;
158
- const en_1 = __importDefault(__nccwpck_require__(316));
158
+ const en_1 = __importDefault(__nccwpck_require__(183));
159
159
  exports.defaultErrorMap = en_1.default;
160
160
  let overrideErrorMap = en_1.default;
161
161
  function setErrorMap(map) {
@@ -170,7 +170,7 @@ exports.getErrorMap = getErrorMap;
170
170
 
171
171
  /***/ }),
172
172
 
173
- /***/ 892:
173
+ /***/ 831:
174
174
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
175
175
 
176
176
 
@@ -189,17 +189,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
189
189
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
190
190
  };
191
191
  Object.defineProperty(exports, "__esModule", ({ value: true }));
192
- __exportStar(__nccwpck_require__(508), exports);
193
- __exportStar(__nccwpck_require__(906), exports);
194
- __exportStar(__nccwpck_require__(689), exports);
195
- __exportStar(__nccwpck_require__(241), exports);
196
- __exportStar(__nccwpck_require__(842), exports);
197
- __exportStar(__nccwpck_require__(106), exports);
192
+ __exportStar(__nccwpck_require__(503), exports);
193
+ __exportStar(__nccwpck_require__(707), exports);
194
+ __exportStar(__nccwpck_require__(160), exports);
195
+ __exportStar(__nccwpck_require__(46), exports);
196
+ __exportStar(__nccwpck_require__(735), exports);
197
+ __exportStar(__nccwpck_require__(705), exports);
198
198
 
199
199
 
200
200
  /***/ }),
201
201
 
202
- /***/ 927:
202
+ /***/ 266:
203
203
  /***/ ((__unused_webpack_module, exports) => {
204
204
 
205
205
 
@@ -214,7 +214,7 @@ var errorUtil;
214
214
 
215
215
  /***/ }),
216
216
 
217
- /***/ 906:
217
+ /***/ 707:
218
218
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
219
219
 
220
220
 
@@ -223,8 +223,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
223
223
  };
224
224
  Object.defineProperty(exports, "__esModule", ({ value: true }));
225
225
  exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0;
226
- const errors_1 = __nccwpck_require__(508);
227
- const en_1 = __importDefault(__nccwpck_require__(316));
226
+ const errors_1 = __nccwpck_require__(503);
227
+ const en_1 = __importDefault(__nccwpck_require__(183));
228
228
  const makeIssue = (params) => {
229
229
  const { data, path, errorMaps, issueData } = params;
230
230
  const fullPath = [...path, ...(issueData.path || [])];
@@ -346,7 +346,7 @@ exports.isAsync = isAsync;
346
346
 
347
347
  /***/ }),
348
348
 
349
- /***/ 689:
349
+ /***/ 160:
350
350
  /***/ ((__unused_webpack_module, exports) => {
351
351
 
352
352
 
@@ -355,7 +355,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
355
355
 
356
356
  /***/ }),
357
357
 
358
- /***/ 241:
358
+ /***/ 46:
359
359
  /***/ ((__unused_webpack_module, exports) => {
360
360
 
361
361
 
@@ -504,7 +504,7 @@ exports.getParsedType = getParsedType;
504
504
 
505
505
  /***/ }),
506
506
 
507
- /***/ 771:
507
+ /***/ 834:
508
508
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
509
509
 
510
510
 
@@ -536,21 +536,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
536
536
  };
537
537
  Object.defineProperty(exports, "__esModule", ({ value: true }));
538
538
  exports.z = void 0;
539
- const z = __importStar(__nccwpck_require__(892));
539
+ const z = __importStar(__nccwpck_require__(831));
540
540
  exports.z = z;
541
- __exportStar(__nccwpck_require__(892), exports);
541
+ __exportStar(__nccwpck_require__(831), exports);
542
542
  exports["default"] = z;
543
543
 
544
544
 
545
545
  /***/ }),
546
546
 
547
- /***/ 316:
547
+ /***/ 183:
548
548
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
549
549
 
550
550
 
551
551
  Object.defineProperty(exports, "__esModule", ({ value: true }));
552
- const util_1 = __nccwpck_require__(241);
553
- const ZodError_1 = __nccwpck_require__(106);
552
+ const util_1 = __nccwpck_require__(46);
553
+ const ZodError_1 = __nccwpck_require__(705);
554
554
  const errorMap = (issue, _ctx) => {
555
555
  let message;
556
556
  switch (issue.code) {
@@ -680,7 +680,7 @@ exports["default"] = errorMap;
680
680
 
681
681
  /***/ }),
682
682
 
683
- /***/ 842:
683
+ /***/ 735:
684
684
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
685
685
 
686
686
 
@@ -699,11 +699,11 @@ var _ZodEnum_cache, _ZodNativeEnum_cache;
699
699
  Object.defineProperty(exports, "__esModule", ({ value: true }));
700
700
  exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.datetimeRegex = exports.ZodType = void 0;
701
701
  exports.NEVER = exports["void"] = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports["null"] = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports["instanceof"] = exports["function"] = exports["enum"] = exports.effect = exports.discriminatedUnion = exports.date = void 0;
702
- const errors_1 = __nccwpck_require__(508);
703
- const errorUtil_1 = __nccwpck_require__(927);
704
- const parseUtil_1 = __nccwpck_require__(906);
705
- const util_1 = __nccwpck_require__(241);
706
- const ZodError_1 = __nccwpck_require__(106);
702
+ const errors_1 = __nccwpck_require__(503);
703
+ const errorUtil_1 = __nccwpck_require__(266);
704
+ const parseUtil_1 = __nccwpck_require__(707);
705
+ const util_1 = __nccwpck_require__(46);
706
+ const ZodError_1 = __nccwpck_require__(705);
707
707
  class ParseInputLazyPath {
708
708
  constructor(parent, value, path, key) {
709
709
  this._cachedPath = [];
@@ -4575,7 +4575,7 @@ exports.NEVER = parseUtil_1.INVALID;
4575
4575
  /******/ // startup
4576
4576
  /******/ // Load entry module and return exports
4577
4577
  /******/ // This entry module is referenced by other modules so it can't be inlined
4578
- /******/ var __webpack_exports__ = __nccwpck_require__(771);
4578
+ /******/ var __webpack_exports__ = __nccwpck_require__(834);
4579
4579
  /******/ module.exports = __webpack_exports__;
4580
4580
  /******/
4581
4581
  /******/ })()
@@ -1 +1 @@
1
- {"name":"zod","author":"Colin McDonnell <colin@colinhacks.com>","version":"3.24.2","funding":"https://github.com/sponsors/colinhacks","license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"zod","author":"Colin McDonnell <colin@colinhacks.com>","version":"3.24.3","funding":"https://github.com/sponsors/colinhacks","license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -9,6 +9,7 @@ export declare class ChunkGraph {
9
9
  constructor(binding: JsChunkGraph);
10
10
  getChunkModules(chunk: Chunk): ReadonlyArray<Module>;
11
11
  getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
12
+ getOrderedChunkModulesIterable(chunk: Chunk, compareFn: (a: Module, b: Module) => number): Iterable<Module>;
12
13
  getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
13
14
  getNumberOfEntryModules(chunk: Chunk): number;
14
15
  getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
@@ -0,0 +1,13 @@
1
+ import { Chunks } from "@rspack/binding";
2
+ import { Chunk } from "./Chunk";
3
+ declare module "@rspack/binding" {
4
+ interface Chunks {
5
+ [Symbol.iterator](): SetIterator<Chunk>;
6
+ entries(): SetIterator<[Chunk, Chunk]>;
7
+ values(): SetIterator<Chunk>;
8
+ keys(): SetIterator<Chunk>;
9
+ forEach(callbackfn: (value: Chunk, value2: Chunk, set: ReadonlySet<Chunk>) => void, thisArg?: any): void;
10
+ has(value: Chunk): boolean;
11
+ }
12
+ }
13
+ export default Chunks;
@@ -34,6 +34,7 @@ import { StatsFactory } from "./stats/StatsFactory";
34
34
  import { StatsPrinter } from "./stats/StatsPrinter";
35
35
  import type { InputFileSystem } from "./util/fs";
36
36
  import type Hash from "./util/hash";
37
+ import "./Chunks";
37
38
  export type Assets = Record<string, Source>;
38
39
  export interface Asset {
39
40
  name: string;
@@ -354,12 +355,6 @@ export declare class Compilation {
354
355
  * @internal
355
356
  */
356
357
  __internal__hasAsset(name: string): boolean;
357
- /**
358
- * Note: This is not a webpack public API, maybe removed in future.
359
- *
360
- * @internal
361
- */
362
- __internal__getChunks(): Chunk[];
363
358
  /**
364
359
  * Note: This is not a webpack public API, maybe removed in future.
365
360
  *
package/dist/Module.d.ts CHANGED
@@ -45,6 +45,7 @@ export type ContextModuleFactoryAfterResolveResult = false | ContextModuleFactor
45
45
  declare module "@rspack/binding" {
46
46
  interface Module {
47
47
  identifier(): string;
48
+ readableIdentifier(): string;
48
49
  originalSource(): Source | null;
49
50
  emitFile(filename: string, source: Source, assetInfo?: AssetInfo): void;
50
51
  }
@@ -1,3 +1,4 @@
1
+ import z from "../../../compiled/zod";
1
2
  type RawStyleConfig = {
2
3
  styleLibraryDirectory?: string;
3
4
  custom?: string;
@@ -28,6 +29,40 @@ type PluginImportConfig = {
28
29
  ignoreStyleComponent?: string[];
29
30
  };
30
31
  type PluginImportOptions = PluginImportConfig[] | undefined;
32
+ export declare const ZodSwcPluginImportConfig: z.ZodOptional<z.ZodArray<z.ZodObject<{
33
+ libraryName: z.ZodString;
34
+ libraryDirectory: z.ZodOptional<z.ZodString>;
35
+ customName: z.ZodOptional<z.ZodString>;
36
+ customStyleName: z.ZodOptional<z.ZodString>;
37
+ style: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
38
+ styleLibraryDirectory: z.ZodOptional<z.ZodString>;
39
+ camelToDashComponentName: z.ZodOptional<z.ZodBoolean>;
40
+ transformToDefaultImport: z.ZodOptional<z.ZodBoolean>;
41
+ ignoreEsComponent: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
42
+ ignoreStyleComponent: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
+ }, "strict", z.ZodTypeAny, {
44
+ libraryName: string;
45
+ libraryDirectory?: string | undefined;
46
+ customName?: string | undefined;
47
+ customStyleName?: string | undefined;
48
+ style?: string | boolean | undefined;
49
+ styleLibraryDirectory?: string | undefined;
50
+ camelToDashComponentName?: boolean | undefined;
51
+ transformToDefaultImport?: boolean | undefined;
52
+ ignoreEsComponent?: string[] | undefined;
53
+ ignoreStyleComponent?: string[] | undefined;
54
+ }, {
55
+ libraryName: string;
56
+ libraryDirectory?: string | undefined;
57
+ customName?: string | undefined;
58
+ customStyleName?: string | undefined;
59
+ style?: string | boolean | undefined;
60
+ styleLibraryDirectory?: string | undefined;
61
+ camelToDashComponentName?: boolean | undefined;
62
+ transformToDefaultImport?: boolean | undefined;
63
+ ignoreEsComponent?: string[] | undefined;
64
+ ignoreStyleComponent?: string[] | undefined;
65
+ }>, "many">>;
31
66
  declare function resolvePluginImport(pluginImport: PluginImportOptions): RawPluginImportConfig[] | undefined;
32
67
  export { resolvePluginImport };
33
68
  export type { PluginImportOptions };