rollup-plugin-zephyr 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withZephyr = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const isCI = require("is-ci");
|
|
5
|
+
const isCI = tslib_1.__importStar(require("is-ci"));
|
|
6
6
|
const zephyr_agent_1 = require("zephyr-agent");
|
|
7
7
|
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
8
8
|
const get_assets_map_1 = require("./utils/get-assets-map");
|
|
@@ -20,99 +20,95 @@ function withZephyr() {
|
|
|
20
20
|
let _state;
|
|
21
21
|
return {
|
|
22
22
|
name: 'with-zephyr',
|
|
23
|
-
buildStart: (options) =>
|
|
24
|
-
_state = (function zephyr_init() {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
buildStart: async (options) => {
|
|
24
|
+
_state = (async function zephyr_init() {
|
|
25
|
+
(0, zephyr_edge_contract_1.ze_log)('Setting up zephyr agent configuration.');
|
|
26
|
+
const _zephyrOptions = { wait_for_index_html: false };
|
|
27
|
+
const path_to_execution_dir = getInputFolder(options);
|
|
28
|
+
const [packageJson, gitInfo] = await Promise.all([(0, zephyr_agent_1.getPackageJson)(path_to_execution_dir), (0, zephyr_agent_1.getGitInfo)()]);
|
|
29
|
+
const application_uid = (0, zephyr_edge_contract_1.createApplicationUID)({
|
|
30
|
+
org: gitInfo.app.org,
|
|
31
|
+
project: gitInfo.app.project,
|
|
32
|
+
name: packageJson.name,
|
|
33
|
+
});
|
|
34
|
+
await (0, zephyr_agent_1.checkAuth)();
|
|
35
|
+
const [appConfig, buildId, hash_set] = await Promise.all([
|
|
36
|
+
(0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }),
|
|
37
|
+
(0, zephyr_agent_1.getBuildId)(application_uid),
|
|
38
|
+
(0, zephyr_agent_1.get_hash_list)(application_uid),
|
|
39
|
+
]);
|
|
40
|
+
const { username, email, EDGE_URL } = appConfig;
|
|
41
|
+
(0, zephyr_edge_contract_1.ze_log)('Got application configuration: ', {
|
|
42
|
+
username,
|
|
43
|
+
email,
|
|
44
|
+
EDGE_URL,
|
|
45
|
+
});
|
|
46
|
+
if (!buildId)
|
|
47
|
+
return (0, zephyr_edge_contract_1.ze_error)('ERR_GET_BUILD_ID');
|
|
48
|
+
(0, zephyr_edge_contract_1.ze_log)(`Got build id: ${buildId}`);
|
|
49
|
+
const pluginOptions = {
|
|
50
|
+
pluginName: 'rollup-plugin-zephyr',
|
|
51
|
+
application_uid,
|
|
52
|
+
buildEnv: 'local',
|
|
53
|
+
username,
|
|
54
|
+
app: {
|
|
55
|
+
name: packageJson.name,
|
|
56
|
+
version: packageJson.version,
|
|
31
57
|
org: gitInfo.app.org,
|
|
32
58
|
project: gitInfo.app.project,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(0, zephyr_edge_contract_1.
|
|
50
|
-
const pluginOptions = {
|
|
51
|
-
pluginName: 'rollup-plugin-zephyr',
|
|
52
|
-
application_uid,
|
|
53
|
-
buildEnv: 'local',
|
|
54
|
-
username,
|
|
55
|
-
app: {
|
|
56
|
-
name: packageJson.name,
|
|
57
|
-
version: packageJson.version,
|
|
58
|
-
org: gitInfo.app.org,
|
|
59
|
-
project: gitInfo.app.project,
|
|
60
|
-
},
|
|
61
|
-
git: gitInfo.git,
|
|
62
|
-
isCI: isCI,
|
|
63
|
-
zeConfig: {
|
|
64
|
-
user: username,
|
|
65
|
-
edge_url: EDGE_URL,
|
|
66
|
-
buildId: buildId,
|
|
67
|
-
},
|
|
68
|
-
mfConfig: void 0,
|
|
69
|
-
wait_for_index_html: _zephyrOptions === null || _zephyrOptions === void 0 ? void 0 : _zephyrOptions.wait_for_index_html,
|
|
70
|
-
};
|
|
71
|
-
const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
|
|
72
|
-
logEvent({
|
|
73
|
-
level: 'info',
|
|
74
|
-
action: 'build:info:user',
|
|
75
|
-
ignore: true,
|
|
76
|
-
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`,
|
|
77
|
-
});
|
|
78
|
-
return {
|
|
79
|
-
appConfig,
|
|
80
|
-
buildId,
|
|
81
|
-
hash_set,
|
|
82
|
-
pluginOptions,
|
|
83
|
-
};
|
|
59
|
+
},
|
|
60
|
+
git: gitInfo.git,
|
|
61
|
+
isCI: isCI,
|
|
62
|
+
zeConfig: {
|
|
63
|
+
user: username,
|
|
64
|
+
edge_url: EDGE_URL,
|
|
65
|
+
buildId: buildId,
|
|
66
|
+
},
|
|
67
|
+
mfConfig: void 0,
|
|
68
|
+
wait_for_index_html: _zephyrOptions === null || _zephyrOptions === void 0 ? void 0 : _zephyrOptions.wait_for_index_html,
|
|
69
|
+
};
|
|
70
|
+
const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
|
|
71
|
+
logEvent({
|
|
72
|
+
level: 'info',
|
|
73
|
+
action: 'build:info:user',
|
|
74
|
+
ignore: true,
|
|
75
|
+
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`,
|
|
84
76
|
});
|
|
77
|
+
return {
|
|
78
|
+
appConfig,
|
|
79
|
+
buildId,
|
|
80
|
+
hash_set,
|
|
81
|
+
pluginOptions,
|
|
82
|
+
};
|
|
85
83
|
})();
|
|
86
|
-
}
|
|
87
|
-
writeBundle: (options, bundle) =>
|
|
84
|
+
},
|
|
85
|
+
writeBundle: async (options, bundle) => {
|
|
88
86
|
const zeStart = Date.now();
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
zeStart,
|
|
111
|
-
});
|
|
87
|
+
await (async function zephyr_upload(props) {
|
|
88
|
+
(0, zephyr_edge_contract_1.ze_log)('zephyr agent started...');
|
|
89
|
+
const { state, bundle } = props;
|
|
90
|
+
const _state = await state;
|
|
91
|
+
if (!_state)
|
|
92
|
+
return (0, zephyr_edge_contract_1.ze_error)('ERR_INITIALIZE_ZEPHYR_AGENT');
|
|
93
|
+
const { appConfig, hash_set, pluginOptions } = _state;
|
|
94
|
+
const assetsMap = (0, get_assets_map_1.getAssetsMap)(bundle);
|
|
95
|
+
const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
|
|
96
|
+
await (0, zephyr_agent_1.upload)({
|
|
97
|
+
pluginOptions,
|
|
98
|
+
assets: {
|
|
99
|
+
assetsMap,
|
|
100
|
+
missingAssets,
|
|
101
|
+
outputPath: options.dir,
|
|
102
|
+
count: Object.keys(bundle).length,
|
|
103
|
+
},
|
|
104
|
+
// @ts-expect-error TODO: fix this types to get legacy and current working
|
|
105
|
+
getDashData: get_dash_data_1.getDashData,
|
|
106
|
+
appConfig,
|
|
107
|
+
zeStart,
|
|
112
108
|
});
|
|
113
109
|
})({ state: _state, bundle });
|
|
114
110
|
console.log('zephyr agent done in', Date.now() - zeStart, 'ms');
|
|
115
|
-
}
|
|
111
|
+
},
|
|
116
112
|
};
|
|
117
113
|
}
|
|
118
114
|
exports.withZephyr = withZephyr;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup-plugin-zephyr.js","sourceRoot":"","sources":["../../src/lib/rollup-plugin-zephyr.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"rollup-plugin-zephyr.js","sourceRoot":"","sources":["../../src/lib/rollup-plugin-zephyr.ts"],"names":[],"mappings":";;;;AAAA,oDAA8B;AAE9B,+CAUsB;AACtB,+DAS8B;AAC9B,2DAAsD;AACtD,yDAAoD;AASpD,MAAM,cAAc,GAAG,CAAC,OAAqB,EAAU,EAAE;IACvD,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC,KAAK,CAAC;IAC5D,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1D,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;AACvB,CAAC,CAAC;AAEF,SAAgB,UAAU;IACxB,IAAI,MAAyC,CAAC;IAE9C,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,KAAK,EAAE,OAAqB,EAAE,EAAE;YAC1C,MAAM,GAAG,CAAC,KAAK,UAAU,WAAW;gBAClC,IAAA,6BAAM,EAAC,wCAAwC,CAAC,CAAC;gBAEjD,MAAM,cAAc,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC;gBACtD,MAAM,qBAAqB,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;gBAEtD,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAA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AM,aAAa,GAAG,IAAA,iCAAkB,EAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAClE,MAAM,IAAA,qBAAM,EAAC;oBACX,aAAa;oBACb,MAAM,EAAE;wBACN,SAAS;wBACT,aAAa;wBACb,UAAU,EAAE,OAAO,CAAC,GAAa;wBACjC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;qBAClC;oBACD,0EAA0E;oBAC1E,WAAW,EAAX,2BAAW;oBACX,SAAS;oBACT,OAAO;iBACR,CAAC,CAAC;YACL,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAE9B,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC;QAClE,CAAC;KACF,CAAC;AACJ,CAAC;AA7GD,gCA6GC"}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup-plugin-zephyr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"is-ci": "^3.0.1",
|
|
10
10
|
"rollup": "^4",
|
|
11
11
|
"tslib": "^2",
|
|
12
|
-
"zephyr-agent": "0.0.
|
|
13
|
-
"zephyr-edge-contract": "0.0.
|
|
12
|
+
"zephyr-agent": "0.0.26",
|
|
13
|
+
"zephyr-edge-contract": "0.0.26"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"rollup",
|