vite-plugin-zephyr 0.0.20 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
package/LICENSE CHANGED
@@ -1,39 +1,39 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- ...
13
-
14
- END OF TERMS AND CONDITIONS
15
-
16
- APPENDIX: How to apply the Apache License to your work.
17
-
18
- To apply the Apache License to your work, attach the following
19
- boilerplate notice, with the fields enclosed by brackets "[]"
20
- replaced with your own identifying information. (Don't include
21
- the brackets!) The text should be enclosed in the appropriate
22
- comment syntax for the file format. We also recommend that a
23
- file or class name and description of purpose be included on the
24
- same line as the copyright notice for each file. The "copyright"
25
- word should be left as is (without quotes).
26
-
27
- Copyright [2023] [Zephyr Cloud]
28
-
29
- Licensed under the Apache License, Version 2.0 (the "License");
30
- you may not use this file except in compliance with the License.
31
- You may obtain a copy of the License at
32
-
33
- http://www.apache.org/licenses/LICENSE-2.0
34
-
35
- Unless required by applicable law or agreed to in writing, software
36
- distributed under the License is distributed on an "AS IS" BASIS,
37
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38
- See the License for the specific language governing permissions and
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ ...
13
+
14
+ END OF TERMS AND CONDITIONS
15
+
16
+ APPENDIX: How to apply the Apache License to your work.
17
+
18
+ To apply the Apache License to your work, attach the following
19
+ boilerplate notice, with the fields enclosed by brackets "[]"
20
+ replaced with your own identifying information. (Don't include
21
+ the brackets!) The text should be enclosed in the appropriate
22
+ comment syntax for the file format. We also recommend that a
23
+ file or class name and description of purpose be included on the
24
+ same line as the copyright notice for each file. The "copyright"
25
+ word should be left as is (without quotes).
26
+
27
+ Copyright [2023] [Zephyr Cloud]
28
+
29
+ Licensed under the Apache License, Version 2.0 (the "License");
30
+ you may not use this file except in compliance with the License.
31
+ You may obtain a copy of the License at
32
+
33
+ http://www.apache.org/licenses/LICENSE-2.0
34
+
35
+ Unless required by applicable law or agreed to in writing, software
36
+ distributed under the License is distributed on an "AS IS" BASIS,
37
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38
+ See the License for the specific language governing permissions and
39
39
  limitations under the License.
@@ -1,17 +1,20 @@
1
+ export interface RemoteEntry {
2
+ name: string;
3
+ entryGlobalName?: string;
4
+ entry: string;
5
+ type?: string;
6
+ }
1
7
  export interface RemoteMapExtraction {
2
- remotesMap: {
3
- [index: string]: {
4
- url: string;
5
- };
6
- };
8
+ remotesMap: RemoteEntry[];
7
9
  startIndex: number;
8
10
  endIndex: number;
9
11
  }
10
12
  /**
11
- * Parses the provided code to extract the remotesMap object.
13
+ * Parses the provided code to extract the remotes object.
12
14
  *
13
- * @param code - The code containing the remotesMap declaration.
14
- * @returns An object containing the remotesMap as a Record<string, string> and the start and end indices of the remotesMap declaration in the code, or undefined if parsing fails.
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.
15
18
  */
16
- export declare function parseRemoteMap(code: string): Promise<RemoteMapExtraction | undefined>;
19
+ export declare function parseRemoteMap(code: string, id: string): RemoteMapExtraction | undefined;
17
20
  export declare function replaceProtocolAndHost(originalUrl: string, newProtocolAndHost: string): string;
@@ -4,53 +4,86 @@ exports.replaceProtocolAndHost = exports.parseRemoteMap = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const json5_1 = tslib_1.__importDefault(require("json5"));
6
6
  const zephyr_edge_contract_1 = require("zephyr-edge-contract");
