react-doctor 0.8.1-dev.5b468f8 → 0.8.1-dev.61bf03e

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/lsp.js CHANGED
@@ -32883,6 +32883,44 @@ var AmbiguousProjectError = class extends Error {
32883
32883
  }
32884
32884
  };
32885
32885
  const isProjectDiscoveryError = (value) => value instanceof ProjectNotFoundError || value instanceof NoReactDependencyError || value instanceof PackageJsonNotFoundError || value instanceof NotADirectoryError || value instanceof AmbiguousProjectError;
32886
+ const isErrnoException = (error) => error instanceof Error && "code" in error;
32887
+ const IGNORABLE_READDIR_ERROR_CODES = new Set([
32888
+ "EACCES",
32889
+ "EPERM",
32890
+ "ENOENT",
32891
+ "ENOTDIR",
32892
+ "EINVAL",
32893
+ "ELOOP",
32894
+ "ENAMETOOLONG"
32895
+ ]);
32896
+ const isIgnorableReaddirError = (error) => isErrnoException(error) && typeof error.code === "string" && IGNORABLE_READDIR_ERROR_CODES.has(error.code);
32897
+ const readDirectoryEntries = (directoryPath) => {
32898
+ try {
32899
+ return NFS.readdirSync(directoryPath, { withFileTypes: true });
32900
+ } catch (error) {
32901
+ if (isIgnorableReaddirError(error)) return [];
32902
+ throw error;
32903
+ }
32904
+ };
32905
+ const isFile = (filePath) => {
32906
+ try {
32907
+ return NFS.statSync(filePath).isFile();
32908
+ } catch {
32909
+ return false;
32910
+ }
32911
+ };
32912
+ const isDirectory = (directoryPath) => {
32913
+ try {
32914
+ return NFS.statSync(directoryPath).isDirectory();
32915
+ } catch {
32916
+ return false;
32917
+ }
32918
+ };
32919
+ const isPlainObject = (value) => {
32920
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
32921
+ const prototype = Object.getPrototypeOf(value);
32922
+ return prototype === null || prototype === Object.prototype;
32923
+ };
32886
32924
  const SOURCE_FILE_PATTERN = /\.(tsx?|jsx?|mts|mjs)$/;
32887
32925
  const GENERATED_BUNDLE_FILE_PATTERN = /\.(iife|umd|global|min)\.m?js$/i;
32888
32926
  const GENERATED_SOURCE_DIRECTORY_PATTERN = /(?:^|\/)__generated__\//;
@@ -33064,44 +33102,6 @@ const SUPPLY_CHAIN_OVERLAP_TIMEOUT_MS = 9e4;
33064
33102
  const SUPPLY_CHAIN_CACHE_TTL_MS = 864e5;
33065
33103
  const SUPPLY_CHAIN_CACHE_SUBDIR = "supply-chain";
33066
33104
  const SUPPLY_CHAIN_IGNORED_PACKAGES = new Set(["next"]);
