react-doctor 0.8.1-dev.284b4e4 → 0.8.1-dev.3598138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -14
- package/dist/cli.js +142 -666
- package/dist/index.d.ts +0 -41
- package/dist/index.js +98 -575
- package/dist/lsp.js +98 -575
- package/dist/skills/react-doctor/SKILL.md +0 -5
- package/package.json +4 -4
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|
|
|
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 = /^(?:
|
|
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
|
|
33732
|
-
if (typeof
|
|
33733
|
-
const
|
|
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) =>
|
|
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 (
|
|
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
|
-
|
|
33971
|
-
|
|
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 (
|
|
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
|
|
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
|
|
34017
|
-
if (
|
|
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,79 +34172,7 @@ const listWorkspacePackages = (rootDirectory) => {
|
|
|
34216
34172
|
}
|
|
34217
34173
|
return packages;
|
|
34218
34174
|
};
|
|
34219
|
-
const PREFERRED_DEPENDENCY_SECTIONS = [
|
|
34220
|
-
"dependencies",
|
|
34221
|
-
"peerDependencies",
|
|
34222
|
-
"devDependencies"
|
|
34223
|
-
];
|
|
34224
|
-
const getPreferredDependencyVersion = ({ packageJson, packageNames }) => {
|
|
34225
|
-
for (const packageName of packageNames) {
|
|
34226
|
-
const declaration = getDependencyDeclaration({
|
|
34227
|
-
packageJson,
|
|
34228
|
-
packageName,
|
|
34229
|
-
sections: PREFERRED_DEPENDENCY_SECTIONS
|
|
34230
|
-
});
|
|
34231
|
-
if (declaration.version !== null) return declaration.version;
|
|
34232
|
-
}
|
|
34233
|
-
return null;
|
|
34234
|
-
};
|
|
34235
|
-
const TANSTACK_REACT_QUERY_PACKAGES = ["@tanstack/react-query", "react-query"];
|
|
34236
|
-
const getTanStackQueryVersion = (packageJson) => {
|
|
34237
|
-
return getPreferredDependencyVersion({
|
|
34238
|
-
packageJson,
|
|
34239
|
-
packageNames: TANSTACK_REACT_QUERY_PACKAGES
|
|
34240
|
-
});
|
|
34241
|
-
};
|
|
34242
|
-
const STYLED_COMPONENTS_PACKAGES = ["styled-components"];
|
|
34243
|
-
const getStyledComponentsVersion = (packageJson) => {
|
|
34244
|
-
return getPreferredDependencyVersion({
|
|
34245
|
-
packageJson,
|
|
34246
|
-
packageNames: STYLED_COMPONENTS_PACKAGES
|
|
34247
|
-
});
|
|
34248
|
-
};
|
|
34249
|
-
const I18N_PACKAGES = [
|
|
34250
|
-
"i18next",
|
|
34251
|
-
"react-i18next",
|
|
34252
|
-
"next-i18next",
|
|
34253
|
-
"react-intl",
|
|
34254
|
-
"next-intl",
|
|
34255
|
-
"use-intl",
|
|
34256
|
-
"@formatjs/intl",
|
|
34257
|
-
"@lingui/core",
|
|
34258
|
-
"@lingui/react",
|
|
34259
|
-
"typesafe-i18n",
|
|
34260
|
-
"@tolgee/react",
|
|
34261
|
-
"react-intl-universal"
|
|
34262
|
-
];
|
|
34263
|
-
const hasI18nDependency = (packageJson) => {
|
|
34264
|
-
const allDependencies = {
|
|
34265
|
-
...packageJson.peerDependencies,
|
|
34266
|
-
...packageJson.dependencies,
|
|
34267
|
-
...packageJson.devDependencies,
|
|
34268
|
-
...packageJson.optionalDependencies
|
|
34269
|
-
};
|
|
34270
|
-
return I18N_PACKAGES.some((packageName) => allDependencies[packageName] !== void 0);
|
|
34271
|
-
};
|
|
34272
34175
|
const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
|
|
34273
|
-
const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
34274
|
-
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
34275
|
-
const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
|
|
34276
|
-
const MOBX_REACT_OBSERVER_PACKAGE_NAME = "mobx-react-observer";
|
|
34277
|
-
const REACT_THREE_FIBER_DEPENDENCY_NAMES = ["@react-three/fiber", "react-three-fiber"];
|
|
34278
|
-
const REACT_THREE_FIBER_SECTIONS = [
|
|
34279
|
-
"dependencies",
|
|
34280
|
-
"peerDependencies",
|
|
34281
|
-
"optionalDependencies",
|
|
34282
|
-
"devDependencies"
|
|
34283
|
-
];
|
|
34284
|
-
const THREE_DEPENDENCY_SECTIONS = [
|
|
34285
|
-
"dependencies",
|
|
34286
|
-
"peerDependencies",
|
|
34287
|
-
"optionalDependencies",
|
|
34288
|
-
"devDependencies"
|
|
34289
|
-
];
|
|
34290
|
-
const REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_DEPENDENCY_NAMES, "@react-three/drei"];
|
|
34291
|
-
const THREE_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES, "three"];
|
|
34292
34176
|
const SHOPIFY_FLASH_LIST_PACKAGE_NAME = "@shopify/flash-list";
|
|
34293
34177
|
const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootDirectory, rootPackageJson, sections, workspaceDirectory, workspacePackageJson }) => {
|
|
34294
34178
|
const dependencyDeclaration = getDependencyDeclaration({
|
|
@@ -34299,7 +34183,7 @@ const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootD
|
|
|
34299
34183
|
if (!dependencyDeclaration.hasDeclaration) return null;
|
|
34300
34184
|
return concreteVersion ?? resolveCatalogVersion(workspacePackageJson, packageName, workspaceDirectory, dependencyDeclaration.catalogReference) ?? resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, dependencyDeclaration.catalogReference);
|
|
34301
34185
|
};
|
|
34302
|
-
const
|
|
34186
|
+
const shouldReplaceReactVersion = (currentVersion, nextVersion) => {
|
|
34303
34187
|
if (!currentVersion) return true;
|
|
34304
34188
|
const currentMajor = parseReactMajor(currentVersion);
|
|
34305
34189
|
const nextMajor = parseReactMajor(nextVersion);
|
|
@@ -34307,62 +34191,7 @@ const shouldReplaceWithLowerMajor = (currentVersion, nextVersion) => {
|
|
|
34307
34191
|
if (nextMajor === null) return false;
|
|
34308
34192
|
return nextMajor < currentMajor;
|
|
34309
34193
|
};
|
|
34310
|
-
const
|
|
34311
|
-
if (currentFact.version === null) return true;
|
|
34312
|
-
if (nextFact.version === null) return false;
|
|
34313
|
-
const currentMajor = getLowestDependencyMajor(currentFact.version);
|
|
34314
|
-
const nextMajor = getLowestDependencyMajor(nextFact.version);
|
|
34315
|
-
if (currentMajor === null) return false;
|
|
34316
|
-
if (nextMajor === null) return true;
|
|
34317
|
-
if (currentMajor > latestSupportedMajor) return false;
|
|
34318
|
-
if (nextMajor > latestSupportedMajor) return true;
|
|
34319
|
-
return nextMajor < currentMajor;
|
|
34320
|
-
};
|
|
34321
|
-
const shouldReplaceStyledComponentsVersion = (currentVersion, nextVersion) => {
|
|
34322
|
-
if (!currentVersion) return true;
|
|
34323
|
-
const currentMajor = getLowestDependencyMajor(currentVersion);
|
|
34324
|
-
const nextMajor = getLowestDependencyMajor(nextVersion);
|
|
34325
|
-
if (currentMajor === null) return nextMajor !== null && nextMajor < 6;
|
|
34326
|
-
if (nextMajor === null) return currentMajor >= 6;
|
|
34327
|
-
return nextMajor < currentMajor;
|
|
34328
|
-
};
|
|
34329
|
-
const selectOldestDependencyVersion = (currentVersion, nextVersion) => {
|
|
34330
|
-
if (currentVersion === null || nextVersion === null) return null;
|
|
34331
|
-
const current = parseDependencyMajorMinor(currentVersion);
|
|
34332
|
-
const next = parseDependencyMajorMinor(nextVersion);
|
|
34333
|
-
if (current === null) return currentVersion;
|
|
34334
|
-
if (next === null) return nextVersion;
|
|
34335
|
-
if (next.major !== current.major) return next.major < current.major ? nextVersion : currentVersion;
|
|
34336
|
-
return next.minor < current.minor ? nextVersion : currentVersion;
|
|
34337
|
-
};
|
|
34338
|
-
const shouldReplaceMobxFact = (currentFact, nextFact) => {
|
|
34339
|
-
if (currentFact.sourceDirectory === null) return true;
|
|
34340
|
-
if (currentFact.version === null) return false;
|
|
34341
|
-
if (nextFact.version === null) return true;
|
|
34342
|
-
const currentMajor = getDependencyMajorWithinSupportedRange(currentFact.version, 6);
|
|
34343
|
-
const nextMajor = getDependencyMajorWithinSupportedRange(nextFact.version, 6);
|
|
34344
|
-
if (currentMajor === null) return false;
|
|
34345
|
-
if (nextMajor === null) return true;
|
|
34346
|
-
return selectOldestDependencyVersion(currentFact.version, nextFact.version) === nextFact.version;
|
|
34347
|
-
};
|
|
34348
|
-
const collectBindingVersion = (facts, packageJson, directory, packageName) => {
|
|
34349
|
-
const version = getDependencySpec(packageJson, packageName);
|
|
34350
|
-
if (version === null) return;
|
|
34351
|
-
const resolvedVersion = resolveCatalogBackedDependencyVersion({
|
|
34352
|
-
rootDirectory: directory,
|
|
34353
|
-
rootPackageJson: packageJson,
|
|
34354
|
-
packageName,
|
|
34355
|
-
version
|
|
34356
|
-
});
|
|
34357
|
-
if (packageName === MOBX_REACT_PACKAGE_NAME) {
|
|
34358
|
-
facts.mobxReactVersion = facts.hasMobxReact ? selectOldestDependencyVersion(facts.mobxReactVersion, resolvedVersion) : resolvedVersion;
|
|
34359
|
-
facts.hasMobxReact = true;
|
|
34360
|
-
return;
|
|
34361
|
-
}
|
|
34362
|
-
facts.mobxReactLiteVersion = facts.hasMobxReactLite ? selectOldestDependencyVersion(facts.mobxReactLiteVersion, resolvedVersion) : resolvedVersion;
|
|
34363
|
-
facts.hasMobxReactLite = true;
|
|
34364
|
-
};
|
|
34365
|
-
const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, rootPackageJson) => {
|
|
34194
|
+
const evaluateManifestFacts = (facts, packageJson, directory) => {
|
|
34366
34195
|
if (facts.expo.version === null) {
|
|
34367
34196
|
const spec = getDependencySpec(packageJson, "expo");
|
|
34368
34197
|
if (spec !== null) facts.expo = {
|
|
@@ -34384,113 +34213,13 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34384
34213
|
sourceDirectory: directory
|
|
34385
34214
|
};
|
|
34386
34215
|
}
|
|
34387
|
-
const mobxSpec = getDependencySpec(packageJson, "mobx");
|
|
34388
|
-
if (mobxSpec !== null) {
|
|
34389
|
-
const nextMobxFact = {
|
|
34390
|
-
version: resolveCatalogBackedDependencyVersion({
|
|
34391
|
-
rootDirectory: directory,
|
|
34392
|
-
rootPackageJson: packageJson,
|
|
34393
|
-
packageName: "mobx",
|
|
34394
|
-
version: mobxSpec
|
|
34395
|
-
}),
|
|
34396
|
-
sourceDirectory: directory
|
|
34397
|
-
};
|
|
34398
|
-
if (shouldReplaceMobxFact(facts.mobx, nextMobxFact)) facts.mobx = nextMobxFact;
|
|
34399
|
-
}
|
|
34400
|
-
collectBindingVersion(facts, packageJson, directory, MOBX_REACT_PACKAGE_NAME);
|
|
34401
|
-
collectBindingVersion(facts, packageJson, directory, MOBX_REACT_LITE_PACKAGE_NAME);
|
|
34402
|
-
facts.hasMobxStateTree = facts.hasMobxStateTree || getDependencySpec(packageJson, MOBX_STATE_TREE_PACKAGE_NAME) !== null;
|
|
34403
|
-
facts.hasMobxReactObserver = facts.hasMobxReactObserver || getDependencySpec(packageJson, MOBX_REACT_OBSERVER_PACKAGE_NAME) !== null;
|
|
34404
|
-
const zustandSpec = getDependencySpec(packageJson, "zustand");
|
|
34405
|
-
if (zustandSpec !== null) {
|
|
34406
|
-
const nextZustandFact = {
|
|
34407
|
-
version: resolveCatalogBackedDependencyVersion({
|
|
34408
|
-
rootDirectory: directory,
|
|
34409
|
-
rootPackageJson: packageJson,
|
|
34410
|
-
packageName: "zustand",
|
|
34411
|
-
version: zustandSpec
|
|
34412
|
-
}),
|
|
34413
|
-
sourceDirectory: directory
|
|
34414
|
-
};
|
|
34415
|
-
if (shouldReplaceSupportedDependencyFact(facts.zustand, nextZustandFact, 5)) facts.zustand = nextZustandFact;
|
|
34416
|
-
}
|
|
34417
34216
|
if (facts.reanimatedVersion === null) {
|
|
34418
34217
|
const spec = getDependencySpec(packageJson, REANIMATED_DEPENDENCY_NAME);
|
|
34419
34218
|
if (spec !== null) facts.reanimatedVersion = spec;
|
|
34420
34219
|
}
|
|
34421
|
-
if (facts.valtioVersion === null) {
|
|
34422
|
-
const spec = getDependencySpec(packageJson, "valtio");
|
|
34423
|
-
if (spec !== null) facts.valtioVersion = spec;
|
|
34424
|
-
}
|
|
34425
|
-
facts.tanstackQueryVersion ??= getTanStackQueryVersion(packageJson);
|
|
34426
|
-
const styledComponentsVersion = resolveCatalogBackedDependencyVersion({
|
|
34427
|
-
rootDirectory: directory,
|
|
34428
|
-
rootPackageJson: packageJson,
|
|
34429
|
-
packageName: "styled-components",
|
|
34430
|
-
version: getStyledComponentsVersion(packageJson)
|
|
34431
|
-
});
|
|
34432
|
-
if (styledComponentsVersion && shouldReplaceStyledComponentsVersion(facts.styledComponentsVersion, styledComponentsVersion)) facts.styledComponentsVersion = styledComponentsVersion;
|
|
34433
|
-
facts.hasI18nLibrary = facts.hasI18nLibrary || hasI18nDependency(packageJson);
|
|
34434
|
-
for (const packageName of REACT_THREE_FIBER_DEPENDENCY_NAMES) {
|
|
34435
|
-
const version = resolveCatalogBackedDependencyVersion({
|
|
34436
|
-
rootDirectory,
|
|
34437
|
-
rootPackageJson,
|
|
34438
|
-
sourceDirectory: directory,
|
|
34439
|
-
sourcePackageJson: packageJson,
|
|
34440
|
-
packageName,
|
|
34441
|
-
version: getDependencyDeclaration({
|
|
34442
|
-
packageName,
|
|
34443
|
-
packageJson,
|
|
34444
|
-
sections: REACT_THREE_FIBER_SECTIONS
|
|
34445
|
-
}).version
|
|
34446
|
-
});
|
|
34447
|
-
if (version === null) continue;
|
|
34448
|
-
if (shouldReplaceWithLowerMajor(facts.reactThreeFiber.version, version)) facts.reactThreeFiber = {
|
|
34449
|
-
packageName,
|
|
34450
|
-
version,
|
|
34451
|
-
sourceDirectory: directory
|
|
34452
|
-
};
|
|
34453
|
-
}
|
|
34454
|
-
const threeVersion = resolveCatalogBackedDependencyVersion({
|
|
34455
|
-
rootDirectory,
|
|
34456
|
-
rootPackageJson,
|
|
34457
|
-
sourceDirectory: directory,
|
|
34458
|
-
sourcePackageJson: packageJson,
|
|
34459
|
-
packageName: "three",
|
|
34460
|
-
version: getDependencyDeclaration({
|
|
34461
|
-
packageName: "three",
|
|
34462
|
-
packageJson,
|
|
34463
|
-
sections: THREE_DEPENDENCY_SECTIONS
|
|
34464
|
-
}).version
|
|
34465
|
-
});
|
|
34466
|
-
if (threeVersion !== null) {
|
|
34467
|
-
const currentRelease = parseThreeRelease(facts.threeVersion);
|
|
34468
|
-
const nextRelease = parseThreeRelease(threeVersion);
|
|
34469
|
-
if (facts.threeVersion === null || nextRelease !== null && (currentRelease === null || nextRelease < currentRelease)) facts.threeVersion = threeVersion;
|
|
34470
|
-
}
|
|
34471
34220
|
facts.hasReactNativeAwarePackage = facts.hasReactNativeAwarePackage || isPackageJsonReactNativeAware(packageJson);
|
|
34472
34221
|
facts.hasReanimatedAwarePackage = facts.hasReanimatedAwarePackage || isPackageJsonReanimatedAware(packageJson);
|
|
34473
34222
|
facts.hasSsrDependency = facts.hasSsrDependency || isPackageJsonSsrAware(packageJson);
|
|
34474
|
-
const remotionSpec = getDependencySpec(packageJson, "remotion");
|
|
34475
|
-
if (remotionSpec !== null) {
|
|
34476
|
-
facts.hasRemotionDependency = true;
|
|
34477
|
-
const resolvedRemotionVersion = resolveCatalogBackedDependencyVersion({
|
|
34478
|
-
rootDirectory,
|
|
34479
|
-
rootPackageJson,
|
|
34480
|
-
packageName: "remotion",
|
|
34481
|
-
version: remotionSpec
|
|
34482
|
-
});
|
|
34483
|
-
const remotionMajorVersion = resolvedRemotionVersion === null ? null : getLowestDependencyMajor(resolvedRemotionVersion);
|
|
34484
|
-
if (remotionMajorVersion === null) {
|
|
34485
|
-
facts.hasUnknownRemotionVersion = true;
|
|
34486
|
-
facts.remotionVersion = null;
|
|
34487
|
-
} else if (!facts.hasUnknownRemotionVersion) {
|
|
34488
|
-
const currentRemotionMajorVersion = facts.remotionVersion === null ? null : getLowestDependencyMajor(facts.remotionVersion);
|
|
34489
|
-
if (currentRemotionMajorVersion === null || remotionMajorVersion < currentRemotionMajorVersion) facts.remotionVersion = resolvedRemotionVersion;
|
|
34490
|
-
}
|
|
34491
|
-
}
|
|
34492
|
-
facts.hasThree = facts.hasThree || THREE_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
|
|
34493
|
-
facts.hasReactThreeFiber = facts.hasReactThreeFiber || REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
|
|
34494
34223
|
};
|
|
34495
34224
|
const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGroup }) => {
|
|
34496
34225
|
const facts = {
|
|
@@ -34510,41 +34239,12 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34510
34239
|
version: null,
|
|
34511
34240
|
sourceDirectory: null
|
|
34512
34241
|
},
|
|
34513
|
-
valtioVersion: null,
|
|
34514
|
-
mobx: {
|
|
34515
|
-
version: null,
|
|
34516
|
-
sourceDirectory: null
|
|
34517
|
-
},
|
|
34518
|
-
hasMobxReact: false,
|
|
34519
|
-
mobxReactVersion: null,
|
|
34520
|
-
hasMobxReactLite: false,
|
|
34521
|
-
mobxReactLiteVersion: null,
|
|
34522
|
-
hasMobxStateTree: false,
|
|
34523
|
-
hasMobxReactObserver: false,
|
|
34524
|
-
zustand: {
|
|
34525
|
-
version: null,
|
|
34526
|
-
sourceDirectory: null
|
|
34527
|
-
},
|
|
34528
|
-
tanstackQueryVersion: null,
|
|
34529
|
-
styledComponentsVersion: null,
|
|
34530
|
-
hasI18nLibrary: false,
|
|
34531
34242
|
hasReactNativeAwarePackage: false,
|
|
34532
34243
|
hasReanimatedAwarePackage: false,
|
|
34533
34244
|
hasSsrDependency: false,
|
|
34534
|
-
hasRemotionDependency: false,
|
|
34535
|
-
hasUnknownRemotionVersion: false,
|
|
34536
|
-
remotionVersion: null,
|
|
34537
|
-
hasThree: false,
|
|
34538
|
-
threeVersion: null,
|
|
34539
|
-
hasReactThreeFiber: false,
|
|
34540
|
-
reactThreeFiber: {
|
|
34541
|
-
packageName: null,
|
|
34542
|
-
version: null,
|
|
34543
|
-
sourceDirectory: null
|
|
34544
|
-
},
|
|
34545
34245
|
reanimatedVersion: null
|
|
34546
34246
|
};
|
|
34547
|
-
evaluateManifestFacts(facts, rootPackageJson, rootDirectory
|
|
34247
|
+
evaluateManifestFacts(facts, rootPackageJson, rootDirectory);
|
|
34548
34248
|
let isReactGroupSettled = !collectReactGroup;
|
|
34549
34249
|
const visitedDirectories = /* @__PURE__ */ new Set();
|
|
34550
34250
|
for (const pattern of getWorkspacePatterns(rootDirectory, rootPackageJson)) {
|
|
@@ -34553,7 +34253,7 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34553
34253
|
if (visitedDirectories.has(workspaceDirectory)) continue;
|
|
34554
34254
|
visitedDirectories.add(workspaceDirectory);
|
|
34555
34255
|
const workspacePackageJson = readPackageJson(Path.join(workspaceDirectory, "package.json"));
|
|
34556
|
-
evaluateManifestFacts(facts, workspacePackageJson, workspaceDirectory
|
|
34256
|
+
evaluateManifestFacts(facts, workspacePackageJson, workspaceDirectory);
|
|
34557
34257
|
const info = extractDependencyInfo(workspacePackageJson);
|
|
34558
34258
|
if (info.framework !== "unknown" && frameworkMergeRank(info.framework) < frameworkMergeRank(facts.framework)) facts.framework = info.framework;
|
|
34559
34259
|
if (isReactGroupSettled) continue;
|
|
@@ -34584,7 +34284,7 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34584
34284
|
workspaceDirectory,
|
|
34585
34285
|
workspacePackageJson
|
|
34586
34286
|
});
|
|
34587
|
-
if (reactVersion &&
|
|
34287
|
+
if (reactVersion && shouldReplaceReactVersion(facts.reactVersion, reactVersion)) facts.reactVersion = reactVersion;
|
|
34588
34288
|
if (tailwindVersion && !facts.tailwindVersion) facts.tailwindVersion = tailwindVersion;
|
|
34589
34289
|
if (zodVersion && !facts.zodVersion) facts.zodVersion = zodVersion;
|
|
34590
34290
|
const settledReactMajor = parseReactMajor(facts.reactVersion);
|
|
@@ -34777,35 +34477,11 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
34777
34477
|
tailwindVersion: null,
|
|
34778
34478
|
zodVersion: null,
|
|
34779
34479
|
zodMajorVersion: null,
|
|
34780
|
-
mobxVersion: null,
|
|
34781
|
-
mobxMajorVersion: null,
|
|
34782
|
-
hasMobxReact: false,
|
|
34783
|
-
mobxReactVersion: null,
|
|
34784
|
-
hasMobxReactLite: false,
|
|
34785
|
-
mobxReactLiteVersion: null,
|
|
34786
|
-
hasMobxStateTree: false,
|
|
34787
|
-
hasMobxReactObserver: false,
|
|
34788
|
-
zustandVersion: null,
|
|
34789
|
-
zustandMajorVersion: null,
|
|
34790
34480
|
framework: "unknown",
|
|
34791
34481
|
hasTypeScript: hasOwnTsConfig,
|
|
34792
34482
|
hasReactCompiler: false,
|
|
34793
34483
|
hasReactCompilerLintPlugin: false,
|
|
34794
34484
|
hasTanStackQuery: false,
|
|
34795
|
-
valtioVersion: null,
|
|
34796
|
-
valtioMajorVersion: null,
|
|
34797
|
-
hasRemotion: false,
|
|
34798
|
-
remotionVersion: null,
|
|
34799
|
-
remotionMajorVersion: null,
|
|
34800
|
-
hasI18nLibrary: false,
|
|
34801
|
-
tanstackQueryVersion: null,
|
|
34802
|
-
styledComponentsVersion: null,
|
|
34803
|
-
hasThree: false,
|
|
34804
|
-
threeVersion: null,
|
|
34805
|
-
threeRelease: null,
|
|
34806
|
-
hasReactThreeFiber: false,
|
|
34807
|
-
reactThreeFiberVersion: null,
|
|
34808
|
-
reactThreeFiberMajorVersion: null,
|
|
34809
34485
|
hasSsrDependency: false,
|
|
34810
34486
|
preactVersion: null,
|
|
34811
34487
|
preactMajorVersion: null,
|
|
@@ -34904,12 +34580,6 @@ const discoverProject = (directory) => {
|
|
|
34904
34580
|
packageName: SHOPIFY_FLASH_LIST_PACKAGE_NAME,
|
|
34905
34581
|
version: workspaceFacts.shopifyFlashList.version
|
|
34906
34582
|
}) : null;
|
|
34907
|
-
const zustandVersion = resolveCatalogBackedDependencyVersion({
|
|
34908
|
-
rootDirectory: directory,
|
|
34909
|
-
rootPackageJson: packageJson,
|
|
34910
|
-
packageName: "zustand",
|
|
34911
|
-
version: workspaceFacts.zustand.version
|
|
34912
|
-
});
|
|
34913
34583
|
const hasReanimated = hasReactNativeWorkspace && workspaceFacts.hasReanimatedAwarePackage;
|
|
34914
34584
|
const reanimatedVersion = hasReanimated ? workspaceFacts.reanimatedVersion : null;
|
|
34915
34585
|
const nextjsVersion = framework === "nextjs" ? resolveCatalogBackedDependencyVersion({
|
|
@@ -34918,33 +34588,7 @@ const discoverProject = (directory) => {
|
|
|
34918
34588
|
packageName: "next",
|
|
34919
34589
|
version: workspaceFacts.next.version
|
|
34920
34590
|
}) : null;
|
|
34921
|
-
const valtioVersion = resolveCatalogBackedDependencyVersion({
|
|
34922
|
-
rootDirectory: directory,
|
|
34923
|
-
rootPackageJson: packageJson,
|
|
34924
|
-
packageName: "valtio",
|
|
34925
|
-
version: workspaceFacts.valtioVersion
|
|
34926
|
-
});
|
|
34927
|
-
const mobxVersion = resolveCatalogBackedDependencyVersion({
|
|
34928
|
-
rootDirectory: directory,
|
|
34929
|
-
rootPackageJson: packageJson,
|
|
34930
|
-
packageName: "mobx",
|
|
34931
|
-
version: workspaceFacts.mobx.version
|
|
34932
|
-
});
|
|
34933
34591
|
const preactVersion = getPreactVersion(packageJson);
|
|
34934
|
-
const remotionVersion = workspaceFacts.remotionVersion;
|
|
34935
|
-
const tanstackQueryVersion = getTanStackQueryVersion(packageJson) ?? workspaceFacts.tanstackQueryVersion;
|
|
34936
|
-
const reactThreeFiberVersion = workspaceFacts.reactThreeFiber.packageName ? resolveCatalogBackedDependencyVersion({
|
|
34937
|
-
rootDirectory: directory,
|
|
34938
|
-
rootPackageJson: packageJson,
|
|
34939
|
-
packageName: workspaceFacts.reactThreeFiber.packageName,
|
|
34940
|
-
version: workspaceFacts.reactThreeFiber.version
|
|
34941
|
-
}) : null;
|
|
34942
|
-
const threeVersion = resolveCatalogBackedDependencyVersion({
|
|
34943
|
-
rootDirectory: directory,
|
|
34944
|
-
rootPackageJson: packageJson,
|
|
34945
|
-
packageName: "three",
|
|
34946
|
-
version: workspaceFacts.threeVersion
|
|
34947
|
-
});
|
|
34948
34592
|
const isPreES2023Target = hasTypeScript && detectPreES2023Target(directory);
|
|
34949
34593
|
const projectInfo = {
|
|
34950
34594
|
rootDirectory: directory,
|
|
@@ -34954,35 +34598,11 @@ const discoverProject = (directory) => {
|
|
|
34954
34598
|
tailwindVersion,
|
|
34955
34599
|
zodVersion,
|
|
34956
34600
|
zodMajorVersion: zodVersion === null ? null : getLowestDependencyMajor(zodVersion),
|
|
34957
|
-
mobxVersion,
|
|
34958
|
-
mobxMajorVersion: mobxVersion === null ? null : getDependencyMajorWithinSupportedRange(mobxVersion, 6),
|
|
34959
|
-
hasMobxReact: workspaceFacts.hasMobxReact,
|
|
34960
|
-
mobxReactVersion: workspaceFacts.mobxReactVersion,
|
|
34961
|
-
hasMobxReactLite: workspaceFacts.hasMobxReactLite,
|
|
34962
|
-
mobxReactLiteVersion: workspaceFacts.mobxReactLiteVersion,
|
|
34963
|
-
hasMobxStateTree: workspaceFacts.hasMobxStateTree,
|
|
34964
|
-
hasMobxReactObserver: workspaceFacts.hasMobxReactObserver,
|
|
34965
|
-
zustandVersion,
|
|
34966
|
-
zustandMajorVersion: zustandVersion === null ? null : getLowestDependencyMajor(zustandVersion),
|
|
34967
34601
|
framework,
|
|
34968
34602
|
hasTypeScript,
|
|
34969
34603
|
hasReactCompiler: detectReactCompiler(directory, packageJson),
|
|
34970
34604
|
hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
|
|
34971
|
-
hasTanStackQuery:
|
|
34972
|
-
hasI18nLibrary: workspaceFacts.hasI18nLibrary,
|
|
34973
|
-
tanstackQueryVersion,
|
|
34974
|
-
styledComponentsVersion: workspaceFacts.styledComponentsVersion,
|
|
34975
|
-
valtioVersion,
|
|
34976
|
-
valtioMajorVersion: valtioVersion === null ? null : getLowestDependencyMajor(valtioVersion),
|
|
34977
|
-
hasRemotion: workspaceFacts.hasRemotionDependency,
|
|
34978
|
-
remotionVersion,
|
|
34979
|
-
remotionMajorVersion: remotionVersion === null ? null : getLowestDependencyMajor(remotionVersion),
|
|
34980
|
-
hasThree: workspaceFacts.hasThree,
|
|
34981
|
-
threeVersion,
|
|
34982
|
-
threeRelease: parseThreeRelease(threeVersion),
|
|
34983
|
-
hasReactThreeFiber: workspaceFacts.hasReactThreeFiber,
|
|
34984
|
-
reactThreeFiberVersion,
|
|
34985
|
-
reactThreeFiberMajorVersion: reactThreeFiberVersion === null ? null : getLowestDependencyMajor(reactThreeFiberVersion),
|
|
34605
|
+
hasTanStackQuery: hasTanStackQuery(packageJson),
|
|
34986
34606
|
hasSsrDependency: workspaceFacts.hasSsrDependency,
|
|
34987
34607
|
preactVersion,
|
|
34988
34608
|
preactMajorVersion: parseReactMajor(preactVersion),
|
|
@@ -38183,10 +37803,10 @@ const SSR_FRAMEWORKS = new Set([
|
|
|
38183
37803
|
"gatsby",
|
|
38184
37804
|
"tanstack-start"
|
|
38185
37805
|
]);
|
|
38186
|
-
const
|
|
38187
|
-
if (
|
|
38188
|
-
const
|
|
38189
|
-
for (let candidate = earliest; candidate <=
|
|
37806
|
+
const addMajorLadder = (capabilities, name, major, earliest, latest) => {
|
|
37807
|
+
if (major === null) return;
|
|
37808
|
+
const cappedMajor = Math.min(major, latest);
|
|
37809
|
+
for (let candidate = earliest; candidate <= cappedMajor; candidate += 1) capabilities.add(`${name}:${candidate}`);
|
|
38190
37810
|
};
|
|
38191
37811
|
const buildCapabilities = (project) => {
|
|
38192
37812
|
const capabilities = /* @__PURE__ */ new Set();
|
|
@@ -38199,77 +37819,24 @@ const buildCapabilities = (project) => {
|
|
|
38199
37819
|
if (CLIENT_ONLY_FRAMEWORKS.has(project.framework)) capabilities.add("client-only");
|
|
38200
37820
|
if (project.isStaticExport) capabilities.add("nextjs:static-export");
|
|
38201
37821
|
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
|
|
38202
|
-
|
|
38203
|
-
addVersionCapabilityLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
|
|
37822
|
+
addMajorLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
|
|
38204
37823
|
if (project.reactMajorVersion !== null && project.reactMajorVersion >= 19 && isMajorMinorAtLeast(parseReactMajorMinor(project.reactVersion), {
|
|
38205
37824
|
major: 19,
|
|
38206
37825
|
minor: 2
|
|
38207
37826
|
})) capabilities.add("react:19.2");
|
|
38208
|
-
if (project.tailwindVersion !== null)
|
|
38209
|
-
|
|
38210
|
-
|
|
38211
|
-
|
|
38212
|
-
|
|
38213
|
-
minor: 4
|
|
38214
|
-
})) capabilities.add("tailwind:3.4");
|
|
38215
|
-
if (tailwindVersion !== null && isMajorMinorAtLeast(tailwindVersion, {
|
|
38216
|
-
major: 4,
|
|
38217
|
-
minor: 0
|
|
38218
|
-
})) capabilities.add("tailwind:4");
|
|
38219
|
-
}
|
|
37827
|
+
if (project.tailwindVersion !== null) capabilities.add("tailwind");
|
|
37828
|
+
if (project.tailwindVersion !== null && isMajorMinorAtLeast(parseTailwindMajorMinor(project.tailwindVersion), {
|
|
37829
|
+
major: 3,
|
|
37830
|
+
minor: 4
|
|
37831
|
+
})) capabilities.add("tailwind:3.4");
|
|
38220
37832
|
if (project.zodVersion !== null) capabilities.add("zod");
|
|
38221
37833
|
if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
|
|
38222
|
-
if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
|
|
38223
|
-
if (project.hasMobxReact === true) capabilities.add("mobx-react");
|
|
38224
|
-
if (project.hasMobxReactLite === true) capabilities.add("mobx-react-lite");
|
|
38225
|
-
if (project.hasMobxReact === true || project.hasMobxReactLite === true) capabilities.add("mobx-react-binding");
|
|
38226
|
-
const mobxReactVersion = parseDependencyMajorMinor(project.mobxReactVersion);
|
|
38227
|
-
const mobxReactLiteVersion = parseDependencyMajorMinor(project.mobxReactLiteVersion);
|
|
38228
|
-
const hasMobxReactObserverMemoGuard = mobxReactVersion !== null && isMajorMinorAtLeast(mobxReactVersion, {
|
|
38229
|
-
major: 7,
|
|
38230
|
-
minor: 3
|
|
38231
|
-
});
|
|
38232
|
-
const hasMobxReactLiteObserverMemoGuard = mobxReactLiteVersion !== null && isMajorMinorAtLeast(mobxReactLiteVersion, {
|
|
38233
|
-
major: 3,
|
|
38234
|
-
minor: 3
|
|
38235
|
-
});
|
|
38236
|
-
if (hasMobxReactObserverMemoGuard) capabilities.add("mobx-react-observer-memo-guard");
|
|
38237
|
-
if (hasMobxReactLiteObserverMemoGuard) capabilities.add("mobx-react-lite-observer-memo-guard");
|
|
38238
|
-
if (hasMobxReactObserverMemoGuard || hasMobxReactLiteObserverMemoGuard) capabilities.add("mobx-react-binding-observer-memo-guard");
|
|
38239
|
-
if (project.hasMobxStateTree === true) capabilities.add("mobx-state-tree");
|
|
38240
|
-
if (project.hasMobxReactObserver === true) capabilities.add("mobx-react-observer");
|
|
38241
|
-
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6) addVersionCapabilityLadder(capabilities, "mobx", project.mobxMajorVersion, 4, 6);
|
|
38242
|
-
const mobxVersion = parseDependencyMajorMinor(project.mobxVersion);
|
|
38243
|
-
if (project.mobxMajorVersion === 6 && mobxVersion !== null && isMajorMinorAtLeast(mobxVersion, {
|
|
38244
|
-
major: 6,
|
|
38245
|
-
minor: 10
|
|
38246
|
-
})) capabilities.add("mobx:6.10");
|
|
38247
|
-
if (project.zustandVersion !== void 0 && project.zustandVersion !== null) capabilities.add("zustand");
|
|
38248
|
-
if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5) addVersionCapabilityLadder(capabilities, "zustand", project.zustandMajorVersion, 1, 5);
|
|
38249
37834
|
if (project.isPreES2023Target) capabilities.add("pre-es2023");
|
|
38250
37835
|
if (project.hasReactCompiler) capabilities.add("react-compiler");
|
|
38251
|
-
if (
|
|
38252
|
-
if (project.styledComponentsVersion) {
|
|
38253
|
-
capabilities.add("styled-components");
|
|
38254
|
-
const styledComponentsMajor = getLowestDependencyMajor(project.styledComponentsVersion);
|
|
38255
|
-
if (styledComponentsMajor !== null && styledComponentsMajor >= 6) capabilities.add("styled-components:6");
|
|
38256
|
-
}
|
|
38257
|
-
if (project.hasI18nLibrary) capabilities.add("i18n");
|
|
38258
|
-
if (project.valtioVersion !== null) capabilities.add("valtio");
|
|
38259
|
-
addVersionCapabilityLadder(capabilities, "valtio", project.valtioMajorVersion, 1, 10);
|
|
38260
|
-
if (project.hasRemotion) {
|
|
38261
|
-
capabilities.add("remotion");
|
|
38262
|
-
addVersionCapabilityLadder(capabilities, "remotion", project.remotionMajorVersion ?? null, 4, 30);
|
|
38263
|
-
}
|
|
38264
|
-
if (project.hasThree || project.hasReactThreeFiber) capabilities.add("three");
|
|
38265
|
-
addVersionCapabilityLadder(capabilities, "three", project.threeRelease ?? null, 145, 250);
|
|
38266
|
-
if (project.hasReactThreeFiber) {
|
|
38267
|
-
capabilities.add("r3f");
|
|
38268
|
-
addVersionCapabilityLadder(capabilities, "r3f", project.reactThreeFiberMajorVersion ?? null, 3, 10);
|
|
38269
|
-
}
|
|
37836
|
+
if (project.hasTanStackQuery) capabilities.add("tanstack-query");
|
|
38270
37837
|
if (project.hasTypeScript) capabilities.add("typescript");
|
|
38271
37838
|
if (project.preactVersion !== null) capabilities.add("preact");
|
|
38272
|
-
|
|
37839
|
+
addMajorLadder(capabilities, "preact", project.preactMajorVersion, 10, 20);
|
|
38273
37840
|
if (project.preactVersion !== null && project.reactVersion === null) capabilities.add("pure-preact");
|
|
38274
37841
|
return capabilities;
|
|
38275
37842
|
};
|
|
@@ -38281,7 +37848,7 @@ const getCapabilities = (project) => {
|
|
|
38281
37848
|
capabilitiesByProject.set(project, capabilities);
|
|
38282
37849
|
return capabilities;
|
|
38283
37850
|
};
|
|
38284
|
-
const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhen
|
|
37851
|
+
const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhen) => {
|
|
38285
37852
|
if (requires) {
|
|
38286
37853
|
for (const capability of requires) if (!capabilities.has(capability)) return false;
|
|
38287
37854
|
}
|
|
@@ -38292,29 +37859,20 @@ const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhe
|
|
|
38292
37859
|
if (tags) {
|
|
38293
37860
|
for (const tag of tags) if (ignoredTags.has(tag)) return false;
|
|
38294
37861
|
}
|
|
38295
|
-
if (includedTags && includedTags.size > 0) {
|
|
38296
|
-
if (!tags?.some((tag) => includedTags.has(tag))) return false;
|
|
38297
|
-
}
|
|
38298
37862
|
return true;
|
|
38299
37863
|
};
|
|
38300
|
-
const shouldEnableRuleByDefaultStatus = (options) => options.defaultEnabled !== false || options.hasExplicitOverride === true || options.includeTagDefaults && options.hasIncludedTags;
|
|
38301
37864
|
const yieldToEventLoop = () => new Promise((resolve) => {
|
|
38302
37865
|
setImmediate(resolve);
|
|
38303
37866
|
});
|
|
38304
37867
|
const createSecurityScanSession = (rootDirectory, options) => {
|
|
38305
37868
|
const capabilities = options.project ? getCapabilities(options.project) : /* @__PURE__ */ new Set();
|
|
38306
37869
|
const ignoredTags = options.ignoredTags ?? /* @__PURE__ */ new Set();
|
|
38307
|
-
const includedTags = options.includedTags ?? /* @__PURE__ */ new Set();
|
|
38308
37870
|
const enabledScanRules = REACT_DOCTOR_RULES.flatMap((entry) => {
|
|
38309
37871
|
const rule = entry.rule;
|
|
38310
37872
|
const scan = rule.scan;
|
|
38311
37873
|
if (typeof scan !== "function") return [];
|
|
38312
|
-
if (
|
|
38313
|
-
|
|
38314
|
-
includeTagDefaults: options.includeTagDefaults === true,
|
|
38315
|
-
hasIncludedTags: includedTags.size > 0
|
|
38316
|
-
})) return [];
|
|
38317
|
-
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen, includedTags)) return [];
|
|
37874
|
+
if (rule.defaultEnabled === false) return [];
|
|
37875
|
+
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen)) return [];
|
|
38318
37876
|
return [{
|
|
38319
37877
|
entry,
|
|
38320
37878
|
scan,
|
|
@@ -40300,9 +39858,8 @@ const buildUserPluginRules = (userPlugin, severityControls) => {
|
|
|
40300
39858
|
}
|
|
40301
39859
|
return enabled;
|
|
40302
39860
|
};
|
|
40303
|
-
const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(),
|
|
40304
|
-
const
|
|
40305
|
-
const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" || hasIncludedTags ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
|
|
39861
|
+
const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(), serverAuthFunctionNames, severityControls, userPlugins = [], disableReactHooksJsPlugin = false, ruleSelection, sidecarRuleIdFilter }) => {
|
|
39862
|
+
const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
|
|
40306
39863
|
const reactCompilerRules = reactHooksJsPlugin ? applyRuleSeverityControls(filterRulesToAvailable(REACT_COMPILER_RULES, "react-hooks-js", reactHooksJsPlugin.availableRuleNames), severityControls) : {};
|
|
40307
39864
|
const jsPlugins = [];
|
|
40308
39865
|
if (reactHooksJsPlugin) jsPlugins.push(reactHooksJsPlugin.entry);
|
|
@@ -40317,14 +39874,9 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
40317
39874
|
if (rule.scan !== void 0) continue;
|
|
40318
39875
|
if (customRulesOnly && registryEntry.originallyExternal) continue;
|
|
40319
39876
|
if (rule.framework !== "global" && !rule.requires) continue;
|
|
40320
|
-
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen
|
|
39877
|
+
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen)) continue;
|
|
40321
39878
|
const explicitRuleOverride = resolveRuleSeverityOverride({ ruleKey: registryEntry.key }, severityControls);
|
|
40322
|
-
if (
|
|
40323
|
-
defaultEnabled: rule.defaultEnabled,
|
|
40324
|
-
includeTagDefaults,
|
|
40325
|
-
hasIncludedTags,
|
|
40326
|
-
hasExplicitOverride: explicitRuleOverride !== void 0
|
|
40327
|
-
})) continue;
|
|
39879
|
+
if (rule.defaultEnabled === false && explicitRuleOverride === void 0) continue;
|
|
40328
39880
|
const severity = resolveRuleSeverityOverride({
|
|
40329
39881
|
ruleKey: registryEntry.key,
|
|
40330
39882
|
category: rule.category
|
|
@@ -40333,7 +39885,7 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
40333
39885
|
enabledReactDoctorRules[registryEntry.key] = severity;
|
|
40334
39886
|
}
|
|
40335
39887
|
const userPluginRules = {};
|
|
40336
|
-
if (ruleSelection !== "sidecar"
|
|
39888
|
+
if (ruleSelection !== "sidecar") for (const userPlugin of userPlugins) {
|
|
40337
39889
|
Object.assign(userPluginRules, buildUserPluginRules(userPlugin, severityControls));
|
|
40338
39890
|
jsPlugins.push(userPlugin.entry);
|
|
40339
39891
|
}
|
|
@@ -40550,19 +40102,6 @@ const createSidecarLintCache = (cacheDirectory, rulesetHash) => {
|
|
|
40550
40102
|
}
|
|
40551
40103
|
};
|
|
40552
40104
|
};
|
|
40553
|
-
const fingerprintCacheByFilePath = /* @__PURE__ */ new Map();
|
|
40554
|
-
const fingerprintFileContents = (filePath, fingerprintLength) => {
|
|
40555
|
-
const fileStats = NFS.statSync(filePath, { bigint: true });
|
|
40556
|
-
const cachedFingerprint = fingerprintCacheByFilePath.get(filePath);
|
|
40557
|
-
if (cachedFingerprint?.modifiedTimeNanoseconds === fileStats.mtimeNs && cachedFingerprint.sizeBytes === fileStats.size) return cachedFingerprint.fingerprint;
|
|
40558
|
-
const fingerprint = crypto.createHash("sha256").update(NFS.readFileSync(filePath)).digest("hex").slice(0, fingerprintLength);
|
|
40559
|
-
fingerprintCacheByFilePath.set(filePath, {
|
|
40560
|
-
fingerprint,
|
|
40561
|
-
modifiedTimeNanoseconds: fileStats.mtimeNs,
|
|
40562
|
-
sizeBytes: fileStats.size
|
|
40563
|
-
});
|
|
40564
|
-
return fingerprint;
|
|
40565
|
-
};
|
|
40566
40105
|
const bundledRequire = createRequire(import.meta.url);
|
|
40567
40106
|
const childNodeVersionByBinaryPath = /* @__PURE__ */ new Map();
|
|
40568
40107
|
const resolveChildNodeVersion = (nodeBinaryPath) => {
|
|
@@ -40586,13 +40125,6 @@ const TOOLCHAIN_PACKAGE_SPECIFIERS = [
|
|
|
40586
40125
|
"oxlint-plugin-react-doctor/package.json",
|
|
40587
40126
|
"eslint-plugin-react-hooks/package.json"
|
|
40588
40127
|
];
|
|
40589
|
-
const resolvePluginFingerprint = () => {
|
|
40590
|
-
try {
|
|
40591
|
-
return fingerprintFileContents(bundledRequire.resolve("oxlint-plugin-react-doctor"), 16);
|
|
40592
|
-
} catch {
|
|
40593
|
-
return "unresolved";
|
|
40594
|
-
}
|
|
40595
|
-
};
|
|
40596
40128
|
const resolveOxlintToolchainVersions = (nodeBinaryPath = process.execPath) => {
|
|
40597
40129
|
const versions = [`node=${resolveChildNodeVersion(nodeBinaryPath)}`];
|
|
40598
40130
|
for (const specifier of TOOLCHAIN_PACKAGE_SPECIFIERS) try {
|
|
@@ -40602,7 +40134,6 @@ const resolveOxlintToolchainVersions = (nodeBinaryPath = process.execPath) => {
|
|
|
40602
40134
|
} catch {
|
|
40603
40135
|
versions.push(`${specifier}=missing`);
|
|
40604
40136
|
}
|
|
40605
|
-
versions.push(`oxlint-plugin-react-doctor#fingerprint=${resolvePluginFingerprint()}`);
|
|
40606
40137
|
return versions;
|
|
40607
40138
|
};
|
|
40608
40139
|
const esmRequire = createRequire(import.meta.url);
|
|
@@ -42078,7 +41609,7 @@ const reactHooksJsPluginDropNote = (error) => {
|
|
|
42078
41609
|
* 6. always restore disable directives + clean up the temp dir
|
|
42079
41610
|
*/
|
|
42080
41611
|
const runOxlint = async (options) => {
|
|
42081
|
-
const { rootDirectory, project, includePaths, nodeBinaryPath = process.execPath, customRulesOnly = false, respectInlineDisables = true, adoptExistingLintConfig = true, ignoredTags = /* @__PURE__ */ new Set(),
|
|
41612
|
+
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;
|
|
42082
41613
|
const serverAuthFunctionNames = Array.isArray(userConfig?.serverAuthFunctionNames) ? userConfig.serverAuthFunctionNames.filter((entry) => typeof entry === "string" && entry.length > 0) : void 0;
|
|
42083
41614
|
const severityControls = buildRuleSeverityControls(userConfig);
|
|
42084
41615
|
validateRuleRegistration();
|
|
@@ -42092,15 +41623,13 @@ const runOxlint = async (options) => {
|
|
|
42092
41623
|
}
|
|
42093
41624
|
const pluginPath = resolvePluginPath();
|
|
42094
41625
|
const extendsPaths = (adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : []).filter(canOxlintExtendConfig);
|
|
42095
|
-
const userPlugins =
|
|
41626
|
+
const userPlugins = resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
|
|
42096
41627
|
const buildConfig = (overrides) => createOxlintConfig({
|
|
42097
41628
|
pluginPath,
|
|
42098
41629
|
project,
|
|
42099
41630
|
customRulesOnly,
|
|
42100
41631
|
extendsPaths: overrides.extendsPaths,
|
|
42101
41632
|
ignoredTags,
|
|
42102
|
-
includedTags,
|
|
42103
|
-
includeTagDefaults,
|
|
42104
41633
|
serverAuthFunctionNames,
|
|
42105
41634
|
severityControls,
|
|
42106
41635
|
userPlugins,
|
|
@@ -42489,8 +42018,6 @@ var Linter = class Linter extends Service()("react-doctor/Linter") {
|
|
|
42489
42018
|
respectInlineDisables: input.respectInlineDisables,
|
|
42490
42019
|
adoptExistingLintConfig: input.adoptExistingLintConfig,
|
|
42491
42020
|
ignoredTags: input.ignoredTags,
|
|
42492
|
-
includedTags: input.includedTags,
|
|
42493
|
-
includeTagDefaults: input.includeTagDefaults,
|
|
42494
42021
|
userConfig: input.userConfig ?? null,
|
|
42495
42022
|
configSourceDirectory: input.configSourceDirectory,
|
|
42496
42023
|
onPartialFailure: (reason) => {
|
|
@@ -43339,9 +42866,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
43339
42866
|
const securityScanFailedRef = yield* make$13(false);
|
|
43340
42867
|
const securityScanFiber = yield* forkChild(runCollect(applyPerElementPipeline(isDiffMode ? empty$4 : unwrap(tryPromise(() => checkSecurityScanCooperative(scanDirectory, {
|
|
43341
42868
|
project,
|
|
43342
|
-
ignoredTags: input.ignoredTags
|
|
43343
|
-
includedTags: input.includedTags,
|
|
43344
|
-
includeTagDefaults: input.includeTagDefaults
|
|
42869
|
+
ignoredTags: input.ignoredTags
|
|
43345
42870
|
})).pipe(map$3((diagnostics) => fromIterable$1(diagnostics)), catch_$1(() => set(securityScanFailedRef, true).pipe(as(empty$4))))))).pipe(withSpan("SecurityScan.run")));
|
|
43346
42871
|
const shouldRunSupplyChain = !isDiffMode || (input.supplyChainManifestChanged ?? false);
|
|
43347
42872
|
const supplyChainOverlapTimeout = yield* SupplyChainOverlapTimeoutMs;
|
|
@@ -43432,8 +42957,6 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
43432
42957
|
respectInlineDisables: input.respectInlineDisables,
|
|
43433
42958
|
adoptExistingLintConfig: input.adoptExistingLintConfig,
|
|
43434
42959
|
ignoredTags: input.ignoredTags,
|
|
43435
|
-
includedTags: input.includedTags,
|
|
43436
|
-
includeTagDefaults: input.includeTagDefaults,
|
|
43437
42960
|
userConfig: resolvedConfig.config ?? void 0,
|
|
43438
42961
|
configSourceDirectory: resolvedConfig.configSourceDirectory ?? void 0,
|
|
43439
42962
|
onFileProgress: (scannedFileCount, totalFileCount) => {
|
|
@@ -45936,5 +45459,5 @@ const startLanguageServer = () => {
|
|
|
45936
45459
|
};
|
|
45937
45460
|
//#endregion
|
|
45938
45461
|
export { startLanguageServer };
|
|
45939
|
-
!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]="
|
|
45940
|
-
//# debugId=
|
|
45462
|
+
!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]="4cc86e5a-4a16-5fc0-a4e8-998852b4f219")}catch(e){}}();
|
|
45463
|
+
//# debugId=4cc86e5a-4a16-5fc0-a4e8-998852b4f219
|