parcel-reporter-zephyr 0.0.0-canary-20250227203709 → 0.0.37

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 CHANGED
@@ -1,45 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const plugin_1 = require("@parcel/plugin");
5
4
  const zephyr_agent_1 = require("zephyr-agent");
6
- const get_assets_map_1 = require("./lib/get-assets-map");
7
- const path = tslib_1.__importStar(require("path"));
5
+ const on_build_start_1 = require("./lib/on-build-start");
6
+ const on_build_success_1 = require("./lib/on-build-success");
8
7
  // Create the engine and assets map outside the reporter function
9
8
  // so they persist between calls
10
9
  const { zephyr_engine_defer, zephyr_defer_create } = zephyr_agent_1.ZephyrEngine.defer_create();
11
- const assets = new Map();
12
10
  exports.default = new plugin_1.Reporter({
13
11
  report: async ({ event, options }) => {
14
12
  const projectRoot = options.projectRoot;
15
- if (event.type === 'buildStart') {
16
- zephyr_defer_create({
17
- builder: 'parcel',
18
- context: projectRoot,
19
- });
20
- }
21
- if (event.type === 'buildSuccess') {
22
- const zephyr_engine = await zephyr_engine_defer;
23
- // Start a new build
24
- await zephyr_engine.start_new_build();
25
- // Collect assets from the build
26
- event.bundleGraph.getBundles().forEach((bundle) => {
27
- const filePath = bundle.filePath;
28
- if (!filePath)
29
- return;
30
- const name = path.basename(filePath);
31
- assets.set(name, {
32
- name: name,
33
- filePath,
34
- type: bundle.type,
35
- });
36
- });
37
- // Upload assets and finish the build
38
- await zephyr_engine.upload_assets({
39
- assetsMap: (0, get_assets_map_1.getAssetsMap)(assets),
40
- buildStats: await (0, zephyr_agent_1.zeBuildDashData)(zephyr_engine),
41
- });
42
- await zephyr_engine.build_finished();
13
+ switch (event.type) {
14
+ case 'buildStart':
15
+ await (0, on_build_start_1.onBuildStart)({ zephyr_defer_create, projectRoot });
16
+ break;
17
+ case 'buildSuccess':
18
+ await (0, on_build_success_1.onBuildSuccess)({ zephyr_engine_defer, event });
19
+ break;
20
+ default:
21
+ // ignore unknown build hooks
22
+ break;
43
23
  }
44
24
  },
45
25
  });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAC1C,+CAA6D;AAC7D,yDAAuE;AACvE,mDAA6B;AAE7B,iEAAiE;AACjE,gCAAgC;AAChC,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,2BAAY,CAAC,YAAY,EAAE,CAAC;AACjF,MAAM,MAAM,GAAG,IAAI,GAAG,EAA6B,CAAC;AAEpD,kBAAe,IAAI,iBAAQ,CAAC;IAC1B,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAExC,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAChC,mBAAmB,CAAC;gBAClB,OAAO,EAAE,QAAQ;gBACjB,OAAO,EAAE,WAAW;aACrB,CAAC,CAAC;QACL,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;YAClC,MAAM,aAAa,GAAG,MAAM,mBAAmB,CAAC;YAEhD,oBAAoB;YACpB,MAAM,aAAa,CAAC,eAAe,EAAE,CAAC;YAEtC,gCAAgC;YAChC,KAAK,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBAChD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;gBACjC,IAAI,CAAC,QAAQ;oBAAE,OAAO;gBAEtB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBAErC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;oBACf,IAAI,EAAE,IAAI;oBACV,QAAQ;oBACR,IAAI,EAAE,MAAM,CAAC,IAAI;iBAClB,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,qCAAqC;YACrC,MAAM,aAAa,CAAC,aAAa,CAAC;gBAChC,SAAS,EAAE,IAAA,6BAAY,EAAC,MAAM,CAAC;gBAC/B,UAAU,EAAE,MAAM,IAAA,8BAAe,EAAC,aAAa,CAAC;aACjD,CAAC,CAAC;YAEH,MAAM,aAAa,CAAC,cAAc,EAAE,CAAC;QACvC,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,2CAA0C;AAC1C,+CAA4C;AAC5C,yDAAoD;AACpD,6DAAwD;AAExD,iEAAiE;AACjE,gCAAgC;AAChC,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,2BAAY,CAAC,YAAY,EAAE,CAAC;AAEjF,kBAAe,IAAI,iBAAQ,CAAC;IAC1B,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAExC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,YAAY;gBACf,MAAM,IAAA,6BAAY,EAAC,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAC,CAAC;gBACzD,MAAM;YACR,KAAK,cAAc;gBACjB,MAAM,IAAA,iCAAc,EAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC;gBACrD,MAAM;YACR;gBACE,6BAA6B;gBAC7B,MAAM;QACV,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ZephyrEngineOptions } from 'zephyr-agent';
