zephyr-xpack-internal 0.0.1

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 (85) hide show
  1. package/LICENSE +39 -0
  2. package/README.md +26 -0
  3. package/dist/federation-dashboard-legacy/get-build-stats.d.ts +18 -0
  4. package/dist/federation-dashboard-legacy/get-build-stats.js +51 -0
  5. package/dist/federation-dashboard-legacy/get-build-stats.js.map +1 -0
  6. package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-dependencies.d.ts +12 -0
  7. package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-dependencies.js +31 -0
  8. package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-dependencies.js.map +1 -0
  9. package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.d.ts +28 -0
  10. package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.js +60 -0
  11. package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.js.map +1 -0
  12. package/dist/federation-dashboard-legacy/utils/convert-to-graph/get-licenses.d.ts +2 -0
  13. package/dist/federation-dashboard-legacy/utils/convert-to-graph/get-licenses.js +25 -0
  14. package/dist/federation-dashboard-legacy/utils/convert-to-graph/get-licenses.js.map +1 -0
  15. package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.d.ts +16 -0
  16. package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.js +110 -0
  17. package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.js.map +1 -0
  18. package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.d.ts +27 -0
  19. package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.js +123 -0
  20. package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.js.map +1 -0
  21. package/dist/federation-dashboard-legacy/utils/convert-to-graph/object-has-keys.d.ts +8 -0
  22. package/dist/federation-dashboard-legacy/utils/convert-to-graph/object-has-keys.js +22 -0
  23. package/dist/federation-dashboard-legacy/utils/convert-to-graph/object-has-keys.js.map +1 -0
  24. package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.d.ts +9 -0
  25. package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.js +35 -0
  26. package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.js.map +1 -0
  27. package/dist/federation-dashboard-legacy/utils/convert-to-graph/validate-params.d.ts +34 -0
  28. package/dist/federation-dashboard-legacy/utils/convert-to-graph/validate-params.js +49 -0
  29. package/dist/federation-dashboard-legacy/utils/convert-to-graph/validate-params.js.map +1 -0
  30. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.d.ts +32 -0
  31. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.js +418 -0
  32. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.js.map +1 -0
  33. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.d.ts +4 -0
  34. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.js +19 -0
  35. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.js.map +1 -0
  36. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/compute-version-strategy.d.ts +4 -0
  37. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/compute-version-strategy.js +22 -0
  38. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/compute-version-strategy.js.map +1 -0
  39. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.d.ts +31 -0
  40. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.js +3 -0
  41. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.js.map +1 -0
  42. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-types.d.ts +17 -0
  43. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-types.js +3 -0
  44. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-types.js.map +1 -0
  45. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.d.ts +1 -0
  46. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.js +23 -0
  47. package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.js.map +1 -0
  48. package/dist/federation-dashboard-legacy/utils/merge-graphs/merge-graphs.d.ts +20 -0
  49. package/dist/federation-dashboard-legacy/utils/merge-graphs/merge-graphs.js +84 -0
  50. package/dist/federation-dashboard-legacy/utils/merge-graphs/merge-graphs.js.map +1 -0
  51. package/dist/index.d.ts +6 -0
  52. package/dist/index.js +17 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/lifecycle-events/index.d.ts +2 -0
  55. package/dist/lifecycle-events/index.js +20 -0
  56. package/dist/lifecycle-events/index.js.map +1 -0
  57. package/dist/package.json +24 -0
  58. package/dist/xpack-extract/build-webpack-assets-map.d.ts +4 -0
  59. package/dist/xpack-extract/build-webpack-assets-map.js +40 -0
  60. package/dist/xpack-extract/build-webpack-assets-map.js.map +1 -0
  61. package/dist/xpack-extract/create-mf-runtime-code.d.ts +2 -0
  62. package/dist/xpack-extract/create-mf-runtime-code.js +67 -0
  63. package/dist/xpack-extract/create-mf-runtime-code.js.map +1 -0
  64. package/dist/xpack-extract/extract-federated-dependency-pairs.d.ts +3 -0
  65. package/dist/xpack-extract/extract-federated-dependency-pairs.js +22 -0
  66. package/dist/xpack-extract/extract-federated-dependency-pairs.js.map +1 -0
  67. package/dist/xpack-extract/index.d.ts +6 -0
  68. package/dist/xpack-extract/index.js +16 -0
  69. package/dist/xpack-extract/index.js.map +1 -0
  70. package/dist/xpack-extract/is-module-federation-plugin.d.ts +5 -0
  71. package/dist/xpack-extract/is-module-federation-plugin.js +14 -0
  72. package/dist/xpack-extract/is-module-federation-plugin.js.map +1 -0
  73. package/dist/xpack-extract/iterate-federation-config.d.ts +2 -0
  74. package/dist/xpack-extract/iterate-federation-config.js +18 -0
  75. package/dist/xpack-extract/iterate-federation-config.js.map +1 -0
  76. package/dist/xpack-extract/make-copy-of-module-federation-options.d.ts +2 -0
  77. package/dist/xpack-extract/make-copy-of-module-federation-options.js +11 -0
  78. package/dist/xpack-extract/make-copy-of-module-federation-options.js.map +1 -0
  79. package/dist/xpack-extract/mut-webpack-federated-remotes-config.d.ts +3 -0
  80. package/dist/xpack-extract/mut-webpack-federated-remotes-config.js +36 -0
  81. package/dist/xpack-extract/mut-webpack-federated-remotes-config.js.map +1 -0
  82. package/dist/xpack.types.d.ts +99 -0
  83. package/dist/xpack.types.js +3 -0
  84. package/dist/xpack.types.js.map +1 -0
  85. package/package.json +24 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-has-keys.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/convert-to-graph/object-has-keys.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,SAAgB,UAAU,CACxB,GAAM,EACN,OAAiB;IAEjB,IAAI,IAAI,GAAG,GAAG,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACrE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAM,CAAC;IAC/B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAZD,gCAYC"}
