vite-plugin-zephyr 0.0.26 → 0.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist/lib/internal/extract/extract_vite_assets_map.d.ts +3 -0
  4. package/dist/lib/internal/extract/extract_vite_assets_map.js +31 -0
  5. package/dist/lib/internal/extract/extract_vite_assets_map.js.map +1 -0
  6. package/dist/lib/internal/extract/load_public_dir.js.map +1 -0
  7. package/dist/lib/internal/extract/load_static_assets.d.ts +3 -0
  8. package/dist/lib/internal/extract/load_static_assets.js +26 -0
  9. package/dist/lib/internal/extract/load_static_assets.js.map +1 -0
  10. package/dist/lib/internal/extract/load_static_entries.js.map +1 -0
  11. package/dist/lib/internal/mf-vite-etl/extract-mf-vite-remotes.d.ts +2 -0
  12. package/dist/lib/internal/mf-vite-etl/extract-mf-vite-remotes.js +18 -0
  13. package/dist/lib/internal/mf-vite-etl/extract-mf-vite-remotes.js.map +1 -0
  14. package/dist/lib/internal/mf-vite-etl/load_resolved_remotes.d.ts +2 -0
  15. package/dist/lib/internal/mf-vite-etl/load_resolved_remotes.js +27 -0
  16. package/dist/lib/internal/mf-vite-etl/load_resolved_remotes.js.map +1 -0
  17. package/dist/lib/{remote_map_parser.d.ts → internal/mf-vite-etl/remote_map_parser.d.ts} +2 -2
  18. package/dist/lib/{remote_map_parser.js → internal/mf-vite-etl/remote_map_parser.js} +12 -10
  19. package/dist/lib/internal/mf-vite-etl/remote_map_parser.js.map +1 -0
  20. package/dist/lib/{zephyr-internal-options.d.ts → internal/types/zephyr-internal-options.d.ts} +3 -1
  21. package/dist/lib/internal/types/zephyr-internal-options.js.map +1 -0
  22. package/dist/lib/vite-plugin-zephyr-partial.d.ts +1 -1
  23. package/dist/lib/vite-plugin-zephyr-partial.js +24 -138
  24. package/dist/lib/vite-plugin-zephyr-partial.js.map +1 -1
  25. package/dist/lib/vite-plugin-zephyr.d.ts +2 -2
  26. package/dist/lib/vite-plugin-zephyr.js +31 -150
  27. package/dist/lib/vite-plugin-zephyr.js.map +1 -1
  28. package/dist/package.json +2 -3
  29. package/package.json +2 -3
  30. package/dist/lib/load_extra_files_from_dist.d.ts +0 -8
  31. package/dist/lib/load_extra_files_from_dist.js +0 -37
  32. package/dist/lib/load_extra_files_from_dist.js.map +0 -1
  33. package/dist/lib/load_public_dir.js.map +0 -1
  34. package/dist/lib/load_static_entries.js.map +0 -1
  35. package/dist/lib/remote_map_parser.js.map +0 -1
  36. package/dist/lib/resolve_remote_dependency.d.ts +0 -10
  37. package/dist/lib/resolve_remote_dependency.js +0 -30
  38. package/dist/lib/resolve_remote_dependency.js.map +0 -1
  39. package/dist/lib/types/zephyr-internal-options.d.ts +0 -11
  40. package/dist/lib/types/zephyr-internal-options.js.map +0 -1
  41. package/dist/lib/zephyr-internal-options.js +0 -3
  42. package/dist/lib/zephyr-internal-options.js.map +0 -1
  43. /package/dist/lib/{load_public_dir.d.ts → internal/extract/load_public_dir.d.ts} +0 -0
  44. /package/dist/lib/{load_public_dir.js → internal/extract/load_public_dir.js} +0 -0
  45. /package/dist/lib/{load_static_entries.d.ts → internal/extract/load_static_entries.d.ts} +0 -0
  46. /package/dist/lib/{load_static_entries.js → internal/extract/load_static_entries.js} +0 -0
  47. /package/dist/lib/{types → internal/types}/zephyr-internal-options.js +0 -0
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { withZephyr } from './lib/vite-plugin-zephyr';
1
+ export { withZephyr, type ModuleFederationOptions } from './lib/vite-plugin-zephyr';
2
2
  export { withZephyrPartial } from './lib/vite-plugin-zephyr-partial';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAsD;AAA7C,gHAAA,UAAU,OAAA;AACnB,+EAAqE;AAA5D,+HAAA,iBAAiB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAoF;AAA3E,gHAAA,UAAU,OAAA;AACnB,+EAAqE;AAA5D,+HAAA,iBAAiB,OAAA"}