33067
- const isErrnoException = (error) => error instanceof Error && "code" in error;
33068
- const IGNORABLE_READDIR_ERROR_CODES = new Set([
33069
- "EACCES",
33070
- "EPERM",
33071
- "ENOENT",
33072
- "ENOTDIR",
33073
- "EINVAL",
33074
- "ELOOP",
33075
- "ENAMETOOLONG"
33076
- ]);
33077
- const isIgnorableReaddirError = (error) => isErrnoException(error) && typeof error.code === "string" && IGNORABLE_READDIR_ERROR_CODES.has(error.code);
33078
- const readDirectoryEntries = (directoryPath) => {
33079
- try {
33080
- return NFS.readdirSync(directoryPath, { withFileTypes: true });
33081
- } catch (error) {
33082
- if (isIgnorableReaddirError(error)) return [];
33083
- throw error;
33084
- }
33085
- };
33086
- const isFile = (filePath) => {
33087
- try {
33088
- return NFS.statSync(filePath).isFile();
33089
- } catch {
33090
- return false;
33091
- }
33092
- };
33093
- const isDirectory = (directoryPath) => {
33094
- try {
33095
- return NFS.statSync(directoryPath).isDirectory();
33096
- } catch {
33097
- return false;
33098
- }
33099
- };
33100
- const isPlainObject = (value) => {
33101
- if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
33102
- const prototype = Object.getPrototypeOf(value);
33103
- return prototype === null || prototype === Object.prototype;
33104
- };
33105
33105
  const lastSourceMappingUrl = (fileContent) => {
33106
33106
  const lastReference = [...fileContent.matchAll(/\/\/# sourceMappingURL=(\S+)/g)].at(-1);
33107
33107
  return lastReference ? lastReference[1] : null;
@@ -33427,10 +33427,10 @@ const FALLBACK_TSCONFIG_FILENAMES = ["tsconfig.app.json", "tsconfig.build.json"]
33427
33427
  const FRAMEWORK_PACKAGES = {
33428
33428
  next: "nextjs",
33429
33429
  "@tanstack/react-start": "tanstack-start",
33430
- "@remix-run/react": "remix",
33431
- gatsby: "gatsby",
33432
33430
  vite: "vite",
33433
33431
  "react-scripts": "cra",
33432
+ "@remix-run/react": "remix",
33433
+ gatsby: "gatsby",
33434
33434
  expo: "expo",
33435
33435
  "react-native": "react-native"
33436
33436
  };
@@ -33454,17 +33454,11 @@ const NEXT_CONFIG_FILENAMES = [
33454
33454
  ];
33455
33455
  const BABEL_CONFIG_FILENAMES = [
33456
33456
  ".babelrc",
33457
- ".babelrc.js",
33458
33457
  ".babelrc.json",
33459
- ".babelrc.cjs",
33460
- ".babelrc.mjs",
33461
- ".babelrc.cts",
33462
33458
  "babel.config.js",
33463
33459
  "babel.config.json",
33464
33460
  "babel.config.cjs",
33465
- "babel.config.mjs",
33466
- "babel.config.ts",
33467
- "babel.config.cts"
33461
+ "babel.config.mjs"
33468
33462
  ];
33469
33463
  const VITE_CONFIG_FILENAMES = [
33470
33464
  "vite.config.js",
@@ -33476,28 +33470,12 @@ const VITE_CONFIG_FILENAMES = [
33476
33470
  "vitest.config.ts",
33477
33471
  "vitest.config.js"
33478
33472
  ];
33479
- const RSBUILD_CONFIG_FILENAMES = [
33480
- "rsbuild.config.ts",
33481
- "rsbuild.config.js",
33482
- "rsbuild.config.mts",
33483
- "rsbuild.config.mjs",
33484
- "rsbuild.config.cts",
33485
- "rsbuild.config.cjs"
33486
- ];
33487
- const RSPACK_CONFIG_FILENAMES = [
33488
- "rspack.config.ts",
33489
- "rspack.config.js",
33490
- "rspack.config.mts",
33491
- "rspack.config.mjs",
33492
- "rspack.config.cts",
33493
- "rspack.config.cjs"
33494
- ];
33495
33473
  const EXPO_APP_CONFIG_FILENAMES = [
33496
33474
  "app.json",
33497
33475
  "app.config.js",
33498
33476
  "app.config.ts"
33499
33477
  ];
33500
- const REACT_COMPILER_PACKAGE_REFERENCE_PATTERN = /babel-plugin-react-compiler|react-compiler-runtime|reactCompilerPreset\s*\(|["']react-compiler["']/;
33478
+ const REACT_COMPILER_PACKAGE_REFERENCE_PATTERN = /babel-plugin-react-compiler|react-compiler-runtime|["']react-compiler["']/;
33501
33479
  const REACT_COMPILER_ENABLED_FLAG_PATTERN = /["']?reactCompiler["']?\s*:\s*(?:true\b|\{)/;
33502
33480
  const STATIC_EXPORT_OUTPUT_PATTERN = /(?:^|[^.\w])["']?output["']?\s*:\s*["']export["']/m;
33503
33481
  const hasCompilerPackage = (packageJson, compilerPackages) => {
@@ -33532,8 +33510,6 @@ const detectReactCompiler = (directory, packageJson) => {
33532
33510
  if (hasCompilerInConfigFiles(directory, NEXT_CONFIG_FILENAMES)) return true;
33533
33511
  if (hasCompilerInConfigFiles(directory, BABEL_CONFIG_FILENAMES)) return true;
33534
33512
  if (hasCompilerInConfigFiles(directory, VITE_CONFIG_FILENAMES)) return true;
33535
- if (hasCompilerInConfigFiles(directory, RSBUILD_CONFIG_FILENAMES)) return true;
33536
- if (hasCompilerInConfigFiles(directory, RSPACK_CONFIG_FILENAMES)) return true;
33537
33513
  if (hasCompilerInConfigFiles(directory, EXPO_APP_CONFIG_FILENAMES)) return true;
33538
33514
  return hasCompilerPackageInAncestors(directory, REACT_COMPILER_TRANSFORM_PACKAGES);
33539
33515
  };
@@ -33542,7 +33518,7 @@ const detectNextjsStaticExport = (directory) => NEXT_CONFIG_FILENAMES.some((file
33542
33518
  const filePath = Path.join(directory, filename);
33543
33519
  return isFile(filePath) && STATIC_EXPORT_OUTPUT_PATTERN.test(NFS.readFileSync(filePath, "utf-8"));
33544
33520
  });
33545
- const UNRESOLVABLE_PROTOCOL_VERSION = /^(?:catalog|file|git|github|https?|link|patch|portal|workspace|npm):/i;
33521
+ const UNRESOLVABLE_PROTOCOL_VERSION = /^(?:file|git|github|https?|link|patch|portal|workspace|npm):/i;
33546
33522
  const DIST_TAG_VERSION = /^[a-z][a-z0-9._-]*$/i;
33547
33523
  const WILDCARD_VERSION = /^[*xX](?:\.[*xX])*$/;
33548
33524
  const NPM_ALIAS_VERSION = /^npm:(?:@[^/]+\/[^@]+|[^@]+)@(.+)$/i;
@@ -33675,16 +33651,6 @@ const getLowestDependencyMajor = (version) => {
33675
33651
  }
33676
33652
  return lowestMajor;
33677
33653
  };
33678
- const getDependencyMajorWithinSupportedRange = (version, latestSupportedMajor) => {
33679
- const normalizedVersion = normalizeDependencyVersion(version);
33680
- if (normalizedVersion === null) return null;
33681
- const validRange = import_semver.validRange(normalizedVersion);
33682
- if (validRange === null) return null;
33683
- const minimumVersion = import_semver.minVersion(validRange);
33684
- if (minimumVersion === null || minimumVersion.major > latestSupportedMajor) return null;
33685
- if (import_semver.intersects(validRange, `>=${latestSupportedMajor + 1}.0.0`)) return null;
33686
- return minimumVersion.major;
33687
- };
33688
33654
  const isConcreteDependencyVersion = (version) => {
33689
33655
  const normalizedVersion = normalizeDependencyVersion(version);
33690
33656
  return normalizedVersion !== null && /\d/.test(normalizedVersion);
@@ -33728,18 +33694,9 @@ const parseReactMajorMinor = (reactVersion) => {
33728
33694
  };
33729
33695
  };
33730
33696
  const parseLowerBoundVersion = (versionSpec) => import_semver.validRange(versionSpec) !== null ? import_semver.minVersion(versionSpec) : import_semver.coerce(versionSpec);
33731
- const parseThreeRelease = (threeVersion) => {
33732
- if (typeof threeVersion !== "string") return null;
33733
- const normalizedVersion = normalizeDependencyVersion(threeVersion);
33734
- if (normalizedVersion === null) return null;
33735
- const lowerBound = parseLowerBoundVersion(normalizedVersion);
33736
- if (lowerBound === null) return null;
33737
- if (lowerBound.major > 0) return Number.MAX_SAFE_INTEGER;
33738
- return lowerBound.minor > 0 ? lowerBound.minor : null;
33739
- };
33740
- const parseDependencyMajorMinor = (dependencyVersion) => {
33741
- if (typeof dependencyVersion !== "string") return null;
33742
- const trimmed = dependencyVersion.trim();
33697
+ const parseTailwindMajorMinor = (tailwindVersion) => {
33698
+ if (typeof tailwindVersion !== "string") return null;
33699
+ const trimmed = tailwindVersion.trim();
33743
33700
  if (trimmed.length === 0) return null;
33744
33701
  const lowerBound = parseLowerBoundVersion(trimmed);
33745
33702
  if (lowerBound === null || lowerBound.major <= 0) return null;
@@ -33748,7 +33705,6 @@ const parseDependencyMajorMinor = (dependencyVersion) => {
33748
33705
  minor: lowerBound.minor
33749
33706
  };
33750
33707
  };
33751
- const parseTailwindMajorMinor = (tailwindVersion) => parseDependencyMajorMinor(tailwindVersion);
33752
33708
  const hasUpperBoundOnlyPeerRange = (range) => {
33753
33709
  if (typeof range !== "string") return false;
33754
33710
  const normalizedRange = normalizeDependencyVersion(range);
@@ -33770,7 +33726,7 @@ const resolveEffectiveReactMajor = (reactVersion, packageJson) => {
33770
33726
  if (peerFloor === null) return hasUpperBoundOnlyPeerRange(peerReactRange) ? null : installedReactMajor;
33771
33727
  return installedReactMajor !== null ? Math.min(installedReactMajor, peerFloor) : peerFloor;
33772
33728
  };
33773
- const isCatalogReference = (version) => typeof version === "string" && version.startsWith("catalog:");
33729
+ const isCatalogReference = (version) => version.startsWith("catalog:");
33774
33730
  const extractCatalogName = (version) => {
33775
33731
  if (!isCatalogReference(version)) return null;
33776
33732
  const name = version.slice(8).trim();
@@ -33920,12 +33876,6 @@ const TAILWIND_ZOD_SECTIONS = [
33920
33876
  "devDependencies",
33921
33877
  "peerDependencies"
33922
33878
  ];
33923
- const DEPENDENCY_SPEC_SECTIONS = [
33924
- "dependencies",
33925
- "devDependencies",
33926
- "peerDependencies",
33927
- "optionalDependencies"
33928
- ];
33929
33879
  const EMPTY_DEPENDENCY_INFO = {
33930
33880
  reactVersion: null,
33931
33881
  tailwindVersion: null,
@@ -33935,7 +33885,7 @@ const EMPTY_DEPENDENCY_INFO = {
33935
33885
  const pickConcreteVersion = (packageJson, packageName, sections) => {
33936
33886
  for (const section of sections) {
33937
33887
  const version = packageJson[section]?.[packageName];
33938
- if (typeof version !== "string") continue;
33888
+ if (version === void 0) continue;
33939
33889
  if (isCatalogReference(version)) return null;
33940
33890
  if (isConcreteDependencyVersion(version)) return version;
33941
33891
  }
@@ -33967,16 +33917,13 @@ const extractDependencyInfo = (packageJson) => {
33967
33917
  };
33968
33918
  };
33969
33919
  const getDependencySpec = (packageJson, packageName) => {
33970
- for (const section of DEPENDENCY_SPEC_SECTIONS) {
33971
- const spec = packageJson[section]?.[packageName];
33972
- if (typeof spec === "string") return spec;
33973
- }
33974
- return null;
33920
+ const spec = packageJson.dependencies?.[packageName] ?? packageJson.devDependencies?.[packageName] ?? packageJson.peerDependencies?.[packageName] ?? packageJson.optionalDependencies?.[packageName];
33921
+ return typeof spec === "string" ? spec : null;
33975
33922
  };
33976
33923
  const getDependencyDeclaration = ({ packageJson, packageName, sections }) => {
33977
33924
  for (const section of sections) {
33978
33925
  const version = packageJson[section]?.[packageName];
33979
- if (typeof version !== "string") continue;
33926
+ if (version === void 0) continue;
33980
33927
  return {
33981
33928
  catalogReference: extractCatalogName(version) ?? null,
33982
33929
  hasDeclaration: true,
@@ -34010,15 +33957,24 @@ const getPreactVersion = (packageJson) => {
34010
33957
  ...packageJson.devDependencies
34011
33958
  }.preact ?? null;
34012
33959
  };
34013
- const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson, packageName, sourceDirectory = rootDirectory, sourcePackageJson = rootPackageJson, version }) => {
33960
+ const TANSTACK_QUERY_PACKAGES = new Set([
33961
+ "@tanstack/react-query",
33962
+ "@tanstack/query-core",
33963
+ "react-query"
33964
+ ]);
33965
+ const hasTanStackQuery = (packageJson) => {
33966
+ const allDependencies = {
33967
+ ...packageJson.peerDependencies,
33968
+ ...packageJson.dependencies,
33969
+ ...packageJson.devDependencies
33970
+ };
33971
+ return Object.keys(allDependencies).some((packageName) => TANSTACK_QUERY_PACKAGES.has(packageName));
33972
+ };
33973
+ const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson, packageName, version }) => {
34014
33974
  if (version === null || !isCatalogReference(version)) return version;
34015
33975
  const catalogName = extractCatalogName(version);
34016
- const resolvedSourceVersion = resolveCatalogVersion(sourcePackageJson, packageName, sourceDirectory, catalogName);
34017
- if (resolvedSourceVersion) return resolvedSourceVersion;
34018
- if (sourceDirectory !== rootDirectory || sourcePackageJson !== rootPackageJson) {
34019
- const resolvedRootVersion = resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, catalogName);
34020
- if (resolvedRootVersion) return resolvedRootVersion;
34021
- }
33976
+ const resolvedLocalVersion = resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, catalogName);
33977
+ if (resolvedLocalVersion) return resolvedLocalVersion;
34022
33978
  const monorepoRoot = findMonorepoRoot(rootDirectory);
34023
33979
  if (!monorepoRoot) return version;
34024
33980
  const monorepoPackageJsonPath = Path.join(monorepoRoot, "package.json");
@@ -34216,75 +34172,11 @@ const listWorkspacePackages = (rootDirectory) => {
34216
34172
  }
34217
34173
  return packages;
34218
34174
  };
34219
- const getPreferredDependencyVersion = ({ packageJson, packageNames }) => {
34220
- const allDependencies = {
34221
- ...packageJson.devDependencies,
34222
- ...packageJson.peerDependencies,
34223
- ...packageJson.dependencies
34224
- };
34225
- for (const packageName of packageNames) {
34226
- const version = allDependencies[packageName];
34227
- if (version !== void 0) return version;
34228
- }
34229
- return null;
34230
- };
34231
- const TANSTACK_REACT_QUERY_PACKAGES = ["@tanstack/react-query", "react-query"];
34232
- const getTanStackQueryVersion = (packageJson) => {
34233
- return getPreferredDependencyVersion({
34234
- packageJson,
34235
- packageNames: TANSTACK_REACT_QUERY_PACKAGES
34236
- });
34237
- };
34238
- const STYLED_COMPONENTS_PACKAGES = ["styled-components"];
34239
- const getStyledComponentsVersion = (packageJson) => {
34240
- return getPreferredDependencyVersion({
34241
- packageJson,
34242
- packageNames: STYLED_COMPONENTS_PACKAGES
34243
- });
34244
- };
34245
- const I18N_PACKAGES = [
34246
- "i18next",
34247
- "react-i18next",
34248
- "next-i18next",
34249
- "react-intl",
34250
- "next-intl",
34251
- "use-intl",
34252
- "@formatjs/intl",
34253
- "@lingui/core",
34254
- "@lingui/react",
34255
- "typesafe-i18n",
34256
- "@tolgee/react",
34257
- "react-intl-universal"
34258
- ];
34259
- const hasI18nDependency = (packageJson) => {
34260
- const allDependencies = {
34261
- ...packageJson.peerDependencies,
34262
- ...packageJson.dependencies,
34263
- ...packageJson.devDependencies,
34264
- ...packageJson.optionalDependencies
34265
- };
34266
- return I18N_PACKAGES.some((packageName) => allDependencies[packageName] !== void 0);
34267
- };
34268
34175
  const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
34269
34176
  const MOBX_REACT_PACKAGE_NAME = "mobx-react";
34270
34177
  const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
34271
34178
  const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
34272
34179
  const MOBX_REACT_OBSERVER_PACKAGE_NAME = "mobx-react-observer";
34273
- const REACT_THREE_FIBER_DEPENDENCY_NAMES = ["@react-three/fiber", "react-three-fiber"];
34274
- const REACT_THREE_FIBER_SECTIONS = [
34275
- "dependencies",
34276
- "peerDependencies",
34277
- "optionalDependencies",
34278
- "devDependencies"
34279
- ];
34280
- const THREE_DEPENDENCY_SECTIONS = [
34281
- "dependencies",
34282
- "peerDependencies",
34283
- "optionalDependencies",
34284
- "devDependencies"
34285
- ];
34286
- const REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_DEPENDENCY_NAMES, "@react-three/drei"];
34287
- const THREE_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES, "three"];
34288
34180
  const SHOPIFY_FLASH_LIST_PACKAGE_NAME = "@shopify/flash-list";
34289
34181
  const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootDirectory, rootPackageJson, sections, workspaceDirectory, workspacePackageJson }) => {
34290
34182
  const dependencyDeclaration = getDependencyDeclaration({
@@ -34295,7 +34187,7 @@ const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootD
34295
34187
  if (!dependencyDeclaration.hasDeclaration) return null;
34296
34188
  return concreteVersion ?? resolveCatalogVersion(workspacePackageJson, packageName, workspaceDirectory, dependencyDeclaration.catalogReference) ?? resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, dependencyDeclaration.catalogReference);
34297
34189
  };
34298
- const shouldReplaceWithLowerMajor = (currentVersion, nextVersion) => {
34190
+ const shouldReplaceReactVersion = (currentVersion, nextVersion) => {
34299
34191
  if (!currentVersion) return true;
34300
34192
  const currentMajor = parseReactMajor(currentVersion);
34301
34193
  const nextMajor = parseReactMajor(nextVersion);
@@ -34303,61 +34195,17 @@ const shouldReplaceWithLowerMajor = (currentVersion, nextVersion) => {
34303
34195
  if (nextMajor === null) return false;
34304
34196
  return nextMajor < currentMajor;
34305
34197
  };
34306
- const shouldReplaceSupportedDependencyFact = (currentFact, nextFact, latestSupportedMajor) => {
34198
+ const shouldReplaceMobxFact = (currentFact, nextFact) => {
34307
34199
  if (currentFact.version === null) return true;
34308
34200
  if (nextFact.version === null) return false;
34309
34201
  const currentMajor = getLowestDependencyMajor(currentFact.version);
34310
34202
  const nextMajor = getLowestDependencyMajor(nextFact.version);
34311
34203
  if (currentMajor === null) return false;
34312
34204
  if (nextMajor === null) return true;
34313
- if (currentMajor > latestSupportedMajor) return false;
34314
- if (nextMajor > latestSupportedMajor) return true;
34315
- return nextMajor < currentMajor;
34316
- };
34317
- const shouldReplaceStyledComponentsVersion = (currentVersion, nextVersion) => {
34318
- if (!currentVersion) return true;
34319
- const currentMajor = getLowestDependencyMajor(currentVersion);
34320
- const nextMajor = getLowestDependencyMajor(nextVersion);
34321
- if (currentMajor === null) return nextMajor !== null && nextMajor < 6;
34322
- if (nextMajor === null) return currentMajor >= 6;
34205
+ if (currentMajor > 6) return false;
34206
+ if (nextMajor > 6) return true;
34323
34207
  return nextMajor < currentMajor;
34324
34208
  };
34325
- const selectOldestDependencyVersion = (currentVersion, nextVersion) => {
34326
- if (currentVersion === null || nextVersion === null) return null;
34327
- const current = parseDependencyMajorMinor(currentVersion);
34328
- const next = parseDependencyMajorMinor(nextVersion);
34329
- if (current === null) return currentVersion;
34330
- if (next === null) return nextVersion;
34331
- if (next.major !== current.major) return next.major < current.major ? nextVersion : currentVersion;
34332
- return next.minor < current.minor ? nextVersion : currentVersion;
34333
- };
34334
- const shouldReplaceMobxFact = (currentFact, nextFact) => {
34335
- if (currentFact.sourceDirectory === null) return true;
34336
- if (currentFact.version === null) return false;
34337
- if (nextFact.version === null) return true;
34338
- const currentMajor = getDependencyMajorWithinSupportedRange(currentFact.version, 6);
34339
- const nextMajor = getDependencyMajorWithinSupportedRange(nextFact.version, 6);
34340
- if (currentMajor === null) return false;
34341
- if (nextMajor === null) return true;
34342
- return selectOldestDependencyVersion(currentFact.version, nextFact.version) === nextFact.version;
34343
- };
34344
- const collectBindingVersion = (facts, packageJson, directory, packageName) => {
34345
- const version = getDependencySpec(packageJson, packageName);
34346
- if (version === null) return;
34347
- const resolvedVersion = resolveCatalogBackedDependencyVersion({
34348
- rootDirectory: directory,
34349
- rootPackageJson: packageJson,
34350
- packageName,
34351
- version
34352
- });
34353
- if (packageName === MOBX_REACT_PACKAGE_NAME) {
34354
- facts.mobxReactVersion = facts.hasMobxReact ? selectOldestDependencyVersion(facts.mobxReactVersion, resolvedVersion) : resolvedVersion;
34355
- facts.hasMobxReact = true;
34356
- return;
34357
- }
34358
- facts.mobxReactLiteVersion = facts.hasMobxReactLite ? selectOldestDependencyVersion(facts.mobxReactLiteVersion, resolvedVersion) : resolvedVersion;
34359
- facts.hasMobxReactLite = true;
34360
- };
34361
34209
  const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, rootPackageJson) => {
34362
34210
  if (facts.expo.version === null) {
34363
34211
  const spec = getDependencySpec(packageJson, "expo");
@@ -34393,23 +34241,10 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
34393
34241
  };
34394
34242
  if (shouldReplaceMobxFact(facts.mobx, nextMobxFact)) facts.mobx = nextMobxFact;
34395
34243
  }
34396
- collectBindingVersion(facts, packageJson, directory, MOBX_REACT_PACKAGE_NAME);
34397
- collectBindingVersion(facts, packageJson, directory, MOBX_REACT_LITE_PACKAGE_NAME);
34244
+ facts.hasMobxReact = facts.hasMobxReact || getDependencySpec(packageJson, MOBX_REACT_PACKAGE_NAME) !== null;
34245
+ facts.hasMobxReactLite = facts.hasMobxReactLite || getDependencySpec(packageJson, MOBX_REACT_LITE_PACKAGE_NAME) !== null;
34398
34246
  facts.hasMobxStateTree = facts.hasMobxStateTree || getDependencySpec(packageJson, MOBX_STATE_TREE_PACKAGE_NAME) !== null;
34399
34247
  facts.hasMobxReactObserver = facts.hasMobxReactObserver || getDependencySpec(packageJson, MOBX_REACT_OBSERVER_PACKAGE_NAME) !== null;
34400
- const zustandSpec = getDependencySpec(packageJson, "zustand");
34401
- if (zustandSpec !== null) {
34402
- const nextZustandFact = {
34403
- version: resolveCatalogBackedDependencyVersion({
34404
- rootDirectory: directory,
34405
- rootPackageJson: packageJson,
34406
- packageName: "zustand",
34407
- version: zustandSpec
34408
- }),
34409
- sourceDirectory: directory
34410
- };
34411
- if (shouldReplaceSupportedDependencyFact(facts.zustand, nextZustandFact, 5)) facts.zustand = nextZustandFact;
34412
- }
34413
34248
  if (facts.reanimatedVersion === null) {
34414
34249
  const spec = getDependencySpec(packageJson, REANIMATED_DEPENDENCY_NAME);
34415
34250
  if (spec !== null) facts.reanimatedVersion = spec;
@@ -34418,52 +34253,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
34418
34253
  const spec = getDependencySpec(packageJson, "valtio");
34419
34254
  if (spec !== null) facts.valtioVersion = spec;
34420
34255
  }
34421
- facts.tanstackQueryVersion ??= getTanStackQueryVersion(packageJson);
34422
- const styledComponentsVersion = resolveCatalogBackedDependencyVersion({
34423
- rootDirectory: directory,
34424
- rootPackageJson: packageJson,
34425
- packageName: "styled-components",
34426
- version: getStyledComponentsVersion(packageJson)
34427
- });
34428
- if (styledComponentsVersion && shouldReplaceStyledComponentsVersion(facts.styledComponentsVersion, styledComponentsVersion)) facts.styledComponentsVersion = styledComponentsVersion;
34429
- facts.hasI18nLibrary = facts.hasI18nLibrary || hasI18nDependency(packageJson);
34430
- for (const packageName of REACT_THREE_FIBER_DEPENDENCY_NAMES) {
34431
- const version = resolveCatalogBackedDependencyVersion({
34432
- rootDirectory,
34433
- rootPackageJson,
34434
- sourceDirectory: directory,
34435
- sourcePackageJson: packageJson,
34436
- packageName,
34437
- version: getDependencyDeclaration({
34438
- packageName,
34439
- packageJson,
34440
- sections: REACT_THREE_FIBER_SECTIONS
34441
- }).version
34442
- });
34443
- if (version === null) continue;
34444
- if (shouldReplaceWithLowerMajor(facts.reactThreeFiber.version, version)) facts.reactThreeFiber = {
34445
- packageName,
34446
- version,
34447
- sourceDirectory: directory
34448
- };
34449
- }
34450
- const threeVersion = resolveCatalogBackedDependencyVersion({
34451
- rootDirectory,
34452
- rootPackageJson,
34453
- sourceDirectory: directory,
34454
- sourcePackageJson: packageJson,
34455
- packageName: "three",
34456
- version: getDependencyDeclaration({
34457
- packageName: "three",
34458
- packageJson,
34459
- sections: THREE_DEPENDENCY_SECTIONS
34460
- }).version
34461
- });
34462
- if (threeVersion !== null) {
34463
- const currentRelease = parseThreeRelease(facts.threeVersion);
34464
- const nextRelease = parseThreeRelease(threeVersion);
34465
- if (facts.threeVersion === null || nextRelease !== null && (currentRelease === null || nextRelease < currentRelease)) facts.threeVersion = threeVersion;
34466
- }
34467
34256
  facts.hasReactNativeAwarePackage = facts.hasReactNativeAwarePackage || isPackageJsonReactNativeAware(packageJson);
34468
34257
  facts.hasReanimatedAwarePackage = facts.hasReanimatedAwarePackage || isPackageJsonReanimatedAware(packageJson);
34469
34258
  facts.hasSsrDependency = facts.hasSsrDependency || isPackageJsonSsrAware(packageJson);
@@ -34485,8 +34274,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
34485
34274
  if (currentRemotionMajorVersion === null || remotionMajorVersion < currentRemotionMajorVersion) facts.remotionVersion = resolvedRemotionVersion;
34486
34275
  }
34487
34276
  }
34488
- facts.hasThree = facts.hasThree || THREE_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
34489
- facts.hasReactThreeFiber = facts.hasReactThreeFiber || REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
34490
34277
  };
34491
34278
  const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGroup }) => {
34492
34279
  const facts = {
@@ -34512,32 +34299,15 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
34512
34299
  sourceDirectory: null
34513
34300
  },
34514
34301
  hasMobxReact: false,
34515
- mobxReactVersion: null,
34516
34302
  hasMobxReactLite: false,
34517
- mobxReactLiteVersion: null,
34518
34303
  hasMobxStateTree: false,
34519
34304
  hasMobxReactObserver: false,
34520
- zustand: {
34521
- version: null,
34522
- sourceDirectory: null
34523
- },
34524
- tanstackQueryVersion: null,
34525
- styledComponentsVersion: null,
34526
- hasI18nLibrary: false,
34527
34305
  hasReactNativeAwarePackage: false,
34528
34306
  hasReanimatedAwarePackage: false,
34529
34307
  hasSsrDependency: false,
34530
34308
  hasRemotionDependency: false,
34531
34309
  hasUnknownRemotionVersion: false,
34532
34310
  remotionVersion: null,
34533
- hasThree: false,
34534
- threeVersion: null,
34535
- hasReactThreeFiber: false,
34536
- reactThreeFiber: {
34537
- packageName: null,
34538
- version: null,
34539
- sourceDirectory: null
34540
- },
34541
34311
  reanimatedVersion: null
34542
34312
  };
34543
34313
  evaluateManifestFacts(facts, rootPackageJson, rootDirectory, rootDirectory, rootPackageJson);
@@ -34580,7 +34350,7 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
34580
34350
  workspaceDirectory,
34581
34351
  workspacePackageJson
34582
34352
  });
34583
- if (reactVersion && shouldReplaceWithLowerMajor(facts.reactVersion, reactVersion)) facts.reactVersion = reactVersion;
34353
+ if (reactVersion && shouldReplaceReactVersion(facts.reactVersion, reactVersion)) facts.reactVersion = reactVersion;
34584
34354
  if (tailwindVersion && !facts.tailwindVersion) facts.tailwindVersion = tailwindVersion;
34585
34355
  if (zodVersion && !facts.zodVersion) facts.zodVersion = zodVersion;
34586
34356
  const settledReactMajor = parseReactMajor(facts.reactVersion);
@@ -34776,13 +34546,9 @@ const discoverProjectWithoutPackageJson = (directory) => {
34776
34546
  mobxVersion: null,
34777
34547
  mobxMajorVersion: null,
34778
34548
  hasMobxReact: false,
34779
- mobxReactVersion: null,
34780
34549
  hasMobxReactLite: false,
34781
- mobxReactLiteVersion: null,
34782
34550
  hasMobxStateTree: false,
34783
34551
  hasMobxReactObserver: false,
34784
- zustandVersion: null,
34785
- zustandMajorVersion: null,
34786
34552
  framework: "unknown",
34787
34553
  hasTypeScript: hasOwnTsConfig,
34788
34554
  hasReactCompiler: false,
@@ -34793,15 +34559,6 @@ const discoverProjectWithoutPackageJson = (directory) => {
34793
34559
  hasRemotion: false,
34794
34560
  remotionVersion: null,
34795
34561
  remotionMajorVersion: null,
34796
- hasI18nLibrary: false,
34797
- tanstackQueryVersion: null,
34798
- styledComponentsVersion: null,
34799
- hasThree: false,
34800
- threeVersion: null,
34801
- threeRelease: null,
34802
- hasReactThreeFiber: false,
34803
- reactThreeFiberVersion: null,
34804
- reactThreeFiberMajorVersion: null,
34805
34562
  hasSsrDependency: false,
34806
34563
  preactVersion: null,
34807
34564
  preactMajorVersion: null,
@@ -34900,12 +34657,6 @@ const discoverProject = (directory) => {
34900
34657
  packageName: SHOPIFY_FLASH_LIST_PACKAGE_NAME,
34901
34658
  version: workspaceFacts.shopifyFlashList.version
34902
34659
  }) : null;
34903
- const zustandVersion = resolveCatalogBackedDependencyVersion({
34904
- rootDirectory: directory,
34905
- rootPackageJson: packageJson,
34906
- packageName: "zustand",
34907
- version: workspaceFacts.zustand.version
34908
- });
34909
34660
  const hasReanimated = hasReactNativeWorkspace && workspaceFacts.hasReanimatedAwarePackage;
34910
34661
  const reanimatedVersion = hasReanimated ? workspaceFacts.reanimatedVersion : null;
34911
34662
  const nextjsVersion = framework === "nextjs" ? resolveCatalogBackedDependencyVersion({
@@ -34928,19 +34679,6 @@ const discoverProject = (directory) => {
34928
34679
  });
34929
34680
  const preactVersion = getPreactVersion(packageJson);
34930
34681
  const remotionVersion = workspaceFacts.remotionVersion;
34931
- const tanstackQueryVersion = getTanStackQueryVersion(packageJson) ?? workspaceFacts.tanstackQueryVersion;
34932
- const reactThreeFiberVersion = workspaceFacts.reactThreeFiber.packageName ? resolveCatalogBackedDependencyVersion({
34933
- rootDirectory: directory,
34934
- rootPackageJson: packageJson,
34935
- packageName: workspaceFacts.reactThreeFiber.packageName,
34936
- version: workspaceFacts.reactThreeFiber.version
34937
- }) : null;
34938
- const threeVersion = resolveCatalogBackedDependencyVersion({
34939
- rootDirectory: directory,
34940
- rootPackageJson: packageJson,
34941
- packageName: "three",
34942
- version: workspaceFacts.threeVersion
34943
- });
34944
34682
  const isPreES2023Target = hasTypeScript && detectPreES2023Target(directory);
34945
34683
  const projectInfo = {
34946
34684
  rootDirectory: directory,
@@ -34951,34 +34689,21 @@ const discoverProject = (directory) => {
34951
34689
  zodVersion,
34952
34690
  zodMajorVersion: zodVersion === null ? null : getLowestDependencyMajor(zodVersion),
34953
34691
  mobxVersion,
34954
- mobxMajorVersion: mobxVersion === null ? null : getDependencyMajorWithinSupportedRange(mobxVersion, 6),
34692
+ mobxMajorVersion: mobxVersion === null ? null : getLowestDependencyMajor(mobxVersion),
34955
34693
  hasMobxReact: workspaceFacts.hasMobxReact,
34956
- mobxReactVersion: workspaceFacts.mobxReactVersion,
34957
34694
  hasMobxReactLite: workspaceFacts.hasMobxReactLite,
34958
- mobxReactLiteVersion: workspaceFacts.mobxReactLiteVersion,
34959
34695
  hasMobxStateTree: workspaceFacts.hasMobxStateTree,
34960
34696
  hasMobxReactObserver: workspaceFacts.hasMobxReactObserver,
34961
- zustandVersion,
34962
- zustandMajorVersion: zustandVersion === null ? null : getLowestDependencyMajor(zustandVersion),
34963
34697
  framework,
34964
34698
  hasTypeScript,
34965
34699
  hasReactCompiler: detectReactCompiler(directory, packageJson),
34966
34700
  hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
34967
- hasTanStackQuery: tanstackQueryVersion !== null,
34968
- hasI18nLibrary: workspaceFacts.hasI18nLibrary,
34969
- tanstackQueryVersion,
34970
- styledComponentsVersion: workspaceFacts.styledComponentsVersion,
34701
+ hasTanStackQuery: hasTanStackQuery(packageJson),
34971
34702
  valtioVersion,
34972
34703
  valtioMajorVersion: valtioVersion === null ? null : getLowestDependencyMajor(valtioVersion),
34973
34704
  hasRemotion: workspaceFacts.hasRemotionDependency,
34974
34705
  remotionVersion,
34975
34706
  remotionMajorVersion: remotionVersion === null ? null : getLowestDependencyMajor(remotionVersion),
34976
- hasThree: workspaceFacts.hasThree,
34977
- threeVersion,
34978
- threeRelease: parseThreeRelease(threeVersion),
34979
- hasReactThreeFiber: workspaceFacts.hasReactThreeFiber,
34980
- reactThreeFiberVersion,
34981
- reactThreeFiberMajorVersion: reactThreeFiberVersion === null ? null : getLowestDependencyMajor(reactThreeFiberVersion),
34982
34707
  hasSsrDependency: workspaceFacts.hasSsrDependency,
34983
34708
  preactVersion,
34984
34709
  preactMajorVersion: parseReactMajor(preactVersion),
@@ -38179,10 +37904,10 @@ const SSR_FRAMEWORKS = new Set([
38179
37904
  "gatsby",
38180
37905
  "tanstack-start"
38181
37906
  ]);
38182
- const addVersionCapabilityLadder = (capabilities, name, detectedVersion, earliest, latest) => {
38183
- if (detectedVersion === null) return;
38184
- const cappedVersion = Math.min(detectedVersion, latest);
38185
- for (let candidate = earliest; candidate <= cappedVersion; candidate += 1) capabilities.add(`${name}:${candidate}`);
37907
+ const addMajorLadder = (capabilities, name, major, earliest, latest) => {
37908
+ if (major === null) return;
37909
+ const cappedMajor = Math.min(major, latest);
37910
+ for (let candidate = earliest; candidate <= cappedMajor; candidate += 1) capabilities.add(`${name}:${candidate}`);
38186
37911
  };
38187
37912
  const buildCapabilities = (project) => {
38188
37913
  const capabilities = /* @__PURE__ */ new Set();
@@ -38195,77 +37920,37 @@ const buildCapabilities = (project) => {
38195
37920
  if (CLIENT_ONLY_FRAMEWORKS.has(project.framework)) capabilities.add("client-only");
38196
37921
  if (project.isStaticExport) capabilities.add("nextjs:static-export");
38197
37922
  if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
38198
- if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 16) capabilities.add("nextjs:16");
38199
- addVersionCapabilityLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
37923
+ addMajorLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
38200
37924
  if (project.reactMajorVersion !== null && project.reactMajorVersion >= 19 && isMajorMinorAtLeast(parseReactMajorMinor(project.reactVersion), {
38201
37925
  major: 19,
38202
37926
  minor: 2
38203
37927
  })) capabilities.add("react:19.2");
38204
- if (project.tailwindVersion !== null) {
38205
- capabilities.add("tailwind");
38206
- const tailwindVersion = parseTailwindMajorMinor(project.tailwindVersion);
38207
- if (isMajorMinorAtLeast(tailwindVersion, {
38208
- major: 3,
38209
- minor: 4
38210
- })) capabilities.add("tailwind:3.4");
38211
- if (tailwindVersion !== null && isMajorMinorAtLeast(tailwindVersion, {
38212
- major: 4,
38213
- minor: 0
38214
- })) capabilities.add("tailwind:4");
38215
- }
37928
+ if (project.tailwindVersion !== null) capabilities.add("tailwind");
37929
+ if (project.tailwindVersion !== null && isMajorMinorAtLeast(parseTailwindMajorMinor(project.tailwindVersion), {
37930
+ major: 3,
37931
+ minor: 4
37932
+ })) capabilities.add("tailwind:3.4");
38216
37933
  if (project.zodVersion !== null) capabilities.add("zod");
38217
37934
  if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
38218
37935
  if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
38219
37936
  if (project.hasMobxReact === true) capabilities.add("mobx-react");
38220
37937
  if (project.hasMobxReactLite === true) capabilities.add("mobx-react-lite");
38221
37938
  if (project.hasMobxReact === true || project.hasMobxReactLite === true) capabilities.add("mobx-react-binding");
38222
- const mobxReactVersion = parseDependencyMajorMinor(project.mobxReactVersion);
38223
- const mobxReactLiteVersion = parseDependencyMajorMinor(project.mobxReactLiteVersion);
38224
- const hasMobxReactObserverMemoGuard = mobxReactVersion !== null && isMajorMinorAtLeast(mobxReactVersion, {
38225
- major: 7,
38226
- minor: 3
38227
- });
38228
- const hasMobxReactLiteObserverMemoGuard = mobxReactLiteVersion !== null && isMajorMinorAtLeast(mobxReactLiteVersion, {
38229
- major: 3,
38230
- minor: 3
38231
- });
38232
- if (hasMobxReactObserverMemoGuard) capabilities.add("mobx-react-observer-memo-guard");
38233
- if (hasMobxReactLiteObserverMemoGuard) capabilities.add("mobx-react-lite-observer-memo-guard");
38234
- if (hasMobxReactObserverMemoGuard || hasMobxReactLiteObserverMemoGuard) capabilities.add("mobx-react-binding-observer-memo-guard");
38235
37939
  if (project.hasMobxStateTree === true) capabilities.add("mobx-state-tree");
38236
37940
  if (project.hasMobxReactObserver === true) capabilities.add("mobx-react-observer");
38237
- if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6) addVersionCapabilityLadder(capabilities, "mobx", project.mobxMajorVersion, 4, 6);
38238
- const mobxVersion = parseDependencyMajorMinor(project.mobxVersion);
38239
- if (project.mobxMajorVersion === 6 && mobxVersion !== null && isMajorMinorAtLeast(mobxVersion, {
38240
- major: 6,
38241
- minor: 10
38242
- })) capabilities.add("mobx:6.10");
38243
- if (project.zustandVersion !== void 0 && project.zustandVersion !== null) capabilities.add("zustand");
38244
- if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5) addVersionCapabilityLadder(capabilities, "zustand", project.zustandMajorVersion, 1, 5);
37941
+ if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6) addMajorLadder(capabilities, "mobx", project.mobxMajorVersion, 4, 6);
38245
37942
  if (project.isPreES2023Target) capabilities.add("pre-es2023");
38246
37943
  if (project.hasReactCompiler) capabilities.add("react-compiler");
38247
- if (Boolean(project.hasTanStackQuery) || Boolean(project.tanstackQueryVersion)) capabilities.add("tanstack-query");
38248
- if (project.styledComponentsVersion) {
38249
- capabilities.add("styled-components");
38250
- const styledComponentsMajor = getLowestDependencyMajor(project.styledComponentsVersion);
38251
- if (styledComponentsMajor !== null && styledComponentsMajor >= 6) capabilities.add("styled-components:6");
38252
- }
38253
- if (project.hasI18nLibrary) capabilities.add("i18n");
37944
+ if (project.hasTanStackQuery) capabilities.add("tanstack-query");
38254
37945
  if (project.valtioVersion !== null) capabilities.add("valtio");
38255
- addVersionCapabilityLadder(capabilities, "valtio", project.valtioMajorVersion, 1, 10);
37946
+ addMajorLadder(capabilities, "valtio", project.valtioMajorVersion, 1, 10);
38256
37947
  if (project.hasRemotion) {
38257
37948
  capabilities.add("remotion");
38258
- addVersionCapabilityLadder(capabilities, "remotion", project.remotionMajorVersion ?? null, 4, 30);
38259
- }
38260
- if (project.hasThree || project.hasReactThreeFiber) capabilities.add("three");
38261
- addVersionCapabilityLadder(capabilities, "three", project.threeRelease ?? null, 145, 250);
38262
- if (project.hasReactThreeFiber) {
38263
- capabilities.add("r3f");
38264
- addVersionCapabilityLadder(capabilities, "r3f", project.reactThreeFiberMajorVersion ?? null, 3, 10);
37949
+ addMajorLadder(capabilities, "remotion", project.remotionMajorVersion ?? null, 4, 30);
38265
37950
  }
38266
37951
  if (project.hasTypeScript) capabilities.add("typescript");
38267
37952
  if (project.preactVersion !== null) capabilities.add("preact");
38268
- addVersionCapabilityLadder(capabilities, "preact", project.preactMajorVersion, 10, 20);
37953
+ addMajorLadder(capabilities, "preact", project.preactMajorVersion, 10, 20);
38269
37954
  if (project.preactVersion !== null && project.reactVersion === null) capabilities.add("pure-preact");
38270
37955
  return capabilities;
38271
37956
  };
@@ -38277,7 +37962,7 @@ const getCapabilities = (project) => {
38277
37962
  capabilitiesByProject.set(project, capabilities);
38278
37963
  return capabilities;
38279
37964
  };
38280
- const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhen, includedTags) => {
37965
+ const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhen) => {
38281
37966
  if (requires) {
38282
37967
  for (const capability of requires) if (!capabilities.has(capability)) return false;
38283
37968
  }
@@ -38288,29 +37973,20 @@ const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhe
38288
37973
  if (tags) {
38289
37974
  for (const tag of tags) if (ignoredTags.has(tag)) return false;
38290
37975
  }
38291
- if (includedTags && includedTags.size > 0) {
38292
- if (!tags?.some((tag) => includedTags.has(tag))) return false;
38293
- }
38294
37976
  return true;
38295
37977
  };
38296
- const shouldEnableRuleByDefaultStatus = (options) => options.defaultEnabled !== false || options.hasExplicitOverride === true || options.includeTagDefaults && options.hasIncludedTags;
38297
37978
  const yieldToEventLoop = () => new Promise((resolve) => {
38298
37979
  setImmediate(resolve);
38299
37980
  });
38300
37981
  const createSecurityScanSession = (rootDirectory, options) => {
38301
37982
  const capabilities = options.project ? getCapabilities(options.project) : /* @__PURE__ */ new Set();
38302
37983
  const ignoredTags = options.ignoredTags ?? /* @__PURE__ */ new Set();
38303
- const includedTags = options.includedTags ?? /* @__PURE__ */ new Set();
38304
37984
  const enabledScanRules = REACT_DOCTOR_RULES.flatMap((entry) => {
38305
37985
  const rule = entry.rule;
38306
37986
  const scan = rule.scan;
38307
37987
  if (typeof scan !== "function") return [];
38308
- if (!shouldEnableRuleByDefaultStatus({
38309
- defaultEnabled: rule.defaultEnabled,
38310
- includeTagDefaults: options.includeTagDefaults === true,
38311
- hasIncludedTags: includedTags.size > 0
38312
- })) return [];
38313
- if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen, includedTags)) return [];
37988
+ if (rule.defaultEnabled === false) return [];
37989
+ if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen)) return [];
38314
37990
  return [{
38315
37991
  entry,
38316
37992
  scan,
@@ -40296,9 +39972,8 @@ const buildUserPluginRules = (userPlugin, severityControls) => {
40296
39972
  }
40297
39973
  return enabled;
40298
39974
  };
40299
- const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(), includedTags = /* @__PURE__ */ new Set(), includeTagDefaults = false, serverAuthFunctionNames, severityControls, userPlugins = [], disableReactHooksJsPlugin = false, ruleSelection, sidecarRuleIdFilter }) => {
40300
- const hasIncludedTags = includedTags.size > 0;
40301
- const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" || hasIncludedTags ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
39975
+ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(), serverAuthFunctionNames, severityControls, userPlugins = [], disableReactHooksJsPlugin = false, ruleSelection, sidecarRuleIdFilter }) => {
39976
+ const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
40302
39977
  const reactCompilerRules = reactHooksJsPlugin ? applyRuleSeverityControls(filterRulesToAvailable(REACT_COMPILER_RULES, "react-hooks-js", reactHooksJsPlugin.availableRuleNames), severityControls) : {};
40303
39978
  const jsPlugins = [];
40304
39979
  if (reactHooksJsPlugin) jsPlugins.push(reactHooksJsPlugin.entry);
@@ -40313,14 +39988,9 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
40313
39988
  if (rule.scan !== void 0) continue;
40314
39989
  if (customRulesOnly && registryEntry.originallyExternal) continue;
40315
39990
  if (rule.framework !== "global" && !rule.requires) continue;
40316
- if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen, includedTags)) continue;
39991
+ if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen)) continue;
40317
39992
  const explicitRuleOverride = resolveRuleSeverityOverride({ ruleKey: registryEntry.key }, severityControls);