@@ -0,0 +1,9 @@
1
+ import { Consume } from './module-part-one';
2
+ interface ProcessFunctionRemoteParams {
3
+ functionRemotes: [file: string, applicationID: string, name: string][];
4
+ consumes: Consume[];
5
+ }
6
+ export declare function processFunctionRemotes(params: ProcessFunctionRemoteParams): {
7
+ consumes: Consume[];
8
+ };
9
+ export {};
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processFunctionRemotes = void 0;
4
+ function processFunctionRemotes(params) {
5
+ const { functionRemotes, consumes } = params;
6
+ // TODO move this into the main consumes loop
7
+ if (!Array.isArray(functionRemotes)) {
8
+ return { consumes };
9
+ }
10
+ const dynamicConsumes = Object.values(functionRemotes.reduce((acc, [file, applicationID, name]) => {
11
+ const cleanName = name.replace('./', '');
12
+ const objectId = `${applicationID}/${cleanName}`;
13
+ const cleanFile = file.replace('./', '');
14
+ const foundExistingConsume = consumes.find((consumeObj) => consumeObj.applicationID === applicationID && consumeObj.name === cleanName);
15
+ if (foundExistingConsume) {
16
+ foundExistingConsume.usedIn.add(cleanFile);
17
+ return acc;
18
+ }
19
+ if (acc[objectId]) {
20
+ acc[objectId].usedIn.add(cleanFile);
21
+ return acc;
22
+ }
23
+ acc[objectId] = {
24
+ applicationID,
25
+ name: cleanName,
26
+ consumingApplicationID: name,
27
+ usedIn: new Set([cleanFile]),
28
+ };
29
+ return acc;
30
+ }, {}));
31
+ consumes.push(...dynamicConsumes);
32
+ return { consumes };
33
+ }
34
+ exports.processFunctionRemotes = processFunctionRemotes;
35
+ //# sourceMappingURL=process-function-remotes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-function-remotes.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.ts"],"names":[],"mappings":";;;AAOA,SAAgB,sBAAsB,CAAC,MAAmC;IAGxE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAC7C,6CAA6C;IAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,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wDAwCC"}
@@ -0,0 +1,34 @@
1
+ import { XStatsChunk, XStatsModule } from '../../../xpack.types';
2
+ export interface FederationRemoteEntry {
3
+ origins: {
4
+ loc: string;
5
+ }[];
6
+ [key: string]: FederationRemoteEntry[keyof FederationRemoteEntry];
7
+ }
8
+ export interface TopLevelPackage {
9
+ dependencies?: Record<string, string>;
10
+ devDependencies?: Record<string, string>;
11
+ optionalDependencies?: Record<string, string>;
12
+ [key: string]: TopLevelPackage[keyof TopLevelPackage];
13
+ }
14
+ export interface Module {
15
+ name: string;
16
+ identifier: string;
17
+ reasons: Array<{
18
+ userRequest: string;
19
+ resolvedModule: string;
20
+ type: string;
21
+ module: string;
22
+ }>;
23
+ moduleType: string;
24
+ issuerName?: string;
25
+ nameForCondition: string;
26
+ size: number;
27
+ }
28
+ interface ValidateParams {
29
+ federationRemoteEntry: XStatsChunk | undefined;
30
+ topLevelPackage: TopLevelPackage;
31
+ modules: XStatsModule[] | undefined;
32
+ }
33
+ export declare function validateParams({ federationRemoteEntry, topLevelPackage, modules }: ValidateParams, standalone?: boolean): void;
34
+ export {};
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateParams = void 0;
4
+ const object_has_keys_1 = require("./object-has-keys");
5
+ function validateParams({ federationRemoteEntry, topLevelPackage, modules }, standalone) {
6
+ const hasLoc = federationRemoteEntry
7
+ ? (0, object_has_keys_1.objHasKeys)(federationRemoteEntry, ['origins', '0', 'loc'])
8
+ : federationRemoteEntry;
9
+ const hasDependencies = (0, object_has_keys_1.objHasKeys)(topLevelPackage, ['dependencies']);
10
+ const hasDevDependencies = (0, object_has_keys_1.objHasKeys)(topLevelPackage, ['devDependencies']);
11
+ const hasOptionalDependencies = (0, object_has_keys_1.objHasKeys)(topLevelPackage, ['optionalDependencies']);
12
+ if (federationRemoteEntry) {
13
+ if (typeof hasLoc === 'undefined' ||
14
+ (federationRemoteEntry.origins && federationRemoteEntry.origins[0].loc === '')) {
15
+ throw new Error('federationRemoteEntry.origins[0].loc must be defined and have a value');
16
+ }
17
+ }
18
+ if ((modules && !modules.length) || typeof modules === 'undefined') {
19
+ if (!standalone) {
20
+ throw new Error('Modules must be defined and have length');
21
+ }
22
+ }
23
+ if (!hasDependencies) {
24
+ throw new Error('topLevelPackage.dependencies must be defined');
25
+ }
26
+ if (!hasDevDependencies) {
27
+ throw new Error('topLevelPackage.devDependencies must be defined');
28
+ }
29
+ if (!hasOptionalDependencies) {
30
+ throw new Error('topLevelPackage.optionalDependencies must be defined');
31
+ }
32
+ if (!modules)
33
+ return;
34
+ for (const module of modules) {
35
+ if (typeof module.identifier === 'undefined') {
36
+ throw new Error('module.identifier must be defined');
37
+ }
38
+ if (typeof module.reasons === 'undefined') {
39
+ throw new Error('module.reasons must be defined');
40
+ }
41
+ if ((['consume-shared-module', 'provide-module', 'remote-module'].includes(module.moduleType ?? '') ||
42
+ module.name?.includes('container entry')) &&
43
+ typeof module.issuerName === 'undefined') {
44
+ throw new Error('module.issuerName must be defined');
45
+ }
46
+ }
47
+ }
48
+ exports.validateParams = validateParams;
49
+ //# sourceMappingURL=validate-params.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-params.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/convert-to-graph/validate-params.ts"],"names":[],"mappings":";;;AAAA,uDAA+C;AAwC/C,SAAgB,cAAc,CAC5B,EAAE,qBAAqB,EAAE,eAAe,EAAE,OAAO,EAAkB,EACnE,UAAoB;IAEpB,MAAM,MAAM,GAAG,qBAAqB;QAClC,CAAC,CAAC,IAAA,4BAAU,EAAC,qBAAqB,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5D,CAAC,CAAC,qBAAqB,CAAC;IAE1B,MAAM,eAAe,GAAG,IAAA,4BAAU,EAAC,eAAe,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IACtE,MAAM,kBAAkB,GAAG,IAAA,4BAAU,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;QACpD,CAAC;QAED,IACE,CAAC,CAAC,uBAAuB,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC,QAAQ,CACpE,MAAM,CAAC,UAAU,IAAI,EAAE,CACxB;YACC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;YAC3C,OAAO,MAAM,CAAC,UAAU,KAAK,WAAW,EACxC,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;AACH,CAAC;AA5DD,wCA4DC"}
@@ -0,0 +1,32 @@
1
+ import { ConvertedGraph, ZeUploadBuildStats } from 'zephyr-edge-contract';
2
+ import { TopLevelPackage } from '../convert-to-graph/validate-params';
3
+ import { FederationDashboardPluginOptions } from './federation-dashboard-plugin-options';
4
+ import { Exposes } from './federation-dashboard-types';
5
+ import { XChunk, XCompiler, XStats, XStatsChunk, XStatsCompilation } from '../../../xpack.types';
6
+ interface ProcessWebpackGraphParams {
7
+ stats: XStats;
8
+ stats_json: XStatsCompilation;
9
+ }
10
+ export declare class FederationDashboardPlugin {
11
+ _options: FederationDashboardPluginOptions;
12
+ _dashData: string | undefined;
13
+ allArgumentsUsed: [file: string, applicationID: string, name: string][];
14
+ FederationPluginOptions: {
15
+ name?: string;
16
+ remotes?: unknown;
17
+ exposes?: Exposes;
18
+ };
19
+ constructor(options: Partial<FederationDashboardPluginOptions>);
20
+ /** @param {Compiler} compiler */
21
+ apply(compiler: XCompiler): void;
22
+ processWebpackGraph({ stats, stats_json, }: ProcessWebpackGraphParams): ConvertedGraph | undefined;
23
+ getRemoteEntryChunk(stats: XStatsCompilation, FederationPluginOptions: typeof this.FederationPluginOptions): XStatsChunk | undefined;
24
+ getChunkDependencies(validChunkArray: XChunk[]): Record<string, never>;
25
+ buildVendorFederationMap(liveStats: XStats): TopLevelPackage;
26
+ mapToObjectRec(m: Record<string, XChunk[keyof XChunk]> | Map<string, XChunk[keyof XChunk]> | XChunk[keyof XChunk][]): Record<string, unknown>;
27
+ buildValidChunkArray(liveStats: XStats, FederationPluginOptions: typeof this.FederationPluginOptions): XChunk[];
28
+ postDashboardData(dashData: any): Promise<{
29
+ value: ZeUploadBuildStats;
30
+ } | undefined>;
31
+ }
32
+ export {};
@@ -0,0 +1,418 @@
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("../../../xpack-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
+ for (const chunk of AllReferencedChunksByRemote) {
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FederationDashboardPlugin.js","sourceRoot":"","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romiseExternal {
3
+ apply(compiler: XCompiler): void;
4
+ }
@@ -0,0 +1,19 @@
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
@@ -0,0 +1 @@
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,QAAmB;QACvB,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAC5B,wCAAwC,EACxC,CAAC,WAAyB,EAAE,EAAE;YAC5B,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,MAA2C,EAAE,GAAG,EAAE,EAAE;oBACnD,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"}
@@ -0,0 +1,4 @@
1
+ export declare let gitSha: string | undefined;
2
+ export declare const computeVersionStrategy: (stats: {
3
+ hash?: string;
4
+ }, arg: string | undefined) => string | undefined;