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.
- package/LICENSE +39 -0
- package/README.md +26 -0
- package/dist/federation-dashboard-legacy/get-build-stats.d.ts +18 -0
- package/dist/federation-dashboard-legacy/get-build-stats.js +51 -0
- package/dist/federation-dashboard-legacy/get-build-stats.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-dependencies.d.ts +12 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-dependencies.js +31 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-dependencies.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.d.ts +28 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.js +60 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/get-licenses.d.ts +2 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/get-licenses.js +25 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/get-licenses.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.d.ts +16 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.js +110 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.d.ts +27 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.js +123 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/object-has-keys.d.ts +8 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/object-has-keys.js +22 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/object-has-keys.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.d.ts +9 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.js +35 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/validate-params.d.ts +34 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/validate-params.js +49 -0
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/validate-params.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.d.ts +32 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.js +418 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.d.ts +4 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.js +19 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/compute-version-strategy.d.ts +4 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/compute-version-strategy.js +22 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/compute-version-strategy.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.d.ts +31 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.js +3 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-types.d.ts +17 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-types.js +3 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-types.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.d.ts +1 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.js +23 -0
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/find-package-json.js.map +1 -0
- package/dist/federation-dashboard-legacy/utils/merge-graphs/merge-graphs.d.ts +20 -0
- package/dist/federation-dashboard-legacy/utils/merge-graphs/merge-graphs.js +84 -0
- package/dist/federation-dashboard-legacy/utils/merge-graphs/merge-graphs.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle-events/index.d.ts +2 -0
- package/dist/lifecycle-events/index.js +20 -0
- package/dist/lifecycle-events/index.js.map +1 -0
- package/dist/package.json +24 -0
- package/dist/xpack-extract/build-webpack-assets-map.d.ts +4 -0
- package/dist/xpack-extract/build-webpack-assets-map.js +40 -0
- package/dist/xpack-extract/build-webpack-assets-map.js.map +1 -0
- package/dist/xpack-extract/create-mf-runtime-code.d.ts +2 -0
- package/dist/xpack-extract/create-mf-runtime-code.js +67 -0
- package/dist/xpack-extract/create-mf-runtime-code.js.map +1 -0
- package/dist/xpack-extract/extract-federated-dependency-pairs.d.ts +3 -0
- package/dist/xpack-extract/extract-federated-dependency-pairs.js +22 -0
- package/dist/xpack-extract/extract-federated-dependency-pairs.js.map +1 -0
- package/dist/xpack-extract/index.d.ts +6 -0
- package/dist/xpack-extract/index.js +16 -0
- package/dist/xpack-extract/index.js.map +1 -0
- package/dist/xpack-extract/is-module-federation-plugin.d.ts +5 -0
- package/dist/xpack-extract/is-module-federation-plugin.js +14 -0
- package/dist/xpack-extract/is-module-federation-plugin.js.map +1 -0
- package/dist/xpack-extract/iterate-federation-config.d.ts +2 -0
- package/dist/xpack-extract/iterate-federation-config.js +18 -0
- package/dist/xpack-extract/iterate-federation-config.js.map +1 -0
- package/dist/xpack-extract/make-copy-of-module-federation-options.d.ts +2 -0
- package/dist/xpack-extract/make-copy-of-module-federation-options.js +11 -0
- package/dist/xpack-extract/make-copy-of-module-federation-options.js.map +1 -0
- package/dist/xpack-extract/mut-webpack-federated-remotes-config.d.ts +3 -0
- package/dist/xpack-extract/mut-webpack-federated-remotes-config.js +36 -0
- package/dist/xpack-extract/mut-webpack-federated-remotes-config.js.map +1 -0
- package/dist/xpack.types.d.ts +99 -0
- package/dist/xpack.types.js +3 -0
- package/dist/xpack.types.js.map +1 -0
- package/package.json +24 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mutWebpackFederatedRemotesConfig = void 0;
|
|
4
|
+
const index_1 = require("./index");
|
|
5
|
+
function mutWebpackFederatedRemotesConfig(config, resolvedDependencyPairs) {
|
|
6
|
+
if (!resolvedDependencyPairs?.length) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
(0, index_1.iterateFederationConfig)(config, (plugin) => {
|
|
10
|
+
if (!plugin._options.remotes)
|
|
11
|
+
return;
|
|
12
|
+
const library_type = plugin._options?.library?.type ?? 'var';
|
|
13
|
+
Object.entries(plugin._options.remotes).map((remote) => {
|
|
14
|
+
const [remote_name, remote_version] = remote;
|
|
15
|
+
const resolved_dep = resolvedDependencyPairs.find((dep) => dep.name === remote_name && dep.version === remote_version);
|
|
16
|
+
if (!resolved_dep) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// const [v_app] = plugin['_options'].remotes[remote_name]?.split('@') ?? [];
|
|
20
|
+
const [v_app] = remote_version.split('@') ?? [];
|
|
21
|
+
if (v_app) {
|
|
22
|
+
resolved_dep.remote_entry_url = [v_app, resolved_dep.remote_entry_url].join('@');
|
|
23
|
+
}
|
|
24
|
+
resolved_dep.library_type = library_type;
|
|
25
|
+
resolved_dep.name = remote_name;
|
|
26
|
+
// @ts-expect-error - TS7053: Element implicitly has an any type because expression of type string can't be used to index type RemotesObject | (string | RemotesObject)[]
|
|
27
|
+
// No index signature with a parameter of type string was found on type RemotesObject | (string | RemotesObject)[]
|
|
28
|
+
if (plugin._options.remotes[remote_name]) {
|
|
29
|
+
// @ts-expect-error - read above
|
|
30
|
+
plugin._options.remotes[remote_name] = (0, index_1.createMfRuntimeCode)(resolved_dep);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
exports.mutWebpackFederatedRemotesConfig = mutWebpackFederatedRemotesConfig;
|
|
36
|
+
//# sourceMappingURL=mut-webpack-federated-remotes-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mut-webpack-federated-remotes-config.js","sourceRoot":"","sources":["../../src/xpack-extract/mut-webpack-federated-remotes-config.ts"],"names":[],"mappings":";;;AACA,mCAAuE;AAGvE,SAAgB,gCAAgC,CAC9C,MAAoC,EACpC,uBAAsD;IAEtD,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,CAAC;QACrC,OAAO;IACT,CAAC;IACD,IAAA,+BAAuB,EAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACzC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO;YAAE,OAAO;QAErC,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,IAAI,KAAK,CAAC;QAE7D,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACrD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,MAAM,CAAC;YAC7C,MAAM,YAAY,GAAG,uBAAuB,CAAC,IAAI,CAC/C,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,OAAO,KAAK,cAAc,CACpE,CAAC;YAEF,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,OAAO;YACT,CAAC;YAED,6EAA6E;YAC7E,MAAM,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAEhD,IAAI,KAAK,EAAE,CAAC;gBACV,YAAY,CAAC,gBAAgB,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACnF,CAAC;YAED,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC;YACzC,YAAY,CAAC,IAAI,GAAG,WAAW,CAAC;YAChC,yKAAyK;YACzK,kHAAkH;YAClH,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;gBACzC,gCAAgC;gBAChC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,IAAA,2BAAmB,EAAC,YAAY,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAvCD,4EAuCC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export interface XPackConfiguration<Compiler> {
|
|
2
|
+
context?: string;
|
|
3
|
+
plugins?: (undefined | null | false | '' | 0 | ((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance<Compiler>)[];
|
|
4
|
+
}
|
|
5
|
+
interface WebpackPluginInstance<Compiler> {
|
|
6
|
+
[index: string]: any;
|
|
7
|
+
/** The run point of the plugin, required method. */
|
|
8
|
+
apply: (compiler: Compiler) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface ModuleFederationPlugin {
|
|
11
|
+
apply: (compiler: unknown) => void;
|
|
12
|
+
_options: {
|
|
13
|
+
library?: {
|
|
14
|
+
type?: string;
|
|
15
|
+
};
|
|
16
|
+
remotes?: (string | RemotesObject)[] | RemotesObject;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
interface RemotesObject {
|
|
20
|
+
[index: string]: string | RemotesConfig | string[];
|
|
21
|
+
}
|
|
22
|
+
interface RemotesConfig {
|
|
23
|
+
/** Container locations from which modules should be resolved and loaded at runtime. */
|
|
24
|
+
external: string | string[];
|
|
25
|
+
/** The name of the share scope shared with this remote. */
|
|
26
|
+
shareScope?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface XStatsModule {
|
|
29
|
+
identifier?: string;
|
|
30
|
+
reasons?: XStatsReason[];
|
|
31
|
+
moduleType?: string;
|
|
32
|
+
nameForCondition?: string;
|
|
33
|
+
size?: number;
|
|
34
|
+
issuerName?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface XStatsChunk {
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
names?: string[];
|
|
40
|
+
origins?: Array<{
|
|
41
|
+
loc?: string;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
44
|
+
export interface XCompiler {
|
|
45
|
+
options: {
|
|
46
|
+
output: {
|
|
47
|
+
uniqueName: string;
|
|
48
|
+
};
|
|
49
|
+
plugins: ModuleFederationPlugin[];
|
|
50
|
+
};
|
|
51
|
+
plugins: ModuleFederationPlugin[];
|
|
52
|
+
hooks: {
|
|
53
|
+
compilation: {
|
|
54
|
+
tap: (name: string, callback: (compilation: XCompilation) => void) => void;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
webpack: {
|
|
58
|
+
RuntimeGlobals: {
|
|
59
|
+
loadScript: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export interface XCompilation {
|
|
64
|
+
outputOptions: {
|
|
65
|
+
trustedTypes: boolean;
|
|
66
|
+
};
|
|
67
|
+
hooks: {
|
|
68
|
+
additionalModuleRuntimeRequirements: {
|
|
69
|
+
tap: (name: string, callback: (module: XModule, set: Set<string>) => void) => void;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export interface XModule {
|
|
74
|
+
type: string;
|
|
75
|
+
}
|
|
76
|
+
export interface XChunk {
|
|
77
|
+
id?: string | number | null;
|
|
78
|
+
getAllReferencedChunks: () => Iterable<XChunk>;
|
|
79
|
+
}
|
|
80
|
+
interface XStatsReason {
|
|
81
|
+
module?: string;
|
|
82
|
+
userRequest?: string;
|
|
83
|
+
resolvedModule?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface XStats {
|
|
86
|
+
compilation: {
|
|
87
|
+
options: {
|
|
88
|
+
context?: string;
|
|
89
|
+
};
|
|
90
|
+
namedChunks: ReadonlyMap<string, Readonly<XChunk>>;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export interface XStatsCompilation {
|
|
94
|
+
publicPath?: string;
|
|
95
|
+
hash?: string;
|
|
96
|
+
modules?: XStatsModule[];
|
|
97
|
+
chunks?: XStatsChunk[];
|
|
98
|
+
}
|
|
99
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xpack.types.js","sourceRoot":"","sources":["../src/xpack.types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zephyr-xpack-internal",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@module-federation/automatic-vendor-federation": "1.2.1",
|
|
10
|
+
"is-ci": "^3.0.1",
|
|
11
|
+
"tslib": "^2.3.0",
|
|
12
|
+
"webpack": "^5.93.0",
|
|
13
|
+
"zephyr-agent": "0.0.29",
|
|
14
|
+
"zephyr-edge-contract": "0.0.29"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/is-ci": "^3.0.4",
|
|
18
|
+
"@types/node-persist": "^3.1.8"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "nx run zephyr-xpack-internal:build",
|
|
22
|
+
"patch-version": "pnpm version"
|
|
23
|
+
}
|
|
24
|
+
}
|