react-doctor 0.9.2-dev.3728102 → 0.9.2-dev.86add14
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/cli.js +359 -133
- package/dist/index.d.ts +8 -2
- package/dist/index.js +80 -40
- package/dist/lsp.js +80 -39
- package/package.json +2 -2
package/dist/lsp.js
CHANGED
|
@@ -12,9 +12,9 @@ import * as NodeChildProcess from "node:child_process";
|
|
|
12
12
|
import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
13
13
|
import { ResolverFactory } from "oxc-resolver";
|
|
14
14
|
import ts from "typescript";
|
|
15
|
-
import { parseJSON5 } from "confbox";
|
|
16
15
|
import * as NodeUrl from "node:url";
|
|
17
16
|
import { fileURLToPath } from "node:url";
|
|
17
|
+
import { parseJSON5 } from "confbox";
|
|
18
18
|
import { createJiti } from "jiti";
|
|
19
19
|
import { ANALYZED_MANIFEST_FILENAMES, DEFAULT_EXTENSIONS } from "deslop-js/analyzed-inputs";
|
|
20
20
|
import { gzipSync } from "node:zlib";
|
|
@@ -62452,10 +62452,16 @@ const getTopLevelBinding = (sourceFile, bindingName) => {
|
|
|
62452
62452
|
}
|
|
62453
62453
|
return null;
|
|
62454
62454
|
};
|
|
62455
|
-
const getFunctionLocalBindings = (functionNode, argumentsList) => {
|
|
62455
|
+
const getFunctionLocalBindings = (functionNode, argumentsList, argumentAnalysis, functionAnalysis) => {
|
|
62456
62456
|
const localBindings = /* @__PURE__ */ new Map();
|
|
62457
62457
|
functionNode.parameters.forEach((parameter, parameterIndex) => {
|
|
62458
|
-
if (ts.isIdentifier(parameter.name))
|
|
62458
|
+
if (ts.isIdentifier(parameter.name)) {
|
|
62459
|
+
const argument = argumentsList[parameterIndex];
|
|
62460
|
+
localBindings.set(parameter.name.text, {
|
|
62461
|
+
expression: argument ?? parameter.initializer ?? null,
|
|
62462
|
+
analysis: argument ? argumentAnalysis : functionAnalysis
|
|
62463
|
+
});
|
|
62464
|
+
}
|
|
62459
62465
|
});
|
|
62460
62466
|
return localBindings;
|
|
62461
62467
|
};
|
|
@@ -62591,8 +62597,8 @@ const getStaticConfigValueState = (expression, analysis, visitedExpressions = /*
|
|
|
62591
62597
|
};
|
|
62592
62598
|
if (ts.isIdentifier(unwrappedExpression)) {
|
|
62593
62599
|
if (analysis.localBindings.has(unwrappedExpression.text)) {
|
|
62594
|
-
const
|
|
62595
|
-
return
|
|
62600
|
+
const localReference = analysis.localBindings.get(unwrappedExpression.text);
|
|
62601
|
+
return localReference?.expression ? getStaticConfigValueState(localReference.expression, localReference.analysis, nextVisitedExpressions) : null;
|
|
62596
62602
|
}
|
|
62597
62603
|
const topLevelBinding = getTopLevelBinding(analysis.sourceFile, unwrappedExpression.text);
|
|
62598
62604
|
return topLevelBinding && ts.isExpression(topLevelBinding) ? getStaticConfigValueState(topLevelBinding, analysis, nextVisitedExpressions) : null;
|
|
@@ -62634,8 +62640,8 @@ const getReactCompilerFlagState = (expression, analysis, visitedExpressions = /*
|
|
|
62634
62640
|
const assignedBinding = getAssignedPropertyInitializer(unwrappedExpression, "reactCompiler");
|
|
62635
62641
|
if (assignedBinding.wasFound && assignedBinding.initializer) return { isEnabled: !isStaticallyDisabledConfigExpression(assignedBinding.initializer, analysis) };
|
|
62636
62642
|
if (analysis.localBindings.has(unwrappedExpression.text)) {
|
|
62637
|
-
const
|
|
62638
|
-
return
|
|
62643
|
+
const localReference = analysis.localBindings.get(unwrappedExpression.text);
|
|
62644
|
+
return localReference?.expression ? getReactCompilerFlagState(localReference.expression, localReference.analysis, nextVisitedExpressions) : null;
|
|
62639
62645
|
}
|
|
62640
62646
|
const topLevelBinding = getTopLevelBinding(analysis.sourceFile, unwrappedExpression.text);
|
|
62641
62647
|
return topLevelBinding && ts.isExpression(topLevelBinding) ? getReactCompilerFlagState(topLevelBinding, analysis, nextVisitedExpressions) : null;
|
|
@@ -62658,8 +62664,8 @@ const getSelectedObjectProperty = (expression, propertyName, analysis, visitedEx
|
|
|
62658
62664
|
visitedExpressions.add(resolvedExpression);
|
|
62659
62665
|
if (ts.isIdentifier(resolvedExpression)) {
|
|
62660
62666
|
if (analysis.localBindings.has(resolvedExpression.text)) {
|
|
62661
|
-
const
|
|
62662
|
-
return
|
|
62667
|
+
const localReference = analysis.localBindings.get(resolvedExpression.text);
|
|
62668
|
+
return localReference?.expression ? getSelectedObjectProperty(localReference.expression, propertyName, localReference.analysis, visitedExpressions) : null;
|
|
62663
62669
|
}
|
|
62664
62670
|
const scopedBinding = getScopedConfigBinding(resolvedExpression);
|
|
62665
62671
|
if (scopedBinding.wasFound) return scopedBinding.initializer ? getSelectedObjectProperty(scopedBinding.initializer, propertyName, analysis, visitedExpressions) : null;
|
|
@@ -62668,9 +62674,18 @@ const getSelectedObjectProperty = (expression, propertyName, analysis, visitedEx
|
|
|
62668
62674
|
}
|
|
62669
62675
|
if (!ts.isObjectLiteralExpression(resolvedExpression)) return null;
|
|
62670
62676
|
for (const property of [...resolvedExpression.properties].reverse()) {
|
|
62671
|
-
if (ts.isPropertyAssignment(property) && getStaticPropertyName$2(property.name) === propertyName) return
|
|
62672
|
-
|
|
62673
|
-
|
|
62677
|
+
if (ts.isPropertyAssignment(property) && getStaticPropertyName$2(property.name) === propertyName) return {
|
|
62678
|
+
node: property.initializer,
|
|
62679
|
+
analysis
|
|
62680
|
+
};
|
|
62681
|
+
if (ts.isMethodDeclaration(property) && getStaticPropertyName$2(property.name) === propertyName) return {
|
|
62682
|
+
node: property,
|
|
62683
|
+
analysis
|
|
62684
|
+
};
|
|
62685
|
+
if (ts.isShorthandPropertyAssignment(property) && property.name.text === propertyName) return {
|
|
62686
|
+
node: property.name,
|
|
62687
|
+
analysis
|
|
62688
|
+
};
|
|
62674
62689
|
if (ts.isSpreadAssignment(property)) {
|
|
62675
62690
|
const spreadProperty = getSelectedObjectProperty(property.expression, propertyName, analysis, visitedExpressions);
|
|
62676
62691
|
if (spreadProperty) return spreadProperty;
|
|
@@ -62683,8 +62698,8 @@ const configExpressionMayDefineProperty = (expression, propertyName, analysis) =
|
|
|
62683
62698
|
while (ts.isParenthesizedExpression(resolvedExpression) || ts.isAsExpression(resolvedExpression) || ts.isTypeAssertionExpression(resolvedExpression) || ts.isSatisfiesExpression(resolvedExpression) || ts.isNonNullExpression(resolvedExpression)) resolvedExpression = resolvedExpression.expression;
|
|
62684
62699
|
if (ts.isIdentifier(resolvedExpression)) {
|
|
62685
62700
|
if (analysis.localBindings.has(resolvedExpression.text)) {
|
|
62686
|
-
const
|
|
62687
|
-
return
|
|
62701
|
+
const localReference = analysis.localBindings.get(resolvedExpression.text);
|
|
62702
|
+
return localReference?.expression ? configExpressionMayDefineProperty(localReference.expression, propertyName, localReference.analysis) : true;
|
|
62688
62703
|
}
|
|
62689
62704
|
const scopedBinding = getScopedConfigBinding(resolvedExpression);
|
|
62690
62705
|
if (scopedBinding.wasFound) return scopedBinding.initializer ? configExpressionMayDefineProperty(scopedBinding.initializer, propertyName, analysis) : true;
|
|
@@ -62768,15 +62783,15 @@ const getReExportedConfigModules = (sourceFile, exportName) => {
|
|
|
62768
62783
|
}
|
|
62769
62784
|
return bindings;
|
|
62770
62785
|
};
|
|
62771
|
-
const analyzeConfigModuleExport = (filePath, exportName, allowCompilerTransform, importDepth, visitedModules, argumentsList = []) => {
|
|
62786
|
+
const analyzeConfigModuleExport = (filePath, exportName, allowCompilerTransform, importDepth, visitedModules, argumentsList = [], argumentAnalysis) => {
|
|
62772
62787
|
if (!isFile(filePath) || importDepth > 4) return false;
|
|
62773
62788
|
const moduleVisitKey = `${filePath}:${exportName}:${allowCompilerTransform}`;
|
|
62774
62789
|
if (visitedModules.has(moduleVisitKey)) return false;
|
|
62775
62790
|
const nextVisitedModules = new Set(visitedModules);
|
|
62776
62791
|
nextVisitedModules.add(moduleVisitKey);
|
|
62777
|
-
return analyzeConfigSourceFileExport(parseConfigSourceFile(filePath, NFS.readFileSync(filePath, "utf-8")), filePath, exportName, allowCompilerTransform, importDepth, nextVisitedModules, argumentsList);
|
|
62792
|
+
return analyzeConfigSourceFileExport(parseConfigSourceFile(filePath, NFS.readFileSync(filePath, "utf-8")), filePath, exportName, allowCompilerTransform, importDepth, nextVisitedModules, argumentsList, argumentAnalysis);
|
|
62778
62793
|
};
|
|
62779
|
-
const analyzeConfigSourceFileExport = (sourceFile, filePath, exportName, allowCompilerTransform, importDepth, visitedModules, argumentsList = []) => {
|
|
62794
|
+
const analyzeConfigSourceFileExport = (sourceFile, filePath, exportName, allowCompilerTransform, importDepth, visitedModules, argumentsList = [], argumentAnalysis) => {
|
|
62780
62795
|
const analysis = {
|
|
62781
62796
|
filePath,
|
|
62782
62797
|
sourceFile,
|
|
@@ -62786,14 +62801,27 @@ const analyzeConfigSourceFileExport = (sourceFile, filePath, exportName, allowCo
|
|
|
62786
62801
|
localBindings: /* @__PURE__ */ new Map(),
|
|
62787
62802
|
activeFunctions: /* @__PURE__ */ new Set()
|
|
62788
62803
|
};
|
|
62804
|
+
const resolvedArgumentAnalysis = argumentAnalysis ?? analysis;
|
|
62789
62805
|
const exportedConfigNodes = getExportedConfigNodes(sourceFile, exportName);
|
|
62790
|
-
return exportedConfigNodes.some((node) =>
|
|
62806
|
+
return exportedConfigNodes.some((node) => {
|
|
62807
|
+
if (ts.isArrowFunction(node) || ts.isFunctionExpression(node) || ts.isFunctionDeclaration(node)) return analyzeConfigFunction(node, analysis, allowCompilerTransform, argumentsList, resolvedArgumentAnalysis);
|
|
62808
|
+
if (argumentsList.length > 0 && ts.isIdentifier(node)) {
|
|
62809
|
+
const topLevelBinding = getTopLevelBinding(sourceFile, node.text);
|
|
62810
|
+
if (topLevelBinding && ts.isFunctionLike(topLevelBinding)) return analyzeConfigFunction(topLevelBinding, analysis, allowCompilerTransform, argumentsList, resolvedArgumentAnalysis);
|
|
62811
|
+
const importBinding = getImportBinding(sourceFile, node.text);
|
|
62812
|
+
if (importBinding) {
|
|
62813
|
+
const importedFilePath = resolveImportedConfigFile(filePath, importBinding.moduleSpecifier);
|
|
62814
|
+
return Boolean(importedFilePath && analyzeConfigModuleExport(importedFilePath, importBinding.exportName, allowCompilerTransform, importDepth + 1, visitedModules, argumentsList, resolvedArgumentAnalysis));
|
|
62815
|
+
}
|
|
62816
|
+
}
|
|
62817
|
+
return analyzeConfigNode(node, analysis, allowCompilerTransform);
|
|
62818
|
+
}) || getReExportedConfigModules(sourceFile, exportName).some((binding) => {
|
|
62791
62819
|
if (exportedConfigNodes.length > 0 && binding.isNamespace) return false;
|
|
62792
62820
|
const importedFilePath = resolveImportedConfigFile(filePath, binding.moduleSpecifier);
|
|
62793
|
-
return Boolean(importedFilePath && analyzeConfigModuleExport(importedFilePath, binding.exportName, allowCompilerTransform, importDepth + 1, visitedModules, argumentsList));
|
|
62821
|
+
return Boolean(importedFilePath && analyzeConfigModuleExport(importedFilePath, binding.exportName, allowCompilerTransform, importDepth + 1, visitedModules, argumentsList, resolvedArgumentAnalysis));
|
|
62794
62822
|
});
|
|
62795
62823
|
};
|
|
62796
|
-
const analyzeConfigFunction = (functionNode, analysis, allowCompilerTransform, argumentsList = []) => {
|
|
62824
|
+
const analyzeConfigFunction = (functionNode, analysis, allowCompilerTransform, argumentsList = [], argumentAnalysis = analysis) => {
|
|
62797
62825
|
if (!functionNode.body) return false;
|
|
62798
62826
|
if (analysis.activeFunctions.has(functionNode.pos)) return false;
|
|
62799
62827
|
const activeFunctions = new Set(analysis.activeFunctions);
|
|
@@ -62801,7 +62829,7 @@ const analyzeConfigFunction = (functionNode, analysis, allowCompilerTransform, a
|
|
|
62801
62829
|
const functionAnalysis = {
|
|
62802
62830
|
...analysis,
|
|
62803
62831
|
visitedNodes: /* @__PURE__ */ new Set(),
|
|
62804
|
-
localBindings: getFunctionLocalBindings(functionNode, argumentsList),
|
|
62832
|
+
localBindings: getFunctionLocalBindings(functionNode, argumentsList, argumentAnalysis, analysis),
|
|
62805
62833
|
activeFunctions
|
|
62806
62834
|
};
|
|
62807
62835
|
if (!ts.isBlock(functionNode.body)) return analyzeConfigNode(functionNode.body, functionAnalysis, allowCompilerTransform);
|
|
@@ -62820,7 +62848,7 @@ const analyzeConfigFunction = (functionNode, analysis, allowCompilerTransform, a
|
|
|
62820
62848
|
const analyzeImportedConfig = ({ analysis, moduleSpecifier, exportName, allowCompilerTransform, argumentsList }) => {
|
|
62821
62849
|
const importedFilePath = resolveImportedConfigFile(analysis.filePath, moduleSpecifier);
|
|
62822
62850
|
if (!importedFilePath) return null;
|
|
62823
|
-
return analyzeConfigModuleExport(importedFilePath, exportName, allowCompilerTransform, analysis.importDepth + 1, analysis.visitedModules, argumentsList);
|
|
62851
|
+
return analyzeConfigModuleExport(importedFilePath, exportName, allowCompilerTransform, analysis.importDepth + 1, analysis.visitedModules, argumentsList, analysis);
|
|
62824
62852
|
};
|
|
62825
62853
|
const analyzeConfigIdentifier = (identifier, analysis, allowCompilerTransform, isCompilerTransformCollection, excludedPropertyNames) => {
|
|
62826
62854
|
const assignedReactCompiler = getAssignedPropertyInitializer(identifier, "reactCompiler");
|
|
@@ -62834,8 +62862,8 @@ const analyzeConfigIdentifier = (identifier, analysis, allowCompilerTransform, i
|
|
|
62834
62862
|
if (assignedPlugins.wasFound) overriddenPropertyNames.add("plugins");
|
|
62835
62863
|
if (assignedPresets.wasFound) overriddenPropertyNames.add("presets");
|
|
62836
62864
|
if (analysis.localBindings.has(identifier.text)) {
|
|
62837
|
-
const
|
|
62838
|
-
return Boolean(
|
|
62865
|
+
const localReference = analysis.localBindings.get(identifier.text);
|
|
62866
|
+
return Boolean(localReference?.expression && analyzeConfigNode(localReference.expression, localReference.analysis, allowCompilerTransform, isCompilerTransformCollection, overriddenPropertyNames));
|
|
62839
62867
|
}
|
|
62840
62868
|
const scopedBinding = getScopedConfigBinding(identifier);
|
|
62841
62869
|
if (scopedBinding.wasFound) return Boolean(scopedBinding.initializer && analyzeConfigNode(scopedBinding.initializer, analysis, allowCompilerTransform, isCompilerTransformCollection, overriddenPropertyNames));
|
|
@@ -62901,7 +62929,7 @@ const analyzeConfigCallTarget = (callExpression, analysis, allowCompilerTransfor
|
|
|
62901
62929
|
}
|
|
62902
62930
|
const selectedProperty = getSelectedObjectProperty(target.expression, propertyName, analysis);
|
|
62903
62931
|
if (selectedProperty === null) return null;
|
|
62904
|
-
return ts.isFunctionLike(selectedProperty) ? analyzeConfigFunction(selectedProperty, analysis, allowCompilerTransform, callExpression.arguments) : analyzeConfigNode(selectedProperty, analysis, allowCompilerTransform);
|
|
62932
|
+
return ts.isFunctionLike(selectedProperty.node) ? analyzeConfigFunction(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform, callExpression.arguments, analysis) : analyzeConfigNode(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform);
|
|
62905
62933
|
};
|
|
62906
62934
|
const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTransformCollection = false, excludedPropertyNames) => {
|
|
62907
62935
|
const excludedPropertiesVisitKey = excludedPropertyNames ? [...excludedPropertyNames].sort().join(",") : "";
|
|
@@ -63001,7 +63029,7 @@ const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTra
|
|
|
63001
63029
|
if (ts.isIdentifier(node.expression)) {
|
|
63002
63030
|
if (analysis.localBindings.has(node.expression.text) || getScopedConfigBinding(node.expression).wasFound) {
|
|
63003
63031
|
const selectedProperty = getSelectedObjectProperty(node.expression, node.name.text, analysis);
|
|
63004
|
-
return Boolean(selectedProperty && analyzeConfigNode(selectedProperty, analysis, allowCompilerTransform));
|
|
63032
|
+
return Boolean(selectedProperty && analyzeConfigNode(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform));
|
|
63005
63033
|
}
|
|
63006
63034
|
const importBinding = getImportBinding(analysis.sourceFile, node.expression.text);
|
|
63007
63035
|
if (importBinding?.isNamespace) {
|
|
@@ -63015,7 +63043,7 @@ const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTra
|
|
|
63015
63043
|
return false;
|
|
63016
63044
|
}
|
|
63017
63045
|
const selectedProperty = getSelectedObjectProperty(node.expression, node.name.text, analysis);
|
|
63018
|
-
if (selectedProperty) return analyzeConfigNode(selectedProperty, analysis, allowCompilerTransform);
|
|
63046
|
+
if (selectedProperty) return analyzeConfigNode(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform);
|
|
63019
63047
|
return false;
|
|
63020
63048
|
}
|
|
63021
63049
|
return analyzeConfigNode(node.expression, analysis, allowCompilerTransform);
|
|
@@ -63024,7 +63052,7 @@ const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTra
|
|
|
63024
63052
|
if (ts.isIdentifier(node.expression)) {
|
|
63025
63053
|
if (analysis.localBindings.has(node.expression.text) || getScopedConfigBinding(node.expression).wasFound) {
|
|
63026
63054
|
const selectedProperty = getSelectedObjectProperty(node.expression, node.argumentExpression.text, analysis);
|
|
63027
|
-
return Boolean(selectedProperty && analyzeConfigNode(selectedProperty, analysis, allowCompilerTransform));
|
|
63055
|
+
return Boolean(selectedProperty && analyzeConfigNode(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform));
|
|
63028
63056
|
}
|
|
63029
63057
|
const importBinding = getImportBinding(analysis.sourceFile, node.expression.text);
|
|
63030
63058
|
if (importBinding?.isNamespace) {
|
|
@@ -63037,7 +63065,7 @@ const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTra
|
|
|
63037
63065
|
}));
|
|
63038
63066
|
}
|
|
63039
63067
|
const selectedProperty = getSelectedObjectProperty(node.expression, node.argumentExpression.text, analysis);
|
|
63040
|
-
if (selectedProperty) return analyzeConfigNode(selectedProperty, analysis, allowCompilerTransform);
|
|
63068
|
+
if (selectedProperty) return analyzeConfigNode(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform);
|
|
63041
63069
|
return false;
|
|
63042
63070
|
}
|
|
63043
63071
|
return analyzeConfigNode(node.expression, analysis, allowCompilerTransform);
|
|
@@ -65410,6 +65438,7 @@ const classifyPackageRole = (filename) => {
|
|
|
65410
65438
|
* Resolves the absolute path to read for a diagnostic's `filePath`,
|
|
65411
65439
|
* accounting for the various shapes oxlint emits:
|
|
65412
65440
|
*
|
|
65441
|
+
* - `file://` URL — decode to an absolute filesystem path.
|
|
65413
65442
|
* - Absolute POSIX (`/abs/path/file.tsx`) — pass through.
|
|
65414
65443
|
* - Absolute Windows (`C:/...` or `C:\...`) — pass through.
|
|
65415
65444
|
* - `./relative` or bare relative — join against `rootDirectory`.
|
|
@@ -65419,6 +65448,7 @@ const classifyPackageRole = (filename) => {
|
|
|
65419
65448
|
* use one canonical resolution path.
|
|
65420
65449
|
*/
|
|
65421
65450
|
const resolveCandidateReadPath = (rootDirectory, filePath) => {
|
|
65451
|
+
if (filePath.startsWith("file://")) return fileURLToPath(filePath);
|
|
65422
65452
|
const normalizedFile = filePath.replace(/\\/g, "/");
|
|
65423
65453
|
if (normalizedFile.startsWith("/") || /^[a-zA-Z]:\//.test(normalizedFile) || /^[a-zA-Z]:\\/.test(filePath)) return filePath;
|
|
65424
65454
|
return `${rootDirectory.replace(/\\/g, "/").replace(/\/$/, "")}/${normalizedFile.replace(/^\.\//, "")}`;
|
|
@@ -69613,7 +69643,10 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
69613
69643
|
if (argvLengthChars > spawnArgsLengthCap) return yield* foldSpawnFailure(`spawn ENAMETOOLONG (${argvLengthChars} argv chars exceed ${spawnArgsLengthCap})`);
|
|
69614
69644
|
const handle = yield* spawner.spawn(make$1(input.command, [...input.args], {
|
|
69615
69645
|
cwd: input.directory,
|
|
69616
|
-
env: input.
|
|
69646
|
+
env: input.command === "git" ? {
|
|
69647
|
+
...input.env,
|
|
69648
|
+
GIT_DIR: void 0
|
|
69649
|
+
} : input.env,
|
|
69617
69650
|
extendEnv: true
|
|
69618
69651
|
}));
|
|
69619
69652
|
const maxStdoutBytes = input.maxStdoutBytes;
|
|
@@ -69886,7 +69919,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
69886
69919
|
"--diff-filter=ACMR",
|
|
69887
69920
|
"--relative"
|
|
69888
69921
|
]).pipe(map$3((result) => {
|
|
69889
|
-
if (result.status !== 0) return
|
|
69922
|
+
if (result.status !== 0) return null;
|
|
69890
69923
|
return splitNullSeparated(result.stdout);
|
|
69891
69924
|
})),
|
|
69892
69925
|
showStagedContent: (directory, relativePath, options) => runCommand({
|
|
@@ -74298,10 +74331,14 @@ const materializeSourceTree = (input) => gen(function* () {
|
|
|
74298
74331
|
materializedFiles.push(relativePath);
|
|
74299
74332
|
}
|
|
74300
74333
|
yield* sync(() => {
|
|
74301
|
-
for (const configFilename of STAGED_FILES_PROJECT_CONFIG_FILENAMES) {
|
|
74302
|
-
const sourcePath = path.join(input.directory, configFilename);
|
|
74303
|
-
const targetPath = path.
|
|
74304
|
-
if (
|
|
74334
|
+
for (const subdirectory of ["", ...input.configSubdirectories ?? []]) for (const configFilename of STAGED_FILES_PROJECT_CONFIG_FILENAMES) {
|
|
74335
|
+
const sourcePath = path.join(input.directory, subdirectory, configFilename);
|
|
74336
|
+
const targetPath = path.resolve(resolvedTempDirectory, subdirectory, configFilename);
|
|
74337
|
+
if (!isPathInsideDirectory(targetPath, resolvedTempDirectory)) continue;
|
|
74338
|
+
if (fs.existsSync(sourcePath) && !fs.existsSync(targetPath)) {
|
|
74339
|
+
fs.mkdirSync(path.dirname(targetPath), { recursive: true });
|
|
74340
|
+
fs.cpSync(sourcePath, targetPath);
|
|
74341
|
+
}
|
|
74305
74342
|
}
|
|
74306
74343
|
});
|
|
74307
74344
|
return {
|
|
@@ -74322,15 +74359,17 @@ const materializeSourceTree = (input) => gen(function* () {
|
|
|
74322
74359
|
static layerNode = effect(StagedFiles, gen(function* () {
|
|
74323
74360
|
const git = yield* Git;
|
|
74324
74361
|
return StagedFiles.of({
|
|
74325
|
-
discoverSourceFiles: (directory) => git.stagedFilePaths(directory).pipe(map$3((entries) => entries.filter(isLintableSourceFile)), withSpan("StagedFiles.discoverSourceFiles")),
|
|
74326
|
-
materialize: ({ directory, stagedFiles, tempDirectory }) => materializeSourceTree({
|
|
74362
|
+
discoverSourceFiles: (directory) => git.stagedFilePaths(directory).pipe(map$3((entries) => entries === null ? null : entries.filter(isLintableSourceFile)), withSpan("StagedFiles.discoverSourceFiles")),
|
|
74363
|
+
materialize: ({ directory, stagedFiles, tempDirectory, configSubdirectories }) => materializeSourceTree({
|
|
74327
74364
|
directory,
|
|
74328
74365
|
files: stagedFiles,
|
|
74329
74366
|
tempDirectory,
|
|
74367
|
+
configSubdirectories,
|
|
74330
74368
|
readContent: (relativePath) => git.showStagedContent(directory, relativePath, { maxBufferBytes: GIT_SHOW_MAX_BUFFER_BYTES })
|
|
74331
74369
|
}).pipe(map$3((tree) => ({
|
|
74332
74370
|
tempDirectory: tree.tempDirectory,
|
|
74333
74371
|
stagedFiles: tree.materializedFiles,
|
|
74372
|
+
unmaterializedFiles: tree.unmaterializedFiles,
|
|
74334
74373
|
cleanup: tree.cleanup
|
|
74335
74374
|
})), withSpan("StagedFiles.materialize"))
|
|
74336
74375
|
});
|
|
@@ -74345,6 +74384,7 @@ const materializeSourceTree = (input) => gen(function* () {
|
|
|
74345
74384
|
materialize: ({ tempDirectory }) => succeed$2({
|
|
74346
74385
|
tempDirectory,
|
|
74347
74386
|
stagedFiles: snapshot.materializedFiles ?? snapshot.sourceFiles ?? [],
|
|
74387
|
+
unmaterializedFiles: [],
|
|
74348
74388
|
cleanup: () => {}
|
|
74349
74389
|
})
|
|
74350
74390
|
}));
|
|
@@ -76177,6 +76217,7 @@ const METRIC = {
|
|
|
76177
76217
|
cliError: "cli.error",
|
|
76178
76218
|
cliEnvironmentError: "cli.env_error",
|
|
76179
76219
|
stagedSnapshotDivergence: "staged.snapshot_divergence",
|
|
76220
|
+
stagedPerProject: "staged.per_project",
|
|
76180
76221
|
projectDetected: "project.detected",
|
|
76181
76222
|
projectPathSelected: "project.path_selected",
|
|
76182
76223
|
projectConfigSelected: "project.config_selected",
|
|
@@ -76519,5 +76560,5 @@ const startLanguageServer = () => {
|
|
|
76519
76560
|
};
|
|
76520
76561
|
//#endregion
|
|
76521
76562
|
export { startLanguageServer };
|
|
76522
|
-
!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]="
|
|
76523
|
-
//# debugId=
|
|
76563
|
+
!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]="390ba7cd-f884-5c1e-aa8d-f48ccc1994f7")}catch(e){}}();
|
|
76564
|
+
//# debugId=390ba7cd-f884-5c1e-aa8d-f48ccc1994f7
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.9.2-dev.
|
|
3
|
+
"version": "0.9.2-dev.86add14",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"vscode-uri": "^3.1.0",
|
|
72
72
|
"yaml": "^2.9.0",
|
|
73
73
|
"deslop-js": "0.9.2",
|
|
74
|
-
"oxlint-plugin-react-doctor": "0.9.2-dev.
|
|
74
|
+
"oxlint-plugin-react-doctor": "0.9.2-dev.86add14"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/babel__code-frame": "^7.27.0",
|