7
+ const acorn_1 = tslib_1.__importDefault(require("acorn"));
8
+ const acorn_walk_1 = tslib_1.__importDefault(require("acorn-walk"));
7
9
  /**
8
- * Parses the provided code to extract the remotesMap object.
10
+ * Parses the provided code to extract the remotes object.
9
11
  *
10
- * @param code - The code containing the remotesMap declaration.
11
- * @returns An object containing the remotesMap as a Record<string, string> and the start and end indices of the remotesMap declaration in the code, or undefined if parsing fails.
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.
12
15
  */
13
- function parseRemoteMap(code) {
14
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
- try {
16
- const { js } = yield Promise.resolve().then(() => tslib_1.__importStar(require('@ast-grep/napi')));
17
- const tree = js.parse(code);
18
- const root = tree.root();
19
- const objectNode = root.find(`const remotesMap = $OBJECT;`);
20
- if (!objectNode) {
21
- (0, zephyr_edge_contract_1.ze_error)('ERR_NOT_RESOLVE_APP_NAME_WITH_VERSION', 'Failed to find remotesMap declaration.');
22
- return;
23
- }
24
- const variableDeclaratorNode = objectNode.children().find((child) => child.kind() === 'variable_declarator');
25
- if (!variableDeclaratorNode) {
26
- (0, zephyr_edge_contract_1.ze_error)('ERR_NOT_RESOLVE_APP_NAME_WITH_VERSION', 'Failed to extract object literal from remotesMap declaration: variable_declarator.');
27
- return;
28
- }
29
- const objectLiteralNode = variableDeclaratorNode.children().find((child) => child.kind() === 'object');
30
- if (!objectLiteralNode) {
31
- (0, zephyr_edge_contract_1.ze_error)('ERR_NOT_RESOLVE_APP_NAME_WITH_VERSION', 'Failed to extract object literal from remotesMap declaration: object');
32
- return;
16
+ function parseRemoteMap(code, id) {
17
+ if (!id.includes('localSharedImportMap')) {
18
+ return undefined;
19
+ }
20
+ let arrayNode;
21
+ const startTime = Date.now();
22
+ // Parse the code into an AST
23
+ const ast = acorn_1.default.parse(code, {
24
+ ecmaVersion: 'latest',
25
+ sourceType: 'module',
26
+ locations: true, // Include line and column numbers
27
+ ranges: true, // Include start and end indices
28
+ });
29
+ // Visitor function to find the variable declaration
30
+ function findUsedRemotes(node) {
31
+ if (node.type === 'VariableDeclaration' && node.kind === 'const') {
32
+ for (const declarator of node.declarations) {
33
+ if (declarator.id.type === 'Identifier' && declarator.id.name === 'usedRemotes' && declarator.init) {
34
+ // Found the 'usedRemotes' variable
35
+ arrayNode = declarator.init;
36
+ break;
37
+ }
33
38
  }
34
- const remotesMapObject = json5_1.default.parse(objectLiteralNode.text() || '');
35
- return {
36
- remotesMap: remotesMapObject,
37
- startIndex: objectNode.range().start.index,
38
- endIndex: objectNode.range().end.index,
39
- };
40
- }
41
- catch (error) {
42
- (0, zephyr_edge_contract_1.ze_error)('ERR_NOT_RESOLVE_APP_NAME_WITH_VERSION', 'Failed to parse or modify remotesMap:', error);
43
39
  }
44
- return;
40
+ }
41
+ acorn_walk_1.default.simple(ast, {
42
+ VariableDeclaration: findUsedRemotes,
45
43
  });
44
+ const endTime = Date.now();
45
+ (0, zephyr_edge_contract_1.ze_log)(`parseRemoteMap took ${endTime - startTime}ms`);
46
+ if (!arrayNode) {
47
+ return;
48
+ }
49
+ (0, zephyr_edge_contract_1.ze_log)('vite.arrayNode found: ', arrayNode);
50
+ // Get start and end indices
51
+ const startIndex = arrayNode.start;
52
+ const endIndex = arrayNode.end;
53
+ // Extract the array text from the code
54
+ const arrayText = code.slice(startIndex, endIndex);
55
+ let remotesArray;
56
+ try {
57
+ // Use a faster JSON parser if possible
58
+ remotesArray = JSON.parse(arrayText);
59
+ (0, zephyr_edge_contract_1.ze_log)('vite.parseRemoteMap.remotesArray: ', remotesArray);
60
+ }
61
+ catch (error) {
62
+ // Fallback to json5 only if necessary
63
+ try {
64
+ remotesArray = json5_1.default.parse(arrayText);
65
+ }
66
+ catch (innerError) {
67
+ return;
68
+ }
69
+ }
70
+ return {
71
+ remotesMap: remotesArray,
72
+ startIndex,
73
+ endIndex,
74
+ };
46
75
  }
47
76
  exports.parseRemoteMap = parseRemoteMap;
48
77
  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);
49
80
  const url = new URL(originalUrl);
50
81
  const newUrl = new URL(newProtocolAndHost);
51
82
  // Replace protocol and hostname
52
83
  url.protocol = newUrl.protocol;
53
84
  url.hostname = newUrl.hostname;
85
+ url.port = '';
86
+ (0, zephyr_edge_contract_1.ze_log)('vite.transformedUrl: ', url.toString());
54
87
  return url.toString();
55
88
  }
56
89
  exports.replaceProtocolAndHost = replaceProtocolAndHost;
@@ -1 +1 @@
1
- {"version":3,"file":"remote_map_parser.js","sourceRoot":"","sources":["../../src/lib/remote_map_parser.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,+DAAgD;AAUhD;;;;;GAKG;AACH,SAAsB,cAAc,CAAC,IAAY;;QAC/C,IAAI,CAAC;YACH,MAAM,EAAE,EAAE,EAAE,GAAG,gEAAa,gBAAgB,GAAC,CAAC;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YAEzB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;YAE5D,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,IAAA,+BAAQ,EAAC,uCAAuC,EAAE,wCAAwC,CAAC,CAAC;gBAC5F,OAAO;YACT,CAAC;YAED,MAAM,sBAAsB,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,qBAAqB,CAAC,CAAC;YAE7G,IAAI,CAAC,sBAAsB,EAAE,CAAC;gBAC5B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;IAC/B,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IAEd,IAAA,6BAAM,EAAC,uBAAuB,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEhD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC;AAdD,wDAcC"}
@@ -21,6 +21,7 @@ function resolve_remote_dependency(_a) {
21
21
  throw new Error(res.statusText);
22
22
  }
23
23
  const response = (yield res.json());
24
+ (0, zephyr_edge_contract_1.ze_log)('[Vite]: resolve remote dependency response: ', response);
24
25
  return response === null || response === void 0 ? void 0 : response.value;
25
26
  }
26
27
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"resolve_remote_dependency.js","sourceRoot":"","sources":["../../src/lib/resolve_remote_dependency.ts"],"names":[],"mappings":";;;;AAAA,+DAAmG;AAEnG,SAAsB,yBAAyB;iEAAC,EAAE,IAAI,EAAE,OAAO,EAAqC;QAClG,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;QACF,IAAA,6BAAM,EAAC,sBAAsB,EAAE,IAAI,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;QACjE,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAA,+BAAQ,GAAE,CAAC;YAC/B,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,iBAAiB,EAAE;gBACzC,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,aAAa,EAAE,SAAS,GAAG,KAAK;oBAChC,MAAM,EAAE,kBAAkB;iBAC3B;aACF,CAAC,CAAC;YAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC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AAE,CAA8C,CAAC;YAEjF,IAAA,6BAAM,EAAC,8CAA8C,EAAE,QAAQ,CAAC,CAAC;YACjE,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC;QACzB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAA,+BAAQ,EAAC,uCAAuC,EAAE,sBAAsB,IAAI,mBAAmB,OAAO,GAAG,CAAC,CAAC;QAC7G,CAAC;IACH,CAAC;CAAA;AA3BD,8DA2BC"}
@@ -1,7 +1,11 @@
1
1
  export interface ZephyrInternalOptions {
2
2
  root: string;
3
- configFile: string;
4
3
  outDir: string;
5
4
  publicDir?: string;
6
5
  dir?: string;
7
6
  }
