@wix/wix-code-diagnostics-plugin 1.1.1 → 1.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAM5C,eAAO,MAAM,wBAAwB,QAAO,YAe1C,CAAC;AAEH,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAgB5C,eAAO,MAAM,wBAAwB,QAAO,YAqB3C,CAAC;AAEF,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.mjs CHANGED
@@ -1,3 +1,6 @@
1
+ // src/index.ts
2
+ import { appendFileSync } from "node:fs";
3
+
1
4
  // src/appConfig.ts
2
5
  import { readFileSync } from "node:fs";
3
6
  import { join } from "node:path";
@@ -49,21 +52,29 @@ var reportDiagnostic = async ({
49
52
  // src/index.ts
50
53
  var ENV_ENDPOINT = "WIX_CODE_DIAGNOSTICS_ENDPOINT";
51
54
  var ENV_TOKEN = "WIX_CODE_DIAGNOSTICS_TOKEN";
52
- var wixCodeDiagnosticsPlugin = () => ({
53
- name: "wix-code-diagnostics",
54
- hooks: {
55
- "cli:setup"({ cmd }) {
56
- const endpoint = process.env[ENV_ENDPOINT];
57
- const token = process.env[ENV_TOKEN];
58
- if (!endpoint || !token) {
59
- return;
60
- }
61
- void reportDiagnostic({ endpoint, token, phase: cmd, status: "success" }).catch((error) => {
62
- console.error("[wix-code-diagnostics] failed to report diagnostic:", error);
63
- });
64
- }
55
+ var MARKER = "/tmp/wcd-marker";
56
+ var mark = (line) => {
57
+ try {
58
+ appendFileSync(MARKER, `${line}
59
+ `);
60
+ } catch {
61
+ }
62
+ };
63
+ var wixCodeDiagnosticsPlugin = () => {
64
+ const endpoint = process.env[ENV_ENDPOINT];
65
+ const token = process.env[ENV_TOKEN];
66
+ mark(`factory endpoint=${Boolean(endpoint)} token=${Boolean(token)}`);
67
+ if (endpoint && token) {
68
+ void reportDiagnostic({ endpoint, token, phase: "build", status: "success" }).then(() => mark("report: ok")).catch((error) => {
69
+ mark(`report: error ${error instanceof Error ? error.message : String(error)}`);
70
+ console.error("[wix-code-diagnostics] failed to report diagnostic:", error);
71
+ });
65
72
  }
66
- });
73
+ return {
74
+ name: "wix-code-diagnostics",
75
+ hooks: {}
76
+ };
77
+ };
67
78
  export {
68
79
  readAppConfig,
69
80
  reportDiagnostic,
package/dist/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export interface CliSetupHookArgs {
6
6
  emitter: PluginEmitter;
7
7
  }
8
8
  export interface WixCliPluginHooks {
9
- 'cli:setup'?: (args: CliSetupHookArgs) => void;
9
+ 'cli:setup'?: (args: CliSetupHookArgs) => void | Promise<void>;
10
10
  }
11
11
  export interface WixCliPlugin {
12
12
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;CAChE;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,iBAAiB,CAAC;CAC1B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;CAChE;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,iBAAiB,CAAC;CAC1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/wix-code-diagnostics-plugin",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Wix CLI plugin that forwards CLI build/preview/dev diagnostics to the code-project-orchestrator over HTTP",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -38,5 +38,5 @@
38
38
  "esbuild": "^0.24.0",
39
39
  "typescript": "^5.9.3"
40
40
  },
41
- "falconPackageHash": "7d46a8e485ac2401fd2eef29af95cbc842ca4f4158a942b4c46daf24"
41
+ "falconPackageHash": "1d81f14e2c1e4939f4bd44e7ce9849653d340ca837b95f2c5f036443"
42
42
  }