zephyr-repack-plugin 0.0.0-canary-20241122013202 → 0.0.0-canary-20241122025316

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 (75) hide show
  1. package/dist/delegate-module/replace-remote-with-delegate.js +2 -2
  2. package/dist/delegate-module/replace-remote-with-delegate.js.map +1 -1
  3. package/dist/delegate-module/zephyr-delegate.d.ts +1 -6
  4. package/dist/delegate-module/zephyr-delegate.js +21 -70
  5. package/dist/delegate-module/zephyr-delegate.js.map +1 -1
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +3 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/lib/build-stats/get-build-stats.d.ts +1 -4
  10. package/dist/lib/build-stats/get-build-stats.js +19 -12
  11. package/dist/lib/build-stats/get-build-stats.js.map +1 -1
  12. package/dist/lib/dependency-resolution/replace-remote-with-delegates.js +7 -7
  13. package/dist/lib/dependency-resolution/replace-remote-with-delegates.js.map +1 -1
  14. package/dist/lib/federation-graph/compute-dependencies.js +10 -6
  15. package/dist/lib/federation-graph/compute-dependencies.js.map +1 -1
  16. package/dist/lib/federation-graph/compute-version.js.map +1 -1
  17. package/dist/lib/federation-graph/federation-plugin.d.ts +16 -11
  18. package/dist/lib/federation-graph/federation-plugin.js +26 -19
  19. package/dist/lib/federation-graph/federation-plugin.js.map +1 -1
  20. package/dist/lib/federation-graph/runtime-requirement.js.map +1 -1
  21. package/dist/lib/federation-graph/utils/convert-dependencies.js.map +1 -1
  22. package/dist/lib/federation-graph/utils/convert-to-graph.d.ts +1 -1
  23. package/dist/lib/federation-graph/utils/convert-to-graph.js +2 -2
  24. package/dist/lib/federation-graph/utils/convert-to-graph.js.map +1 -1
  25. package/dist/lib/federation-graph/utils/converted-dependencies.js.map +1 -1
  26. package/dist/lib/federation-graph/utils/get-licenses.js +3 -1
  27. package/dist/lib/federation-graph/utils/get-licenses.js.map +1 -1
  28. package/dist/lib/federation-graph/utils/module-part-one.d.ts +11 -9
  29. package/dist/lib/federation-graph/utils/module-part-one.js +15 -10
  30. package/dist/lib/federation-graph/utils/module-part-one.js.map +1 -1
  31. package/dist/lib/federation-graph/utils/module-part-two.d.ts +6 -4
  32. package/dist/lib/federation-graph/utils/module-part-two.js +26 -10
  33. package/dist/lib/federation-graph/utils/module-part-two.js.map +1 -1
  34. package/dist/lib/federation-graph/utils/process-function-remotes.d.ts +5 -3
  35. package/dist/lib/federation-graph/utils/process-function-remotes.js.map +1 -1
  36. package/dist/lib/{ze-agent/index.d.ts → repack_zephyr_agent.d.ts} +4 -3
  37. package/dist/lib/repack_zephyr_agent.js +58 -0
  38. package/dist/lib/repack_zephyr_agent.js.map +1 -0
  39. package/dist/lib/set-up-build-id.d.ts +2 -2
  40. package/dist/lib/set-up-build-id.js +11 -18
  41. package/dist/lib/set-up-build-id.js.map +1 -1
  42. package/dist/lib/set-up-build-stats-logging.d.ts +2 -2
  43. package/dist/lib/set-up-build-stats-logging.js +6 -8
  44. package/dist/lib/set-up-build-stats-logging.js.map +1 -1
  45. package/dist/lib/set-up-deploy.d.ts +2 -2
  46. package/dist/lib/set-up-deploy.js +6 -6
  47. package/dist/lib/set-up-deploy.js.map +1 -1
  48. package/dist/lib/utils/federation-plugin-get-package-json.js.map +1 -1
  49. package/dist/lib/utils/get-mf-config.d.ts +5 -2
  50. package/dist/lib/utils/get-mf-config.js +11 -11
  51. package/dist/lib/utils/get-mf-config.js.map +1 -1
  52. package/dist/lib/utils/get-platform.js +3 -1
  53. package/dist/lib/utils/get-platform.js.map +1 -1
  54. package/dist/lib/utils/plugin-search.d.ts +7 -1
  55. package/dist/lib/utils/plugin-search.js +4 -2
  56. package/dist/lib/utils/plugin-search.js.map +1 -1
  57. package/dist/lib/with-zephyr.js +21 -22
  58. package/dist/lib/with-zephyr.js.map +1 -1
  59. package/dist/lib/ze-repack-plugin.d.ts +6 -2
  60. package/dist/lib/ze-repack-plugin.js +2 -13
  61. package/dist/lib/ze-repack-plugin.js.map +1 -1
  62. package/dist/package.json +3 -2
  63. package/dist/type/convert-graph-params.d.ts +20 -5
  64. package/dist/type/federation-plugin-options.d.ts +2 -2
  65. package/dist/type/zephyr-internal-types.d.ts +3 -2
  66. package/package.json +4 -3
  67. package/dist/README.md +0 -3
  68. package/dist/lib/federation-graph/compute-shared-module.d.ts +0 -1
  69. package/dist/lib/federation-graph/compute-shared-module.js +0 -3
  70. package/dist/lib/federation-graph/compute-shared-module.js.map +0 -1
  71. package/dist/lib/ze-agent/index.js +0 -55
  72. package/dist/lib/ze-agent/index.js.map +0 -1
  73. package/dist/lib/ze-agent/lifecycle-events.d.ts +0 -2
  74. package/dist/lib/ze-agent/lifecycle-events.js +0 -20
  75. package/dist/lib/ze-agent/lifecycle-events.js.map +0 -1
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setup_deploy = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const process = tslib_1.__importStar(require("node:process"));
6
- const ze_agent_1 = require("./ze-agent");
7
- const lifecycle_events_1 = require("./ze-agent/lifecycle-events");
8
- const zephyr_edge_contract_1 = require("zephyr-edge-contract");
6
+ const zephyr_agent_1 = require("zephyr-agent");
7
+ const repack_zephyr_agent_1 = require("./repack_zephyr_agent");
8
+ const zephyr_xpack_internal_1 = require("zephyr-xpack-internal");
9
9
  function setup_deploy(pluginOptions, compiler) {
10
- (0, zephyr_edge_contract_1.ze_log)('set up zephyr deploy...');
10
+ (0, zephyr_agent_1.ze_log)('set up zephyr deploy...');
11
11
  const { pluginName } = pluginOptions;
12
12
  compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
13
13
  compilation.hooks.processAssets.tapPromise({
@@ -17,14 +17,14 @@ function setup_deploy(pluginOptions, compiler) {
17
17
  const stats = compilation.getStats();
18
18
  const stats_json = compilation.getStats().toJson();
19
19
  pluginOptions.outputPath = compiler.outputPath;
20
- process.nextTick(ze_agent_1.repack_zephyr_agent, {
20
+ process.nextTick(repack_zephyr_agent_1.repack_zephyr_agent, {
21
21
  stats,
22
22
  stats_json,
23
23
  assets,
24
24
  pluginOptions,
25
25
  });
26
26
  if (!pluginOptions.wait_for_index_html) {
27
- await (0, lifecycle_events_1.onDeploymentDone)();
27
+ await (0, zephyr_xpack_internal_1.onDeploymentDone)();
28
28
  }
29
29
  // empty line to separate logs from other plugins
30
30
  console.log();
@@ -1 +1 @@
1
- {"version":3,"file":"set-up-deploy.js","sourceRoot":"","sources":["../../src/lib/set-up-deploy.ts"],"names":[],"mappings":";;;;AAAA,8DAAwC;AAGxC,yCAAiD;AACjD,kEAA+D;AAC/D,+DAA8C;AAE9C,SAAgB,YAAY,CAAC,aAAkC,EAAE,QAAkB;IACjF,IAAA,6BAAM,EAAC,yBAAyB,CAAC,CAAC;IAClC,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IACrC,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,UAAU;YAChB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,2BAA2B;SAChE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC;YAEnD,aAAa,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;YAE/C,OAAO,CAAC,QAAQ,CAAC,8BAAmB,EAAE;gBACpC,KAAK;gBACL,UAAU;gBACV,MAAM;gBACN,aAAa;aACd,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC;gBACvC,MAAM,IAAA,mCAAgB,GAAE,CAAC;YAC3B,CAAC;YAED,iDAAiD;YACjD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AA/BD,oCA+BC"}
1
+ {"version":3,"file":"set-up-deploy.js","sourceRoot":"","sources":["../../src/lib/set-up-deploy.ts"],"names":[],"mappings":";;;;AAAA,8DAAwC;AAExC,+CAAsC;AAEtC,+DAA4D;AAC5D,iEAAyD;AAEzD,SAAgB,YAAY,CAC1B,aAAwC,EACxC,QAAkB;IAElB,IAAA,qBAAM,EAAC,yBAAyB,CAAC,CAAC;IAClC,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IACrC,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,UAAU;YAChB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,2BAA2B;SAChE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC;YAEnD,aAAa,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;YAE/C,OAAO,CAAC,QAAQ,CAAC,yCAAmB,EAAE;gBACpC,KAAK;gBACL,UAAU;gBACV,MAAM;gBACN,aAAa;aACd,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC;gBACvC,MAAM,IAAA,wCAAgB,GAAE,CAAC;YAC3B,CAAC;YAED,iDAAiD;YACjD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAlCD,oCAkCC"}
@@ -1 +1 @@
1
- {"version":3,"file":"federation-plugin-get-package-json.js","sourceRoot":"","sources":["../../../src/lib/utils/federation-plugin-get-package-json.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAsC;AAE/B,MAAM,iBAAiB,GAAG,CAAC,QAA8B,EAAuB,EAAE;IACvF,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO;IACT,CAAC;IACD,IAAI,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,QAAQ,CAAC,IAAI,CAAC,eAAG,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QACzD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,QAAQ,CAAC,IAAI,CAAC,eAAG,CAAC,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;YAC7E,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,GAAG,EAAE,CAAC;IACf,OAAO,IAAA,yBAAiB,EAAC,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAdW,QAAA,iBAAiB,qBAc5B"}
1
+ {"version":3,"file":"federation-plugin-get-package-json.js","sourceRoot":"","sources":["../../../src/lib/utils/federation-plugin-get-package-json.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAsC;AAE/B,MAAM,iBAAiB,GAAG,CAC/B,QAA8B,EACT,EAAE;IACvB,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO;IACT,CAAC;IACD,IAAI,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,QAAQ,CAAC,IAAI,CAAC,eAAG,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QACzD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,QAAQ,CAAC,IAAI,CAAC,eAAG,CAAC,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;YAC7E,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,GAAG,EAAE,CAAC;IACf,OAAO,IAAA,yBAAiB,EAAC,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAhBW,QAAA,iBAAiB,qBAgB5B"}
@@ -1,6 +1,9 @@
1
1
  import { Configuration } from '@rspack/core';
2
2
  import { ZephyrPluginOptions } from 'zephyr-edge-contract';
3
3
  type MfConfig = ZephyrPluginOptions['mfConfig'];
4
- /** Note that this is only usable when Repack.plugins.ModuleFederationPlugin is used on user's side */
5
- export declare function get_copy_of_mf_configs(config: Configuration): MfConfig | Array<MfConfig>;
4
+ /**
5
+ * Note that this is only usable when Repack.plugins.ModuleFederationPlugin is used on
6
+ * user's side
7
+ */
8
+ export declare function get_copy_of_mf_configs(config: Configuration): MfConfig[] | undefined;
6
9
  export {};
@@ -2,23 +2,23 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.get_copy_of_mf_configs = void 0;
4
4
  const plugin_search_1 = require("./plugin-search");
5
- /** Note that this is only usable when Repack.plugins.ModuleFederationPlugin is used on user's side */
5
+ /**
6
+ * Note that this is only usable when Repack.plugins.ModuleFederationPlugin is used on
7
+ * user's side
8
+ */
6
9
  function get_copy_of_mf_configs(config) {
7
- return (config.plugins
10
+ return config.plugins
8
11
  ?.filter(plugin_search_1.is_module_federation_plugin)
9
- .map((mf) => {
12
+ .map((plugin) => {
10
13
  // Then check if `mf` is present because Repack's ModuleFederationPlugin exposes the config under `config`
11
- if (mf) {
12
- const config = JSON.parse(JSON.stringify(mf)).config;
13
- // We are doing this because the filename in React Native is the actual JS bundle, the filename would be at the end of the URL. It's a trade-off for now.
14
- config.bundle_name = config.filename;
15
- return config;
16
- }
14
+ const config = JSON.parse(JSON.stringify(plugin)).config;
15
+ // We are doing this because the filename in React Native is the actual JS bundle, the filename would be at the end of the URL. It's a trade-off for now.
16
+ config.bundle_name = config.filename;
17
+ return config;
17
18
  // If mf is not present, return undefined
18
- return;
19
19
  })
20
20
  // Filter out any undefined values that were returned when mf was not present
21
- .filter(Boolean));
21
+ .filter(Boolean);
22
22
  }
23
23
  exports.get_copy_of_mf_configs = get_copy_of_mf_configs;
24
24
  //# sourceMappingURL=get-mf-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-mf-config.js","sourceRoot":"","sources":["../../../src/lib/utils/get-mf-config.ts"],"names":[],"mappings":";;;AACA,mDAA8D;AAK9D,sGAAsG;AACtG,SAAgB,sBAAsB,CAAC,MAAqB;IAC1D,OAAO,CACL,MAAM,CAAC,OAAO;QACZ,EAAE,MAAM,CAAC,2CAA2B,CAAC;SACpC,GAAG,CAAC,CAAC,EAAW,EAAE,EAAE;QACnB,0GAA0G;QAC1G,IAAI,EAAE,EAAE,CAAC;YACP,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;YACrD,yJAAyJ;YACzJ,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC;YAErC,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,yCAAyC;QACzC,OAAO;IACT,CAAC,CAAC;QACF,6EAA6E;SAC5E,MAAM,CAAC,OAAO,CAAC,CACnB,CAAC;AACJ,CAAC;AAnBD,wDAmBC"}
1
+ {"version":3,"file":"get-mf-config.js","sourceRoot":"","sources":["../../../src/lib/utils/get-mf-config.ts"],"names":[],"mappings":";;;AACA,mDAA8D;AAK9D;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,MAAqB;IAC1D,OACE,MAAM,CAAC,OAAO;QACZ,EAAE,MAAM,CAAC,2CAA2B,CAAC;SACpC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,0GAA0G;QAC1G,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;QACzD,yJAAyJ;QACzJ,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC;QAErC,OAAO,MAAM,CAAC;QACd,yCAAyC;IAC3C,CAAC,CAAC;QACF,6EAA6E;SAC5E,MAAM,CAAC,OAAO,CAClB,CAAC;AACJ,CAAC;AAhBD,wDAgBC"}
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.get_platform_from_repack = void 0;
4
4
  const plugin_search_1 = require("./plugin-search");
5
5
  function get_platform_from_repack(config) {
6
- return config.plugins?.filter(plugin_search_1.is_repack_plugin)?.map((plugin) => plugin.config.platform)[0];
6
+ return config.plugins
7
+ ?.filter(plugin_search_1.is_repack_plugin)
8
+ ?.map((plugin) => plugin.config.platform)[0];
7
9
  }
8
10
  exports.get_platform_from_repack = get_platform_from_repack;
9
11
  //# sourceMappingURL=get-platform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-platform.js","sourceRoot":"","sources":["../../../src/lib/utils/get-platform.ts"],"names":[],"mappings":";;;AACA,mDAAmD;AAKnD,SAAgB,wBAAwB,CAAC,MAAqB;IAC5D,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,gCAAgB,CAAC,EAAE,GAAG,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACnG,CAAC;AAFD,4DAEC"}
1
+ {"version":3,"file":"get-platform.js","sourceRoot":"","sources":["../../../src/lib/utils/get-platform.ts"],"names":[],"mappings":";;;AACA,mDAAmD;AAKnD,SAAgB,wBAAwB,CAAC,MAAqB;IAC5D,OAAO,MAAM,CAAC,OAAO;QACnB,EAAE,MAAM,CAAC,gCAAgB,CAAC;QAC1B,EAAE,GAAG,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAJD,4DAIC"}
@@ -1,5 +1,11 @@
1
1
  import { Configuration } from '@rspack/core';
2
+ import { plugins } from '@callstack/repack';
3
+ import type { ModuleFederationPluginV1Config } from '@callstack/repack/dist/plugins/ModuleFederationPluginV1';
2
4
  type Plugin = NonNullable<Configuration['plugins']>[number];
3
- export declare function is_module_federation_plugin(plugin?: Plugin): any;
5
+ export declare function is_module_federation_plugin(plugin?: Plugin): plugin is plugins.ModuleFederationPlugin & {
6
+ config: ModuleFederationPluginV1Config & {
7
+ bundle_name?: string;
8
+ };
9
+ };
4
10
  export declare function is_repack_plugin(plugin?: Plugin): any;
5
11
  export {};
@@ -4,14 +4,16 @@ exports.is_repack_plugin = exports.is_module_federation_plugin = void 0;
4
4
  function is_module_federation_plugin(plugin) {
5
5
  if (!plugin || typeof plugin !== 'object')
6
6
  return false;
7
- return plugin.constructor.name.includes('ModuleFederationPlugin') || plugin['name']?.includes('ModuleFederationPlugin');
7
+ return (plugin.constructor.name.includes('ModuleFederationPlugin') ||
8
+ plugin['name']?.includes('ModuleFederationPlugin'));
8
9
  }
9
10
  exports.is_module_federation_plugin = is_module_federation_plugin;
10
11
  function is_repack_plugin(plugin) {
11
12
  if (!plugin || typeof plugin !== 'object') {
12
13
  return false;
13
14
  }
14
- return plugin.constructor.name.includes('RepackPlugin') || plugin['name']?.includes('RepackPlugin');
15
+ return (plugin.constructor.name.includes('RepackPlugin') ||
16
+ plugin['name']?.includes('RepackPlugin'));
15
17
  }
16
18
  exports.is_repack_plugin = is_repack_plugin;
17
19
  //# sourceMappingURL=plugin-search.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-search.js","sourceRoot":"","sources":["../../../src/lib/utils/plugin-search.ts"],"names":[],"mappings":";;;AAIA,SAAgB,2BAA2B,CAAC,MAAe;IACzD,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAExD,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAC;AAC1H,CAAC;AAJD,kEAIC;AAED,SAAgB,gBAAgB,CAAC,MAAe;IAC9C,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;AACtG,CAAC;AALD,4CAKC"}
1
+ {"version":3,"file":"plugin-search.js","sourceRoot":"","sources":["../../../src/lib/utils/plugin-search.ts"],"names":[],"mappings":";;;AAMA,SAAgB,2BAA2B,CACzC,MAAe;IAIf,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAExD,OAAO,CACL,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAC1D,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CACnD,CAAC;AACJ,CAAC;AAXD,kEAWC;AAED,SAAgB,gBAAgB,CAAC,MAAe;IAC9C,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CACL,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CACzC,CAAC;AACJ,CAAC;AARD,4CAQC"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withZephyr = void 0;
4
- const zephyr_edge_contract_1 = require("zephyr-edge-contract");
5
4
  const zephyr_agent_1 = require("zephyr-agent");
6
5
  const replace_remote_with_delegates_1 = require("./dependency-resolution/replace-remote-with-delegates");
7
6
  const ze_repack_plugin_1 = require("./ze-repack-plugin");
@@ -9,39 +8,39 @@ const get_platform_1 = require("./utils/get-platform");
9
8
  const get_mf_config_1 = require("./utils/get-mf-config");
10
9
  function withZephyr(_zephyrOptions) {
11
10
  return async function configure(config) {
12
- const execution_dir_path = config.context;
13
- (0, zephyr_edge_contract_1.ze_log)('Configuring with Zephyr...');
11
+ // create instance of ZephyrEngine to track the application
12
+ const zephyr_engine = await zephyr_agent_1.ZephyrEngine.create(config.context);
13
+ (0, zephyr_agent_1.ze_log)('Configuring with Zephyr...');
14
14
  // whether it is CI environment is handled in zephyr-agent
15
- const [packageJson, gitInfo, target] = await Promise.all([
16
- (0, zephyr_agent_1.getPackageJson)(execution_dir_path),
17
- (0, zephyr_agent_1.getGitInfo)(),
18
- (0, get_platform_1.get_platform_from_repack)(config),
19
- ]);
15
+ const target = (0, get_platform_1.get_platform_from_repack)(config);
20
16
  await (0, replace_remote_with_delegates_1.replace_remote_with_delegates)(config, {
21
- org: gitInfo.app.org,
22
- project: gitInfo.app.project,
17
+ org: zephyr_engine.gitProperties.app.org,
18
+ project: zephyr_engine.gitProperties.app.project,
23
19
  target,
24
20
  });
25
- (0, zephyr_edge_contract_1.ze_log)('dependency resolution completed successfully...or at least trying to...');
21
+ (0, zephyr_agent_1.ze_log)('dependency resolution completed successfully...or at least trying to...');
26
22
  // TODO: there might be multiple mf configs and we need to have remote entry for each of them
27
23
  const mf_configs = (0, get_mf_config_1.get_copy_of_mf_configs)(config);
28
- const application_uid = (0, zephyr_edge_contract_1.createApplicationUID)({
29
- org: gitInfo.app.org,
30
- project: gitInfo.app.project,
31
- name: packageJson?.name,
32
- });
33
- (0, zephyr_edge_contract_1.ze_log)('Application uid created...');
24
+ const application_uid = zephyr_engine.application_uid;
25
+ // const app_config = await zephyr_engine.application_configuration;
26
+ // Verify Module Federation configuration's naming
27
+ // verify_mf_config(mf_configs, app_config.PLATFORM);
28
+ // Verify Fastly configuration's naming + application_uid
29
+ // todo: @lois to fix this
30
+ // verify_fastly_config(mf_configs, zephyr_engine);
31
+ (0, zephyr_agent_1.ze_log)('Application uid created...');
34
32
  config.plugins?.push(new ze_repack_plugin_1.ZeRepackPlugin({
33
+ zephyr_engine,
35
34
  application_uid,
36
35
  app: {
37
- name: packageJson.name,
38
- version: packageJson.version,
39
- org: gitInfo.app.org,
40
- project: gitInfo.app.project,
36
+ name: zephyr_engine.npmProperties.name,
37
+ version: zephyr_engine.npmProperties.version,
38
+ org: zephyr_engine.gitProperties.app.org,
39
+ project: zephyr_engine.gitProperties.app.project,
41
40
  },
42
41
  target,
43
42
  upload_file: _zephyrOptions?.upload_file ?? true,
44
- git: gitInfo?.git,
43
+ git: zephyr_engine.gitProperties?.git,
45
44
  mfConfig: Array.isArray(mf_configs) ? mf_configs[0] : mf_configs,
46
45
  // wait_for_bundle: "" //TODO there is index.bundle need to wait for but ignore for now
47
46
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/lib/with-zephyr.ts"],"names":[],"mappings":";;;AAAA,+DAAgH;AAGhH,+CAA0D;AAC1D,yGAAsG;AACtG,yDAAoD;AACpD,uDAAgE;AAChE,yDAA+D;AAG/D,SAAgB,UAAU,CAAC,cAAoC;IAC7D,OAAO,KAAK,UAAU,SAAS,CAAC,MAAqB;QACnD,MAAM,kBAAkB,GAAG,MAAM,C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eAAe;YACf,GAAG,EAAE;gBACH,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC,IAAI;gBACtC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,OAAO;gBAC5C,GAAG,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG;gBACxC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO;aACjD;YACD,MAAM;YACN,WAAW,EAAE,cAAc,EAAE,WAAW,IAAI,IAAI;YAChD,GAAG,EAAE,aAAa,CAAC,aAAa,EAAE,GAAG;YACrC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU;YAChE,wFAAwF;SACzF,CAAC,CACH,CAAC;QAEF,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAlDD,gCAkDC"}
@@ -1,7 +1,11 @@
1
1
  import { ZephyrPluginOptions } from 'zephyr-edge-contract';
2
2
  import { Compiler } from '@rspack/core';
3
+ import { ZephyrEngine } from 'zephyr-agent';
4
+ export interface ZephyrRepackPluginOptions extends Omit<ZephyrPluginOptions, 'isCI' | 'buildEnv' | 'username' | 'zeConfig'> {
5
+ zephyr_engine: ZephyrEngine;
6
+ }
3
7
  export declare class ZeRepackPlugin {
4
- _options: ZephyrPluginOptions;
5
- constructor(options?: {});
8
+ _options: ZephyrRepackPluginOptions;
9
+ constructor(options: Omit<ZephyrRepackPluginOptions, 'pluginName'>);
6
10
  apply(compiler: Compiler): void;
7
11
  }
@@ -1,24 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZeRepackPlugin = void 0;
4
- const tslib_1 = require("tslib");
5
- const isCI = tslib_1.__importStar(require("is-ci"));
6
4
  const set_up_build_id_1 = require("./set-up-build-id");
7
5
  const set_up_build_stats_logging_1 = require("./set-up-build-stats-logging");
8
6
  const set_up_deploy_1 = require("./set-up-deploy");
9
7
  const pluginName = 'ZephyrRepackPlugin';
10
- const default_zephyr_repack_options = {
11
- pluginName,
12
- isCI,
13
- buildEnv: isCI ? 'ci' : 'local',
14
- zeConfig: {},
15
- app: {},
16
- git: {},
17
- };
18
8
  class ZeRepackPlugin {
19
- constructor(options = {}) {
20
- this._options = default_zephyr_repack_options;
21
- this._options = Object.assign(this._options, options ?? {});
9
+ constructor(options) {
10
+ this._options = Object.assign({ pluginName }, options);
22
11
  }
23
12
  apply(compiler) {
24
13
  (0, set_up_build_id_1.setupZephyrConfig)(this._options, compiler);
@@ -1 +1 @@
1
- {"version":3,"file":"ze-repack-plugin.js","sourceRoot":"","sources":["../../src/lib/ze-repack-plugin.ts"],"names":[],"mappings":";;;;AAAA,oDAA8B;AAG9B,uDAA+D;AAC/D,6EAA+D;AAC/D,mDAA+C;AAC/C,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,MAAM,6BAA6B,GAAG;IACpC,UAAU;IACV,IAAI;IACJ,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;IAC/B,QAAQ,EAAE,EAAE;IACZ,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;CACR,CAAC;AAEF,MAAa,cAAc;IAGzB,YAAY,OAAO,GAAG,EAAE;QAFxB,aAAQ,GAAG,6BAAoD,CAAC;QAG9D,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,IAAA,mCAAK,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC/B,IAAA,4CAAe,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACzC,IAAA,4BAAY,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;CACF;AAZD,wCAYC"}
1
+ {"version":3,"file":"ze-repack-plugin.js","sourceRoot":"","sources":["../../src/lib/ze-repack-plugin.ts"],"names":[],"mappings":";;;AAEA,uDAA+D;AAC/D,6EAA+D;AAC/D,mDAA+C;AAG/C,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAOxC,MAAa,cAAc;IAGzB,YAAY,OAAsD;QAChE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,IAAA,mCAAK,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC/B,IAAA,4CAAe,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACzC,IAAA,4BAAY,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;CACF;AAZD,wCAYC"}
package/dist/package.json CHANGED
@@ -11,8 +11,9 @@
11
11
  "patch-version": "pnpm version"
12
12
  },
13
13
  "dependencies": {
14
- "zephyr-agent": "0.0.0-canary-20241121193105",
15
- "zephyr-edge-contract": "0.0.0-canary-20241121193105"
14
+ "zephyr-agent": "0.0.30",
15
+ "zephyr-edge-contract": "0.0.30",
16
+ "zephyr-xpack-internal": "0.0.30"
16
17
  },
17
18
  "devDependencies": {
18
19
  "@callstack/repack": "5.0.0-rc.0",
@@ -13,9 +13,15 @@ export interface ConvertToGraphParams {
13
13
  * // TODO: in MF2 should it be js.bundle or mf-manifest.json?
14
14
  */
15
15
  federationRemoteEntry: StatsChunk | undefined;
16
- /** Module compilation results return from getStats(), typically includes all chunks and modules needed for the build */
16
+ /**
17
+ * Module compilation results return from getStats(), typically includes all chunks and
18
+ * modules needed for the build
19
+ */
17
20
  modules?: StatsModule[];
18
- /** Shared packages in package.json, an Object of Record<string, any>, could be `dependencies`, `devDependencies` or `optionalDependencies` */
21
+ /**
22
+ * Shared packages in package.json, an Object of Record<string, any>, could be
23
+ * `dependencies`, `devDependencies` or `optionalDependencies`
24
+ */
19
25
  topLevelPackage: TopLevelPackage;
20
26
  /** PublicPath from getStats().toJson() */
21
27
  publicPath?: string;
@@ -27,9 +33,15 @@ export interface ConvertToGraphParams {
27
33
  };
28
34
  };
29
35
  versionData?: never;
30
- /** Either `development` or other development enviornment (`production`), default to `development` if not specified */
36
+ /**
37
+ * Either `development` or other development enviornment (`production`), default to
38
+ * `development` if not specified
39
+ */
31
40
  environment?: string;
32
- /** Computed version based on file hash and _options.versionStrategy //TODO: this is git sha atm need to fix and whink what would be here */
41
+ /**
42
+ * Computed version based on file hash and _options.versionStrategy //TODO: this is git
43
+ * sha atm need to fix and whink what would be here
44
+ */
33
45
  version?: string;
34
46
  /** Date.now() if not specified */
35
47
  posted?: Date;
@@ -41,7 +53,10 @@ export interface ConvertToGraphParams {
41
53
  sha?: string;
42
54
  /** GetStats()'s hash */
43
55
  buildHash?: string;
44
- /** Include referenced chunks in a remote, if the host app doesn't expose anything it will be empty */
56
+ /**
57
+ * Include referenced chunks in a remote, if the host app doesn't expose anything it
58
+ * will be empty
59
+ */
45
60
  chunkDependencies: unknown;
46
61
  /** 'ios' | 'android' | 'web' | undefined */
47
62
  target?: 'ios' | 'android' | 'web' | undefined;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Stats, StatsCompilation } from '@rspack/core';
3
- import { ZephyrPluginOptions } from 'zephyr-edge-contract';
3
+ import { ZephyrRepackPluginOptions } from '../lib/ze-repack-plugin';
4
4
  export interface FederationDashboardPluginOptions {
5
5
  app?: {
6
6
  org: string;
@@ -51,7 +51,7 @@ interface ExposesConfig {
51
51
  export interface ProcessRspackGraphParams {
52
52
  stats: Stats;
53
53
  stats_json: StatsCompilation;
54
- pluginOptions: ZephyrPluginOptions;
54
+ pluginOptions: ZephyrRepackPluginOptions;
55
55
  }
56
56
  export interface TopLevelPackage {
57
57
  dependencies?: Record<string, string>;
@@ -1,6 +1,7 @@
1
1
  import { Configuration } from '@rspack/core';
2
2
  import type { Stats, StatsCompilation } from '@rspack/core';
3
- import { ZephyrPluginOptions, Source } from 'zephyr-edge-contract';
3
+ import { Source } from 'zephyr-edge-contract';
4
+ import { ZephyrRepackPluginOptions } from '../lib/ze-repack-plugin';
4
5
  export interface DelegateConfig {
5
6
  org: string;
6
7
  project: string;
@@ -18,6 +19,6 @@ export interface ResolvedDependency {
18
19
  export interface ZephyrAgentProps {
19
20
  stats: Stats;
20
21
  stats_json: StatsCompilation;
21
- pluginOptions: ZephyrPluginOptions;
22
+ pluginOptions: ZephyrRepackPluginOptions;
22
23
  assets: Record<string, Source>;
23
24
  }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "zephyr-repack-plugin",
3
- "version": "0.0.0-canary-20241122013202",
3
+ "version": "0.0.0-canary-20241122025316",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "type": "commonjs",
8
8
  "dependencies": {
9
- "zephyr-agent": "0.0.0-canary-20241121193105",
10
- "zephyr-edge-contract": "0.0.0-canary-20241121193105"
9
+ "zephyr-agent": "0.0.30",
10
+ "zephyr-edge-contract": "0.0.30",
11
+ "zephyr-xpack-internal": "0.0.30"
11
12
  },
12
13
  "devDependencies": {
13
14
  "@callstack/repack": "5.0.0-rc.0",
package/dist/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Zephyr: We made application federation easy
2
-
3
- Readme too be released
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=compute-shared-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compute-shared-module.js","sourceRoot":"","sources":["../../../src/lib/federation-graph/compute-shared-module.ts"],"names":[],"mappings":""}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.repack_zephyr_agent = void 0;
4
- const zephyr_agent_1 = require("zephyr-agent");
5
- const zephyr_edge_contract_1 = require("zephyr-edge-contract");
6
- const get_build_stats_1 = require("../build-stats/get-build-stats");
7
- const lifecycle_events_1 = require("./lifecycle-events");
8
- const zephyr_agent_2 = require("zephyr-agent");
9
- async function repack_zephyr_agent({ stats, stats_json, assets, pluginOptions }) {
10
- (0, zephyr_edge_contract_1.ze_log)('zephyr agent started.');
11
- if (!pluginOptions.application_uid || !pluginOptions.zeConfig.buildId) {
12
- (0, lifecycle_events_1.emitDeploymentDone)();
13
- return;
14
- }
15
- const application_uid = pluginOptions.application_uid;
16
- const [appConfig, hash_set] = await Promise.all([(0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }), (0, zephyr_agent_1.get_hash_list)(application_uid)]);
17
- const { EDGE_URL, PLATFORM } = appConfig;
18
- const zeStart = Date.now();
19
- const assetsMap = await (0, zephyr_agent_1.zeBuildAssetsMap)(pluginOptions, assets);
20
- const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
21
- if (pluginOptions.upload_file) {
22
- try {
23
- (0, zephyr_edge_contract_1.ze_log)('Started uploading...');
24
- await (0, zephyr_agent_1.upload)({
25
- pluginOptions,
26
- assets: {
27
- assetsMap,
28
- missingAssets,
29
- outputPath: pluginOptions.outputPath,
30
- count: Object.keys(assets).length,
31
- },
32
- getDashData: () => (0, get_build_stats_1.getBuildStats)({
33
- stats,
34
- stats_json,
35
- assets,
36
- pluginOptions,
37
- // DOMAIN,
38
- EDGE_URL,
39
- PLATFORM,
40
- //TYPE,
41
- }),
42
- appConfig,
43
- zeStart,
44
- });
45
- }
46
- catch (err) {
47
- (0, zephyr_agent_2.logFn)('error', zephyr_edge_contract_1.ZephyrError.format(err));
48
- }
49
- finally {
50
- (0, lifecycle_events_1.emitDeploymentDone)();
51
- }
52
- }
53
- }
54
- exports.repack_zephyr_agent = repack_zephyr_agent;
55
-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,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;iBAClC;gBACD,WAAW,EAAE,GAAG,EAAE,CAChB,IAAA,+BAAa,EAAC;oBACZ,KAAK;oBACL,UAAU;oBACV,MAAM;oBACN,aAAa;oBACb,UAAU;oBACV,QAAQ;oBACR,QAAQ;oBACR,OAAO;iBACR,CAAC;gBACJ,SAAS;gBACT,OAAO;aACR,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAA,oBAAK,EAAC,OAAO,EAAE,kCAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1C,CAAC;gBAAS,CAAC;YACT,IAAA,qCAAkB,GAAE,CAAC;QACvB,CAAC;IACH,CAAC;AAEH,CAAC;AAjDD,kDAiDC"}
@@ -1,2 +0,0 @@
1
- export declare function emitDeploymentDone(): void;
2
- export declare function onDeploymentDone(): Promise<string>;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.onDeploymentDone = exports.emitDeploymentDone = void 0;
4
- const node_events_1 = require("node:events");
5
- const zephyr_edge_contract_1 = require("zephyr-edge-contract");
6
- const _lifecycle_events = new node_events_1.EventEmitter();
7
- const _deployment_done = 'deployment-done';
8
- function emitDeploymentDone() {
9
- (0, zephyr_edge_contract_1.ze_log)('Deployment done');
10
- _lifecycle_events.emit(_deployment_done);
11
- }
12
- exports.emitDeploymentDone = emitDeploymentDone;
13
- async function onDeploymentDone() {
14
- return new Promise((resolve) => {
15
- (0, zephyr_edge_contract_1.ze_log)('Waiting for deployment done');
16
- _lifecycle_events.once(_deployment_done, resolve);
17
- });
18
- }
19
- exports.onDeploymentDone = onDeploymentDone;
20
- //# sourceMappingURL=lifecycle-events.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lifecycle-events.js","sourceRoot":"","sources":["../../../src/lib/ze-agent/lifecycle-events.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,+DAA8C;AAE9C,MAAM,iBAAiB,GAAG,IAAI,0BAAY,EAAE,CAAC;AAE7C,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAE3C,SAAgB,kBAAkB;IAChC,IAAA,6BAAM,EAAC,iBAAiB,CAAC,CAAC;IAC1B,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAC3C,CAAC;AAHD,gDAGC;AAEM,KAAK,UAAU,gBAAgB;IACpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAA,6BAAM,EAAC,6BAA6B,CAAC,CAAC;QACtC,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC;AALD,4CAKC"}