react-doctor 0.9.2-dev.3f3197f → 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/index.d.ts CHANGED
@@ -9333,11 +9333,17 @@ interface ReactDoctorConfig {
9333
9333
  * Entries resolve exactly like `--project` values: workspace package
9334
9334
  * names (or directory basenames) first, then directory paths relative to
9335
9335
  * the scanned root. `"*"` selects every discovered workspace project.
9336
- * Invalid entries fail the run with the same error as the flag.
9336
+ * Invalid entries fail the run with the same error as the flag — except
9337
+ * under `--staged`, where they warn and fall back to a single scan at the
9338
+ * root, because `--staged` runs in a commit hook and a stale entry there
9339
+ * would block every commit.
9337
9340
  *
9338
9341
  * Precedence: an explicit `--project` flag overrides this list. Only the
9339
9342
  * config at the invocation root is consulted — `projects` inside a
9340
- * module's own config is ignored (modules can't redirect the scan).
9343
+ * module's own config is ignored (modules can't redirect the scan). Under
9344
+ * `--staged` this list applies only when you invoke react-doctor from the
9345
+ * directory that declared it, so a per-package or positional run does not
9346
+ * resolve an ancestor's entries against the package.
9341
9347
  */
9342
9348
  projects?: string[];
9343
9349
  textComponents?: string[];
package/dist/index.js CHANGED
@@ -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]="41e39010-e2d7-5e6b-9bba-626bf64affe5")}catch(e){}}();
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]="cc06d86a-0b85-5115-a9f2-cc30c268ad79")}catch(e){}}();
3
3
  import { i as __toESM$1, r as __require, t as __commonJSMin$1 } from "./chunk-ChKA3wi6.js";
4
4
  import { createRequire } from "node:module";
5
5
  import reactDoctorPlugin, { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_RULES, REACT_DOCTOR_RULES, classifySecurityScanFile, collectCrossFileDependencyProbes, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor";
@@ -13,11 +13,11 @@ import * as NodeChildProcess from "node:child_process";
13
13
  import { execFileSync, spawn, spawnSync } from "node:child_process";
14
14
  import { ResolverFactory } from "oxc-resolver";
15
15
  import ts from "typescript";
16
+ import * as NodeUrl from "node:url";
17
+ import { fileURLToPath } from "node:url";
16
18
  import * as OS from "node:os";
17
19
  import os from "node:os";
18
20
  import { parseJSON5 } from "confbox";
19
- import * as NodeUrl from "node:url";
20
- import { fileURLToPath } from "node:url";
21
21
  import { createJiti } from "jiti";
22
22
  import { ANALYZED_MANIFEST_FILENAMES, DEFAULT_EXTENSIONS } from "deslop-js/analyzed-inputs";
23
23
  import { gzipSync } from "node:zlib";
@@ -62399,10 +62399,16 @@ const getTopLevelBinding = (sourceFile, bindingName) => {
62399
62399
  }
62400
62400
  return null;
62401
62401
  };
