@wix/wix-code-diagnostics-plugin 1.0.0 → 1.1.0

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,YAmB1C,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":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAM5C,eAAO,MAAM,wBAAwB,QAAO,YAqB1C,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"}
package/dist/index.mjs CHANGED
@@ -31,7 +31,7 @@ var reportDiagnostic = async ({
31
31
  if (!metaSiteId || !overrideId) {
32
32
  return;
33
33
  }
34
- await globalThis.fetch(endpoint, {
34
+ const res = await globalThis.fetch(endpoint, {
35
35
  method: "POST",
36
36
  headers: {
37
37
  "content-type": "application/json",
@@ -39,6 +39,11 @@ var reportDiagnostic = async ({
39
39
  },
40
40
  body: JSON.stringify({ overrideId, metaSiteId, phase, status })
41
41
  });
42
+ if (!res.ok) {
43
+ throw new Error(
44
+ `ReportCodeDiagnostic responded ${res.status} ${res.statusText}: ${await res.text()}`
45
+ );
46
+ }
42
47
  };
43
48
 
44
49
  // src/index.ts
@@ -55,7 +60,9 @@ var wixCodeDiagnosticsPlugin = () => ({
55
60
  }
56
61
  emitter.on("dc-updated", () => {
57
62
  void reportDiagnostic({ endpoint, token, phase: "dev", status: "success" }).catch(
58
- () => void 0
63
+ (error) => {
64
+ console.error("[wix-code-diagnostics] failed to report diagnostic:", error);
65
+ }
59
66
  );
60
67
  });
61
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reportDiagnostic.d.ts","sourceRoot":"","sources":["../src/reportDiagnostic.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,gBAAgB,GAAU,0CAMpC,qBAAqB,KAAG,OAAO,CAAC,IAAI,CActC,CAAC"}
1
+ {"version":3,"file":"reportDiagnostic.d.ts","sourceRoot":"","sources":["../src/reportDiagnostic.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,gBAAgB,GAAU,0CAMpC,qBAAqB,KAAG,OAAO,CAAC,IAAI,CAoBtC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/wix-code-diagnostics-plugin",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
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": "35c1871dda852f0cb3f5be465edb4df7c6096041123dda85043e8ebb"
41
+ "falconPackageHash": "c6beccf57b910a51a8360086b9cfc6d5fc3ceddd12d1ee12559a4b08"
42
42
  }