40318
- if (!shouldEnableRuleByDefaultStatus({
40319
- defaultEnabled: rule.defaultEnabled,
40320
- includeTagDefaults,
40321
- hasIncludedTags,
40322
- hasExplicitOverride: explicitRuleOverride !== void 0
40323
- })) continue;
39993
+ if (rule.defaultEnabled === false && explicitRuleOverride === void 0) continue;
40324
39994
  const severity = resolveRuleSeverityOverride({
40325
39995
  ruleKey: registryEntry.key,
40326
39996
  category: rule.category
@@ -40329,7 +39999,7 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
40329
39999
  enabledReactDoctorRules[registryEntry.key] = severity;
40330
40000
  }
40331
40001
  const userPluginRules = {};
40332
- if (ruleSelection !== "sidecar" && !hasIncludedTags) for (const userPlugin of userPlugins) {
40002
+ if (ruleSelection !== "sidecar") for (const userPlugin of userPlugins) {
40333
40003
  Object.assign(userPluginRules, buildUserPluginRules(userPlugin, severityControls));
40334
40004
  jsPlugins.push(userPlugin.entry);
40335
40005
  }
@@ -40546,19 +40216,6 @@ const createSidecarLintCache = (cacheDirectory, rulesetHash) => {
40546
40216
  }
40547
40217
  };
40548
40218
  };
