parcel-reporter-zephyr 0.1.3-next.2 → 0.1.3-next.4
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/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/dist/lib/on-build-success.js +21 -26
- package/dist/lib/on-build-success.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -11,17 +11,22 @@ function createZephyrReporter(options) {
|
|
|
11
11
|
const { zephyr_engine_defer, zephyr_defer_create } = zephyr_agent_1.ZephyrEngine.defer_create();
|
|
12
12
|
return new plugin_1.Reporter({
|
|
13
13
|
report: async ({ event, options: parcelOptions }) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
try {
|
|
15
|
+
const projectRoot = parcelOptions.inputFS.cwd();
|
|
16
|
+
switch (event.type) {
|
|
17
|
+
case 'buildStart':
|
|
18
|
+
await (0, on_build_start_1.onBuildStart)({ zephyr_defer_create, projectRoot });
|
|
19
|
+
break;
|
|
20
|
+
case 'buildSuccess':
|
|
21
|
+
await (0, on_build_success_1.onBuildSuccess)({ zephyr_engine_defer, event, hooks: options === null || options === void 0 ? void 0 : options.hooks });
|
|
22
|
+
break;
|
|
23
|
+
default:
|
|
24
|
+
// ignore unknown build hooks
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
(0, zephyr_agent_1.handleGlobalError)(error);
|
|
25
30
|
}
|
|
26
31
|
},
|
|
27
32
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAqCS,oDAAoB;AArC7B,2CAA0C;AAC1C,+CAAsF;AACtF,yDAAoD;AACpD,6DAAwD;AAMxD,SAAS,oBAAoB,CAAC,OAAqC;IACjE,iEAAiE;IACjE,gCAAgC;IAChC,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,2BAAY,CAAC,YAAY,EAAE,CAAC;IAEjF,OAAO,IAAI,iBAAQ,CAAC;QAClB,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE;YAClD,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;gBAEhD,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;oBACnB,KAAK,YAAY;wBACf,MAAM,IAAA,6BAAY,EAAC,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAC,CAAC;wBACzD,MAAM;oBACR,KAAK,cAAc;wBACjB,MAAM,IAAA,iCAAc,EAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAE,CAAC,CAAC;wBAC5E,MAAM;oBACR;wBACE,6BAA6B;wBAC7B,MAAM;gBACV,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAA,gCAAiB,EAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAID,kBAAe,oBAAoB,EAAE,CAAC"}
|
|
@@ -8,32 +8,27 @@ const get_assets_map_1 = require("./get-assets-map");
|
|
|
8
8
|
const assets = new Map();
|
|
9
9
|
async function onBuildSuccess(props) {
|
|
10
10
|
const { event, zephyr_engine_defer, hooks } = props;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
type: bundle.type,
|
|
25
|
-
});
|
|
11
|
+
const zephyr_engine = await zephyr_engine_defer;
|
|
12
|
+
// Start a new build
|
|
13
|
+
await zephyr_engine.start_new_build();
|
|
14
|
+
// Collect assets from the build
|
|
15
|
+
event.bundleGraph.getBundles().forEach((bundle) => {
|
|
16
|
+
const filePath = bundle.filePath;
|
|
17
|
+
if (!filePath)
|
|
18
|
+
return;
|
|
19
|
+
const name = node_path_1.default.basename(filePath);
|
|
20
|
+
assets.set(name, {
|
|
21
|
+
name: name,
|
|
22
|
+
filePath,
|
|
23
|
+
type: bundle.type,
|
|
26
24
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
catch (error) {
|
|
36
|
-
(0, zephyr_agent_1.logFn)('error', zephyr_agent_1.ZephyrError.format(error));
|
|
37
|
-
}
|
|
25
|
+
});
|
|
26
|
+
// Upload assets and finish the build
|
|
27
|
+
await zephyr_engine.upload_assets({
|
|
28
|
+
assetsMap: (0, get_assets_map_1.getAssetsMap)(assets),
|
|
29
|
+
buildStats: await (0, zephyr_agent_1.zeBuildDashData)(zephyr_engine),
|
|
30
|
+
hooks,
|
|
31
|
+
});
|
|
32
|
+
await zephyr_engine.build_finished();
|
|
38
33
|
}
|
|
39
34
|
//# sourceMappingURL=on-build-success.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-build-success.js","sourceRoot":"","sources":["../../src/lib/on-build-success.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"on-build-success.js","sourceRoot":"","sources":["../../src/lib/on-build-success.ts"],"names":[],"mappings":";;AAaA,wCA8BC;;AA1CD,kEAA6B;AAC7B,+CAAyF;AACzF,qDAAwE;AAExE,MAAM,MAAM,GAAG,IAAI,GAAG,EAA6B,CAAC;AAQ7C,KAAK,UAAU,cAAc,CAAC,KAA0B;IAC7D,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAEpD,MAAM,aAAa,GAAG,MAAM,mBAAmB,CAAC;IAEhD,oBAAoB;IACpB,MAAM,aAAa,CAAC,eAAe,EAAE,CAAC;IAEtC,gCAAgC;IAChC,KAAK,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAChD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,QAAQ;YAAE,OAAO;QAEtB,MAAM,IAAI,GAAG,mBAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAErC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;YACf,IAAI,EAAE,IAAI;YACV,QAAQ;YACR,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,qCAAqC;IACrC,MAAM,aAAa,CAAC,aAAa,CAAC;QAChC,SAAS,EAAE,IAAA,6BAAY,EAAC,MAAM,CAAC;QAC/B,UAAU,EAAE,MAAM,IAAA,8BAAe,EAAC,aAAa,CAAC;QAChD,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,aAAa,CAAC,cAAc,EAAE,CAAC;AACvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parcel-reporter-zephyr",
|
|
3
|
-
"version": "0.1.3-next.
|
|
3
|
+
"version": "0.1.3-next.4",
|
|
4
4
|
"description": "Parcel reporter for Zephyr",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@parcel/plugin": "^2.16.1",
|
|
20
20
|
"@parcel/types": "^2.16.1",
|
|
21
21
|
"tslib": "^2.8.1",
|
|
22
|
-
"zephyr-agent": "0.1.3-next.
|
|
22
|
+
"zephyr-agent": "0.1.3-next.4"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/jest": "29.5.14",
|