@module-federation/enhanced 0.1.5 → 0.1.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.
Files changed (194) hide show
  1. package/dist/package.json +67 -0
  2. package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +57 -0
  3. package/dist/src/declarations/plugins/container/Dependency.d.ts +285 -0
  4. package/dist/src/declarations/plugins/container/Module.d.ts +138 -0
  5. package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +33 -0
  6. package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +4 -0
  7. package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +28 -0
  8. package/dist/src/declarations/plugins/container/Template.d.ts +198 -0
  9. package/dist/src/declarations/plugins/container/WebpackError.d.ts +32 -0
  10. package/dist/src/declarations/plugins/container/WebpackOptions.d.ts +140 -0
  11. package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +74 -0
  12. package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +67 -0
  13. package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +78 -0
  14. package/dist/src/index.d.ts +14 -0
  15. package/dist/src/index.js +37 -0
  16. package/dist/src/index.js.map +1 -0
  17. package/dist/src/lib/Constants.d.ts +117 -0
  18. package/dist/src/lib/Constants.js +125 -0
  19. package/dist/src/lib/Constants.js.map +1 -0
  20. package/dist/src/lib/RuntimeGlobals.d.ts +0 -0
  21. package/dist/src/lib/RuntimeGlobals.js +316 -0
  22. package/dist/src/lib/RuntimeGlobals.js.map +1 -0
  23. package/dist/src/lib/container/AsyncBoundaryPlugin.d.ts +20 -0
  24. package/dist/src/lib/container/AsyncBoundaryPlugin.js +183 -0
  25. package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -0
  26. package/dist/src/lib/container/ContainerEntryDependency.d.ts +24 -0
  27. package/dist/src/lib/container/ContainerEntryDependency.js +39 -0
  28. package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -0
  29. package/dist/src/lib/container/ContainerEntryModule.d.ts +75 -0
  30. package/dist/src/lib/container/ContainerEntryModule.js +250 -0
  31. package/dist/src/lib/container/ContainerEntryModule.js.map +1 -0
  32. package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +15 -0
  33. package/dist/src/lib/container/ContainerEntryModuleFactory.js +30 -0
  34. package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -0
  35. package/dist/src/lib/container/ContainerExposedDependency.d.ts +19 -0
  36. package/dist/src/lib/container/ContainerExposedDependency.js +49 -0
  37. package/dist/src/lib/container/ContainerExposedDependency.js.map +1 -0
  38. package/dist/src/lib/container/ContainerPlugin.d.ts +13 -0
  39. package/dist/src/lib/container/ContainerPlugin.js +185 -0
  40. package/dist/src/lib/container/ContainerPlugin.js.map +1 -0
  41. package/dist/src/lib/container/ContainerReferencePlugin.d.ts +14 -0
  42. package/dist/src/lib/container/ContainerReferencePlugin.js +102 -0
  43. package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -0
  44. package/dist/src/lib/container/FallbackDependency.d.ts +15 -0
  45. package/dist/src/lib/container/FallbackDependency.js +47 -0
  46. package/dist/src/lib/container/FallbackDependency.js.map +1 -0
  47. package/dist/src/lib/container/FallbackItemDependency.d.ts +3 -0
  48. package/dist/src/lib/container/FallbackItemDependency.js +26 -0
  49. package/dist/src/lib/container/FallbackItemDependency.js.map +1 -0
  50. package/dist/src/lib/container/FallbackModule.d.ts +54 -0
  51. package/dist/src/lib/container/FallbackModule.js +152 -0
  52. package/dist/src/lib/container/FallbackModule.js.map +1 -0
  53. package/dist/src/lib/container/FallbackModuleFactory.d.ts +11 -0
  54. package/dist/src/lib/container/FallbackModuleFactory.js +28 -0
  55. package/dist/src/lib/container/FallbackModuleFactory.js.map +1 -0
  56. package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +14 -0
  57. package/dist/src/lib/container/HoistContainerReferencesPlugin.js +61 -0
  58. package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -0
  59. package/dist/src/lib/container/ModuleFederationPlugin.d.ts +16 -0
  60. package/dist/src/lib/container/ModuleFederationPlugin.js +122 -0
  61. package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -0
  62. package/dist/src/lib/container/RemoteModule.d.ts +90 -0
  63. package/dist/src/lib/container/RemoteModule.js +148 -0
  64. package/dist/src/lib/container/RemoteModule.js.map +1 -0
  65. package/dist/src/lib/container/RemoteRuntimeModule.d.ts +12 -0
  66. package/dist/src/lib/container/RemoteRuntimeModule.js +101 -0
  67. package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -0
  68. package/dist/src/lib/container/RemoteToExternalDependency.d.ts +4 -0
  69. package/dist/src/lib/container/RemoteToExternalDependency.js +26 -0
  70. package/dist/src/lib/container/RemoteToExternalDependency.js.map +1 -0
  71. package/dist/src/lib/container/constant.d.ts +3 -0
  72. package/dist/src/lib/container/constant.js +12 -0
  73. package/dist/src/lib/container/constant.js.map +1 -0
  74. package/dist/src/lib/container/options.d.ts +26 -0
  75. package/dist/src/lib/container/options.js +81 -0
  76. package/dist/src/lib/container/options.js.map +1 -0
  77. package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +13 -0
  78. package/dist/src/lib/container/runtime/FederationRuntimeModule.js +27 -0
  79. package/dist/src/lib/container/runtime/FederationRuntimeModule.js.map +1 -0
  80. package/dist/src/lib/container/runtime/FederationRuntimePlugin.d.ts +17 -0
  81. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +207 -0
  82. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -0
  83. package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +5 -0
  84. package/dist/src/lib/container/runtime/getFederationGlobal.js +24 -0
  85. package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -0
  86. package/dist/src/lib/container/runtime/utils.d.ts +16 -0
  87. package/dist/src/lib/container/runtime/utils.js +83 -0
  88. package/dist/src/lib/container/runtime/utils.js.map +1 -0
  89. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +3 -0
  90. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +26 -0
  91. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -0
  92. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +99 -0
  93. package/dist/src/lib/sharing/ConsumeSharedModule.js +206 -0
  94. package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -0
  95. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +30 -0
  96. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +245 -0
  97. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -0
  98. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +31 -0
  99. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +124 -0
  100. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -0
  101. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +3 -0
  102. package/dist/src/lib/sharing/ProvideForSharedDependency.js +27 -0
  103. package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -0
  104. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +36 -0
  105. package/dist/src/lib/sharing/ProvideSharedDependency.js +70 -0
  106. package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -0
  107. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +67 -0
  108. package/dist/src/lib/sharing/ProvideSharedModule.js +186 -0
  109. package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -0
  110. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +18 -0
  111. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +30 -0
  112. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -0
  113. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +47 -0
  114. package/dist/src/lib/sharing/ProvideSharedPlugin.js +195 -0
  115. package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -0
  116. package/dist/src/lib/sharing/SharePlugin.d.ts +41 -0
  117. package/dist/src/lib/sharing/SharePlugin.js +79 -0
  118. package/dist/src/lib/sharing/SharePlugin.js.map +1 -0
  119. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +14 -0
  120. package/dist/src/lib/sharing/ShareRuntimeModule.js +102 -0
  121. package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -0
  122. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +12 -0
  123. package/dist/src/lib/sharing/resolveMatchedConfigs.js +66 -0
  124. package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -0
  125. package/dist/src/lib/sharing/utils.d.ts +37 -0
  126. package/dist/src/lib/sharing/utils.js +359 -0
  127. package/dist/src/lib/sharing/utils.js.map +1 -0
  128. package/dist/src/rspack.d.ts +1 -0
  129. package/dist/src/rspack.js +6 -0
  130. package/dist/src/rspack.js.map +1 -0
  131. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +5 -0
  132. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -0
  133. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -0
  134. package/dist/src/runtime.d.ts +1 -0
  135. package/dist/src/runtime.js +18 -0
  136. package/dist/src/runtime.js.map +1 -0
  137. package/dist/src/schemas/container/ContainerPlugin.check.d.ts +7 -0
  138. package/dist/src/schemas/container/ContainerPlugin.check.js +2318 -0
  139. package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -0
  140. package/dist/src/schemas/container/ContainerPlugin.d.ts +289 -0
  141. package/dist/src/schemas/container/ContainerPlugin.js +326 -0
  142. package/dist/src/schemas/container/ContainerPlugin.js.map +1 -0
  143. package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +7 -0
  144. package/dist/src/schemas/container/ContainerReferencePlugin.check.js +939 -0
  145. package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -0
  146. package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +87 -0
  147. package/dist/src/schemas/container/ContainerReferencePlugin.js +132 -0
  148. package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -0
  149. package/dist/src/schemas/container/ModuleFederationPlugin.check.d.ts +9 -0
  150. package/dist/src/schemas/container/ModuleFederationPlugin.check.js +4001 -0
  151. package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -0
  152. package/dist/src/schemas/container/ModuleFederationPlugin.d.ts +626 -0
  153. package/dist/src/schemas/container/ModuleFederationPlugin.js +720 -0
  154. package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -0
  155. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts +7 -0
  156. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +434 -0
  157. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -0
  158. package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +104 -0
  159. package/dist/src/schemas/sharing/ProviderSharedPlugin.js +119 -0
  160. package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -0
  161. package/dist/src/types/runtime.d.ts +7 -0
  162. package/dist/src/types/runtime.js +3 -0
  163. package/dist/src/types/runtime.js.map +1 -0
  164. package/dist/src/webpack.d.ts +1 -0
  165. package/dist/src/webpack.js +9 -0
  166. package/dist/src/webpack.js.map +1 -0
  167. package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +8 -0
  168. package/dist/src/wrapper/AsyncBoundaryPlugin.js +19 -0
  169. package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -0
  170. package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +8 -0
  171. package/dist/src/wrapper/ConsumeSharedPlugin.js +19 -0
  172. package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -0
  173. package/dist/src/wrapper/ContainerPlugin.d.ts +8 -0
  174. package/dist/src/wrapper/ContainerPlugin.js +19 -0
  175. package/dist/src/wrapper/ContainerPlugin.js.map +1 -0
  176. package/dist/src/wrapper/ContainerReferencePlugin.d.ts +8 -0
  177. package/dist/src/wrapper/ContainerReferencePlugin.js +19 -0
  178. package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -0
  179. package/dist/src/wrapper/FederationRuntimePlugin.d.ts +9 -0
  180. package/dist/src/wrapper/FederationRuntimePlugin.js +22 -0
  181. package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -0
  182. package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +6 -0
  183. package/dist/src/wrapper/HoistContainerReferencesPlugin.js +18 -0
  184. package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -0
  185. package/dist/src/wrapper/ModuleFederationPlugin.d.ts +8 -0
  186. package/dist/src/wrapper/ModuleFederationPlugin.js +24 -0
  187. package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -0
  188. package/dist/src/wrapper/ProvideSharedPlugin.d.ts +8 -0
  189. package/dist/src/wrapper/ProvideSharedPlugin.js +19 -0
  190. package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -0
  191. package/dist/src/wrapper/SharePlugin.d.ts +8 -0
  192. package/dist/src/wrapper/SharePlugin.js +19 -0
  193. package/dist/src/wrapper/SharePlugin.js.map +1 -0
  194. package/package.json +8 -8
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@module-federation/enhanced",
3
+ "version": "0.1.6",
4
+ "main": "./src/index.js",
5
+ "types": "./dist/src/index.d.ts",
6
+ "files": [
7
+ "dist/",
8
+ "README.md"
9
+ ],
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "peerDependencies": {
14
+ "webpack": "^5.0.0"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/src/index.d.ts",
19
+ "require": "./dist/src/index.js",
20
+ "import": "./dist/src/index.js"
21
+ },
22
+ "./webpack": {
23
+ "types": "./dist/src/webpack.d.ts",
24
+ "require": "./dist/src/webpack.js",
25
+ "import": "./dist/src/webpack.js"
26
+ },
27
+ "./rspack": {
28
+ "types": "./dist/src/rspack.d.ts",
29
+ "require": "./dist/src/rspack.js",
30
+ "import": "./dist/src/rspack.js"
31
+ },
32
+ "./runtime": {
33
+ "types": "./dist/src/runtime.d.ts",
34
+ "require": "./dist/src/runtime.js",
35
+ "import": "./dist/src/runtime.js"
36
+ }
37
+ },
38
+ "typesVersions": {
39
+ "*": {
40
+ ".": [
41
+ "./dist/src/index.d.ts"
42
+ ],
43
+ "webpack": [
44
+ "./dist/src/webpack.d.ts"
45
+ ],
46
+ "rspack": [
47
+ "./dist/src/rspack.d.ts"
48
+ ],
49
+ "runtime": [
50
+ "./dist/src/runtime.d.ts"
51
+ ]
52
+ }
53
+ },
54
+ "devDependencies": {
55
+ "@module-federation/webpack-bundler-runtime": "workspace:*"
56
+ },
57
+ "dependencies": {
58
+ "@module-federation/sdk": "workspace:*",
59
+ "@module-federation/runtime-tools": "workspace:*",
60
+ "@module-federation/manifest": "workspace:*",
61
+ "@module-federation/managers": "workspace:*",
62
+ "@module-federation/dts-plugin": "workspace:*",
63
+ "@module-federation/rspack": "workspace:*",
64
+ "upath": "2.0.1"
65
+ },
66
+ "type": "commonjs"
67
+ }
@@ -0,0 +1,57 @@
1
+ export class AsyncDependenciesBlock extends DependenciesBlock {
2
+ /**
3
+ * @param {(ChunkGroupOptions & { entryOptions?: EntryOptions }) | null} groupOptions options for the group
4
+ * @param {(DependencyLocation | null)=} loc the line of code
5
+ * @param {(string | null)=} request the request
6
+ */
7
+ constructor(
8
+ groupOptions:
9
+ | (ChunkGroupOptions & {
10
+ entryOptions?: EntryOptions;
11
+ })
12
+ | null,
13
+ loc?: (DependencyLocation | null) | undefined,
14
+ request?: (string | null) | undefined,
15
+ );
16
+ groupOptions: import('./ChunkGroup').RawChunkGroupOptions & {
17
+ name?: string | undefined;
18
+ } & {
19
+ entryOptions?: import('./Entrypoint').EntryOptions | undefined;
20
+ };
21
+ loc: import('./Dependency').DependencyLocation | null | undefined;
22
+ request: string | null | undefined;
23
+ _stringifiedGroupOptions: string | undefined;
24
+ /**
25
+ * @param {string | undefined} value The new chunk name
26
+ * @returns {void}
27
+ */
28
+ set chunkName(arg: string | undefined);
29
+ /**
30
+ * @returns {string | undefined} The name of the chunk
31
+ */
32
+ get chunkName(): string | undefined;
33
+ set module(arg: any);
34
+ get module(): any;
35
+ }
36
+ declare namespace AsyncDependenciesBlock {
37
+ export {
38
+ ChunkGraph,
39
+ ChunkGroup,
40
+ ChunkGroupOptions,
41
+ DependencyLocation,
42
+ UpdateHashContext,
43
+ EntryOptions,
44
+ Module,
45
+ ObjectDeserializerContext,
46
+ ObjectSerializerContext,
47
+ Hash,
48
+ };
49
+ }
50
+ import DependenciesBlock = require('./DependenciesBlock');
51
+ type ChunkGroupOptions = import('./ChunkGroup').ChunkGroupOptions;
52
+ type EntryOptions = import('./Entrypoint').EntryOptions;
53
+ type DependencyLocation = import('./Dependency').DependencyLocation;
54
+ type ChunkGraph = import('./ChunkGraph');
55
+ type ChunkGroup = import('./ChunkGroup');
56
+ type UpdateHashContext = import('./Dependency').UpdateHashContext;
57
+ type Hash = import('./util/Hash');
@@ -0,0 +1,285 @@
1
+ export class Dependency {
2
+ /** @type {Module | undefined} */
3
+ _parentModule: Module | undefined;
4
+ /** @type {DependenciesBlock | undefined} */
5
+ _parentDependenciesBlock: DependenciesBlock | undefined;
6
+ /** @type {number} */
7
+ _parentDependenciesBlockIndex: number;
8
+ /** @type {boolean} */
9
+ weak: boolean;
10
+ /** @type {boolean} */
11
+ optional: boolean;
12
+ _locSL: number;
13
+ _locSC: number;
14
+ _locEL: number;
15
+ _locEC: number;
16
+ _locI: any;
17
+ _locN: any;
18
+ _loc:
19
+ | DependencyLocation
20
+ | (SyntheticDependencyLocation & RealDependencyLocation)
21
+ | undefined;
22
+ /**
23
+ * @returns {string} a display name for the type of dependency
24
+ */
25
+ get type(): string;
26
+ /**
27
+ * @returns {string} a dependency category, typical categories are "commonjs", "amd", "esm"
28
+ */
29
+ get category(): string;
30
+ set loc(arg: DependencyLocation);
31
+ /**
32
+ * @returns {DependencyLocation} location
33
+ */
34
+ get loc(): DependencyLocation;
35
+ /**
36
+ * @param {number} startLine start line
37
+ * @param {number} startColumn start column
38
+ * @param {number} endLine end line
39
+ * @param {number} endColumn end column
40
+ */
41
+ setLoc(
42
+ startLine: number,
43
+ startColumn: number,
44
+ endLine: number,
45
+ endColumn: number,
46
+ ): void;
47
+ /**
48
+ * @returns {string | undefined} a request context
49
+ */
50
+ getContext(): string | undefined;
51
+ /**
52
+ * @returns {string | null} an identifier to merge equal requests
53
+ */
54
+ getResourceIdentifier(): string | null;
55
+ /**
56
+ * @returns {boolean | TRANSITIVE} true, when changes to the referenced module could affect the referencing module; TRANSITIVE, when changes to the referenced module could affect referencing modules of the referencing module
57
+ */
58
+ couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
59
+ /**
60
+ * Returns the referenced module and export
61
+ * @deprecated
62
+ * @param {ModuleGraph} moduleGraph module graph
63
+ * @returns {never} throws error
64
+ */
65
+ getReference(moduleGraph: ModuleGraph): never;
66
+ /**
67
+ * Returns list of exports referenced by this dependency
68
+ * @param {ModuleGraph} moduleGraph module graph
69
+ * @param {RuntimeSpec} runtime the runtime for which the module is analysed
70
+ * @returns {(string[] | ReferencedExport)[]} referenced exports
71
+ */
72
+ getReferencedExports(
73
+ moduleGraph: ModuleGraph,
74
+ runtime: RuntimeSpec,
75
+ ): (string[] | ReferencedExport)[];
76
+ /**
77
+ * @param {ModuleGraph} moduleGraph module graph
78
+ * @returns {null | false | function(ModuleGraphConnection, RuntimeSpec): ConnectionState} function to determine if the connection is active
79
+ */
80
+ getCondition(
81
+ moduleGraph: ModuleGraph,
82
+ ):
83
+ | false
84
+ | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
85
+ | null;
86
+ /**
87
+ * Returns the exported names
88
+ * @param {ModuleGraph} moduleGraph module graph
89
+ * @returns {ExportsSpec | undefined} export names
90
+ */
91
+ getExports(moduleGraph: ModuleGraph): ExportsSpec | undefined;
92
+ /**
93
+ * Returns warnings
94
+ * @param {ModuleGraph} moduleGraph module graph
95
+ * @returns {WebpackError[] | null | undefined} warnings
96
+ */
97
+ getWarnings(moduleGraph: ModuleGraph): WebpackError[] | null | undefined;
98
+ /**
99
+ * Returns errors
100
+ * @param {ModuleGraph} moduleGraph module graph
101
+ * @returns {WebpackError[] | null | undefined} errors
102
+ */
103
+ getErrors(moduleGraph: ModuleGraph): WebpackError[] | null | undefined;
104
+ /**
105
+ * Update the hash
106
+ * @param {Hash} hash hash to be updated
107
+ * @param {UpdateHashContext} context context
108
+ * @returns {void}
109
+ */
110
+ updateHash(hash: Hash, context: UpdateHashContext): void;
111
+ /**
112
+ * implement this method to allow the occurrence order plugin to count correctly
113
+ * @returns {number} count how often the id is used in this dependency
114
+ */
115
+ getNumberOfIdOccurrences(): number;
116
+ /**
117
+ * @param {ModuleGraph} moduleGraph the module graph
118
+ * @returns {ConnectionState} how this dependency connects the module to referencing modules
119
+ */
120
+ getModuleEvaluationSideEffectsState(
121
+ moduleGraph: ModuleGraph,
122
+ ): ConnectionState;
123
+ /**
124
+ * @param {string} context context directory
125
+ * @returns {Module | null} a module
126
+ */
127
+ createIgnoredModule(context: string): Module | null;
128
+ /**
129
+ * @param {ObjectSerializerContext} context context
130
+ */
131
+ serialize({ write }: ObjectSerializerContext): void;
132
+ /**
133
+ * @param {ObjectDeserializerContext} context context
134
+ */
135
+ deserialize({ read }: ObjectDeserializerContext): void;
136
+ set module(arg: any);
137
+ get module(): any;
138
+ get disconnect(): any;
139
+ }
140
+ declare namespace Dependency {
141
+ export {
142
+ NO_EXPORTS_REFERENCED,
143
+ EXPORTS_OBJECT_REFERENCED,
144
+ TRANSITIVE,
145
+ Source,
146
+ ChunkGraph,
147
+ DependenciesBlock,
148
+ DependencyTemplates,
149
+ Module,
150
+ ModuleGraph,
151
+ ModuleGraphConnection,
152
+ ConnectionState,
153
+ RuntimeTemplate,
154
+ WebpackError,
155
+ ObjectDeserializerContext,
156
+ ObjectSerializerContext,
157
+ Hash,
158
+ RuntimeSpec,
159
+ UpdateHashContext,
160
+ SourcePosition,
161
+ RealDependencyLocation,
162
+ SyntheticDependencyLocation,
163
+ DependencyLocation,
164
+ ExportSpec,
165
+ ExportsSpec,
166
+ ReferencedExport,
167
+ };
168
+ }
169
+ type Module = import('./Module');
170
+ type DependenciesBlock = import('./DependenciesBlock');
171
+ type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
172
+ type SyntheticDependencyLocation = {
173
+ name: string;
174
+ index?: number | undefined;
175
+ };
176
+ type RealDependencyLocation = {
177
+ start: SourcePosition;
178
+ end?: SourcePosition | undefined;
179
+ index?: number | undefined;
180
+ };
181
+
182
+ declare const TRANSITIVE: unique symbol;
183
+ type ModuleGraph = import('./ModuleGraph');
184
+ type RuntimeSpec = import('./util/runtime').RuntimeSpec;
185
+ type ReferencedExport = {
186
+ /**
187
+ * name of the referenced export
188
+ */
189
+ name: string[];
190
+ /**
191
+ * when false, referenced export can not be mangled, defaults to true
192
+ */
193
+ canMangle?: boolean | undefined;
194
+ };
195
+ type ModuleGraphConnection = import('./ModuleGraphConnection');
196
+ type ConnectionState = import('./ModuleGraphConnection').ConnectionState;
197
+ type ExportsSpec = {
198
+ /**
199
+ * exported names, true for unknown exports or null for no exports
200
+ */
201
+ exports: (string | ExportSpec)[] | true | null;
202
+ /**
203
+ * when exports = true, list of unaffected exports
204
+ */
205
+ excludeExports?: Set<string> | undefined;
206
+ /**
207
+ * list of maybe prior exposed, but now hidden exports
208
+ */
209
+ hideExports?: Set<string> | undefined;
210
+ /**
211
+ * when reexported: from which module
212
+ */
213
+ from?: ModuleGraphConnection | undefined;
214
+ /**
215
+ * when reexported: with which priority
216
+ */
217
+ priority?: number | undefined;
218
+ /**
219
+ * can the export be renamed (defaults to true)
220
+ */
221
+ canMangle?: boolean | undefined;
222
+ /**
223
+ * are the exports terminal bindings that should be checked for export star conflicts
224
+ */
225
+ terminalBinding?: boolean | undefined;
226
+ /**
227
+ * module on which the result depends on
228
+ */
229
+ dependencies?: Module[] | undefined;
230
+ };
231
+ type WebpackError = import('./WebpackError');
232
+ type Hash = import('./util/Hash');
233
+ type UpdateHashContext = {
234
+ chunkGraph: ChunkGraph;
235
+ runtime: RuntimeSpec;
236
+ runtimeTemplate?: RuntimeTemplate | undefined;
237
+ };
238
+ type ObjectSerializerContext =
239
+ import('./serialization/ObjectMiddleware').ObjectSerializerContext;
240
+ type ObjectDeserializerContext =
241
+ import('./serialization/ObjectMiddleware').ObjectDeserializerContext;
242
+ declare const NO_EXPORTS_REFERENCED: string[][];
243
+ declare const EXPORTS_OBJECT_REFERENCED: string[][];
244
+ type Source = import('webpack-sources').Source;
245
+ type ChunkGraph = import('./ChunkGraph');
246
+ type DependencyTemplates = import('./DependencyTemplates');
247
+ type RuntimeTemplate = import('./RuntimeTemplate');
248
+ type SourcePosition = {
249
+ line: number;
250
+ column?: number | undefined;
251
+ };
252
+ type ExportSpec = {
253
+ /**
254
+ * the name of the export
255
+ */
256
+ name: string;
257
+ /**
258
+ * can the export be renamed (defaults to true)
259
+ */
260
+ canMangle?: boolean | undefined;
261
+ /**
262
+ * is the export a terminal binding that should be checked for export star conflicts
263
+ */
264
+ terminalBinding?: boolean | undefined;
265
+ /**
266
+ * nested exports
267
+ */
268
+ exports?: (string | ExportSpec)[] | undefined;
269
+ /**
270
+ * when reexported: from which module
271
+ */
272
+ from?: ModuleGraphConnection | undefined;
273
+ /**
274
+ * when reexported: from which export
275
+ */
276
+ export?: (string[] | null) | undefined;
277
+ /**
278
+ * when reexported: with which priority
279
+ */
280
+ priority?: number | undefined;
281
+ /**
282
+ * export is not visible, because another export blends over it
283
+ */
284
+ hidden?: boolean | undefined;
285
+ };
@@ -0,0 +1,138 @@
1
+ declare class Module extends DependenciesBlock {
2
+ constructor(type: string, context?: null | string, layer?: null | string);
3
+ type: string;
4
+ context: null | string;
5
+ layer: null | string;
6
+ needId: boolean;
7
+ debugId: number;
8
+ resolveOptions?: ResolveOptionsWebpackOptions;
9
+ factoryMeta?: FactoryMeta;
10
+ useSourceMap: boolean;
11
+ useSimpleSourceMap: boolean;
12
+ buildMeta?: BuildMeta;
13
+ buildInfo?: BuildInfo;
14
+ presentationalDependencies?: Dependency[];
15
+ codeGenerationDependencies?: Dependency[];
16
+ id: string | number;
17
+ get hash(): string;
18
+ get renderedHash(): string;
19
+ profile: null | ModuleProfile;
20
+ index: null | number;
21
+ index2: null | number;
22
+ depth: null | number;
23
+ issuer: null | Module;
24
+ get usedExports(): null | boolean | SortableSet<string>;
25
+ get optimizationBailout(): (
26
+ | string
27
+ | ((requestShortener: RequestShortener) => string)
28
+ )[];
29
+ get optional(): boolean;
30
+ addChunk(chunk: Chunk): boolean;
31
+ removeChunk(chunk: Chunk): void;
32
+ isInChunk(chunk: Chunk): boolean;
33
+ isEntryModule(): boolean;
34
+ getChunks(): Chunk[];
35
+ getNumberOfChunks(): number;
36
+ get chunksIterable(): Iterable<Chunk>;
37
+ isProvided(exportName: string): null | boolean;
38
+ get exportsArgument(): string;
39
+ get moduleArgument(): string;
40
+ getExportsType(
41
+ moduleGraph: ModuleGraph,
42
+ strict?: boolean,
43
+ ): 'namespace' | 'default-only' | 'default-with-named' | 'dynamic';
44
+ addPresentationalDependency(presentationalDependency: Dependency): void;
45
+ addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
46
+ addWarning(warning: WebpackError): void;
47
+ getWarnings(): undefined | Iterable<WebpackError>;
48
+ getNumberOfWarnings(): number;
49
+ addError(error: WebpackError): void;
50
+ getErrors(): undefined | Iterable<WebpackError>;
51
+ getNumberOfErrors(): number;
52
+
53
+ /**
54
+ * removes all warnings and errors
55
+ */
56
+ clearWarningsAndErrors(): void;
57
+ isOptional(moduleGraph: ModuleGraph): boolean;
58
+ isAccessibleInChunk(
59
+ chunkGraph: ChunkGraph,
60
+ chunk: Chunk,
61
+ ignoreChunk?: Chunk,
62
+ ): boolean;
63
+ isAccessibleInChunkGroup(
64
+ chunkGraph: ChunkGraph,
65
+ chunkGroup: ChunkGroup,
66
+ ignoreChunk?: Chunk,
67
+ ): boolean;
68
+ hasReasonForChunk(
69
+ chunk: Chunk,
70
+ moduleGraph: ModuleGraph,
71
+ chunkGraph: ChunkGraph,
72
+ ): boolean;
73
+ hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
74
+ needBuild(
75
+ context: NeedBuildContext,
76
+ callback: (arg0?: null | WebpackError, arg1?: boolean) => void,
77
+ ): void;
78
+ needRebuild(
79
+ fileTimestamps: Map<string, null | number>,
80
+ contextTimestamps: Map<string, null | number>,
81
+ ): boolean;
82
+ invalidateBuild(): void;
83
+ identifier(): string;
84
+ readableIdentifier(requestShortener: RequestShortener): string;
85
+ build(
86
+ options: WebpackOptionsNormalized,
87
+ compilation: Compilation,
88
+ resolver: ResolverWithOptions,
89
+ fs: InputFileSystem,
90
+ callback: (arg0?: WebpackError) => void,
91
+ ): void;
92
+ getSourceTypes(): Set<string>;
93
+ source(
94
+ dependencyTemplates: DependencyTemplates,
95
+ runtimeTemplate: RuntimeTemplate,
96
+ type?: string,
97
+ ): Source;
98
+ size(type?: string): number;
99
+ libIdent(options: LibIdentOptions): null | string;
100
+ nameForCondition(): null | string;
101
+ getConcatenationBailoutReason(
102
+ context: ConcatenationBailoutReasonContext,
103
+ ): undefined | string;
104
+ getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
105
+ codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
106
+ chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
107
+ hasChunkCondition(): boolean;
108
+
109
+ /**
110
+ * Assuming this module is in the cache. Update the (cached) module with
111
+ * the fresh module from the factory. Usually updates internal references
112
+ * and properties.
113
+ */
114
+ updateCacheModule(module: Module): void;
115
+
116
+ /**
117
+ * Module should be unsafe cached. Get data that's needed for that.
118
+ * This data will be passed to restoreFromUnsafeCache later.
119
+ */
120
+ getUnsafeCacheData(): object;
121
+
122
+ /**
123
+ * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
124
+ */
125
+ cleanupForCache(): void;
126
+ originalSource(): null | Source;
127
+ addCacheDependencies(
128
+ fileDependencies: LazySet<string>,
129
+ contextDependencies: LazySet<string>,
130
+ missingDependencies: LazySet<string>,
131
+ buildDependencies: LazySet<string>,
132
+ ): void;
133
+ get hasEqualsChunks(): any;
134
+ get isUsed(): any;
135
+ get errors(): any;
136
+ get warnings(): any;
137
+ used: any;
138
+ }
@@ -0,0 +1,33 @@
1
+ declare abstract class ModuleFactory {
2
+ create(
3
+ data: ModuleFactoryCreateData,
4
+ callback: (arg0?: null | Error, arg1?: ModuleFactoryResult) => void,
5
+ ): void;
6
+ }
7
+
8
+ declare interface ModuleFactoryCreateData {
9
+ contextInfo: ModuleFactoryCreateDataContextInfo;
10
+ resolveOptions?: ResolveOptionsWebpackOptions;
11
+ context: string;
12
+ dependencies: Dependency[];
13
+ }
14
+
15
+ declare interface ModuleFactoryCreateDataContextInfo {
16
+ issuer: string;
17
+ issuerLayer?: null | string;
18
+ compiler: string;
19
+ }
20
+ declare interface ModuleFactoryResult {
21
+ /**
22
+ * the created module or unset if no module was created
23
+ */
24
+ module?: Module;
25
+ fileDependencies?: Set<string>;
26
+ contextDependencies?: Set<string>;
27
+ missingDependencies?: Set<string>;
28
+
29
+ /**
30
+ * allow to use the unsafe cache
31
+ */
32
+ cacheable?: boolean;
33
+ }
@@ -0,0 +1,4 @@
1
+ export type ObjectDeserializerContext = {
2
+ read: () => any;
3
+ setCircularReference: (arg0: any) => void;
4
+ };
@@ -0,0 +1,28 @@
1
+ export class StaticExportsDependency extends NullDependency {
2
+ /**
3
+ * @param {string[] | true} exports export names
4
+ * @param {boolean} canMangle true, if mangling exports names is allowed
5
+ */
6
+ constructor(exports: string[] | true, canMangle: boolean);
7
+ exports: true | string[];
8
+ canMangle: boolean;
9
+ }
10
+ declare namespace StaticExportsDependency {
11
+ export {
12
+ ChunkGraph,
13
+ ExportSpec,
14
+ ExportsSpec,
15
+ UpdateHashContext,
16
+ ModuleGraph,
17
+ ObjectDeserializerContext,
18
+ ObjectSerializerContext,
19
+ Hash,
20
+ };
21
+ }
22
+ import NullDependency = require('./NullDependency');
23
+ type ChunkGraph = import('../ChunkGraph');
24
+ type ExportSpec = import('./Dependency').ExportSpec;
25
+ type ExportsSpec = import('./Dependency').ExportsSpec;
26
+ type UpdateHashContext = import('./Dependency').UpdateHashContext;
27
+ type ModuleGraph = import('../ModuleGraph');
28
+ type Hash = import('../util/Hash');