40549
- const fingerprintCacheByFilePath = /* @__PURE__ */ new Map();
40550
- const fingerprintFileContents = (filePath, fingerprintLength) => {
40551
- const fileStats = NFS.statSync(filePath, { bigint: true });
40552
- const cachedFingerprint = fingerprintCacheByFilePath.get(filePath);
40553
- if (cachedFingerprint?.modifiedTimeNanoseconds === fileStats.mtimeNs && cachedFingerprint.sizeBytes === fileStats.size) return cachedFingerprint.fingerprint;
40554
- const fingerprint = crypto.createHash("sha256").update(NFS.readFileSync(filePath)).digest("hex").slice(0, fingerprintLength);
40555
- fingerprintCacheByFilePath.set(filePath, {
40556
- fingerprint,
40557
- modifiedTimeNanoseconds: fileStats.mtimeNs,
40558
- sizeBytes: fileStats.size
40559
- });
40560
- return fingerprint;
40561
- };
40562
40219
  const bundledRequire = createRequire(import.meta.url);
40563
40220
  const childNodeVersionByBinaryPath = /* @__PURE__ */ new Map();
40564
40221
  const resolveChildNodeVersion = (nodeBinaryPath) => {
@@ -40582,13 +40239,6 @@ const TOOLCHAIN_PACKAGE_SPECIFIERS = [
40582
40239
  "oxlint-plugin-react-doctor/package.json",
40583
40240
  "eslint-plugin-react-hooks/package.json"
40584
40241
  ];
40585
- const resolvePluginFingerprint = () => {
40586
- try {
40587
- return fingerprintFileContents(bundledRequire.resolve("oxlint-plugin-react-doctor"), 16);
40588
- } catch {
40589
- return "unresolved";
40590
- }
40591
- };
40592
40242
  const resolveOxlintToolchainVersions = (nodeBinaryPath = process.execPath) => {
40593
40243
  const versions = [`node=${resolveChildNodeVersion(nodeBinaryPath)}`];
40594
40244
  for (const specifier of TOOLCHAIN_PACKAGE_SPECIFIERS) try {
@@ -40598,7 +40248,6 @@ const resolveOxlintToolchainVersions = (nodeBinaryPath = process.execPath) => {
40598
40248
  } catch {
40599
40249
  versions.push(`${specifier}=missing`);
40600
40250
  }
40601
- versions.push(`oxlint-plugin-react-doctor#fingerprint=${resolvePluginFingerprint()}`);
40602
40251
  return versions;
40603
40252
  };
40604
40253
  const esmRequire = createRequire(import.meta.url);
@@ -42074,7 +41723,7 @@ const reactHooksJsPluginDropNote = (error) => {
42074
41723
  * 6. always restore disable directives + clean up the temp dir
42075
41724
  */
42076
41725
  const runOxlint = async (options) => {
42077
- const { rootDirectory, project, includePaths, nodeBinaryPath = process.execPath, customRulesOnly = false, respectInlineDisables = true, adoptExistingLintConfig = true, ignoredTags = /* @__PURE__ */ new Set(), includedTags = /* @__PURE__ */ new Set(), includeTagDefaults = false, userConfig, configSourceDirectory = rootDirectory, onPartialFailure, onFileCoverage, perFileLintCacheEnabled = false, sidecarLintCacheEnabled = false, onCacheStats, onSidecarStats, spawnTimeoutMs, outputMaxBytes, lintBatchOrdering = "cost" } = options;
41726
+ const { rootDirectory, project, includePaths, nodeBinaryPath = process.execPath, customRulesOnly = false, respectInlineDisables = true, adoptExistingLintConfig = true, ignoredTags = /* @__PURE__ */ new Set(), userConfig, configSourceDirectory = rootDirectory, onPartialFailure, onFileCoverage, perFileLintCacheEnabled = false, sidecarLintCacheEnabled = false, onCacheStats, onSidecarStats, spawnTimeoutMs, outputMaxBytes, lintBatchOrdering = "cost" } = options;
42078
41727
  const serverAuthFunctionNames = Array.isArray(userConfig?.serverAuthFunctionNames) ? userConfig.serverAuthFunctionNames.filter((entry) => typeof entry === "string" && entry.length > 0) : void 0;
42079
41728
  const severityControls = buildRuleSeverityControls(userConfig);
42080
41729
  validateRuleRegistration();
@@ -42088,15 +41737,13 @@ const runOxlint = async (options) => {
42088
41737
  }
42089
41738
  const pluginPath = resolvePluginPath();
42090
41739
  const extendsPaths = (adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : []).filter(canOxlintExtendConfig);
42091
- const userPlugins = includedTags.size > 0 ? [] : resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
41740
+ const userPlugins = resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
42092
41741
  const buildConfig = (overrides) => createOxlintConfig({
42093
41742
  pluginPath,
42094
41743
  project,
42095
41744
  customRulesOnly,
42096
41745
  extendsPaths: overrides.extendsPaths,
42097
41746
  ignoredTags,
42098
- includedTags,
42099
- includeTagDefaults,
42100
41747
  serverAuthFunctionNames,
42101
41748
  severityControls,
42102
41749
  userPlugins,
@@ -42485,8 +42132,6 @@ var Linter = class Linter extends Service()("react-doctor/Linter") {
42485
42132
  respectInlineDisables: input.respectInlineDisables,
42486
42133
  adoptExistingLintConfig: input.adoptExistingLintConfig,
42487
42134
  ignoredTags: input.ignoredTags,
42488
- includedTags: input.includedTags,
42489
- includeTagDefaults: input.includeTagDefaults,
42490
42135
  userConfig: input.userConfig ?? null,
42491
42136
  configSourceDirectory: input.configSourceDirectory,
42492
42137
  onPartialFailure: (reason) => {
@@ -43335,9 +42980,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
43335
42980
  const securityScanFailedRef = yield* make$13(false);
43336
42981
  const securityScanFiber = yield* forkChild(runCollect(applyPerElementPipeline(isDiffMode ? empty$4 : unwrap(tryPromise(() => checkSecurityScanCooperative(scanDirectory, {
43337
42982
  project,
43338
- ignoredTags: input.ignoredTags,
43339
- includedTags: input.includedTags,
43340
- includeTagDefaults: input.includeTagDefaults
42983
+ ignoredTags: input.ignoredTags
43341
42984
  })).pipe(map$3((diagnostics) => fromIterable$1(diagnostics)), catch_$1(() => set(securityScanFailedRef, true).pipe(as(empty$4))))))).pipe(withSpan("SecurityScan.run")));
43342
42985
  const shouldRunSupplyChain = !isDiffMode || (input.supplyChainManifestChanged ?? false);
43343
42986
  const supplyChainOverlapTimeout = yield* SupplyChainOverlapTimeoutMs;
@@ -43428,8 +43071,6 @@ const runInspect = (input, hooks = {}) => gen(function* () {
43428
43071
  respectInlineDisables: input.respectInlineDisables,
43429
43072
  adoptExistingLintConfig: input.adoptExistingLintConfig,
43430
43073
  ignoredTags: input.ignoredTags,
43431
- includedTags: input.includedTags,
43432
- includeTagDefaults: input.includeTagDefaults,
43433
43074
  userConfig: resolvedConfig.config ?? void 0,
43434
43075
  configSourceDirectory: resolvedConfig.configSourceDirectory ?? void 0,
43435
43076
  onFileProgress: (scannedFileCount, totalFileCount) => {
@@ -45932,5 +45573,5 @@ const startLanguageServer = () => {
45932
45573
  };
45933
45574
  //#endregion
45934
45575
  export { startLanguageServer };
45935
- !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]="51dfb658-30e2-586b-8f8e-5eaa86b6350a")}catch(e){}}();
45936
- //# debugId=51dfb658-30e2-586b-8f8e-5eaa86b6350a
45576
+ !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]="23f6c159-20b7-5636-888d-5add4f4c7fc3")}catch(e){}}();
45577
+ //# debugId=23f6c159-20b7-5636-888d-5add4f4c7fc3