@@ -0,0 +1,3 @@
1
+ import { ZeBuildAssetsMap, ZephyrEngine } from 'zephyr-agent';
2
+ import type { ZephyrInternalOptions } from '../types/zephyr-internal-options';
3
+ export declare function extract_vite_assets_map(zephyr_engine: ZephyrEngine, vite_internal_options: ZephyrInternalOptions): Promise<ZeBuildAssetsMap>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extract_vite_assets_map = void 0;
4
+ const zephyr_agent_1 = require("zephyr-agent");
5
+ const load_static_assets_1 = require("./load_static_assets");
6
+ async function extract_vite_assets_map(zephyr_engine, vite_internal_options) {
7
+ const application_uid = zephyr_engine.application_uid;
8
+ const assets = await (0, load_static_assets_1.loadStaticAssets)(vite_internal_options);
9
+ const partialAssetMap = await (0, zephyr_agent_1.getPartialAssetMap)(application_uid);
10
+ await (0, zephyr_agent_1.removePartialAssetMap)(application_uid);
11
+ const runtime_assets = vite_internal_options.assets;
12
+ const complete_assets = Object.assign({}, assets, ...Object.values(partialAssetMap !== null && partialAssetMap !== void 0 ? partialAssetMap : {}), runtime_assets);
13
+ return (0, zephyr_agent_1.buildAssetsMap)(complete_assets, extractBuffer, getAssetType);
14
+ }
15
+ exports.extract_vite_assets_map = extract_vite_assets_map;
16
+ function getAssetType(asset) {
17
+ return asset.type;
18
+ }
19
+ function extractBuffer(asset) {
20
+ switch (asset.type) {
21
+ case 'chunk':
22
+ return asset.code;
23
+ case 'asset':
24
+ return typeof asset.source === 'string'
25
+ ? asset.source
26
+ : new TextDecoder().decode(asset.source);
27
+ default:
28
+ return void 0;
29
+ }
30
+ }
31
+ //# sourceMappingURL=extract_vite_assets_map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract_vite_assets_map.js","sourceRoot":"","sources":["../../../../src/lib/internal/extract/extract_vite_assets_map.ts"],"names":[],"mappings":";;;AAAA,+CAMsB;AAEtB,6DAAwD;AAGjD,KAAK,UAAU,uBAAuB,CAC3C,aAA2B,EAC3B,qBAA4C;IAE5C,MAAM,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IACtD,MAAM,MAAM,GAAG,MAAM,IAAA,qCAAgB,EAAC,qBAAqB,CAAC,CAAC;IAC7D,MAAM,eAAe,GAAG,MAAM,IAAA,iCAAkB,EAAC,eAAe,CAAC,CAAC;IAClE,MAAM,IAAA,oCAAqB,EAAC,eAAe,CAAC,CAAC;IAE7C,MAAM,cAAc,GAAG,qBAAqB,CAAC,MAAM,CAAC;IACpD,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CACnC,EAAE,EACF,MAAM,EACN,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,EAAE,CAAC,EACvC,cAAc,CACf,CAAC;IACF,OAAO,IAAA,6BAAc,EAAC,eAAe,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;AACtE,CAAC;AAjBD,0DAiBC;AAED,SAAS,YAAY,CAAC,KAAgC;IACpD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,SAAS,aAAa,CAAC,KAAgC;IACrD,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,KAAK,CAAC,IAAI,CAAC;QACpB,KAAK,OAAO;YACV,OAAO,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;gBACrC,CAAC,CAAC,KAAK,CAAC,MAAM;gBACd,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C;YACE,OAAO,KAAK,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load_public_dir.js","sourceRoot":"","sources":["../../../../src/lib/internal/extract/load_public_dir.ts"],"names":[],"mappings":";;;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C;AACtB,CAAC;AA9BD,0CA8BC"}
@@ -0,0 +1,3 @@
1
+ import type { OutputBundle } from 'rollup';
2
+ import type { ZephyrInternalOptions } from '../types/zephyr-internal-options';
3
+ export declare function loadStaticAssets(vite_internal_options: ZephyrInternalOptions): Promise<OutputBundle>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadStaticAssets = void 0;
4
+ const load_public_dir_1 = require("./load_public_dir");
5
+ const load_static_entries_1 = require("./load_static_entries");
6
+ async function loadStaticAssets(vite_internal_options) {
7
+ const publicAssets = [];
8
+ if (vite_internal_options.publicDir) {
9
+ const _public_assets = await (0, load_public_dir_1.load_public_dir)({
10
+ outDir: vite_internal_options.outDir,
11
+ publicDir: vite_internal_options.publicDir,
12
+ });
13
+ publicAssets.push(..._public_assets);
14
+ }
15
+ const _static_assets = await (0, load_static_entries_1.load_static_entries)({
16
+ root: vite_internal_options.root,
17
+ outDir: vite_internal_options.outDir,
18
+ });
19
+ publicAssets.push(..._static_assets);
20
+ return publicAssets.reduce((acc, asset) => {
21
+ acc[asset.fileName] = asset;
22
+ return acc;
23
+ }, {});
24
+ }
25
+ exports.loadStaticAssets = loadStaticAssets;
26
+ //# sourceMappingURL=load_static_assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load_static_assets.js","sourceRoot":"","sources":["../../../../src/lib/internal/extract/load_static_assets.ts"],"names":[],"mappings":";;;AACA,uDAAoD;AACpD,+DAA4D;AAGrD,KAAK,UAAU,gBAAgB,CACpC,qBAA4C;IAE5C,MAAM,YAAY,GAAkB,EAAE,CAAC;IAEvC,IAAI,qBAAqB,CAAC,SAAS,EAAE,CAAC;QACpC,MAAM,cAAc,GAAG,MAAM,IAAA,iCAAe,EAAC;YAC3C,MAAM,EAAE,qBAAqB,CAAC,MAAM;YACpC,SAAS,EAAE,qBAAqB,CAAC,SAAS;SAC3C,CAAC,CAAC;QACH,YAAY,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,IAAA,yCAAmB,EAAC;QAC/C,IAAI,EAAE,qBAAqB,CAAC,IAAI;QAChC,MAAM,EAAE,qBAAqB,CAAC,MAAM;KACrC,CAAC,CAAC;IACH,YAAY,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;IAErC,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACxC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;QAC5B,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAkB,CAAC,CAAC;AACzB,CAAC;AAvBD,4CAuBC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load_static_entries.js","sourceRoot":"","sources":["../../../../src/lib/internal/extract/load_static_entries.ts"],"names":[],"mappings":";;;AACA,yCAA8C;AAC9C,qCAA0D;AAC1D,+BAAqC;AACrC,yCAAsC;AAO/B,KAAK,UAAU,mBAAmB,CACvC,KAA+B;IAE/B,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACvB,MAAM,YAAY,GAAkB,EAAE,CAAC;IAEvC,MAAM,aAAa,GAAG,IAAA,mBAAO,EAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAElD,MAAM,OAAO,GAAG,KAAK,EAAE,OAAe,EAAE,EAAE;QACxC,KAAK,MAAM,IAAI,IAAI,IAAA,qBAAW,EAAC,OAAO,CAAC,EAAE,CAAC;YACxC,MAAM,QAAQ,GAAG,IAAA,mBAAO,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACxC,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,QAAQ,CAAC,CAAC;YAChC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACvB,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACxB,SAAS;YACX,CAAC;YACD,MAAM,QAAQ,GAAG,IAAA,oBAAa,EAAC,IAAA,oBAAQ,EAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;YAClE,YAAY,CAAC,IAAI,CAAC;gBAChB,QAAQ;gBACR,IAAI,EAAE,IAAI;gBACV,kBAAkB,EAAE,KAAK;gBACzB,MAAM,EAAE,MAAM,IAAA,qBAAS,EAAC,kBAAQ,CAAC,CAAC,QAAQ,CAAC;gBAC3C,IAAI,EAAE,OAAO;gBACb,gBAAgB,EAAE,IAAI;aACvB,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;IACF,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7B,OAAO,YAAY,CAAC;AACtB,CAAC;AA7BD,kDA6BC"}
@@ -0,0 +1,2 @@
1
+ import { ZeDependencyPair } from 'zephyr-agent';
2
+ export declare function extract_remotes_dependencies(code: string, id: string): ZeDependencyPair[] | undefined;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extract_remotes_dependencies = void 0;
4
+ const remote_map_parser_1 = require("./remote_map_parser");
5
+ function extract_remotes_dependencies(code, id) {
6
+ const dependencyPairs = [];
7
+ const extractedRemotes = (0, remote_map_parser_1.parseRemoteMap)(code, id);
8
+ if (extractedRemotes === undefined)
9
+ return;
10
+ const { remotesMap } = extractedRemotes;
11
+ for (const remote of remotesMap) {
12
+ const { name, entry: version } = remote;
13
+ dependencyPairs.push({ name, version });
14
+ }
15
+ return dependencyPairs;
16
+ }
17
+ exports.extract_remotes_dependencies = extract_remotes_dependencies;
18
+ //# sourceMappingURL=extract-mf-vite-remotes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-mf-vite-remotes.js","sourceRoot":"","sources":["../../../../src/lib/internal/mf-vite-etl/extract-mf-vite-remotes.ts"],"names":[],"mappings":";;;AACA,2DAAqD;AAErD,SAAgB,4BAA4B,CAC1C,IAAY,EACZ,EAAU;IAEV,MAAM,eAAe,GAAuB,EAAE,CAAC;IAC/C,MAAM,gBAAgB,GAAG,IAAA,kCAAc,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAClD,IAAI,gBAAgB,KAAK,SAAS;QAAE,OAAO;IAE3C,MAAM,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAAC;IAExC,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE,CAAC;QAChC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QACxC,eAAe,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AAhBD,oEAgBC"}
@@ -0,0 +1,2 @@
1
+ import { ZeResolvedDependency } from 'zephyr-agent';
2
+ export declare function load_resolved_remotes(resolved_remotes: ZeResolvedDependency[], code: string, id: string): string | undefined;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.load_resolved_remotes = void 0;
4
+ const remote_map_parser_1 = require("./remote_map_parser");
5
+ function load_resolved_remotes(resolved_remotes, code, id) {
6
+ const extractedRemotes = (0, remote_map_parser_1.parseRemoteMap)(code, id);
7
+ if (extractedRemotes === undefined)
8
+ return;
9
+ const remotes = [];
10
+ const { remotesMap, startIndex, endIndex } = extractedRemotes;
11
+ for (const remote of remotesMap) {
12
+ const { name, entry, type } = remote;
13
+ const remoteDetails = resolved_remotes.find((r) => r.name === name && r.version === entry);
14
+ if (!remoteDetails)
15
+ continue;
16
+ const updatedUrl = (0, remote_map_parser_1.replaceProtocolAndHost)(entry, remoteDetails.remote_entry_url);
17
+ remotes.push({
18
+ name,
19
+ type,
20
+ entryGlobalName: name,
21
+ entry: updatedUrl,
22
+ });
23
+ }
24
+ return code.slice(0, startIndex) + JSON.stringify(remotes) + code.slice(endIndex);
25
+ }
26
+ exports.load_resolved_remotes = load_resolved_remotes;
27
+ //# sourceMappingURL=load_resolved_remotes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load_resolved_remotes.js","sourceRoot":"","sources":["../../../../src/lib/internal/mf-vite-etl/load_resolved_remotes.ts"],"names":[],"mappings":";;;AACA,2DAI6B;AAE7B,SAAgB,qBAAqB,CACnC,gBAAwC,EACxC,IAAY,EACZ,EAAU;IAEV,MAAM,gBAAgB,GAAG,IAAA,kCAAc,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAClD,IAAI,gBAAgB,KAAK,SAAS;QAAE,OAAO;IAE3C,MAAM,OAAO,GAAsC,EAAE,CAAC;IACtD,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;IAC9D,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE,CAAC;QAChC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QACrC,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CACzC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,OAAO,KAAK,KAAK,CAC9C,CAAC;QACF,IAAI,CAAC,aAAa;YAAE,SAAS;QAE7B,MAAM,UAAU,GAAG,IAAA,0CAAsB,EAAC,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;QACjF,OAAO,CAAC,IAAI,CAAC;YACX,IAAI;YACJ,IAAI;YACJ,eAAe,EAAE,IAAI;YACrB,KAAK,EAAE,UAAU;SAClB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AACpF,CAAC;AA1BD,sDA0BC"}
@@ -13,8 +13,8 @@ export interface RemoteMapExtraction {
13
13
  * Parses the provided code to extract the remotes object.
14
14
  *
15
15
  * @param code - The code containing the remotes object declaration.
16
- * @returns An object containing the remotes object and the start and end indices of the remotes object declaration in the code, or
17
- * undefined if parsing fails.
16
+ * @returns An object containing the remotes object and the start and end indices of the
17
+ * remotes object declaration in the code, or undefined if parsing fails.
18
18
  */
19
19
  export declare function parseRemoteMap(code: string, id: string): RemoteMapExtraction | undefined;
20
20
  export declare function replaceProtocolAndHost(originalUrl: string, newProtocolAndHost: string): string;
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.replaceProtocolAndHost = exports.parseRemoteMap = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const json5_1 = tslib_1.__importDefault(require("json5"));
6
- const zephyr_edge_contract_1 = require("zephyr-edge-contract");
7
6
  const acorn_1 = tslib_1.__importDefault(require("acorn"));
8
7
  const acorn_walk_1 = tslib_1.__importDefault(require("acorn-walk"));
8
+ const zephyr_agent_1 = require("zephyr-agent");
9
9
  /**
10
10
  * Parses the provided code to extract the remotes object.
11
11
  *
12
12
  * @param code - The code containing the remotes object declaration.
13
- * @returns An object containing the remotes object and the start and end indices of the remotes object declaration in the code, or
14
- * undefined if parsing fails.
13
+ * @returns An object containing the remotes object and the start and end indices of the
14
+ * remotes object declaration in the code, or undefined if parsing fails.
15
15
  */
16
16
  function parseRemoteMap(code, id) {
17
17
  if (!id.includes('localSharedImportMap')) {
@@ -30,7 +30,9 @@ function parseRemoteMap(code, id) {
30
30
  function findUsedRemotes(node) {
31
31
  if (node.type === 'VariableDeclaration' && node.kind === 'const') {
32
32
  for (const declarator of node.declarations) {
33
- if (declarator.id.type === 'Identifier' && declarator.id.name === 'usedRemotes' && declarator.init) {
33
+ if (declarator.id.type === 'Identifier' &&
34
+ declarator.id.name === 'usedRemotes' &&
35
+ declarator.init) {
34
36
  // Found the 'usedRemotes' variable
35
37
  arrayNode = declarator.init;
36
38
  break;
@@ -42,11 +44,11 @@ function parseRemoteMap(code, id) {
42
44
  VariableDeclaration: findUsedRemotes,
43
45
  });
44
46
  const endTime = Date.now();
45
- (0, zephyr_edge_contract_1.ze_log)(`parseRemoteMap took ${endTime - startTime}ms`);
47
+ (0, zephyr_agent_1.ze_log)(`parseRemoteMap took ${endTime - startTime}ms`);
46
48
  if (!arrayNode) {
47
49
  return;
48
50
  }
49
- (0, zephyr_edge_contract_1.ze_log)('vite.arrayNode found: ', arrayNode);
51
+ (0, zephyr_agent_1.ze_log)('vite.arrayNode found: ', arrayNode);
50
52
  // Get start and end indices
51
53
  const startIndex = arrayNode.start;
52
54
  const endIndex = arrayNode.end;
@@ -56,7 +58,7 @@ function parseRemoteMap(code, id) {
56
58
  try {
57
59
  // Use a faster JSON parser if possible
58
60
  remotesArray = JSON.parse(arrayText);
59
- (0, zephyr_edge_contract_1.ze_log)('vite.parseRemoteMap.remotesArray: ', remotesArray);
61
+ (0, zephyr_agent_1.ze_log)('vite.parseRemoteMap.remotesArray: ', remotesArray);
60
62
  }
61
63
  catch (error) {
62
64
  // Fallback to json5 only if necessary
@@ -75,15 +77,15 @@ function parseRemoteMap(code, id) {
75
77
  }
76
78
  exports.parseRemoteMap = parseRemoteMap;
77
79
  function replaceProtocolAndHost(originalUrl, newProtocolAndHost) {
78
- (0, zephyr_edge_contract_1.ze_log)('vite.replaceProtocalAndHost.originalUrl: ', originalUrl);
79
- (0, zephyr_edge_contract_1.ze_log)('vite.replaceProtocalAndHost: ', newProtocolAndHost);
80
+ (0, zephyr_agent_1.ze_log)('vite.replaceProtocalAndHost.originalUrl: ', originalUrl);
81
+ (0, zephyr_agent_1.ze_log)('vite.replaceProtocalAndHost: ', newProtocolAndHost);
80
82
  const url = new URL(originalUrl);
81
83
  const newUrl = new URL(newProtocolAndHost);
82
84
  // Replace protocol and hostname
83
85
  url.protocol = newUrl.protocol;
84
86
  url.hostname = newUrl.hostname;
85
87
  url.port = '';
86
- (0, zephyr_edge_contract_1.ze_log)('vite.transformedUrl: ', url.toString());
88
+ (0, zephyr_agent_1.ze_log)('vite.transformedUrl: ', url.toString());
87
89
  return url.toString();
88
90
  }
89
91
  exports.replaceProtocolAndHost = replaceProtocolAndHost;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote_map_parser.js","sourceRoot":"","sources":["../../../../src/lib/internal/mf-vite-etl/remote_map_parser.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,0DAA0B;AAC1B,oEAA8B;AAC9B,+CAAsC;AAetC;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,IAAY,EACZ,EAAU;IAEV,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;QACzC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,SAAiC,CAAC;IAEtC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,6BAA6B;IAC7B,MAAM,GAAG,GAAG,eAAK,CAAC,KAAK,CAAC,IAAI,EAAE;QAC5B,WAAW,EAAE,QAAQ;QACrB,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,IAAI,EAAE,kCAAkC;QACnD,MAAM,EAAE,IAAI,EAAE,gCAAgC;KAC/C,CAAC,CAAC;IAEH,oDAAoD;IACpD,SAAS,eAAe,CAAC,IAA+B;QACtD,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACjE,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBAC3C,IACE,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,YAAY;oBACnC,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,aAAa;oBACpC,UAAU,CAAC,IAAI,EACf,CAAC;oBACD,mCAAmC;oBACnC,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC;oBAC5B,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,oBAAI,CAAC,MAAM,CAAC,GAAG,EAAE;Q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,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAE3C,gCAAgC;IAChC,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC/B,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC/B,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IAEd,IAAA,qBAAM,EAAC,uBAAuB,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEhD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC;AAjBD,wDAiBC"}
@@ -1,7 +1,9 @@
1
+ import { OutputBundle } from 'rollup';
1
2
  export interface ZephyrInternalOptions {
2
3
  root: string;
3
- configFile: string;
4
4
  outDir: string;
5
+ configFile?: string;
5
6
  publicDir?: string;
6
7
  dir?: string;
8
+ assets?: OutputBundle;
7
9
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zephyr-internal-options.js","sourceRoot":"","sources":["../../../../src/lib/internal/types/zephyr-internal-options.ts"],"names":[],"mappings":""}
@@ -5,6 +5,6 @@ export declare function withZephyrPartial(): {
5
5
  apply: string;
6
6
  enforce: string;
7
7
  configResolved: (config: ResolvedConfig) => Promise<void>;
8
- writeBundle: (options: NormalizedOutputOptions, _bundle: OutputBundle) => Promise<void>;
8
+ writeBundle: (options: NormalizedOutputOptions, bundle: OutputBundle) => Promise<void>;
9
9
  closeBundle: () => Promise<void>;
10
10
  };
@@ -1,162 +1,48 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withZephyrPartial = void 0;
4
- const tslib_1 = require("tslib");
5
- const isCI = tslib_1.__importStar(require("is-ci"));
6
4
  const zephyr_agent_1 = require("zephyr-agent");
7
- const zephyr_edge_contract_1 = require("zephyr-edge-contract");
8
- const load_extra_files_from_dist_1 = require("./load_extra_files_from_dist");
9
- const load_public_dir_1 = require("./load_public_dir");
5
+ const extract_vite_assets_map_1 = require("./internal/extract/extract_vite_assets_map");
10
6
  function withZephyrPartial() {
11
- let bundle = {};
12
- const vite_internal_options = {};
7
+ const { zephyr_engine_defer, zephyr_defer_create } = zephyr_agent_1.ZephyrEngine.defer_create();
8
+ let resolve_vite_internal_options;
9
+ const vite_internal_options_defer = new Promise((resolve) => {
10
+ resolve_vite_internal_options = resolve;
11
+ });
13
12
  return {
14
13
  name: 'with-zephyr-partial',
15
14
  apply: 'build',
16
15
  enforce: 'post',
17
16
  configResolved: async (config) => {
18
- Object.assign(vite_internal_options, {
17
+ zephyr_defer_create(config.root);
18
+ resolve_vite_internal_options({
19
19
  root: config.root,
20
20
  configFile: config.configFile,
21
21
  outDir: config.build.outDir,
22
22
  publicDir: config.publicDir,
23
23
  });
24
24
  },
25
- writeBundle: async (options, _bundle) => {
25
+ writeBundle: async (options, bundle) => {
26
+ const vite_internal_options = await vite_internal_options_defer;
26
27
  vite_internal_options.dir = options.dir;
27
- bundle = _bundle;
28
+ vite_internal_options.assets = bundle;
28
29
  },
29
30
  closeBundle: async () => {
30
- const publicAssets = [];
31
- if (vite_internal_options.publicDir) {
32
- const _public_assets = await (0, load_public_dir_1.load_public_dir)({
33
- outDir: vite_internal_options.outDir,
34
- publicDir: vite_internal_options.publicDir,
35
- });
36
- publicAssets.push(..._public_assets);
37
- }
38
- const _extra_assets = await (0, load_extra_files_from_dist_1.load_extra_files_from_dist)({
39
- root: vite_internal_options.root,
40
- outDir: vite_internal_options.outDir,
41
- bundle,
42
- });
43
- publicAssets.push(..._extra_assets);
44
- const assets = Object.assign({}, bundle, ...publicAssets.map((asset) => ({ [asset.fileName]: asset })));
45
- await _zephyr_partial({ assets, vite_internal_options });
31
+ var _a;
32
+ const vite_internal_options = await vite_internal_options_defer;
33
+ const zephyr_engine = await zephyr_engine_defer;
34
+ const application_uid = zephyr_engine.application_uid;
35
+ // context import ^
36
+ const assetsMap = await (0, extract_vite_assets_map_1.extract_vite_assets_map)(zephyr_engine, vite_internal_options);
37
+ await (0, zephyr_agent_1.savePartialAssetMap)(application_uid, (_a = vite_internal_options.configFile) !== null && _a !== void 0 ? _a : 'partial', assetsMap);
38
+ // todo: initially partial build doesn't have deploy, but code below could enable it if needed
39
+ // await zephyr_engine.upload_assets({
40
+ // assetsMap,
41
+ // // todo: this should be updated if we have remotes
42
+ // buildStats: await zeBuildDashData(zephyr_engine),
43
+ // });
46
44
  },
47
45
  };
48
46
  }
49
47
  exports.withZephyrPartial = withZephyrPartial;
50
- async function _zephyr_partial(options) {
51
- var _a;
52
- const { assets, vite_internal_options } = options;
53
- const path_to_execution_dir = vite_internal_options.root;
54
- (0, zephyr_edge_contract_1.ze_log)('Configuring with Zephyr...');
55
- const packageJson = await (0, zephyr_agent_1.getPackageJson)(path_to_execution_dir);
56
- (0, zephyr_edge_contract_1.ze_log)('Loaded Package JSON', packageJson);
57
- if (!packageJson)
58
- return (0, zephyr_edge_contract_1.ze_error)('ERR_PACKAGE_JSON_NOT_FOUND');
59
- const gitInfo = await (0, zephyr_agent_1.getGitInfo)();
60
- (0, zephyr_edge_contract_1.ze_log)('Loaded Git Info', gitInfo);
61
- if (!gitInfo || !(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.org) || !(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.project))
62
- return (0, zephyr_edge_contract_1.ze_error)('ERR_NO_GIT_INFO', 'Can you confirm the current directory has initialized as a git repository?');
63
- if (!(packageJson === null || packageJson === void 0 ? void 0 : packageJson.name))
64
- return (0, zephyr_edge_contract_1.ze_error)('ERR_PACKAGE_JSON_MUST_HAVE_NAME_VERSION', 'package.json must have a name and version.');
65
- const application_uid = (0, zephyr_edge_contract_1.createApplicationUID)({
66
- org: gitInfo.app.org,
67
- project: gitInfo.app.project,
68
- name: packageJson === null || packageJson === void 0 ? void 0 : packageJson.name,
69
- });
70
- (0, zephyr_edge_contract_1.ze_log)('Going to check auth token or get it...');
71
- await (0, zephyr_agent_1.checkAuth)();
72
- (0, zephyr_edge_contract_1.ze_log)('Got auth token, going to get application configuration and build id...');
73
- const [appConfig, buildId, hash_set] = await Promise.all([
74
- (0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }),
75
- (0, zephyr_agent_1.getBuildId)(application_uid),
76
- (0, zephyr_agent_1.get_hash_list)(application_uid),
77
- ]);
78
- const { username, email, EDGE_URL } = appConfig;
79
- (0, zephyr_edge_contract_1.ze_log)('Got application configuration', { username, email, EDGE_URL });
80
- if (!buildId)
81
- return (0, zephyr_edge_contract_1.ze_error)('ERR_GET_BUILD_ID');
82
- const pluginOptions = {
83
- pluginName: 'rollup-plugin-zephyr',
84
- application_uid,
85
- buildEnv: 'local',
86
- username,
87
- app: {
88
- name: packageJson.name,
89
- version: packageJson.version,
90
- org: gitInfo.app.org,
91
- project: gitInfo.app.project,
92
- },
93
- git: gitInfo.git,
94
- isCI,
95
- zeConfig: {
96
- user: username,
97
- edge_url: EDGE_URL,
98
- buildId,
99
- },
100
- mfConfig: void 0,
101
- };
102
- (0, zephyr_edge_contract_1.ze_log)('\n--------\n zephyr agent started. \n ------ \n');
103
- const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
104
- logEvent({
105
- level: 'info',
106
- action: 'build:info:user',
107
- ignore: true,
108
- message: `Hi ${(0, zephyr_edge_contract_1.cyanBright)(username)}!\n${(0, zephyr_edge_contract_1.white)(application_uid)}${(0, zephyr_edge_contract_1.yellow)(`#${buildId}`)}\n`,
109
- });
110
- const zeStart = Date.now();
111
- const extractBuffer = (asset) => {
112
- switch (asset.type) {
113
- case 'chunk':
114
- return asset.code;
115
- case 'asset':
116
- return typeof asset.source === 'string' ? asset.source : new TextDecoder().decode(asset.source);
117
- default:
118
- return void 0;
119
- }
120
- };
121
- const getAssetType = (asset) => asset.type;
122
- const assetsMap = Object.keys(assets).reduce((memo, filepath) => {
123
- const asset = assets[filepath];
124
- const buffer = extractBuffer(asset);
125
- if (!buffer && buffer !== '') {
126
- logEvent({
127
- action: 'ze:build:assets:unknown-asset-type',
128
- level: 'error',
129
- message: `unknown asset type: ${getAssetType(asset)}`,
130
- });
131
- return memo;
132
- }
133
- const assetMap = (0, zephyr_agent_1.getZeBuildAsset)({ filepath, content: buffer });
134
- memo[assetMap.hash] = assetMap;
135
- return memo;
136
- }, {});
137
- const snapshot = (0, zephyr_agent_1.createSnapshot)({
138
- options: pluginOptions,
139
- assets: assetsMap,
140
- username,
141
- email,
142
- });
143
- await (0, zephyr_agent_1.zeUploadSnapshot)({ pluginOptions, snapshot, appConfig }).catch((err) => (0, zephyr_edge_contract_1.ze_error)('ERR_FAILED_UPLOAD_SNAPSHOTS', 'Failed to upload snapshot.', err));
144
- const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
145
- const assetsUploadSuccess = await (0, zephyr_agent_1.zeUploadAssets)(pluginOptions, {
146
- missingAssets,
147
- assetsMap,
148
- count: Object.keys(assets).length,
149
- });
150
- if (!assetsUploadSuccess)
151
- return (0, zephyr_edge_contract_1.ze_error)('ERR_FAILED_UPLOAD_ASSETS', assetsUploadSuccess);
152
- if (missingAssets.length) {
153
- await (0, zephyr_agent_1.update_hash_list)(application_uid, assetsMap);
154
- }
155
- await (0, zephyr_edge_contract_1.savePartialAssetMap)(application_uid, (_a = vite_internal_options.configFile) !== null && _a !== void 0 ? _a : 'partial', assetsMap);
156
- logEvent({
157
- level: 'info',
158
- action: 'build:deploy:done',
159
- message: `Deployment took ${(0, zephyr_edge_contract_1.yellow)(`${Date.now() - zeStart}`)}ms`,
160
- });
161
- }
162
48
  //# sourceMappingURL=vite-plugin-zephyr-partial.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin-zephyr-partial.js","sourceRoot":"","sources":["../../src/lib/vite-plugin-zephyr-partial.ts"],"names":[],"mappings":";;;;AAAA,oDAA8B;AAG9B,+CAcsB;AACtB,+DAU8B;AAC9B,6EAA0E;AAC1E,uDAAoD;AAGpD,SAAgB,iBAAiB;IAC/B,IAAI,MAAM,GAAiB,EAAE,CAAC;IAC9B,MAAM,qBA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,CAAC;QACxC,CAAC;QAED,WAAW,EAAE,KAAK,IAAI,EAAE;;YACtB,MAAM,qBAAqB,GAAG,MAAM,2BAA2B,CAAC;YAChE,MAAM,aAAa,GAAG,MAAM,mBAAmB,CAAC;YAChD,MAAM,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;YACtD,mBAAmB;YACnB,MAAM,SAAS,GAAG,MAAM,IAAA,iDAAuB,EAC7C,aAAa,EACb,qBAAqB,CACtB,CAAC;YACF,MAAM,IAAA,kCAAmB,EACvB,eAAe,EACf,MAAA,qBAAqB,CAAC,UAAU,mCAAI,SAAS,EAC7C,SAAS,CACV,CAAC;YACF,8FAA8F;YAC9F,sCAAsC;YACtC,eAAe;YACf,uDAAuD;YACvD,sDAAsD;YACtD,MAAM;QACR,CAAC;KACF,CAAC;AACJ,CAAC;AAjDD,8CAiDC"}
@@ -1,8 +1,8 @@
1
1
  import type { Plugin } from 'vite';
2
2
  import { federation } from '@module-federation/vite';
3
- type FederationFunction = typeof federation;
3
+ export type ModuleFederationOptions = Parameters<typeof federation>[0];
4
4
  interface VitePluginZephyrOptions {
5
- mfConfig?: Parameters<FederationFunction>[0];
5
+ mfConfig?: ModuleFederationOptions;
6
6
  }
7
7
  export declare function withZephyr(_options?: VitePluginZephyrOptions): Plugin[];
8
8
  export {};
@@ -1,179 +1,60 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withZephyr = void 0;
4
- const tslib_1 = require("tslib");
5
- const isCI = tslib_1.__importStar(require("is-ci"));
6
4
  const zephyr_agent_1 = require("zephyr-agent");
7
- const zephyr_edge_contract_1 = require("zephyr-edge-contract");
8
- const load_public_dir_1 = require("./load_public_dir");
9
- const load_static_entries_1 = require("./load_static_entries");
10
- const remote_map_parser_1 = require("./remote_map_parser");
11
- const resolve_remote_dependency_1 = require("./resolve_remote_dependency");
12
5
  const vite_1 = require("@module-federation/vite");
6
+ const extract_vite_assets_map_1 = require("./internal/extract/extract_vite_assets_map");
7
+ const extract_mf_vite_remotes_1 = require("./internal/mf-vite-etl/extract-mf-vite-remotes");
8
+ const load_resolved_remotes_1 = require("./internal/mf-vite-etl/load_resolved_remotes");
13
9
  function withZephyr(_options) {
14
10
  const mfConfig = _options === null || _options === void 0 ? void 0 : _options.mfConfig;
15
- return mfConfig ? (0, vite_1.federation)(mfConfig).concat([zephyrPlugin(_options)]) : [zephyrPlugin(_options)];
11
+ const plugins = [];
12
+ if (mfConfig) {
13
+ plugins.push(...(0, vite_1.federation)(mfConfig));
14
+ }
15
+ plugins.push(zephyrPlugin(_options));
16
+ return plugins;
16
17
  }
17
18
  exports.withZephyr = withZephyr;
18
19
  function zephyrPlugin(_options) {
19
- let gitInfo;
20
- let packageJson;
21
- let application_uid;
22
- const vite_internal_options = {};
20
+ const { zephyr_engine_defer, zephyr_defer_create } = zephyr_agent_1.ZephyrEngine.defer_create();
21
+ let resolve_vite_internal_options;
22
+ const vite_internal_options_defer = new Promise((resolve) => {
23
+ resolve_vite_internal_options = resolve;
24
+ });
23
25
  return {
24
26
  name: 'with-zephyr',
25
27
  enforce: 'post',
26
28
  configResolved: async (config) => {
27
29
  var _a;
28
- Object.assign(vite_internal_options, {
30
+ zephyr_defer_create(config.root);
31
+ resolve_vite_internal_options({
29
32
  root: config.root,
30
33
  outDir: (_a = config.build) === null || _a === void 0 ? void 0 : _a.outDir,
31
34
  publicDir: config.publicDir,
32
35
  });
33
- (0, zephyr_edge_contract_1.ze_log)('Configuring with Zephyr...');
34
- packageJson = await (0, zephyr_agent_1.getPackageJson)(vite_internal_options.root);
35
- (0, zephyr_edge_contract_1.ze_log)('Loaded package.json.', packageJson);
36
- if (!packageJson)
37
- return (0, zephyr_edge_contract_1.ze_error)('ERR_PACKAGE_JSON_NOT_FOUND');
38
- gitInfo = await (0, zephyr_agent_1.getGitInfo)();
39
- (0, zephyr_edge_contract_1.ze_log)('Loaded Git Info.', gitInfo);
40
- if (!gitInfo || !(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.org) || !(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.project))
41
- return (0, zephyr_edge_contract_1.ze_error)('ERR_NO_GIT_INFO', 'Could not get git info. \n Can you confirm this directory has initialized as a git repository? ');
42
- if (!(packageJson === null || packageJson === void 0 ? void 0 : packageJson.name))
43
- return (0, zephyr_edge_contract_1.ze_error)('ERR_PACKAGE_JSON_MUST_HAVE_NAME_VERSION');
44
- application_uid = (0, zephyr_edge_contract_1.createApplicationUID)({
45
- org: gitInfo.app.org,
46
- project: gitInfo.app.project,
47
- name: packageJson === null || packageJson === void 0 ? void 0 : packageJson.name,
48
- });
49
- (0, zephyr_edge_contract_1.ze_log)('vite-zephyr-options', vite_internal_options);
50
36
  },
51
37
  transform: async (code, id) => {
52
- const extractedRemotes = _options ? (0, remote_map_parser_1.parseRemoteMap)(code, id) : undefined;
53
- if (extractedRemotes === undefined) {
38
+ const zephyr_engine = await zephyr_engine_defer;
39
+ const dependencyPairs = (0, extract_mf_vite_remotes_1.extract_remotes_dependencies)(code, id);
40
+ if (!dependencyPairs)
41
+ return code;
42
+ const resolved_remotes = await zephyr_engine.resolve_remote_dependencies(dependencyPairs);
43
+ if (!resolved_remotes)
54
44
  return code;
55
- }
56
- const { remotesMap, startIndex, endIndex } = extractedRemotes;
57
- const remotes = [];
58
- for (const remote of remotesMap) {
59
- const { name, entry, type } = remote;
60
- (0, zephyr_edge_contract_1.ze_log)('Remote details:', JSON.stringify(remotesMap));
61
- const remote_application_uuid = (0, zephyr_edge_contract_1.createApplicationUID)({
62
- org: gitInfo.app.org,
63
- project: gitInfo.app.project,
64
- name: name,
65
- });
66
- (0, zephyr_edge_contract_1.ze_log)('Resolving remote:', remote_application_uuid, name);
67
- const remoteDetails = await (0, resolve_remote_dependency_1.resolve_remote_dependency)({ name: remote_application_uuid, version: name });
68
- (0, zephyr_edge_contract_1.ze_log)('Resolved remote:', remoteDetails);
69
- if (!remoteDetails) {
70
- continue;
71
- }
72
- const updatedUrl = (0, remote_map_parser_1.replaceProtocolAndHost)(entry, remoteDetails.remote_entry_url);
73
- (0, zephyr_edge_contract_1.ze_log)('Updating remote url:', entry, 'to ->', updatedUrl);
74
- remotes.push({
75
- name,
76
- type,
77
- entryGlobalName: name,
78
- entry: updatedUrl,
79
- });
80
- (0, zephyr_edge_contract_1.ze_log)('Updated remote url:', entry);
81
- }
82
- (0, zephyr_edge_contract_1.ze_log)('Writing remotesMap to bundle:', remotes);
83
- return code.slice(0, startIndex) + JSON.stringify(remotes) + code.slice(endIndex);
45
+ return (0, load_resolved_remotes_1.load_resolved_remotes)(resolved_remotes, code, id);
84
46
  },
85
47
  closeBundle: async () => {
86
- const publicAssets = [];
87
- if (vite_internal_options.publicDir) {
88
- const _public_assets = await (0, load_public_dir_1.load_public_dir)({
89
- outDir: vite_internal_options.outDir,
90
- publicDir: vite_internal_options.publicDir,
91
- });
92
- publicAssets.push(..._public_assets);
93
- }
94
- const _static_assets = await (0, load_static_entries_1.load_static_entries)({
95
- root: vite_internal_options.root,
96
- outDir: vite_internal_options.outDir,
48
+ const vite_internal_options = await vite_internal_options_defer;
49
+ const zephyr_engine = await zephyr_engine_defer;
50
+ await zephyr_engine.start_new_build();
51
+ const assetsMap = await (0, extract_vite_assets_map_1.extract_vite_assets_map)(zephyr_engine, vite_internal_options);
52
+ await zephyr_engine.upload_assets({
53
+ assetsMap,
54
+ buildStats: await (0, zephyr_agent_1.zeBuildDashData)(zephyr_engine),
97
55
  });
98
- publicAssets.push(..._static_assets);
99
- const assets = Object.assign({}, ...publicAssets.map((asset) => ({ [asset.fileName]: asset })));
100
- await _zephyr({ assets, vite_internal_options, application_uid, packageJson, gitInfo });
101
- },
102
- };
103
- }
104
- async function _zephyr(options) {
105
- const { assets: _assets, vite_internal_options, application_uid, packageJson, gitInfo } = options;
106
- (0, zephyr_edge_contract_1.ze_log)('Going to check auth token or get it...');
107
- await (0, zephyr_agent_1.checkAuth)();
108
- (0, zephyr_edge_contract_1.ze_log)('Got auth token, going to get application configuration and build id...');
109
- const [appConfig, buildId, hash_set] = await Promise.all([
110
- (0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }),
111
- (0, zephyr_agent_1.getBuildId)(application_uid),
112
- (0, zephyr_agent_1.get_hash_list)(application_uid),
113
- ]);
114
- const { username, email, EDGE_URL } = appConfig;
115
- (0, zephyr_edge_contract_1.ze_log)('Got application configuration', { username, email, EDGE_URL });
116
- if (!buildId)
117
- return (0, zephyr_edge_contract_1.ze_error)('ERR_GET_BUILD_ID');
118
- const pluginOptions = {
119
- pluginName: 'vite-plugin-zephyr',
120
- application_uid,
121
- buildEnv: 'local',
122
- username,
123
- app: {
124
- name: packageJson.name,
125
- version: packageJson.version,
126
- org: gitInfo.app.org,
127
- project: gitInfo.app.project,
56
+ await zephyr_engine.build_finished();
128
57
  },
129
- git: gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.git,
130
- isCI,
131
- zeConfig: {
132
- user: username,
133
- edge_url: EDGE_URL,
134
- buildId,
135
- },
136
- mfConfig: void 0,
137
58
  };
138
- (0, zephyr_edge_contract_1.ze_log)('\nzephyr agent started.\n');
139
- const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
140
- logEvent({
141
- level: 'info',
142
- action: 'build:info:user',
143
- ignore: true,
144
- message: `Hi ${(0, zephyr_edge_contract_1.cyanBright)(username)}!\n${(0, zephyr_edge_contract_1.white)(application_uid)}${(0, zephyr_edge_contract_1.yellow)(`#${buildId}`)}\n`,
145
- });
146
- const zeStart = Date.now();
147
- const partialAssetMap = await (0, zephyr_edge_contract_1.getPartialAssetMap)(application_uid);
148
- await (0, zephyr_edge_contract_1.removePartialAssetMap)(application_uid);
149
- const assets = Object.assign({}, _assets, ...Object.values(partialAssetMap !== null && partialAssetMap !== void 0 ? partialAssetMap : {}));
150
- const assetsMap = (0, zephyr_agent_1.buildAssetsMap)(assets, extractBuffer, getAssetType);
151
- const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
152
- await (0, zephyr_agent_1.upload)({
153
- pluginOptions,
154
- assets: {
155
- assetsMap,
156
- missingAssets,
157
- outputPath: vite_internal_options.outDir,
158
- count: Object.keys(assets).length,
159
- },
160
- // @ts-expect-error TODO: fix this types to get legacy and current working
161
- getDashData: zephyr_agent_1.zeGetDashData,
162
- appConfig,
163
- zeStart,
164
- });
165
- }
166
- function extractBuffer(asset) {
167
- switch (asset.type) {
168
- case 'chunk':
169
- return asset.code;
170
- case 'asset':
171
- return typeof asset.source === 'string' ? asset.source : new TextDecoder().decode(asset.source);
172
- default:
173
- return void 0;
174
- }
175
- }
176
- function getAssetType(asset) {
177
- return asset.type;
178
59
  }
179
60
  //# sourceMappingURL=vite-plugin-zephyr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin-zephyr.js","sourceRoot":"","sources":["../../src/lib/vite-plugin-zephyr.ts"],"names":[],"mappings":";;;;AAAA,oDAA8B;AAG9B,+CAasB;AACtB,+DAU8B;AAC9B,uDAAoD;AACpD,+DAA4D;AAE5D,2DAAkG;AAClG,2EAAwE;AACxE,kDAAqD;AAWrD,SAAgB,UAAU,CAAC,QAAkC;IAC3D,MAAM,QAAQ,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,QAAQ,CAAC;IACpC,OAAO,QAAQ,CAAC,CAAC,CAAE,IAAA,iBAAU,EAAC,QAAQ,CAAc,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnH,CAAC;AAHD,gCAGC;AAED,SAAS,YAAY,CAAC,QAAkC;IACtD,IAAI,OAAgB,CAAC;IACrB,IAAI,WAAuD,CAAC;IAC5D,IAAI,eAAuB,CAAC;IAE5B,MAAM,qBAAqB,GAAG,EAAkC,CAAC;IAEjE,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,MAAM;QAEf,cAAc,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CAAC;gBAChC,SAAS;gBACT,UAAU,EAAE,MAAM,IAAA,8BAAe,EAAC,aAAa,CAAC;aACjD,CAAC,CAAC;YACH,MAAM,aAAa,CAAC,cAAc,EAAE,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-zephyr",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,8 +16,7 @@
16
16
  "json5": "2.2.3",
17
17
  "rollup": "^4.22.5",
18
18
  "vite": "^5.4.8",
19
- "zephyr-agent": "workspace:*",
20
- "zephyr-edge-contract": "workspace:*"
19
+ "zephyr-agent": "workspace:*"
21
20
  },
22
21
  "devDependencies": {
23
22
  "@types/is-ci": "^3.0.4"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-zephyr",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,8 +13,7 @@
13
13
  "json5": "2.2.3",
14
14
  "rollup": "^4.22.5",
15
15
  "vite": "^5.4.8",
16
- "zephyr-agent": "0.0.26",
17
- "zephyr-edge-contract": "0.0.26"
16
+ "zephyr-agent": "0.0.27"
18
17
  },
19
18
  "devDependencies": {
20
19
  "@types/is-ci": "^3.0.4"
@@ -1,8 +0,0 @@
1
- import { OutputAsset, OutputBundle } from 'rollup';
2
- interface LoadExtraFilesFromDistOptions {
3
- root: string;
4
- bundle: OutputBundle;
5
- outDir: string;
6
- }
7
- export declare function load_extra_files_from_dist(props: LoadExtraFilesFromDistOptions): Promise<OutputAsset[]>;
8
- export {};
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.load_extra_files_from_dist = void 0;
4
- const node_path_1 = require("node:path");
5
- const node_fs_1 = require("node:fs");
6
- const vite_1 = require("vite");
7
- const node_util_1 = require("node:util");
8
- async function load_extra_files_from_dist(props) {
9
- const { root, bundle } = props;
10
- const publicAssets = [];
11
- const root_dist_dir = (0, node_path_1.resolve)(root, props.outDir);
12
- const loadDir = async (destDir) => {
13
- for (const file of (0, node_fs_1.readdirSync)(destDir)) {
14
- const destFile = (0, node_path_1.resolve)(destDir, file);
15
- const stat = (0, node_fs_1.statSync)(destFile);
16
- if (stat.isDirectory()) {
17
- await loadDir(destFile);
18
- continue;
19
- }
20
- const fileName = (0, vite_1.normalizePath)((0, node_path_1.relative)(root_dist_dir, destFile));
21
- if (!(fileName in bundle)) {
22
- publicAssets.push({
23
- fileName,
24
- name: file,
25
- needsCodeReference: false,
26
- source: await (0, node_util_1.promisify)(node_fs_1.readFile)(destFile),
27
- type: 'asset',
28
- originalFileName: file,
29
- });
30
- }
31
- }
32
- };
33
- await loadDir(root_dist_dir);
34
- return publicAssets;
35
- }
36
- exports.load_extra_files_from_dist = load_extra_files_from_dist;
37
- //# sourceMappingURL=load_extra_files_from_dist.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"load_extra_files_from_dist.js","sourceRoot":"","sources":["../../src/lib/load_extra_files_from_dist.ts"],"names":[],"mappings":";;;AACA,yCAA8C;AAC9C,qCAA0D;AAC1D,+BAAqC;AACrC,yCAAsC;AAQ/B,KAAK,UAAU,0BAA0B,CAAC,KAAoC;IACnF,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC/B,MAAM,YAAY,GAAkB,EAAE,CAAC;IAEvC,MAAM,aAAa,GAAG,IAAA,mBAAO,EAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,KAAK,EAAE,OAAe,EAAE,EAAE;QACxC,KAAK,MAAM,IAAI,IAAI,IAAA,qBAAW,EAAC,OAAO,CAAC,EAAE,CAAC;YACxC,M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;
4
- }): Promise<ResolvedDependency | void>;
5
- export interface ResolvedDependency {
6
- remote_name: string;
7
- default_url: string;
8
- application_uid: string;
9
- remote_entry_url: string;
10
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolve_remote_dependency = void 0;
4
- const zephyr_edge_contract_1 = require("zephyr-edge-contract");
5
- async function resolve_remote_dependency({ name, version }) {
6
- const resolveDependency = new URL(`${zephyr_edge_contract_1.ze_api_gateway.resolve}/${encodeURIComponent(name)}/${encodeURIComponent(version)}`, (0, zephyr_edge_contract_1.ZE_API_ENDPOINT)());
7
- (0, zephyr_edge_contract_1.ze_log)('Resolving dependency', name, version, resolveDependency);
8
- try {
9
- const token = await (0, zephyr_edge_contract_1.getToken)();
10
- const res = await fetch(resolveDependency, {
11
- method: 'GET',
12
- headers: {
13
- 'Content-Type': 'application/json',
14
- Authorization: 'Bearer ' + token,
15
- Accept: 'application/json',
16
- },
17
- });
18
- if (!res.ok) {
19
- throw new Error(res.statusText);
20
- }
21
- const response = (await res.json());
22
- (0, zephyr_edge_contract_1.ze_log)('[Vite]: resolve remote dependency response: ', response);
23
- return response === null || response === void 0 ? void 0 : response.value;
24
- }
25
- catch (err) {
26
- (0, zephyr_edge_contract_1.ze_error)('ERR_NOT_RESOLVE_APP_NAME_WITH_VERSION', `Could not resolve '${name}' with version '${version}'`);
27
- }
28
- }
29
- exports.resolve_remote_dependency = resolve_remote_dependency;
30
- //# sourceMappingURL=resolve_remote_dependency.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve_remote_dependency.js","sourceRoot":"","sources":["../../src/lib/resolve_remote_dependency.ts"],"names":[],"mappings":";;;AAAA,+DAAmG;AAE5F,KAAK,UAAU,yBAAyB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAqC;IAClG,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC/B,GAAG,qCAAc,CAAC,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE,EACtF,IAAA,sCAAe,GAAE,CAClB,CAAC;IACF,IAAA,6BAAM,EAAC,sBAAsB,EAAE,IAAI,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;IACjE,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,IAAA,+BAAQ,GAAE,CAAC;QAC/B,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,iBAAiB,EAAE;YACzC,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,SAAS,GAAG,KAAK;gBAChC,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;QACD,MAAM,QAAQ,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA8C,CAAC;QAEjF,IAAA,6BAAM,EAAC,8CAA8C,EAAE,QAAQ,CAAC,CAAC;QACjE,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC;IACzB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAA,+BAAQ,EAAC,uCAAuC,EAAE,sBAAsB,IAAI,mBAAmB,OAAO,GAAG,CAAC,CAAC;IAC7G,CAAC;AACH,CAAC;AA3BD,8DA2BC"}
@@ -1,11 +0,0 @@
1
- export interface ZephyrInternalOptions {
2
- root: string;
3
- outDir: string;
4
- publicDir?: string;
5
- dir?: string;
6
- }
7
- export interface ZephyrPartialInternalOptions {
8
- root: string;
9
- outDir: string;
10
- publicDir?: string;
11
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"zephyr-internal-options.js","sourceRoot":"","sources":["../../../src/lib/types/zephyr-internal-options.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=zephyr-internal-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zephyr-internal-options.js","sourceRoot":"","sources":["../../src/lib/zephyr-internal-options.ts"],"names":[],"mappings":""}