vite-plugin-zephyr 0.0.13 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +0 -1
- package/dist/lib/load_extra_files_from_dist.d.ts +1 -0
- package/dist/lib/load_extra_files_from_dist.js +2 -1
- package/dist/lib/load_extra_files_from_dist.js.map +1 -1
- package/dist/lib/load_public_dir.js +2 -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 +2 -1
- package/dist/lib/load_static_entries.js.map +1 -1
- package/dist/lib/vite-plugin-zephyr-partial.d.ts +2 -2
- package/dist/lib/vite-plugin-zephyr-partial.js +26 -19
- package/dist/lib/vite-plugin-zephyr-partial.js.map +1 -1
- package/dist/lib/vite-plugin-zephyr.d.ts +1 -1
- package/dist/lib/vite-plugin-zephyr.js +56 -117
- 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
package/README.md
CHANGED
@@ -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);
|
@@ -27,6 +27,7 @@ function load_extra_files_from_dist(props) {
|
|
27
27
|
needsCodeReference: false,
|
28
28
|
source: yield (0, node_util_1.promisify)(node_fs_1.readFile)(destFile),
|
29
29
|
type: 'asset',
|
30
|
+
originalFileName: file,
|
30
31
|
});
|
31
32
|
}
|
32
33
|
}
|
@@ -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,CAAC,KAAoC;;QACnF,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;wBACb,gBAAgB,EAAE,IAAI;qBACvB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC,CAAA,CAAC;QACF,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;QAE7B,OAAO,YAAY,CAAC;IACtB,CAAC;CAAA;AA7BD,gEA6BC"}
|
@@ -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({
|
@@ -28,6 +28,7 @@ function load_public_dir(props) {
|
|
28
28
|
needsCodeReference: false,
|
29
29
|
source: yield (0, node_util_1.promisify)(node_fs_1.readFile)(srcFile),
|
30
30
|
type: 'asset',
|
31
|
+
originalFileName: (0, node_path_1.basename)(file),
|
31
32
|
});
|
32
33
|
}
|
33
34
|
}
|
@@ -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,
|
1
|
+
{"version":3,"file":"load_public_dir.js","sourceRoot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,SAAS,EAAE,MAAM,CAAC,CAAC;QACjC,OAAO,YAAY,CAAC;IACtB,CAAC;CAAA;AA5BD,0CA4BC"}
|
@@ -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);
|
@@ -32,6 +32,7 @@ function load_static_entries(props) {
|
|
32
32
|
needsCodeReference: false,
|
33
33
|
source: yield (0, node_util_1.promisify)(node_fs_1.readFile)(destFile),
|
34
34
|
type: 'asset',
|
35
|
+
originalFileName: file,
|
35
36
|
});
|
36
37
|
}
|
37
38
|
}
|
@@ -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,CAAC,KAA+B;;QACvE,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;wBACb,gBAAgB,EAAE,IAAI;qBACvB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC,CAAA,CAAC;QACF,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;QAC7B,OAAO,YAAY,CAAC;IACtB,CAAC;CAAA;AA7BD,kDA6BC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import type { NormalizedOutputOptions, OutputBundle } from 'rollup';
|
2
|
+
import type { ResolvedConfig } from 'vite';
|
3
3
|
export declare function withZephyrPartial(): {
|
4
4
|
name: string;
|
5
5
|
apply: string;
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withZephyrPartial = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const isCI = require("is-ci");
|
6
|
-
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
7
6
|
const zephyr_agent_1 = require("zephyr-agent");
|
8
|
-
const
|
7
|
+
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
9
8
|
const load_extra_files_from_dist_1 = require("./load_extra_files_from_dist");
|
9
|
+
const load_public_dir_1 = require("./load_public_dir");
|
10
10
|
function withZephyrPartial() {
|
11
11
|
let bundle = {};
|
12
12
|
const vite_internal_options = {};
|
@@ -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,25 @@ 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)('ZE10010', '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
|
-
|
63
|
-
|
64
|
-
|
65
|
-
return (0, zephyr_edge_contract_1.ze_error)('Could not get git info');
|
62
|
+
if (!gitInfo || !(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.org) || !(gitInfo === null || gitInfo === void 0 ? void 0 : gitInfo.app.project))
|
63
|
+
return (0, zephyr_edge_contract_1.ze_error)('ZE10016', 'Could not get git info. Can you confirm the current directory has initialized as a git repository?');
|
64
|
+
if (!(packageJson === null || packageJson === void 0 ? void 0 : packageJson.name))
|
65
|
+
return (0, zephyr_edge_contract_1.ze_error)('ZE10013', 'package.json must have a name and version.');
|
66
66
|
const application_uid = (0, zephyr_edge_contract_1.createApplicationUID)({
|
67
67
|
org: gitInfo.app.org,
|
68
68
|
project: gitInfo.app.project,
|
69
69
|
name: packageJson === null || packageJson === void 0 ? void 0 : packageJson.name,
|
70
70
|
});
|
71
|
-
(0, zephyr_edge_contract_1.ze_log)('Going to check auth token or get it');
|
71
|
+
(0, zephyr_edge_contract_1.ze_log)('Going to check auth token or get it...');
|
72
72
|
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');
|
73
|
+
(0, zephyr_edge_contract_1.ze_log)('Got auth token, going to get application configuration and build id...');
|
74
74
|
const [appConfig, buildId, hash_set] = yield Promise.all([
|
75
75
|
(0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }),
|
76
76
|
(0, zephyr_agent_1.getBuildId)(application_uid).catch((err) => {
|
@@ -86,7 +86,7 @@ function _zephyr_partial(options) {
|
|
86
86
|
const { username, email, EDGE_URL } = appConfig;
|
87
87
|
(0, zephyr_edge_contract_1.ze_log)('Got application configuration', { username, email, EDGE_URL });
|
88
88
|
if (!buildId)
|
89
|
-
return (0, zephyr_edge_contract_1.ze_error)('
|
89
|
+
return (0, zephyr_edge_contract_1.ze_error)('ZE10019', 'Could not get build id.');
|
90
90
|
const pluginOptions = {
|
91
91
|
pluginName: 'rollup-plugin-zephyr',
|
92
92
|
application_uid,
|
@@ -107,17 +107,24 @@ function _zephyr_partial(options) {
|
|
107
107
|
},
|
108
108
|
mfConfig: void 0,
|
109
109
|
};
|
110
|
-
(0, zephyr_edge_contract_1.ze_log)('zephyr agent started.');
|
110
|
+
(0, zephyr_edge_contract_1.ze_log)('\n--------\n zephyr agent started. \n ------ \n');
|
111
111
|
const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
|
112
|
+
logEvent({
|
113
|
+
level: 'info',
|
114
|
+
action: 'build:info:user',
|
115
|
+
message: `Hi ${(0, zephyr_edge_contract_1.cyanBright)(username)}!`,
|
116
|
+
}, {
|
117
|
+
level: 'info',
|
118
|
+
action: 'build:info:id',
|
119
|
+
message: `Building to ${(0, zephyr_edge_contract_1.blackBright)(application_uid)}${(0, zephyr_edge_contract_1.yellow)(`#${buildId}`)}`,
|
120
|
+
});
|
112
121
|
const zeStart = Date.now();
|
113
122
|
const extractBuffer = (asset) => {
|
114
123
|
switch (asset.type) {
|
115
124
|
case 'chunk':
|
116
125
|
return asset.code;
|
117
126
|
case 'asset':
|
118
|
-
return typeof asset.source === 'string'
|
119
|
-
? asset.source
|
120
|
-
: new TextDecoder().decode(asset.source);
|
127
|
+
return typeof asset.source === 'string' ? asset.source : new TextDecoder().decode(asset.source);
|
121
128
|
default:
|
122
129
|
return void 0;
|
123
130
|
}
|
@@ -144,7 +151,7 @@ function _zephyr_partial(options) {
|
|
144
151
|
username,
|
145
152
|
email,
|
146
153
|
});
|
147
|
-
yield (0, zephyr_agent_1.zeUploadSnapshot)(pluginOptions, snapshot).catch((err) => (0, zephyr_edge_contract_1.ze_error)('Failed to upload snapshot.', err));
|
154
|
+
yield (0, zephyr_agent_1.zeUploadSnapshot)({ pluginOptions, snapshot, appConfig }).catch((err) => (0, zephyr_edge_contract_1.ze_error)('ZE10018', 'Failed to upload snapshot.', err));
|
148
155
|
const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
|
149
156
|
const assetsUploadSuccess = yield (0, zephyr_agent_1.zeUploadAssets)(pluginOptions, {
|
150
157
|
missingAssets,
|
@@ -152,7 +159,7 @@ function _zephyr_partial(options) {
|
|
152
159
|
count: Object.keys(assets).length,
|
153
160
|
});
|
154
161
|
if (!assetsUploadSuccess)
|
155
|
-
return (0, zephyr_edge_contract_1.ze_error)('Failed to upload assets.', assetsUploadSuccess);
|
162
|
+
return (0, zephyr_edge_contract_1.ze_error)('ZE10017', 'Failed to upload assets.', assetsUploadSuccess);
|
156
163
|
if (missingAssets.length) {
|
157
164
|
yield (0, zephyr_agent_1.update_hash_list)(application_uid, assetsMap);
|
158
165
|
}
|
@@ -160,7 +167,7 @@ function _zephyr_partial(options) {
|
|
160
167
|
logEvent({
|
161
168
|
level: 'info',
|
162
169
|
action: 'build:deploy:done',
|
163
|
-
message: `
|
170
|
+
message: `Build deployed in ${(0, zephyr_edge_contract_1.yellow)(`${Date.now() - zeStart}`)}ms`,
|
164
171
|
});
|
165
172
|
});
|
166
173
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vite-plugin-zephyr-partial.js","sourceRoot":"","sources":["../../src/lib/vite-plugin-zephyr-partial.ts"],"names":[],"mappings":";;;;
|
1
|
+
{"version":3,"file":"vite-plugin-zephyr-partial.js","sourceRoot":"","sources":["../../src/lib/vite-plugin-zephyr-partial.ts"],"names":[],"mappings":";;;;AAAA,8BAA8B;AAG9B,+CAcsB;AACtB,+DAW8B;AAC9B,6EAA0E;AAC1E,uDAAoD;AAGpD,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;gBA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AAC,eAAe,EAAE,MAAA,qBAAqB,CAAC,UAAU,mCAAI,SAAS,EAAE,SAAS,CAAC,CAAC;QAErG,QAAQ,CAAC;YACP,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,mBAAmB;YAC3B,OAAO,EAAE,qBAAqB,IAAA,6BAAM,EAAC,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC,IAAI;SACpE,CAAC,CAAC;IACL,CAAC;CAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Plugin } from 'vite';
|
1
|
+
import type { Plugin } from 'vite';
|
2
2
|
export declare function withZephyr(): Plugin;
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withZephyr = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const isCI = require("is-ci");
|
6
|
-
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
7
6
|
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");
|
8
9
|
const load_static_entries_1 = require("./load_static_entries");
|
9
10
|
function withZephyr() {
|
10
11
|
// todo: set correctly
|
@@ -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)('ZE10010', '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)('ZE10016', '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)('ZE10013', '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)('ZE10019', 'Could not get build id.');
|
80
88
|
const pluginOptions = {
|
81
89
|
pluginName: 'rollup-plugin-zephyr',
|
82
90
|
application_uid,
|
@@ -97,119 +105,50 @@ 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);
|
110
|
+
logEvent({
|
111
|
+
level: 'info',
|
112
|
+
action: 'build:info:user',
|
113
|
+
message: `Hi ${(0, zephyr_edge_contract_1.cyanBright)(username)}!`,
|
114
|
+
}, {
|
115
|
+
level: 'info',
|
116
|
+
action: 'build:info:id',
|
117
|
+
message: `Building to ${(0, zephyr_edge_contract_1.blackBright)(application_uid)}${(0, zephyr_edge_contract_1.yellow)(`#${buildId}`)}`,
|
118
|
+
});
|
102
119
|
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
120
|
const partialAssetMap = yield (0, zephyr_edge_contract_1.getPartialAssetMap)(application_uid);
|
117
121
|
yield (0, zephyr_edge_contract_1.removePartialAssetMap)(application_uid);
|
118
122
|
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));
|
123
|
+
const assetsMap = (0, zephyr_agent_1.buildAssetsMap)(assets, extractBuffer, getAssetType);
|
142
124
|
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)({
|
125
|
+
yield (0, zephyr_agent_1.upload)({
|
209
126
|
pluginOptions,
|
210
|
-
|
127
|
+
assets: {
|
128
|
+
assetsMap,
|
129
|
+
missingAssets,
|
130
|
+
outputPath: vite_internal_options.outDir,
|
131
|
+
count: Object.keys(assets).length,
|
132
|
+
},
|
133
|
+
// @ts-expect-error TODO: fix this types to get legacy and current working
|
134
|
+
getDashData: zephyr_agent_1.zeGetDashData,
|
135
|
+
appConfig,
|
211
136
|
zeStart,
|
137
|
+
uploadConfig: appConfig.uploadConfig,
|
212
138
|
});
|
213
139
|
});
|
214
140
|
}
|
141
|
+
function extractBuffer(asset) {
|
142
|
+
switch (asset.type) {
|
143
|
+
case 'chunk':
|
144
|
+
return asset.code;
|
145
|
+
case 'asset':
|
146
|
+
return typeof asset.source === 'string' ? asset.source : new TextDecoder().decode(asset.source);
|
147
|
+
default:
|
148
|
+
return void 0;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
function getAssetType(asset) {
|
152
|
+
return asset.type;
|
153
|
+
}
|
215
154
|
//# 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":";;;;
|
1
|
+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a,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,0EAA0E;YAC1E,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,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClG;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.15",
|
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.15",
|
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.15",
|
12
|
+
"zephyr-agent": "0.0.15"
|
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
|
-
}
|