@wix/wix-code-diagnostics-plugin 1.1.0 → 1.1.2
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.map +1 -1
- package/dist/index.mjs +26 -8
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
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,YA0B1C,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
|
@@ -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,22 +52,37 @@ 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";
|
|
55
|
+
var MARKER = "/tmp/wcd-marker";
|
|
56
|
+
var mark = (line) => {
|
|
57
|
+
try {
|
|
58
|
+
appendFileSync(MARKER, `${line}
|
|
59
|
+
`);
|
|
60
|
+
} catch {
|
|
61
|
+
}
|
|
62
|
+
};
|
|
52
63
|
var wixCodeDiagnosticsPlugin = () => ({
|
|
53
64
|
name: "wix-code-diagnostics",
|
|
54
65
|
hooks: {
|
|
55
|
-
"cli:setup"({
|
|
66
|
+
async "cli:setup"({ cmd }) {
|
|
56
67
|
const endpoint = process.env[ENV_ENDPOINT];
|
|
57
68
|
const token = process.env[ENV_TOKEN];
|
|
69
|
+
mark(`cli:setup cmd=${cmd} endpoint=${Boolean(endpoint)} token=${Boolean(token)}`);
|
|
70
|
+
console.log("[wix-code-diagnostics] cli:setup", {
|
|
71
|
+
cmd,
|
|
72
|
+
hasEndpoint: Boolean(endpoint),
|
|
73
|
+
hasToken: Boolean(token)
|
|
74
|
+
});
|
|
58
75
|
if (!endpoint || !token) {
|
|
59
76
|
return;
|
|
60
77
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
);
|
|
67
|
-
|
|
78
|
+
try {
|
|
79
|
+
await reportDiagnostic({ endpoint, token, phase: cmd, status: "success" });
|
|
80
|
+
mark("report: ok");
|
|
81
|
+
console.log("[wix-code-diagnostics] reported diagnostic", { cmd });
|
|
82
|
+
} catch (error) {
|
|
83
|
+
mark(`report: error ${error instanceof Error ? error.message : String(error)}`);
|
|
84
|
+
console.error("[wix-code-diagnostics] failed to report diagnostic:", error);
|
|
85
|
+
}
|
|
68
86
|
}
|
|
69
87
|
}
|
|
70
88
|
});
|
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;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -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;
|
|
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.
|
|
3
|
+
"version": "1.1.2",
|
|
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": "
|
|
41
|
+
"falconPackageHash": "24b7563b5eeee5dee20d33fc4b8f037d0a7d3bd1a9e44b5efcf0ba59"
|
|
42
42
|
}
|