rollup-plugin-zephyr 0.0.25 → 0.0.27
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.
- package/dist/lib/rollup-plugin-zephyr.js +17 -100
- package/dist/lib/rollup-plugin-zephyr.js.map +1 -1
- package/dist/lib/{utils → transform}/get-assets-map.d.ts +1 -1
- package/dist/lib/transform/get-assets-map.js.map +1 -0
- package/dist/package.json +5 -3
- package/package.json +5 -3
- package/dist/lib/utils/get-assets-map.js.map +0 -1
- package/dist/lib/utils/get-dash-data.d.ts +0 -39
- package/dist/lib/utils/get-dash-data.js +0 -9
- package/dist/lib/utils/get-dash-data.js.map +0 -1
- /package/dist/lib/{utils → transform}/get-assets-map.js +0 -0
|
@@ -1,12 +1,9 @@
|
|
|
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 = require("is-ci");
|
|
6
4
|
const zephyr_agent_1 = require("zephyr-agent");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const get_dash_data_1 = require("./utils/get-dash-data");
|
|
5
|
+
const get_assets_map_1 = require("./transform/get-assets-map");
|
|
6
|
+
const node_process_1 = require("node:process");
|
|
10
7
|
const getInputFolder = (options) => {
|
|
11
8
|
if (typeof options.input === 'string')
|
|
12
9
|
return options.input;
|
|
@@ -14,105 +11,25 @@ const getInputFolder = (options) => {
|
|
|
14
11
|
return options.input[0];
|
|
15
12
|
if (typeof options.input === 'object')
|
|
16
13
|
return Object.values(options.input)[0];
|
|
17
|
-
return
|
|
14
|
+
return (0, node_process_1.cwd)();
|
|
18
15
|
};
|
|
19
16
|
function withZephyr() {
|
|
20
|
-
|
|
17
|
+
const { zephyr_engine_defer, zephyr_defer_create } = zephyr_agent_1.ZephyrEngine.defer_create();
|
|
21
18
|
return {
|
|
22
19
|
name: 'with-zephyr',
|
|
23
|
-
buildStart: (options) =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const [appConfig, buildId, hash_set] = yield Promise.all([
|
|
37
|
-
(0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }),
|
|
38
|
-
(0, zephyr_agent_1.getBuildId)(application_uid),
|
|
39
|
-
(0, zephyr_agent_1.get_hash_list)(application_uid),
|
|
40
|
-
]);
|
|
41
|
-
const { username, email, EDGE_URL } = appConfig;
|
|
42
|
-
(0, zephyr_edge_contract_1.ze_log)('Got application configuration: ', {
|
|
43
|
-
username,
|
|
44
|
-
email,
|
|
45
|
-
EDGE_URL,
|
|
46
|
-
});
|
|
47
|
-
if (!buildId)
|
|
48
|
-
return (0, zephyr_edge_contract_1.ze_error)('ERR_GET_BUILD_ID');
|
|
49
|
-
(0, zephyr_edge_contract_1.ze_log)(`Got build id: ${buildId}`);
|
|
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
|
-
};
|
|
84
|
-
});
|
|
85
|
-
})();
|
|
86
|
-
}),
|
|
87
|
-
writeBundle: (options, bundle) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
const zeStart = Date.now();
|
|
89
|
-
yield (function zephyr_upload(props) {
|
|
90
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
(0, zephyr_edge_contract_1.ze_log)('zephyr agent started...');
|
|
92
|
-
const { state, bundle } = props;
|
|
93
|
-
const _state = yield state;
|
|
94
|
-
if (!_state)
|
|
95
|
-
return (0, zephyr_edge_contract_1.ze_error)('ERR_INITIALIZE_ZEPHYR_AGENT');
|
|
96
|
-
const { appConfig, hash_set, pluginOptions } = _state;
|
|
97
|
-
const assetsMap = (0, get_assets_map_1.getAssetsMap)(bundle);
|
|
98
|
-
const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
|
|
99
|
-
yield (0, zephyr_agent_1.upload)({
|
|
100
|
-
pluginOptions,
|
|
101
|
-
assets: {
|
|
102
|
-
assetsMap,
|
|
103
|
-
missingAssets,
|
|
104
|
-
outputPath: options.dir,
|
|
105
|
-
count: Object.keys(bundle).length,
|
|
106
|
-
},
|
|
107
|
-
// @ts-expect-error TODO: fix this types to get legacy and current working
|
|
108
|
-
getDashData: get_dash_data_1.getDashData,
|
|
109
|
-
appConfig,
|
|
110
|
-
zeStart,
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
})({ state: _state, bundle });
|
|
114
|
-
console.log('zephyr agent done in', Date.now() - zeStart, 'ms');
|
|
115
|
-
}),
|
|
20
|
+
buildStart: async (options) => {
|
|
21
|
+
const path_to_execution_dir = getInputFolder(options);
|
|
22
|
+
zephyr_defer_create(path_to_execution_dir);
|
|
23
|
+
},
|
|
24
|
+
writeBundle: async (options, bundle) => {
|
|
25
|
+
const zephyr_engine = await zephyr_engine_defer;
|
|
26
|
+
await zephyr_engine.start_new_build();
|
|
27
|
+
await zephyr_engine.upload_assets({
|
|
28
|
+
assetsMap: (0, get_assets_map_1.getAssetsMap)(bundle),
|
|
29
|
+
buildStats: await (0, zephyr_agent_1.zeBuildDashData)(zephyr_engine),
|
|
30
|
+
});
|
|
31
|
+
await zephyr_engine.build_finished();
|
|
32
|
+
},
|
|
116
33
|
};
|
|
117
34
|
}
|
|
118
35
|
exports.withZephyr = withZephyr;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup-plugin-zephyr.js","sourceRoot":"","sources":["../../src/lib/rollup-plugin-zephyr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rollup-plugin-zephyr.js","sourceRoot":"","sources":["../../src/lib/rollup-plugin-zephyr.ts"],"names":[],"mappings":";;;AACA,+CAA6D;AAC7D,+DAA0D;AAC1D,+CAAmC;AAEnC,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;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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,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAgC,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup-plugin-zephyr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "nx run rollup-plugin-zephyr:build"
|
|
10
|
+
},
|
|
8
11
|
"dependencies": {
|
|
9
12
|
"is-ci": "^3.0.1",
|
|
10
13
|
"rollup": "^4",
|
|
11
14
|
"tslib": "^2",
|
|
12
|
-
"zephyr-agent": "workspace:*"
|
|
13
|
-
"zephyr-edge-contract": "workspace:*"
|
|
15
|
+
"zephyr-agent": "workspace:*"
|
|
14
16
|
},
|
|
15
17
|
"keywords": [
|
|
16
18
|
"rollup",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup-plugin-zephyr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,8 +9,7 @@
|
|
|
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.25"
|
|
12
|
+
"zephyr-agent": "0.0.27"
|
|
14
13
|
},
|
|
15
14
|
"keywords": [
|
|
16
15
|
"rollup",
|
|
@@ -20,5 +19,8 @@
|
|
|
20
19
|
],
|
|
21
20
|
"devDependencies": {
|
|
22
21
|
"@types/is-ci": "^3.0.4"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "nx run rollup-plugin-zephyr:build"
|
|
23
25
|
}
|
|
24
26
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-assets-map.js","sourceRoot":"","sources":["../../../src/lib/utils/get-assets-map.ts"],"names":[],"mappings":";;;AACA,+CAA8C;AAG9C,SAAgB,YAAY,CAAC,MAAoB;IAC/C,OAAO,IAAA,6BAAc,EAAC,MAAM,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;AAC7D,CAAC;AAFD,oCAEC;AAED,MAAM,aAAa,GAAG,CACpB,KAAgC,EACZ,EAAE;IACtB,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,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAgC,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ZeApplicationConfig, ZephyrPluginOptions } from 'zephyr-edge-contract';
|
|
2
|
-
interface GetDashDataOptions {
|
|
3
|
-
appConfig: ZeApplicationConfig;
|
|
4
|
-
pluginOptions: ZephyrPluginOptions;
|
|
5
|
-
}
|
|
6
|
-
export declare function getDashData({ pluginOptions, appConfig }: GetDashDataOptions): {
|
|
7
|
-
id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
environment: string;
|
|
10
|
-
edge: {
|
|
11
|
-
url: string;
|
|
12
|
-
};
|
|
13
|
-
app: {
|
|
14
|
-
org: string;
|
|
15
|
-
project: string;
|
|
16
|
-
name: string;
|
|
17
|
-
version: string;
|
|
18
|
-
} & {
|
|
19
|
-
buildId: string;
|
|
20
|
-
};
|
|
21
|
-
version: string;
|
|
22
|
-
git: {
|
|
23
|
-
name: string;
|
|
24
|
-
email: string;
|
|
25
|
-
branch: string;
|
|
26
|
-
commit: string;
|
|
27
|
-
};
|
|
28
|
-
context: {
|
|
29
|
-
isCI: boolean;
|
|
30
|
-
};
|
|
31
|
-
dependencies: never[];
|
|
32
|
-
devDependencies: never[];
|
|
33
|
-
optionalDependencies: never[];
|
|
34
|
-
metadata: {};
|
|
35
|
-
overrides: never[];
|
|
36
|
-
consumes: never[];
|
|
37
|
-
modules: never[];
|
|
38
|
-
};
|
|
39
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDashData = void 0;
|
|
4
|
-
const zephyr_agent_1 = require("zephyr-agent");
|
|
5
|
-
function getDashData({ pluginOptions, appConfig }) {
|
|
6
|
-
return (0, zephyr_agent_1.zeGetDashData)({ pluginOptions, appConfig });
|
|
7
|
-
}
|
|
8
|
-
exports.getDashData = getDashData;
|
|
9
|
-
//# sourceMappingURL=get-dash-data.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-dash-data.js","sourceRoot":"","sources":["../../../src/lib/utils/get-dash-data.ts"],"names":[],"mappings":";;;AACA,+CAA6C;AAO7C,SAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,SAAS,EAAsB;IAC1E,OAAO,IAAA,4BAAa,EAAC,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC;AACrD,CAAC;AAFD,kCAEC"}
|
|
File without changes
|