zephyr-webpack-plugin 0.0.29 → 0.0.30
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/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -2
- package/dist/types/missing-webpack-types.d.ts +3 -9
- package/dist/webpack-plugin/with-zephyr.js +4 -4
- package/dist/webpack-plugin/with-zephyr.js.map +1 -1
- package/dist/webpack-plugin/ze-setup-ze-deploy.js +2 -2
- package/dist/webpack-plugin/ze-setup-ze-deploy.js.map +1 -1
- package/dist/webpack-plugin/ze-webpack-plugin.d.ts +1 -1
- package/dist/webpack-plugin/ze-webpack-upload-agent.js +4 -6
- package/dist/webpack-plugin/ze-webpack-upload-agent.js.map +1 -1
- package/package.json +4 -3
- package/dist/federation-dashboard-legacy/get-build-stats.d.ts +0 -8
- package/dist/federation-dashboard-legacy/get-build-stats.js +0 -51
- package/dist/federation-dashboard-legacy/get-build-stats.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-dependencies.d.ts +0 -12
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-dependencies.js +0 -31
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-dependencies.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.d.ts +0 -28
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.js +0 -56
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/get-licenses.d.ts +0 -2
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/get-licenses.js +0 -25
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/get-licenses.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.d.ts +0 -16
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.js +0 -110
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.d.ts +0 -27
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.js +0 -123
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/object-has-keys.d.ts +0 -8
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/object-has-keys.js +0 -22
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/object-has-keys.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.d.ts +0 -9
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.js +0 -35
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/validate-params.d.ts +0 -34
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/validate-params.js +0 -49
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/validate-params.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.d.ts +0 -32
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.js +0 -418
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.d.ts +0 -4
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.js +0 -19
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/compute-version-strategy.d.ts +0 -4
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/compute-version-strategy.js +0 -22
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/compute-version-strategy.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.d.ts +0 -31
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.js +0 -3
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-types.d.ts +0 -17
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-types.js +0 -3
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-types.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.d.ts +0 -1
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.js +0 -23
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.js.map +0 -1
- package/dist/federation-dashboard-legacy/utils/merge-graphs/merge-graphs.d.ts +0 -20
- package/dist/federation-dashboard-legacy/utils/merge-graphs/merge-graphs.js +0 -84
- package/dist/federation-dashboard-legacy/utils/merge-graphs/merge-graphs.js.map +0 -1
- package/dist/lifecycle-events/lifecycle-events.d.ts +0 -2
- package/dist/lifecycle-events/lifecycle-events.js +0 -20
- package/dist/lifecycle-events/lifecycle-events.js.map +0 -1
- package/dist/webpack-extract/build-webpack-assets-map.d.ts +0 -4
- package/dist/webpack-extract/build-webpack-assets-map.js +0 -40
- package/dist/webpack-extract/build-webpack-assets-map.js.map +0 -1
- package/dist/webpack-extract/create-mf-runtime-code.d.ts +0 -2
- package/dist/webpack-extract/create-mf-runtime-code.js +0 -67
- package/dist/webpack-extract/create-mf-runtime-code.js.map +0 -1
- package/dist/webpack-extract/extract-federated-dependency-pairs.d.ts +0 -3
- package/dist/webpack-extract/extract-federated-dependency-pairs.js +0 -22
- package/dist/webpack-extract/extract-federated-dependency-pairs.js.map +0 -1
- package/dist/webpack-extract/index.d.ts +0 -7
- package/dist/webpack-extract/index.js +0 -16
- package/dist/webpack-extract/index.js.map +0 -1
- package/dist/webpack-extract/is-module-federation-plugin.d.ts +0 -5
- package/dist/webpack-extract/is-module-federation-plugin.js +0 -14
- package/dist/webpack-extract/is-module-federation-plugin.js.map +0 -1
- package/dist/webpack-extract/iterate-federation-config.d.ts +0 -2
- package/dist/webpack-extract/iterate-federation-config.js +0 -18
- package/dist/webpack-extract/iterate-federation-config.js.map +0 -1
- package/dist/webpack-extract/make-copy-of-module-federation-options.d.ts +0 -2
- package/dist/webpack-extract/make-copy-of-module-federation-options.js +0 -11
- package/dist/webpack-extract/make-copy-of-module-federation-options.js.map +0 -1
- package/dist/webpack-extract/mut-webpack-federated-remotes-config.d.ts +0 -3
- package/dist/webpack-extract/mut-webpack-federated-remotes-config.js +0 -36
- package/dist/webpack-extract/mut-webpack-federated-remotes-config.js.map +0 -1
|
@@ -1,418 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FederationDashboardPlugin = void 0;
|
|
4
|
-
const node_path_1 = require("node:path");
|
|
5
|
-
const convert_to_graph_1 = require("../convert-to-graph/convert-to-graph");
|
|
6
|
-
const find_package_json_1 = require("./find-package-json");
|
|
7
|
-
const compute_version_strategy_1 = require("./compute-version-strategy");
|
|
8
|
-
const add_runtime_requirement_to_promise_external_1 = require("./add-runtime-requirement-to-promise-external");
|
|
9
|
-
const is_module_federation_plugin_1 = require("../../../webpack-extract/is-module-federation-plugin");
|
|
10
|
-
// TODO: convert this require to imports
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
12
|
-
const AutomaticVendorFederation = require('@module-federation/automatic-vendor-federation');
|
|
13
|
-
class FederationDashboardPlugin {
|
|
14
|
-
// { filename: string; reportFunction: () => void }
|
|
15
|
-
constructor(options) {
|
|
16
|
-
this.allArgumentsUsed = [];
|
|
17
|
-
this.FederationPluginOptions = {};
|
|
18
|
-
this._options = Object.assign({
|
|
19
|
-
debug: false,
|
|
20
|
-
useAST: false,
|
|
21
|
-
}, options);
|
|
22
|
-
}
|
|
23
|
-
/** @param {Compiler} compiler */
|
|
24
|
-
apply(compiler) {
|
|
25
|
-
// todo: use buildid version (user_build_count)
|
|
26
|
-
compiler.options.output.uniqueName = `v${Date.now()}`;
|
|
27
|
-
new add_runtime_requirement_to_promise_external_1.AddRuntimeRequirementToPromiseExternal().apply(compiler);
|
|
28
|
-
const FederationPlugin = compiler.options.plugins.find(is_module_federation_plugin_1.isModuleFederationPlugin);
|
|
29
|
-
// todo: valorkin fixes
|
|
30
|
-
this._options.standalone = typeof FederationPlugin === 'undefined';
|
|
31
|
-
if (FederationPlugin) {
|
|
32
|
-
this.FederationPluginOptions = Object.assign({}, FederationPlugin._options, this._options.standalone || {});
|
|
33
|
-
}
|
|
34
|
-
else if (this._options.standalone) {
|
|
35
|
-
this.FederationPluginOptions = {};
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
throw new Error('Dashboard plugin is missing Module Federation or standalone option');
|
|
39
|
-
}
|
|
40
|
-
// if (this.FederationPluginOptions) {
|
|
41
|
-
// this.FederationPluginOptions.name =
|
|
42
|
-
// this.FederationPluginOptions?.name?.replace('__REMOTE_VERSION__', '');
|
|
43
|
-
// compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
|
44
|
-
// compilation.hooks.processAssets.tapPromise(
|
|
45
|
-
// {
|
|
46
|
-
// name: PLUGIN_NAME,
|
|
47
|
-
// stage: Compilation.PROCESS_ASSETS_STAGE_REPORT
|
|
48
|
-
// },
|
|
49
|
-
// () => this.processWebpackGraph(compilation)
|
|
50
|
-
// );
|
|
51
|
-
// });
|
|
52
|
-
// }
|
|
53
|
-
// todo: valorkin find usage of this env variables
|
|
54
|
-
// if (this.FederationPluginOptions?.name) {
|
|
55
|
-
// new DefinePlugin({
|
|
56
|
-
// 'process.dashboardURL': JSON.stringify(this._options.dashboardURL),
|
|
57
|
-
// 'process.CURRENT_HOST': JSON.stringify(
|
|
58
|
-
// this.FederationPluginOptions.name
|
|
59
|
-
// )
|
|
60
|
-
// }).apply(compiler);
|
|
61
|
-
// }
|
|
62
|
-
}
|
|
63
|
-
/*parseModuleAst(compilation: Compilation, callback?: () => void): void {
|
|
64
|
-
const filePaths: { resource: string; file?: string }[] = [];
|
|
65
|
-
const allArgumentsUsed: string[][] = [];
|
|
66
|
-
// Explore each chunk (build output):
|
|
67
|
-
compilation.chunks.forEach((chunk) => {
|
|
68
|
-
// Explore each module within the chunk (built inputs):
|
|
69
|
-
chunk.getModules().forEach(
|
|
70
|
-
(
|
|
71
|
-
module: Module & {
|
|
72
|
-
resource?: string;
|
|
73
|
-
resourceResolveData?: { relativePath: string };
|
|
74
|
-
}
|
|
75
|
-
) => {
|
|
76
|
-
// Loop through all the dependencies that has the named export that we are looking for
|
|
77
|
-
const matchedNamedExports = module.dependencies.filter(
|
|
78
|
-
(dep: Dependency & { name?: string }) =>
|
|
79
|
-
dep.name === 'federateComponent'
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
if (matchedNamedExports.length > 0 && module.resource) {
|
|
83
|
-
filePaths.push({
|
|
84
|
-
resource: module.resource,
|
|
85
|
-
file: module.resourceResolveData?.relativePath,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
filePaths.forEach(({ resource, file }) => {
|
|
92
|
-
const sourceCode = readFileSync(resource).toString('utf-8');
|
|
93
|
-
const ast = parse(sourceCode, {
|
|
94
|
-
sourceType: 'unambiguous',
|
|
95
|
-
plugins: ['jsx', 'typescript'],
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
// traverse the abstract syntax tree
|
|
99
|
-
traverse(ast, {
|
|
100
|
-
/!**
|
|
101
|
-
* We want to run a function depending on a found nodeType
|
|
102
|
-
* More node types are documented here: https://babeljs.io/docs/en/babel-types#api
|
|
103
|
-
*!/
|
|
104
|
-
CallExpression: (path) => {
|
|
105
|
-
const { node } = path;
|
|
106
|
-
const { callee, arguments: args } = node;
|
|
107
|
-
|
|
108
|
-
if (callee?.loc?.identifierName === 'federateComponent') {
|
|
109
|
-
const argsAreStrings = args.every(
|
|
110
|
-
(arg) => arg.type === 'StringLiteral'
|
|
111
|
-
);
|
|
112
|
-
if (!argsAreStrings) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
const argsValue: (string | undefined)[] = [file];
|
|
116
|
-
|
|
117
|
-
// we collect the JS representation of each argument used in this function call
|
|
118
|
-
for (let i = 0; i < args.length; i++) {
|
|
119
|
-
const a = args[i];
|
|
120
|
-
let { code } = generate(a);
|
|
121
|
-
|
|
122
|
-
if (code.startsWith('{')) {
|
|
123
|
-
// wrap it in parentheses, so when it's eval-ed, it is eval-ed correctly into an JS object
|
|
124
|
-
code = `(${code})`;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const value = eval(code);
|
|
128
|
-
|
|
129
|
-
// If the value is a Node, that means it was a variable name
|
|
130
|
-
// There is no easy way to resolve the variable real value, so we just skip any function calls
|
|
131
|
-
// that has variable as its args
|
|
132
|
-
if (isNode(value)) {
|
|
133
|
-
// by breaking out of the loop here,
|
|
134
|
-
// we also prevent this args to be pushed to `allArgumentsUsed`
|
|
135
|
-
break;
|
|
136
|
-
} else {
|
|
137
|
-
argsValue.push(value);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (i === args.length - 1) {
|
|
141
|
-
// push to the top level array
|
|
142
|
-
|
|
143
|
-
allArgumentsUsed.push(argsValue.filter(Boolean) as string[]);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
const uniqueArgs = allArgumentsUsed.reduce(
|
|
153
|
-
(acc, current) => {
|
|
154
|
-
const id = current.join('|');
|
|
155
|
-
acc[id] = current as [
|
|
156
|
-
file: string,
|
|
157
|
-
applicationID: string,
|
|
158
|
-
name: string,
|
|
159
|
-
];
|
|
160
|
-
return acc;
|
|
161
|
-
},
|
|
162
|
-
{} as Record<string, [file: string, applicationID: string, name: string]>
|
|
163
|
-
);
|
|
164
|
-
this.allArgumentsUsed = Object.values(uniqueArgs);
|
|
165
|
-
if (callback) callback();
|
|
166
|
-
}*/
|
|
167
|
-
processWebpackGraph({ stats, stats_json, }) {
|
|
168
|
-
// async processWebpackGraph(/*curCompiler: Compilation*/): Promise<unknown> {
|
|
169
|
-
// const stats = curCompiler.getStats();
|
|
170
|
-
// const stats_json = stats.toJson();
|
|
171
|
-
// if (this._options.useAST) {
|
|
172
|
-
// this.parseModuleAst(curCompiler);
|
|
173
|
-
// }
|
|
174
|
-
// fs.writeFileSync('stats.json', JSON.stringify(stats, null, 2))
|
|
175
|
-
// get RemoteEntryChunk
|
|
176
|
-
const RemoteEntryChunk = this.getRemoteEntryChunk(stats_json, this.FederationPluginOptions);
|
|
177
|
-
const validChunkArray = this.buildValidChunkArray(stats, this.FederationPluginOptions);
|
|
178
|
-
const chunkDependencies = this.getChunkDependencies(validChunkArray);
|
|
179
|
-
const vendorFederation = this.buildVendorFederationMap(stats);
|
|
180
|
-
const rawData = {
|
|
181
|
-
name: this.FederationPluginOptions?.name,
|
|
182
|
-
remotes: Object.keys(this.FederationPluginOptions?.remotes || {}),
|
|
183
|
-
metadata: this._options.metadata || {},
|
|
184
|
-
topLevelPackage: vendorFederation || {},
|
|
185
|
-
publicPath: stats_json.publicPath,
|
|
186
|
-
federationRemoteEntry: RemoteEntryChunk,
|
|
187
|
-
buildHash: stats_json.hash,
|
|
188
|
-
environment: this._options.environment, // 'development' if not specified
|
|
189
|
-
version: (0, compute_version_strategy_1.computeVersionStrategy)(stats_json, this._options.versionStrategy),
|
|
190
|
-
posted: this._options.posted, // Date.now() if not specified
|
|
191
|
-
group: this._options.group, // 'default' if not specified
|
|
192
|
-
sha: compute_version_strategy_1.gitSha,
|
|
193
|
-
modules: stats_json.modules,
|
|
194
|
-
chunkDependencies,
|
|
195
|
-
functionRemotes: this.allArgumentsUsed,
|
|
196
|
-
};
|
|
197
|
-
let graphData;
|
|
198
|
-
try {
|
|
199
|
-
graphData = (0, convert_to_graph_1.convertToGraph)(rawData, !!this._options.standalone);
|
|
200
|
-
}
|
|
201
|
-
catch (err) {
|
|
202
|
-
console.warn('Error during dashboard data processing');
|
|
203
|
-
console.warn(err);
|
|
204
|
-
}
|
|
205
|
-
if (!graphData) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
return graphData;
|
|
209
|
-
// const dashData = (this._dashData = JSON.stringify(graphData));
|
|
210
|
-
// return this.postDashboardData(graphData);
|
|
211
|
-
// todo: this was generating dashboard plugin, not sure we need it anymore
|
|
212
|
-
/*return Promise.resolve().then(() => {
|
|
213
|
-
const statsBuf = Buffer.from(dashData || '{}', 'utf-8');
|
|
214
|
-
|
|
215
|
-
const source: Source = {
|
|
216
|
-
source() {
|
|
217
|
-
return statsBuf;
|
|
218
|
-
},
|
|
219
|
-
size() {
|
|
220
|
-
return statsBuf.length;
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
// for dashboard.json
|
|
224
|
-
if (curCompiler.emitAsset && this._options.filename) {
|
|
225
|
-
const asset = curCompiler.getAsset(this._options.filename);
|
|
226
|
-
if (asset) {
|
|
227
|
-
curCompiler.updateAsset(this._options.filename, source as never);
|
|
228
|
-
} else {
|
|
229
|
-
curCompiler.emitAsset(this._options.filename, source as never);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
// for versioned remote
|
|
233
|
-
if (
|
|
234
|
-
curCompiler.emitAsset &&
|
|
235
|
-
this.FederationPluginOptions.filename &&
|
|
236
|
-
Object.keys(this.FederationPluginOptions.exposes || {}).length !== 0
|
|
237
|
-
) {
|
|
238
|
-
const remoteEntry = curCompiler
|
|
239
|
-
.getAsset(this.FederationPluginOptions.filename) as Asset & { source: { _value?: string } };
|
|
240
|
-
const cleanVersion =
|
|
241
|
-
typeof rawData.version === 'string'
|
|
242
|
-
? `_${rawData.version.split('.').join('_')}`
|
|
243
|
-
: `_${rawData.version}`;
|
|
244
|
-
|
|
245
|
-
let codeSource;
|
|
246
|
-
if (
|
|
247
|
-
remoteEntry &&
|
|
248
|
-
!remoteEntry.source._value &&
|
|
249
|
-
remoteEntry.source.source
|
|
250
|
-
) {
|
|
251
|
-
codeSource = remoteEntry.source.source();
|
|
252
|
-
} else if (remoteEntry.source._value) {
|
|
253
|
-
codeSource = remoteEntry.source._value;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if (!codeSource) {
|
|
257
|
-
return callback && callback();
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
//string replace "dsl" with version_dsl to make another global.
|
|
261
|
-
const newSource = codeSource
|
|
262
|
-
.toString()
|
|
263
|
-
.replace(new RegExp(`__REMOTE_VERSION__`, 'g'), cleanVersion);
|
|
264
|
-
|
|
265
|
-
const rewriteTempalteFromMain = codeSource
|
|
266
|
-
.toString()
|
|
267
|
-
.replace(new RegExp(`__REMOTE_VERSION__`, 'g'), '');
|
|
268
|
-
|
|
269
|
-
const remoteEntryBuffer = Buffer.from(newSource, 'utf-8');
|
|
270
|
-
const originalRemoteEntryBuffer = Buffer.from(
|
|
271
|
-
rewriteTempalteFromMain,
|
|
272
|
-
'utf-8'
|
|
273
|
-
);
|
|
274
|
-
|
|
275
|
-
const remoteEntrySource = new RawSource(remoteEntryBuffer);
|
|
276
|
-
|
|
277
|
-
const originalRemoteEntrySource = new RawSource(
|
|
278
|
-
originalRemoteEntryBuffer
|
|
279
|
-
);
|
|
280
|
-
|
|
281
|
-
if (remoteEntry && graphData?.version) {
|
|
282
|
-
curCompiler.updateAsset(
|
|
283
|
-
this.FederationPluginOptions.filename,
|
|
284
|
-
originalRemoteEntrySource
|
|
285
|
-
);
|
|
286
|
-
|
|
287
|
-
curCompiler.emitAsset(
|
|
288
|
-
[graphData.version, this.FederationPluginOptions.filename].join(
|
|
289
|
-
'.'
|
|
290
|
-
),
|
|
291
|
-
remoteEntrySource
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
if (callback) {
|
|
296
|
-
return void callback();
|
|
297
|
-
}
|
|
298
|
-
});*/
|
|
299
|
-
}
|
|
300
|
-
getRemoteEntryChunk(stats, FederationPluginOptions) {
|
|
301
|
-
if (!stats.chunks)
|
|
302
|
-
return;
|
|
303
|
-
return stats.chunks.find((chunk) => chunk.names?.find((name) => name === FederationPluginOptions.name));
|
|
304
|
-
}
|
|
305
|
-
getChunkDependencies(validChunkArray) {
|
|
306
|
-
return validChunkArray.reduce((acc, chunk) => {
|
|
307
|
-
const subset = chunk.getAllReferencedChunks();
|
|
308
|
-
const stringifiableChunk = Array.from(subset).map((sub) => {
|
|
309
|
-
const cleanSet = Object.getOwnPropertyNames(sub).reduce((acc, key) => {
|
|
310
|
-
if (key === '_groups')
|
|
311
|
-
return acc;
|
|
312
|
-
return Object.assign(acc, { [key]: sub[key] });
|
|
313
|
-
}, {});
|
|
314
|
-
return this.mapToObjectRec(cleanSet);
|
|
315
|
-
});
|
|
316
|
-
return Object.assign(acc, {
|
|
317
|
-
[`${chunk.id}`]: stringifiableChunk,
|
|
318
|
-
});
|
|
319
|
-
}, {});
|
|
320
|
-
}
|
|
321
|
-
buildVendorFederationMap(liveStats) {
|
|
322
|
-
const vendorFederation = {};
|
|
323
|
-
let packageJson;
|
|
324
|
-
if (this._options.packageJsonPath) {
|
|
325
|
-
// todo: wrap this is in try/catch
|
|
326
|
-
packageJson = require(this._options.packageJsonPath);
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
const initialPath = liveStats.compilation.options.context?.split(node_path_1.sep);
|
|
330
|
-
packageJson = (0, find_package_json_1.findPackageJson)(initialPath);
|
|
331
|
-
}
|
|
332
|
-
if (packageJson) {
|
|
333
|
-
vendorFederation.dependencies = AutomaticVendorFederation({
|
|
334
|
-
exclude: [],
|
|
335
|
-
ignoreVersion: false,
|
|
336
|
-
packageJson,
|
|
337
|
-
// subPackages: this.directReasons(modules),
|
|
338
|
-
shareFrom: ['dependencies'],
|
|
339
|
-
ignorePatchversion: false,
|
|
340
|
-
});
|
|
341
|
-
vendorFederation.devDependencies = AutomaticVendorFederation({
|
|
342
|
-
exclude: [],
|
|
343
|
-
ignoreVersion: false,
|
|
344
|
-
packageJson,
|
|
345
|
-
// subPackages: this.directReasons(modules),
|
|
346
|
-
shareFrom: ['devDependencies'],
|
|
347
|
-
ignorePatchversion: false,
|
|
348
|
-
});
|
|
349
|
-
vendorFederation.optionalDependencies = AutomaticVendorFederation({
|
|
350
|
-
exclude: [],
|
|
351
|
-
ignoreVersion: false,
|
|
352
|
-
packageJson,
|
|
353
|
-
// subPackages: this.directReasons(modules),
|
|
354
|
-
shareFrom: ['optionalDependencies'],
|
|
355
|
-
ignorePatchversion: false,
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
return vendorFederation;
|
|
359
|
-
}
|
|
360
|
-
mapToObjectRec(m) {
|
|
361
|
-
const lo = {};
|
|
362
|
-
for (const [key, value] of Object.entries(m)) {
|
|
363
|
-
if (value instanceof Map && value.size > 0) {
|
|
364
|
-
lo[key] = this.mapToObjectRec(value);
|
|
365
|
-
}
|
|
366
|
-
else if (value instanceof Set && value.size > 0) {
|
|
367
|
-
lo[key] = this.mapToObjectRec(Array.from(value));
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
lo[key] = value;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
return lo;
|
|
374
|
-
}
|
|
375
|
-
buildValidChunkArray(liveStats, FederationPluginOptions) {
|
|
376
|
-
if (!FederationPluginOptions.name)
|
|
377
|
-
return [];
|
|
378
|
-
const namedChunkRefs = liveStats.compilation.namedChunks.get(FederationPluginOptions.name);
|
|
379
|
-
if (!namedChunkRefs)
|
|
380
|
-
return [];
|
|
381
|
-
const AllReferencedChunksByRemote = namedChunkRefs.getAllReferencedChunks();
|
|
382
|
-
const validChunkArray = [];
|
|
383
|
-
AllReferencedChunksByRemote.forEach((chunk) => {
|
|
384
|
-
if (chunk.id !== FederationPluginOptions.name) {
|
|
385
|
-
validChunkArray.push(chunk);
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
return validChunkArray;
|
|
389
|
-
}
|
|
390
|
-
/*directReasons(modules) {
|
|
391
|
-
const directReasons = new Set();
|
|
392
|
-
|
|
393
|
-
modules.forEach((module) => {
|
|
394
|
-
if (module.reasons) {
|
|
395
|
-
module.reasons.forEach((reason) => {
|
|
396
|
-
if (reason.userRequest) {
|
|
397
|
-
try {
|
|
398
|
-
// grab user required package.json
|
|
399
|
-
const subsetPackage = require(reason.userRequest +
|
|
400
|
-
'/package.json');
|
|
401
|
-
|
|
402
|
-
directReasons.add(subsetPackage);
|
|
403
|
-
} catch (e) {
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
|
|
410
|
-
return Array.from(directReasons);
|
|
411
|
-
}*/
|
|
412
|
-
async postDashboardData(dashData) {
|
|
413
|
-
console.log(dashData);
|
|
414
|
-
throw new Error('not implemented, override it');
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
exports.FederationDashboardPlugin = FederationDashboardPlugin;
|
|
418
|
-
//# sourceMappingURL=FederationDashboardPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FederationDashboardPlugin.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;AAIhC,2EAG8C;AAE9C,2DAAsD;AACtD,yEAA4E;AAE5E,+GAAuG;AAEvG,sGAAgG;AAEhG,wCAAwC;AACxC,8DAA8D;AAC9D,MAAM,yBAAyB,GAAG,OAAO,CAAC,gDAAgD,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C,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACN,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAClB,CAAC;QACH,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,oBAAoB,CAClB,SAAgB,EAChB,uBAA4D;QAE5D,IAAI,CAAC,uBAAuB,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QAE7C,MAAM,cAAc,GAAG,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,CAC1D,uBAAuB,CAAC,IAAI,CAC7B,CAAC;QAEF,IAAI,CAAC,cAAc;YAAE,OAAO,EAAE,CAAC;QAC/B,MAAM,2BAA2B,GAAG,cAAc,CAAC,sBAAsB,EAAE,CAAC;QAE5E,MAAM,eAAe,GAAY,EAAE,CAAC;QACpC,2BAA2B,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC5C,IAAI,KAAK,CAAC,EAAE,KAAK,uBAAuB,CAAC,IAAI,EAAE,CAAC;gBAC9C,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACzB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IAEH,KAAK,CAAC,iBAAiB,CAAC,QAAa;QAMnC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;CACF;AAneD,8DAmeC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AddRuntimeRequirementToPromiseExternal = void 0;
|
|
4
|
-
class AddRuntimeRequirementToPromiseExternal {
|
|
5
|
-
apply(compiler) {
|
|
6
|
-
compiler.hooks.compilation.tap('AddRuntimeRequirementToPromiseExternal', (compilation) => {
|
|
7
|
-
const { RuntimeGlobals } = compiler.webpack;
|
|
8
|
-
if (compilation.outputOptions.trustedTypes) {
|
|
9
|
-
compilation.hooks.additionalModuleRuntimeRequirements.tap('AddRuntimeRequirementToPromiseExternal', (module, set) => {
|
|
10
|
-
if (module.externalType === 'promise') {
|
|
11
|
-
set.add(RuntimeGlobals.loadScript);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.AddRuntimeRequirementToPromiseExternal = AddRuntimeRequirementToPromiseExternal;
|
|
19
|
-
//# sourceMappingURL=add-runtime-requirement-to-promise-external.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-runtime-requirement-to-promise-external.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.ts"],"names":[],"mappings":";;;AAEA,MAAa,sCAAsC;IACjD,KAAK,CAAC,QAAkB;QACtB,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAC5B,wCAAwC,EACxC,CAAC,WAAwB,EAAE,EAAE;YAC3B,MAAM,EAAE,cAAc,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC;YAC5C,IAAI,WAAW,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;gBAC3C,WAAW,CAAC,KAAK,CAAC,mCAAmC,CAAC,GAAG,CACvD,wCAAwC,EACxC,CAAC,MAA0C,EAAE,GAAG,EAAE,EAAE;oBAClD,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;wBACtC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;oBACrC,CAAC;gBACH,CAAC,CACF,CAAC;YACJ,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAnBD,wFAmBC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.computeVersionStrategy = exports.gitSha = void 0;
|
|
4
|
-
const node_child_process_1 = require("node:child_process");
|
|
5
|
-
try {
|
|
6
|
-
exports.gitSha = (0, node_child_process_1.execSync)('git rev-parse HEAD').toString().trim();
|
|
7
|
-
}
|
|
8
|
-
catch (e) {
|
|
9
|
-
console.error(e);
|
|
10
|
-
}
|
|
11
|
-
const computeVersionStrategy = (stats, arg) => {
|
|
12
|
-
switch (arg) {
|
|
13
|
-
case 'gitSha':
|
|
14
|
-
return exports.gitSha;
|
|
15
|
-
case 'buildHash':
|
|
16
|
-
return stats.hash;
|
|
17
|
-
default:
|
|
18
|
-
return arg ? arg.toString() : exports.gitSha;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
exports.computeVersionStrategy = computeVersionStrategy;
|
|
22
|
-
//# sourceMappingURL=compute-version-strategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compute-version-strategy.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/federation-dashboard-plugin/compute-version-strategy.ts"],"names":[],"mappings":";;;AAAA,2DAA8C;AAG9C,IAAI,CAAC;IACH,cAAM,GAAG,IAAA,6BAAQ,EAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;AAC5D,CAAC;AAAC,OAAO,CAAC,EAAE,CAAC;IACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAEM,MAAM,sBAAsB,GAAG,CACpC,KAEC,EACD,GAAuB,EACH,EAAE;IACtB,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,QAAQ;YACX,OAAO,cAAM,CAAC;QAChB,KAAK,WAAW;YACd,OAAO,KAAK,CAAC,IAAI,CAAC;QACpB;YACE,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,cAAM,CAAC;IACzC,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,sBAAsB,0BAcjC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export interface FederationDashboardPluginOptions {
|
|
2
|
-
app?: {
|
|
3
|
-
org: string;
|
|
4
|
-
project: string;
|
|
5
|
-
name: string;
|
|
6
|
-
version: string;
|
|
7
|
-
};
|
|
8
|
-
git?: {
|
|
9
|
-
name?: string;
|
|
10
|
-
email?: string;
|
|
11
|
-
branch: string;
|
|
12
|
-
commit: string;
|
|
13
|
-
};
|
|
14
|
-
context: {
|
|
15
|
-
isCI: boolean;
|
|
16
|
-
};
|
|
17
|
-
debug: boolean;
|
|
18
|
-
filename: string;
|
|
19
|
-
useAST: boolean;
|
|
20
|
-
standalone?: boolean;
|
|
21
|
-
dashboardURL?: string;
|
|
22
|
-
metadata?: Record<string, string | {
|
|
23
|
-
url: string;
|
|
24
|
-
}>;
|
|
25
|
-
environment?: string;
|
|
26
|
-
versionStrategy?: string;
|
|
27
|
-
posted?: Date;
|
|
28
|
-
group?: string;
|
|
29
|
-
nextjs?: string;
|
|
30
|
-
packageJsonPath?: string;
|
|
31
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"federation-dashboard-plugin-options.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.ts"],"names":[],"mappings":""}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export interface Source {
|
|
3
|
-
source: () => Buffer;
|
|
4
|
-
size: () => number;
|
|
5
|
-
}
|
|
6
|
-
export type Exposes = (string | ExposesObject)[] | ExposesObject;
|
|
7
|
-
interface ExposesObject {
|
|
8
|
-
[index: string]: string | ExposesConfig | string[];
|
|
9
|
-
}
|
|
10
|
-
/** Advanced configuration for modules that should be exposed by this container. */
|
|
11
|
-
interface ExposesConfig {
|
|
12
|
-
/** Request to a module that should be exposed by this container. */
|
|
13
|
-
import: string | string[];
|
|
14
|
-
/** Custom chunk name for the exposed module. */
|
|
15
|
-
name?: string;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"federation-dashboard-types.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-types.ts"],"names":[],"mappings":""}
|
package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const findPackageJson: (filePath: string[] | undefined) => undefined | unknown;
|
package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findPackageJson = void 0;
|
|
4
|
-
const node_fs_1 = require("node:fs");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
6
|
-
const findPackageJson = (filePath) => {
|
|
7
|
-
if (!filePath || filePath.length === 0) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if ((0, node_fs_1.existsSync)((0, node_path_1.join)(filePath.join(node_path_1.sep), 'package.json'))) {
|
|
11
|
-
try {
|
|
12
|
-
const file = (0, node_fs_1.readFileSync)((0, node_path_1.join)(filePath.join(node_path_1.sep), 'package.json'), 'utf-8');
|
|
13
|
-
return JSON.parse(file);
|
|
14
|
-
}
|
|
15
|
-
catch (e) {
|
|
16
|
-
console.error(e);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
filePath.pop();
|
|
20
|
-
return (0, exports.findPackageJson)(filePath);
|
|
21
|
-
};
|
|
22
|
-
exports.findPackageJson = findPackageJson;
|
|
23
|
-
//# sourceMappingURL=find-package-json.js.map
|
package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-package-json.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAsC;AAE/B,MAAM,eAAe,GAAG,CAAC,QAA8B,EAAuB,EAAE;IACrF,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO;IACT,CAAC;IACD,IAAI,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,QAAQ,CAAC,IAAI,CAAC,eAAG,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QACzD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,QAAQ,CAAC,IAAI,CAAC,eAAG,CAAC,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;YAC7E,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,GAAG,EAAE,CAAC;IACf,OAAO,IAAA,uBAAe,EAAC,QAAQ,CAAC,CAAC;AACnC,CAAC,CAAC;AAdW,QAAA,eAAe,mBAc1B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ConvertedDependencies } from '../convert-to-graph/convert-dependencies';
|
|
2
|
-
import { ModuleObject, Overrides } from '../convert-to-graph/module-part-two';
|
|
3
|
-
type Graph = ConvertedDependencies & {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
remote: string;
|
|
7
|
-
modules: ModuleObject[];
|
|
8
|
-
overrides: Overrides[];
|
|
9
|
-
consumes: {
|
|
10
|
-
consumingApplicationID: string;
|
|
11
|
-
applicationID: string | null;
|
|
12
|
-
name: string;
|
|
13
|
-
usedIn: {
|
|
14
|
-
file: string;
|
|
15
|
-
url: string;
|
|
16
|
-
}[];
|
|
17
|
-
}[];
|
|
18
|
-
};
|
|
19
|
-
export declare function mergeGraphs(graph1: Graph, graph2: Graph): Graph;
|
|
20
|
-
export {};
|