react-doctor 0.9.14 → 0.9.15-dev.23d6160
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 +3 -0
- package/dist/_react-doctor_require-typescript-DXQDYeWK.js +16 -0
- package/dist/{active-run-trace-dlIZeEvb.js → active-run-trace-Dewycxda.js} +3 -3
- package/dist/{active-scan-abort-registry-B72ASBUh.js → active-scan-abort-registry-CCTgal0O.js} +3 -3
- package/dist/{build-section-divider-8DpL5BjN.js → build-section-divider-Bt7znRi8.js} +5 -4
- package/dist/{ci-DH_jkNS4.js → ci-vktx9bIK.js} +14 -13
- package/dist/cli.js +32 -29
- package/dist/constants-DJ3RtEMu.js +1035 -0
- package/dist/{constants-CKOk_Fa9.js → constants-DNh19qg9.js} +3 -3
- package/dist/{design-DR72z3tB.js → design-CH3L5hSZ.js} +4 -4
- package/dist/{devtools-DOdrAPkZ.js → devtools-D20sefkm.js} +3 -3
- package/dist/duplicate-jsx-worker.js +62 -62
- package/dist/{exit-gracefully-BP0lJPao.js → exit-gracefully-Y5XyTvxu.js} +7 -7
- package/dist/fs-utils-C88IbqFa.js +45 -0
- package/dist/{get-east-asian-width-CM5BOEC-.js → get-east-asian-width-DRPy7dqz.js} +4 -4
- package/dist/{handle-error-BO7AUOeO.js → handle-error-8NlzFVoW.js} +6 -5
- package/dist/index.d.ts +8511 -8509
- package/dist/index.js +12734 -12338
- package/dist/{inspect-CtwjUwiF.js → inspect-Cs2Ojloa.js} +28 -21
- package/dist/{install-DAwHDunN.js → install-C4JkqZoO.js} +10 -9
- package/dist/{install-doctor-script-DousNjwa.js → install-doctor-script-Dr4O5HID.js} +17 -8
- package/dist/{install-github-workflow-DNfyCbSd.js → install-github-workflow-Dtf07ISQ.js} +10 -10
- package/dist/{install-react-doctor-CofgPrzS.js → install-react-doctor-Bi_Dav6m.js} +15 -11
- package/dist/is-cache-globally-disabled-De19063F.js +10 -0
- package/dist/{jsx-runtime-Dv_yWxfg.js → jsx-runtime-CND_0px2.js} +11 -10
- package/dist/oxlint-worker.js +95 -5
- package/dist/{path-format-DnHpmJwG.js → path-format-By20mo8A.js} +3 -3
- package/dist/{print-branded-header-CFoO5ZHN.js → print-branded-header-DqaKyGKm.js} +4 -4
- package/dist/project-analysis-worker.js +459 -461
- package/dist/{prompt-runtime-scan-url-9tmVyRA2.js → prompt-runtime-scan-url-DiI3_zIx.js} +6 -6
- package/dist/react-compiler-detection-worker.d.ts +1 -0
- package/dist/react-compiler-detection-worker.js +1029 -0
- package/dist/{read-object-file-C8gGTrwo.js → read-object-file-DBJkVOGK.js} +4 -4
- package/dist/{record-metric-DMuxA69u.js → record-metric-C-ZZzzDc.js} +12589 -13129
- package/dist/{report-error-DynYEdrW.js → report-error-_C-eJJHZ.js} +7 -6
- package/dist/{report-workflow-result-C0nwk5Eq.js → report-workflow-result-BA_xTdWY.js} +24 -11
- package/dist/{resolve-scope-CtDh9FtN.js → resolve-scope-Cl4BiTkm.js} +7 -7
- package/dist/{rules-Dtp6I51W.js → rules-DAQXfBXb.js} +8 -7
- package/dist/{run-scan-app-DTjrGFyP.js → run-scan-app-CN5nwdB-.js} +12 -11
- package/dist/{runtime-scan-DylzMW6d.js → runtime-scan-DFdypOyE.js} +13 -12
- package/dist/{sanitize-runtime-url-CtosBgav.js → sanitize-runtime-url-yCL8ZAFd.js} +4 -4
- package/dist/{scan-i9quJrxG.js → scan-C6U_DFdI.js} +10 -9
- package/dist/{semver-DlmXks31.js → semver-BZIuy1gP.js} +3 -3
- package/dist/{should-fail-scan-gate-uW8_hnTc.js → should-fail-scan-gate-2mIY6wHj.js} +1848 -1825
- package/dist/{should-skip-prompts-fmi7PPp5.js → should-skip-prompts-CuyyYvRd.js} +4 -4
- package/dist/{should-use-tui-DaLPPhMi.js → should-use-tui-CbbIdX9b.js} +4 -4
- package/dist/start-scan-preamble-DVhXIPc0.d.ts +1 -0
- package/dist/start-scan-preamble-DZknzhHU.js +68 -0
- package/dist/start-scan-preamble.d.ts +1 -0
- package/dist/start-scan-preamble.js +4 -0
- package/dist/{telemetry-runtime-CxBC0gEj.js → telemetry-runtime-DLq3FDzI.js} +7 -6
- package/dist/{unref-stdin-SK3WfwxS.js → unref-stdin-D-NZBFpg.js} +3 -3
- package/dist/unwrap-typescript-expression-CrEPQUWz.js +14 -0
- package/dist/{version-Bti3M8BN.js → version-DO7dtT21.js} +5 -4
- package/dist/{why-dcQaGoJz.js → why-uxPDWtZO.js} +4 -4
- package/dist/{with-run-span-Lynvloyt.js → with-run-span-BCopjALe.js} +7 -6
- package/package.json +7 -5
- package/dist/_react-doctor_require-typescript-DnwIzXJn.js +0 -7
- package/dist/unwrap-typescript-expression-CbO_6kmC.js +0 -14
|
@@ -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]="ec0f5177-2747-59db-8b39-27f1cc08b1ed")}catch(e){}}();
|
|
3
3
|
const GIT_CHECK_ATTR_MAX_BUFFER_BYTES = 50 * 1024 * 1024;
|
|
4
4
|
const OXLINT_WORKER_JOB_END_MARKER = "__REACT_DOCTOR_OXLINT_JOB_END__";
|
|
5
5
|
const REACT_DOCTOR_PLUGIN_RESET_HOOK_KEY = Symbol.for("react-doctor.reset-filesystem-caches");
|
|
@@ -19,5 +19,5 @@ const JSX_DUPLICATION_SOURCE_FILE_PATTERN = /\.[cm]?(?:jsx?|tsx)$/;
|
|
|
19
19
|
//#endregion
|
|
20
20
|
export { MAX_GLOB_PATTERN_LENGTH_CHARS as a, GIT_CHECK_ATTR_MAX_BUFFER_BYTES as c, JSX_DUPLICATION_SOURCE_FILE_PATTERN as i, JSX_DUPLICATION_DEFAULT_MAX_SOURCE_FILES as n, OXLINT_WORKER_JOB_END_MARKER as o, JSX_DUPLICATION_DEFAULT_MAX_SOURCE_LENGTH_CHARS as r, REACT_DOCTOR_PLUGIN_RESET_HOOK_KEY as s, JSX_DUPLICATION_DEFAULT_MAX_JSX_NODES as t };
|
|
21
21
|
|
|
22
|
-
//# sourceMappingURL=constants-
|
|
23
|
-
//# debugId=
|
|
22
|
+
//# sourceMappingURL=constants-DNh19qg9.js.map
|
|
23
|
+
//# debugId=ec0f5177-2747-59db-8b39-27f1cc08b1ed
|
|
@@ -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 { t as inspectAction } from "./inspect-
|
|
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]="2f294ba0-1366-5500-a067-d6bb3b942eb1")}catch(e){}}();
|
|
3
|
+
import { t as inspectAction } from "./inspect-Cs2Ojloa.js";
|
|
4
4
|
//#region src/cli/commands/design.ts
|
|
5
5
|
const designAction = async (directory, flags) => inspectAction(directory, {
|
|
6
6
|
...flags,
|
|
@@ -10,5 +10,5 @@ const designAction = async (directory, flags) => inspectAction(directory, {
|
|
|
10
10
|
//#endregion
|
|
11
11
|
export { designAction };
|
|
12
12
|
|
|
13
|
-
//# sourceMappingURL=design-
|
|
14
|
-
//# debugId=
|
|
13
|
+
//# sourceMappingURL=design-CH3L5hSZ.js.map
|
|
14
|
+
//# debugId=2f294ba0-1366-5500-a067-d6bb3b942eb1
|
|
@@ -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]="0b1ed8bf-aa85-5ba8-93c1-1bd5f79c22e3")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
//#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/constants.js
|
|
5
5
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -16999,5 +16999,5 @@ if (await isDevToolsReachable()) {
|
|
|
16999
16999
|
//#endregion
|
|
17000
17000
|
export {};
|
|
17001
17001
|
|
|
17002
|
-
//# sourceMappingURL=devtools-
|
|
17003
|
-
//# debugId=
|
|
17002
|
+
//# sourceMappingURL=devtools-D20sefkm.js.map
|
|
17003
|
+
//# debugId=0b1ed8bf-aa85-5ba8-93c1-1bd5f79c22e3
|
|
@@ -1,13 +1,13 @@
|
|
|
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 { t as
|
|
4
|
-
import { t as unwrapTypescriptExpression } from "./unwrap-typescript-expression-
|
|
5
|
-
import { i as JSX_DUPLICATION_SOURCE_FILE_PATTERN } from "./constants-
|
|
6
|
-
import * as path$1 from "node:path";
|
|
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]="3fb1e6c0-870e-54f2-9dd3-ef90f8a0c9bf")}catch(e){}}();
|
|
3
|
+
import { t as typescriptBinding } from "./_react-doctor_require-typescript-DXQDYeWK.js";
|
|
4
|
+
import { t as unwrapTypescriptExpression } from "./unwrap-typescript-expression-CrEPQUWz.js";
|
|
5
|
+
import { i as JSX_DUPLICATION_SOURCE_FILE_PATTERN } from "./constants-DNh19qg9.js";
|
|
7
6
|
import * as fs$2 from "node:fs";
|
|
7
|
+
import * as path$1 from "node:path";
|
|
8
8
|
import crypto from "node:crypto";
|
|
9
|
-
import * as fs$1 from "node:fs/promises";
|
|
10
9
|
import { parentPort } from "node:worker_threads";
|
|
10
|
+
import * as fs$1 from "node:fs/promises";
|
|
11
11
|
//#region ../core/src/utils/resolve-bounded-source-read-bytes.ts
|
|
12
12
|
const resolveBoundedSourceReadBytes = (maximumLengthChars, sizeBytes) => Math.min(sizeBytes, maximumLengthChars * 3 + 1);
|
|
13
13
|
//#endregion
|
|
@@ -78,10 +78,10 @@ const createJsxSourceReader = (input) => {
|
|
|
78
78
|
//#endregion
|
|
79
79
|
//#region ../core/src/utils/get-typescript-script-kind.ts
|
|
80
80
|
const getTypescriptScriptKind = (fileName) => {
|
|
81
|
-
if (fileName.endsWith(".tsx")) return
|
|
82
|
-
if (fileName.endsWith(".jsx")) return
|
|
83
|
-
if (fileName.endsWith(".ts")) return
|
|
84
|
-
return
|
|
81
|
+
if (fileName.endsWith(".tsx")) return typescriptBinding.ScriptKind.TSX;
|
|
82
|
+
if (fileName.endsWith(".jsx")) return typescriptBinding.ScriptKind.JSX;
|
|
83
|
+
if (fileName.endsWith(".ts")) return typescriptBinding.ScriptKind.TS;
|
|
84
|
+
return typescriptBinding.ScriptKind.JS;
|
|
85
85
|
};
|
|
86
86
|
//#endregion
|
|
87
87
|
//#region ../core/src/utils/yield-to-event-loop.ts
|
|
@@ -103,14 +103,14 @@ const importDeclarationHasRuntimeValue = (declaration) => {
|
|
|
103
103
|
if (!importClause) return true;
|
|
104
104
|
if (importClause.isTypeOnly) return false;
|
|
105
105
|
if (importClause.name || !importClause.namedBindings) return true;
|
|
106
|
-
if (
|
|
106
|
+
if (typescriptBinding.isNamespaceImport(importClause.namedBindings)) return true;
|
|
107
107
|
return importClause.namedBindings.elements.some((element) => !element.isTypeOnly);
|
|
108
108
|
};
|
|
109
109
|
const openingElementHasNonReactMarker = (openingElement) => openingElement.attributes.properties.some((attribute) => {
|
|
110
|
-
if (!
|
|
111
|
-
if (
|
|
110
|
+
if (!typescriptBinding.isJsxAttribute(attribute)) return false;
|
|
111
|
+
if (typescriptBinding.isJsxNamespacedName(attribute.name)) return attribute.name.namespace.text === "class" || attribute.name.namespace.text === "bind";
|
|
112
112
|
if (attribute.name.text !== "classList" || !attribute.initializer) return false;
|
|
113
|
-
return
|
|
113
|
+
return typescriptBinding.isJsxExpression(attribute.initializer) && attribute.initializer.expression !== void 0 && typescriptBinding.isObjectLiteralExpression(attribute.initializer.expression);
|
|
114
114
|
});
|
|
115
115
|
const NON_REACT_RUNTIME_SOURCE_TEXT_MARKERS = [
|
|
116
116
|
...NON_REACT_JSX_RUNTIME_PREFIXES,
|
|
@@ -126,20 +126,20 @@ const isNonReactJsxSource = (sourceFile) => {
|
|
|
126
126
|
let hasReactRuntime = false;
|
|
127
127
|
let hasNonReactMarker = false;
|
|
128
128
|
const visitNode = (node) => {
|
|
129
|
-
if (
|
|
130
|
-
const source =
|
|
129
|
+
if (typescriptBinding.isImportDeclaration(node) && importDeclarationHasRuntimeValue(node)) {
|
|
130
|
+
const source = typescriptBinding.isStringLiteral(node.moduleSpecifier) ? node.moduleSpecifier.text : "";
|
|
131
131
|
if (NON_REACT_JSX_RUNTIME_PACKAGES.has(source) || matchesPackagePrefix(source, NON_REACT_JSX_RUNTIME_PREFIXES)) hasNonReactRuntime = true;
|
|
132
132
|
if (matchesPackagePrefix(source, REACT_JSX_RUNTIME_PREFIXES)) hasReactRuntime = true;
|
|
133
133
|
}
|
|
134
|
-
if ((
|
|
135
|
-
|
|
134
|
+
if ((typescriptBinding.isJsxOpeningElement(node) || typescriptBinding.isJsxSelfClosingElement(node)) && openingElementHasNonReactMarker(node)) hasNonReactMarker = true;
|
|
135
|
+
typescriptBinding.forEachChild(node, visitNode);
|
|
136
136
|
};
|
|
137
137
|
visitNode(sourceFile);
|
|
138
138
|
return !hasReactRuntime && (hasNonReactRuntime || hasNonReactMarker);
|
|
139
139
|
};
|
|
140
140
|
//#endregion
|
|
141
141
|
//#region ../core/src/react-cleanup/detect-duplicate-jsx-subtrees.ts
|
|
142
|
-
const isJsxSubtreeNode = (node) =>
|
|
142
|
+
const isJsxSubtreeNode = (node) => typescriptBinding.isJsxElement(node) || typescriptBinding.isJsxSelfClosingElement(node) || typescriptBinding.isJsxFragment(node);
|
|
143
143
|
const resolveOptions = (options) => ({
|
|
144
144
|
minimumNodeCount: options.minimumNodeCount ?? 6,
|
|
145
145
|
minimumDepth: options.minimumDepth ?? 3,
|
|
@@ -158,7 +158,7 @@ const hashParts = (parts) => {
|
|
|
158
158
|
const collectDirectJsxDescendants = (node) => {
|
|
159
159
|
const descendants = [];
|
|
160
160
|
const pendingNodes = [];
|
|
161
|
-
|
|
161
|
+
typescriptBinding.forEachChild(node, (child) => {
|
|
162
162
|
pendingNodes.push(child);
|
|
163
163
|
});
|
|
164
164
|
while (pendingNodes.length > 0) {
|
|
@@ -168,7 +168,7 @@ const collectDirectJsxDescendants = (node) => {
|
|
|
168
168
|
descendants.push(currentNode);
|
|
169
169
|
continue;
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
typescriptBinding.forEachChild(currentNode, (child) => {
|
|
172
172
|
pendingNodes.push(child);
|
|
173
173
|
});
|
|
174
174
|
}
|
|
@@ -176,15 +176,15 @@ const collectDirectJsxDescendants = (node) => {
|
|
|
176
176
|
};
|
|
177
177
|
const buildStructuralHash = (node, metadataByNode) => {
|
|
178
178
|
if (isJsxSubtreeNode(node)) return buildJsxSubtreeMetadata(node, metadataByNode).fingerprint;
|
|
179
|
-
if (
|
|
180
|
-
if (
|
|
179
|
+
if (typescriptBinding.isJsxText(node)) return node.getText().trim().length === 0 ? "jsx-whitespace" : "jsx-text";
|
|
180
|
+
if (typescriptBinding.isPropertyAccessExpression(node)) return hashParts([
|
|
181
181
|
"property-access",
|
|
182
182
|
node.questionDotToken === void 0 ? "required" : "optional",
|
|
183
183
|
buildStructuralHash(node.expression, metadataByNode),
|
|
184
184
|
node.name.text
|
|
185
185
|
]);
|
|
186
|
-
if (
|
|
187
|
-
const argumentHash =
|
|
186
|
+
if (typescriptBinding.isElementAccessExpression(node)) {
|
|
187
|
+
const argumentHash = typescriptBinding.isStringLiteral(node.argumentExpression) || typescriptBinding.isNumericLiteral(node.argumentExpression) ? `${typescriptBinding.SyntaxKind[node.argumentExpression.kind]}:${node.argumentExpression.text}` : buildStructuralHash(node.argumentExpression, metadataByNode);
|
|
188
188
|
return hashParts([
|
|
189
189
|
"element-access",
|
|
190
190
|
node.questionDotToken === void 0 ? "required" : "optional",
|
|
@@ -192,23 +192,23 @@ const buildStructuralHash = (node, metadataByNode) => {
|
|
|
192
192
|
argumentHash
|
|
193
193
|
]);
|
|
194
194
|
}
|
|
195
|
-
if (
|
|
195
|
+
if (typescriptBinding.isBinaryExpression(node)) return hashParts([
|
|
196
196
|
"binary-expression",
|
|
197
|
-
|
|
197
|
+
typescriptBinding.SyntaxKind[node.operatorToken.kind],
|
|
198
198
|
buildStructuralHash(node.left, metadataByNode),
|
|
199
199
|
buildStructuralHash(node.right, metadataByNode)
|
|
200
200
|
]);
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
if (typescriptBinding.isPrefixUnaryExpression(node) || typescriptBinding.isPostfixUnaryExpression(node)) return hashParts([
|
|
202
|
+
typescriptBinding.SyntaxKind[node.kind],
|
|
203
|
+
typescriptBinding.SyntaxKind[node.operator],
|
|
204
204
|
buildStructuralHash(node.operand, metadataByNode)
|
|
205
205
|
]);
|
|
206
|
-
if (
|
|
207
|
-
if (
|
|
208
|
-
if (
|
|
206
|
+
if (typescriptBinding.isIdentifier(node)) return "identifier";
|
|
207
|
+
if (typescriptBinding.isStringLiteral(node) || typescriptBinding.isNumericLiteral(node) || typescriptBinding.isNoSubstitutionTemplateLiteral(node) || typescriptBinding.isRegularExpressionLiteral(node)) return typescriptBinding.SyntaxKind[node.kind];
|
|
208
|
+
if (typescriptBinding.isJsxAttribute(node)) {
|
|
209
209
|
let initializerHash = "present";
|
|
210
|
-
if (node.initializer !== void 0) if (
|
|
211
|
-
else if (
|
|
210
|
+
if (node.initializer !== void 0) if (typescriptBinding.isStringLiteral(node.initializer)) initializerHash = `string:${node.initializer.text}`;
|
|
211
|
+
else if (typescriptBinding.isJsxExpression(node.initializer) && node.initializer.expression !== void 0 && (typescriptBinding.isStringLiteral(node.initializer.expression) || typescriptBinding.isNumericLiteral(node.initializer.expression) || node.initializer.expression.kind === typescriptBinding.SyntaxKind.TrueKeyword || node.initializer.expression.kind === typescriptBinding.SyntaxKind.FalseKeyword || node.initializer.expression.kind === typescriptBinding.SyntaxKind.NullKeyword)) initializerHash = `static:${node.initializer.expression.getText()}`;
|
|
212
212
|
else initializerHash = buildStructuralHash(node.initializer, metadataByNode);
|
|
213
213
|
return hashParts([
|
|
214
214
|
"attribute",
|
|
@@ -216,31 +216,31 @@ const buildStructuralHash = (node, metadataByNode) => {
|
|
|
216
216
|
initializerHash
|
|
217
217
|
]);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
219
|
+
if (typescriptBinding.isPropertyAssignment(node)) return hashParts([
|
|
220
220
|
"property-assignment",
|
|
221
221
|
node.name.getText(),
|
|
222
222
|
buildStructuralHash(node.initializer, metadataByNode)
|
|
223
223
|
]);
|
|
224
|
-
if (
|
|
225
|
-
if (
|
|
224
|
+
if (typescriptBinding.isShorthandPropertyAssignment(node)) return hashParts(["shorthand-property", node.name.text]);
|
|
225
|
+
if (typescriptBinding.isJsxSpreadAttribute(node)) return hashParts(["spread", buildStructuralHash(node.expression, metadataByNode)]);
|
|
226
226
|
const childHashes = [];
|
|
227
|
-
|
|
227
|
+
typescriptBinding.forEachChild(node, (child) => {
|
|
228
228
|
childHashes.push(buildStructuralHash(child, metadataByNode));
|
|
229
229
|
});
|
|
230
|
-
return hashParts([
|
|
230
|
+
return hashParts([typescriptBinding.SyntaxKind[node.kind], ...childHashes]);
|
|
231
231
|
};
|
|
232
232
|
const buildJsxSubtreeMetadata = (node, metadataByNode) => {
|
|
233
233
|
const existingMetadata = metadataByNode.get(node);
|
|
234
234
|
if (existingMetadata) return existingMetadata;
|
|
235
235
|
const descendantMetadata = collectDirectJsxDescendants(node).map((descendant) => buildJsxSubtreeMetadata(descendant, metadataByNode));
|
|
236
|
-
const nodeParts = [
|
|
237
|
-
if (
|
|
238
|
-
else if (
|
|
236
|
+
const nodeParts = [typescriptBinding.SyntaxKind[node.kind]];
|
|
237
|
+
if (typescriptBinding.isJsxElement(node)) nodeParts.push(node.openingElement.tagName.getText());
|
|
238
|
+
else if (typescriptBinding.isJsxSelfClosingElement(node)) nodeParts.push(node.tagName.getText());
|
|
239
239
|
else nodeParts.push("fragment");
|
|
240
|
-
|
|
241
|
-
if (
|
|
242
|
-
if (
|
|
243
|
-
if (
|
|
240
|
+
typescriptBinding.forEachChild(node, (child) => {
|
|
241
|
+
if (typescriptBinding.isJsxClosingElement(child) || typescriptBinding.isJsxClosingFragment(child)) return;
|
|
242
|
+
if (typescriptBinding.isJsxText(child) && child.getText().trim().length === 0) return;
|
|
243
|
+
if (typescriptBinding.isJsxExpression(child) && child.expression === void 0) return;
|
|
244
244
|
nodeParts.push(buildStructuralHash(child, metadataByNode));
|
|
245
245
|
});
|
|
246
246
|
const metadata = {
|
|
@@ -252,8 +252,8 @@ const buildJsxSubtreeMetadata = (node, metadataByNode) => {
|
|
|
252
252
|
return metadata;
|
|
253
253
|
};
|
|
254
254
|
const getRootName = (node) => {
|
|
255
|
-
if (
|
|
256
|
-
if (
|
|
255
|
+
if (typescriptBinding.isJsxElement(node)) return node.openingElement.tagName.getText();
|
|
256
|
+
if (typescriptBinding.isJsxSelfClosingElement(node)) return node.tagName.getText();
|
|
257
257
|
return "Fragment";
|
|
258
258
|
};
|
|
259
259
|
const getFunctionIdentity = (node, identityByNode) => {
|
|
@@ -267,7 +267,7 @@ const getFunctionIdentity = (node, identityByNode) => {
|
|
|
267
267
|
break;
|
|
268
268
|
}
|
|
269
269
|
traversedNodes.push(currentNode);
|
|
270
|
-
if (
|
|
270
|
+
if (typescriptBinding.isFunctionDeclaration(currentNode)) {
|
|
271
271
|
if (currentNode.name !== void 0) {
|
|
272
272
|
functionIdentity = {
|
|
273
273
|
name: currentNode.name.text,
|
|
@@ -275,7 +275,7 @@ const getFunctionIdentity = (node, identityByNode) => {
|
|
|
275
275
|
};
|
|
276
276
|
break;
|
|
277
277
|
}
|
|
278
|
-
if (
|
|
278
|
+
if (typescriptBinding.getModifiers(currentNode)?.some((modifier) => modifier.kind === typescriptBinding.SyntaxKind.DefaultKeyword)) {
|
|
279
279
|
functionIdentity = {
|
|
280
280
|
name: "default export",
|
|
281
281
|
startOffset: currentNode.getStart()
|
|
@@ -283,9 +283,9 @@ const getFunctionIdentity = (node, identityByNode) => {
|
|
|
283
283
|
break;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
if (
|
|
286
|
+
if (typescriptBinding.isMethodDeclaration(currentNode)) {
|
|
287
287
|
const classDeclaration = currentNode.parent;
|
|
288
|
-
if (
|
|
288
|
+
if (typescriptBinding.isClassDeclaration(classDeclaration) && classDeclaration.name !== void 0) {
|
|
289
289
|
functionIdentity = {
|
|
290
290
|
name: classDeclaration.name.text,
|
|
291
291
|
startOffset: classDeclaration.getStart()
|
|
@@ -298,31 +298,31 @@ const getFunctionIdentity = (node, identityByNode) => {
|
|
|
298
298
|
};
|
|
299
299
|
break;
|
|
300
300
|
}
|
|
301
|
-
if (
|
|
301
|
+
if (typescriptBinding.isFunctionExpression(currentNode) && currentNode.name !== void 0) {
|
|
302
302
|
functionIdentity = {
|
|
303
303
|
name: currentNode.name.text,
|
|
304
304
|
startOffset: currentNode.getStart()
|
|
305
305
|
};
|
|
306
306
|
break;
|
|
307
307
|
}
|
|
308
|
-
if (
|
|
308
|
+
if (typescriptBinding.isArrowFunction(currentNode) || typescriptBinding.isFunctionExpression(currentNode)) {
|
|
309
309
|
let assignmentNode = currentNode.parent;
|
|
310
|
-
while (assignmentNode !== void 0 && (
|
|
311
|
-
if (assignmentNode !== void 0 &&
|
|
310
|
+
while (assignmentNode !== void 0 && (typescriptBinding.isCallExpression(assignmentNode) || typescriptBinding.isExpressionWithTypeArguments(assignmentNode) || typescriptBinding.isExpression(assignmentNode) && unwrapTypescriptExpression(assignmentNode) !== assignmentNode)) assignmentNode = assignmentNode.parent;
|
|
311
|
+
if (assignmentNode !== void 0 && typescriptBinding.isVariableDeclaration(assignmentNode)) {
|
|
312
312
|
functionIdentity = {
|
|
313
313
|
name: assignmentNode.name.getText(),
|
|
314
314
|
startOffset: assignmentNode.getStart()
|
|
315
315
|
};
|
|
316
316
|
break;
|
|
317
317
|
}
|
|
318
|
-
if (assignmentNode !== void 0 &&
|
|
318
|
+
if (assignmentNode !== void 0 && typescriptBinding.isPropertyAssignment(assignmentNode)) {
|
|
319
319
|
functionIdentity = {
|
|
320
320
|
name: assignmentNode.name.getText(),
|
|
321
321
|
startOffset: assignmentNode.getStart()
|
|
322
322
|
};
|
|
323
323
|
break;
|
|
324
324
|
}
|
|
325
|
-
if (assignmentNode !== void 0 &&
|
|
325
|
+
if (assignmentNode !== void 0 && typescriptBinding.isExportAssignment(assignmentNode) && !assignmentNode.isExportEquals) {
|
|
326
326
|
functionIdentity = {
|
|
327
327
|
name: "default export",
|
|
328
328
|
startOffset: assignmentNode.getStart()
|
|
@@ -372,7 +372,7 @@ const collectCandidates = (source, sourceFile, signal, maximumCandidateCount) =>
|
|
|
372
372
|
jsxNodes.push(currentNode);
|
|
373
373
|
}
|
|
374
374
|
const childNodes = [];
|
|
375
|
-
|
|
375
|
+
typescriptBinding.forEachChild(currentNode, (child) => {
|
|
376
376
|
childNodes.push(child);
|
|
377
377
|
});
|
|
378
378
|
for (let childIndex = childNodes.length - 1; childIndex >= 0; childIndex -= 1) pendingNodes.push(childNodes[childIndex]);
|
|
@@ -421,7 +421,7 @@ const scanSource = (input) => {
|
|
|
421
421
|
didAbort: false,
|
|
422
422
|
didScan: false
|
|
423
423
|
};
|
|
424
|
-
const sourceFile =
|
|
424
|
+
const sourceFile = typescriptBinding.createSourceFile(input.source.path, input.source.sourceText, typescriptBinding.ScriptTarget.Latest, true, getTypescriptScriptKind(input.source.path));
|
|
425
425
|
if (isNonReactJsxSource(sourceFile)) return {
|
|
426
426
|
candidates: [],
|
|
427
427
|
incompleteReason: null,
|
|
@@ -633,4 +633,4 @@ startDuplicateJsxWorker();
|
|
|
633
633
|
export {};
|
|
634
634
|
|
|
635
635
|
//# sourceMappingURL=duplicate-jsx-worker.js.map
|
|
636
|
-
//# debugId=
|
|
636
|
+
//# debugId=3fb1e6c0-870e-54f2-9dd3-ef90f8a0c9bf
|
|
@@ -1,9 +1,9 @@
|
|
|
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 { d as isJsonModeActive, m as writeJsonCancellationReport } from "./record-metric-
|
|
4
|
-
import { n as shutdownTelemetry, r as flushSentry } from "./telemetry-runtime-
|
|
5
|
-
import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-
|
|
6
|
-
import { n as buildFooterLinkLines, t as buildSectionDivider } from "./build-section-divider-
|
|
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]="abb585b4-e873-5ef5-a599-3ffc6eab1e04")}catch(e){}}();
|
|
3
|
+
import { d as isJsonModeActive, m as writeJsonCancellationReport } from "./record-metric-C-ZZzzDc.js";
|
|
4
|
+
import { n as shutdownTelemetry, r as flushSentry } from "./telemetry-runtime-DLq3FDzI.js";
|
|
5
|
+
import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-CCTgal0O.js";
|
|
6
|
+
import { n as buildFooterLinkLines, t as buildSectionDivider } from "./build-section-divider-Bt7znRi8.js";
|
|
7
7
|
//#region src/cli/utils/active-tui-renderer.ts
|
|
8
8
|
let activeTuiRenderer = null;
|
|
9
9
|
const registerActiveTuiRenderer = (renderer) => {
|
|
@@ -50,5 +50,5 @@ const exitGracefully = () => {
|
|
|
50
50
|
//#endregion
|
|
51
51
|
export { registerActiveTuiRenderer as n, exitGracefully as t };
|
|
52
52
|
|
|
53
|
-
//# sourceMappingURL=exit-gracefully-
|
|
54
|
-
//# debugId=
|
|
53
|
+
//# sourceMappingURL=exit-gracefully-Y5XyTvxu.js.map
|
|
54
|
+
//# debugId=abb585b4-e873-5ef5-a599-3ffc6eab1e04
|
|
@@ -0,0 +1,45 @@
|
|
|
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]="1136a40a-1f61-5692-99b2-3333cd8344be")}catch(e){}}();
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
//#region ../core/src/utils/is-errno-exception.ts
|
|
5
|
+
const isErrnoException = (error) => error instanceof Error && "code" in error;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ../core/src/project-info/fs-utils.ts
|
|
8
|
+
const IGNORABLE_READDIR_ERROR_CODES = new Set([
|
|
9
|
+
"EACCES",
|
|
10
|
+
"EBUSY",
|
|
11
|
+
"EPERM",
|
|
12
|
+
"ENOENT",
|
|
13
|
+
"ENOTDIR",
|
|
14
|
+
"EINVAL",
|
|
15
|
+
"ELOOP",
|
|
16
|
+
"ENAMETOOLONG",
|
|
17
|
+
"ETIMEDOUT",
|
|
18
|
+
"UNKNOWN"
|
|
19
|
+
]);
|
|
20
|
+
const isIgnorableReaddirError = (error) => isErrnoException(error) && typeof error.code === "string" && IGNORABLE_READDIR_ERROR_CODES.has(error.code);
|
|
21
|
+
const readDirectoryEntries = (directoryPath) => {
|
|
22
|
+
try {
|
|
23
|
+
return fs.readdirSync(directoryPath, { withFileTypes: true });
|
|
24
|
+
} catch (error) {
|
|
25
|
+
if (isIgnorableReaddirError(error)) return [];
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const isFile = (filePath) => {
|
|
30
|
+
try {
|
|
31
|
+
return fs.statSync(filePath, { throwIfNoEntry: false })?.isFile() ?? false;
|
|
32
|
+
} catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const isPlainObject = (value) => {
|
|
37
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
38
|
+
const prototype = Object.getPrototypeOf(value);
|
|
39
|
+
return prototype === null || prototype === Object.prototype;
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { isErrnoException as i, isPlainObject as n, readDirectoryEntries as r, isFile as t };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=fs-utils-C88IbqFa.js.map
|
|
45
|
+
//# debugId=1136a40a-1f61-5692-99b2-3333cd8344be
|
|
@@ -1,7 +1,7 @@
|
|
|
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 process from "node:process";
|
|
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]="70b802b1-ad2a-5159-b53c-75b55bfdbad2")}catch(e){}}();
|
|
4
3
|
import os from "node:os";
|
|
4
|
+
import process from "node:process";
|
|
5
5
|
import tty from "node:tty";
|
|
6
6
|
//#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
7
7
|
const ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -440,5 +440,5 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
|
440
440
|
//#endregion
|
|
441
441
|
export { chalk as a, stripAnsi as i, isFullWidth as n, isWide as r, eastAsianWidth as t };
|
|
442
442
|
|
|
443
|
-
//# sourceMappingURL=get-east-asian-width-
|
|
444
|
-
//# debugId=
|
|
443
|
+
//# sourceMappingURL=get-east-asian-width-DRPy7dqz.js.map
|
|
444
|
+
//# debugId=70b802b1-ad2a-5159-b53c-75b55bfdbad2
|
|
@@ -1,7 +1,8 @@
|
|
|
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 {
|
|
4
|
-
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]="f39101d5-24eb-597f-aa14-1d4057210187")}catch(e){}}();
|
|
3
|
+
import { ct as CANONICAL_DISCORD_URL, lt as CANONICAL_GITHUB_URL, u as METRIC } from "./constants-DJ3RtEMu.js";
|
|
4
|
+
import { Ln as isErrnoException, Ot as highlighter, _ as VERSION, _t as formatErrorChain, jt as isReactDoctorError, rn as error, t as recordCount, un as gen, vt as formatReactDoctorError, yn as runSync } from "./record-metric-C-ZZzzDc.js";
|
|
5
|
+
import { c as isNpmCacheCorruptionError, l as formatEnvironmentError, s as formatNpmCacheCorruptionError, u as isEnvironmentError } from "./telemetry-runtime-DLq3FDzI.js";
|
|
5
6
|
//#region src/cli/utils/handle-error.ts
|
|
6
7
|
const OTLP_ENDPOINT_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_ENDPOINT";
|
|
7
8
|
const OTLP_AUTH_HEADER_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_AUTH_HEADER";
|
|
@@ -110,5 +111,5 @@ const handleUserError = (error$1, options = {}) => {
|
|
|
110
111
|
//#endregion
|
|
111
112
|
export { handleUserError as n, handleError as t };
|
|
112
113
|
|
|
113
|
-
//# sourceMappingURL=handle-error-
|
|
114
|
-
//# debugId=
|
|
114
|
+
//# sourceMappingURL=handle-error-8NlzFVoW.js.map
|
|
115
|
+
//# debugId=f39101d5-24eb-597f-aa14-1d4057210187
|