vite-plugin-zephyr 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/load_extra_files_from_dist.d.ts +1 -0
- package/dist/lib/load_extra_files_from_dist.js +1 -1
- package/dist/lib/load_extra_files_from_dist.js.map +1 -1
- package/dist/lib/load_public_dir.js +1 -1
- package/dist/lib/load_public_dir.js.map +1 -1
- package/dist/lib/load_static_entries.d.ts +1 -0
- package/dist/lib/load_static_entries.js +1 -1
- package/dist/lib/load_static_entries.js.map +1 -1
- package/dist/lib/vite-plugin-zephyr-partial.js +14 -13
- package/dist/lib/vite-plugin-zephyr-partial.js.map +1 -1
- package/dist/lib/vite-plugin-zephyr.js +47 -116
- package/dist/lib/vite-plugin-zephyr.js.map +1 -1
- package/dist/package.json +2 -2
- package/package.json +3 -3
- package/.eslintrc.json +0 -25
- package/jest.config.ts +0 -11
- package/project.json +0 -34
- package/tsconfig.json +0 -22
- package/tsconfig.lib.json +0 -11
- package/tsconfig.spec.json +0 -14
@@ -2,6 +2,7 @@ import { OutputAsset, OutputBundle } from 'rollup';
|
|
2
2
|
interface LoadExtraFilesFromDistOptions {
|
3
3
|
root: string;
|
4
4
|
bundle: OutputBundle;
|
5
|
+
outDir: string;
|
5
6
|
}
|
6
7
|
export declare function load_extra_files_from_dist(props: LoadExtraFilesFromDistOptions): Promise<OutputAsset[]>;
|
7
8
|
export {};
|
@@ -10,7 +10,7 @@ function load_extra_files_from_dist(props) {
|
|
10
10
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
11
11
|
const { root, bundle } = props;
|
12
12
|
const publicAssets = [];
|
13
|
-
const root_dist_dir = (0, node_path_1.resolve)(root,
|
13
|
+
const root_dist_dir = (0, node_path_1.resolve)(root, props.outDir);
|
14
14
|
const loadDir = (destDir) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
15
15
|
for (const file of (0, node_fs_1.readdirSync)(destDir)) {
|
16
16
|
const destFile = (0, node_path_1.resolve)(destDir, file);
|
@@ -1 +1 @@
|
|
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;
|
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;AAQtC,SAAsB,0BAA0B,CAC9C,KAAoC;;QAEpC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;QAC/B,MAAM,YAAY,GAAkB,EAAE,CAAC;QAEvC,MAAM,aAAa,GAAG,IAAA,mBAAO,EAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,OAAO,GAAG,CAAO,OAAe,EAAE,EAAE;YACxC,KAAK,MAAM,IAAI,IAAI,IAAA,qBAAW,EAAC,OAAO,CAAC,EAAE,CAAC;gBACxC,MAAM,QAAQ,GAAG,IAAA,mBAAO,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBACxC,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,QAAQ,CAAC,CAAC;gBAChC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;oBACvB,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;oBACxB,SAAS;gBACX,CAAC;gBACD,MAAM,QAAQ,GAAG,IAAA,oBAAa,EAAC,IAAA,oBAAQ,EAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;gBAClE,IAAI,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC;oBAC1B,YAAY,CAAC,IAAI,CAAC;wBAChB,QAAQ;wBACR,IAAI,EAAE,IAAI;wBACV,kBAAkB,EAAE,KAAK;wBACzB,MAAM,EAAE,MAAM,IAAA,qBAAS,EAAC,kBAAQ,CAAC,CAAC,QAAQ,CAAC;wBAC3C,IAAI,EAAE,OAAO;qBACd,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC,CAAA,CAAC;QACF,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;QAE7B,OAAO,YAAY,CAAC;IACtB,CAAC;CAAA;AA9BD,gEA8BC"}
|
@@ -19,7 +19,7 @@ function load_public_dir(props) {
|
|
19
19
|
const destFile = (0, node_path_1.resolve)(destDir, file);
|
20
20
|
const stat = (0, node_fs_1.statSync)(srcFile);
|
21
21
|
if (stat.isDirectory()) {
|
22
|
-
loadDir(srcFile, destFile);
|
22
|
+
yield loadDir(srcFile, destFile);
|
23
23
|
}
|
24
24
|
else {
|
25
25
|
publicAssets.push({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"load_public_dir.js","sourceRoot":"","sources":["../../src/lib/load_public_dir.ts"],"names":[],"mappings":";;;;AACA,qCAA0D;AAC1D,yCAAwD;AACxD,+BAAqC;AACrC,yCAAsC;AAOtC,SAAsB,eAAe,CACnC,KAA2B;;QAE3B,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;QACpC,MAAM,YAAY,GAAkB,EAAE,CAAC;QAEvC,MAAM,OAAO,GAAG,CAAO,MAAc,EAAE,OAAe,EAAE,EAAE;YACxD,KAAK,MAAM,IAAI,IAAI,IAAA,qBAAW,EAAC,MAAM,CAAC,EAAE,CAAC;gBACvC,MAAM,OAAO,GAAG,IAAA,mBAAO,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBACtC,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;oBACxB,SAAS;gBACX,CAAC;gBACD,MAAM,QAAQ,GAAG,IAAA,mBAAO,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBACxC,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,OAAO,CAAC,CAAC;gBAC/B,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,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ACH,CAAC,CAAA,CAAC;QACF,MAAM,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACjC,OAAO,YAAY,CAAC;IACtB,CAAC;CAAA;AA7BD,0CA6BC"}
|
@@ -15,7 +15,7 @@ function load_static_entries(props) {
|
|
15
15
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
16
16
|
const { root, bundle } = props;
|
17
17
|
const publicAssets = [];
|
18
|
-
const root_dist_dir = (0, node_path_1.resolve)(root,
|
18
|
+
const root_dist_dir = (0, node_path_1.resolve)(root, props.outDir);
|
19
19
|
const loadDir = (destDir) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
20
20
|
for (const file of (0, node_fs_1.readdirSync)(destDir)) {
|
21
21
|
const destFile = (0, node_path_1.resolve)(destDir, file);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"load_static_entries.js","sourceRoot":"","sources":["../../src/lib/load_static_entries.ts"],"names":[],"mappings":";;;;AACA,yCAA8C;AAC9C,qCAA0D;AAC1D,+BAAqC;AACrC,yCAAsC;
|
1
|
+
{"version":3,"file":"load_static_entries.js","sourceRoot":"","sources":["../../src/lib/load_static_entries.ts"],"names":[],"mappings":";;;;AACA,yCAA8C;AAC9C,qCAA0D;AAC1D,+BAAqC;AACrC,yCAAsC;AAQtC,MAAM,aAAa,GAA4B;IAC7C,YAAY,EAAE,IAAI;IAClB,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,SAAsB,mBAAmB,CACvC,KAA+B;;QAE/B,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;QAC/B,MAAM,YAAY,GAAkB,EAAE,CAAC;QAEvC,MAAM,aAAa,GAAG,IAAA,mBAAO,EAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAElD,MAAM,OAAO,GAAG,CAAO,OAAe,EAAE,EAAE;YACxC,KAAK,MAAM,IAAI,IAAI,IAAA,qBAAW,EAAC,OAAO,CAAC,EAAE,CAAC;gBACxC,MAAM,QAAQ,GAAG,IAAA,mBAAO,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBACxC,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,QAAQ,CAAC,CAAC;gBAChC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;oBACvB,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;oBACxB,SAAS;gBACX,CAAC;gBACD,MAAM,QAAQ,GAAG,IAAA,oBAAa,EAAC,IAAA,oBAAQ,EAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;gBAClE,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;oBACxB,YAAY,CAAC,IAAI,CAAC;wBAChB,QAAQ;wBACR,IAAI,EAAE,IAAI;wBACV,kBAAkB,EAAE,KAAK;wBACzB,MAAM,EAAE,MAAM,IAAA,qBAAS,EAAC,kBAAQ,CAAC,CAAC,QAAQ,CAAC;wBAC3C,IAAI,EAAE,OAAO;qBACd,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC,CAAA,CAAC;QACF,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;QAC7B,OAAO,YAAY,CAAC;IACtB,CAAC;CAAA;AA9BD,kDA8BC"}
|
@@ -37,6 +37,7 @@ function withZephyrPartial() {
|
|
37
37
|
}
|
38
38
|
const _extra_assets = yield (0, load_extra_files_from_dist_1.load_extra_files_from_dist)({
|
39
39
|
root: vite_internal_options.root,
|
40
|
+
outDir: vite_internal_options.outDir,
|
40
41
|
bundle,
|
41
42
|
});
|
42
43
|
publicAssets.push(..._extra_assets);
|
@@ -51,26 +52,26 @@ function _zephyr_partial(options) {
|
|
51
52
|
var _a;
|
52
53
|
const { assets, vite_internal_options } = options;
|
53
54
|
const path_to_execution_dir = vite_internal_options.root;
|
54
|
-
(0, zephyr_edge_contract_1.ze_log)('Configuring with Zephyr');
|
55
|
+
(0, zephyr_edge_contract_1.ze_log)('Configuring with Zephyr...');
|
55
56
|
const packageJson = yield (0, zephyr_agent_1.getPackageJson)(path_to_execution_dir);
|
56
57
|
(0, zephyr_edge_contract_1.ze_log)('Loaded Package JSON', packageJson);
|
57
58
|
if (!packageJson)
|
58
|
-
return (0, zephyr_edge_contract_1.ze_error)('
|
59
|
+
return (0, zephyr_edge_contract_1.ze_error)("BU10010", 'package.json not found.');
|
59
60
|
const gitInfo = yield (0, zephyr_agent_1.getGitInfo)();
|
60
61
|
(0, zephyr_edge_contract_1.ze_log)('Loaded Git Info', gitInfo);
|
61
|
-
if (!gitInfo ||
|
62
|
-
!(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.
|
63
|
-
|
64
|
-
|
65
|
-
return (0, zephyr_edge_contract_1.ze_error)('
|
62
|
+
if (!gitInfo || !(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.org) ||
|
63
|
+
!(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.project))
|
64
|
+
return (0, zephyr_edge_contract_1.ze_error)("BU10016", `Could not get git info. Can you confirm the current directory has initialized as a git repository?`);
|
65
|
+
if (!(packageJson === null || packageJson === void 0 ? void 0 : packageJson.name))
|
66
|
+
return (0, zephyr_edge_contract_1.ze_error)("BU10013", 'package.json must have a name and version.');
|
66
67
|
const application_uid = (0, zephyr_edge_contract_1.createApplicationUID)({
|
67
68
|
org: gitInfo.app.org,
|
68
69
|
project: gitInfo.app.project,
|
69
70
|
name: packageJson === null || packageJson === void 0 ? void 0 : packageJson.name,
|
70
71
|
});
|
71
|
-
(0, zephyr_edge_contract_1.ze_log)('Going to check auth token or get it');
|
72
|
+
(0, zephyr_edge_contract_1.ze_log)('Going to check auth token or get it...');
|
72
73
|
yield (0, zephyr_agent_1.checkAuth)();
|
73
|
-
(0, zephyr_edge_contract_1.ze_log)('Got auth token, going to get application configuration and build id');
|
74
|
+
(0, zephyr_edge_contract_1.ze_log)('Got auth token, going to get application configuration and build id...');
|
74
75
|
const [appConfig, buildId, hash_set] = yield Promise.all([
|
75
76
|
(0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }),
|
76
77
|
(0, zephyr_agent_1.getBuildId)(application_uid).catch((err) => {
|
@@ -86,7 +87,7 @@ function _zephyr_partial(options) {
|
|
86
87
|
const { username, email, EDGE_URL } = appConfig;
|
87
88
|
(0, zephyr_edge_contract_1.ze_log)('Got application configuration', { username, email, EDGE_URL });
|
88
89
|
if (!buildId)
|
89
|
-
return (0, zephyr_edge_contract_1.ze_error)('
|
90
|
+
return (0, zephyr_edge_contract_1.ze_error)("BU10019", 'Could not get build id.');
|
90
91
|
const pluginOptions = {
|
91
92
|
pluginName: 'rollup-plugin-zephyr',
|
92
93
|
application_uid,
|
@@ -107,7 +108,7 @@ function _zephyr_partial(options) {
|
|
107
108
|
},
|
108
109
|
mfConfig: void 0,
|
109
110
|
};
|
110
|
-
(0, zephyr_edge_contract_1.ze_log)('zephyr agent started.');
|
111
|
+
(0, zephyr_edge_contract_1.ze_log)('\n--------\n zephyr agent started. \n ------ \n');
|
111
112
|
const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
|
112
113
|
const zeStart = Date.now();
|
113
114
|
const extractBuffer = (asset) => {
|
@@ -144,7 +145,7 @@ function _zephyr_partial(options) {
|
|
144
145
|
username,
|
145
146
|
email,
|
146
147
|
});
|
147
|
-
yield (0, zephyr_agent_1.zeUploadSnapshot)(pluginOptions, snapshot).catch((err) => (0, zephyr_edge_contract_1.ze_error)('Failed to upload snapshot.', err));
|
148
|
+
yield (0, zephyr_agent_1.zeUploadSnapshot)(pluginOptions, snapshot).catch((err) => (0, zephyr_edge_contract_1.ze_error)("DE10018", 'Failed to upload snapshot.', err));
|
148
149
|
const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
|
149
150
|
const assetsUploadSuccess = yield (0, zephyr_agent_1.zeUploadAssets)(pluginOptions, {
|
150
151
|
missingAssets,
|
@@ -152,7 +153,7 @@ function _zephyr_partial(options) {
|
|
152
153
|
count: Object.keys(assets).length,
|
153
154
|
});
|
154
155
|
if (!assetsUploadSuccess)
|
155
|
-
return (0, zephyr_edge_contract_1.ze_error)('Failed to upload assets.', assetsUploadSuccess);
|
156
|
+
return (0, zephyr_edge_contract_1.ze_error)("DE10017", 'Failed to upload assets.', assetsUploadSuccess);
|
156
157
|
if (missingAssets.length) {
|
157
158
|
yield (0, zephyr_agent_1.update_hash_list)(application_uid, assetsMap);
|
158
159
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vite-plugin-zephyr-partial.js","sourceRoot":"","sources":["../../src/lib/vite-plugin-zephyr-partial.ts"],"names":[],"mappings":";;;;AAOA,8BAA8B;AAE9B,+DAM8B;AAC9B,+CAcsB;AAEtB,uDAAoD;AACpD,6EAA0E;AAG1E,SAAgB,iBAAiB;IAC/B,IAAI,MAAM,GAAiB,EAAE,CAAC;IAC9B,MAAM,qBAAqB,GAAG,EAA2B,CAAC;IAE1D,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,CAAO,MAAsB,EAAE,EAAE;YAC/C,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;gBACnC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;gBAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B,CAAC,CAAC;QACL,CAAC,CAAA;QAED,WAAW,EAAE,CACX,OAAgC,EAChC,OAAqB,EACrB,EAAE;YACF,qBAAqB,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;YACxC,MAAM,GAAG,OAAO,CAAC;QACnB,CAAC,CAAA;QAED,WAAW,EAAE,GAAS,EAAE;YACtB,MAAM,YAAY,GAAkB,EAAE,CAAC;YAEvC,IAAI,qBAAqB,CAAC,SAAS,E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_edge_contract_1 = require("zephyr-edge-contract");
|
7
7
|
const zephyr_agent_1 = require("zephyr-agent");
|
8
8
|
const load_static_entries_1 = require("./load_static_entries");
|
9
|
+
const load_public_dir_1 = require("./load_public_dir");
|
9
10
|
function withZephyr() {
|
10
11
|
// todo: set correctly
|
11
12
|
let bundle = {};
|
@@ -26,8 +27,16 @@ function withZephyr() {
|
|
26
27
|
}),
|
27
28
|
closeBundle: () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
28
29
|
const publicAssets = [];
|
30
|
+
if (vite_internal_options.publicDir) {
|
31
|
+
const _public_assets = yield (0, load_public_dir_1.load_public_dir)({
|
32
|
+
outDir: vite_internal_options.outDir,
|
33
|
+
publicDir: vite_internal_options.publicDir,
|
34
|
+
});
|
35
|
+
publicAssets.push(..._public_assets);
|
36
|
+
}
|
29
37
|
const _static_assets = yield (0, load_static_entries_1.load_static_entries)({
|
30
38
|
root: vite_internal_options.root,
|
39
|
+
outDir: vite_internal_options.outDir,
|
31
40
|
bundle,
|
32
41
|
});
|
33
42
|
publicAssets.push(..._static_assets);
|
@@ -41,26 +50,25 @@ function _zephyr(options) {
|
|
41
50
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
42
51
|
const { assets: _assets, vite_internal_options } = options;
|
43
52
|
const path_to_execution_dir = vite_internal_options.root;
|
44
|
-
(0, zephyr_edge_contract_1.ze_log)('Configuring with Zephyr');
|
53
|
+
(0, zephyr_edge_contract_1.ze_log)('Configuring with Zephyr...');
|
45
54
|
const packageJson = yield (0, zephyr_agent_1.getPackageJson)(path_to_execution_dir);
|
46
|
-
(0, zephyr_edge_contract_1.ze_log)('Loaded
|
55
|
+
(0, zephyr_edge_contract_1.ze_log)('Loaded package.json.', packageJson);
|
47
56
|
if (!packageJson)
|
48
|
-
return (0, zephyr_edge_contract_1.ze_error)('
|
57
|
+
return (0, zephyr_edge_contract_1.ze_error)('BU10010', 'package.json not found.');
|
49
58
|
const gitInfo = yield (0, zephyr_agent_1.getGitInfo)();
|
50
|
-
(0, zephyr_edge_contract_1.ze_log)('Loaded Git Info', gitInfo);
|
51
|
-
if (!gitInfo ||
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
return (0, zephyr_edge_contract_1.ze_error)('Could not get git info');
|
59
|
+
(0, zephyr_edge_contract_1.ze_log)('Loaded Git Info.', gitInfo);
|
60
|
+
if (!gitInfo || !(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.org) || !(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.project))
|
61
|
+
return (0, zephyr_edge_contract_1.ze_error)('BU10016', `Could not get git info. \n Can you confirm this directory has initialized as a git repository? `);
|
62
|
+
if (!(packageJson === null || packageJson === void 0 ? void 0 : packageJson.name))
|
63
|
+
return (0, zephyr_edge_contract_1.ze_error)('BU10013', 'package.json must have a name and version.');
|
56
64
|
const application_uid = (0, zephyr_edge_contract_1.createApplicationUID)({
|
57
65
|
org: gitInfo.app.org,
|
58
66
|
project: gitInfo.app.project,
|
59
67
|
name: packageJson === null || packageJson === void 0 ? void 0 : packageJson.name,
|
60
68
|
});
|
61
|
-
(0, zephyr_edge_contract_1.ze_log)('Going to check auth token or get it');
|
69
|
+
(0, zephyr_edge_contract_1.ze_log)('Going to check auth token or get it...');
|
62
70
|
yield (0, zephyr_agent_1.checkAuth)();
|
63
|
-
(0, zephyr_edge_contract_1.ze_log)('Got auth token, going to get application configuration and build id');
|
71
|
+
(0, zephyr_edge_contract_1.ze_log)('Got auth token, going to get application configuration and build id...');
|
64
72
|
const [appConfig, buildId, hash_set] = yield Promise.all([
|
65
73
|
(0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }),
|
66
74
|
(0, zephyr_agent_1.getBuildId)(application_uid).catch((err) => {
|
@@ -76,7 +84,7 @@ function _zephyr(options) {
|
|
76
84
|
const { username, email, EDGE_URL } = appConfig;
|
77
85
|
(0, zephyr_edge_contract_1.ze_log)('Got application configuration', { username, email, EDGE_URL });
|
78
86
|
if (!buildId)
|
79
|
-
return (0, zephyr_edge_contract_1.ze_error)('
|
87
|
+
return (0, zephyr_edge_contract_1.ze_error)('BU10019', 'Could not get build id.');
|
80
88
|
const pluginOptions = {
|
81
89
|
pluginName: 'rollup-plugin-zephyr',
|
82
90
|
application_uid,
|
@@ -97,119 +105,42 @@ function _zephyr(options) {
|
|
97
105
|
},
|
98
106
|
mfConfig: void 0,
|
99
107
|
};
|
100
|
-
(0, zephyr_edge_contract_1.ze_log)('
|
108
|
+
(0, zephyr_edge_contract_1.ze_log)('\nzephyr agent started.\n');
|
101
109
|
const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
|
102
110
|
const zeStart = Date.now();
|
103
|
-
const extractBuffer = (asset) => {
|
104
|
-
switch (asset.type) {
|
105
|
-
case 'chunk':
|
106
|
-
return asset.code;
|
107
|
-
case 'asset':
|
108
|
-
return typeof asset.source === 'string'
|
109
|
-
? asset.source
|
110
|
-
: new TextDecoder().decode(asset.source);
|
111
|
-
default:
|
112
|
-
return void 0;
|
113
|
-
}
|
114
|
-
};
|
115
|
-
const getAssetType = (asset) => asset.type;
|
116
111
|
const partialAssetMap = yield (0, zephyr_edge_contract_1.getPartialAssetMap)(application_uid);
|
117
112
|
yield (0, zephyr_edge_contract_1.removePartialAssetMap)(application_uid);
|
118
113
|
const assets = Object.assign({}, _assets, ...Object.values(partialAssetMap !== null && partialAssetMap !== void 0 ? partialAssetMap : {}));
|
119
|
-
const assetsMap =
|
120
|
-
const asset = assets[filepath];
|
121
|
-
const buffer = extractBuffer(asset);
|
122
|
-
if (!buffer) {
|
123
|
-
logEvent({
|
124
|
-
action: 'ze:build:assets:unknown-asset-type',
|
125
|
-
level: 'error',
|
126
|
-
message: `unknown asset type: ${getAssetType(asset)}`,
|
127
|
-
});
|
128
|
-
1;
|
129
|
-
return memo;
|
130
|
-
}
|
131
|
-
const assetMap = (0, zephyr_agent_1.getZeBuildAsset)({ filepath, content: buffer });
|
132
|
-
memo[assetMap.hash] = assetMap;
|
133
|
-
return memo;
|
134
|
-
}, {});
|
135
|
-
const snapshot = (0, zephyr_agent_1.createSnapshot)({
|
136
|
-
options: pluginOptions,
|
137
|
-
assets: Object.assign({}, assetsMap, ...Object.values(partialAssetMap !== null && partialAssetMap !== void 0 ? partialAssetMap : {})),
|
138
|
-
username,
|
139
|
-
email,
|
140
|
-
});
|
141
|
-
yield (0, zephyr_agent_1.zeUploadSnapshot)(pluginOptions, snapshot).catch((err) => (0, zephyr_edge_contract_1.ze_error)('Failed to upload snapshot.', err));
|
114
|
+
const assetsMap = (0, zephyr_agent_1.buildAssetsMap)(assets, extractBuffer, getAssetType);
|
142
115
|
const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
|
143
|
-
|
144
|
-
missingAssets,
|
145
|
-
assetsMap,
|
146
|
-
count: Object.keys(assets).length,
|
147
|
-
});
|
148
|
-
if (!assetsUploadSuccess)
|
149
|
-
return (0, zephyr_edge_contract_1.ze_error)('Failed to upload assets.', assetsUploadSuccess);
|
150
|
-
if (missingAssets.length) {
|
151
|
-
yield (0, zephyr_agent_1.update_hash_list)(application_uid, assetsMap);
|
152
|
-
}
|
153
|
-
const version = (0, zephyr_edge_contract_1.createSnapshotId)(pluginOptions);
|
154
|
-
const dashData = {
|
155
|
-
id: pluginOptions.application_uid,
|
156
|
-
name: packageJson.name,
|
157
|
-
// name: pluginOptions.mfConfig?.name,
|
158
|
-
edge: { url: EDGE_URL },
|
159
|
-
app: Object.assign({}, pluginOptions.app, {
|
160
|
-
buildId: pluginOptions.zeConfig.buildId,
|
161
|
-
}),
|
162
|
-
version,
|
163
|
-
git: pluginOptions.git,
|
164
|
-
// remote: pluginOptions.mfConfig?.filename,
|
165
|
-
// remotes: Object.keys(pluginOptions.mfConfig?.remotes || {}),
|
166
|
-
context: {
|
167
|
-
isCI: pluginOptions.isCI,
|
168
|
-
},
|
169
|
-
dependencies: [],
|
170
|
-
devDependencies: [],
|
171
|
-
optionalDependencies: [],
|
172
|
-
metadata: {},
|
173
|
-
overrides: [
|
174
|
-
/* {
|
175
|
-
"id": "react-dom",
|
176
|
-
"name": "react-dom",
|
177
|
-
"version": "18.2.0",
|
178
|
-
"location": "react-dom",
|
179
|
-
"applicationID": "react-dom"
|
180
|
-
},
|
181
|
-
{
|
182
|
-
"id": "react",
|
183
|
-
"name": "react",
|
184
|
-
"version": "18.2.0",
|
185
|
-
"location": "react",
|
186
|
-
"applicationID": "react"
|
187
|
-
}*/
|
188
|
-
],
|
189
|
-
consumes: [],
|
190
|
-
modules: [
|
191
|
-
/* {
|
192
|
-
"id": "GreenRecos:GreenRecos",
|
193
|
-
"name": "GreenRecos",
|
194
|
-
"applicationID": "GreenRecos",
|
195
|
-
"requires": [
|
196
|
-
"react"
|
197
|
-
],
|
198
|
-
"file": "./src/app/team-green-recos.tsx"
|
199
|
-
}*/
|
200
|
-
],
|
201
|
-
sha: pluginOptions.git.commit,
|
202
|
-
// todo: @deprecate
|
203
|
-
buildHash: pluginOptions.git.commit,
|
204
|
-
};
|
205
|
-
const envs = yield (0, zephyr_agent_1.zeUploadBuildStats)(dashData);
|
206
|
-
if (!envs)
|
207
|
-
return (0, zephyr_edge_contract_1.ze_error)('Did not receive envs from build stats upload. Exiting.');
|
208
|
-
yield (0, zephyr_agent_1.zeEnableSnapshotOnEdge)({
|
116
|
+
yield (0, zephyr_agent_1.upload)({
|
209
117
|
pluginOptions,
|
210
|
-
|
118
|
+
assets: {
|
119
|
+
assetsMap,
|
120
|
+
missingAssets,
|
121
|
+
outputPath: vite_internal_options.outDir,
|
122
|
+
count: Object.keys(assets).length,
|
123
|
+
},
|
124
|
+
getDashData: zephyr_agent_1.zeGetDashData,
|
125
|
+
appConfig,
|
211
126
|
zeStart,
|
127
|
+
uploadConfig: appConfig.uploadConfig,
|
212
128
|
});
|
213
129
|
});
|
214
130
|
}
|
131
|
+
function extractBuffer(asset) {
|
132
|
+
switch (asset.type) {
|
133
|
+
case 'chunk':
|
134
|
+
return asset.code;
|
135
|
+
case 'asset':
|
136
|
+
return typeof asset.source === 'string'
|
137
|
+
? asset.source
|
138
|
+
: new TextDecoder().decode(asset.source);
|
139
|
+
default:
|
140
|
+
return void 0;
|
141
|
+
}
|
142
|
+
}
|
143
|
+
function getAssetType(asset) {
|
144
|
+
return asset.type;
|
145
|
+
}
|
215
146
|
//# 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":";;;;AAMA,8BAA8B;AAG9B,+
|
1
|
+
{"version":3,"file":"vite-plugin-zephyr.js","sourceRoot":"","sources":["../../src/lib/vite-plugin-zephyr.ts"],"names":[],"mappings":";;;;AAMA,8BAA8B;AAG9B,+DAM8B;AAC9B,+CAYsB;AAEtB,+DAA4D;AAE5D,uDAAoD;AASpD,SAAgB,UAAU;IACxB,sBAAsB;IACtB,IAAI,MAAM,GAAiB,EAAE,CAAC;IAE9B,MAAM,qBAAqB,GAAG,EAAkC,CAAC;IAEjE,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,CAAO,MAAsB,EAAE,EAAE;YAC/C,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;gBACnC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;gBAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B,CAAC,CAAC;QACL,CAAC,CAAA;QACD,WAAW,EAAE,CACX,OAAgC,EAChC,OAAqB,EACrB,EAAE;YACF,MAAM,GAAG,OAAO,CAAC;QACnB,CAAC,CAAA;QACD,WAAW,EAAE,GAAS,EAAE;YACtB,MAAM,YAAY,GAAkB,EAAE,CAAC;YAEvC,IAAI,qBAAqB,CAAC,SAAS,EAAE,CAAC;gBACpC,MAAM,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,MAAM,SAAS,GAAG,IAAA,6BAAc,EAAC,MAAM,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;QACtE,MAAM,aAAa,GAAG,IAAA,iCAAkB,EAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QAElE,MAAM,IAAA,qBAAM,EAAC;YACX,aAAa;YACb,MAAM,EAAE;gBACN,SAAS;gBACT,aAAa;gBACb,UAAU,EAAE,qBAAqB,CAAC,MAAM;gBACxC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;aAClC;YACD,WAAW,EAAE,4BAAa;YAC1B,SAAS;YACT,OAAO;YACP,YAAY,EAAE,SAAS,CAAC,YAAY;SACrC,CAAC,CAAC;IACL,CAAC;CAAA;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;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.
|
3
|
+
"version": "0.0.14",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -10,7 +10,7 @@
|
|
10
10
|
"dependencies": {
|
11
11
|
"vite": "^5",
|
12
12
|
"rollup": "^4",
|
13
|
-
"is-ci": "^3
|
13
|
+
"is-ci": "^3",
|
14
14
|
"zephyr-edge-contract": "workspace:*",
|
15
15
|
"zephyr-agent": "workspace:*"
|
16
16
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite-plugin-zephyr",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.14",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -8,8 +8,8 @@
|
|
8
8
|
"vite": "^5",
|
9
9
|
"rollup": "^4",
|
10
10
|
"is-ci": "^3",
|
11
|
-
"zephyr-edge-contract": "0.0.
|
12
|
-
"zephyr-agent": "0.0.
|
11
|
+
"zephyr-edge-contract": "0.0.14",
|
12
|
+
"zephyr-agent": "0.0.14"
|
13
13
|
},
|
14
14
|
"devDependencies": {
|
15
15
|
"@types/is-ci": "^3.0.4"
|
package/.eslintrc.json
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": ["../../.eslintrc.json"],
|
3
|
-
"ignorePatterns": ["!**/*"],
|
4
|
-
"overrides": [
|
5
|
-
{
|
6
|
-
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
7
|
-
"rules": {}
|
8
|
-
},
|
9
|
-
{
|
10
|
-
"files": ["*.ts", "*.tsx"],
|
11
|
-
"rules": {}
|
12
|
-
},
|
13
|
-
{
|
14
|
-
"files": ["*.js", "*.jsx"],
|
15
|
-
"rules": {}
|
16
|
-
},
|
17
|
-
{
|
18
|
-
"files": ["*.json"],
|
19
|
-
"parser": "jsonc-eslint-parser",
|
20
|
-
"rules": {
|
21
|
-
"@nx/dependency-checks": "error"
|
22
|
-
}
|
23
|
-
}
|
24
|
-
]
|
25
|
-
}
|
package/jest.config.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
/* eslint-disable */
|
2
|
-
export default {
|
3
|
-
displayName: 'vite-plugin-zephyr',
|
4
|
-
preset: '../../jest.preset.js',
|
5
|
-
testEnvironment: 'node',
|
6
|
-
transform: {
|
7
|
-
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
8
|
-
},
|
9
|
-
moduleFileExtensions: ['ts', 'js', 'html'],
|
10
|
-
coverageDirectory: '../../coverage/libs/vite-plugin-zephyr',
|
11
|
-
};
|
package/project.json
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "vite-plugin-zephyr",
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
4
|
-
"sourceRoot": "libs/vite-plugin-zephyr/src",
|
5
|
-
"projectType": "library",
|
6
|
-
"tags": [],
|
7
|
-
"targets": {
|
8
|
-
"build": {
|
9
|
-
"executor": "@nx/js:tsc",
|
10
|
-
"outputs": ["{options.outputPath}"],
|
11
|
-
"options": {
|
12
|
-
"rootDir": "libs/vite-plugin-zephyr/src",
|
13
|
-
"outputPath": "libs/vite-plugin-zephyr/dist",
|
14
|
-
"tsConfig": "libs/vite-plugin-zephyr/tsconfig.lib.json",
|
15
|
-
"main": "libs/vite-plugin-zephyr/src/index.ts"
|
16
|
-
}
|
17
|
-
},
|
18
|
-
"nx-release-publish": {
|
19
|
-
"options": {
|
20
|
-
"packageRoot": "dist\\{projectRoot}"
|
21
|
-
}
|
22
|
-
},
|
23
|
-
"lint": {
|
24
|
-
"executor": "@nx/eslint:lint"
|
25
|
-
},
|
26
|
-
"test": {
|
27
|
-
"executor": "@nx/jest:jest",
|
28
|
-
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
29
|
-
"options": {
|
30
|
-
"jestConfig": "libs/vite-plugin-zephyr/jest.config.ts"
|
31
|
-
}
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
package/tsconfig.json
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": "../../tsconfig.base.json",
|
3
|
-
"compilerOptions": {
|
4
|
-
"module": "commonjs",
|
5
|
-
"forceConsistentCasingInFileNames": true,
|
6
|
-
"strict": true,
|
7
|
-
"noImplicitOverride": true,
|
8
|
-
"noPropertyAccessFromIndexSignature": true,
|
9
|
-
"noImplicitReturns": true,
|
10
|
-
"noFallthroughCasesInSwitch": true
|
11
|
-
},
|
12
|
-
"files": [],
|
13
|
-
"include": [],
|
14
|
-
"references": [
|
15
|
-
{
|
16
|
-
"path": "./tsconfig.lib.json"
|
17
|
-
},
|
18
|
-
{
|
19
|
-
"path": "./tsconfig.spec.json"
|
20
|
-
}
|
21
|
-
]
|
22
|
-
}
|
package/tsconfig.lib.json
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": "./tsconfig.json",
|
3
|
-
"compilerOptions": {
|
4
|
-
"module": "commonjs",
|
5
|
-
"outDir": "../../dist/out-tsc",
|
6
|
-
"declaration": true,
|
7
|
-
"types": ["node"]
|
8
|
-
},
|
9
|
-
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
|
10
|
-
"include": ["src/**/*.ts"]
|
11
|
-
}
|
package/tsconfig.spec.json
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": "./tsconfig.json",
|
3
|
-
"compilerOptions": {
|
4
|
-
"outDir": "../../dist/out-tsc",
|
5
|
-
"module": "commonjs",
|
6
|
-
"types": ["jest", "node"]
|
7
|
-
},
|
8
|
-
"include": [
|
9
|
-
"jest.config.ts",
|
10
|
-
"src/**/*.test.ts",
|
11
|
-
"src/**/*.spec.ts",
|
12
|
-
"src/**/*.d.ts"
|
13
|
-
]
|
14
|
-
}
|