zephyr-xpack-internal 0.0.0-canary-20250818211502 → 0.0.0-canary-20250902114854

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 (30) hide show
  1. package/dist/federation-dashboard-legacy/get-build-stats.js +0 -14
  2. package/dist/federation-dashboard-legacy/get-build-stats.js.map +1 -1
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.js +1 -3
  5. package/dist/index.js.map +1 -1
  6. package/dist/xpack-extract/index.d.ts +0 -1
  7. package/dist/xpack-extract/index.js +1 -3
  8. package/dist/xpack-extract/index.js.map +1 -1
  9. package/dist/xpack-extract/iterate-federated-remote-config.d.ts +2 -2
  10. package/dist/xpack-extract/iterate-federated-remote-config.js +1 -1
  11. package/dist/xpack-extract/iterate-federated-remote-config.js.map +1 -1
  12. package/dist/xpack-extract/mut-webpack-federated-remotes-config.js +6 -26
  13. package/dist/xpack-extract/mut-webpack-federated-remotes-config.js.map +1 -1
  14. package/dist/xpack.types.d.ts +0 -8
  15. package/package.json +3 -3
  16. package/dist/hooks/ze-emit-manifest.d.ts +0 -37
  17. package/dist/hooks/ze-emit-manifest.js +0 -29
  18. package/dist/hooks/ze-emit-manifest.js.map +0 -1
  19. package/dist/types/module-federation.types.d.ts +0 -300
  20. package/dist/types/module-federation.types.js +0 -5
  21. package/dist/types/module-federation.types.js.map +0 -1
  22. package/dist/xpack-extract/is-legacy-mf-plugin.d.ts +0 -2
  23. package/dist/xpack-extract/is-legacy-mf-plugin.js +0 -50
  24. package/dist/xpack-extract/is-legacy-mf-plugin.js.map +0 -1
  25. package/dist/xpack-extract/runtime-plugin-insert.d.ts +0 -2
  26. package/dist/xpack-extract/runtime-plugin-insert.js +0 -36
  27. package/dist/xpack-extract/runtime-plugin-insert.js.map +0 -1
  28. package/dist/xpack-extract/runtime-plugin.d.ts +0 -8
  29. package/dist/xpack-extract/runtime-plugin.js +0 -109
  30. package/dist/xpack-extract/runtime-plugin.js.map +0 -1
