react-doctor 0.9.12-dev.28a1a9f → 0.9.12-dev.2b0f06e
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/README.md +27 -0
- package/dist/active-run-trace-dlIZeEvb.js +18 -0
- package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
- package/dist/{build-section-divider-CdnczCsb.js → build-section-divider-D_v6WkSf.js} +8 -22
- package/dist/{ci-CvrWkFyG.js → ci-CRuXbH3D.js} +12 -11
- package/dist/cli.js +76 -24
- package/dist/{design-C6QoD6j5.js → design-4JdzGp7l.js} +4 -4
- package/dist/{devtools-D8NTVj81.js → devtools-BiC-AP3B.js} +3 -3
- package/dist/{exit-gracefully-dQBRJxyW.js → exit-gracefully-B-aIckQm.js} +15 -9
- package/dist/get-east-asian-width-Cglw13G7.js +444 -0
- package/dist/{report-error-DspMW6A2.js → handle-error-DIJp6KGi.js} +6 -61
- package/dist/index.d.ts +32 -0
- package/dist/index.js +128 -3
- package/dist/{inspect-CEYHtLuK.js → inspect-BFbqw1rf.js} +16 -15
- package/dist/{install-BPQG8X-S.js → install-CJgOEd94.js} +9 -8
- package/dist/{install-doctor-script-BZJlaCgz.js → install-doctor-script-BdxYpXZI.js} +6 -441
- package/dist/{install-github-workflow-DQIDvKig.js → install-github-workflow-CqbWtIgt.js} +6 -6
- package/dist/{install-react-doctor-C3iiSm4r.js → install-react-doctor-C7SKnOTZ.js} +8 -8
- package/dist/{run-scan-app-lYmDIiT4.js → jsx-runtime-CmCDiKfl.js} +280 -2774
- package/dist/{print-branded-header-B594Zejh.js → print-branded-header-qIFyuETX.js} +4 -4
- package/dist/prompt-runtime-scan-url-CL2dlnZd.js +240 -0
- package/dist/{read-object-file-CIVH-Cg-.js → read-object-file-CBK-rayZ.js} +4 -4
- package/dist/{record-metric-CFPfyOEW.js → record-metric-CNHDZW2C.js} +147 -9
- package/dist/report-error-CKKT4508.js +64 -0
- package/dist/{report-workflow-result-GxDOhexG.js → report-workflow-result-B727d63m.js} +5 -5
- package/dist/{resolve-scope-CNV3HRNo.js → resolve-scope-Dsafs5WC.js} +6 -6
- package/dist/{rules-C1Nt63By.js → rules-CMFJO4Nw.js} +6 -6
- package/dist/run-scan-app-BYjPV87g.js +2508 -0
- package/dist/runtime-scan/browser-probe.iife.js +855 -0
- package/dist/runtime-scan-CPWa4luI.js +770 -0
- package/dist/sanitize-runtime-url-CmSOuwqY.js +76 -0
- package/dist/{scan-D-Y1Qifl.js → scan-D4Z3HTnz.js} +10 -22
- package/dist/{should-fail-scan-gate-XdfNPXf9.js → should-fail-scan-gate-B1SBLqAA.js} +12 -111
- package/dist/{should-skip-prompts-DXyhnzjP.js → should-skip-prompts-HRpuZc_r.js} +4 -4
- package/dist/should-use-tui-aKQP1UDR.js +25 -0
- package/dist/skills/improve-threejs/SKILL.md +102 -0
- package/dist/skills/performance/SKILL.md +113 -0
- package/dist/skills/react-doctor/SKILL.md +6 -0
- package/dist/{unref-stdin-CwYEtpri.js → telemetry-runtime-gpSkE7tQ.js} +5 -23
- package/dist/unref-stdin-BKT_s38a.js +12 -0
- package/dist/{version-tT7fsrFN.js → version-B3x9O0_8.js} +4 -4
- package/dist/{why-4B0HPeQG.js → why-L7QLihhQ.js} +4 -4
- package/dist/with-run-span-DMPEdZJM.js +110 -0
- package/package.json +7 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="334d9334-045a-5049-b7a7-fd4c29acf2da")}catch(e){}}();
|
|
3
|
+
import { An as gen, Kt as highlighter, Tn as log, _ as VERSION } from "./record-metric-CNHDZW2C.js";
|
|
4
4
|
//#region src/cli/utils/print-branded-header.ts
|
|
5
5
|
/**
|
|
6
6
|
* Single branded line every command prints first when not in JSON
|
|
@@ -18,5 +18,5 @@ const printBrandedHeader = gen(function* () {
|
|
|
18
18
|
//#endregion
|
|
19
19
|
export { printBrandedHeader as t };
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=print-branded-header-
|
|
22
|
-
//# debugId=
|
|
21
|
+
//# sourceMappingURL=print-branded-header-qIFyuETX.js.map
|
|
22
|
+
//# debugId=334d9334-045a-5049-b7a7-fd4c29acf2da
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4cb4213-b289-57d5-a427-4b1a50084380")}catch(e){}}();
|
|
3
|
+
import { t as unrefStdin } from "./unref-stdin-BKT_s38a.js";
|
|
4
|
+
import { a as RUNTIME_SCAN_LOCAL_DEV_PORTS, t as sanitizeRuntimeUrl, u as RUNTIME_SCAN_MAX_STRING_LENGTH } from "./sanitize-runtime-url-CmSOuwqY.js";
|
|
5
|
+
import { a as useExitOnCtrlC, c as Spinner, d as useInput, h as Box, i as import_react, m as Text, n as registerMountedTuiRenderer, o as terminalSymbols, p as render, r as useStdoutDimensions, s as isPrintableInput, t as require_jsx_runtime } from "./jsx-runtime-CmCDiKfl.js";
|
|
6
|
+
import * as http from "node:http";
|
|
7
|
+
//#region src/cli/runtime-scan/detect-local-runtime-urls.ts
|
|
8
|
+
const LOCAL_HTTP_HOSTS = ["127.0.0.1", "::1"];
|
|
9
|
+
const probeLocalHttpHost = (port, host) => new Promise((resolve) => {
|
|
10
|
+
let didResolve = false;
|
|
11
|
+
const resolveOnce = (isReachable) => {
|
|
12
|
+
if (didResolve) return;
|
|
13
|
+
didResolve = true;
|
|
14
|
+
resolve(isReachable);
|
|
15
|
+
};
|
|
16
|
+
const request = http.request({
|
|
17
|
+
agent: false,
|
|
18
|
+
host,
|
|
19
|
+
method: "HEAD",
|
|
20
|
+
path: "/",
|
|
21
|
+
port
|
|
22
|
+
}, (response) => {
|
|
23
|
+
response.resume();
|
|
24
|
+
resolveOnce(true);
|
|
25
|
+
});
|
|
26
|
+
request.setTimeout(300, () => request.destroy());
|
|
27
|
+
request.on("error", () => resolveOnce(false));
|
|
28
|
+
request.on("close", () => resolveOnce(false));
|
|
29
|
+
request.end();
|
|
30
|
+
});
|
|
31
|
+
const probeLocalHttpPort = async (port) => {
|
|
32
|
+
if (!(await Promise.all(LOCAL_HTTP_HOSTS.map((host) => probeLocalHttpHost(port, host)))).some(Boolean)) return null;
|
|
33
|
+
return {
|
|
34
|
+
port,
|
|
35
|
+
url: `http://localhost:${port}`
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
const detectLocalRuntimeUrls = async (ports = RUNTIME_SCAN_LOCAL_DEV_PORTS) => {
|
|
39
|
+
const probeResults = await Promise.all(ports.map(probeLocalHttpPort));
|
|
40
|
+
const suggestions = [];
|
|
41
|
+
for (const probeResult of probeResults) if (probeResult !== null) suggestions.push(probeResult);
|
|
42
|
+
return suggestions;
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/cli/ink/prompt-runtime-scan-url.tsx
|
|
46
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
47
|
+
const RuntimeScanUrlPrompt = ({ discoverLocalUrls = detectLocalRuntimeUrls, onSubmit }) => {
|
|
48
|
+
const [mode, setMode] = (0, import_react.useState)("select");
|
|
49
|
+
const [suggestions, setSuggestions] = (0, import_react.useState)([]);
|
|
50
|
+
const [isDetecting, setIsDetecting] = (0, import_react.useState)(true);
|
|
51
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react.useState)(0);
|
|
52
|
+
const [url, setUrl] = (0, import_react.useState)("");
|
|
53
|
+
const [validationMessage, setValidationMessage] = (0, import_react.useState)(null);
|
|
54
|
+
const { columns: terminalColumns, rows: terminalRows } = useStdoutDimensions();
|
|
55
|
+
useExitOnCtrlC();
|
|
56
|
+
(0, import_react.useEffect)(() => {
|
|
57
|
+
let isMounted = true;
|
|
58
|
+
discoverLocalUrls().then((detectedSuggestions) => {
|
|
59
|
+
if (!isMounted) return;
|
|
60
|
+
setSuggestions(detectedSuggestions);
|
|
61
|
+
setIsDetecting(false);
|
|
62
|
+
}, () => {
|
|
63
|
+
if (isMounted) setIsDetecting(false);
|
|
64
|
+
});
|
|
65
|
+
return () => {
|
|
66
|
+
isMounted = false;
|
|
67
|
+
};
|
|
68
|
+
}, [discoverLocalUrls]);
|
|
69
|
+
const updateUrl = (nextUrl) => {
|
|
70
|
+
setUrl(nextUrl.slice(0, RUNTIME_SCAN_MAX_STRING_LENGTH));
|
|
71
|
+
setValidationMessage(null);
|
|
72
|
+
};
|
|
73
|
+
useInput((input, key) => {
|
|
74
|
+
if (mode === "select") {
|
|
75
|
+
const optionCount = suggestions.length + 1;
|
|
76
|
+
if (key.escape || input === "q") return onSubmit(null);
|
|
77
|
+
if (key.upArrow || input === "k") return setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
78
|
+
if (key.downArrow || input === "j") return setSelectedIndex(Math.min(optionCount - 1, selectedIndex + 1));
|
|
79
|
+
if (key.return) {
|
|
80
|
+
const selectedSuggestion = suggestions[selectedIndex];
|
|
81
|
+
if (selectedSuggestion !== void 0) return onSubmit(selectedSuggestion.url);
|
|
82
|
+
setMode("custom");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (isPrintableInput(input) && !key.ctrl && !key.meta) {
|
|
86
|
+
setMode("custom");
|
|
87
|
+
updateUrl(input);
|
|
88
|
+
}
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (key.escape) return setMode("select");
|
|
92
|
+
if (key.backspace || key.delete) return updateUrl(url.slice(0, -1));
|
|
93
|
+
if (key.ctrl && input === "u") return updateUrl("");
|
|
94
|
+
if (key.return) {
|
|
95
|
+
const trimmedUrl = url.trim();
|
|
96
|
+
try {
|
|
97
|
+
sanitizeRuntimeUrl(trimmedUrl);
|
|
98
|
+
onSubmit(trimmedUrl);
|
|
99
|
+
} catch {
|
|
100
|
+
setValidationMessage("Enter an absolute URL starting with http:// or https://.");
|
|
101
|
+
}
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (isPrintableInput(input) && !key.ctrl && !key.meta) updateUrl(url + input);
|
|
105
|
+
});
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
107
|
+
alignItems: "center",
|
|
108
|
+
height: terminalRows,
|
|
109
|
+
justifyContent: "center",
|
|
110
|
+
width: terminalColumns,
|
|
111
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
112
|
+
borderColor: "magenta",
|
|
113
|
+
borderStyle: "round",
|
|
114
|
+
flexDirection: "column",
|
|
115
|
+
paddingX: 1,
|
|
116
|
+
width: Math.min(terminalColumns, 72),
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
119
|
+
color: "magenta",
|
|
120
|
+
bold: true,
|
|
121
|
+
children: "React Doctor"
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
124
|
+
bold: true,
|
|
125
|
+
children: "Choose an app to scan"
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
128
|
+
dimColor: true,
|
|
129
|
+
children: "We’ll open Chrome and scan one interaction."
|
|
130
|
+
}),
|
|
131
|
+
mode === "select" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
132
|
+
flexDirection: "column",
|
|
133
|
+
marginTop: 1,
|
|
134
|
+
children: [
|
|
135
|
+
isDetecting ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
136
|
+
dimColor: true,
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
139
|
+
color: "cyan",
|
|
140
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { type: "dots" })
|
|
141
|
+
}),
|
|
142
|
+
" ",
|
|
143
|
+
"Looking for local apps…"
|
|
144
|
+
]
|
|
145
|
+
}) : null,
|
|
146
|
+
!isDetecting && suggestions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
147
|
+
dimColor: true,
|
|
148
|
+
children: "No local HTTP apps detected."
|
|
149
|
+
}) : null,
|
|
150
|
+
suggestions.map((suggestion, suggestionIndex) => {
|
|
151
|
+
const isSelected = suggestionIndex === selectedIndex;
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
153
|
+
bold: isSelected,
|
|
154
|
+
color: isSelected ? "cyan" : void 0,
|
|
155
|
+
children: [
|
|
156
|
+
isSelected ? terminalSymbols.pointer : terminalSymbols.pointerSmall,
|
|
157
|
+
" ",
|
|
158
|
+
suggestion.url,
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
160
|
+
dimColor: true,
|
|
161
|
+
children: " detected"
|
|
162
|
+
})
|
|
163
|
+
]
|
|
164
|
+
}, suggestion.url);
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
167
|
+
bold: selectedIndex === suggestions.length,
|
|
168
|
+
color: selectedIndex === suggestions.length ? "cyan" : void 0,
|
|
169
|
+
children: [
|
|
170
|
+
selectedIndex === suggestions.length ? terminalSymbols.pointer : terminalSymbols.pointerSmall,
|
|
171
|
+
" ",
|
|
172
|
+
"Enter another URL"
|
|
173
|
+
]
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
176
|
+
marginTop: 1,
|
|
177
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
178
|
+
dimColor: true,
|
|
179
|
+
children: "↑↓ choose · Enter continue · Esc cancel"
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
184
|
+
flexDirection: "column",
|
|
185
|
+
marginTop: 1,
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
188
|
+
dimColor: true,
|
|
189
|
+
children: "App URL"
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
192
|
+
wrap: "truncate-end",
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
195
|
+
color: "cyan",
|
|
196
|
+
children: "› "
|
|
197
|
+
}),
|
|
198
|
+
url,
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
200
|
+
inverse: true,
|
|
201
|
+
children: " "
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
}),
|
|
205
|
+
validationMessage === null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
206
|
+
color: "red",
|
|
207
|
+
children: validationMessage
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
210
|
+
marginTop: 1,
|
|
211
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
212
|
+
dimColor: true,
|
|
213
|
+
children: "Enter continue · Esc back · Ctrl+U clear"
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
})
|
|
218
|
+
]
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
const promptRuntimeScanUrl = () => new Promise((resolve) => {
|
|
223
|
+
let disposeRenderer = () => {};
|
|
224
|
+
const submitUrl = (url) => {
|
|
225
|
+
disposeRenderer();
|
|
226
|
+
unrefStdin();
|
|
227
|
+
resolve(url);
|
|
228
|
+
};
|
|
229
|
+
disposeRenderer = registerMountedTuiRenderer(render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RuntimeScanUrlPrompt, { onSubmit: submitUrl }), {
|
|
230
|
+
alternateScreen: true,
|
|
231
|
+
exitOnCtrlC: false,
|
|
232
|
+
stdin: process.stdin,
|
|
233
|
+
stdout: process.stderr
|
|
234
|
+
}));
|
|
235
|
+
});
|
|
236
|
+
//#endregion
|
|
237
|
+
export { promptRuntimeScanUrl };
|
|
238
|
+
|
|
239
|
+
//# sourceMappingURL=prompt-runtime-scan-url-CL2dlnZd.js.map
|
|
240
|
+
//# debugId=a4cb4213-b289-57d5-a427-4b1a50084380
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="72004fa3-ee58-5f05-b293-8ed88357e695")}catch(e){}}();
|
|
3
|
+
import { Sr as isPlainObject } from "./record-metric-CNHDZW2C.js";
|
|
4
4
|
import * as fs$1 from "node:fs";
|
|
5
5
|
import { parseJSON5 } from "confbox";
|
|
6
6
|
//#region src/cli/utils/read-object-file.ts
|
|
@@ -20,5 +20,5 @@ const readObjectFile = (filePath) => {
|
|
|
20
20
|
//#endregion
|
|
21
21
|
export { readObjectFile as t };
|
|
22
22
|
|
|
23
|
-
//# sourceMappingURL=read-object-file-
|
|
24
|
-
//# debugId=
|
|
23
|
+
//# sourceMappingURL=read-object-file-CBK-rayZ.js.map
|
|
24
|
+
//# debugId=72004fa3-ee58-5f05-b293-8ed88357e695
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="84050cb3-ec23-5ae9-b377-bcd74ba5de78")}catch(e){}}();
|
|
3
3
|
import { i as __toESM$1, r as __require, t as __commonJSMin$1 } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
import { n as require_picomatch, t as require_semver } from "./semver-DFtnEmN-.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
@@ -63691,6 +63691,18 @@ const detectPreES2023Target = (directory) => {
|
|
|
63691
63691
|
}
|
|
63692
63692
|
return false;
|
|
63693
63693
|
};
|
|
63694
|
+
const SHADCN_CONFIG_FILE_NAME = "components.json";
|
|
63695
|
+
const detectShadcnUi = (directory) => {
|
|
63696
|
+
if (isFile(path$1$1.join(directory, SHADCN_CONFIG_FILE_NAME))) return true;
|
|
63697
|
+
if (isProjectBoundary(directory)) return false;
|
|
63698
|
+
let ancestorDirectory = path$1$1.dirname(directory);
|
|
63699
|
+
while (ancestorDirectory !== path$1$1.dirname(ancestorDirectory)) {
|
|
63700
|
+
if (isFile(path$1$1.join(ancestorDirectory, SHADCN_CONFIG_FILE_NAME))) return true;
|
|
63701
|
+
if (isProjectBoundary(ancestorDirectory)) return false;
|
|
63702
|
+
ancestorDirectory = path$1$1.dirname(ancestorDirectory);
|
|
63703
|
+
}
|
|
63704
|
+
return false;
|
|
63705
|
+
};
|
|
63694
63706
|
const FRAMEWORK_PACKAGES = {
|
|
63695
63707
|
next: "nextjs",
|
|
63696
63708
|
"@tanstack/react-start": "tanstack-start",
|
|
@@ -64456,6 +64468,29 @@ const getTanStackQueryVersion = (packageJson) => {
|
|
|
64456
64468
|
packageNames: TANSTACK_REACT_QUERY_PACKAGES
|
|
64457
64469
|
});
|
|
64458
64470
|
};
|
|
64471
|
+
const hasAnyDependency = (packageJson, packageNames) => {
|
|
64472
|
+
const allDependencies = {
|
|
64473
|
+
...packageJson.peerDependencies,
|
|
64474
|
+
...packageJson.dependencies,
|
|
64475
|
+
...packageJson.devDependencies,
|
|
64476
|
+
...packageJson.optionalDependencies
|
|
64477
|
+
};
|
|
64478
|
+
return packageNames.some((packageName) => allDependencies[packageName] !== void 0);
|
|
64479
|
+
};
|
|
64480
|
+
const BASE_UI_PACKAGES = ["@base-ui-components/react", "@base-ui/react"];
|
|
64481
|
+
const hasBaseUiDependency = (packageJson) => hasAnyDependency(packageJson, BASE_UI_PACKAGES);
|
|
64482
|
+
const RADIX_UNIFIED_PACKAGE = "radix-ui";
|
|
64483
|
+
const RADIX_PRIMITIVE_PACKAGE_PREFIX = "@radix-ui/react-";
|
|
64484
|
+
const RADIX_NON_PRIMITIVE_PACKAGES = new Set(["@radix-ui/react-icons"]);
|
|
64485
|
+
const hasRadixUiDependency = (packageJson) => {
|
|
64486
|
+
const allDependencies = {
|
|
64487
|
+
...packageJson.peerDependencies,
|
|
64488
|
+
...packageJson.dependencies,
|
|
64489
|
+
...packageJson.devDependencies,
|
|
64490
|
+
...packageJson.optionalDependencies
|
|
64491
|
+
};
|
|
64492
|
+
return Object.keys(allDependencies).some((packageName) => packageName === RADIX_UNIFIED_PACKAGE || packageName.startsWith(RADIX_PRIMITIVE_PACKAGE_PREFIX) && !RADIX_NON_PRIMITIVE_PACKAGES.has(packageName));
|
|
64493
|
+
};
|
|
64459
64494
|
const STYLED_COMPONENTS_PACKAGES = ["styled-components"];
|
|
64460
64495
|
const getStyledComponentsVersion = (packageJson) => {
|
|
64461
64496
|
return getPreferredDependencyVersion({
|
|
@@ -64486,6 +64521,10 @@ const hasI18nDependency = (packageJson) => {
|
|
|
64486
64521
|
};
|
|
64487
64522
|
return I18N_PACKAGES.some((packageName) => allDependencies[packageName] !== void 0);
|
|
64488
64523
|
};
|
|
64524
|
+
const REACT_ARIA_COMPONENT_PACKAGES = ["react-aria-components"];
|
|
64525
|
+
const TANSTACK_TABLE_PACKAGES = ["@tanstack/react-table"];
|
|
64526
|
+
const TANSTACK_VIRTUAL_PACKAGES = ["@tanstack/react-virtual"];
|
|
64527
|
+
const TANSTACK_FORM_PACKAGES = ["@tanstack/react-form"];
|
|
64489
64528
|
const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
|
|
64490
64529
|
const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
64491
64530
|
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
@@ -64676,6 +64715,13 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
64676
64715
|
});
|
|
64677
64716
|
if (styledComponentsVersion && shouldReplaceStyledComponentsVersion(facts.styledComponentsVersion, styledComponentsVersion)) facts.styledComponentsVersion = styledComponentsVersion;
|
|
64678
64717
|
facts.hasI18nLibrary = facts.hasI18nLibrary || hasI18nDependency(packageJson);
|
|
64718
|
+
facts.hasShadcnUi = facts.hasShadcnUi || detectShadcnUi(directory);
|
|
64719
|
+
facts.hasRadixUi = facts.hasRadixUi || hasRadixUiDependency(packageJson);
|
|
64720
|
+
facts.hasBaseUi = facts.hasBaseUi || hasBaseUiDependency(packageJson);
|
|
64721
|
+
facts.hasReactAriaComponents = facts.hasReactAriaComponents || hasAnyDependency(packageJson, REACT_ARIA_COMPONENT_PACKAGES);
|
|
64722
|
+
facts.hasTanstackTable = facts.hasTanstackTable || hasAnyDependency(packageJson, TANSTACK_TABLE_PACKAGES);
|
|
64723
|
+
facts.hasTanstackVirtual = facts.hasTanstackVirtual || hasAnyDependency(packageJson, TANSTACK_VIRTUAL_PACKAGES);
|
|
64724
|
+
facts.hasTanstackForm = facts.hasTanstackForm || hasAnyDependency(packageJson, TANSTACK_FORM_PACKAGES);
|
|
64679
64725
|
for (const packageName of REACT_THREE_FIBER_DEPENDENCY_NAMES) {
|
|
64680
64726
|
const version = resolveCatalogBackedDependencyVersion({
|
|
64681
64727
|
rootDirectory,
|
|
@@ -64778,6 +64824,13 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
64778
64824
|
tanstackQueryVersion: null,
|
|
64779
64825
|
styledComponentsVersion: null,
|
|
64780
64826
|
hasI18nLibrary: false,
|
|
64827
|
+
hasShadcnUi: false,
|
|
64828
|
+
hasRadixUi: false,
|
|
64829
|
+
hasBaseUi: false,
|
|
64830
|
+
hasReactAriaComponents: false,
|
|
64831
|
+
hasTanstackTable: false,
|
|
64832
|
+
hasTanstackVirtual: false,
|
|
64833
|
+
hasTanstackForm: false,
|
|
64781
64834
|
hasReactNativeAwarePackage: false,
|
|
64782
64835
|
hasReanimatedAwarePackage: false,
|
|
64783
64836
|
hasSsrDependency: false,
|
|
@@ -65122,6 +65175,12 @@ const discoverProjectWithoutPackageJson = (directory, options) => {
|
|
|
65122
65175
|
remotionVersion: null,
|
|
65123
65176
|
remotionMajorVersion: null,
|
|
65124
65177
|
hasI18nLibrary: false,
|
|
65178
|
+
hasRadixUi: false,
|
|
65179
|
+
hasBaseUi: false,
|
|
65180
|
+
hasReactAriaComponents: false,
|
|
65181
|
+
hasTanstackTable: false,
|
|
65182
|
+
hasTanstackVirtual: false,
|
|
65183
|
+
hasTanstackForm: false,
|
|
65125
65184
|
tanstackQueryVersion: null,
|
|
65126
65185
|
styledComponentsVersion: null,
|
|
65127
65186
|
hasThree: false,
|
|
@@ -65143,6 +65202,7 @@ const discoverProjectWithoutPackageJson = (directory, options) => {
|
|
|
65143
65202
|
shopifyFlashListMajorVersion: null,
|
|
65144
65203
|
hasReanimated: false,
|
|
65145
65204
|
reanimatedVersion: null,
|
|
65205
|
+
hasShadcnUi: detectShadcnUi(directory),
|
|
65146
65206
|
isPreES2023Target: hasOwnTsConfig && detectPreES2023Target(directory),
|
|
65147
65207
|
isStaticExport: false,
|
|
65148
65208
|
sourceFileCount
|
|
@@ -65305,6 +65365,12 @@ const discoverProject = (directory, options = {}) => {
|
|
|
65305
65365
|
hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
|
|
65306
65366
|
hasTanStackQuery: tanstackQueryVersion !== null,
|
|
65307
65367
|
hasI18nLibrary: workspaceFacts.hasI18nLibrary,
|
|
65368
|
+
hasRadixUi: workspaceFacts.hasRadixUi,
|
|
65369
|
+
hasBaseUi: workspaceFacts.hasBaseUi,
|
|
65370
|
+
hasReactAriaComponents: workspaceFacts.hasReactAriaComponents,
|
|
65371
|
+
hasTanstackTable: workspaceFacts.hasTanstackTable,
|
|
65372
|
+
hasTanstackVirtual: workspaceFacts.hasTanstackVirtual,
|
|
65373
|
+
hasTanstackForm: workspaceFacts.hasTanstackForm,
|
|
65308
65374
|
tanstackQueryVersion,
|
|
65309
65375
|
styledComponentsVersion: workspaceFacts.styledComponentsVersion,
|
|
65310
65376
|
valtioVersion,
|
|
@@ -65331,6 +65397,7 @@ const discoverProject = (directory, options = {}) => {
|
|
|
65331
65397
|
shopifyFlashListMajorVersion: shopifyFlashListVersion === null ? null : getLowestDependencyMajor(shopifyFlashListVersion),
|
|
65332
65398
|
hasReanimated,
|
|
65333
65399
|
reanimatedVersion,
|
|
65400
|
+
hasShadcnUi: workspaceFacts.hasShadcnUi,
|
|
65334
65401
|
isPreES2023Target,
|
|
65335
65402
|
isStaticExport: framework === "nextjs" && detectNextjsStaticExport(workspaceFacts.next.sourceDirectory ?? directory),
|
|
65336
65403
|
sourceFileCount
|
|
@@ -69335,6 +69402,13 @@ const buildCapabilities = (project) => {
|
|
|
69335
69402
|
minor: 0
|
|
69336
69403
|
})) capabilities.add("tailwind:4");
|
|
69337
69404
|
}
|
|
69405
|
+
if (project.hasShadcnUi === true) capabilities.add("shadcn");
|
|
69406
|
+
if (project.hasRadixUi === true) capabilities.add("radix-ui");
|
|
69407
|
+
if (project.hasBaseUi === true) capabilities.add("base-ui");
|
|
69408
|
+
if (project.hasReactAriaComponents === true) capabilities.add("react-aria");
|
|
69409
|
+
if (project.hasTanstackTable === true) capabilities.add("tanstack-table");
|
|
69410
|
+
if (project.hasTanstackVirtual === true) capabilities.add("tanstack-virtual");
|
|
69411
|
+
if (project.hasTanstackForm === true) capabilities.add("tanstack-form");
|
|
69338
69412
|
if (project.zodVersion !== null) capabilities.add("zod");
|
|
69339
69413
|
if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
|
|
69340
69414
|
if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
|
|
@@ -73024,6 +73098,46 @@ const buildProfiledNodeArguments = (input) => [
|
|
|
73024
73098
|
...input.heapProfileDirectory ? ["--heap-prof", `--heap-prof-dir=${input.heapProfileDirectory}`] : [],
|
|
73025
73099
|
...input.argumentsList
|
|
73026
73100
|
];
|
|
73101
|
+
const buildOxlintTimingArguments = (argumentsList) => {
|
|
73102
|
+
const timingArguments = [...argumentsList];
|
|
73103
|
+
const formatFlagIndex = timingArguments.indexOf("--format");
|
|
73104
|
+
if (formatFlagIndex === -1 || formatFlagIndex + 1 >= timingArguments.length) throw new Error("Oxlint timing arguments require a --format value");
|
|
73105
|
+
timingArguments[formatFlagIndex + 1] = "default";
|
|
73106
|
+
timingArguments.push("--debug", "timings", "--quiet");
|
|
73107
|
+
return timingArguments;
|
|
73108
|
+
};
|
|
73109
|
+
const captureOxlintRuleTimings = (input) => new Promise((resolve, reject) => {
|
|
73110
|
+
const timingEnvironment = { ...input.environment };
|
|
73111
|
+
timingEnvironment.REACT_DOCTOR_RULE_TIMINGS_DIR = void 0;
|
|
73112
|
+
const timingChild = spawn(input.nodeBinaryPath, buildOxlintTimingArguments(input.argumentsList), {
|
|
73113
|
+
cwd: input.rootDirectory,
|
|
73114
|
+
env: timingEnvironment,
|
|
73115
|
+
stdio: [
|
|
73116
|
+
"ignore",
|
|
73117
|
+
"pipe",
|
|
73118
|
+
"pipe"
|
|
73119
|
+
]
|
|
73120
|
+
});
|
|
73121
|
+
const stdoutBuffers = [];
|
|
73122
|
+
const stderrBuffers = [];
|
|
73123
|
+
timingChild.stdout.on("data", (buffer) => stdoutBuffers.push(buffer));
|
|
73124
|
+
timingChild.stderr.on("data", (buffer) => stderrBuffers.push(buffer));
|
|
73125
|
+
timingChild.on("error", reject);
|
|
73126
|
+
timingChild.on("close", (_code, signal) => {
|
|
73127
|
+
if (signal) {
|
|
73128
|
+
reject(/* @__PURE__ */ new Error(`Oxlint timing pass was killed by ${signal}`));
|
|
73129
|
+
return;
|
|
73130
|
+
}
|
|
73131
|
+
const timingOutput = `${Buffer.concat(stdoutBuffers).toString("utf8")}\n${Buffer.concat(stderrBuffers).toString("utf8")}`;
|
|
73132
|
+
if (!timingOutput.includes("Rule timings:")) {
|
|
73133
|
+
resolve();
|
|
73134
|
+
return;
|
|
73135
|
+
}
|
|
73136
|
+
fs$1$3.mkdirSync(input.timingDirectory, { recursive: true });
|
|
73137
|
+
fs$1$3.writeFileSync(path$1$1.join(input.timingDirectory, `oxlint-${timingChild.pid ?? process.pid}.timings.txt`), timingOutput);
|
|
73138
|
+
resolve();
|
|
73139
|
+
});
|
|
73140
|
+
});
|
|
73027
73141
|
const lowerChildProcessPriority = (processId) => {
|
|
73028
73142
|
if (processId === void 0) return;
|
|
73029
73143
|
try {
|
|
@@ -73145,7 +73259,18 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
73145
73259
|
return;
|
|
73146
73260
|
}
|
|
73147
73261
|
}
|
|
73148
|
-
|
|
73262
|
+
const timingDirectory = SANITIZED_ENV.REACT_DOCTOR_OXLINT_TIMINGS_DIR;
|
|
73263
|
+
if (timingDirectory === void 0) {
|
|
73264
|
+
resolve(output);
|
|
73265
|
+
return;
|
|
73266
|
+
}
|
|
73267
|
+
captureOxlintRuleTimings({
|
|
73268
|
+
argumentsList: args,
|
|
73269
|
+
environment: SANITIZED_ENV,
|
|
73270
|
+
nodeBinaryPath,
|
|
73271
|
+
rootDirectory,
|
|
73272
|
+
timingDirectory
|
|
73273
|
+
}).then(() => resolve(output), reject);
|
|
73149
73274
|
});
|
|
73150
73275
|
});
|
|
73151
73276
|
const PARALLELISM_EXHAUSTION_ERROR_CODES = new Set([
|
|
@@ -76415,6 +76540,7 @@ const METRIC = {
|
|
|
76415
76540
|
ciConfigured: "ci.configured",
|
|
76416
76541
|
rulesChanged: "rules.changed",
|
|
76417
76542
|
rulesQueried: "rules.queried",
|
|
76543
|
+
runtimeScanUrlPromptShown: "runtime_scan.url_prompt_shown",
|
|
76418
76544
|
tuiCompactReportShown: "tui.compact_report_shown",
|
|
76419
76545
|
tuiFindingNavigated: "tui.finding_navigated",
|
|
76420
76546
|
tuiIssueStreamShown: "tui.issue_stream_shown",
|
|
@@ -76468,7 +76594,7 @@ const makeNoopConsole = () => ({
|
|
|
76468
76594
|
});
|
|
76469
76595
|
//#endregion
|
|
76470
76596
|
//#region src/cli/utils/version.ts
|
|
76471
|
-
const VERSION = "0.9.12-dev.
|
|
76597
|
+
const VERSION = "0.9.12-dev.2b0f06e";
|
|
76472
76598
|
//#endregion
|
|
76473
76599
|
//#region src/cli/utils/json-mode.ts
|
|
76474
76600
|
let context = null;
|
|
@@ -76506,13 +76632,14 @@ const installSilentConsole = () => {
|
|
|
76506
76632
|
"trace"
|
|
76507
76633
|
]) target[key] = source[key];
|
|
76508
76634
|
};
|
|
76509
|
-
const enableJsonMode = ({ compact, directory, outputFile }) => {
|
|
76635
|
+
const enableJsonMode = ({ compact, directory, outputFile, writeCancellationError }) => {
|
|
76510
76636
|
context = {
|
|
76511
76637
|
compact,
|
|
76512
76638
|
directory,
|
|
76513
76639
|
startTime: performance$1.now(),
|
|
76514
76640
|
mode: "full",
|
|
76515
|
-
outputFile: null
|
|
76641
|
+
outputFile: null,
|
|
76642
|
+
writeCancellationError
|
|
76516
76643
|
};
|
|
76517
76644
|
installSilentConsole();
|
|
76518
76645
|
if (outputFile) {
|
|
@@ -76551,6 +76678,13 @@ const writeJsonErrorReport = (error, sentryEventId) => {
|
|
|
76551
76678
|
process.stdout.write(INTERNAL_ERROR_JSON_FALLBACK);
|
|
76552
76679
|
}
|
|
76553
76680
|
};
|
|
76681
|
+
const writeJsonCancellationReport = () => {
|
|
76682
|
+
if (context?.writeCancellationError !== void 0) {
|
|
76683
|
+
context.writeCancellationError();
|
|
76684
|
+
return;
|
|
76685
|
+
}
|
|
76686
|
+
writeJsonErrorReport(/* @__PURE__ */ new Error("Scan cancelled by user (SIGINT/SIGTERM)"));
|
|
76687
|
+
};
|
|
76554
76688
|
//#endregion
|
|
76555
76689
|
//#region src/cli/utils/run-id.ts
|
|
76556
76690
|
let cachedRunId;
|
|
@@ -76559,10 +76693,14 @@ const getRunId = () => {
|
|
|
76559
76693
|
return cachedRunId;
|
|
76560
76694
|
};
|
|
76561
76695
|
//#endregion
|
|
76696
|
+
//#region src/cli/utils/scrub-run-arguments.ts
|
|
76697
|
+
const scrubRunArguments = (argumentsList) => anonymizeText(argumentsList.map((argument) => argument.replace(/^((?:--[^=]+=)?)(?:https?|wss?):\/\/.+$/i, "$1<url>")).join(" "));
|
|
76698
|
+
//#endregion
|
|
76562
76699
|
//#region src/cli/utils/build-run-context.ts
|
|
76563
76700
|
const ROOT_SUBCOMMANDS = new Set([
|
|
76564
76701
|
"design",
|
|
76565
76702
|
"install",
|
|
76703
|
+
"scan",
|
|
76566
76704
|
"setup"
|
|
76567
76705
|
]);
|
|
76568
76706
|
const detectInvokedVia = () => {
|
|
@@ -76603,7 +76741,7 @@ const buildRunContext = () => {
|
|
|
76603
76741
|
runId: getRunId(),
|
|
76604
76742
|
origin: detectOrigin(),
|
|
76605
76743
|
command: detectCommand(userArguments),
|
|
76606
|
-
argv:
|
|
76744
|
+
argv: scrubRunArguments(userArguments),
|
|
76607
76745
|
cwd: scrubSensitivePaths(process.cwd()),
|
|
76608
76746
|
node: process.version,
|
|
76609
76747
|
nodeMajor: detectNodeMajor(),
|
|
@@ -76798,7 +76936,7 @@ const recordDistribution = (name, value, options = {}) => {
|
|
|
76798
76936
|
} catch {}
|
|
76799
76937
|
};
|
|
76800
76938
|
//#endregion
|
|
76801
|
-
export {
|
|
76939
|
+
export { Linter as $, CANONICAL_DISCORD_URL as $n, layerObservability as $t, SCAN_RESULT_CACHE_FILENAME as A, gen as An, discoverSupportedSubprojects as At, isNonInteractiveEnvironment as B, sync as Bn, getDiffInfo as Bt, CI_TRUST_COMPANIES as C, error as Cn, messageFromUnknown as Cr, collectSourceFileCountsByDirectory as Ct, NANOSECONDS_PER_MILLISECOND as D, Diagnostic as Dn, createNodeReadFileLinesSync as Dt, MINIMUM_VTE_VERSION_FOR_HYPERLINKS as E, warn$1 as En, countOptInProjectRuleSelections as Et, STAGED_FILES_TEMP_DIR_PREFIX as F, provide as Fn, formatErrorChain as Ft, isCiEnvironment as G, provide$2 as Gn, hashFileContents as Gt, isDebugFlagEnabled as H, void_ as Hn, groupBy as Ht, STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES as I, provideContext as In, formatReactDoctorError as It, Config as J, makeUnsafe$5 as Jn, isPathInsideDirectory as Jt, isCiOrCodingAgentEnvironment as K, succeed$3 as Kn, highlighter as Kt, TUI_REPORT_COMPACT_MAX_ROWS as L, provideService as Ln, getBaselineDiffPlan as Lt, SENTRY_DSN as M, map$3 as Mn, filterPathsOutsideDirectories as Mt, SENTRY_FLUSH_TIMEOUT_MS as N, orElseSucceed as Nn, filterSourceFiles as Nt, REACT_DOCTOR_CONFIG_PROJECT_NAME as O, decodeUnknownSync as On, createOxlintSpawnSlots as Ot, SENTRY_RELEASE_PREFIX as P, promise as Pn, findLegacyConfig as Pt, LintPartialFailures as Q, AXIOM_DEFAULT_DOMAIN as Qn, isScanComplete as Qt, TUI_REPORT_DETAIL_WIDTH_FRACTION as R, runPromise as Rn, getChangedLineRanges as Rt, BASELINE_FILES_TEMP_DIR_PREFIX as S, Console as Sn, isPlainObject as Sr, clearConfigCache as St, METRIC as T, log as Tn, computeDiagnosticDelta as Tt, ACTION_INPUT_ENVIRONMENT_VARIABLES as U, buildWithScope as Un, hasPublishedFixRecipe as Ut, isGitHookEnvironment as V, try_ as Vn, getEquivalentRuleKeys as Vt, detectRunnerOs as W, mergeAll$1 as Wn, hasSupportedFrameworkOrLibrary as Wt, Git as X, void_$1 as Xn, isReactDoctorError as Xt, Files as Y, fail$5 as Yn, isProjectDiscoveryError as Yt, LEGACY_CONFIG_FILENAME as Z, ParentSpan as Zn, isSameRuleKey as Zt, VERSION as _, shouldUseMaintainabilityLayer as _n, STAGED_FILES_PROJECT_CONFIG_FILENAMES as _r, buildRuleSeverityControls as _t, isEnvFlagEnabled as a, materializeSourceTree as an, DIAGNOSTIC_CATEGORY_BUCKETS as ar, Progress as at, AXIOM_METRICS_DATASET as b, validateConfigTypes as bn, isErrnoException as br, canonicalizeUserRuleKey as bt, setSentryProjectInfo as c, resolveGithubActionsScoreMetadata as cn, GITHUB_ACTIONS_SETUP_URL as cr, Score as ct, isJsonModeActive as d, resolveScanConcurrency as dn, JSX_DUPLICATION_SOURCE_FILE_PATTERN as dr, SupplyChain as dt, listSourceFiles as en, CANONICAL_GITHUB_URL as er, Maintainability as et, setJsonReportDirectory as f, resolveScanTarget as fn, JSX_FILE_PATTERN as fr, anonymizeInPlace as ft, writeJsonReport as g, setColorEnabled as gn, SKILL_NAME as gr, buildRuleDocsUrl as gt, writeJsonErrorReport as h, scrubSensitivePaths as hn, SHARE_BASE_URL as hr, buildJsonReport as ht, isTelemetryEnabled as i, mapWithConcurrency as in, CONFIG_SCHEMA_URL as ir, PerFileLintCacheEnabled as it, SCAN_RESULT_CACHE_MAX_HASHED_FILE_SIZE_BYTES as j, makeSpan$1 as jn, filterDiagnosticsForSurface as jt, RUN_GIT_MAX_BUFFER_BYTES as k, make$30 as kn, detectAiTrainingEnvironment as kt, getRunId as l, resolveLintBatchOrdering as ln, GIT_SHOW_MAX_BUFFER_BYTES as lr, SidecarLintCacheEnabled as lt, writeJsonCancellationReport as m, runInspect as mn, OXLINT_NODE_REQUIREMENT as mr, atomicWriteJson as mt, recordDistribution as n, listWorkspacePackages as nn, COMPILER_CLEANUP_BUCKET as nr, OxlintConcurrency as nt, buildSentryScope as o, mergeReactDoctorConfigs as on, DOCS_URL as or, Project as ot, setJsonReportMode as p, restoreLegacyThrow as pn, MILLISECONDS_PER_SECOND as pr, anonymizeText as pt, isCodingAgentEnvironment as q, close as qn, isMonorepoRoot as qt, toSpanAttributes as r, loadConfigWithSource as rn, COMPILER_CLEANUP_RULE_KEYS as rr, OxlintSpawnSlots as rt, buildSentryProjectContext as s, remainingDeadlineBudgetMs as sn, ENTERPRISE_CONTACT_URL as sr, Reporter as st, recordCount as t, listSourceFilesCooperative as tn, CI_URL as tr, NodeResolver as tt, enableJsonMode as u, resolveReactDoctorCacheDir as un, HTML_FILE_PATTERN as ur, StagedFiles as ut, makeNoopConsole as v, summarizeDiagnostics as vn, getCategoryImpact as vr, buildSkippedChecks as vt, GH_DEFAULT_BRANCH_PROBE_TIMEOUT_MS as w, info as wn, toCanonicalPath as wr, computeConfigFingerprint as wt, AXIOM_TRACES_DATASET as x, yieldToEventLoop as xn, isFile as xr, classifyFileContext as xt, AXIOM_INGEST_TOKEN as y, toRelativePath as yn, isDirectory as yr, calculateScore as yt, CliInputError as z, runSync as zn, getDiagnosticRuleIdentity as zt };
|
|
76802
76940
|
|
|
76803
|
-
//# sourceMappingURL=record-metric-
|
|
76804
|
-
//# debugId=
|
|
76941
|
+
//# sourceMappingURL=record-metric-CNHDZW2C.js.map
|
|
76942
|
+
//# debugId=84050cb3-ec23-5ae9-b377-bcd74ba5de78
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2e15275a-6bc9-5627-b55e-aaa738c44520")}catch(e){}}();
|
|
3
|
+
import { N as SENTRY_FLUSH_TIMEOUT_MS, T as METRIC, Xt as isReactDoctorError, l as getRunId, o as buildSentryScope, t as recordCount } from "./record-metric-CNHDZW2C.js";
|
|
4
|
+
import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-gpSkE7tQ.js";
|
|
5
|
+
import { r as recordRunTraceId, t as getActiveRunTrace } from "./active-run-trace-dlIZeEvb.js";
|
|
6
|
+
import * as Sentry from "@sentry/node";
|
|
7
|
+
//#region src/cli/utils/report-error.ts
|
|
8
|
+
/**
|
|
9
|
+
* Sends an error to Sentry — enriched with a fresh snapshot of the current run
|
|
10
|
+
* (version, platform, CI/agent, invocation, scanned project) and, when a run
|
|
11
|
+
* transaction is in flight, linked to its trace via the scope's propagation
|
|
12
|
+
* context so the crash and its transaction share a `trace_id` — then waits for
|
|
13
|
+
* delivery before the caller exits. The CLI tears down synchronously after
|
|
14
|
+
* rendering an error, so the awaited `flush` is what actually gets the event
|
|
15
|
+
* (and any in-flight transaction) off the machine.
|
|
16
|
+
*
|
|
17
|
+
* Returns the Sentry event id so the caller can surface it as a reference the
|
|
18
|
+
* user can quote when reporting the bug; returns `undefined` when Sentry was
|
|
19
|
+
* never initialized (`--no-score`, tests, or a missing DSN) or delivery failed.
|
|
20
|
+
* Swallows any transport failure so telemetry can never mask the user's
|
|
21
|
+
* original error.
|
|
22
|
+
*/
|
|
23
|
+
const reportErrorToSentry = async (error) => {
|
|
24
|
+
if (!Sentry.isInitialized()) return void 0;
|
|
25
|
+
if (isExpectedUserError(error)) return void 0;
|
|
26
|
+
try {
|
|
27
|
+
const { tags, contexts } = buildSentryScope();
|
|
28
|
+
let reason = "unknown";
|
|
29
|
+
if (isReactDoctorError(error)) reason = error.reason._tag;
|
|
30
|
+
else if (error instanceof Error) reason = error.name;
|
|
31
|
+
recordCount(METRIC.cliError, 1, {
|
|
32
|
+
command: typeof tags.command === "string" ? tags.command : void 0,
|
|
33
|
+
reason
|
|
34
|
+
});
|
|
35
|
+
const runTrace = getActiveRunTrace();
|
|
36
|
+
const eventId = Sentry.withScope((scope) => {
|
|
37
|
+
for (const [name, context] of Object.entries(contexts)) scope.setContext(name, context);
|
|
38
|
+
scope.setTags(tags);
|
|
39
|
+
if (runTrace) {
|
|
40
|
+
scope.setContext("axiom", {
|
|
41
|
+
traceId: runTrace.traceId,
|
|
42
|
+
runId: getRunId()
|
|
43
|
+
});
|
|
44
|
+
scope.setPropagationContext({
|
|
45
|
+
traceId: runTrace.traceId,
|
|
46
|
+
parentSpanId: runTrace.spanId,
|
|
47
|
+
sampled: runTrace.sampled,
|
|
48
|
+
sampleRand: Math.random()
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
recordRunTraceId(scope.getPropagationContext().traceId);
|
|
52
|
+
return Sentry.captureException(error);
|
|
53
|
+
});
|
|
54
|
+
await Promise.all([Sentry.flush(SENTRY_FLUSH_TIMEOUT_MS), shutdownTelemetry()]);
|
|
55
|
+
return eventId;
|
|
56
|
+
} catch {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { reportErrorToSentry as t };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=report-error-CKKT4508.js.map
|
|
64
|
+
//# debugId=2e15275a-6bc9-5627-b55e-aaa738c44520
|