parcel-reporter-zephyr 0.0.0-canary.3 → 0.0.0-canary.31

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.d.ts CHANGED
@@ -1,3 +1,10 @@
1
1
  import { Reporter } from '@parcel/plugin';
2
+ import { type ZephyrBuildHooks } from 'zephyr-agent';
3
+ export interface ZephyrParcelReporterOptions {
4
+ hooks?: ZephyrBuildHooks;
5
+ }
6
+ declare function createZephyrReporter(options?: ZephyrParcelReporterOptions): Reporter;
7
+ export { createZephyrReporter };
8
+ export type { ZephyrBuildHooks, DeploymentInfo } from 'zephyr-agent';
2
9
  declare const _default: Reporter;
3
10
  export default _default;
package/dist/index.js CHANGED
@@ -1,26 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createZephyrReporter = createZephyrReporter;
3
4
  const plugin_1 = require("@parcel/plugin");
4
5
  const zephyr_agent_1 = require("zephyr-agent");
5
6
  const on_build_start_1 = require("./lib/on-build-start");
6
7
  const on_build_success_1 = require("./lib/on-build-success");
7
- // Create the engine and assets map outside the reporter function
8
- // so they persist between calls
9
- const { zephyr_engine_defer, zephyr_defer_create } = zephyr_agent_1.ZephyrEngine.defer_create();
10
- exports.default = new plugin_1.Reporter({
11
- report: async ({ event, options }) => {
12
- const projectRoot = options.inputFS.cwd();
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;
23
- }
24
- },
25
- });
8
+ function createZephyrReporter(options) {
9
+ // Create the engine and assets map outside the reporter function
10
+ // so they persist between calls
11
+ const { zephyr_engine_defer, zephyr_defer_create } = zephyr_agent_1.ZephyrEngine.defer_create();
12
+ return new plugin_1.Reporter({
13
+ report: async ({ event, options: parcelOptions }) => {
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);
30
+ }
31
+ },
32
+ });
33
+ }
34
+ exports.default = createZephyrReporter();
26
35
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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,OAAO,CAAC,GAAG,EAAE,CAAC;QAE1C,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"}
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"}
@@ -1,8 +1,9 @@
1
1
  import type { BuildSuccessEvent } from '@parcel/types';
2
- import { type ZephyrEngine } from 'zephyr-agent';
2
+ import { type ZephyrEngine, type ZephyrBuildHooks } from 'zephyr-agent';
3
3
  interface OnBuildSuccessProps {
4
4
  zephyr_engine_defer: Promise<ZephyrEngine>;
5
5
  event: BuildSuccessEvent;
6
+ hooks?: ZephyrBuildHooks;
6
7
  }
7
8
  export declare function onBuildSuccess(props: OnBuildSuccessProps): Promise<void>;
8
9
  export {};
@@ -7,32 +7,28 @@ const zephyr_agent_1 = require("zephyr-agent");
7
7
  const get_assets_map_1 = require("./get-assets-map");
8
8
  const assets = new Map();
9
9
  async function onBuildSuccess(props) {
10
- const { event, zephyr_engine_defer } = props;
11
- try {
12
- const zephyr_engine = await zephyr_engine_defer;
13
- // Start a new build
14
- await zephyr_engine.start_new_build();
15
- // Collect assets from the build
16
- event.bundleGraph.getBundles().forEach((bundle) => {
17
- const filePath = bundle.filePath;
18
- if (!filePath)
19
- return;
20
- const name = node_path_1.default.basename(filePath);
21
- assets.set(name, {
22
- name: name,
23
- filePath,
24
- type: bundle.type,
25
- });
10
+ const { event, zephyr_engine_defer, hooks } = 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 = node_path_1.default.basename(filePath);
20
+ assets.set(name, {
21
+ name: name,
22
+ filePath,
23
+ type: bundle.type,
26
24
  });
27
- // Upload assets and finish the build
28
- await zephyr_engine.upload_assets({
29
- assetsMap: (0, get_assets_map_1.getAssetsMap)(assets),
30
- buildStats: await (0, zephyr_agent_1.zeBuildDashData)(zephyr_engine),
31
- });
32
- await zephyr_engine.build_finished();
33
- }
34
- catch (error) {
35
- (0, zephyr_agent_1.logFn)('error', zephyr_agent_1.ZephyrError.format(error));
36
- }
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();
37
33
  }
38
34
  //# sourceMappingURL=on-build-success.js.map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-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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parcel-reporter-zephyr",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "Parcel reporter for Zephyr",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,18 +20,20 @@
20
20
  "patch-version": "pnpm version"
21
21
  },
22
22
  "dependencies": {
23
- "@parcel/core": "catalog:parcel",
24
- "@parcel/plugin": "catalog:parcel",
25
- "@parcel/types": "catalog:parcel",
26
- "is-ci": "catalog:plugin-shared",
23
+ "tslib": "catalog:typescript",
27
24
  "zephyr-agent": "workspace:*"
28
25
  },
29
26
  "devDependencies": {
30
- "@types/is-ci": "catalog:typescript",
27
+ "@parcel/plugin": "catalog:parcel",
28
+ "@parcel/types": "catalog:parcel",
31
29
  "@types/jest": "catalog:typescript",
32
30
  "@typescript-eslint/eslint-plugin": "catalog:eslint",
33
31
  "ts-jest": "catalog:typescript"
34
32
  },
33
+ "peerDependencies": {
34
+ "@parcel/plugin": "^2.0.0",
35
+ "@parcel/types": "^2.0.0"
36
+ },
35
37
  "publishConfig": {
36
38
  "access": "public",
37
39
  "provenance": true
@@ -0,0 +1,3 @@
1
+ import baseConfig from '../../eslint.config.mjs';
2
+
3
+ export default [...baseConfig];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parcel-reporter-zephyr",
3
- "version": "0.0.0-canary.3",
3
+ "version": "0.0.0-canary.31",
4
4
  "description": "Parcel reporter for Zephyr",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,18 +16,20 @@
16
16
  "main": "dist/index.js",
17
17
  "types": "dist/index.d.ts",
18
18
  "dependencies": {
19
- "@parcel/core": "^2.13.3",
20
- "@parcel/plugin": "^2.13.3",
21
- "@parcel/types": "^2.13.3",
22
- "is-ci": "^4.1.0",
23
- "zephyr-agent": "0.0.0-canary.3"
19
+ "tslib": "^2.8.1",
20
+ "zephyr-agent": "0.0.0-canary.31"
24
21
  },
25
22
  "devDependencies": {
26
- "@types/is-ci": "3.0.4",
23
+ "@parcel/plugin": "^2.16.1",
24
+ "@parcel/types": "^2.16.1",
27
25
  "@types/jest": "29.5.14",
28
26
  "@typescript-eslint/eslint-plugin": "^8.27.0",
29
27
  "ts-jest": "^29.2.6"
30
28
  },
29
+ "peerDependencies": {
30
+ "@parcel/plugin": "^2.0.0",
31
+ "@parcel/types": "^2.0.0"
32
+ },
31
33
  "publishConfig": {
32
34
  "access": "public",
33
35
  "provenance": true