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/lsp.js
CHANGED
|
@@ -32923,58 +32923,6 @@ const IGNORED_DIRECTORIES = new Set([
|
|
|
32923
32923
|
"storybook-static"
|
|
32924
32924
|
]);
|
|
32925
32925
|
const MILLISECONDS_PER_SECOND = 1e3;
|
|
32926
|
-
const REACT_ROUTER_CAPABILITY_THRESHOLDS = [
|
|
32927
|
-
{
|
|
32928
|
-
capability: "react-router:6.4",
|
|
32929
|
-
major: 6,
|
|
32930
|
-
minor: 4
|
|
32931
|
-
},
|
|
32932
|
-
{
|
|
32933
|
-
capability: "react-router:6.7",
|
|
32934
|
-
major: 6,
|
|
32935
|
-
minor: 7
|
|
32936
|
-
},
|
|
32937
|
-
{
|
|
32938
|
-
capability: "react-router:6.9",
|
|
32939
|
-
major: 6,
|
|
32940
|
-
minor: 9
|
|
32941
|
-
},
|
|
32942
|
-
{
|
|
32943
|
-
capability: "react-router:6.19",
|
|
32944
|
-
major: 6,
|
|
32945
|
-
minor: 19
|
|
32946
|
-
},
|
|
32947
|
-
{
|
|
32948
|
-
capability: "react-router:7",
|
|
32949
|
-
major: 7,
|
|
32950
|
-
minor: 0
|
|
32951
|
-
},
|
|
32952
|
-
{
|
|
32953
|
-
capability: "react-router:7.8",
|
|
32954
|
-
major: 7,
|
|
32955
|
-
minor: 8
|
|
32956
|
-
},
|
|
32957
|
-
{
|
|
32958
|
-
capability: "react-router:7.9",
|
|
32959
|
-
major: 7,
|
|
32960
|
-
minor: 9
|
|
32961
|
-
},
|
|
32962
|
-
{
|
|
32963
|
-
capability: "react-router:7.10",
|
|
32964
|
-
major: 7,
|
|
32965
|
-
minor: 10
|
|
32966
|
-
},
|
|
32967
|
-
{
|
|
32968
|
-
capability: "react-router:7.15",
|
|
32969
|
-
major: 7,
|
|
32970
|
-
minor: 15
|
|
32971
|
-
},
|
|
32972
|
-
{
|
|
32973
|
-
capability: "react-router:8",
|
|
32974
|
-
major: 8,
|
|
32975
|
-
minor: 0
|
|
32976
|
-
}
|
|
32977
|
-
];
|
|
32978
32926
|
const SCORE_API_URL = "https://www.react.doctor/api/score";
|
|
32979
32927
|
const FETCH_TIMEOUT_MS = 1e4;
|
|
32980
32928
|
const GITHUB_VIEWER_PERMISSION_TIMEOUT_MS = 2e3;
|
|
@@ -33594,7 +33542,7 @@ const detectNextjsStaticExport = (directory) => NEXT_CONFIG_FILENAMES.some((file
|
|
|
33594
33542
|
const filePath = Path.join(directory, filename);
|
|
33595
33543
|
return isFile(filePath) && STATIC_EXPORT_OUTPUT_PATTERN.test(NFS.readFileSync(filePath, "utf-8"));
|
|
33596
33544
|
});
|
|
33597
|
-
const UNRESOLVABLE_PROTOCOL_VERSION = /^(?:
|
|
33545
|
+
const UNRESOLVABLE_PROTOCOL_VERSION = /^(?:file|git|github|https?|link|patch|portal|workspace|npm):/i;
|
|
33598
33546
|
const DIST_TAG_VERSION = /^[a-z][a-z0-9._-]*$/i;
|
|
33599
33547
|
const WILDCARD_VERSION = /^[*xX](?:\.[*xX])*$/;
|
|
33600
33548
|
const NPM_ALIAS_VERSION = /^npm:(?:@[^/]+\/[^@]+|[^@]+)@(.+)$/i;
|
|
@@ -33780,15 +33728,6 @@ const parseReactMajorMinor = (reactVersion) => {
|
|
|
33780
33728
|
};
|
|
33781
33729
|
};
|
|
33782
33730
|
const parseLowerBoundVersion = (versionSpec) => import_semver.validRange(versionSpec) !== null ? import_semver.minVersion(versionSpec) : import_semver.coerce(versionSpec);
|
|
33783
|
-
const parseThreeRelease = (threeVersion) => {
|
|
33784
|
-
if (typeof threeVersion !== "string") return null;
|
|
33785
|
-
const normalizedVersion = normalizeDependencyVersion(threeVersion);
|
|
33786
|
-
if (normalizedVersion === null) return null;
|
|
33787
|
-
const lowerBound = parseLowerBoundVersion(normalizedVersion);
|
|
33788
|
-
if (lowerBound === null) return null;
|
|
33789
|
-
if (lowerBound.major > 0) return Number.MAX_SAFE_INTEGER;
|
|
33790
|
-
return lowerBound.minor > 0 ? lowerBound.minor : null;
|
|
33791
|
-
};
|
|
33792
33731
|
const parseDependencyMajorMinor = (dependencyVersion) => {
|
|
33793
33732
|
if (typeof dependencyVersion !== "string") return null;
|
|
33794
33733
|
const trimmed = dependencyVersion.trim();
|
|
@@ -33822,7 +33761,7 @@ const resolveEffectiveReactMajor = (reactVersion, packageJson) => {
|
|
|
33822
33761
|
if (peerFloor === null) return hasUpperBoundOnlyPeerRange(peerReactRange) ? null : installedReactMajor;
|
|
33823
33762
|
return installedReactMajor !== null ? Math.min(installedReactMajor, peerFloor) : peerFloor;
|
|
33824
33763
|
};
|
|
33825
|
-
const isCatalogReference = (version) =>
|
|
33764
|
+
const isCatalogReference = (version) => version.startsWith("catalog:");
|
|
33826
33765
|
const extractCatalogName = (version) => {
|
|
33827
33766
|
if (!isCatalogReference(version)) return null;
|
|
33828
33767
|
const name = version.slice(8).trim();
|
|
@@ -33972,12 +33911,6 @@ const TAILWIND_ZOD_SECTIONS = [
|
|
|
33972
33911
|
"devDependencies",
|
|
33973
33912
|
"peerDependencies"
|
|
33974
33913
|
];
|
|
33975
|
-
const DEPENDENCY_SPEC_SECTIONS = [
|
|
33976
|
-
"dependencies",
|
|
33977
|
-
"devDependencies",
|
|
33978
|
-
"peerDependencies",
|
|
33979
|
-
"optionalDependencies"
|
|
33980
|
-
];
|
|
33981
33914
|
const EMPTY_DEPENDENCY_INFO = {
|
|
33982
33915
|
reactVersion: null,
|
|
33983
33916
|
tailwindVersion: null,
|
|
@@ -33987,7 +33920,7 @@ const EMPTY_DEPENDENCY_INFO = {
|
|
|
33987
33920
|
const pickConcreteVersion = (packageJson, packageName, sections) => {
|
|
33988
33921
|
for (const section of sections) {
|
|
33989
33922
|
const version = packageJson[section]?.[packageName];
|
|
33990
|
-
if (
|
|
33923
|
+
if (version === void 0) continue;
|
|
33991
33924
|
if (isCatalogReference(version)) return null;
|
|
33992
33925
|
if (isConcreteDependencyVersion(version)) return version;
|
|
33993
33926
|
}
|
|
@@ -34019,16 +33952,13 @@ const extractDependencyInfo = (packageJson) => {
|
|
|
34019
33952
|
};
|
|
34020
33953
|
};
|
|
34021
33954
|
const getDependencySpec = (packageJson, packageName) => {
|
|
34022
|
-
|
|
34023
|
-
|
|
34024
|
-
if (typeof spec === "string") return spec;
|
|
34025
|
-
}
|
|
34026
|
-
return null;
|
|
33955
|
+
const spec = packageJson.dependencies?.[packageName] ?? packageJson.devDependencies?.[packageName] ?? packageJson.peerDependencies?.[packageName] ?? packageJson.optionalDependencies?.[packageName];
|
|
33956
|
+
return typeof spec === "string" ? spec : null;
|
|
34027
33957
|
};
|
|
34028
33958
|
const getDependencyDeclaration = ({ packageJson, packageName, sections }) => {
|
|
34029
33959
|
for (const section of sections) {
|
|
34030
33960
|
const version = packageJson[section]?.[packageName];
|
|
34031
|
-
if (
|
|
33961
|
+
if (version === void 0) continue;
|
|
34032
33962
|
return {
|
|
34033
33963
|
catalogReference: extractCatalogName(version) ?? null,
|
|
34034
33964
|
hasDeclaration: true,
|
|
@@ -34062,15 +33992,11 @@ const getPreactVersion = (packageJson) => {
|
|
|
34062
33992
|
...packageJson.devDependencies
|
|
34063
33993
|
}.preact ?? null;
|
|
34064
33994
|
};
|
|
34065
|
-
const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson, packageName,
|
|
33995
|
+
const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson, packageName, version }) => {
|
|
34066
33996
|
if (version === null || !isCatalogReference(version)) return version;
|
|
34067
33997
|
const catalogName = extractCatalogName(version);
|
|
34068
|
-
const
|
|
34069
|
-
if (
|
|
34070
|
-
if (sourceDirectory !== rootDirectory || sourcePackageJson !== rootPackageJson) {
|
|
34071
|
-
const resolvedRootVersion = resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, catalogName);
|
|
34072
|
-
if (resolvedRootVersion) return resolvedRootVersion;
|
|
34073
|
-
}
|
|
33998
|
+
const resolvedLocalVersion = resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, catalogName);
|
|
33999
|
+
if (resolvedLocalVersion) return resolvedLocalVersion;
|
|
34074
34000
|
const monorepoRoot = findMonorepoRoot(rootDirectory);
|
|
34075
34001
|
if (!monorepoRoot) return version;
|
|
34076
34002
|
const monorepoPackageJsonPath = Path.join(monorepoRoot, "package.json");
|
|
@@ -34268,19 +34194,15 @@ const listWorkspacePackages = (rootDirectory) => {
|
|
|
34268
34194
|
}
|
|
34269
34195
|
return packages;
|
|
34270
34196
|
};
|
|
34271
|
-
const PREFERRED_DEPENDENCY_SECTIONS = [
|
|
34272
|
-
"dependencies",
|
|
34273
|
-
"peerDependencies",
|
|
34274
|
-
"devDependencies"
|
|
34275
|
-
];
|
|
34276
34197
|
const getPreferredDependencyVersion = ({ packageJson, packageNames }) => {
|
|
34198
|
+
const allDependencies = {
|
|
34199
|
+
...packageJson.devDependencies,
|
|
34200
|
+
...packageJson.peerDependencies,
|
|
34201
|
+
...packageJson.dependencies
|
|
34202
|
+
};
|
|
34277
34203
|
for (const packageName of packageNames) {
|
|
34278
|
-
const
|
|
34279
|
-
|
|
34280
|
-
packageName,
|
|
34281
|
-
sections: PREFERRED_DEPENDENCY_SECTIONS
|
|
34282
|
-
});
|
|
34283
|
-
if (declaration.version !== null) return declaration.version;
|
|
34204
|
+
const version = allDependencies[packageName];
|
|
34205
|
+
if (version !== void 0) return version;
|
|
34284
34206
|
}
|
|
34285
34207
|
return null;
|
|
34286
34208
|
};
|
|
@@ -34326,26 +34248,6 @@ const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
|
34326
34248
|
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
34327
34249
|
const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
|
|
34328
34250
|
const MOBX_REACT_OBSERVER_PACKAGE_NAME = "mobx-react-observer";
|
|
34329
|
-
const REACT_THREE_FIBER_DEPENDENCY_NAMES = ["@react-three/fiber", "react-three-fiber"];
|
|
34330
|
-
const REACT_THREE_FIBER_SECTIONS = [
|
|
34331
|
-
"dependencies",
|
|
34332
|
-
"peerDependencies",
|
|
34333
|
-
"optionalDependencies",
|
|
34334
|
-
"devDependencies"
|
|
34335
|
-
];
|
|
34336
|
-
const THREE_DEPENDENCY_SECTIONS = [
|
|
34337
|
-
"dependencies",
|
|
34338
|
-
"peerDependencies",
|
|
34339
|
-
"optionalDependencies",
|
|
34340
|
-
"devDependencies"
|
|
34341
|
-
];
|
|
34342
|
-
const REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_DEPENDENCY_NAMES, "@react-three/drei"];
|
|
34343
|
-
const THREE_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES, "three"];
|
|
34344
|
-
const REACT_ROUTER_DEPENDENCY_NAMES = [
|
|
34345
|
-
"@react-router/dev",
|
|
34346
|
-
"react-router-dom",
|
|
34347
|
-
"react-router"
|
|
34348
|
-
];
|
|
34349
34251
|
const SHOPIFY_FLASH_LIST_PACKAGE_NAME = "@shopify/flash-list";
|
|
34350
34252
|
const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootDirectory, rootPackageJson, sections, workspaceDirectory, workspacePackageJson }) => {
|
|
34351
34253
|
const dependencyDeclaration = getDependencyDeclaration({
|
|
@@ -34356,7 +34258,7 @@ const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootD
|
|
|
34356
34258
|
if (!dependencyDeclaration.hasDeclaration) return null;
|
|
34357
34259
|
return concreteVersion ?? resolveCatalogVersion(workspacePackageJson, packageName, workspaceDirectory, dependencyDeclaration.catalogReference) ?? resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, dependencyDeclaration.catalogReference);
|
|
34358
34260
|
};
|
|
34359
|
-
const
|
|
34261
|
+
const shouldReplaceReactVersion = (currentVersion, nextVersion) => {
|
|
34360
34262
|
if (!currentVersion) return true;
|
|
34361
34263
|
const currentMajor = parseReactMajor(currentVersion);
|
|
34362
34264
|
const nextMajor = parseReactMajor(nextVersion);
|
|
@@ -34419,15 +34321,6 @@ const collectBindingVersion = (facts, packageJson, directory, packageName) => {
|
|
|
34419
34321
|
facts.mobxReactLiteVersion = facts.hasMobxReactLite ? selectOldestDependencyVersion(facts.mobxReactLiteVersion, resolvedVersion) : resolvedVersion;
|
|
34420
34322
|
facts.hasMobxReactLite = true;
|
|
34421
34323
|
};
|
|
34422
|
-
const shouldReplaceReactRouterVersion = (currentVersion, nextVersion) => {
|
|
34423
|
-
if (currentVersion === null) return true;
|
|
34424
|
-
const current = parseReactMajorMinor(currentVersion);
|
|
34425
|
-
const next = parseReactMajorMinor(nextVersion);
|
|
34426
|
-
if (current === null) return next !== null;
|
|
34427
|
-
if (next === null) return false;
|
|
34428
|
-
if (next.major !== current.major) return next.major < current.major;
|
|
34429
|
-
return next.minor < current.minor;
|
|
34430
|
-
};
|
|
34431
34324
|
const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, rootPackageJson) => {
|
|
34432
34325
|
if (facts.expo.version === null) {
|
|
34433
34326
|
const spec = getDependencySpec(packageJson, "expo");
|
|
@@ -34443,23 +34336,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34443
34336
|
sourceDirectory: directory
|
|
34444
34337
|
};
|
|
34445
34338
|
}
|
|
34446
|
-
for (const packageName of REACT_ROUTER_DEPENDENCY_NAMES) {
|
|
34447
|
-
const resolvedSpec = resolveCatalogBackedDependencyVersion({
|
|
34448
|
-
rootDirectory,
|
|
34449
|
-
rootPackageJson,
|
|
34450
|
-
sourceDirectory: directory,
|
|
34451
|
-
sourcePackageJson: packageJson,
|
|
34452
|
-
packageName,
|
|
34453
|
-
version: getDependencySpec(packageJson, packageName)
|
|
34454
|
-
});
|
|
34455
|
-
if (resolvedSpec === null || !shouldReplaceReactRouterVersion(facts.reactRouter.version, resolvedSpec)) continue;
|
|
34456
|
-
facts.reactRouter = {
|
|
34457
|
-
version: resolvedSpec,
|
|
34458
|
-
sourceDirectory: directory,
|
|
34459
|
-
packageName
|
|
34460
|
-
};
|
|
34461
|
-
}
|
|
34462
|
-
facts.hasReactRouterFramework = facts.hasReactRouterFramework || getDependencySpec(packageJson, "@react-router/dev") !== null;
|
|
34463
34339
|
if (facts.shopifyFlashList.version === null) {
|
|
34464
34340
|
const spec = getDependencySpec(packageJson, SHOPIFY_FLASH_LIST_PACKAGE_NAME);
|
|
34465
34341
|
if (spec !== null) facts.shopifyFlashList = {
|
|
@@ -34514,43 +34390,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34514
34390
|
});
|
|
34515
34391
|
if (styledComponentsVersion && shouldReplaceStyledComponentsVersion(facts.styledComponentsVersion, styledComponentsVersion)) facts.styledComponentsVersion = styledComponentsVersion;
|
|
34516
34392
|
facts.hasI18nLibrary = facts.hasI18nLibrary || hasI18nDependency(packageJson);
|
|
34517
|
-
for (const packageName of REACT_THREE_FIBER_DEPENDENCY_NAMES) {
|
|
34518
|
-
const version = resolveCatalogBackedDependencyVersion({
|
|
34519
|
-
rootDirectory,
|
|
34520
|
-
rootPackageJson,
|
|
34521
|
-
sourceDirectory: directory,
|
|
34522
|
-
sourcePackageJson: packageJson,
|
|
34523
|
-
packageName,
|
|
34524
|
-
version: getDependencyDeclaration({
|
|
34525
|
-
packageName,
|
|
34526
|
-
packageJson,
|
|
34527
|
-
sections: REACT_THREE_FIBER_SECTIONS
|
|
34528
|
-
}).version
|
|
34529
|
-
});
|
|
34530
|
-
if (version === null) continue;
|
|
34531
|
-
if (shouldReplaceWithLowerMajor(facts.reactThreeFiber.version, version)) facts.reactThreeFiber = {
|
|
34532
|
-
packageName,
|
|
34533
|
-
version,
|
|
34534
|
-
sourceDirectory: directory
|
|
34535
|
-
};
|
|
34536
|
-
}
|
|
34537
|
-
const threeVersion = resolveCatalogBackedDependencyVersion({
|
|
34538
|
-
rootDirectory,
|
|
34539
|
-
rootPackageJson,
|
|
34540
|
-
sourceDirectory: directory,
|
|
34541
|
-
sourcePackageJson: packageJson,
|
|
34542
|
-
packageName: "three",
|
|
34543
|
-
version: getDependencyDeclaration({
|
|
34544
|
-
packageName: "three",
|
|
34545
|
-
packageJson,
|
|
34546
|
-
sections: THREE_DEPENDENCY_SECTIONS
|
|
34547
|
-
}).version
|
|
34548
|
-
});
|
|
34549
|
-
if (threeVersion !== null) {
|
|
34550
|
-
const currentRelease = parseThreeRelease(facts.threeVersion);
|
|
34551
|
-
const nextRelease = parseThreeRelease(threeVersion);
|
|
34552
|
-
if (facts.threeVersion === null || nextRelease !== null && (currentRelease === null || nextRelease < currentRelease)) facts.threeVersion = threeVersion;
|
|
34553
|
-
}
|
|
34554
34393
|
facts.hasReactNativeAwarePackage = facts.hasReactNativeAwarePackage || isPackageJsonReactNativeAware(packageJson);
|
|
34555
34394
|
facts.hasReanimatedAwarePackage = facts.hasReanimatedAwarePackage || isPackageJsonReanimatedAware(packageJson);
|
|
34556
34395
|
facts.hasSsrDependency = facts.hasSsrDependency || isPackageJsonSsrAware(packageJson);
|
|
@@ -34572,8 +34411,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34572
34411
|
if (currentRemotionMajorVersion === null || remotionMajorVersion < currentRemotionMajorVersion) facts.remotionVersion = resolvedRemotionVersion;
|
|
34573
34412
|
}
|
|
34574
34413
|
}
|
|
34575
|
-
facts.hasThree = facts.hasThree || THREE_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
|
|
34576
|
-
facts.hasReactThreeFiber = facts.hasReactThreeFiber || REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
|
|
34577
34414
|
};
|
|
34578
34415
|
const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGroup }) => {
|
|
34579
34416
|
const facts = {
|
|
@@ -34589,11 +34426,6 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34589
34426
|
version: null,
|
|
34590
34427
|
sourceDirectory: null
|
|
34591
34428
|
},
|
|
34592
|
-
reactRouter: {
|
|
34593
|
-
version: null,
|
|
34594
|
-
sourceDirectory: null,
|
|
34595
|
-
packageName: null
|
|
34596
|
-
},
|
|
34597
34429
|
shopifyFlashList: {
|
|
34598
34430
|
version: null,
|
|
34599
34431
|
sourceDirectory: null
|
|
@@ -34622,22 +34454,13 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34622
34454
|
hasRemotionDependency: false,
|
|
34623
34455
|
hasUnknownRemotionVersion: false,
|
|
34624
34456
|
remotionVersion: null,
|
|
34625
|
-
hasThree: false,
|
|
34626
|
-
threeVersion: null,
|
|
34627
|
-
hasReactThreeFiber: false,
|
|
34628
|
-
reactThreeFiber: {
|
|
34629
|
-
packageName: null,
|
|
34630
|
-
version: null,
|
|
34631
|
-
sourceDirectory: null
|
|
34632
|
-
},
|
|
34633
|
-
hasReactRouterFramework: false,
|
|
34634
34457
|
reanimatedVersion: null
|
|
34635
34458
|
};
|
|
34636
34459
|
evaluateManifestFacts(facts, rootPackageJson, rootDirectory, rootDirectory, rootPackageJson);
|
|
34637
34460
|
let isReactGroupSettled = !collectReactGroup;
|
|
34638
34461
|
const visitedDirectories = /* @__PURE__ */ new Set();
|
|
34639
34462
|
for (const pattern of getWorkspacePatterns(rootDirectory, rootPackageJson)) {
|
|
34640
|
-
const directories = resolveWorkspaceDirectories(rootDirectory, pattern).
|
|
34463
|
+
const directories = [...resolveWorkspaceDirectories(rootDirectory, pattern)].sort();
|
|
34641
34464
|
for (const workspaceDirectory of directories) {
|
|
34642
34465
|
if (visitedDirectories.has(workspaceDirectory)) continue;
|
|
34643
34466
|
visitedDirectories.add(workspaceDirectory);
|
|
@@ -34673,7 +34496,7 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34673
34496
|
workspaceDirectory,
|
|
34674
34497
|
workspacePackageJson
|
|
34675
34498
|
});
|
|
34676
|
-
if (reactVersion &&
|
|
34499
|
+
if (reactVersion && shouldReplaceReactVersion(facts.reactVersion, reactVersion)) facts.reactVersion = reactVersion;
|
|
34677
34500
|
if (tailwindVersion && !facts.tailwindVersion) facts.tailwindVersion = tailwindVersion;
|
|
34678
34501
|
if (zodVersion && !facts.zodVersion) facts.zodVersion = zodVersion;
|
|
34679
34502
|
const settledReactMajor = parseReactMajor(facts.reactVersion);
|
|
@@ -34889,20 +34712,12 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
34889
34712
|
hasI18nLibrary: false,
|
|
34890
34713
|
tanstackQueryVersion: null,
|
|
34891
34714
|
styledComponentsVersion: null,
|
|
34892
|
-
hasThree: false,
|
|
34893
|
-
threeVersion: null,
|
|
34894
|
-
threeRelease: null,
|
|
34895
|
-
hasReactThreeFiber: false,
|
|
34896
|
-
reactThreeFiberVersion: null,
|
|
34897
|
-
reactThreeFiberMajorVersion: null,
|
|
34898
34715
|
hasSsrDependency: false,
|
|
34899
34716
|
preactVersion: null,
|
|
34900
34717
|
preactMajorVersion: null,
|
|
34901
34718
|
hasReactNativeWorkspace: false,
|
|
34902
34719
|
nextjsVersion: null,
|
|
34903
34720
|
nextjsMajorVersion: null,
|
|
34904
|
-
reactRouterVersion: null,
|
|
34905
|
-
hasReactRouterFramework: false,
|
|
34906
34721
|
expoVersion: null,
|
|
34907
34722
|
shopifyFlashListVersion: null,
|
|
34908
34723
|
shopifyFlashListMajorVersion: null,
|
|
@@ -35021,27 +34836,9 @@ const discoverProject = (directory) => {
|
|
|
35021
34836
|
packageName: "mobx",
|
|
35022
34837
|
version: workspaceFacts.mobx.version
|
|
35023
34838
|
});
|
|
35024
|
-
const reactRouterVersion = workspaceFacts.reactRouter.packageName === null ? null : resolveCatalogBackedDependencyVersion({
|
|
35025
|
-
rootDirectory: directory,
|
|
35026
|
-
rootPackageJson: packageJson,
|
|
35027
|
-
packageName: workspaceFacts.reactRouter.packageName,
|
|
35028
|
-
version: workspaceFacts.reactRouter.version
|
|
35029
|
-
});
|
|
35030
34839
|
const preactVersion = getPreactVersion(packageJson);
|
|
35031
34840
|
const remotionVersion = workspaceFacts.remotionVersion;
|
|
35032
34841
|
const tanstackQueryVersion = getTanStackQueryVersion(packageJson) ?? workspaceFacts.tanstackQueryVersion;
|
|
35033
|
-
const reactThreeFiberVersion = workspaceFacts.reactThreeFiber.packageName ? resolveCatalogBackedDependencyVersion({
|
|
35034
|
-
rootDirectory: directory,
|
|
35035
|
-
rootPackageJson: packageJson,
|
|
35036
|
-
packageName: workspaceFacts.reactThreeFiber.packageName,
|
|
35037
|
-
version: workspaceFacts.reactThreeFiber.version
|
|
35038
|
-
}) : null;
|
|
35039
|
-
const threeVersion = resolveCatalogBackedDependencyVersion({
|
|
35040
|
-
rootDirectory: directory,
|
|
35041
|
-
rootPackageJson: packageJson,
|
|
35042
|
-
packageName: "three",
|
|
35043
|
-
version: workspaceFacts.threeVersion
|
|
35044
|
-
});
|
|
35045
34842
|
const isPreES2023Target = hasTypeScript && detectPreES2023Target(directory);
|
|
35046
34843
|
const projectInfo = {
|
|
35047
34844
|
rootDirectory: directory,
|
|
@@ -35074,20 +34871,12 @@ const discoverProject = (directory) => {
|
|
|
35074
34871
|
hasRemotion: workspaceFacts.hasRemotionDependency,
|
|
35075
34872
|
remotionVersion,
|
|
35076
34873
|
remotionMajorVersion: remotionVersion === null ? null : getLowestDependencyMajor(remotionVersion),
|
|
35077
|
-
hasThree: workspaceFacts.hasThree,
|
|
35078
|
-
threeVersion,
|
|
35079
|
-
threeRelease: parseThreeRelease(threeVersion),
|
|
35080
|
-
hasReactThreeFiber: workspaceFacts.hasReactThreeFiber,
|
|
35081
|
-
reactThreeFiberVersion,
|
|
35082
|
-
reactThreeFiberMajorVersion: reactThreeFiberVersion === null ? null : getLowestDependencyMajor(reactThreeFiberVersion),
|
|
35083
34874
|
hasSsrDependency: workspaceFacts.hasSsrDependency,
|
|
35084
34875
|
preactVersion,
|
|
35085
34876
|
preactMajorVersion: parseReactMajor(preactVersion),
|
|
35086
34877
|
hasReactNativeWorkspace,
|
|
35087
34878
|
nextjsVersion,
|
|
35088
34879
|
nextjsMajorVersion: nextjsVersion === null ? null : getLowestDependencyMajor(nextjsVersion),
|
|
35089
|
-
reactRouterVersion,
|
|
35090
|
-
hasReactRouterFramework: workspaceFacts.hasReactRouterFramework,
|
|
35091
34880
|
expoVersion,
|
|
35092
34881
|
shopifyFlashListVersion,
|
|
35093
34882
|
shopifyFlashListMajorVersion: shopifyFlashListVersion === null ? null : getLowestDependencyMajor(shopifyFlashListVersion),
|
|
@@ -38282,10 +38071,10 @@ const SSR_FRAMEWORKS = new Set([
|
|
|
38282
38071
|
"gatsby",
|
|
38283
38072
|
"tanstack-start"
|
|
38284
38073
|
]);
|
|
38285
|
-
const
|
|
38286
|
-
if (
|
|
38287
|
-
const
|
|
38288
|
-
for (let candidate = earliest; candidate <=
|
|
38074
|
+
const addMajorLadder = (capabilities, name, major, earliest, latest) => {
|
|
38075
|
+
if (major === null) return;
|
|
38076
|
+
const cappedMajor = Math.min(major, latest);
|
|
38077
|
+
for (let candidate = earliest; candidate <= cappedMajor; candidate += 1) capabilities.add(`${name}:${candidate}`);
|
|
38289
38078
|
};
|
|
38290
38079
|
const buildCapabilities = (project) => {
|
|
38291
38080
|
const capabilities = /* @__PURE__ */ new Set();
|
|
@@ -38299,16 +38088,7 @@ const buildCapabilities = (project) => {
|
|
|
38299
38088
|
if (project.isStaticExport) capabilities.add("nextjs:static-export");
|
|
38300
38089
|
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
|
|
38301
38090
|
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 16) capabilities.add("nextjs:16");
|
|
38302
|
-
|
|
38303
|
-
if (reactRouterVersion !== null) {
|
|
38304
|
-
capabilities.add("react-router");
|
|
38305
|
-
if (project.hasReactRouterFramework === true) capabilities.add("react-router-framework");
|
|
38306
|
-
const detectedVersion = parseReactMajorMinor(reactRouterVersion);
|
|
38307
|
-
if (detectedVersion !== null) {
|
|
38308
|
-
for (const threshold of REACT_ROUTER_CAPABILITY_THRESHOLDS) if (isMajorMinorAtLeast(detectedVersion, threshold)) capabilities.add(threshold.capability);
|
|
38309
|
-
}
|
|
38310
|
-
}
|
|
38311
|
-
addVersionCapabilityLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
|
|
38091
|
+
addMajorLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
|
|
38312
38092
|
if (project.reactMajorVersion !== null && project.reactMajorVersion >= 19 && isMajorMinorAtLeast(parseReactMajorMinor(project.reactVersion), {
|
|
38313
38093
|
major: 19,
|
|
38314
38094
|
minor: 2
|
|
@@ -38346,14 +38126,14 @@ const buildCapabilities = (project) => {
|
|
|
38346
38126
|
if (hasMobxReactObserverMemoGuard || hasMobxReactLiteObserverMemoGuard) capabilities.add("mobx-react-binding-observer-memo-guard");
|
|
38347
38127
|
if (project.hasMobxStateTree === true) capabilities.add("mobx-state-tree");
|
|
38348
38128
|
if (project.hasMobxReactObserver === true) capabilities.add("mobx-react-observer");
|
|
38349
|
-
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6)
|
|
38129
|
+
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6) addMajorLadder(capabilities, "mobx", project.mobxMajorVersion, 4, 6);
|
|
38350
38130
|
const mobxVersion = parseDependencyMajorMinor(project.mobxVersion);
|
|
38351
38131
|
if (project.mobxMajorVersion === 6 && mobxVersion !== null && isMajorMinorAtLeast(mobxVersion, {
|
|
38352
38132
|
major: 6,
|
|
38353
38133
|
minor: 10
|
|
38354
38134
|
})) capabilities.add("mobx:6.10");
|
|
38355
38135
|
if (project.zustandVersion !== void 0 && project.zustandVersion !== null) capabilities.add("zustand");
|
|
38356
|
-
if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5)
|
|
38136
|
+
if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5) addMajorLadder(capabilities, "zustand", project.zustandMajorVersion, 1, 5);
|
|
38357
38137
|
if (project.isPreES2023Target) capabilities.add("pre-es2023");
|
|
38358
38138
|
if (project.hasReactCompiler) capabilities.add("react-compiler");
|
|
38359
38139
|
if (Boolean(project.hasTanStackQuery) || Boolean(project.tanstackQueryVersion)) capabilities.add("tanstack-query");
|
|
@@ -38364,20 +38144,14 @@ const buildCapabilities = (project) => {
|
|
|
38364
38144
|
}
|
|
38365
38145
|
if (project.hasI18nLibrary) capabilities.add("i18n");
|
|
38366
38146
|
if (project.valtioVersion !== null) capabilities.add("valtio");
|
|
38367
|
-
|
|
38147
|
+
addMajorLadder(capabilities, "valtio", project.valtioMajorVersion, 1, 10);
|
|
38368
38148
|
if (project.hasRemotion) {
|
|
38369
38149
|
capabilities.add("remotion");
|
|
38370
|
-
|
|
38371
|
-
}
|
|
38372
|
-
if (project.hasThree || project.hasReactThreeFiber) capabilities.add("three");
|
|
38373
|
-
addVersionCapabilityLadder(capabilities, "three", project.threeRelease ?? null, 145, 250);
|
|
38374
|
-
if (project.hasReactThreeFiber) {
|
|
38375
|
-
capabilities.add("r3f");
|
|
38376
|
-
addVersionCapabilityLadder(capabilities, "r3f", project.reactThreeFiberMajorVersion ?? null, 3, 10);
|
|
38150
|
+
addMajorLadder(capabilities, "remotion", project.remotionMajorVersion ?? null, 4, 30);
|
|
38377
38151
|
}
|
|
38378
38152
|
if (project.hasTypeScript) capabilities.add("typescript");
|
|
38379
38153
|
if (project.preactVersion !== null) capabilities.add("preact");
|
|
38380
|
-
|
|
38154
|
+
addMajorLadder(capabilities, "preact", project.preactMajorVersion, 10, 20);
|
|
38381
38155
|
if (project.preactVersion !== null && project.reactVersion === null) capabilities.add("pure-preact");
|
|
38382
38156
|
return capabilities;
|
|
38383
38157
|
};
|
|
@@ -46044,5 +45818,5 @@ const startLanguageServer = () => {
|
|
|
46044
45818
|
};
|
|
46045
45819
|
//#endregion
|
|
46046
45820
|
export { startLanguageServer };
|
|
46047
|
-
!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]="
|
|
46048
|
-
//# debugId=
|
|
45821
|
+
!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]="f864b0b7-d64a-58b1-8eed-e2387bc445d5")}catch(e){}}();
|
|
45822
|
+
//# debugId=f864b0b7-d64a-58b1-8eed-e2387bc445d5
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.8.1-dev.
|
|
3
|
+
"version": "0.8.1-dev.fc1b3a3",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"vscode-uri": "^3.1.0",
|
|
67
67
|
"yaml": "^2.9.0",
|
|
68
68
|
"deslop-js": "0.8.1",
|
|
69
|
-
"oxlint-plugin-react-doctor": "0.8.1-dev.
|
|
69
|
+
"oxlint-plugin-react-doctor": "0.8.1-dev.fc1b3a3"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"commander": "^14.0.3",
|
|
76
76
|
"ora": "^9.4.0",
|
|
77
77
|
"@react-doctor/api": "0.8.1",
|
|
78
|
-
"@react-doctor/
|
|
79
|
-
"@react-doctor/
|
|
78
|
+
"@react-doctor/language-server": "0.8.1",
|
|
79
|
+
"@react-doctor/core": "0.8.1"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": "^20.19.0 || >=22.13.0"
|