7
+ export interface ZephyrPartialInternalOptions {
8
+ root: string;
9
+ outDir: string;
10
+ publicDir?: string;
11
+ }
@@ -1,3 +1,8 @@
1
1
  import type { Plugin } from 'vite';
2
- import { VitePluginFederationOptions } from '@originjs/vite-plugin-federation';
3
- export declare function withZephyr(_options?: VitePluginFederationOptions): Plugin;
2
+ import { federation } from '@module-federation/vite';
3
+ type FederationFunction = typeof federation;
4
+ interface VitePluginZephyrOptions {
5
+ mfConfig?: Parameters<FederationFunction>[0];
6
+ }
7
+ export declare function withZephyr(_options?: VitePluginZephyrOptions): Plugin[];
8
+ export {};
@@ -9,9 +9,10 @@ const load_public_dir_1 = require("./load_public_dir");
9
9
  const load_static_entries_1 = require("./load_static_entries");
10
10
  const remote_map_parser_1 = require("./remote_map_parser");
11
11
  const resolve_remote_dependency_1 = require("./resolve_remote_dependency");
12
- const vite_plugin_federation_1 = tslib_1.__importDefault(require("@originjs/vite-plugin-federation"));
12
+ const vite_1 = require("@module-federation/vite");
13
13
  function withZephyr(_options) {
14
- return zephyrPlugin(_options);
14
+ const mfConfig = _options === null || _options === void 0 ? void 0 : _options.mfConfig;
15
+ return mfConfig ? (0, vite_1.federation)(mfConfig).concat([zephyrPlugin(_options)]) : [zephyrPlugin(_options)];
15
16
  }
