rollup-plugin-zephyr 0.0.14 → 0.0.16
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/README.md +0 -1
- package/dist/lib/rollup-plugin-zephyr.d.ts +1 -1
- package/dist/lib/rollup-plugin-zephyr.js +22 -10
- package/dist/lib/rollup-plugin-zephyr.js.map +1 -1
- package/dist/lib/utils/get-assets-map.js.map +1 -1
- package/dist/lib/utils/get-dash-data.d.ts +4 -5
- package/dist/lib/utils/get-dash-data.js.map +1 -1
- package/dist/package.json +7 -3
- package/package.json +9 -5
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InputOptions, NormalizedOutputOptions, OutputBundle } from 'rollup';
|
|
1
|
+
import type { InputOptions, NormalizedOutputOptions, OutputBundle } from 'rollup';
|
|
2
2
|
export declare function withZephyr(): {
|
|
3
3
|
name: string;
|
|
4
4
|
buildStart: (options: InputOptions) => Promise<void>;
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withZephyr = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const isCI = require("is-ci");
|
|
6
6
|
const zephyr_agent_1 = require("zephyr-agent");
|
|
7
|
+
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
7
8
|
const get_assets_map_1 = require("./utils/get-assets-map");
|
|
8
9
|
const get_dash_data_1 = require("./utils/get-dash-data");
|
|
9
10
|
const getInputFolder = (options) => {
|
|
@@ -23,13 +24,9 @@ function withZephyr() {
|
|
|
23
24
|
_state = (function zephyr_init() {
|
|
24
25
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
26
|
(0, zephyr_edge_contract_1.ze_log)('Setting up zephyr agent configuration.');
|
|
26
|
-
const isCI = false;
|
|
27
27
|
const _zephyrOptions = { wait_for_index_html: false };
|
|
28
28
|
const path_to_execution_dir = getInputFolder(options);
|
|
29
|
-
const [packageJson, gitInfo] = yield Promise.all([
|
|
30
|
-
(0, zephyr_agent_1.getPackageJson)(path_to_execution_dir),
|
|
31
|
-
(0, zephyr_agent_1.getGitInfo)(),
|
|
32
|
-
]);
|
|
29
|
+
const [packageJson, gitInfo] = yield Promise.all([(0, zephyr_agent_1.getPackageJson)(path_to_execution_dir), (0, zephyr_agent_1.getGitInfo)()]);
|
|
33
30
|
const application_uid = (0, zephyr_edge_contract_1.createApplicationUID)({
|
|
34
31
|
org: gitInfo.app.org,
|
|
35
32
|
project: gitInfo.app.project,
|
|
@@ -42,10 +39,14 @@ function withZephyr() {
|
|
|
42
39
|
(0, zephyr_agent_1.get_hash_list)(application_uid),
|
|
43
40
|
]);
|
|
44
41
|
const { username, email, EDGE_URL } = appConfig;
|
|
45
|
-
(0, zephyr_edge_contract_1.ze_log)('Got application configuration: ', {
|
|
46
|
-
|
|
42
|
+
(0, zephyr_edge_contract_1.ze_log)('Got application configuration: ', {
|
|
43
|
+
username,
|
|
44
|
+
email,
|
|
45
|
+
EDGE_URL,
|
|
46
|
+
});
|
|
47
47
|
if (!buildId)
|
|
48
|
-
return (0, zephyr_edge_contract_1.ze_error)(
|
|
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}`);
|
|
49
50
|
const pluginOptions = {
|
|
50
51
|
pluginName: 'rollup-plugin-zephyr',
|
|
51
52
|
application_uid,
|
|
@@ -67,6 +68,16 @@ function withZephyr() {
|
|
|
67
68
|
mfConfig: void 0,
|
|
68
69
|
wait_for_index_html: _zephyrOptions === null || _zephyrOptions === void 0 ? void 0 : _zephyrOptions.wait_for_index_html,
|
|
69
70
|
};
|
|
71
|
+
const logEvent = (0, zephyr_agent_1.logger)(pluginOptions);
|
|
72
|
+
logEvent({
|
|
73
|
+
level: 'info',
|
|
74
|
+
action: 'build:info:user',
|
|
75
|
+
message: `Hi ${(0, zephyr_edge_contract_1.cyanBright)(username)}!`,
|
|
76
|
+
}, {
|
|
77
|
+
level: 'info',
|
|
78
|
+
action: 'build:info:id',
|
|
79
|
+
message: `Building to ${(0, zephyr_edge_contract_1.blackBright)(application_uid)}${(0, zephyr_edge_contract_1.yellow)(`#${buildId}`)}`,
|
|
80
|
+
});
|
|
70
81
|
return {
|
|
71
82
|
appConfig,
|
|
72
83
|
buildId,
|
|
@@ -84,7 +95,7 @@ function withZephyr() {
|
|
|
84
95
|
const { state, bundle } = props;
|
|
85
96
|
const _state = yield state;
|
|
86
97
|
if (!_state)
|
|
87
|
-
return (0, zephyr_edge_contract_1.ze_error)(
|
|
98
|
+
return (0, zephyr_edge_contract_1.ze_error)('ERR_INITIALIZE_ZEPHYR_AGENT');
|
|
88
99
|
const { appConfig, hash_set, pluginOptions } = _state;
|
|
89
100
|
const assetsMap = (0, get_assets_map_1.getAssetsMap)(bundle);
|
|
90
101
|
const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
|
|
@@ -96,6 +107,7 @@ function withZephyr() {
|
|
|
96
107
|
outputPath: options.dir,
|
|
97
108
|
count: Object.keys(bundle).length,
|
|
98
109
|
},
|
|
110
|
+
// @ts-expect-error TODO: fix this types to get legacy and current working
|
|
99
111
|
getDashData: get_dash_data_1.getDashData,
|
|
100
112
|
appConfig,
|
|
101
113
|
zeStart,
|
|
@@ -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":";;;;AAAA,8BAA8B;AAE9B,+CAUsB;AACtB,+DAU8B;AAC9B,2DAAsD;AACtD,yDAAoD;AASpD,MAAM,cAAc,GAAG,CAAC,OAAqB,EAAU,EAAE;IACvD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AC,YAAY;qBACrC,CAAC,CAAC;gBACL,CAAC;aAAA,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,CAAA;KACF,CAAC;AACJ,CAAC;AApHD,gCAoHC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -6,6 +6,7 @@ interface GetDashDataOptions {
|
|
|
6
6
|
export declare function getDashData({ pluginOptions, appConfig }: GetDashDataOptions): {
|
|
7
7
|
id: string;
|
|
8
8
|
name: string;
|
|
9
|
+
environment: string;
|
|
9
10
|
edge: {
|
|
10
11
|
url: string;
|
|
11
12
|
};
|
|
@@ -15,12 +16,12 @@ export declare function getDashData({ pluginOptions, appConfig }: GetDashDataOpt
|
|
|
15
16
|
name: string;
|
|
16
17
|
version: string;
|
|
17
18
|
} & {
|
|
18
|
-
buildId: string
|
|
19
|
+
buildId: string;
|
|
19
20
|
};
|
|
20
21
|
version: string;
|
|
21
22
|
git: {
|
|
22
|
-
name
|
|
23
|
-
email
|
|
23
|
+
name: string;
|
|
24
|
+
email: string;
|
|
24
25
|
branch: string;
|
|
25
26
|
commit: string;
|
|
26
27
|
};
|
|
@@ -34,7 +35,5 @@ export declare function getDashData({ pluginOptions, appConfig }: GetDashDataOpt
|
|
|
34
35
|
overrides: never[];
|
|
35
36
|
consumes: never[];
|
|
36
37
|
modules: never[];
|
|
37
|
-
sha: string;
|
|
38
|
-
buildHash: string;
|
|
39
38
|
};
|
|
40
39
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-dash-data.js","sourceRoot":"","sources":["../../../src/lib/utils/get-dash-data.ts"],"names":[],"mappings":";;;AACA,+
|
|
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"}
|
package/dist/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup-plugin-zephyr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"
|
|
9
|
+
"is-ci": "^3.0.1",
|
|
10
10
|
"rollup": "^4",
|
|
11
|
+
"tslib": "^2",
|
|
11
12
|
"zephyr-agent": "workspace:*",
|
|
12
13
|
"zephyr-edge-contract": "workspace:*"
|
|
13
14
|
},
|
|
@@ -16,5 +17,8 @@
|
|
|
16
17
|
"rollup-plugin",
|
|
17
18
|
"zephyr",
|
|
18
19
|
"deploy"
|
|
19
|
-
]
|
|
20
|
+
],
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/is-ci": "^3.0.4"
|
|
23
|
+
}
|
|
20
24
|
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup-plugin-zephyr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"
|
|
9
|
+
"is-ci": "^3.0.1",
|
|
10
10
|
"rollup": "^4",
|
|
11
|
-
"
|
|
12
|
-
"zephyr-
|
|
11
|
+
"tslib": "^2",
|
|
12
|
+
"zephyr-agent": "0.0.16",
|
|
13
|
+
"zephyr-edge-contract": "0.0.16"
|
|
13
14
|
},
|
|
14
15
|
"keywords": [
|
|
15
16
|
"rollup",
|
|
16
17
|
"rollup-plugin",
|
|
17
18
|
"zephyr",
|
|
18
19
|
"deploy"
|
|
19
|
-
]
|
|
20
|
+
],
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/is-ci": "^3.0.4"
|
|
23
|
+
}
|
|
20
24
|
}
|