62402
- const getFunctionLocalBindings = (functionNode, argumentsList) => {
62402
+ const getFunctionLocalBindings = (functionNode, argumentsList, argumentAnalysis, functionAnalysis) => {
62403
62403
  const localBindings = /* @__PURE__ */ new Map();
62404
62404
  functionNode.parameters.forEach((parameter, parameterIndex) => {
62405
- if (ts.isIdentifier(parameter.name)) localBindings.set(parameter.name.text, argumentsList[parameterIndex] ?? parameter.initializer ?? null);
62405
+ if (ts.isIdentifier(parameter.name)) {
62406
+ const argument = argumentsList[parameterIndex];
62407
+ localBindings.set(parameter.name.text, {
62408
+ expression: argument ?? parameter.initializer ?? null,
62409
+ analysis: argument ? argumentAnalysis : functionAnalysis
62410
+ });
62411
+ }
62406
62412
  });
62407
62413
  return localBindings;
62408
62414
  };
@@ -62538,8 +62544,8 @@ const getStaticConfigValueState = (expression, analysis, visitedExpressions = /*
62538
62544
  };
62539
62545
  if (ts.isIdentifier(unwrappedExpression)) {
62540
62546
  if (analysis.localBindings.has(unwrappedExpression.text)) {
62541
- const localInitializer = analysis.localBindings.get(unwrappedExpression.text);
62542
- return localInitializer ? getStaticConfigValueState(localInitializer, analysis, nextVisitedExpressions) : null;
62547
+ const localReference = analysis.localBindings.get(unwrappedExpression.text);
62548
+ return localReference?.expression ? getStaticConfigValueState(localReference.expression, localReference.analysis, nextVisitedExpressions) : null;
62543
62549
  }
62544
62550
  const topLevelBinding = getTopLevelBinding(analysis.sourceFile, unwrappedExpression.text);
62545
62551
  return topLevelBinding && ts.isExpression(topLevelBinding) ? getStaticConfigValueState(topLevelBinding, analysis, nextVisitedExpressions) : null;
@@ -62581,8 +62587,8 @@ const getReactCompilerFlagState = (expression, analysis, visitedExpressions = /*
62581
62587
  const assignedBinding = getAssignedPropertyInitializer(unwrappedExpression, "reactCompiler");
62582
62588
  if (assignedBinding.wasFound && assignedBinding.initializer) return { isEnabled: !isStaticallyDisabledConfigExpression(assignedBinding.initializer, analysis) };
62583
62589
  if (analysis.localBindings.has(unwrappedExpression.text)) {
62584
- const localInitializer = analysis.localBindings.get(unwrappedExpression.text);
62585
- return localInitializer ? getReactCompilerFlagState(localInitializer, analysis, nextVisitedExpressions) : null;
62590
+ const localReference = analysis.localBindings.get(unwrappedExpression.text);
62591
+ return localReference?.expression ? getReactCompilerFlagState(localReference.expression, localReference.analysis, nextVisitedExpressions) : null;
62586
62592
  }
62587
62593
  const topLevelBinding = getTopLevelBinding(analysis.sourceFile, unwrappedExpression.text);
62588
62594
  return topLevelBinding && ts.isExpression(topLevelBinding) ? getReactCompilerFlagState(topLevelBinding, analysis, nextVisitedExpressions) : null;
@@ -62605,8 +62611,8 @@ const getSelectedObjectProperty = (expression, propertyName, analysis, visitedEx
62605
62611
  visitedExpressions.add(resolvedExpression);
62606
62612
  if (ts.isIdentifier(resolvedExpression)) {
62607
62613
  if (analysis.localBindings.has(resolvedExpression.text)) {
62608
- const localInitializer = analysis.localBindings.get(resolvedExpression.text);
62609
- return localInitializer ? getSelectedObjectProperty(localInitializer, propertyName, analysis, visitedExpressions) : null;
62614
+ const localReference = analysis.localBindings.get(resolvedExpression.text);
62615
+ return localReference?.expression ? getSelectedObjectProperty(localReference.expression, propertyName, localReference.analysis, visitedExpressions) : null;
62610
62616
  }
62611
62617
  const scopedBinding = getScopedConfigBinding(resolvedExpression);
62612
62618
  if (scopedBinding.wasFound) return scopedBinding.initializer ? getSelectedObjectProperty(scopedBinding.initializer, propertyName, analysis, visitedExpressions) : null;
@@ -62615,9 +62621,18 @@ const getSelectedObjectProperty = (expression, propertyName, analysis, visitedEx
62615
62621
  }
62616
62622
  if (!ts.isObjectLiteralExpression(resolvedExpression)) return null;
62617
62623
  for (const property of [...resolvedExpression.properties].reverse()) {
62618
- if (ts.isPropertyAssignment(property) && getStaticPropertyName$2(property.name) === propertyName) return property.initializer;
62619
- if (ts.isMethodDeclaration(property) && getStaticPropertyName$2(property.name) === propertyName) return property;
62620
- if (ts.isShorthandPropertyAssignment(property) && property.name.text === propertyName) return property.name;
62624
+ if (ts.isPropertyAssignment(property) && getStaticPropertyName$2(property.name) === propertyName) return {
62625
+ node: property.initializer,
62626
+ analysis
62627
+ };
62628
+ if (ts.isMethodDeclaration(property) && getStaticPropertyName$2(property.name) === propertyName) return {
62629
+ node: property,
62630
+ analysis
62631
+ };
62632
+ if (ts.isShorthandPropertyAssignment(property) && property.name.text === propertyName) return {
62633
+ node: property.name,
62634
+ analysis
62635
+ };
62621
62636
  if (ts.isSpreadAssignment(property)) {
62622
62637
  const spreadProperty = getSelectedObjectProperty(property.expression, propertyName, analysis, visitedExpressions);
62623
62638
  if (spreadProperty) return spreadProperty;
@@ -62630,8 +62645,8 @@ const configExpressionMayDefineProperty = (expression, propertyName, analysis) =
62630
62645
  while (ts.isParenthesizedExpression(resolvedExpression) || ts.isAsExpression(resolvedExpression) || ts.isTypeAssertionExpression(resolvedExpression) || ts.isSatisfiesExpression(resolvedExpression) || ts.isNonNullExpression(resolvedExpression)) resolvedExpression = resolvedExpression.expression;
62631
62646
  if (ts.isIdentifier(resolvedExpression)) {
62632
62647
  if (analysis.localBindings.has(resolvedExpression.text)) {
62633
- const localInitializer = analysis.localBindings.get(resolvedExpression.text);
62634
- return localInitializer ? configExpressionMayDefineProperty(localInitializer, propertyName, analysis) : true;
62648
+ const localReference = analysis.localBindings.get(resolvedExpression.text);
62649
+ return localReference?.expression ? configExpressionMayDefineProperty(localReference.expression, propertyName, localReference.analysis) : true;
62635
62650
  }
62636
62651
  const scopedBinding = getScopedConfigBinding(resolvedExpression);
62637
62652
  if (scopedBinding.wasFound) return scopedBinding.initializer ? configExpressionMayDefineProperty(scopedBinding.initializer, propertyName, analysis) : true;
@@ -62715,15 +62730,15 @@ const getReExportedConfigModules = (sourceFile, exportName) => {
62715
62730
  }
62716
62731
  return bindings;
62717
62732
  };
62718
- const analyzeConfigModuleExport = (filePath, exportName, allowCompilerTransform, importDepth, visitedModules, argumentsList = []) => {
62733
+ const analyzeConfigModuleExport = (filePath, exportName, allowCompilerTransform, importDepth, visitedModules, argumentsList = [], argumentAnalysis) => {
62719
62734
  if (!isFile(filePath) || importDepth > 4) return false;
62720
62735
  const moduleVisitKey = `${filePath}:${exportName}:${allowCompilerTransform}`;
62721
62736
  if (visitedModules.has(moduleVisitKey)) return false;
62722
62737
  const nextVisitedModules = new Set(visitedModules);
62723
62738
  nextVisitedModules.add(moduleVisitKey);
62724
- return analyzeConfigSourceFileExport(parseConfigSourceFile(filePath, NFS.readFileSync(filePath, "utf-8")), filePath, exportName, allowCompilerTransform, importDepth, nextVisitedModules, argumentsList);
62739
+ return analyzeConfigSourceFileExport(parseConfigSourceFile(filePath, NFS.readFileSync(filePath, "utf-8")), filePath, exportName, allowCompilerTransform, importDepth, nextVisitedModules, argumentsList, argumentAnalysis);
62725
62740
  };
62726
- const analyzeConfigSourceFileExport = (sourceFile, filePath, exportName, allowCompilerTransform, importDepth, visitedModules, argumentsList = []) => {
62741
+ const analyzeConfigSourceFileExport = (sourceFile, filePath, exportName, allowCompilerTransform, importDepth, visitedModules, argumentsList = [], argumentAnalysis) => {
62727
62742
  const analysis = {
62728
62743
  filePath,
62729
62744
  sourceFile,
@@ -62733,14 +62748,27 @@ const analyzeConfigSourceFileExport = (sourceFile, filePath, exportName, allowCo
62733
62748
  localBindings: /* @__PURE__ */ new Map(),
62734
62749
  activeFunctions: /* @__PURE__ */ new Set()
62735
62750
  };
62751
+ const resolvedArgumentAnalysis = argumentAnalysis ?? analysis;
62736
62752
  const exportedConfigNodes = getExportedConfigNodes(sourceFile, exportName);
62737
- return exportedConfigNodes.some((node) => ts.isArrowFunction(node) || ts.isFunctionExpression(node) || ts.isFunctionDeclaration(node) ? analyzeConfigFunction(node, analysis, allowCompilerTransform, argumentsList) : analyzeConfigNode(node, analysis, allowCompilerTransform)) || getReExportedConfigModules(sourceFile, exportName).some((binding) => {
62753
+ return exportedConfigNodes.some((node) => {
62754
+ if (ts.isArrowFunction(node) || ts.isFunctionExpression(node) || ts.isFunctionDeclaration(node)) return analyzeConfigFunction(node, analysis, allowCompilerTransform, argumentsList, resolvedArgumentAnalysis);
62755
+ if (argumentsList.length > 0 && ts.isIdentifier(node)) {
62756
+ const topLevelBinding = getTopLevelBinding(sourceFile, node.text);
62757
+ if (topLevelBinding && ts.isFunctionLike(topLevelBinding)) return analyzeConfigFunction(topLevelBinding, analysis, allowCompilerTransform, argumentsList, resolvedArgumentAnalysis);
62758
+ const importBinding = getImportBinding(sourceFile, node.text);
62759
+ if (importBinding) {
62760
+ const importedFilePath = resolveImportedConfigFile(filePath, importBinding.moduleSpecifier);
62761
+ return Boolean(importedFilePath && analyzeConfigModuleExport(importedFilePath, importBinding.exportName, allowCompilerTransform, importDepth + 1, visitedModules, argumentsList, resolvedArgumentAnalysis));
62762
+ }
62763
+ }
62764
+ return analyzeConfigNode(node, analysis, allowCompilerTransform);
62765
+ }) || getReExportedConfigModules(sourceFile, exportName).some((binding) => {
62738
62766
  if (exportedConfigNodes.length > 0 && binding.isNamespace) return false;
62739
62767
  const importedFilePath = resolveImportedConfigFile(filePath, binding.moduleSpecifier);
62740
- return Boolean(importedFilePath && analyzeConfigModuleExport(importedFilePath, binding.exportName, allowCompilerTransform, importDepth + 1, visitedModules, argumentsList));
62768
+ return Boolean(importedFilePath && analyzeConfigModuleExport(importedFilePath, binding.exportName, allowCompilerTransform, importDepth + 1, visitedModules, argumentsList, resolvedArgumentAnalysis));
62741
62769
  });
62742
62770
  };
62743
- const analyzeConfigFunction = (functionNode, analysis, allowCompilerTransform, argumentsList = []) => {
62771
+ const analyzeConfigFunction = (functionNode, analysis, allowCompilerTransform, argumentsList = [], argumentAnalysis = analysis) => {
62744
62772
  if (!functionNode.body) return false;
62745
62773
  if (analysis.activeFunctions.has(functionNode.pos)) return false;
62746
62774
  const activeFunctions = new Set(analysis.activeFunctions);
@@ -62748,7 +62776,7 @@ const analyzeConfigFunction = (functionNode, analysis, allowCompilerTransform, a
62748
62776
  const functionAnalysis = {
62749
62777
  ...analysis,
62750
62778
  visitedNodes: /* @__PURE__ */ new Set(),
62751
- localBindings: getFunctionLocalBindings(functionNode, argumentsList),
62779
+ localBindings: getFunctionLocalBindings(functionNode, argumentsList, argumentAnalysis, analysis),
62752
62780
  activeFunctions
62753
62781
  };
62754
62782
  if (!ts.isBlock(functionNode.body)) return analyzeConfigNode(functionNode.body, functionAnalysis, allowCompilerTransform);
@@ -62767,7 +62795,7 @@ const analyzeConfigFunction = (functionNode, analysis, allowCompilerTransform, a
62767
62795
  const analyzeImportedConfig = ({ analysis, moduleSpecifier, exportName, allowCompilerTransform, argumentsList }) => {
62768
62796
  const importedFilePath = resolveImportedConfigFile(analysis.filePath, moduleSpecifier);
62769
62797
  if (!importedFilePath) return null;
62770
- return analyzeConfigModuleExport(importedFilePath, exportName, allowCompilerTransform, analysis.importDepth + 1, analysis.visitedModules, argumentsList);
62798
+ return analyzeConfigModuleExport(importedFilePath, exportName, allowCompilerTransform, analysis.importDepth + 1, analysis.visitedModules, argumentsList, analysis);
62771
62799
  };
62772
62800
  const analyzeConfigIdentifier = (identifier, analysis, allowCompilerTransform, isCompilerTransformCollection, excludedPropertyNames) => {
62773
62801
  const assignedReactCompiler = getAssignedPropertyInitializer(identifier, "reactCompiler");
@@ -62781,8 +62809,8 @@ const analyzeConfigIdentifier = (identifier, analysis, allowCompilerTransform, i
62781
62809
  if (assignedPlugins.wasFound) overriddenPropertyNames.add("plugins");
62782
62810
  if (assignedPresets.wasFound) overriddenPropertyNames.add("presets");
62783
62811
  if (analysis.localBindings.has(identifier.text)) {
62784
- const localInitializer = analysis.localBindings.get(identifier.text);
62785
- return Boolean(localInitializer && analyzeConfigNode(localInitializer, analysis, allowCompilerTransform, isCompilerTransformCollection, overriddenPropertyNames));
62812
+ const localReference = analysis.localBindings.get(identifier.text);
62813
+ return Boolean(localReference?.expression && analyzeConfigNode(localReference.expression, localReference.analysis, allowCompilerTransform, isCompilerTransformCollection, overriddenPropertyNames));
62786
62814
  }
62787
62815
  const scopedBinding = getScopedConfigBinding(identifier);
62788
62816
  if (scopedBinding.wasFound) return Boolean(scopedBinding.initializer && analyzeConfigNode(scopedBinding.initializer, analysis, allowCompilerTransform, isCompilerTransformCollection, overriddenPropertyNames));
@@ -62848,7 +62876,7 @@ const analyzeConfigCallTarget = (callExpression, analysis, allowCompilerTransfor
62848
62876
  }
62849
62877
  const selectedProperty = getSelectedObjectProperty(target.expression, propertyName, analysis);
62850
62878
  if (selectedProperty === null) return null;
62851
- return ts.isFunctionLike(selectedProperty) ? analyzeConfigFunction(selectedProperty, analysis, allowCompilerTransform, callExpression.arguments) : analyzeConfigNode(selectedProperty, analysis, allowCompilerTransform);
62879
+ return ts.isFunctionLike(selectedProperty.node) ? analyzeConfigFunction(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform, callExpression.arguments, analysis) : analyzeConfigNode(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform);
62852
62880
  };
62853
62881
  const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTransformCollection = false, excludedPropertyNames) => {
62854
62882
  const excludedPropertiesVisitKey = excludedPropertyNames ? [...excludedPropertyNames].sort().join(",") : "";
@@ -62948,7 +62976,7 @@ const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTra
62948
62976
  if (ts.isIdentifier(node.expression)) {
62949
62977
  if (analysis.localBindings.has(node.expression.text) || getScopedConfigBinding(node.expression).wasFound) {
62950
62978
  const selectedProperty = getSelectedObjectProperty(node.expression, node.name.text, analysis);
62951
- return Boolean(selectedProperty && analyzeConfigNode(selectedProperty, analysis, allowCompilerTransform));
62979
+ return Boolean(selectedProperty && analyzeConfigNode(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform));
62952
62980
  }
62953
62981
  const importBinding = getImportBinding(analysis.sourceFile, node.expression.text);
62954
62982
  if (importBinding?.isNamespace) {
@@ -62962,7 +62990,7 @@ const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTra
62962
62990
  return false;
62963
62991
  }
62964
62992
  const selectedProperty = getSelectedObjectProperty(node.expression, node.name.text, analysis);
62965
- if (selectedProperty) return analyzeConfigNode(selectedProperty, analysis, allowCompilerTransform);
62993
+ if (selectedProperty) return analyzeConfigNode(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform);
62966
62994
  return false;
62967
62995
  }
62968
62996
  return analyzeConfigNode(node.expression, analysis, allowCompilerTransform);
@@ -62971,7 +62999,7 @@ const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTra
62971
62999
  if (ts.isIdentifier(node.expression)) {
62972
63000
  if (analysis.localBindings.has(node.expression.text) || getScopedConfigBinding(node.expression).wasFound) {
62973
63001
  const selectedProperty = getSelectedObjectProperty(node.expression, node.argumentExpression.text, analysis);
62974
- return Boolean(selectedProperty && analyzeConfigNode(selectedProperty, analysis, allowCompilerTransform));
63002
+ return Boolean(selectedProperty && analyzeConfigNode(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform));
62975
63003
  }
62976
63004
  const importBinding = getImportBinding(analysis.sourceFile, node.expression.text);
62977
63005
  if (importBinding?.isNamespace) {
@@ -62984,7 +63012,7 @@ const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTra
62984
63012
  }));
62985
63013
  }
62986
63014
  const selectedProperty = getSelectedObjectProperty(node.expression, node.argumentExpression.text, analysis);
62987
- if (selectedProperty) return analyzeConfigNode(selectedProperty, analysis, allowCompilerTransform);
63015
+ if (selectedProperty) return analyzeConfigNode(selectedProperty.node, selectedProperty.analysis, allowCompilerTransform);
62988
63016
  return false;
62989
63017
  }
62990
63018
  return analyzeConfigNode(node.expression, analysis, allowCompilerTransform);
@@ -65361,6 +65389,7 @@ const classifyPackageRole = (filename) => {
65361
65389
  * Resolves the absolute path to read for a diagnostic's `filePath`,
65362
65390
  * accounting for the various shapes oxlint emits:
65363
65391
  *
65392
+ * - `file://` URL — decode to an absolute filesystem path.
65364
65393
  * - Absolute POSIX (`/abs/path/file.tsx`) — pass through.
65365
65394
  * - Absolute Windows (`C:/...` or `C:\...`) — pass through.
65366
65395
  * - `./relative` or bare relative — join against `rootDirectory`.
@@ -65370,6 +65399,7 @@ const classifyPackageRole = (filename) => {
65370
65399
  * use one canonical resolution path.
65371
65400
  */
65372
65401
  const resolveCandidateReadPath = (rootDirectory, filePath) => {
65402
+ if (filePath.startsWith("file://")) return fileURLToPath(filePath);
65373
65403
  const normalizedFile = filePath.replace(/\\/g, "/");
65374
65404
  if (normalizedFile.startsWith("/") || /^[a-zA-Z]:\//.test(normalizedFile) || /^[a-zA-Z]:\\/.test(filePath)) return filePath;
65375
65405
  return `${rootDirectory.replace(/\\/g, "/").replace(/\/$/, "")}/${normalizedFile.replace(/^\.\//, "")}`;
@@ -69634,7 +69664,10 @@ var Git = class Git extends Service()("react-doctor/Git") {
69634
69664
  if (argvLengthChars > spawnArgsLengthCap) return yield* foldSpawnFailure(`spawn ENAMETOOLONG (${argvLengthChars} argv chars exceed ${spawnArgsLengthCap})`);
69635
69665
  const handle = yield* spawner.spawn(make$1(input.command, [...input.args], {
69636
69666
  cwd: input.directory,
69637
- env: input.env,
69667
+ env: input.command === "git" ? {
69668
+ ...input.env,
69669
+ GIT_DIR: void 0
69670
+ } : input.env,
69638
69671
  extendEnv: true
69639
69672
  }));
69640
69673
  const maxStdoutBytes = input.maxStdoutBytes;
@@ -69907,7 +69940,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
69907
69940
  "--diff-filter=ACMR",
69908
69941
  "--relative"
69909
69942
  ]).pipe(map$3((result) => {
69910
- if (result.status !== 0) return [];
69943
+ if (result.status !== 0) return null;
69911
69944
  return splitNullSeparated(result.stdout);
69912
69945
  })),
69913
69946
  showStagedContent: (directory, relativePath, options) => runCommand({
@@ -74319,10 +74352,14 @@ const materializeSourceTree = (input) => gen(function* () {
74319
74352
  materializedFiles.push(relativePath);
74320
74353
  }
74321
74354
  yield* sync(() => {
74322
- for (const configFilename of STAGED_FILES_PROJECT_CONFIG_FILENAMES) {
74323
- const sourcePath = path.join(input.directory, configFilename);
74324
- const targetPath = path.join(resolvedTempDirectory, configFilename);
74325
- if (fs.existsSync(sourcePath) && !fs.existsSync(targetPath)) fs.cpSync(sourcePath, targetPath);
74355
+ for (const subdirectory of ["", ...input.configSubdirectories ?? []]) for (const configFilename of STAGED_FILES_PROJECT_CONFIG_FILENAMES) {
74356
+ const sourcePath = path.join(input.directory, subdirectory, configFilename);
74357
+ const targetPath = path.resolve(resolvedTempDirectory, subdirectory, configFilename);
74358
+ if (!isPathInsideDirectory(targetPath, resolvedTempDirectory)) continue;
74359
+ if (fs.existsSync(sourcePath) && !fs.existsSync(targetPath)) {
74360
+ fs.mkdirSync(path.dirname(targetPath), { recursive: true });
74361
+ fs.cpSync(sourcePath, targetPath);
74362
+ }
74326
74363
  }
74327
74364
  });
74328
74365
  return {
@@ -74343,15 +74380,17 @@ const materializeSourceTree = (input) => gen(function* () {
74343
74380
  static layerNode = effect(StagedFiles, gen(function* () {
74344
74381
  const git = yield* Git;
74345
74382
  return StagedFiles.of({
74346
- discoverSourceFiles: (directory) => git.stagedFilePaths(directory).pipe(map$3((entries) => entries.filter(isLintableSourceFile)), withSpan("StagedFiles.discoverSourceFiles")),
74347
- materialize: ({ directory, stagedFiles, tempDirectory }) => materializeSourceTree({
74383
+ discoverSourceFiles: (directory) => git.stagedFilePaths(directory).pipe(map$3((entries) => entries === null ? null : entries.filter(isLintableSourceFile)), withSpan("StagedFiles.discoverSourceFiles")),
74384
+ materialize: ({ directory, stagedFiles, tempDirectory, configSubdirectories }) => materializeSourceTree({
74348
74385
  directory,
74349
74386
  files: stagedFiles,
74350
74387
  tempDirectory,
74388
+ configSubdirectories,
74351
74389
  readContent: (relativePath) => git.showStagedContent(directory, relativePath, { maxBufferBytes: GIT_SHOW_MAX_BUFFER_BYTES })
74352
74390
  }).pipe(map$3((tree) => ({
74353
74391
  tempDirectory: tree.tempDirectory,
74354
74392
  stagedFiles: tree.materializedFiles,
74393
+ unmaterializedFiles: tree.unmaterializedFiles,
74355
74394
  cleanup: tree.cleanup
74356
74395
  })), withSpan("StagedFiles.materialize"))
74357
74396
  });
@@ -74366,6 +74405,7 @@ const materializeSourceTree = (input) => gen(function* () {
74366
74405
  materialize: ({ tempDirectory }) => succeed$2({
74367
74406
  tempDirectory,
74368
74407
  stagedFiles: snapshot.materializedFiles ?? snapshot.sourceFiles ?? [],
74408
+ unmaterializedFiles: [],
74369
74409
  cleanup: () => {}
74370
74410
  })
74371
74411
  }));
@@ -74892,4 +74932,4 @@ const toJsonReport = (result, options) => buildJsonReport({
74892
74932
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
74893
74933
 
74894
74934
  //# sourceMappingURL=index.js.map
74895
- //# debugId=41e39010-e2d7-5e6b-9bba-626bf64affe5
74935
+ //# debugId=cc06d86a-0b85-5115-a9f2-cc30c268ad79