react-doctor 0.8.1-dev.f5f13b8 → 0.8.1-dev.fc1b3a3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +34 -260
- package/dist/index.d.ts +0 -16
- package/dist/index.js +31 -257
- package/dist/lsp.js +31 -257
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d6c84ba6-2fee-56d3-ba17-e8408ecdedc5")}catch(e){}}();
|
|
3
3
|
import { r as __toESM$1, t as __commonJSMin$1 } from "./chunk-N93fKeF6.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import reactDoctorPlugin, { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_RULES, REACT_DOCTOR_RULES, classifySecurityScanFile, collectCrossFileDependencyProbes, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor";
|
|
@@ -32894,58 +32894,6 @@ const IGNORED_DIRECTORIES = new Set([
|
|
|
32894
32894
|
"storybook-static"
|
|
32895
32895
|
]);
|
|
32896
32896
|
const MILLISECONDS_PER_SECOND = 1e3;
|
|
32897
|
-
const REACT_ROUTER_CAPABILITY_THRESHOLDS = [
|
|
32898
|
-
{
|
|
32899
|
-
capability: "react-router:6.4",
|
|
32900
|
-
major: 6,
|
|
32901
|
-
minor: 4
|
|
32902
|
-
},
|
|
32903
|
-
{
|
|
32904
|
-
capability: "react-router:6.7",
|
|
32905
|
-
major: 6,
|
|
32906
|
-
minor: 7
|
|
32907
|
-
},
|
|
32908
|
-
{
|
|
32909
|
-
capability: "react-router:6.9",
|
|
32910
|
-
major: 6,
|
|
32911
|
-
minor: 9
|
|
32912
|
-
},
|
|
32913
|
-
{
|
|
32914
|
-
capability: "react-router:6.19",
|
|
32915
|
-
major: 6,
|
|
32916
|
-
minor: 19
|
|
32917
|
-
},
|
|
32918
|
-
{
|
|
32919
|
-
capability: "react-router:7",
|
|
32920
|
-
major: 7,
|
|
32921
|
-
minor: 0
|
|
32922
|
-
},
|
|
32923
|
-
{
|
|
32924
|
-
capability: "react-router:7.8",
|
|
32925
|
-
major: 7,
|
|
32926
|
-
minor: 8
|
|
32927
|
-
},
|
|
32928
|
-
{
|
|
32929
|
-
capability: "react-router:7.9",
|
|
32930
|
-
major: 7,
|
|
32931
|
-
minor: 9
|
|
32932
|
-
},
|
|
32933
|
-
{
|
|
32934
|
-
capability: "react-router:7.10",
|
|
32935
|
-
major: 7,
|
|
32936
|
-
minor: 10
|
|
32937
|
-
},
|
|
32938
|
-
{
|
|
32939
|
-
capability: "react-router:7.15",
|
|
32940
|
-
major: 7,
|
|
32941
|
-
minor: 15
|
|
32942
|
-
},
|
|
32943
|
-
{
|
|
32944
|
-
capability: "react-router:8",
|
|
32945
|
-
major: 8,
|
|
32946
|
-
minor: 0
|
|
32947
|
-
}
|
|
32948
|
-
];
|
|
32949
32897
|
const SCORE_API_URL = "https://www.react.doctor/api/score";
|
|
32950
32898
|
const FETCH_TIMEOUT_MS = 1e4;
|
|
32951
32899
|
const GITHUB_VIEWER_PERMISSION_TIMEOUT_MS = 2e3;
|
|
@@ -33542,7 +33490,7 @@ const detectNextjsStaticExport = (directory) => NEXT_CONFIG_FILENAMES.some((file
|
|
|
33542
33490
|
const filePath = Path.join(directory, filename);
|
|
33543
33491
|
return isFile(filePath) && STATIC_EXPORT_OUTPUT_PATTERN.test(NFS.readFileSync(filePath, "utf-8"));
|
|
33544
33492
|
});
|
|
33545
|
-
const UNRESOLVABLE_PROTOCOL_VERSION = /^(?:
|
|
33493
|
+
const UNRESOLVABLE_PROTOCOL_VERSION = /^(?:file|git|github|https?|link|patch|portal|workspace|npm):/i;
|
|
33546
33494
|
const DIST_TAG_VERSION = /^[a-z][a-z0-9._-]*$/i;
|
|
33547
33495
|
const WILDCARD_VERSION = /^[*xX](?:\.[*xX])*$/;
|
|
33548
33496
|
const NPM_ALIAS_VERSION = /^npm:(?:@[^/]+\/[^@]+|[^@]+)@(.+)$/i;
|
|
@@ -33728,15 +33676,6 @@ const parseReactMajorMinor = (reactVersion) => {
|
|
|
33728
33676
|
};
|
|
33729
33677
|
};
|
|
33730
33678
|
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
33679
|
const parseDependencyMajorMinor = (dependencyVersion) => {
|
|
33741
33680
|
if (typeof dependencyVersion !== "string") return null;
|
|
33742
33681
|
const trimmed = dependencyVersion.trim();
|
|
@@ -33770,7 +33709,7 @@ const resolveEffectiveReactMajor = (reactVersion, packageJson) => {
|
|
|
33770
33709
|
if (peerFloor === null) return hasUpperBoundOnlyPeerRange(peerReactRange) ? null : installedReactMajor;
|
|
33771
33710
|
return installedReactMajor !== null ? Math.min(installedReactMajor, peerFloor) : peerFloor;
|
|
33772
33711
|
};
|
|
33773
|
-
const isCatalogReference = (version) =>
|
|
33712
|
+
const isCatalogReference = (version) => version.startsWith("catalog:");
|
|
33774
33713
|
const extractCatalogName = (version) => {
|
|
33775
33714
|
if (!isCatalogReference(version)) return null;
|
|
33776
33715
|
const name = version.slice(8).trim();
|
|
@@ -33920,12 +33859,6 @@ const TAILWIND_ZOD_SECTIONS = [
|
|
|
33920
33859
|
"devDependencies",
|
|
33921
33860
|
"peerDependencies"
|
|
33922
33861
|
];
|
|
33923
|
-
const DEPENDENCY_SPEC_SECTIONS = [
|
|
33924
|
-
"dependencies",
|
|
33925
|
-
"devDependencies",
|
|
33926
|
-
"peerDependencies",
|
|
33927
|
-
"optionalDependencies"
|
|
33928
|
-
];
|
|
33929
33862
|
const EMPTY_DEPENDENCY_INFO = {
|
|
33930
33863
|
reactVersion: null,
|
|
33931
33864
|
tailwindVersion: null,
|
|
@@ -33935,7 +33868,7 @@ const EMPTY_DEPENDENCY_INFO = {
|
|
|
33935
33868
|
const pickConcreteVersion = (packageJson, packageName, sections) => {
|
|
33936
33869
|
for (const section of sections) {
|
|
33937
33870
|
const version = packageJson[section]?.[packageName];
|
|
33938
|
-
if (
|
|
33871
|
+
if (version === void 0) continue;
|
|
33939
33872
|
if (isCatalogReference(version)) return null;
|
|
33940
33873
|
if (isConcreteDependencyVersion(version)) return version;
|
|
33941
33874
|
}
|
|
@@ -33967,16 +33900,13 @@ const extractDependencyInfo = (packageJson) => {
|
|
|
33967
33900
|
};
|
|
33968
33901
|
};
|
|
33969
33902
|
const getDependencySpec = (packageJson, packageName) => {
|
|
33970
|
-
|
|
33971
|
-
|
|
33972
|
-
if (typeof spec === "string") return spec;
|
|
33973
|
-
}
|
|
33974
|
-
return null;
|
|
33903
|
+
const spec = packageJson.dependencies?.[packageName] ?? packageJson.devDependencies?.[packageName] ?? packageJson.peerDependencies?.[packageName] ?? packageJson.optionalDependencies?.[packageName];
|
|
33904
|
+
return typeof spec === "string" ? spec : null;
|
|
33975
33905
|
};
|
|
33976
33906
|
const getDependencyDeclaration = ({ packageJson, packageName, sections }) => {
|
|
33977
33907
|
for (const section of sections) {
|
|
33978
33908
|
const version = packageJson[section]?.[packageName];
|
|
33979
|
-
if (
|
|
33909
|
+
if (version === void 0) continue;
|
|
33980
33910
|
return {
|
|
33981
33911
|
catalogReference: extractCatalogName(version) ?? null,
|
|
33982
33912
|
hasDeclaration: true,
|
|
@@ -34010,15 +33940,11 @@ const getPreactVersion = (packageJson) => {
|
|
|
34010
33940
|
...packageJson.devDependencies
|
|
34011
33941
|
}.preact ?? null;
|
|
34012
33942
|
};
|
|
34013
|
-
const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson, packageName,
|
|
33943
|
+
const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson, packageName, version }) => {
|
|
34014
33944
|
if (version === null || !isCatalogReference(version)) return version;
|
|
34015
33945
|
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
|
-
}
|
|
33946
|
+
const resolvedLocalVersion = resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, catalogName);
|
|
33947
|
+
if (resolvedLocalVersion) return resolvedLocalVersion;
|
|
34022
33948
|
const monorepoRoot = findMonorepoRoot(rootDirectory);
|
|
34023
33949
|
if (!monorepoRoot) return version;
|
|
34024
33950
|
const monorepoPackageJsonPath = Path.join(monorepoRoot, "package.json");
|
|
@@ -34216,19 +34142,15 @@ const listWorkspacePackages = (rootDirectory) => {
|
|
|
34216
34142
|
}
|
|
34217
34143
|
return packages;
|
|
34218
34144
|
};
|
|
34219
|
-
const PREFERRED_DEPENDENCY_SECTIONS = [
|
|
34220
|
-
"dependencies",
|
|
34221
|
-
"peerDependencies",
|
|
34222
|
-
"devDependencies"
|
|
34223
|
-
];
|
|
34224
34145
|
const getPreferredDependencyVersion = ({ packageJson, packageNames }) => {
|
|
34146
|
+
const allDependencies = {
|
|
34147
|
+
...packageJson.devDependencies,
|
|
34148
|
+
...packageJson.peerDependencies,
|
|
34149
|
+
...packageJson.dependencies
|
|
34150
|
+
};
|
|
34225
34151
|
for (const packageName of packageNames) {
|
|
34226
|
-
const
|
|
34227
|
-
|
|
34228
|
-
packageName,
|
|
34229
|
-
sections: PREFERRED_DEPENDENCY_SECTIONS
|
|
34230
|
-
});
|
|
34231
|
-
if (declaration.version !== null) return declaration.version;
|
|
34152
|
+
const version = allDependencies[packageName];
|
|
34153
|
+
if (version !== void 0) return version;
|
|
34232
34154
|
}
|
|
34233
34155
|
return null;
|
|
34234
34156
|
};
|
|
@@ -34274,26 +34196,6 @@ const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
|
34274
34196
|
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
34275
34197
|
const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
|
|
34276
34198
|
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
|
-
const REACT_ROUTER_DEPENDENCY_NAMES = [
|
|
34293
|
-
"@react-router/dev",
|
|
34294
|
-
"react-router-dom",
|
|
34295
|
-
"react-router"
|
|
34296
|
-
];
|
|
34297
34199
|
const SHOPIFY_FLASH_LIST_PACKAGE_NAME = "@shopify/flash-list";
|
|
34298
34200
|
const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootDirectory, rootPackageJson, sections, workspaceDirectory, workspacePackageJson }) => {
|
|
34299
34201
|
const dependencyDeclaration = getDependencyDeclaration({
|
|
@@ -34304,7 +34206,7 @@ const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootD
|
|
|
34304
34206
|
if (!dependencyDeclaration.hasDeclaration) return null;
|
|
34305
34207
|
return concreteVersion ?? resolveCatalogVersion(workspacePackageJson, packageName, workspaceDirectory, dependencyDeclaration.catalogReference) ?? resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, dependencyDeclaration.catalogReference);
|
|
34306
34208
|
};
|
|
34307
|
-
const
|
|
34209
|
+
const shouldReplaceReactVersion = (currentVersion, nextVersion) => {
|
|
34308
34210
|
if (!currentVersion) return true;
|
|
34309
34211
|
const currentMajor = parseReactMajor(currentVersion);
|
|
34310
34212
|
const nextMajor = parseReactMajor(nextVersion);
|
|
@@ -34367,15 +34269,6 @@ const collectBindingVersion = (facts, packageJson, directory, packageName) => {
|
|
|
34367
34269
|
facts.mobxReactLiteVersion = facts.hasMobxReactLite ? selectOldestDependencyVersion(facts.mobxReactLiteVersion, resolvedVersion) : resolvedVersion;
|
|
34368
34270
|
facts.hasMobxReactLite = true;
|
|
34369
34271
|
};
|
|
34370
|
-
const shouldReplaceReactRouterVersion = (currentVersion, nextVersion) => {
|
|
34371
|
-
if (currentVersion === null) return true;
|
|
34372
|
-
const current = parseReactMajorMinor(currentVersion);
|
|
34373
|
-
const next = parseReactMajorMinor(nextVersion);
|
|
34374
|
-
if (current === null) return next !== null;
|
|
34375
|
-
if (next === null) return false;
|
|
34376
|
-
if (next.major !== current.major) return next.major < current.major;
|
|
34377
|
-
return next.minor < current.minor;
|
|
34378
|
-
};
|
|
34379
34272
|
const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, rootPackageJson) => {
|
|
34380
34273
|
if (facts.expo.version === null) {
|
|
34381
34274
|
const spec = getDependencySpec(packageJson, "expo");
|
|
@@ -34391,23 +34284,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34391
34284
|
sourceDirectory: directory
|
|
34392
34285
|
};
|
|
34393
34286
|
}
|
|
34394
|
-
for (const packageName of REACT_ROUTER_DEPENDENCY_NAMES) {
|
|
34395
|
-
const resolvedSpec = resolveCatalogBackedDependencyVersion({
|
|
34396
|
-
rootDirectory,
|
|
34397
|
-
rootPackageJson,
|
|
34398
|
-
sourceDirectory: directory,
|
|
34399
|
-
sourcePackageJson: packageJson,
|
|
34400
|
-
packageName,
|
|
34401
|
-
version: getDependencySpec(packageJson, packageName)
|
|
34402
|
-
});
|
|
34403
|
-
if (resolvedSpec === null || !shouldReplaceReactRouterVersion(facts.reactRouter.version, resolvedSpec)) continue;
|
|
34404
|
-
facts.reactRouter = {
|
|
34405
|
-
version: resolvedSpec,
|
|
34406
|
-
sourceDirectory: directory,
|
|
34407
|
-
packageName
|
|
34408
|
-
};
|
|
34409
|
-
}
|
|
34410
|
-
facts.hasReactRouterFramework = facts.hasReactRouterFramework || getDependencySpec(packageJson, "@react-router/dev") !== null;
|
|
34411
34287
|
if (facts.shopifyFlashList.version === null) {
|
|
34412
34288
|
const spec = getDependencySpec(packageJson, SHOPIFY_FLASH_LIST_PACKAGE_NAME);
|
|
34413
34289
|
if (spec !== null) facts.shopifyFlashList = {
|
|
@@ -34462,43 +34338,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34462
34338
|
});
|
|
34463
34339
|
if (styledComponentsVersion && shouldReplaceStyledComponentsVersion(facts.styledComponentsVersion, styledComponentsVersion)) facts.styledComponentsVersion = styledComponentsVersion;
|
|
34464
34340
|
facts.hasI18nLibrary = facts.hasI18nLibrary || hasI18nDependency(packageJson);
|
|
34465
|
-
for (const packageName of REACT_THREE_FIBER_DEPENDENCY_NAMES) {
|
|
34466
|
-
const version = resolveCatalogBackedDependencyVersion({
|
|
34467
|
-
rootDirectory,
|
|
34468
|
-
rootPackageJson,
|
|
34469
|
-
sourceDirectory: directory,
|
|
34470
|
-
sourcePackageJson: packageJson,
|
|
34471
|
-
packageName,
|
|
34472
|
-
version: getDependencyDeclaration({
|
|
34473
|
-
packageName,
|
|
34474
|
-
packageJson,
|
|
34475
|
-
sections: REACT_THREE_FIBER_SECTIONS
|
|
34476
|
-
}).version
|
|
34477
|
-
});
|
|
34478
|
-
if (version === null) continue;
|
|
34479
|
-
if (shouldReplaceWithLowerMajor(facts.reactThreeFiber.version, version)) facts.reactThreeFiber = {
|
|
34480
|
-
packageName,
|
|
34481
|
-
version,
|
|
34482
|
-
sourceDirectory: directory
|
|
34483
|
-
};
|
|
34484
|
-
}
|
|
34485
|
-
const threeVersion = resolveCatalogBackedDependencyVersion({
|
|
34486
|
-
rootDirectory,
|
|
34487
|
-
rootPackageJson,
|
|
34488
|
-
sourceDirectory: directory,
|
|
34489
|
-
sourcePackageJson: packageJson,
|
|
34490
|
-
packageName: "three",
|
|
34491
|
-
version: getDependencyDeclaration({
|
|
34492
|
-
packageName: "three",
|
|
34493
|
-
packageJson,
|
|
34494
|
-
sections: THREE_DEPENDENCY_SECTIONS
|
|
34495
|
-
}).version
|
|
34496
|
-
});
|
|
34497
|
-
if (threeVersion !== null) {
|
|
34498
|
-
const currentRelease = parseThreeRelease(facts.threeVersion);
|
|
34499
|
-
const nextRelease = parseThreeRelease(threeVersion);
|
|
34500
|
-
if (facts.threeVersion === null || nextRelease !== null && (currentRelease === null || nextRelease < currentRelease)) facts.threeVersion = threeVersion;
|
|
34501
|
-
}
|
|
34502
34341
|
facts.hasReactNativeAwarePackage = facts.hasReactNativeAwarePackage || isPackageJsonReactNativeAware(packageJson);
|
|
34503
34342
|
facts.hasReanimatedAwarePackage = facts.hasReanimatedAwarePackage || isPackageJsonReanimatedAware(packageJson);
|
|
34504
34343
|
facts.hasSsrDependency = facts.hasSsrDependency || isPackageJsonSsrAware(packageJson);
|
|
@@ -34520,8 +34359,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34520
34359
|
if (currentRemotionMajorVersion === null || remotionMajorVersion < currentRemotionMajorVersion) facts.remotionVersion = resolvedRemotionVersion;
|
|
34521
34360
|
}
|
|
34522
34361
|
}
|
|
34523
|
-
facts.hasThree = facts.hasThree || THREE_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
|
|
34524
|
-
facts.hasReactThreeFiber = facts.hasReactThreeFiber || REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
|
|
34525
34362
|
};
|
|
34526
34363
|
const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGroup }) => {
|
|
34527
34364
|
const facts = {
|
|
@@ -34537,11 +34374,6 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34537
34374
|
version: null,
|
|
34538
34375
|
sourceDirectory: null
|
|
34539
34376
|
},
|
|
34540
|
-
reactRouter: {
|
|
34541
|
-
version: null,
|
|
34542
|
-
sourceDirectory: null,
|
|
34543
|
-
packageName: null
|
|
34544
|
-
},
|
|
34545
34377
|
shopifyFlashList: {
|
|
34546
34378
|
version: null,
|
|
34547
34379
|
sourceDirectory: null
|
|
@@ -34570,22 +34402,13 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34570
34402
|
hasRemotionDependency: false,
|
|
34571
34403
|
hasUnknownRemotionVersion: false,
|
|
34572
34404
|
remotionVersion: null,
|
|
34573
|
-
hasThree: false,
|
|
34574
|
-
threeVersion: null,
|
|
34575
|
-
hasReactThreeFiber: false,
|
|
34576
|
-
reactThreeFiber: {
|
|
34577
|
-
packageName: null,
|
|
34578
|
-
version: null,
|
|
34579
|
-
sourceDirectory: null
|
|
34580
|
-
},
|
|
34581
|
-
hasReactRouterFramework: false,
|
|
34582
34405
|
reanimatedVersion: null
|
|
34583
34406
|
};
|
|
34584
34407
|
evaluateManifestFacts(facts, rootPackageJson, rootDirectory, rootDirectory, rootPackageJson);
|
|
34585
34408
|
let isReactGroupSettled = !collectReactGroup;
|
|
34586
34409
|
const visitedDirectories = /* @__PURE__ */ new Set();
|
|
34587
34410
|
for (const pattern of getWorkspacePatterns(rootDirectory, rootPackageJson)) {
|
|
34588
|
-
const directories = resolveWorkspaceDirectories(rootDirectory, pattern).
|
|
34411
|
+
const directories = [...resolveWorkspaceDirectories(rootDirectory, pattern)].sort();
|
|
34589
34412
|
for (const workspaceDirectory of directories) {
|
|
34590
34413
|
if (visitedDirectories.has(workspaceDirectory)) continue;
|
|
34591
34414
|
visitedDirectories.add(workspaceDirectory);
|
|
@@ -34621,7 +34444,7 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34621
34444
|
workspaceDirectory,
|
|
34622
34445
|
workspacePackageJson
|
|
34623
34446
|
});
|
|
34624
|
-
if (reactVersion &&
|
|
34447
|
+
if (reactVersion && shouldReplaceReactVersion(facts.reactVersion, reactVersion)) facts.reactVersion = reactVersion;
|
|
34625
34448
|
if (tailwindVersion && !facts.tailwindVersion) facts.tailwindVersion = tailwindVersion;
|
|
34626
34449
|
if (zodVersion && !facts.zodVersion) facts.zodVersion = zodVersion;
|
|
34627
34450
|
const settledReactMajor = parseReactMajor(facts.reactVersion);
|
|
@@ -34837,20 +34660,12 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
34837
34660
|
hasI18nLibrary: false,
|
|
34838
34661
|
tanstackQueryVersion: null,
|
|
34839
34662
|
styledComponentsVersion: null,
|
|
34840
|
-
hasThree: false,
|
|
34841
|
-
threeVersion: null,
|
|
34842
|
-
threeRelease: null,
|
|
34843
|
-
hasReactThreeFiber: false,
|
|
34844
|
-
reactThreeFiberVersion: null,
|
|
34845
|
-
reactThreeFiberMajorVersion: null,
|
|
34846
34663
|
hasSsrDependency: false,
|
|
34847
34664
|
preactVersion: null,
|
|
34848
34665
|
preactMajorVersion: null,
|
|
34849
34666
|
hasReactNativeWorkspace: false,
|
|
34850
34667
|
nextjsVersion: null,
|
|
34851
34668
|
nextjsMajorVersion: null,
|
|
34852
|
-
reactRouterVersion: null,
|
|
34853
|
-
hasReactRouterFramework: false,
|
|
34854
34669
|
expoVersion: null,
|
|
34855
34670
|
shopifyFlashListVersion: null,
|
|
34856
34671
|
shopifyFlashListMajorVersion: null,
|
|
@@ -34969,27 +34784,9 @@ const discoverProject = (directory) => {
|
|
|
34969
34784
|
packageName: "mobx",
|
|
34970
34785
|
version: workspaceFacts.mobx.version
|
|
34971
34786
|
});
|
|
34972
|
-
const reactRouterVersion = workspaceFacts.reactRouter.packageName === null ? null : resolveCatalogBackedDependencyVersion({
|
|
34973
|
-
rootDirectory: directory,
|
|
34974
|
-
rootPackageJson: packageJson,
|
|
34975
|
-
packageName: workspaceFacts.reactRouter.packageName,
|
|
34976
|
-
version: workspaceFacts.reactRouter.version
|
|
34977
|
-
});
|
|
34978
34787
|
const preactVersion = getPreactVersion(packageJson);
|
|
34979
34788
|
const remotionVersion = workspaceFacts.remotionVersion;
|
|
34980
34789
|
const tanstackQueryVersion = getTanStackQueryVersion(packageJson) ?? workspaceFacts.tanstackQueryVersion;
|
|
34981
|
-
const reactThreeFiberVersion = workspaceFacts.reactThreeFiber.packageName ? resolveCatalogBackedDependencyVersion({
|
|
34982
|
-
rootDirectory: directory,
|
|
34983
|
-
rootPackageJson: packageJson,
|
|
34984
|
-
packageName: workspaceFacts.reactThreeFiber.packageName,
|
|
34985
|
-
version: workspaceFacts.reactThreeFiber.version
|
|
34986
|
-
}) : null;
|
|
34987
|
-
const threeVersion = resolveCatalogBackedDependencyVersion({
|
|
34988
|
-
rootDirectory: directory,
|
|
34989
|
-
rootPackageJson: packageJson,
|
|
34990
|
-
packageName: "three",
|
|
34991
|
-
version: workspaceFacts.threeVersion
|
|
34992
|
-
});
|
|
34993
34790
|
const isPreES2023Target = hasTypeScript && detectPreES2023Target(directory);
|
|
34994
34791
|
const projectInfo = {
|
|
34995
34792
|
rootDirectory: directory,
|
|
@@ -35022,20 +34819,12 @@ const discoverProject = (directory) => {
|
|
|
35022
34819
|
hasRemotion: workspaceFacts.hasRemotionDependency,
|
|
35023
34820
|
remotionVersion,
|
|
35024
34821
|
remotionMajorVersion: remotionVersion === null ? null : getLowestDependencyMajor(remotionVersion),
|
|
35025
|
-
hasThree: workspaceFacts.hasThree,
|
|
35026
|
-
threeVersion,
|
|
35027
|
-
threeRelease: parseThreeRelease(threeVersion),
|
|
35028
|
-
hasReactThreeFiber: workspaceFacts.hasReactThreeFiber,
|
|
35029
|
-
reactThreeFiberVersion,
|
|
35030
|
-
reactThreeFiberMajorVersion: reactThreeFiberVersion === null ? null : getLowestDependencyMajor(reactThreeFiberVersion),
|
|
35031
34822
|
hasSsrDependency: workspaceFacts.hasSsrDependency,
|
|
35032
34823
|
preactVersion,
|
|
35033
34824
|
preactMajorVersion: parseReactMajor(preactVersion),
|
|
35034
34825
|
hasReactNativeWorkspace,
|
|
35035
34826
|
nextjsVersion,
|
|
35036
34827
|
nextjsMajorVersion: nextjsVersion === null ? null : getLowestDependencyMajor(nextjsVersion),
|
|
35037
|
-
reactRouterVersion,
|
|
35038
|
-
hasReactRouterFramework: workspaceFacts.hasReactRouterFramework,
|
|
35039
34828
|
expoVersion,
|
|
35040
34829
|
shopifyFlashListVersion,
|
|
35041
34830
|
shopifyFlashListMajorVersion: shopifyFlashListVersion === null ? null : getLowestDependencyMajor(shopifyFlashListVersion),
|
|
@@ -38304,10 +38093,10 @@ const SSR_FRAMEWORKS = new Set([
|
|
|
38304
38093
|
"gatsby",
|
|
38305
38094
|
"tanstack-start"
|
|
38306
38095
|
]);
|
|
38307
|
-
const
|
|
38308
|
-
if (
|
|
38309
|
-
const
|
|
38310
|
-
for (let candidate = earliest; candidate <=
|
|
38096
|
+
const addMajorLadder = (capabilities, name, major, earliest, latest) => {
|
|
38097
|
+
if (major === null) return;
|
|
38098
|
+
const cappedMajor = Math.min(major, latest);
|
|
38099
|
+
for (let candidate = earliest; candidate <= cappedMajor; candidate += 1) capabilities.add(`${name}:${candidate}`);
|
|
38311
38100
|
};
|
|
38312
38101
|
const buildCapabilities = (project) => {
|
|
38313
38102
|
const capabilities = /* @__PURE__ */ new Set();
|
|
@@ -38321,16 +38110,7 @@ const buildCapabilities = (project) => {
|
|
|
38321
38110
|
if (project.isStaticExport) capabilities.add("nextjs:static-export");
|
|
38322
38111
|
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
|
|
38323
38112
|
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 16) capabilities.add("nextjs:16");
|
|
38324
|
-
|
|
38325
|
-
if (reactRouterVersion !== null) {
|
|
38326
|
-
capabilities.add("react-router");
|
|
38327
|
-
if (project.hasReactRouterFramework === true) capabilities.add("react-router-framework");
|
|
38328
|
-
const detectedVersion = parseReactMajorMinor(reactRouterVersion);
|
|
38329
|
-
if (detectedVersion !== null) {
|
|
38330
|
-
for (const threshold of REACT_ROUTER_CAPABILITY_THRESHOLDS) if (isMajorMinorAtLeast(detectedVersion, threshold)) capabilities.add(threshold.capability);
|
|
38331
|
-
}
|
|
38332
|
-
}
|
|
38333
|
-
addVersionCapabilityLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
|
|
38113
|
+
addMajorLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
|
|
38334
38114
|
if (project.reactMajorVersion !== null && project.reactMajorVersion >= 19 && isMajorMinorAtLeast(parseReactMajorMinor(project.reactVersion), {
|
|
38335
38115
|
major: 19,
|
|
38336
38116
|
minor: 2
|
|
@@ -38368,14 +38148,14 @@ const buildCapabilities = (project) => {
|
|
|
38368
38148
|
if (hasMobxReactObserverMemoGuard || hasMobxReactLiteObserverMemoGuard) capabilities.add("mobx-react-binding-observer-memo-guard");
|
|
38369
38149
|
if (project.hasMobxStateTree === true) capabilities.add("mobx-state-tree");
|
|
38370
38150
|
if (project.hasMobxReactObserver === true) capabilities.add("mobx-react-observer");
|
|
38371
|
-
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6)
|
|
38151
|
+
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6) addMajorLadder(capabilities, "mobx", project.mobxMajorVersion, 4, 6);
|
|
38372
38152
|
const mobxVersion = parseDependencyMajorMinor(project.mobxVersion);
|
|
38373
38153
|
if (project.mobxMajorVersion === 6 && mobxVersion !== null && isMajorMinorAtLeast(mobxVersion, {
|
|
38374
38154
|
major: 6,
|
|
38375
38155
|
minor: 10
|
|
38376
38156
|
})) capabilities.add("mobx:6.10");
|
|
38377
38157
|
if (project.zustandVersion !== void 0 && project.zustandVersion !== null) capabilities.add("zustand");
|
|
38378
|
-
if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5)
|
|
38158
|
+
if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5) addMajorLadder(capabilities, "zustand", project.zustandMajorVersion, 1, 5);
|
|
38379
38159
|
if (project.isPreES2023Target) capabilities.add("pre-es2023");
|
|
38380
38160
|
if (project.hasReactCompiler) capabilities.add("react-compiler");
|
|
38381
38161
|
if (Boolean(project.hasTanStackQuery) || Boolean(project.tanstackQueryVersion)) capabilities.add("tanstack-query");
|
|
@@ -38386,20 +38166,14 @@ const buildCapabilities = (project) => {
|
|
|
38386
38166
|
}
|
|
38387
38167
|
if (project.hasI18nLibrary) capabilities.add("i18n");
|
|
38388
38168
|
if (project.valtioVersion !== null) capabilities.add("valtio");
|
|
38389
|
-
|
|
38169
|
+
addMajorLadder(capabilities, "valtio", project.valtioMajorVersion, 1, 10);
|
|
38390
38170
|
if (project.hasRemotion) {
|
|
38391
38171
|
capabilities.add("remotion");
|
|
38392
|
-
|
|
38393
|
-
}
|
|
38394
|
-
if (project.hasThree || project.hasReactThreeFiber) capabilities.add("three");
|
|
38395
|
-
addVersionCapabilityLadder(capabilities, "three", project.threeRelease ?? null, 145, 250);
|
|
38396
|
-
if (project.hasReactThreeFiber) {
|
|
38397
|
-
capabilities.add("r3f");
|
|
38398
|
-
addVersionCapabilityLadder(capabilities, "r3f", project.reactThreeFiberMajorVersion ?? null, 3, 10);
|
|
38172
|
+
addMajorLadder(capabilities, "remotion", project.remotionMajorVersion ?? null, 4, 30);
|
|
38399
38173
|
}
|
|
38400
38174
|
if (project.hasTypeScript) capabilities.add("typescript");
|
|
38401
38175
|
if (project.preactVersion !== null) capabilities.add("preact");
|
|
38402
|
-
|
|
38176
|
+
addMajorLadder(capabilities, "preact", project.preactMajorVersion, 10, 20);
|
|
38403
38177
|
if (project.preactVersion !== null && project.reactVersion === null) capabilities.add("pure-preact");
|
|
38404
38178
|
return capabilities;
|
|
38405
38179
|
};
|
|
@@ -44424,4 +44198,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
44424
44198
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
44425
44199
|
|
|
44426
44200
|
//# sourceMappingURL=index.js.map
|
|
44427
|
-
//# debugId=
|
|
44201
|
+
//# debugId=d6c84ba6-2fee-56d3-ba17-e8408ecdedc5
|