2
+ interface OnBuildStartProps {
3
+ zephyr_defer_create: (options: ZephyrEngineOptions) => void;
4
+ projectRoot: string;
5
+ }
6
+ export declare function onBuildStart(props: OnBuildStartProps): Promise<void>;
7
+ export {};
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onBuildStart = onBuildStart;
4
+ async function onBuildStart(props) {
5
+ const { zephyr_defer_create, projectRoot } = props;
6
+ zephyr_defer_create({
7
+ builder: 'parcel',
8
+ context: projectRoot,
9
+ });
10
+ }
11
+ //# sourceMappingURL=on-build-start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"on-build-start.js","sourceRoot":"","sources":["../../src/lib/on-build-start.ts"],"names":[],"mappings":";;AAMA,oCAMC;AANM,KAAK,UAAU,YAAY,CAAC,KAAwB;IACzD,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IACnD,mBAAmB,CAAC;QAClB,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,WAAW;KACrB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { BuildSuccessEvent } from '@parcel/types';
2
+ import { type ZephyrEngine } from 'zephyr-agent';
3
+ interface OnBuildSuccessProps {
4
+ zephyr_engine_defer: Promise<ZephyrEngine>;
5
+ event: BuildSuccessEvent;
6
+ }
7
+ export declare function onBuildSuccess(props: OnBuildSuccessProps): Promise<void>;
8
+ export {};
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onBuildSuccess = onBuildSuccess;
4
+ const tslib_1 = require("tslib");
5
+ const path_1 = tslib_1.__importDefault(require("path"));
6
+ const get_assets_map_1 = require("./get-assets-map");
7
+ const zephyr_agent_1 = require("zephyr-agent");
8
+ const assets = new Map();
9
+ async function onBuildSuccess(props) {
10
+ const { event, zephyr_engine_defer } = props;
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 = path_1.default.basename(filePath);
20
+ assets.set(name, {
21
+ name: name,
22
+ filePath,
23
+ type: bundle.type,
24
+ });
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
+ });
31
+ await zephyr_engine.build_finished();
32
+ }
33
+ //# sourceMappingURL=on-build-success.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"on-build-success.js","sourceRoot":"","sources":["../../src/lib/on-build-success.ts"],"names":[],"mappings":";;AAYA,wCA6BC;;AAxCD,wDAAwB;AACxB,qDAAwE;AACxE,+CAAkE;AAElE,MAAM,MAAM,GAAG,IAAI,GAAG,EAA6B,CAAC;AAO7C,KAAK,UAAU,cAAc,CAAC,KAA0B;IAC7D,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAC;IAE7C,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,cAAI,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;KACjD,CAAC,CAAC;IAEH,MAAM,aAAa,CAAC,cAAc,EAAE,CAAC;AACvC,CAAC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parcel-reporter-zephyr",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,8 +13,7 @@
13
13
  "@parcel/plugin": "^2.13.3",
14
14
  "@parcel/types": "^2.13.3",
15
15
  "@parcel/core": "^2.13.3",
16
- "zephyr-agent": "workspace:*",
17
- "zephyr-xpack-internal": "workspace:*"
16
+ "zephyr-agent": "workspace:*"
18
17
  },
19
18
  "devDependencies": {
20
19
  "@types/is-ci": "^3.0.4"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parcel-reporter-zephyr",
3
- "version": "0.0.0-canary-20250227203709",
3
+ "version": "0.0.37",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,8 +9,7 @@
9
9
  "@parcel/plugin": "^2.13.3",
10
10
  "@parcel/types": "^2.13.3",
11
11
  "@parcel/core": "^2.13.3",
12
- "zephyr-agent": "0.0.35",
13
- "zephyr-xpack-internal": "0.0.35"
12
+ "zephyr-agent": "0.0.37"
14
13
  },
15
14
  "devDependencies": {
16
15
  "@types/is-ci": "^3.0.4"