@module-federation/sdk 2.0.1 → 2.1.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 (113) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +19 -0
  2. package/dist/_virtual/_rolldown/runtime.js +18 -0
  3. package/dist/constant.cjs +70 -0
  4. package/dist/constant.cjs.map +1 -0
  5. package/dist/constant.d.ts +53 -0
  6. package/dist/constant.js +55 -0
  7. package/dist/constant.js.map +1 -0
  8. package/dist/createModuleFederationConfig.cjs +9 -0
  9. package/dist/createModuleFederationConfig.cjs.map +1 -0
  10. package/dist/createModuleFederationConfig.d.ts +8 -0
  11. package/dist/createModuleFederationConfig.js +8 -0
  12. package/dist/createModuleFederationConfig.js.map +1 -0
  13. package/dist/dom.cjs +166 -0
  14. package/dist/dom.cjs.map +1 -0
  15. package/dist/dom.d.ts +35 -0
  16. package/dist/dom.js +162 -0
  17. package/dist/dom.js.map +1 -0
  18. package/dist/env.cjs +32 -0
  19. package/dist/env.cjs.map +1 -0
  20. package/dist/{src/env.d.ts → env.d.ts} +5 -2
  21. package/dist/env.js +29 -0
  22. package/dist/env.js.map +1 -0
  23. package/dist/generateSnapshotFromManifest.cjs +138 -0
  24. package/dist/generateSnapshotFromManifest.cjs.map +1 -0
  25. package/dist/generateSnapshotFromManifest.d.ts +22 -0
  26. package/dist/generateSnapshotFromManifest.js +134 -0
  27. package/dist/generateSnapshotFromManifest.js.map +1 -0
  28. package/dist/index.cjs +89 -0
  29. package/dist/index.d.ts +20 -1
  30. package/dist/index.js +15 -0
  31. package/dist/logger.cjs +129 -0
  32. package/dist/logger.cjs.map +1 -0
  33. package/dist/logger.d.ts +34 -0
  34. package/dist/logger.js +125 -0
  35. package/dist/logger.js.map +1 -0
  36. package/dist/node.cjs +122 -0
  37. package/dist/node.cjs.map +1 -0
  38. package/dist/node.d.ts +17 -0
  39. package/dist/node.js +120 -0
  40. package/dist/node.js.map +1 -0
  41. package/dist/normalize-webpack-path.cjs +28 -0
  42. package/dist/normalize-webpack-path.cjs.map +1 -0
  43. package/dist/normalize-webpack-path.d.ts +10 -1
  44. package/dist/normalize-webpack-path.js +26 -0
  45. package/dist/normalize-webpack-path.js.map +1 -0
  46. package/dist/normalizeOptions.cjs +19 -0
  47. package/dist/normalizeOptions.cjs.map +1 -0
  48. package/dist/normalizeOptions.d.ts +5 -0
  49. package/dist/normalizeOptions.js +18 -0
  50. package/dist/normalizeOptions.js.map +1 -0
  51. package/dist/types/common.d.ts +14 -0
  52. package/dist/types/hooks.d.ts +16 -0
  53. package/dist/types/index.d.ts +10 -0
  54. package/dist/types/manifest.d.ts +34 -0
  55. package/dist/types/plugins/ContainerPlugin.cjs +13 -0
  56. package/dist/types/plugins/ContainerPlugin.cjs.map +1 -0
  57. package/dist/types/plugins/ContainerPlugin.d.ts +40 -0
  58. package/dist/types/plugins/ContainerPlugin.js +8 -0
  59. package/dist/types/plugins/ContainerPlugin.js.map +1 -0
  60. package/dist/types/plugins/ContainerReferencePlugin.cjs +13 -0
  61. package/dist/types/plugins/ContainerReferencePlugin.cjs.map +1 -0
  62. package/dist/types/plugins/ContainerReferencePlugin.d.ts +23 -0
  63. package/dist/types/plugins/ContainerReferencePlugin.js +8 -0
  64. package/dist/types/plugins/ContainerReferencePlugin.js.map +1 -0
  65. package/dist/types/plugins/ModuleFederationPlugin.cjs +13 -0
  66. package/dist/types/plugins/ModuleFederationPlugin.cjs.map +1 -0
  67. package/dist/types/plugins/ModuleFederationPlugin.d.ts +432 -0
  68. package/dist/types/plugins/ModuleFederationPlugin.js +8 -0
  69. package/dist/types/plugins/ModuleFederationPlugin.js.map +1 -0
  70. package/dist/types/plugins/SharePlugin.cjs +13 -0
  71. package/dist/types/plugins/SharePlugin.cjs.map +1 -0
  72. package/dist/types/plugins/SharePlugin.d.ts +29 -0
  73. package/dist/types/plugins/SharePlugin.js +8 -0
  74. package/dist/types/plugins/SharePlugin.js.map +1 -0
  75. package/dist/types/plugins/index.d.ts +4 -0
  76. package/dist/types/snapshot.d.ts +81 -0
  77. package/dist/types/stats.d.ts +101 -0
  78. package/dist/utils.cjs +127 -0
  79. package/dist/utils.cjs.map +1 -0
  80. package/dist/{src/utils.d.ts → utils.d.ts} +9 -3
  81. package/dist/utils.js +116 -0
  82. package/dist/utils.js.map +1 -0
  83. package/package.json +7 -7
  84. package/dist/index.cjs.cjs +0 -1032
  85. package/dist/index.cjs.cjs.map +0 -1
  86. package/dist/index.cjs.d.ts +0 -1
  87. package/dist/index.esm.js +0 -978
  88. package/dist/index.esm.js.map +0 -1
  89. package/dist/normalize-webpack-path.cjs.cjs +0 -42
  90. package/dist/normalize-webpack-path.cjs.cjs.map +0 -1
  91. package/dist/normalize-webpack-path.cjs.d.ts +0 -1
  92. package/dist/normalize-webpack-path.esm.js +0 -39
  93. package/dist/normalize-webpack-path.esm.js.map +0 -1
  94. package/dist/src/constant.d.ts +0 -49
  95. package/dist/src/createModuleFederationConfig.d.ts +0 -2
  96. package/dist/src/dom.d.ts +0 -29
  97. package/dist/src/generateSnapshotFromManifest.d.ts +0 -15
  98. package/dist/src/index.d.ts +0 -11
  99. package/dist/src/logger.d.ts +0 -32
  100. package/dist/src/node.d.ts +0 -11
  101. package/dist/src/normalize-webpack-path.d.ts +0 -5
  102. package/dist/src/normalizeOptions.d.ts +0 -1
  103. package/dist/src/types/common.d.ts +0 -10
  104. package/dist/src/types/hooks.d.ts +0 -12
  105. package/dist/src/types/index.d.ts +0 -6
  106. package/dist/src/types/manifest.d.ts +0 -29
  107. package/dist/src/types/plugins/ContainerPlugin.d.ts +0 -32
  108. package/dist/src/types/plugins/ContainerReferencePlugin.d.ts +0 -15
  109. package/dist/src/types/plugins/ModuleFederationPlugin.d.ts +0 -425
  110. package/dist/src/types/plugins/SharePlugin.d.ts +0 -21
  111. package/dist/src/types/plugins/index.d.ts +0 -4
  112. package/dist/src/types/snapshot.d.ts +0 -77
  113. package/dist/src/types/stats.d.ts +0 -97