16
17
  exports.withZephyr = withZephyr;
17
18
  function zephyrPlugin(_options) {
@@ -22,17 +23,11 @@ function zephyrPlugin(_options) {
22
23
  return {
23
24
  name: 'with-zephyr',
24
25
  enforce: 'post',
25
- config: (config) => {
26
- config.plugins = config.plugins || [];
27
- // only push the options when options are presented
28
- _options &&
29
- config.plugins.push((0, vite_plugin_federation_1.default)(Object.assign({}, _options)));
30
- },
31
26
  configResolved: (config) => tslib_1.__awaiter(this, void 0, void 0, function* () {
27
+ var _a;
32
28
  Object.assign(vite_internal_options, {
33
29
  root: config.root,
34
- configFile: config.configFile,
35
- outDir: config.build.outDir,
30
+ outDir: (_a = config.build) === null || _a === void 0 ? void 0 : _a.outDir,
36
31
  publicDir: config.publicDir,
37
32
  });
38
33
  (0, zephyr_edge_contract_1.ze_log)('Configuring with Zephyr...');
@@ -53,33 +48,39 @@ function zephyrPlugin(_options) {
53
48
  });
54
49
  (0, zephyr_edge_contract_1.ze_log)('vite-zephyr-options', vite_internal_options);
55
50
  }),
56
- // Used by Vite dev server for in memory bundles
57
- transform: (code) => tslib_1.__awaiter(this, void 0, void 0, function* () {
58
- // If there is no options getting passed in return undefined and pass the code directly to next step
59
- const extractedRemoteMap = _options ? yield (0, remote_map_parser_1.parseRemoteMap)(code) : undefined;
60
- if (extractedRemoteMap === undefined) {
51
+ transform: (code, id) => tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ const extractedRemotes = _options ? (0, remote_map_parser_1.parseRemoteMap)(code, id) : undefined;
53
+ if (extractedRemotes === undefined) {
61
54
  return code;
62
55
  }
63
- const { remotesMap, startIndex, endIndex } = extractedRemoteMap;
64
- for (const [remoteName, remoteConfig] of Object.entries(remotesMap)) {
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));
65
61
  const remote_application_uuid = (0, zephyr_edge_contract_1.createApplicationUID)({
66
62
  org: gitInfo.app.org,
67
63
  project: gitInfo.app.project,
68
- name: remoteName,
64
+ name: name,
69
65
  });
70
- (0, zephyr_edge_contract_1.ze_log)('Resolving remote:', remote_application_uuid, remoteName);
71
- const remoteDetails = yield (0, resolve_remote_dependency_1.resolve_remote_dependency)({ name: remote_application_uuid, version: '*' });
66
+ (0, zephyr_edge_contract_1.ze_log)('Resolving remote:', remote_application_uuid, name);
67
+ const remoteDetails = yield (0, resolve_remote_dependency_1.resolve_remote_dependency)({ name: remote_application_uuid, version: name });
72
68
  (0, zephyr_edge_contract_1.ze_log)('Resolved remote:', remoteDetails);
73
69
  if (!remoteDetails) {
74
70
  continue;
75
71
  }
76
- (0, zephyr_edge_contract_1.ze_log)('Updating remote url:', remoteConfig.url, remoteDetails.remote_entry_url);
77
- remoteConfig.url = (0, remote_map_parser_1.replaceProtocolAndHost)(remoteConfig.url, remoteDetails.remote_entry_url);
78
- (0, zephyr_edge_contract_1.ze_log)('Updated remote url:', remoteConfig.url);
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);
79
81
  }
80
- (0, zephyr_edge_contract_1.ze_log)('Writing remotesMap to bundle:', remotesMap);
81
- const newObjectCode = `const remotesMap = ${JSON.stringify(remotesMap)};`;
82
- return code.slice(0, startIndex) + newObjectCode + code.slice(endIndex);
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);
83
84
  }),