@@ -36,19 +36,6 @@ async function getBuildStats({ stats, stats_json, pluginOptions, EDGE_URL, DOMAI
36
36
  : pluginOptions.mfConfig;
37
37
  const { name, filename } = mfConfig ? ((0, extract_federation_config_1.extractFederatedConfig)(mfConfig) ?? {}) : {};
38
38
  const remotes = ze_engine.federated_dependencies;
39
- // Build zephyr:dependencies from federated_dependencies
40
- const zephyrDependencies = {};
41
- if (remotes) {
42
- for (const dep of remotes) {
43
- zephyrDependencies[dep.name] = {
44
- application_uid: dep.application_uid,
45
- remote_entry_url: dep.remote_entry_url,
46
- default_url: dep.default_url,
47
- name: dep.name,
48
- library_type: dep.library_type || 'module',
49
- };
50
- }
51
- }
52
39
  const data_overrides = {
53
40
  id: application_uid,
54
41
  name: name,
@@ -63,7 +50,6 @@ async function getBuildStats({ stats, stats_json, pluginOptions, EDGE_URL, DOMAI
63
50
  remotes: remotes?.map(({ application_uid }) => application_uid) ?? [],
64
51
  context: { isCI },
65
52
  build_target,
66
- 'zephyr:dependencies': zephyrDependencies,
67
53
  };
68
54
  // todo: extend data
69
55
  const res = Object.assign({}, convertedGraph, data_overrides, {
@@ -1 +1 @@
1
- {"version":3,"file":"get-build-stats.js","sourceRoot":"","sources":["../../src/federation-dashboard-legacy/get-build-stats.ts"],"names":[],"mappings":";;AAiBA,sCA4FC;AA5GD,+CAA6D;AAE7D,0FAAoF;AAEpF,6GAA0G;AAYnG,KAAK,UAAU,aAAa,CAA2C,EAC5E,KAAK,EACL,UAAU,EACV,aAAa,EACb,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,SAAS,EAAE,SAAS,GAAG,SAAS,GAOjC;IACC,qBAAM,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;IAC1E,MAAM,SAAS,GAAG,aAAa,CAAC,aAAa,CAAC;IAC9C,MAAM,GAAG,GAAG,SAAS,CAAC,qBAAqB,CAAC;IAC5C,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC,aAAa,CAAC;I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C,CAAC,CAAC;QAC3B,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC;IAE3B,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAA,kDAAsB,EAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpF,MAAM,OAAO,GAAG,SAAS,CAAC,sBAAsB,CAAC;IAEjD,MAAM,cAAc,GAAG;QACrB,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE;QAClC,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC;QACxC,OAAO;QACP,GAAG;QACH,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE;QACrE,OAAO,EAAE,EAAE,IAAI,EAAE;QACjB,YAAY;KACb,CAAC;IAEF,oBAAoB;IAEpB,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,cAAc,EAAE;QAC5D,OAAO,EAAE,IAAI,EAAE,+BAA+B;QAC9C,IAAI,EAAE,EAAE,EAAE,wDAAwD;KACnE,CAAqB,CAAC;IACvB,qBAAM,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;IACzC,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,5 @@ export type { XPackConfiguration, ModuleFederationPlugin, XStats, XStatsCompilat
6
6
  export { getBuildStats } from './federation-dashboard-legacy/get-build-stats';
7
7
  export { setupZeDeploy } from './hooks/ze-setup-ze-deploy';
8
8
  export { logBuildSteps } from './hooks/ze-setup-build-steps-logging';
9
- export { setupManifestEmission } from './hooks/ze-emit-manifest';
10
9
  export { xpack_zephyr_agent } from './xpack-extract/ze-xpack-upload-agent';
11
10
  export { detectAndStoreBaseHref } from './basehref/basehref-integration';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.detectAndStoreBaseHref = exports.xpack_zephyr_agent = exports.setupManifestEmission = exports.logBuildSteps = exports.setupZeDeploy = exports.getBuildStats = exports.buildWebpackAssetMap = exports.xpack_delegate_module_template = exports.mutWebpackFederatedRemotesConfig = exports.makeCopyOfModuleFederationOptions = exports.extractFederatedDependencyPairs = exports.isModuleFederationPlugin = exports.emitDeploymentDone = exports.onDeploymentDone = void 0;
3
+ exports.detectAndStoreBaseHref = exports.xpack_zephyr_agent = exports.logBuildSteps = exports.setupZeDeploy = exports.getBuildStats = exports.buildWebpackAssetMap = exports.xpack_delegate_module_template = exports.mutWebpackFederatedRemotesConfig = exports.makeCopyOfModuleFederationOptions = exports.extractFederatedDependencyPairs = exports.isModuleFederationPlugin = exports.emitDeploymentDone = exports.onDeploymentDone = void 0;
4
4
  var lifecycle_events_1 = require("./lifecycle-events");
5
5
  Object.defineProperty(exports, "onDeploymentDone", { enumerable: true, get: function () { return lifecycle_events_1.onDeploymentDone; } });
6
6
  Object.defineProperty(exports, "emitDeploymentDone", { enumerable: true, get: function () { return lifecycle_events_1.emitDeploymentDone; } });
@@ -19,8 +19,6 @@ var ze_setup_ze_deploy_1 = require("./hooks/ze-setup-ze-deploy");
19
19
  Object.defineProperty(exports, "setupZeDeploy", { enumerable: true, get: function () { return ze_setup_ze_deploy_1.setupZeDeploy; } });
20
20
  var ze_setup_build_steps_logging_1 = require("./hooks/ze-setup-build-steps-logging");
21
21
  Object.defineProperty(exports, "logBuildSteps", { enumerable: true, get: function () { return ze_setup_build_steps_logging_1.logBuildSteps; } });
22
- var ze_emit_manifest_1 = require("./hooks/ze-emit-manifest");
23
- Object.defineProperty(exports, "setupManifestEmission", { enumerable: true, get: function () { return ze_emit_manifest_1.setupManifestEmission; } });
24
22
  var ze_xpack_upload_agent_1 = require("./xpack-extract/ze-xpack-upload-agent");
25
23
  Object.defineProperty(exports, "xpack_zephyr_agent", { enumerable: true, get: function () { return ze_xpack_upload_agent_1.xpack_zephyr_agent; } });
26
24
  var basehref_integration_1 = require("./basehref/basehref-integration");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA0E;AAAjE,oHAAA,gBAAgB,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AAE7C,2FAAuF;AAA9E,uIAAA,wBAAwB,OAAA;AACjC,iDAKyB;AAJvB,gIAAA,+BAA+B,OAAA;AAC/B,kIAAA,iCAAiC,OAAA;AACjC,iIAAA,gCAAgC,OAAA;AAChC,+HAAA,8BAA8B,OAAA;AAEhC,qFAAgF;AAAvE,gIAAA,oBAAoB,OAAA;AAS7B,iFAA8E;AAArE,gHAAA,aAAa,OAAA;AAEtB,iEAA2D;AAAlD,mHAAA,aAAa,OAAA;AACtB,qFAAqE;AAA5D,6HAAA,aAAa,OAAA;AACtB,6DAAiE;AAAxD,yHAAA,qBAAqB,OAAA;AAE9B,+EAA2E;AAAlE,2HAAA,kBAAkB,OAAA;AAE3B,wEAAyE;AAAhE,8HAAA,sBAAsB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA0E;AAAjE,oHAAA,gBAAgB,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AAE7C,2FAAuF;AAA9E,uIAAA,wBAAwB,OAAA;AACjC,iDAKyB;AAJvB,gIAAA,+BAA+B,OAAA;AAC/B,kIAAA,iCAAiC,OAAA;AACjC,iIAAA,gCAAgC,OAAA;AAChC,+HAAA,8BAA8B,OAAA;AAEhC,qFAAgF;AAAvE,gIAAA,oBAAoB,OAAA;AAS7B,iFAA8E;AAArE,gHAAA,aAAa,OAAA;AAEtB,iEAA2D;AAAlD,mHAAA,aAAa,OAAA;AACtB,qFAAqE;AAA5D,6HAAA,aAAa,OAAA;AAEtB,+EAA2E;AAAlE,2HAAA,kBAAkB,OAAA;AAE3B,wEAAyE;AAAhE,8HAAA,sBAAsB,OAAA"}
@@ -5,4 +5,3 @@ export { isModuleFederationPlugin } from './is-module-federation-plugin';
5
5
  export { iterateFederationConfig } from './iterate-federation-config';
6
6
  export { makeCopyOfModuleFederationOptions } from './make-copy-of-module-federation-options';
7
7
  export { mutWebpackFederatedRemotesConfig } from './mut-webpack-federated-remotes-config';
8
- export { createZephyrRuntimePlugin } from './runtime-plugin';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createZephyrRuntimePlugin = exports.mutWebpackFederatedRemotesConfig = exports.makeCopyOfModuleFederationOptions = exports.iterateFederationConfig = exports.isModuleFederationPlugin = exports.extractFederatedConfig = exports.parseRemotesAsEntries = exports.extractFederatedDependencyPairs = exports.xpack_delegate_module_template = exports.createMfRuntimeCode = void 0;
3
+ exports.mutWebpackFederatedRemotesConfig = exports.makeCopyOfModuleFederationOptions = exports.iterateFederationConfig = exports.isModuleFederationPlugin = exports.extractFederatedConfig = exports.parseRemotesAsEntries = exports.extractFederatedDependencyPairs = exports.xpack_delegate_module_template = exports.createMfRuntimeCode = void 0;
4
4
  var create_mf_runtime_code_1 = require("./create-mf-runtime-code");
5
5
  Object.defineProperty(exports, "createMfRuntimeCode", { enumerable: true, get: function () { return create_mf_runtime_code_1.createMfRuntimeCode; } });
6
6
  Object.defineProperty(exports, "xpack_delegate_module_template", { enumerable: true, get: function () { return create_mf_runtime_code_1.xpack_delegate_module_template; } });
@@ -17,6 +17,4 @@ var make_copy_of_module_federation_options_1 = require("./make-copy-of-module-fe
17
17
  Object.defineProperty(exports, "makeCopyOfModuleFederationOptions", { enumerable: true, get: function () { return make_copy_of_module_federation_options_1.makeCopyOfModuleFederationOptions; } });
18
18
  var mut_webpack_federated_remotes_config_1 = require("./mut-webpack-federated-remotes-config");
19
19
  Object.defineProperty(exports, "mutWebpackFederatedRemotesConfig", { enumerable: true, get: function () { return mut_webpack_federated_remotes_config_1.mutWebpackFederatedRemotesConfig; } });
20
- var runtime_plugin_1 = require("./runtime-plugin");
21
- Object.defineProperty(exports, "createZephyrRuntimePlugin", { enumerable: true, get: function () { return runtime_plugin_1.createZephyrRuntimePlugin; } });
22
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/xpack-extract/index.ts"],"names":[],"mappings":";;;AAAA,mEAGkC;AAFhC,6HAAA,mBAAmB,OAAA;AACnB,wIAAA,8BAA8B,OAAA;AAEhC,2FAG8C;AAF5C,qJAAA,+BAA+B,OAAA;AAC/B,2IAAA,qBAAqB,OAAA;AAEvB,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,yEAAsE;AAA7D,oIAAA,uBAAuB,OAAA;AAChC,mGAA6F;AAApF,2JAAA,iCAAiC,OAAA;AAC1C,+FAA0F;AAAjF,wJAAA,gCAAgC,OAAA;AACzC,mDAA6D;AAApD,2HAAA,yBAAyB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/xpack-extract/index.ts"],"names":[],"mappings":";;;AAAA,mEAGkC;AAFhC,6HAAA,mBAAmB,OAAA;AACnB,wIAAA,8BAA8B,OAAA;AAEhC,2FAG8C;AAF5C,qJAAA,+BAA+B,OAAA;AAC/B,2IAAA,qBAAqB,OAAA;AAEvB,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,yEAAsE;AAA7D,oIAAA,uBAAuB,OAAA;AAChC,mGAA6F;AAApF,2JAAA,iCAAiC,OAAA;AAC1C,+FAA0F;AAAjF,wJAAA,gCAAgC,OAAA"}
@@ -1,2 +1,2 @@
1
- import type { ModuleFederationPlugin, XFederatedRemotesConfig, XPackConfiguration } from '../xpack.types';
2
- export declare function iterateFederatedRemoteConfig<Compiler, K = XFederatedRemotesConfig>(config: XPackConfiguration<Compiler>, for_remote: (federatedRemoteConfig: XFederatedRemotesConfig, plugin: ModuleFederationPlugin) => K): K[];
1
+ import type { XFederatedRemotesConfig, XPackConfiguration } from '../xpack.types';
2
+ export declare function iterateFederatedRemoteConfig<Compiler, K = XFederatedRemotesConfig>(config: XPackConfiguration<Compiler>, for_remote: (federatedRemoteConfig: XFederatedRemotesConfig) => K): K[];
@@ -18,7 +18,7 @@ function iterateFederatedRemoteConfig(config, for_remote) {
18
18
  (0, zephyr_agent_1.logFn)('warn', `No federated config found for plugin: ${plugin.constructor.name}, skipping...`);
19
19
  continue;
20
20
  }
21
- results.push(for_remote(federatedConfig, plugin));
21
+ results.push(for_remote(federatedConfig));
22
22
  }
23
23
  zephyr_agent_1.ze_log.remotes('iterateFederatedRemoteConfig.results', results);
24
24
  return results;
@@ -1 +1 @@
1
- {"version":3,"file":"iterate-federated-remote-config.js","sourceRoot":"","sources":["../../src/xpack-extract/iterate-federated-remote-config.ts"],"names":[],"mappings":";;AASA,oEA+BC;AAxCD,+CAA6C;AAM7C,2EAAqE;AACrE,+EAAyE;AAEzE,SAAgB,4BAA4B,CAC1C,MAAoC,EACpC,UAGM;IAEN,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAQ,EAAE,CAAC;IACxB,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,IAAA,sDAAwB,EAAC,MAAM,CAAC,EAAE,CAAC;YACtC,SAAS;QACX,CAAC;QAED,MAAM,eAAe,GAAG,IAAA,kDAAsB,EAAC,MAAM,CAAC,CAAC;QAEvD,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,IAAA,oBAAK,EACH,MAAM,EACN,yCAAyC,MAAM,CAAC,WAAW,CAAC,IAAI,eAAe,CAChF,CAAC;YACF,SAAS;QACX,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,CAAC;IACD,qBAAM,CAAC,OAAO,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;IAEhE,OAAO,OAAO,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"iterate-federated-remote-config.js","sourceRoot":"","sources":["../../src/xpack-extract/iterate-federated-remote-config.ts"],"names":[],"mappings":";;AAKA,oEA4BC;AAjCD,+CAA6C;AAE7C,2EAAqE;AACrE,+EAAyE;AAEzE,SAAgB,4BAA4B,CAC1C,MAAoC,EACpC,UAAiE;IAEjE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAQ,EAAE,CAAC;IACxB,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,IAAA,sDAAwB,EAAC,MAAM,CAAC,EAAE,CAAC;YACtC,SAAS;QACX,CAAC;QAED,MAAM,eAAe,GAAG,IAAA,kDAAsB,EAAC,MAAM,CAAC,CAAC;QAEvD,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,IAAA,oBAAK,EACH,MAAM,EACN,yCAAyC,MAAM,CAAC,WAAW,CAAC,IAAI,eAAe,CAChF,CAAC;YACF,SAAS;QACX,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC;IAC5C,CAAC;IACD,qBAAM,CAAC,OAAO,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;IAEhE,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -5,28 +5,18 @@ const zephyr_agent_1 = require("zephyr-agent");
5
5
  const zephyr_edge_contract_1 = require("zephyr-edge-contract");
6
6
  const extract_federated_dependency_pairs_1 = require("./extract-federated-dependency-pairs");
7
7
  const index_1 = require("./index");
8
- const is_legacy_mf_plugin_1 = require("./is-legacy-mf-plugin");
9
8
  const iterate_federated_remote_config_1 = require("./iterate-federated-remote-config");
10
- const runtime_plugin_insert_1 = require("./runtime-plugin-insert");
11
9
  function mutWebpackFederatedRemotesConfig(zephyr_engine, config, resolvedDependencyPairs, delegate_module_template = index_1.xpack_delegate_module_template) {
12
10
  if (!resolvedDependencyPairs?.length) {
13
11
  zephyr_agent_1.ze_log.remotes(`No resolved dependency pairs found, skipping...`);
14
12
  return;
15
13
  }
16
- zephyr_agent_1.ze_log.remotes(`Processing ${resolvedDependencyPairs.length} resolved dependencies`);
17
- (0, iterate_federated_remote_config_1.iterateFederatedRemoteConfig)(config, (remotesConfig, plugin) => {
14
+ (0, iterate_federated_remote_config_1.iterateFederatedRemoteConfig)(config, (remotesConfig) => {
18
15
  const remotes = remotesConfig?.remotes;
19
16
  if (!remotes) {
20
17
  zephyr_agent_1.ze_log.remotes(`No remotes found for plugin: ${JSON.stringify(remotesConfig, null, 2)}`, 'skipping...');
21
18
  return;
22
19
  }
23
- let runtimePluginInserted = false;
24
- const isRepack = zephyr_engine.builder === 'repack';
25
- // Try runtime plugin insertion first if not legacy plugin and not Repack
26
- if (!(0, is_legacy_mf_plugin_1.isLegacyMFPlugin)(plugin) && !isRepack) {
27
- runtimePluginInserted = (0, runtime_plugin_insert_1.runtimePluginInsert)(plugin);
28
- }
29
- // Legacy processing - only if runtime plugin wasn't inserted or isEnhanced is false
30
20
  const library_type = remotesConfig.library?.type ?? 'var';
31
21
  zephyr_agent_1.ze_log.remotes(`Library type: ${library_type}`);
32
22
  const remoteEntries = (0, extract_federated_dependency_pairs_1.parseRemotesAsEntries)(remotes);
@@ -42,37 +32,27 @@ function mutWebpackFederatedRemotesConfig(zephyr_engine, config, resolvedDepende
42
32
  zephyr_agent_1.ze_log.remotes(`Resolved dependency pair not found for remote: ${JSON.stringify(remote, null, 2)}`, 'skipping...');
43
33
  return;
44
34
  }
45
- const remote_entry_url = resolved_dep.remote_entry_url;
46
35
  // todo: this is a version with named export logic, we should take this into account later
47
36
  const [v_app] = remote_version.includes('@')
48
37
  ? remote_version.split('@')
49
38
  : [remote_name];
50
39
  zephyr_agent_1.ze_log.remotes(`v_app: ${v_app}`);
51
40
  if (v_app) {
52
- resolved_dep.remote_entry_url = [v_app, remote_entry_url].join('@');
53
- zephyr_agent_1.ze_log.remotes(`Adding version to remote entry url: ${remote_entry_url}`);
41
+ resolved_dep.remote_entry_url = [v_app, resolved_dep.remote_entry_url].join('@');
42
+ zephyr_agent_1.ze_log.remotes(`Adding version to remote entry url: ${resolved_dep.remote_entry_url}`);
54
43
  }
55
44
  resolved_dep.library_type = library_type;
56
45
  resolved_dep.name = (0, zephyr_edge_contract_1.normalize_app_name)(remote_name);
57
- // Final value can be current one, zephyr delegate
58
- // or fixed URL when using Zephyr Runtime plugin
59
- let remote_final_value = resolved_dep.remote_entry_url;
60
- if (!runtimePluginInserted && !isRepack) {
61
- remote_final_value = (0, index_1.createMfRuntimeCode)(zephyr_engine, resolved_dep, delegate_module_template);
62
- }
63
- // Nx remote definition is an Array
46
+ const runtimeCode = (0, index_1.createMfRuntimeCode)(zephyr_engine, resolved_dep, delegate_module_template);
64
47
  if (Array.isArray(remotes)) {
65
48
  const remoteIndex = remotes.indexOf(remote_name);
66
49
  if (remoteIndex === -1)
67
50
  return;
68
- const nx_remote_value = remote_final_value.startsWith('promise')
69
- ? remote_final_value
70
- : remote_entry_url; // Only the URL without alias for Nx definition
71
51
  // @ts-expect-error - Nx's ModuleFederationPlugin has different remote types
72
- remotes.splice(remoteIndex, 1, [remote_name, nx_remote_value]);
52
+ remotes.splice(remoteIndex, 1, [remote_name, runtimeCode]);
73
53
  return;
74
54
  }
75
- remotes[remote_name] = remote_final_value;
55
+ remotes[remote_name] = runtimeCode;
76
56
  });
77
57
  zephyr_agent_1.ze_log.remotes(`Set runtime code for remotes: ${remotes}`);
78
58
  });
@@ -1 +1 @@
1
- {"version":3,"file":"mut-webpack-federated-remotes-config.js","sourceRoot":"","sources":["../../src/xpack-extract/mut-webpack-federated-remotes-config.ts"],"names":[],"mappings":";;AAUA,4EAuGC;AAhHD,+CAAiE;AACjE,+DAA0D;AAE1D,6FAA6E;AAC7E,mCAA8E;AAC9E,+DAAyD;AACzD,uFAAiF;AACjF,mEAA8D;AAE9D,SAAgB,gCAAgC,CAC9C,aAA2B,EAC3B,MAAoC,EACpC,uBAAsD,EACtD,2BAAsD,sCAA8B;IAEpF,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,CAAC;QACrC,qBAAM,CAAC,OAAO,CAAC,iDAAiD,CAAC,CAAC;QAClE,OAAO;IACT,CAAC;IAED,qBAAM,CAAC,OAAO,CAAC,cAAc,uBAAuB,CAAC,MAAM,wBAAwB,CAAC,CAAC;IAErF,IAAA,8DAA4B,EAAC,MAAM,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE;QAC7D,MAAM,OAAO,GAAG,aAAa,EAAE,OAAO,CAAC;QACvC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,qBAAM,CAAC,OAAO,CACZ,gCAAgC,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EACxE,aAAa,CACd,CAAC;YACF,OAAO;QACT,CAAC;QAED,IAAI,qBAAqB,GAAG,KAAK,CAAC;QAClC,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,KAAK,QAAQ,CAAC;QAEpD,yEAAyE;QACzE,IAAI,CAAC,IAAA,sCAAgB,EAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC3C,qBAAqB,GAAG,IAAA,2CAAm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AAC;AACL,CAAC"}
1
+ {"version":3,"file":"mut-webpack-federated-remotes-config.js","sourceRoot":"","sources":["../../src/xpack-extract/mut-webpack-federated-remotes-config.ts"],"names":[],"mappings":";;AAQA,4EAmFC;AA1FD,+CAAiE;AACjE,+DAA0D;AAE1D,6FAA6E;AAC7E,mCAA8E;AAC9E,uFAAiF;AAEjF,SAAgB,gCAAgC,CAC9C,aAA2B,EAC3B,MAAoC,EACpC,uBAAsD,EACtD,2BAAsD,sCAA8B;IAEpF,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,CAAC;QACrC,qBAAM,CAAC,OAAO,CAAC,iDAAiD,CAAC,CAAC;QAClE,OAAO;IACT,CAAC;IAED,IAAA,8DAA4B,EAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE;QACrD,MAAM,OAAO,GAAG,aAAa,EAAE,OAAO,CAAC;QACvC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,qBAAM,CAAC,OAAO,CACZ,gCAAgC,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EACxE,aAAa,CACd,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,YAAY,GAAG,aAAa,CAAC,OAAO,EAAE,IAAI,IAAI,KAAK,CAAC;QAE1D,qBAAM,CAAC,OAAO,CAAC,iBAAiB,YAAY,EAAE,CAAC,CAAC;QAEhD,MAAM,aAAa,GAAG,IAAA,0DAAqB,EAAC,OAAO,CAAC,CAAC;QAErD,aAAa,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC/B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,MAAM,CAAC;YAC7C,MAAM,YAAY,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;gBACxD,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC;gBAC3C,MAAM,YAAY,GAChB,GAAG,CAAC,OAAO,KAAK,QAA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,WAAW,KAAK,CAAC,CAAC;oBAAE,OAAO;gBAC/B,4EAA4E;gBAC5E,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;gBAC3D,OAAO;YACT,CAAC;YAED,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC;QACrC,CAAC,CAAC,CAAC;QACH,qBAAM,CAAC,OAAO,CAAC,iCAAiC,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -23,8 +23,6 @@ export interface XFederatedRemotesConfig {
23
23
  * actual output js.bundle and they want to put it in filename field)
24
24
  */
25
25
  bundle_name?: string;
26
- /** Runtime plugins for Module Federation */
27
- runtimePlugins?: string[];
28
26
  }
29
27
  export interface ModuleFederationPlugin {
30
28
  apply: (compiler: unknown) => void;
@@ -32,14 +30,8 @@ export interface ModuleFederationPlugin {
32
30
  _options?: XFederatedRemotesConfig | {
33
31
  config: XFederatedRemotesConfig;
34
32
  };
35
- /** For Nx Module Federation plugin */
36
- options?: XFederatedRemotesConfig | {
37
- config: XFederatedRemotesConfig;
38
- };
39
33
  /** Repack specific for now until Repack change how the config should be exposed */
40
34
  config?: XFederatedRemotesConfig;
41
- /** NxModuleFederationPlugin */
42
- configOverride?: Omit<XFederatedRemotesConfig, 'exposes' | 'remotes' | 'name' | 'shared' | 'filename'>;
43
35
  }
44
36
  interface RemotesObject {
45
37
  [index: string]: string | RemotesConfig | string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zephyr-xpack-internal",
3
- "version": "0.0.0-canary-20250818211502",
3
+ "version": "0.0.0-canary-20250902114854",
4
4
  "description": "Xpack internals for Zephyr",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,8 +19,8 @@
19
19
  "@module-federation/automatic-vendor-federation": "^1.2.1",
20
20
  "is-ci": "^4.1.0",
21
21
  "tslib": "^2.8.1",
22
- "zephyr-agent": "0.0.0-canary-20250818211502",
23
- "zephyr-edge-contract": "0.0.0-canary-20250818211502"
22
+ "zephyr-agent": "0.0.0-canary-20250902114854",
23
+ "zephyr-edge-contract": "0.0.0-canary-20250902114854"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/is-ci": "3.0.4",
@@ -1,37 +0,0 @@
1
- import { type ZephyrEngine } from 'zephyr-agent';
2
- interface EmitManifestOptions {
3
- pluginName: string;
4
- zephyr_engine: ZephyrEngine;
5
- }
6
- interface EmitManifestCompiler {
7
- webpack: {
8
- sources: {
9
- RawSource: new (source: string | Buffer) => any;
10
- };
11
- Compilation: {
12
- PROCESS_ASSETS_STAGE_ADDITIONAL: number;
13
- };
14
- };
15
- hooks: {
16
- thisCompilation: {
17
- tap: (pluginName: string, cb: (compilation: EmitManifestCompilation) => void) => void;
18
- };
19
- };
20
- }
21
- interface EmitManifestCompilation {
22
- hooks: {
23
- processAssets: {
24
- tapPromise: (options: {
25
- name: string;
26
- stage: number;
27
- }, cb: (assets: Record<string, any>) => Promise<void>) => void;
28
- };
29
- };
30
- emitAsset: (filename: string, source: any) => void;
31
- }
32
- /**
33
- * Emits the zephyr-manifest.json file during the build process This ensures the manifest
34
- * is available for local development
35
- */
36
- export declare function setupManifestEmission<T extends EmitManifestOptions, XCompiler extends EmitManifestCompiler>(pluginOptions: T, compiler: XCompiler): void;
37
- export {};
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupManifestEmission = setupManifestEmission;
4
- const zephyr_agent_1 = require("zephyr-agent");
5
- /**
6
- * Emits the zephyr-manifest.json file during the build process This ensures the manifest
7
- * is available for local development
8
- */
9
- function setupManifestEmission(pluginOptions, compiler) {
10
- const { pluginName, zephyr_engine } = pluginOptions;
11
- const { RawSource } = compiler.webpack.sources;
12
- compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
13
- compilation.hooks.processAssets.tapPromise({
14
- name: `${pluginName}:EmitManifest`,
15
- stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,
16
- }, async () => {
17
- // Wait for dependencies to be resolved
18
- if (!zephyr_engine.federated_dependencies) {
19
- zephyr_agent_1.ze_log.snapshot('[Zephyr Manifest] No federated dependencies to emit');
20
- return;
21
- }
22
- // Convert to JSON
23
- const manifestContent = (0, zephyr_agent_1.createManifestContent)(zephyr_engine.federated_dependencies);
24
- // Emit the asset
25
- compilation.emitAsset('zephyr-manifest.json', new RawSource(manifestContent));
26
- });
27
- });
28
- }
29
- //# sourceMappingURL=ze-emit-manifest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ze-emit-manifest.js","sourceRoot":"","sources":["../../src/hooks/ze-emit-manifest.ts"],"names":[],"mappings":";;AAsCA,sDA8BC;AApED,+CAAgF;AAkChF;;;GAGG;AACH,SAAgB,qBAAqB,CAGnC,aAAgB,EAAE,QAAmB;IACrC,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IACpD,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC;IAE/C,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE,EAAE;QAC7D,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CACxC;YACE,IAAI,EAAE,GAAG,UAAU,eAAe;YAClC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,+BAA+B;SACpE,EACD,KAAK,IAAI,EAAE;YACT,uCAAuC;YACvC,IAAI,CAAC,aAAa,CAAC,sBAAsB,EAAE,CAAC;gBAC1C,qBAAM,CAAC,QAAQ,CAAC,qDAAqD,CAAC,CAAC;gBACvE,OAAO;YACT,CAAC;YAED,kBAAkB;YAClB,MAAM,eAAe,GAAG,IAAA,oCAAqB,EAC3C,aAAa,CAAC,sBAAsB,CACrC,CAAC;YAEF,iBAAiB;YACjB,WAAW,CAAC,SAAS,CAAC,sBAAsB,EAAE,IAAI,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC;QAChF,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,300 +0,0 @@
1
- export interface ShareScopeMap {
2
- [scopeName: string]: {
3
- [pkgName: string]: {
4
- [version: string]: {
5
- get: () => any;
6
- loaded?: boolean;
7
- from?: string;
8
- eager?: boolean;
9
- };
10
- };
11
- };
12
- }
13
- export interface ShareInfos {
14
- [pkgName: string]: {
15
- version: string;
16
- scope: string[];
17
- useIn: string[];
18
- from: string;
19
- lib: () => any;
20
- deps: string[];
21
- strategy?: 'version-first' | 'loaded-first';
22
- shareConfig?: any;
23
- };
24
- }
25
- export interface Remote {
26
- name: string;
27
- alias?: string;
28
- entry?: string;
29
- type?: string;
30
- shareScope?: string;
31
- entryGlobalName?: string;
32
- }
33
- export interface Shared {
34
- version: string;
35
- scope: string[];
36
- useIn: string[];
37
- from: string;
38
- lib: () => any;
39
- deps: string[];
40
- strategy?: 'version-first' | 'loaded-first';
41
- shareConfig?: any;
42
- }
43
- export interface Options {
44
- name: string;
45
- version?: string;
46
- remotes: Remote[];
47
- shared: {
48
- [pkgName: string]: Shared[];
49
- };
50
- plugins?: FederationRuntimePlugin[];
51
- shareStrategy?: 'version-first' | 'loaded-first';
52
- }
53
- export interface UserOptions {
54
- name: string;
55
- version?: string;
56
- remotes?: Remote[];
57
- shared?: Record<string, any>;
58
- plugins?: FederationRuntimePlugin[];
59
- shareStrategy?: 'version-first' | 'loaded-first';
60
- }
61
- export interface RemoteInfo {
62
- name: string;
63
- alias?: string;
64
- entry: string;
65
- type?: string;
66
- shareScope?: string;
67
- entryGlobalName?: string;
68
- }
69
- export interface ModuleInfo {
70
- name: string;
71
- buildVersion: string;
72
- publicPath: string;
73
- types: {
74
- path: string;
75
- name: string;
76
- zip?: string;
77
- api?: string;
78
- };
79
- remotes: Array<{
80
- federationContainerName: string;
81
- moduleName: string;
82
- alias: string;
83
- entry: string;
84
- }>;
85
- shared: Array<{
86
- id: string;
87
- name: string;
88
- version: string;
89
- requiredVersion: string;
90
- assets: {
91
- js: {
92
- sync: string[];
93
- async: string[];
94
- };
95
- css: {
96
- sync: string[];
97
- async: string[];
98
- };
99
- };
100
- }>;
101
- exposes: Record<string, {
102
- id: string;
103
- name: string;
104
- assets: {
105
- js: {
106
- sync: string[];
107
- async: string[];
108
- };
109
- css: {
110
- sync: string[];
111
- async: string[];
112
- };
113
- };
114
- }>;
115
- }
116
- export interface BeforeInitHookArgs {
117
- userOptions: UserOptions;
118
- options: Options;
119
- origin: any;
120
- shareInfo: ShareInfos;
121
- }
122
- export interface InitHookArgs {
123
- options: Options;
124
- origin: any;
125
- }
126
- export interface BeforeInitContainerHookArgs {
127
- shareScope: ShareScopeMap[string];
128
- initScope: Record<string, any>;
129
- remoteEntryInitOptions: any;
130
- remoteInfo: RemoteInfo;
131
- origin: any;
132
- }
133
- export interface InitContainerHookArgs {
134
- shareScope: ShareScopeMap[string];
135
- initScope: Record<string, any>;
136
- remoteEntryInitOptions: any;
137
- remoteInfo: RemoteInfo;
138
- remoteEntryExports: any;
139
- origin: any;
140
- id: string;
141
- remoteSnapshot?: ModuleInfo;
142
- }
143
- export interface BeforeRegisterRemoteHookArgs {
144
- remote: Remote;
145
- origin: any;
146
- }
147
- export interface RegisterRemoteHookArgs {
148
- remote: Remote;
149
- origin: any;
150
- }
151
- export interface BeforeRequestHookArgs {
152
- id: string;
153
- options: Options;
154
- origin: any;
155
- }
156
- export interface OnLoadHookArgs {
157
- id: string;
158
- expose: string;
159
- pkgNameOrAlias: string;
160
- remote: Remote;
161
- options: any;
162
- origin: any;
163
- exposeModule: any;
164
- exposeModuleFactory: any;
165
- moduleInstance: any;
166
- }
167
- export interface AfterResolveHookArgs {
168
- id: string;
169
- pkgNameOrAlias: string;
170
- expose: string;
171
- remote: Remote;
172
- options: Options;
173
- origin: any;
174
- remoteInfo: RemoteInfo;
175
- remoteSnapshot?: ModuleInfo;
176
- }
177
- export interface BeforeLoadShareHookArgs {
178
- pkgName: string;
179
- shareInfo?: Shared;
180
- shared: Options['shared'];
181
- origin: any;
182
- }
183
- export interface LoadShareHookArgs {
184
- origin: any;
185
- pkgName: string;
186
- shareInfos: ShareInfos;
187
- }
188
- export interface ResolveShareHookArgs {
189
- shareScopeMap: ShareScopeMap;
190
- scope: string;
191
- pkgName: string;
192
- version: string;
193
- GlobalFederation: any;
194
- resolver: () => Shared | undefined;
195
- }
196
- export interface InitContainerShareScopeMapHookArgs {
197
- shareScope: ShareScopeMap[string];
198
- options: Options;
199
- origin: any;
200
- scopeName: string;
201
- hostShareScopeMap?: ShareScopeMap;
202
- }
203
- export interface BeforeLoadRemoteSnapshotHookArgs {
204
- options: Options;
205
- moduleInfo: Remote;
206
- }
207
- export interface LoadSnapshotHookArgs {
208
- options: Options;
209
- moduleInfo: Remote;
210
- hostGlobalSnapshot: any;
211
- globalSnapshot: any;
212
- remoteSnapshot?: any;
213
- }
214
- export interface LoadRemoteSnapshotHookArgs {
215
- options: Options;
216
- moduleInfo: Remote;
217
- manifestJson?: any;
218
- manifestUrl?: string;
219
- remoteSnapshot: ModuleInfo;
220
- from: 'global' | 'manifest';
221
- }
222
- export interface AfterLoadSnapshotHookArgs {
223
- id?: string;
224
- host: any;
225
- options: Options;
226
- moduleInfo: Remote;
227
- remoteSnapshot: ModuleInfo;
228
- }
229
- export interface GetModuleInfoHookArgs {
230
- target: Record<string, any>;
231
- key: any;
232
- }
233
- export interface CreateScriptHookArgs {
234
- url: string;
235
- attrs?: Record<string, any>;
236
- }
237
- export interface CreateLinkHookArgs {
238
- url: string;
239
- attrs?: Record<string, any>;
240
- }
241
- export interface FetchHookArgs {
242
- url: string;
243
- init: RequestInit;
244
- }
245
- export interface LoadEntryErrorHookArgs {
246
- getRemoteEntry: any;
247
- origin: any;
248
- remoteInfo: RemoteInfo;
249
- remoteEntryExports?: any;
250
- globalLoading: Record<string, Promise<void | any> | undefined>;
251
- uniqueKey: string;
252
- }
253
- export interface GetModuleFactoryHookArgs {
254
- remoteEntryExports: any;
255
- expose: string;
256
- moduleInfo: RemoteInfo;
257
- }
258
- export type BeforeBridgeRenderHookArgs = Record<string, any>;
259
- export type AfterBridgeRenderHookArgs = Record<string, any>;
260
- export type BeforeBridgeDestroyHookArgs = Record<string, any>;
261
- export type AfterBridgeDestroyHookArgs = Record<string, any>;
262
- export interface FederationRuntimePlugin {
263
- name: string;
264
- version?: string;
265
- beforeInit?: (args: BeforeInitHookArgs) => BeforeInitHookArgs | Promise<BeforeInitHookArgs>;
266
- init?: (args: InitHookArgs) => void;
267
- beforeInitContainer?: (args: BeforeInitContainerHookArgs) => BeforeInitContainerHookArgs | Promise<BeforeInitContainerHookArgs>;
268
- initContainer?: (args: InitContainerHookArgs) => InitContainerHookArgs | Promise<InitContainerHookArgs>;
269
- beforeRegisterRemote?: (args: BeforeRegisterRemoteHookArgs) => BeforeRegisterRemoteHookArgs | Promise<BeforeRegisterRemoteHookArgs>;
270
- registerRemote?: (args: RegisterRemoteHookArgs) => RegisterRemoteHookArgs | Promise<RegisterRemoteHookArgs>;
271
- beforeRequest?: (args: BeforeRequestHookArgs) => BeforeRequestHookArgs | Promise<BeforeRequestHookArgs>;
272
- onLoad?: (args: OnLoadHookArgs) => void | Promise<void>;
273
- afterResolve?: (args: AfterResolveHookArgs) => AfterResolveHookArgs | Promise<AfterResolveHookArgs>;
274
- beforeLoadShare?: (args: BeforeLoadShareHookArgs) => BeforeLoadShareHookArgs | Promise<BeforeLoadShareHookArgs>;
275
- loadShare?: (args: LoadShareHookArgs) => false | void | Promise<false | void>;
276
- resolveShare?: (args: ResolveShareHookArgs) => ResolveShareHookArgs | Promise<ResolveShareHookArgs>;
277
- initContainerShareScopeMap?: (args: InitContainerShareScopeMapHookArgs) => InitContainerShareScopeMapHookArgs | Promise<InitContainerShareScopeMapHookArgs>;
278
- beforeLoadRemoteSnapshot?: (args: BeforeLoadRemoteSnapshotHookArgs) => void | Promise<void>;
279
- loadSnapshot?: (args: LoadSnapshotHookArgs) => LoadSnapshotHookArgs | Promise<LoadSnapshotHookArgs>;
280
- loadRemoteSnapshot?: (args: LoadRemoteSnapshotHookArgs) => LoadRemoteSnapshotHookArgs | Promise<LoadRemoteSnapshotHookArgs>;
281
- afterLoadSnapshot?: (args: AfterLoadSnapshotHookArgs) => AfterLoadSnapshotHookArgs | Promise<AfterLoadSnapshotHookArgs>;
282
- getModuleInfo?: (args: GetModuleInfoHookArgs) => void | {
283
- value: any;
284
- key: string;
285
- };
286
- createScript?: (args: CreateScriptHookArgs) => any;
287
- createLink?: (args: CreateLinkHookArgs) => void | HTMLLinkElement;
288
- fetch?: (args: FetchHookArgs) => false | void | Promise<Response>;
289
- loadEntryError?: (args: LoadEntryErrorHookArgs) => Promise<(() => Promise<any>) | undefined>;
290
- getModuleFactory?: (args: GetModuleFactoryHookArgs) => Promise<(() => Promise<any>) | undefined>;
291
- beforeBridgeRender?: (args: BeforeBridgeRenderHookArgs) => void | Record<string, any>;
292
- afterBridgeRender?: (args: AfterBridgeRenderHookArgs) => void | Record<string, any>;
293
- beforeBridgeDestroy?: (args: BeforeBridgeDestroyHookArgs) => void | Record<string, any>;
294
- afterBridgeDestroy?: (args: AfterBridgeDestroyHookArgs) => void | Record<string, any>;
295
- }
296
- export interface RemoteWithEntry {
297
- name: string;
298
- alias?: string;
299
- entry: string;
300
- }
@@ -1,5 +0,0 @@
1
- "use strict";
2
- // Local type definitions to avoid external library dependencies
3
- // Based on @module-federation/runtime-core@0.16.0
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=module-federation.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"module-federation.types.js","sourceRoot":"","sources":["../../src/types/module-federation.types.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,kDAAkD"}
@@ -1,2 +0,0 @@
1
- import type { ModuleFederationPlugin } from '../xpack.types';
2
- export declare function isLegacyMFPlugin(plugin: ModuleFederationPlugin): boolean;
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isLegacyMFPlugin = isLegacyMFPlugin;
4
- const zephyr_agent_1 = require("zephyr-agent");
5
- const extract_federation_config_1 = require("./extract-federation-config");
6
- function isLegacyMFPlugin(plugin) {
7
- const options = (0, extract_federation_config_1.extractFederatedConfig)(plugin);
8
- if (!options) {
9
- zephyr_agent_1.ze_log.mf('Not a Module Federation plugin');
10
- return false;
11
- }
12
- // If constructor name doesn't match, definitely not webpack's
13
- if (plugin.constructor.name !== 'ModuleFederationPlugin') {
14
- zephyr_agent_1.ze_log.mf('Non-legacy Module Federation plugin identified. Current plugin name: ', plugin.constructor.name);
15
- return false;
16
- }
17
- const enhancedFeaturesChecks = [
18
- // Core enhanced methods (likely present in most versions)
19
- [plugin, 'getRemoteEntryUrls', 'function'],
20
- [plugin, 'getContainerEntryModule', 'function'],
21
- [plugin, 'invalidateRemote', 'function'],
22
- // Newer enhanced methods (higher version requirements)
23
- [plugin, 'statsResourceInfo'],
24
- [plugin, 'getStats', 'function'],
25
- // Configuration-based detection (version-agnostic)
26
- [options, 'experiments'],
27
- [options, 'runtimePlugins'],
28
- [options, 'enhanced'],
29
- // Internal properties (likely present across versions)
30
- [plugin, '_experiments'],
31
- [plugin, '_enhanced'],
32
- ];
33
- for (const check of enhancedFeaturesChecks) {
34
- if (hasProperty(...check)) {
35
- zephyr_agent_1.ze_log.mf('Non-legacy Module Federation plugin identified. Plugin contains property: ', check[1]);
36
- return false; // Has enhanced features, so NOT legacy
37
- }
38
- }
39
- // If we get here, it's webpack's native plugin
40
- return true;
41
- }
42
- const hasProperty = (target, property, type) => {
43
- const hasProp = property in target;
44
- if (!(property in target))
45
- return false;
46
- if (type)
47
- return typeof target[property] === type;
48
- return hasProp;
49
- };
50
- //# sourceMappingURL=is-legacy-mf-plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-legacy-mf-plugin.js","source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ACT,CAAC;YACF,OAAO,KAAK,CAAC,CAAC,uCAAuC;QACvD,CAAC;IACH,CAAC;IACD,+CAA+C;IAC/C,OAAO,IAAI,CAAC;AACd,CAAC;AAID,MAAM,WAAW,GAAG,CAAC,MAAW,EAAE,QAAgB,EAAE,IAAa,EAAW,EAAE;IAC5E,MAAM,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC;IAEnC,IAAI,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAExC,IAAI,IAAI;QAAE,OAAO,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAElD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { ModuleFederationPlugin } from '../xpack.types';
2
- export declare function runtimePluginInsert(plugin: ModuleFederationPlugin): boolean;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runtimePluginInsert = runtimePluginInsert;
4
- const zephyr_agent_1 = require("zephyr-agent");
5
- const extract_federation_config_1 = require("./extract-federation-config");
6
- function runtimePluginInsert(plugin) {
7
- try {
8
- const runtimePluginPath = require.resolve('./runtime-plugin');
9
- zephyr_agent_1.ze_log.remotes(`Adding Zephyr runtime plugin: ${runtimePluginPath}`);
10
- let configRef = (0, extract_federation_config_1.extractFederatedConfig)(plugin);
11
- if (!configRef) {
12
- zephyr_agent_1.ze_log.remotes('No MF config found.');
13
- return false;
14
- }
15
- // handle NxModuleFederationPlugin wrapper
16
- if ('configOverride' in plugin) {
17
- plugin.configOverride ?? (plugin.configOverride = {});
18
- configRef = plugin.configOverride;
19
- }
20
- // Initialize runtimePlugins array if it doesn't exist
21
- if (!configRef.runtimePlugins) {
22
- configRef.runtimePlugins = [];
23
- }
24
- // Add the runtime plugin only if it's not already present
25
- if (!configRef.runtimePlugins.includes(runtimePluginPath)) {
26
- configRef.runtimePlugins.push(runtimePluginPath);
27
- }
28
- zephyr_agent_1.ze_log.remotes(`Runtime plugin added to Module Federation config`);
29
- return true; // Successfully inserted runtime plugin
30
- }
31
- catch (error) {
32
- zephyr_agent_1.ze_log.remotes(`Failed to resolve runtime plugin path: ${error}`);
33
- return false; // Failed to insert runtime plugin
34
- }
35
- }
36
- //# sourceMappingURL=runtime-plugin-insert.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-plugin-insert.js","sourceRoot":"","sources":["../../src/xpack-extract/runtime-plugin-insert.ts"],"names":[],"mappings":";;AAIA,kDAmCC;AAvCD,+CAAsC;AAEtC,2EAAqE;AAErE,SAAgB,mBAAmB,CAAC,MAA8B;IAChE,IAAI,CAAC;QACH,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAC9D,qBAAM,CAAC,OAAO,CAAC,iCAAiC,iBAAiB,EAAE,CAAC,CAAC;QAErE,IAAI,SAAS,GACX,IAAA,kDAAsB,EAAC,MAAM,CAAC,CAAC;QAEjC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,qBAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;YACtC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,0CAA0C;QAC1C,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAAC;YAC/B,MAAM,CAAC,cAAc,KAArB,MAAM,CAAC,cAAc,GAAK,EAAE,EAAC;YAC7B,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;QACpC,CAAC;QAED,sDAAsD;QACtD,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;YAC9B,SAAS,CAAC,cAAc,GAAG,EAAE,CAAC;QAChC,CAAC;QAED,0DAA0D;QAC1D,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;YAC1D,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACnD,CAAC;QACD,qBAAM,CAAC,OAAO,CAAC,kDAAkD,CAAC,CAAC;QAEnE,OAAO,IAAI,CAAC,CAAC,uCAAuC;IACtD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,qBAAM,CAAC,OAAO,CAAC,0CAA0C,KAAK,EAAE,CAAC,CAAC;QAClE,OAAO,KAAK,CAAC,CAAC,kCAAkC;IAClD,CAAC;AACH,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { FederationRuntimePlugin } from '../types/module-federation.types';
2
- /**
3
- * Zephyr Runtime Plugin for Module Federation This plugin handles dynamic remote URL
4
- * resolution at runtime using beforeRequest hook to mutate URLs on the fly
5
- */
6
- export declare function createZephyrRuntimePlugin(): FederationRuntimePlugin;
7
- /** Default export for use with Module Federation runtime plugins array */
8
- export default createZephyrRuntimePlugin;
@@ -1,109 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createZephyrRuntimePlugin = createZephyrRuntimePlugin;
4
- // Ensure only one fetch is done by the app
5
- const globalKey = '__ZEPHYR_MANIFEST_PROMISE__';
6
- const _global = typeof window !== 'undefined' ? window : globalThis;
7
- function getGlobalManifestPromise() {
8
- return _global[globalKey];
9
- }
10
- function setGlobalManifestPromise(promise) {
11
- _global[globalKey] = promise;
12
- }
13
- /**
14
- * Zephyr Runtime Plugin for Module Federation This plugin handles dynamic remote URL
15
- * resolution at runtime using beforeRequest hook to mutate URLs on the fly
16
- */
17
- function createZephyrRuntimePlugin() {
18
- let processedRemotes;
19
- // Start fetching manifest immediately
20
- let zephyrManifestPromise = getGlobalManifestPromise();
21
- if (!zephyrManifestPromise) {
22
- zephyrManifestPromise = fetchZephyrManifest();
23
- setGlobalManifestPromise(zephyrManifestPromise);
24
- }
25
- return {
26
- name: 'zephyr-runtime-remote-resolver',
27
- async beforeRequest(args) {
28
- const zephyrManifest = await zephyrManifestPromise;
29
- if (!processedRemotes) {
30
- processedRemotes = identifyRemotes(args, zephyrManifest);
31
- }
32
- // Extract remote name from args.id (format: "remoteName/componentName")
33
- const remoteName = args.id.split('/')[0];
34
- if (!processedRemotes[remoteName]) {
35
- return args; // No matching remote found
36
- }
37
- // Get the resolved URL, checking session storage first
38
- const resolvedUrl = getResolvedRemoteUrl(processedRemotes[remoteName]);
39
- const targetRemote = args.options.remotes.find((remote) => hasEntry(remote) && (remote.name === remoteName || remote.alias === remoteName));
40
- // Update the remote entry URL
41
- targetRemote.entry = resolvedUrl;
42
- return args;
43
- },
44
- };
45
- }
46
- /** Fetches the zephyr-manifest.json file and returns the runtime plugin data */
47
- async function fetchZephyrManifest() {
48
- try {
49
- // Fetch the manifest from the same origin
50
- const response = await fetch('/zephyr-manifest.json');
51
- if (!response.ok) {
52
- return;
53
- }
54
- const manifest = await response.json().catch(() => undefined);
55
- if (!manifest) {
56
- console.error('Failed to parse manifest JSON');
57
- return;
58
- }
59
- return manifest;
60
- }
61
- catch {
62
- console.error('Unexpected error fetching manifest');
63
- return;
64
- }
65
- }
66
- function identifyRemotes(args, zephyrManifest) {
67
- const identifiedRemotes = {};
68
- // No runtime plugin configured
69
- if (!zephyrManifest) {
70
- return identifiedRemotes;
71
- }
72
- // No remotes defined
73
- if (!args.options.remotes.length) {
74
- return identifiedRemotes;
75
- }
76
- const { dependencies } = zephyrManifest;
77
- const remotes = args.options.remotes;
78
- remotes.forEach((remote) => {
79
- const resolvedRemote = dependencies[remote.name] ?? dependencies[remote.alias ?? ''];
80
- if (resolvedRemote) {
81
- identifiedRemotes[resolvedRemote.name] = resolvedRemote;
82
- }
83
- });
84
- return identifiedRemotes;
85
- }
86
- function hasEntry(remote) {
87
- return (remote !== null &&
88
- remote !== undefined &&
89
- typeof remote === 'object' &&
90
- 'entry' in remote &&
91
- typeof remote.entry === 'string');
92
- }
93
- /** Resolves the actual remote URL, checking session storage for overrides */
94
- function getResolvedRemoteUrl(resolvedRemote) {
95
- const _window = typeof window !== 'undefined' ? window : globalThis;
96
- // Check for session storage override (for development/testing)
97
- const sessionEdgeURL = _window.sessionStorage?.getItem(resolvedRemote.application_uid);
98
- // Use session URL if available, otherwise use resolved URL
99
- let edgeUrl = sessionEdgeURL ?? resolvedRemote.remote_entry_url;
100
- // Handle versioned remotes (name@url format)
101
- if (edgeUrl.indexOf('@') !== -1) {
102
- const [, url] = edgeUrl.split('@');
103
- edgeUrl = url;
104
- }
105
- return edgeUrl;
106
- }
107
- /** Default export for use with Module Federation runtime plugins array */
108
- exports.default = createZephyrRuntimePlugin;
109
- //# sourceMappingURL=runtime-plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-plugin.js","sourceRoot":"","sources":["../../src/xpack-extract/runtime-plugin.ts"],"names":[],"mappings":";;AAuBA,8DAyCC;AAzDD,2CAA2C;AAC3C,MAAM,SAAS,GAAG,6BAA6B,CAAC;AAChD,MAAM,OAAO,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC;AAEpE,SAAS,wBAAwB;IAC/B,OAAQ,OAAe,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,wBAAwB,CAAC,OAA4C;IAC3E,OAAe,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,SAAgB,yBAAyB;IACvC,IAAI,gBAA8D,CAAC;IAEnE,sCAAsC;IACtC,IAAI,qBAAqB,GAAG,wBAAwB,EAAE,CAAC;IAEvD,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,qBAAqB,GAAG,mBAAmB,EAAE,CAAC;QAC9C,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IAClD,CAAC;IAED,OAAO;QACL,IAAI,EAAE,gCAAgC;QACtC,KAAK,CAAC,aAAa,CAAC,IAAI;YACtB,MAAM,cAAc,GAAG,MAAM,qBAAqB,CAAC;YAEnD,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACtB,gBAAgB,GAAG,eAAe,CAAC,IAAI,EAAE,cAAc,CAAC,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