@@ -0,0 +1,432 @@
1
+ import { Stats } from "../stats.js";
2
+ import webpack from "webpack";
3
+
4
+ //#region src/types/plugins/ModuleFederationPlugin.d.ts
5
+ declare namespace ModuleFederationPlugin_d_exports {
6
+ export { AdditionalDataOptions, AmdContainer, AsyncBoundaryOptions, AuxiliaryComment, DataPrefetch, DtsHostOptions, DtsRemoteOptions, EntryRuntime, Exposes, ExposesConfig, ExposesItem, ExposesItems, ExposesObject, ExternalsType, LibraryCustomUmdCommentObject, LibraryCustomUmdObject, LibraryExport, LibraryName, LibraryOptions, LibraryType, ModuleFederationPluginOptions, PluginDevOptions, PluginDtsOptions, PluginManifestOptions, RemoteTypeUrls, Remotes, RemotesConfig, RemotesItem, RemotesItems, RemotesObject, Shared, SharedConfig, SharedItem, SharedObject, SharedStrategy, TreeShakingConfig, UmdNamedDefine };
7
+ }
8
+ /**
9
+ * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
10
+ */
11
+ type Exposes = (ExposesItem | ExposesObject)[] | ExposesObject;
12
+ /**
13
+ * Module that should be exposed by this container.
14
+ */
15
+ type ExposesItem = string;
16
+ /**
17
+ * Modules that should be exposed by this container.
18
+ */
19
+ type ExposesItems = ExposesItem[];
20
+ /**
21
+ * Add a container for define/require functions in the AMD module.
22
+ */
23
+ type AmdContainer = string;
24
+ /**
25
+ * Add a comment in the UMD wrapper.
26
+ */
27
+ type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
28
+ /**
29
+ * Specify which export should be exposed as library.
30
+ */
31
+ type LibraryExport = string[] | string;
32
+ /**
33
+ * The name of the library (some types allow unnamed libraries too).
34
+ */
35
+ type LibraryName = string[] | string | LibraryCustomUmdObject;
36
+ /**
37
+ * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
38
+ */
39
+ type LibraryType = ('var' | 'module' | 'assign' | 'assign-properties' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system') | string;
40
+ /**
41
+ * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
42
+ */
43
+ type UmdNamedDefine = boolean;
44
+ /**
45
+ * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
46
+ */
47
+ type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'script' | 'module-import' | 'node-commonjs';
48
+ /**
49
+ * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
50
+ */
51
+ type Remotes = (RemotesItem | RemotesObject)[] | RemotesObject;
52
+ /**
53
+ * Container location from which modules should be resolved and loaded at runtime.
54
+ */
55
+ type RemotesItem = string;
56
+ /**
57
+ * Container locations from which modules should be resolved and loaded at runtime.
58
+ */
59
+ type RemotesItems = RemotesItem[];
60
+ /**
61
+ * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
62
+ */
63
+ type EntryRuntime = false | string;
64
+ /**
65
+ * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
66
+ */
67
+ type Shared = (SharedItem | SharedObject)[] | SharedObject;
68
+ /**
69
+ * A module that should be shared in the share scope.
70
+ */
71
+ type SharedItem = string;
72
+ /**
73
+ * Enable Data Prefetch
74
+ */
75
+ type DataPrefetch = boolean;
76
+ interface AdditionalDataOptions {
77
+ stats: Stats;
78
+ compiler: webpack.Compiler;
79
+ compilation: webpack.Compilation;
80
+ bundler: 'webpack' | 'rspack';
81
+ }
82
+ interface PluginManifestOptions {
83
+ filePath?: string;
84
+ disableAssetsAnalyze?: boolean;
85
+ fileName?: string;
86
+ additionalData?: (options: AdditionalDataOptions) => Promise<void | Stats> | Stats | void;
87
+ }
88
+ interface PluginDevOptions {
89
+ disableLiveReload?: boolean;
90
+ disableHotTypesReload?: boolean;
91
+ disableDynamicRemoteTypeHints?: boolean;
92
+ }
93
+ interface RemoteTypeUrl {
94
+ alias?: string;
95
+ api: string;
96
+ zip: string;
97
+ }
98
+ interface RemoteTypeUrls {
99
+ [remoteName: string]: RemoteTypeUrl;
100
+ }
101
+ interface DtsHostOptions {
102
+ typesFolder?: string;
103
+ abortOnError?: boolean;
104
+ remoteTypesFolder?: string;
105
+ deleteTypesFolder?: boolean;
106
+ maxRetries?: number;
107
+ consumeAPITypes?: boolean;
108
+ runtimePkgs?: string[];
109
+ remoteTypeUrls?: (() => Promise<RemoteTypeUrls>) | RemoteTypeUrls;
110
+ timeout?: number;
111
+ /** The family of IP, used for network requests */
112
+ family?: 4 | 6;
113
+ typesOnBuild?: boolean;
114
+ }
115
+ interface DtsRemoteOptions {
116
+ tsConfigPath?: string;
117
+ typesFolder?: string;
118
+ compiledTypesFolder?: string;
119
+ deleteTypesFolder?: boolean;
120
+ additionalFilesToCompile?: string[];
121
+ compileInChildProcess?: boolean;
122
+ compilerInstance?: 'tsc' | 'vue-tsc' | 'tspc' | string;
123
+ generateAPITypes?: boolean;
124
+ extractThirdParty?: boolean | {
125
+ exclude?: Array<string | RegExp>;
126
+ };
127
+ extractRemoteTypes?: boolean;
128
+ abortOnError?: boolean;
129
+ deleteTsConfig?: boolean;
130
+ }
131
+ interface PluginDtsOptions {
132
+ generateTypes?: boolean | DtsRemoteOptions;
133
+ consumeTypes?: boolean | DtsHostOptions;
134
+ tsConfigPath?: string;
135
+ extraOptions?: Record<string, any>;
136
+ implementation?: string;
137
+ cwd?: string;
138
+ displayErrorInTerminal?: boolean;
139
+ }
140
+ type AsyncBoundaryOptions = {
141
+ eager?: RegExp | ((module: any) => boolean);
142
+ excludeChunk?: (chunk: any) => boolean;
143
+ };
144
+ interface ModuleFederationPluginOptions {
145
+ /**
146
+ * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
147
+ */
148
+ exposes?: Exposes;
149
+ /**
150
+ * The filename of the container as relative path inside the `output.path` directory.
151
+ */
152
+ filename?: string;
153
+ /**
154
+ * Options for library.
155
+ */
156
+ library?: LibraryOptions;
157
+ /**
158
+ * The name of the container.
159
+ */
160
+ name?: string;
161
+ /**
162
+ * The external type of the remote containers.
163
+ */
164
+ remoteType?: ExternalsType;
165
+ /**
166
+ * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
167
+ */
168
+ remotes?: Remotes;
169
+ /**
170
+ * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
171
+ */
172
+ runtime?: EntryRuntime;
173
+ /**
174
+ * Share scope name used for all shared modules (defaults to 'default').
175
+ */
176
+ shareScope?: string | string[];
177
+ /**
178
+ * load shared strategy(defaults to 'version-first').
179
+ */
180
+ shareStrategy?: SharedStrategy;
181
+ /**
182
+ * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
183
+ */
184
+ shared?: Shared;
185
+ /**
186
+ * Runtime plugin file paths or package name. Supports tuple [path, params].
187
+ */
188
+ runtimePlugins?: (string | [string, Record<string, unknown>])[];
189
+ /**
190
+ * Custom public path function
191
+ */
192
+ getPublicPath?: string;
193
+ /**
194
+ * Bundler runtime path
195
+ */
196
+ implementation?: string;
197
+ manifest?: boolean | PluginManifestOptions;
198
+ dev?: boolean | PluginDevOptions;
199
+ dts?: boolean | PluginDtsOptions;
200
+ dataPrefetch?: DataPrefetch;
201
+ virtualRuntimeEntry?: boolean;
202
+ experiments?: {
203
+ externalRuntime?: boolean;
204
+ provideExternalRuntime?: boolean;
205
+ asyncStartup?: boolean;
206
+ /**
207
+ * Options related to build optimizations.
208
+ */
209
+ optimization?: {
210
+ /**
211
+ * Enable optimization to skip snapshot plugin
212
+ */
213
+ disableSnapshot?: boolean;
214
+ /**
215
+ * Target environment for the build
216
+ */
217
+ target?: 'web' | 'node';
218
+ };
219
+ };
220
+ bridge?: {
221
+ /**
222
+ * Enables bridge router functionality for React applications.
223
+ * When enabled, automatically handles routing context and basename injection
224
+ * for micro-frontend applications using react-router-dom.
225
+ *
226
+ * @default false
227
+ */
228
+ enableBridgeRouter?: boolean;
229
+ /**
230
+ * @deprecated Use `enableBridgeRouter: false` instead.
231
+ *
232
+ * Disables the default alias setting in the bridge.
233
+ * When true, users must manually handle basename through root component props.
234
+ *
235
+ * Migration:
236
+ * - `disableAlias: true` → `enableBridgeRouter: false`
237
+ * - `disableAlias: false` → `enableBridgeRouter: true`
238
+ *
239
+ * @default false
240
+ */
241
+ disableAlias?: boolean;
242
+ };
243
+ /**
244
+ * Configuration for async boundary plugin
245
+ */
246
+ async?: boolean | AsyncBoundaryOptions;
247
+ /**
248
+ * The directory to output the tree shaking shared fallback resources.
249
+ */
250
+ treeShakingDir?: string;
251
+ /**
252
+ * Whether to inject shared used exports into bundler runtime.
253
+ */
254
+ injectTreeShakingUsedExports?: boolean;
255
+ treeShakingSharedExcludePlugins?: string[];
256
+ treeShakingSharedPlugins?: string[];
257
+ }
258
+ /**
259
+ * Modules that should be exposed by this container. Property names are used as public paths.
260
+ */
261
+ interface ExposesObject {
262
+ /**
263
+ * Modules that should be exposed by this container.
264
+ */
265
+ [k: string]: ExposesConfig | ExposesItem | ExposesItems;
266
+ }
267
+ /**
268
+ * Advanced configuration for modules that should be exposed by this container.
269
+ */
270
+ interface ExposesConfig {
271
+ /**
272
+ * Request to a module that should be exposed by this container.
273
+ */
274
+ import: ExposesItem | ExposesItems;
275
+ /**
276
+ * Custom chunk name for the exposed module.
277
+ */
278
+ name?: string;
279
+ }
280
+ /**
281
+ * Options for library.
282
+ */
283
+ interface LibraryOptions {
284
+ /**
285
+ * Add a container for define/require functions in the AMD module.
286
+ */
287
+ amdContainer?: AmdContainer;
288
+ /**
289
+ * Add a comment in the UMD wrapper.
290
+ */
291
+ auxiliaryComment?: AuxiliaryComment;
292
+ /**
293
+ * Specify which export should be exposed as library.
294
+ */
295
+ export?: LibraryExport;
296
+ /**
297
+ * The name of the library (some types allow unnamed libraries too).
298
+ */
299
+ name?: LibraryName;
300
+ /**
301
+ * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
302
+ */
303
+ type: LibraryType;
304
+ /**
305
+ * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
306
+ */
307
+ umdNamedDefine?: UmdNamedDefine;
308
+ }
309
+ /**
310
+ * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
311
+ */
312
+ interface LibraryCustomUmdCommentObject {
313
+ /**
314
+ * Set comment for `amd` section in UMD.
315
+ */
316
+ amd?: string;
317
+ /**
318
+ * Set comment for `commonjs` (exports) section in UMD.
319
+ */
320
+ commonjs?: string;
321
+ /**
322
+ * Set comment for `commonjs2` (module.exports) section in UMD.
323
+ */
324
+ commonjs2?: string;
325
+ /**
326
+ * Set comment for `root` (global variable) section in UMD.
327
+ */
328
+ root?: string;
329
+ }
330
+ /**
331
+ * Description object for all UMD variants of the library name.
332
+ */
333
+ interface LibraryCustomUmdObject {
334
+ /**
335
+ * Name of the exposed AMD library in the UMD.
336
+ */
337
+ amd?: string;
338
+ /**
339
+ * Name of the exposed commonjs export in the UMD.
340
+ */
341
+ commonjs?: string;
342
+ /**
343
+ * Name of the property exposed globally by a UMD library.
344
+ */
345
+ root?: string[] | string;
346
+ }
347
+ /**
348
+ * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
349
+ */
350
+ interface RemotesObject {
351
+ /**
352
+ * Container locations from which modules should be resolved and loaded at runtime.
353
+ */
354
+ [k: string]: RemotesConfig | RemotesItem | RemotesItems;
355
+ }
356
+ /**
357
+ * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
358
+ */
359
+ interface RemotesConfig {
360
+ /**
361
+ * Container locations from which modules should be resolved and loaded at runtime.
362
+ */
363
+ external: RemotesItem | RemotesItems;
364
+ /**
365
+ * The name of the share scope shared with this remote.
366
+ */
367
+ shareScope?: string | string[];
368
+ }
369
+ /**
370
+ * Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
371
+ */
372
+ interface SharedObject {
373
+ /**
374
+ * Modules that should be shared in the share scope.
375
+ */
376
+ [k: string]: SharedConfig | SharedItem;
377
+ }
378
+ type SharedStrategy = 'version-first' | 'loaded-first';
379
+ type TreeShakingConfig = {
380
+ usedExports?: string[];
381
+ mode?: 'server-calc' | 'runtime-infer';
382
+ filename?: string;
383
+ };
384
+ /**
385
+ * Advanced configuration for modules that should be shared in the share scope.
386
+ */
387
+ interface SharedConfig {
388
+ /**
389
+ * Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.
390
+ */
391
+ eager?: boolean;
392
+ /**
393
+ * Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.
394
+ */
395
+ import?: false | SharedItem;
396
+ /**
397
+ * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
398
+ */
399
+ packageName?: string;
400
+ /**
401
+ * Version requirement from module in share scope.
402
+ */
403
+ requiredVersion?: false | string;
404
+ /**
405
+ * Module is looked up under this key from the share scope.
406
+ */
407
+ shareKey?: string;
408
+ /**
409
+ * Share scope name.
410
+ */
411
+ shareScope?: string | string[];
412
+ /**
413
+ * load shared strategy(defaults to 'version-first').
414
+ */
415
+ shareStrategy?: SharedStrategy;
416
+ /**
417
+ * Allow only a single version of the shared module in share scope (disabled by default).
418
+ */
419
+ singleton?: boolean;
420
+ /**
421
+ * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).
422
+ */
423
+ strictVersion?: boolean;
424
+ /**
425
+ * Version of the provided module. Will replace lower matching versions, but not higher.
426
+ */
427
+ version?: false | string;
428
+ treeShaking?: TreeShakingConfig;
429
+ }
430
+ //#endregion
431
+ export { DataPrefetch, EntryRuntime, Exposes, ExternalsType, LibraryOptions, ModuleFederationPluginOptions, ModuleFederationPlugin_d_exports, Remotes, Shared };
432
+ //# sourceMappingURL=ModuleFederationPlugin.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+
3
+ //#region src/types/plugins/ModuleFederationPlugin.ts
4
+ var ModuleFederationPlugin_exports = /* @__PURE__ */ __exportAll({});
5
+
6
+ //#endregion
7
+ export { ModuleFederationPlugin_exports };
8
+ //# sourceMappingURL=ModuleFederationPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleFederationPlugin.js","names":[],"sources":["../../../src/types/plugins/ModuleFederationPlugin.ts"],"sourcesContent":["import type webpack from 'webpack';\nimport { Stats } from '../stats';\n/**\n * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.\n */\nexport type Exposes = (ExposesItem | ExposesObject)[] | ExposesObject;\n/**\n * Module that should be exposed by this container.\n */\nexport type ExposesItem = string;\n/**\n * Modules that should be exposed by this container.\n */\nexport type ExposesItems = ExposesItem[];\n/**\n * Add a container for define/require functions in the AMD module.\n */\nexport type AmdContainer = string;\n/**\n * Add a comment in the UMD wrapper.\n */\nexport type AuxiliaryComment = string | LibraryCustomUmdCommentObject;\n/**\n * Specify which export should be exposed as library.\n */\nexport type LibraryExport = string[] | string;\n/**\n * The name of the library (some types allow unnamed libraries too).\n */\nexport type LibraryName = string[] | string | LibraryCustomUmdObject;\n/**\n * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).\n */\nexport type LibraryType =\n | (\n | 'var'\n | 'module'\n | 'assign'\n | 'assign-properties'\n | 'this'\n | 'window'\n | 'self'\n | 'global'\n | 'commonjs'\n | 'commonjs2'\n | 'commonjs-module'\n | 'commonjs-static'\n | 'amd'\n | 'amd-require'\n | 'umd'\n | 'umd2'\n | 'jsonp'\n | 'system'\n )\n | string;\n/**\n * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.\n */\nexport type UmdNamedDefine = boolean;\n/**\n * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).\n */\nexport type ExternalsType =\n | 'var'\n | 'module'\n | 'assign'\n | 'this'\n | 'window'\n | 'self'\n | 'global'\n | 'commonjs'\n | 'commonjs2'\n | 'commonjs-module'\n | 'commonjs-static'\n | 'amd'\n | 'amd-require'\n | 'umd'\n | 'umd2'\n | 'jsonp'\n | 'system'\n | 'promise'\n | 'import'\n | 'script'\n | 'module-import'\n | 'node-commonjs';\n/**\n * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.\n */\nexport type Remotes = (RemotesItem | RemotesObject)[] | RemotesObject;\n/**\n * Container location from which modules should be resolved and loaded at runtime.\n */\nexport type RemotesItem = string;\n/**\n * Container locations from which modules should be resolved and loaded at runtime.\n */\nexport type RemotesItems = RemotesItem[];\n/**\n * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.\n */\nexport type EntryRuntime = false | string;\n/**\n * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.\n */\nexport type Shared = (SharedItem | SharedObject)[] | SharedObject;\n/**\n * A module that should be shared in the share scope.\n */\nexport type SharedItem = string;\n/**\n * Enable Data Prefetch\n */\nexport type DataPrefetch = boolean;\n\nexport interface AdditionalDataOptions {\n stats: Stats;\n compiler: webpack.Compiler;\n compilation: webpack.Compilation;\n bundler: 'webpack' | 'rspack';\n}\nexport interface PluginManifestOptions {\n filePath?: string;\n disableAssetsAnalyze?: boolean;\n fileName?: string;\n additionalData?: (\n options: AdditionalDataOptions,\n ) => Promise<void | Stats> | Stats | void;\n}\n\nexport interface PluginDevOptions {\n disableLiveReload?: boolean;\n disableHotTypesReload?: boolean;\n disableDynamicRemoteTypeHints?: boolean;\n}\n\ninterface RemoteTypeUrl {\n alias?: string;\n api: string;\n zip: string;\n}\n\nexport interface RemoteTypeUrls {\n [remoteName: string]: RemoteTypeUrl;\n}\n\nexport interface DtsHostOptions {\n typesFolder?: string;\n abortOnError?: boolean;\n remoteTypesFolder?: string;\n deleteTypesFolder?: boolean;\n maxRetries?: number;\n consumeAPITypes?: boolean;\n runtimePkgs?: string[];\n remoteTypeUrls?: (() => Promise<RemoteTypeUrls>) | RemoteTypeUrls;\n timeout?: number;\n /** The family of IP, used for network requests */\n family?: 4 | 6;\n typesOnBuild?: boolean;\n}\n\nexport interface DtsRemoteOptions {\n tsConfigPath?: string;\n typesFolder?: string;\n compiledTypesFolder?: string;\n deleteTypesFolder?: boolean;\n additionalFilesToCompile?: string[];\n compileInChildProcess?: boolean;\n compilerInstance?: 'tsc' | 'vue-tsc' | 'tspc' | string;\n generateAPITypes?: boolean;\n extractThirdParty?:\n | boolean\n | {\n exclude?: Array<string | RegExp>;\n };\n extractRemoteTypes?: boolean;\n abortOnError?: boolean;\n deleteTsConfig?: boolean;\n}\n\nexport interface PluginDtsOptions {\n generateTypes?: boolean | DtsRemoteOptions;\n consumeTypes?: boolean | DtsHostOptions;\n tsConfigPath?: string;\n extraOptions?: Record<string, any>;\n implementation?: string;\n cwd?: string;\n displayErrorInTerminal?: boolean;\n}\n\nexport type AsyncBoundaryOptions = {\n eager?: RegExp | ((module: any) => boolean);\n excludeChunk?: (chunk: any) => boolean;\n};\n\nexport interface ModuleFederationPluginOptions {\n /**\n * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.\n */\n exposes?: Exposes;\n /**\n * The filename of the container as relative path inside the `output.path` directory.\n */\n filename?: string;\n /**\n * Options for library.\n */\n library?: LibraryOptions;\n /**\n * The name of the container.\n */\n name?: string;\n /**\n * The external type of the remote containers.\n */\n remoteType?: ExternalsType;\n /**\n * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.\n */\n remotes?: Remotes;\n /**\n * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.\n */\n runtime?: EntryRuntime;\n /**\n * Share scope name used for all shared modules (defaults to 'default').\n */\n shareScope?: string | string[];\n /**\n * load shared strategy(defaults to 'version-first').\n */\n shareStrategy?: SharedStrategy;\n /**\n * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.\n */\n shared?: Shared;\n /**\n * Runtime plugin file paths or package name. Supports tuple [path, params].\n */\n runtimePlugins?: (string | [string, Record<string, unknown>])[];\n /**\n * Custom public path function\n */\n getPublicPath?: string;\n /**\n * Bundler runtime path\n */\n implementation?: string;\n\n manifest?: boolean | PluginManifestOptions;\n dev?: boolean | PluginDevOptions;\n dts?: boolean | PluginDtsOptions;\n dataPrefetch?: DataPrefetch;\n virtualRuntimeEntry?: boolean;\n experiments?: {\n externalRuntime?: boolean;\n provideExternalRuntime?: boolean;\n asyncStartup?: boolean;\n /**\n * Options related to build optimizations.\n */\n optimization?: {\n /**\n * Enable optimization to skip snapshot plugin\n */\n disableSnapshot?: boolean;\n /**\n * Target environment for the build\n */\n target?: 'web' | 'node';\n };\n };\n bridge?: {\n /**\n * Enables bridge router functionality for React applications.\n * When enabled, automatically handles routing context and basename injection\n * for micro-frontend applications using react-router-dom.\n *\n * @default false\n */\n enableBridgeRouter?: boolean;\n /**\n * @deprecated Use `enableBridgeRouter: false` instead.\n *\n * Disables the default alias setting in the bridge.\n * When true, users must manually handle basename through root component props.\n *\n * Migration:\n * - `disableAlias: true` → `enableBridgeRouter: false`\n * - `disableAlias: false` → `enableBridgeRouter: true`\n *\n * @default false\n */\n disableAlias?: boolean;\n };\n /**\n * Configuration for async boundary plugin\n */\n async?: boolean | AsyncBoundaryOptions;\n\n /**\n * The directory to output the tree shaking shared fallback resources.\n */\n treeShakingDir?: string;\n\n /**\n * Whether to inject shared used exports into bundler runtime.\n */\n injectTreeShakingUsedExports?: boolean;\n treeShakingSharedExcludePlugins?: string[];\n treeShakingSharedPlugins?: string[];\n}\n/**\n * Modules that should be exposed by this container. Property names are used as public paths.\n */\nexport interface ExposesObject {\n /**\n * Modules that should be exposed by this container.\n */\n [k: string]: ExposesConfig | ExposesItem | ExposesItems;\n}\n/**\n * Advanced configuration for modules that should be exposed by this container.\n */\nexport interface ExposesConfig {\n /**\n * Request to a module that should be exposed by this container.\n */\n import: ExposesItem | ExposesItems;\n /**\n * Custom chunk name for the exposed module.\n */\n name?: string;\n}\n/**\n * Options for library.\n */\nexport interface LibraryOptions {\n /**\n * Add a container for define/require functions in the AMD module.\n */\n amdContainer?: AmdContainer;\n /**\n * Add a comment in the UMD wrapper.\n */\n auxiliaryComment?: AuxiliaryComment;\n /**\n * Specify which export should be exposed as library.\n */\n export?: LibraryExport;\n /**\n * The name of the library (some types allow unnamed libraries too).\n */\n name?: LibraryName;\n /**\n * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).\n */\n type: LibraryType;\n /**\n * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.\n */\n umdNamedDefine?: UmdNamedDefine;\n}\n/**\n * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.\n */\nexport interface LibraryCustomUmdCommentObject {\n /**\n * Set comment for `amd` section in UMD.\n */\n amd?: string;\n /**\n * Set comment for `commonjs` (exports) section in UMD.\n */\n commonjs?: string;\n /**\n * Set comment for `commonjs2` (module.exports) section in UMD.\n */\n commonjs2?: string;\n /**\n * Set comment for `root` (global variable) section in UMD.\n */\n root?: string;\n}\n/**\n * Description object for all UMD variants of the library name.\n */\nexport interface LibraryCustomUmdObject {\n /**\n * Name of the exposed AMD library in the UMD.\n */\n amd?: string;\n /**\n * Name of the exposed commonjs export in the UMD.\n */\n commonjs?: string;\n /**\n * Name of the property exposed globally by a UMD library.\n */\n root?: string[] | string;\n}\n/**\n * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.\n */\nexport interface RemotesObject {\n /**\n * Container locations from which modules should be resolved and loaded at runtime.\n */\n [k: string]: RemotesConfig | RemotesItem | RemotesItems;\n}\n/**\n * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.\n */\nexport interface RemotesConfig {\n /**\n * Container locations from which modules should be resolved and loaded at runtime.\n */\n external: RemotesItem | RemotesItems;\n /**\n * The name of the share scope shared with this remote.\n */\n shareScope?: string | string[];\n}\n/**\n * Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.\n */\nexport interface SharedObject {\n /**\n * Modules that should be shared in the share scope.\n */\n [k: string]: SharedConfig | SharedItem;\n}\n\nexport type SharedStrategy = 'version-first' | 'loaded-first';\n\nexport type TreeShakingConfig = {\n usedExports?: string[];\n mode?: 'server-calc' | 'runtime-infer';\n filename?: string;\n};\n\n/**\n * Advanced configuration for modules that should be shared in the share scope.\n */\nexport interface SharedConfig {\n /**\n * Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.\n */\n eager?: boolean;\n /**\n * Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.\n */\n import?: false | SharedItem;\n /**\n * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.\n */\n packageName?: string;\n /**\n * Version requirement from module in share scope.\n */\n requiredVersion?: false | string;\n /**\n * Module is looked up under this key from the share scope.\n */\n shareKey?: string;\n /**\n * Share scope name.\n */\n shareScope?: string | string[];\n /**\n * load shared strategy(defaults to 'version-first').\n */\n shareStrategy?: SharedStrategy;\n /**\n * Allow only a single version of the shared module in share scope (disabled by default).\n */\n singleton?: boolean;\n /**\n * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).\n */\n strictVersion?: boolean;\n /**\n * Version of the provided module. Will replace lower matching versions, but not higher.\n */\n version?: false | string;\n treeShaking?: TreeShakingConfig;\n}\n"],"mappings":""}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
+
3
+ //#region src/types/plugins/SharePlugin.ts
4
+ var SharePlugin_exports = /* @__PURE__ */ require_runtime.__exportAll({});
5
+
6
+ //#endregion
7
+ Object.defineProperty(exports, 'SharePlugin_exports', {
8
+ enumerable: true,
9
+ get: function () {
10
+ return SharePlugin_exports;
11
+ }
12
+ });
13
+ //# sourceMappingURL=SharePlugin.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharePlugin.cjs","names":[],"sources":["../../../src/types/plugins/SharePlugin.ts"],"sourcesContent":["import type { Shared } from './ModuleFederationPlugin';\n\n/**\n * Options for shared modules.\n */\nexport interface SharePluginOptions {\n /**\n * Share scope name used for all shared modules (defaults to 'default').\n */\n shareScope?: string | string[];\n /**\n * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.\n */\n shared: Shared;\n}\nexport declare class SharePlugin {\n constructor(options: SharePluginOptions);\n\n /**\n * Apply the plugin\n */\n apply(compiler: any): void;\n}\n"],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import { Shared } from "./ModuleFederationPlugin.js";
2
+
3
+ //#region src/types/plugins/SharePlugin.d.ts
4
+ declare namespace SharePlugin_d_exports {
5
+ export { SharePlugin, SharePluginOptions };
6
+ }
7
+ /**
8
+ * Options for shared modules.
9
+ */
10
+ interface SharePluginOptions {
11
+ /**
12
+ * Share scope name used for all shared modules (defaults to 'default').
13
+ */
14
+ shareScope?: string | string[];
15
+ /**
16
+ * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
17
+ */
18
+ shared: Shared;
19
+ }
20
+ declare class SharePlugin {
21
+ constructor(options: SharePluginOptions);
22
+ /**
23
+ * Apply the plugin
24
+ */
25
+ apply(compiler: any): void;
26
+ }
27
+ //#endregion
28
+ export { SharePlugin_d_exports };
29
+ //# sourceMappingURL=SharePlugin.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+
3
+ //#region src/types/plugins/SharePlugin.ts
4
+ var SharePlugin_exports = /* @__PURE__ */ __exportAll({});
5
+
6
+ //#endregion
7
+ export { SharePlugin_exports };
8
+ //# sourceMappingURL=SharePlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharePlugin.js","names":[],"sources":["../../../src/types/plugins/SharePlugin.ts"],"sourcesContent":["import type { Shared } from './ModuleFederationPlugin';\n\n/**\n * Options for shared modules.\n */\nexport interface SharePluginOptions {\n /**\n * Share scope name used for all shared modules (defaults to 'default').\n */\n shareScope?: string | string[];\n /**\n * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.\n */\n shared: Shared;\n}\nexport declare class SharePlugin {\n constructor(options: SharePluginOptions);\n\n /**\n * Apply the plugin\n */\n apply(compiler: any): void;\n}\n"],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { ModuleFederationPlugin_d_exports } from "./ModuleFederationPlugin.js";
2
+ import { ContainerPlugin_d_exports } from "./ContainerPlugin.js";
3
+ import { ContainerReferencePlugin_d_exports } from "./ContainerReferencePlugin.js";
4
+ import { SharePlugin_d_exports } from "./SharePlugin.js";
@@ -0,0 +1,81 @@
1
+ import { TreeShakingStatus } from "../constant.js";
2
+ import { RemoteEntryType, StatsAssets } from "./stats.js";
3
+
4
+ //#region src/types/snapshot.d.ts
5
+ interface BasicModuleInfo {
6
+ dev?: {
7
+ version?: string;
8
+ remotes?: {
9
+ [nameWithType: string]: string;
10
+ };
11
+ };
12
+ version: string;
13
+ buildVersion: string;
14
+ remoteTypes: string;
15
+ remoteTypesZip: string;
16
+ remoteTypesAPI?: string;
17
+ remotesInfo: Record<string, {
18
+ matchedVersion: string;
19
+ }>;
20
+ shared: Array<{
21
+ sharedName: string;
22
+ fallback?: string;
23
+ fallbackName?: string;
24
+ fallbackType?: RemoteEntryType;
25
+ version?: string;
26
+ assets: StatsAssets;
27
+ treeShakingStatus?: TreeShakingStatus;
28
+ secondarySharedTreeShakingEntry?: string;
29
+ secondarySharedTreeShakingName?: string;
30
+ }>;
31
+ }
32
+ interface BasicProviderModuleInfo extends BasicModuleInfo {
33
+ remoteEntry: string;
34
+ remoteEntryType: RemoteEntryType;
35
+ ssrRemoteEntry?: string;
36
+ ssrRemoteEntryType?: RemoteEntryType;
37
+ globalName: string;
38
+ modules: Array<{
39
+ moduleName: string;
40
+ modulePath?: string;
41
+ assets: StatsAssets;
42
+ }>;
43
+ prefetchInterface?: boolean;
44
+ prefetchEntry?: string;
45
+ prefetchEntryType?: RemoteEntryType;
46
+ }
47
+ interface BasicProviderModuleInfoWithPublicPath extends BasicProviderModuleInfo {
48
+ publicPath: string;
49
+ ssrPublicPath?: string;
50
+ }
51
+ interface BasicProviderModuleInfoWithGetPublicPath extends BasicProviderModuleInfo {
52
+ getPublicPath: string;
53
+ }
54
+ interface ManifestProvider {
55
+ remoteEntry: string;
56
+ ssrRemoteEntry?: string;
57
+ version?: string;
58
+ }
59
+ interface PureEntryProvider extends ManifestProvider {
60
+ globalName: string;
61
+ }
62
+ interface BasicConsumerModuleInfo extends BasicModuleInfo {
63
+ consumerList: Array<string>;
64
+ }
65
+ interface ConsumerModuleInfoWithPublicPath extends BasicConsumerModuleInfo, BasicProviderModuleInfo {
66
+ publicPath: string;
67
+ ssrPublicPath?: string;
68
+ }
69
+ interface ConsumerModuleInfoWithGetPublicPath extends BasicConsumerModuleInfo, BasicProviderModuleInfo {
70
+ getPublicPath: string;
71
+ }
72
+ type PureConsumerModuleInfo = Omit<BasicConsumerModuleInfo, 'remoteTypes'>;
73
+ type ConsumerModuleInfo = ConsumerModuleInfoWithPublicPath | ConsumerModuleInfoWithGetPublicPath;
74
+ type ProviderModuleInfo = BasicProviderModuleInfoWithPublicPath | BasicProviderModuleInfoWithGetPublicPath;
75
+ type ModuleInfo = ConsumerModuleInfo | PureConsumerModuleInfo | ProviderModuleInfo;
76
+ type GlobalModuleInfo = {
77
+ [key: string]: ModuleInfo | ManifestProvider | PureEntryProvider | undefined;
78
+ };
79
+ //#endregion
80
+ export { BasicProviderModuleInfo, ConsumerModuleInfo, ConsumerModuleInfoWithPublicPath, GlobalModuleInfo, ManifestProvider, ModuleInfo, ProviderModuleInfo, PureConsumerModuleInfo, PureEntryProvider };
81
+ //# sourceMappingURL=snapshot.d.ts.map