84
85
  closeBundle: () => tslib_1.__awaiter(this, void 0, void 0, function* () {
85
86
  const publicAssets = [];
@@ -1 +1 @@
1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AAC;AAED,SAAS,YAAY,CAAC,KAAgC;IACpD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-zephyr",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,14 +8,16 @@
8
8
  "build": "nx run vite-plugin-zephyr:build"
9
9
  },
10
10
  "dependencies": {
11
- "vite": "^5.4.6",
12
- "rollup": "^4",
11
+ "@module-federation/runtime": "^0.6.10",
12
+ "@module-federation/vite": "^1.1.3",
13
+ "acorn": "^8.12.1",
14
+ "acorn-walk": "^8.3.4",
13
15
  "is-ci": "^3",
14
- "@ast-grep/napi": "0.27.0",
15
- "@originjs/vite-plugin-federation": "^1.3.5",
16
16
  "json5": "2.2.3",
17
- "zephyr-edge-contract": "workspace:*",
18
- "zephyr-agent": "workspace:*"
17
+ "rollup": "^4.22.5",
18
+ "vite": "^5.4.8",
19
+ "zephyr-agent": "workspace:*",
20
+ "zephyr-edge-contract": "workspace:*"
19
21
  },
20
22
  "devDependencies": {
21
23
  "@types/is-ci": "^3.0.4"
package/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "vite-plugin-zephyr",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "dependencies": {
8
- "vite": "^5.4.6",
9
- "rollup": "^4",
8
+ "@module-federation/runtime": "^0.6.10",
9
+ "@module-federation/vite": "^1.1.3",
10
+ "acorn": "^8.12.1",
11
+ "acorn-walk": "^8.3.4",
10
12
  "is-ci": "^3",
11
- "@ast-grep/napi": "0.27.0",
12
- "@originjs/vite-plugin-federation": "^1.3.5",
13
13
  "json5": "2.2.3",
14
- "zephyr-edge-contract": "0.0.20",
15
- "zephyr-agent": "0.0.20"
14
+ "rollup": "^4.22.5",
15
+ "vite": "^5.4.8",
16
+ "zephyr-agent": "0.0.22",
17
+ "zephyr-edge-contract": "0.0.22"
16
18
  },
17
19
  "devDependencies": {
18
20
  "@types/is-ci": "^3.0.4"