react-doctor 0.8.1-dev.8e5ae45 → 0.8.1-dev.90e794f
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 +8 -151
- package/dist/index.d.ts +0 -24
- package/dist/index.js +5 -148
- package/dist/lsp.js +5 -148
- package/package.json +5 -5
package/dist/cli.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]="cc020c29-7bf9-5ff5-867d-058ebf813fa9")}catch(e){}}();
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as NodeChildProcess from "node:child_process";
|
|
5
5
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
@@ -37317,10 +37317,6 @@ const listWorkspacePackages = (rootDirectory) => {
|
|
|
37317
37317
|
return packages;
|
|
37318
37318
|
};
|
|
37319
37319
|
const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
|
|
37320
|
-
const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
37321
|
-
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
37322
|
-
const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
|
|
37323
|
-
const MOBX_REACT_OBSERVER_PACKAGE_NAME = "mobx-react-observer";
|
|
37324
37320
|
const SHOPIFY_FLASH_LIST_PACKAGE_NAME = "@shopify/flash-list";
|
|
37325
37321
|
const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootDirectory, rootPackageJson, sections, workspaceDirectory, workspacePackageJson }) => {
|
|
37326
37322
|
const dependencyDeclaration = getDependencyDeclaration({
|
|
@@ -37339,18 +37335,7 @@ const shouldReplaceReactVersion = (currentVersion, nextVersion) => {
|
|
|
37339
37335
|
if (nextMajor === null) return false;
|
|
37340
37336
|
return nextMajor < currentMajor;
|
|
37341
37337
|
};
|
|
37342
|
-
const
|
|
37343
|
-
if (currentFact.version === null) return true;
|
|
37344
|
-
if (nextFact.version === null) return false;
|
|
37345
|
-
const currentMajor = getLowestDependencyMajor(currentFact.version);
|
|
37346
|
-
const nextMajor = getLowestDependencyMajor(nextFact.version);
|
|
37347
|
-
if (currentMajor === null) return false;
|
|
37348
|
-
if (nextMajor === null) return true;
|
|
37349
|
-
if (currentMajor > latestSupportedMajor) return false;
|
|
37350
|
-
if (nextMajor > latestSupportedMajor) return true;
|
|
37351
|
-
return nextMajor < currentMajor;
|
|
37352
|
-
};
|
|
37353
|
-
const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, rootPackageJson) => {
|
|
37338
|
+
const evaluateManifestFacts = (facts, packageJson, directory) => {
|
|
37354
37339
|
if (facts.expo.version === null) {
|
|
37355
37340
|
const spec = getDependencySpec(packageJson, "expo");
|
|
37356
37341
|
if (spec !== null) facts.expo = {
|
|
@@ -37372,65 +37357,13 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
37372
37357
|
sourceDirectory: directory
|
|
37373
37358
|
};
|
|
37374
37359
|
}
|
|
37375
|
-
const mobxSpec = getDependencySpec(packageJson, "mobx");
|
|
37376
|
-
if (mobxSpec !== null) {
|
|
37377
|
-
const nextMobxFact = {
|
|
37378
|
-
version: resolveCatalogBackedDependencyVersion({
|
|
37379
|
-
rootDirectory: directory,
|
|
37380
|
-
rootPackageJson: packageJson,
|
|
37381
|
-
packageName: "mobx",
|
|
37382
|
-
version: mobxSpec
|
|
37383
|
-
}),
|
|
37384
|
-
sourceDirectory: directory
|
|
37385
|
-
};
|
|
37386
|
-
if (shouldReplaceSupportedDependencyFact(facts.mobx, nextMobxFact, 6)) facts.mobx = nextMobxFact;
|
|
37387
|
-
}
|
|
37388
|
-
facts.hasMobxReact = facts.hasMobxReact || getDependencySpec(packageJson, MOBX_REACT_PACKAGE_NAME) !== null;
|
|
37389
|
-
facts.hasMobxReactLite = facts.hasMobxReactLite || getDependencySpec(packageJson, MOBX_REACT_LITE_PACKAGE_NAME) !== null;
|
|
37390
|
-
facts.hasMobxStateTree = facts.hasMobxStateTree || getDependencySpec(packageJson, MOBX_STATE_TREE_PACKAGE_NAME) !== null;
|
|
37391
|
-
facts.hasMobxReactObserver = facts.hasMobxReactObserver || getDependencySpec(packageJson, MOBX_REACT_OBSERVER_PACKAGE_NAME) !== null;
|
|
37392
|
-
const zustandSpec = getDependencySpec(packageJson, "zustand");
|
|
37393
|
-
if (zustandSpec !== null) {
|
|
37394
|
-
const nextZustandFact = {
|
|
37395
|
-
version: resolveCatalogBackedDependencyVersion({
|
|
37396
|
-
rootDirectory: directory,
|
|
37397
|
-
rootPackageJson: packageJson,
|
|
37398
|
-
packageName: "zustand",
|
|
37399
|
-
version: zustandSpec
|
|
37400
|
-
}),
|
|
37401
|
-
sourceDirectory: directory
|
|
37402
|
-
};
|
|
37403
|
-
if (shouldReplaceSupportedDependencyFact(facts.zustand, nextZustandFact, 5)) facts.zustand = nextZustandFact;
|
|
37404
|
-
}
|
|
37405
37360
|
if (facts.reanimatedVersion === null) {
|
|
37406
37361
|
const spec = getDependencySpec(packageJson, REANIMATED_DEPENDENCY_NAME);
|
|
37407
37362
|
if (spec !== null) facts.reanimatedVersion = spec;
|
|
37408
37363
|
}
|
|
37409
|
-
if (facts.valtioVersion === null) {
|
|
37410
|
-
const spec = getDependencySpec(packageJson, "valtio");
|
|
37411
|
-
if (spec !== null) facts.valtioVersion = spec;
|
|
37412
|
-
}
|
|
37413
37364
|
facts.hasReactNativeAwarePackage = facts.hasReactNativeAwarePackage || isPackageJsonReactNativeAware(packageJson);
|
|
37414
37365
|
facts.hasReanimatedAwarePackage = facts.hasReanimatedAwarePackage || isPackageJsonReanimatedAware(packageJson);
|
|
37415
37366
|
facts.hasSsrDependency = facts.hasSsrDependency || isPackageJsonSsrAware(packageJson);
|
|
37416
|
-
const remotionSpec = getDependencySpec(packageJson, "remotion");
|
|
37417
|
-
if (remotionSpec !== null) {
|
|
37418
|
-
facts.hasRemotionDependency = true;
|
|
37419
|
-
const resolvedRemotionVersion = resolveCatalogBackedDependencyVersion({
|
|
37420
|
-
rootDirectory,
|
|
37421
|
-
rootPackageJson,
|
|
37422
|
-
packageName: "remotion",
|
|
37423
|
-
version: remotionSpec
|
|
37424
|
-
});
|
|
37425
|
-
const remotionMajorVersion = resolvedRemotionVersion === null ? null : getLowestDependencyMajor(resolvedRemotionVersion);
|
|
37426
|
-
if (remotionMajorVersion === null) {
|
|
37427
|
-
facts.hasUnknownRemotionVersion = true;
|
|
37428
|
-
facts.remotionVersion = null;
|
|
37429
|
-
} else if (!facts.hasUnknownRemotionVersion) {
|
|
37430
|
-
const currentRemotionMajorVersion = facts.remotionVersion === null ? null : getLowestDependencyMajor(facts.remotionVersion);
|
|
37431
|
-
if (currentRemotionMajorVersion === null || remotionMajorVersion < currentRemotionMajorVersion) facts.remotionVersion = resolvedRemotionVersion;
|
|
37432
|
-
}
|
|
37433
|
-
}
|
|
37434
37367
|
};
|
|
37435
37368
|
const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGroup }) => {
|
|
37436
37369
|
const facts = {
|
|
@@ -37450,28 +37383,12 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
37450
37383
|
version: null,
|
|
37451
37384
|
sourceDirectory: null
|
|
37452
37385
|
},
|
|
37453
|
-
valtioVersion: null,
|
|
37454
|
-
mobx: {
|
|
37455
|
-
version: null,
|
|
37456
|
-
sourceDirectory: null
|
|
37457
|
-
},
|
|
37458
|
-
hasMobxReact: false,
|
|
37459
|
-
hasMobxReactLite: false,
|
|
37460
|
-
hasMobxStateTree: false,
|
|
37461
|
-
hasMobxReactObserver: false,
|
|
37462
|
-
zustand: {
|
|
37463
|
-
version: null,
|
|
37464
|
-
sourceDirectory: null
|
|
37465
|
-
},
|
|
37466
37386
|
hasReactNativeAwarePackage: false,
|
|
37467
37387
|
hasReanimatedAwarePackage: false,
|
|
37468
37388
|
hasSsrDependency: false,
|
|
37469
|
-
hasRemotionDependency: false,
|
|
37470
|
-
hasUnknownRemotionVersion: false,
|
|
37471
|
-
remotionVersion: null,
|
|
37472
37389
|
reanimatedVersion: null
|
|
37473
37390
|
};
|
|
37474
|
-
evaluateManifestFacts(facts, rootPackageJson, rootDirectory
|
|
37391
|
+
evaluateManifestFacts(facts, rootPackageJson, rootDirectory);
|
|
37475
37392
|
let isReactGroupSettled = !collectReactGroup;
|
|
37476
37393
|
const visitedDirectories = /* @__PURE__ */ new Set();
|
|
37477
37394
|
for (const pattern of getWorkspacePatterns(rootDirectory, rootPackageJson)) {
|
|
@@ -37480,7 +37397,7 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
37480
37397
|
if (visitedDirectories.has(workspaceDirectory)) continue;
|
|
37481
37398
|
visitedDirectories.add(workspaceDirectory);
|
|
37482
37399
|
const workspacePackageJson = readPackageJson$1(Path.join(workspaceDirectory, "package.json"));
|
|
37483
|
-
evaluateManifestFacts(facts, workspacePackageJson, workspaceDirectory
|
|
37400
|
+
evaluateManifestFacts(facts, workspacePackageJson, workspaceDirectory);
|
|
37484
37401
|
const info = extractDependencyInfo(workspacePackageJson);
|
|
37485
37402
|
if (info.framework !== "unknown" && frameworkMergeRank(info.framework) < frameworkMergeRank(facts.framework)) facts.framework = info.framework;
|
|
37486
37403
|
if (isReactGroupSettled) continue;
|
|
@@ -37701,24 +37618,11 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
37701
37618
|
tailwindVersion: null,
|
|
37702
37619
|
zodVersion: null,
|
|
37703
37620
|
zodMajorVersion: null,
|
|
37704
|
-
mobxVersion: null,
|
|
37705
|
-
mobxMajorVersion: null,
|
|
37706
|
-
hasMobxReact: false,
|
|
37707
|
-
hasMobxReactLite: false,
|
|
37708
|
-
hasMobxStateTree: false,
|
|
37709
|
-
hasMobxReactObserver: false,
|
|
37710
|
-
zustandVersion: null,
|
|
37711
|
-
zustandMajorVersion: null,
|
|
37712
37621
|
framework: "unknown",
|
|
37713
37622
|
hasTypeScript: hasOwnTsConfig,
|
|
37714
37623
|
hasReactCompiler: false,
|
|
37715
37624
|
hasReactCompilerLintPlugin: false,
|
|
37716
37625
|
hasTanStackQuery: false,
|
|
37717
|
-
valtioVersion: null,
|
|
37718
|
-
valtioMajorVersion: null,
|
|
37719
|
-
hasRemotion: false,
|
|
37720
|
-
remotionVersion: null,
|
|
37721
|
-
remotionMajorVersion: null,
|
|
37722
37626
|
hasSsrDependency: false,
|
|
37723
37627
|
preactVersion: null,
|
|
37724
37628
|
preactMajorVersion: null,
|
|
@@ -37817,12 +37721,6 @@ const discoverProject = (directory) => {
|
|
|
37817
37721
|
packageName: SHOPIFY_FLASH_LIST_PACKAGE_NAME,
|
|
37818
37722
|
version: workspaceFacts.shopifyFlashList.version
|
|
37819
37723
|
}) : null;
|
|
37820
|
-
const zustandVersion = resolveCatalogBackedDependencyVersion({
|
|
37821
|
-
rootDirectory: directory,
|
|
37822
|
-
rootPackageJson: packageJson,
|
|
37823
|
-
packageName: "zustand",
|
|
37824
|
-
version: workspaceFacts.zustand.version
|
|
37825
|
-
});
|
|
37826
37724
|
const hasReanimated = hasReactNativeWorkspace && workspaceFacts.hasReanimatedAwarePackage;
|
|
37827
37725
|
const reanimatedVersion = hasReanimated ? workspaceFacts.reanimatedVersion : null;
|
|
37828
37726
|
const nextjsVersion = framework === "nextjs" ? resolveCatalogBackedDependencyVersion({
|
|
@@ -37831,20 +37729,7 @@ const discoverProject = (directory) => {
|
|
|
37831
37729
|
packageName: "next",
|
|
37832
37730
|
version: workspaceFacts.next.version
|
|
37833
37731
|
}) : null;
|
|
37834
|
-
const valtioVersion = resolveCatalogBackedDependencyVersion({
|
|
37835
|
-
rootDirectory: directory,
|
|
37836
|
-
rootPackageJson: packageJson,
|
|
37837
|
-
packageName: "valtio",
|
|
37838
|
-
version: workspaceFacts.valtioVersion
|
|
37839
|
-
});
|
|
37840
|
-
const mobxVersion = resolveCatalogBackedDependencyVersion({
|
|
37841
|
-
rootDirectory: directory,
|
|
37842
|
-
rootPackageJson: packageJson,
|
|
37843
|
-
packageName: "mobx",
|
|
37844
|
-
version: workspaceFacts.mobx.version
|
|
37845
|
-
});
|
|
37846
37732
|
const preactVersion = getPreactVersion(packageJson);
|
|
37847
|
-
const remotionVersion = workspaceFacts.remotionVersion;
|
|
37848
37733
|
const isPreES2023Target = hasTypeScript && detectPreES2023Target(directory);
|
|
37849
37734
|
const projectInfo = {
|
|
37850
37735
|
rootDirectory: directory,
|
|
@@ -37854,24 +37739,11 @@ const discoverProject = (directory) => {
|
|
|
37854
37739
|
tailwindVersion,
|
|
37855
37740
|
zodVersion,
|
|
37856
37741
|
zodMajorVersion: zodVersion === null ? null : getLowestDependencyMajor(zodVersion),
|
|
37857
|
-
mobxVersion,
|
|
37858
|
-
mobxMajorVersion: mobxVersion === null ? null : getLowestDependencyMajor(mobxVersion),
|
|
37859
|
-
hasMobxReact: workspaceFacts.hasMobxReact,
|
|
37860
|
-
hasMobxReactLite: workspaceFacts.hasMobxReactLite,
|
|
37861
|
-
hasMobxStateTree: workspaceFacts.hasMobxStateTree,
|
|
37862
|
-
hasMobxReactObserver: workspaceFacts.hasMobxReactObserver,
|
|
37863
|
-
zustandVersion,
|
|
37864
|
-
zustandMajorVersion: zustandVersion === null ? null : getLowestDependencyMajor(zustandVersion),
|
|
37865
37742
|
framework,
|
|
37866
37743
|
hasTypeScript,
|
|
37867
37744
|
hasReactCompiler: detectReactCompiler(directory, packageJson),
|
|
37868
37745
|
hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
|
|
37869
37746
|
hasTanStackQuery: hasTanStackQuery(packageJson),
|
|
37870
|
-
valtioVersion,
|
|
37871
|
-
valtioMajorVersion: valtioVersion === null ? null : getLowestDependencyMajor(valtioVersion),
|
|
37872
|
-
hasRemotion: workspaceFacts.hasRemotionDependency,
|
|
37873
|
-
remotionVersion,
|
|
37874
|
-
remotionMajorVersion: remotionVersion === null ? null : getLowestDependencyMajor(remotionVersion),
|
|
37875
37747
|
hasSsrDependency: workspaceFacts.hasSsrDependency,
|
|
37876
37748
|
preactVersion,
|
|
37877
37749
|
preactMajorVersion: parseReactMajor(preactVersion),
|
|
@@ -41209,24 +41081,9 @@ const buildCapabilities = (project) => {
|
|
|
41209
41081
|
})) capabilities.add("tailwind:3.4");
|
|
41210
41082
|
if (project.zodVersion !== null) capabilities.add("zod");
|
|
41211
41083
|
if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
|
|
41212
|
-
if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
|
|
41213
|
-
if (project.hasMobxReact === true) capabilities.add("mobx-react");
|
|
41214
|
-
if (project.hasMobxReactLite === true) capabilities.add("mobx-react-lite");
|
|
41215
|
-
if (project.hasMobxReact === true || project.hasMobxReactLite === true) capabilities.add("mobx-react-binding");
|
|
41216
|
-
if (project.hasMobxStateTree === true) capabilities.add("mobx-state-tree");
|
|
41217
|
-
if (project.hasMobxReactObserver === true) capabilities.add("mobx-react-observer");
|
|
41218
|
-
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6) addMajorLadder(capabilities, "mobx", project.mobxMajorVersion, 4, 6);
|
|
41219
|
-
if (project.zustandVersion !== void 0 && project.zustandVersion !== null) capabilities.add("zustand");
|
|
41220
|
-
if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5) addMajorLadder(capabilities, "zustand", project.zustandMajorVersion, 1, 5);
|
|
41221
41084
|
if (project.isPreES2023Target) capabilities.add("pre-es2023");
|
|
41222
41085
|
if (project.hasReactCompiler) capabilities.add("react-compiler");
|
|
41223
41086
|
if (project.hasTanStackQuery) capabilities.add("tanstack-query");
|
|
41224
|
-
if (project.valtioVersion !== null) capabilities.add("valtio");
|
|
41225
|
-
addMajorLadder(capabilities, "valtio", project.valtioMajorVersion, 1, 10);
|
|
41226
|
-
if (project.hasRemotion) {
|
|
41227
|
-
capabilities.add("remotion");
|
|
41228
|
-
addMajorLadder(capabilities, "remotion", project.remotionMajorVersion ?? null, 4, 30);
|
|
41229
|
-
}
|
|
41230
41087
|
if (project.hasTypeScript) capabilities.add("typescript");
|
|
41231
41088
|
if (project.preactVersion !== null) capabilities.add("preact");
|
|
41232
41089
|
addMajorLadder(capabilities, "preact", project.preactMajorVersion, 10, 20);
|
|
@@ -47510,7 +47367,7 @@ const makeNoopConsole = () => ({
|
|
|
47510
47367
|
});
|
|
47511
47368
|
//#endregion
|
|
47512
47369
|
//#region src/cli/utils/version.ts
|
|
47513
|
-
const VERSION = "0.8.1-dev.
|
|
47370
|
+
const VERSION = "0.8.1-dev.90e794f";
|
|
47514
47371
|
//#endregion
|
|
47515
47372
|
//#region src/cli/utils/json-mode.ts
|
|
47516
47373
|
let context = null;
|
|
@@ -47862,13 +47719,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
47862
47719
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
47863
47720
|
* standard `SENTRY_RELEASE` override.
|
|
47864
47721
|
*/
|
|
47865
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.8.1-dev.
|
|
47722
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.8.1-dev.90e794f`;
|
|
47866
47723
|
/**
|
|
47867
47724
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
47868
47725
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
47869
47726
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
47870
47727
|
*/
|
|
47871
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.8.1-dev.
|
|
47728
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.8.1-dev.90e794f") ? "development" : "production");
|
|
47872
47729
|
/**
|
|
47873
47730
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
47874
47731
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -66548,4 +66405,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
66548
66405
|
export {};
|
|
66549
66406
|
|
|
66550
66407
|
//# sourceMappingURL=cli.js.map
|
|
66551
|
-
//# debugId=
|
|
66408
|
+
//# debugId=cc020c29-7bf9-5ff5-867d-058ebf813fa9
|
package/dist/index.d.ts
CHANGED
|
@@ -9543,35 +9543,11 @@ interface ProjectInfo {
|
|
|
9543
9543
|
zodVersion: string | null;
|
|
9544
9544
|
/** Parsed major from `zodVersion`, or `null` when absent/unparseable. Mirrors `reactMajorVersion`. */
|
|
9545
9545
|
zodMajorVersion: number | null;
|
|
9546
|
-
/** Declared MobX core version spec. Optional so existing `ProjectInfo` consumers remain source-compatible. */
|
|
9547
|
-
mobxVersion?: string | null;
|
|
9548
|
-
/** Parsed major from `mobxVersion`, or `null` when absent/unparseable. */
|
|
9549
|
-
mobxMajorVersion?: number | null;
|
|
9550
|
-
hasMobxReact?: boolean;
|
|
9551
|
-
hasMobxReactLite?: boolean;
|
|
9552
|
-
hasMobxStateTree?: boolean;
|
|
9553
|
-
hasMobxReactObserver?: boolean;
|
|
9554
|
-
/** Declared Zustand version spec. Optional so existing `ProjectInfo` consumers remain source-compatible. */
|
|
9555
|
-
zustandVersion?: string | null;
|
|
9556
|
-
/** Parsed major from `zustandVersion`, or `null` when absent/unparseable. */
|
|
9557
|
-
zustandMajorVersion?: number | null;
|
|
9558
9546
|
framework: Framework;
|
|
9559
9547
|
hasTypeScript: boolean;
|
|
9560
9548
|
hasReactCompiler: boolean;
|
|
9561
9549
|
hasReactCompilerLintPlugin?: boolean;
|
|
9562
9550
|
hasTanStackQuery: boolean;
|
|
9563
|
-
hasRemotion?: boolean;
|
|
9564
|
-
remotionVersion?: string | null;
|
|
9565
|
-
remotionMajorVersion?: number | null;
|
|
9566
|
-
/**
|
|
9567
|
-
* The declared `valtio` version spec, or `null` when no package in the
|
|
9568
|
-
* analyzed project declares Valtio. `useSnapshot` has kept the same
|
|
9569
|
-
* render-read contract across Valtio 1 and 2, so presence alone drives the
|
|
9570
|
-
* `valtio` capability and its parsed major-version ladder.
|
|
9571
|
-
*/
|
|
9572
|
-
valtioVersion: string | null;
|
|
9573
|
-
/** Parsed major from `valtioVersion`, or `null` when absent/unparseable. */
|
|
9574
|
-
valtioMajorVersion: number | null;
|
|
9575
9551
|
/**
|
|
9576
9552
|
* `true` when the project or a workspace declares a Vite-based SSR runtime
|
|
9577
9553
|
* such as React Router's Node adapter, Vike, or vite-plugin-ssr.
|
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]="ba0e3885-0c68-5322-b382-578d3d89d5c5")}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";
|
|
@@ -34121,10 +34121,6 @@ const listWorkspacePackages = (rootDirectory) => {
|
|
|
34121
34121
|
return packages;
|
|
34122
34122
|
};
|
|
34123
34123
|
const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
|
|
34124
|
-
const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
34125
|
-
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
34126
|
-
const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
|
|
34127
|
-
const MOBX_REACT_OBSERVER_PACKAGE_NAME = "mobx-react-observer";
|
|
34128
34124
|
const SHOPIFY_FLASH_LIST_PACKAGE_NAME = "@shopify/flash-list";
|
|
34129
34125
|
const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootDirectory, rootPackageJson, sections, workspaceDirectory, workspacePackageJson }) => {
|
|
34130
34126
|
const dependencyDeclaration = getDependencyDeclaration({
|
|
@@ -34143,18 +34139,7 @@ const shouldReplaceReactVersion = (currentVersion, nextVersion) => {
|
|
|
34143
34139
|
if (nextMajor === null) return false;
|
|
34144
34140
|
return nextMajor < currentMajor;
|
|
34145
34141
|
};
|
|
34146
|
-
const
|
|
34147
|
-
if (currentFact.version === null) return true;
|
|
34148
|
-
if (nextFact.version === null) return false;
|
|
34149
|
-
const currentMajor = getLowestDependencyMajor(currentFact.version);
|
|
34150
|
-
const nextMajor = getLowestDependencyMajor(nextFact.version);
|
|
34151
|
-
if (currentMajor === null) return false;
|
|
34152
|
-
if (nextMajor === null) return true;
|
|
34153
|
-
if (currentMajor > latestSupportedMajor) return false;
|
|
34154
|
-
if (nextMajor > latestSupportedMajor) return true;
|
|
34155
|
-
return nextMajor < currentMajor;
|
|
34156
|
-
};
|
|
34157
|
-
const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, rootPackageJson) => {
|
|
34142
|
+
const evaluateManifestFacts = (facts, packageJson, directory) => {
|
|
34158
34143
|
if (facts.expo.version === null) {
|
|
34159
34144
|
const spec = getDependencySpec(packageJson, "expo");
|
|
34160
34145
|
if (spec !== null) facts.expo = {
|
|
@@ -34176,65 +34161,13 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34176
34161
|
sourceDirectory: directory
|
|
34177
34162
|
};
|
|
34178
34163
|
}
|
|
34179
|
-
const mobxSpec = getDependencySpec(packageJson, "mobx");
|
|
34180
|
-
if (mobxSpec !== null) {
|
|
34181
|
-
const nextMobxFact = {
|
|
34182
|
-
version: resolveCatalogBackedDependencyVersion({
|
|
34183
|
-
rootDirectory: directory,
|
|
34184
|
-
rootPackageJson: packageJson,
|
|
34185
|
-
packageName: "mobx",
|
|
34186
|
-
version: mobxSpec
|
|
34187
|
-
}),
|
|
34188
|
-
sourceDirectory: directory
|
|
34189
|
-
};
|
|
34190
|
-
if (shouldReplaceSupportedDependencyFact(facts.mobx, nextMobxFact, 6)) facts.mobx = nextMobxFact;
|
|
34191
|
-
}
|
|
34192
|
-
facts.hasMobxReact = facts.hasMobxReact || getDependencySpec(packageJson, MOBX_REACT_PACKAGE_NAME) !== null;
|
|
34193
|
-
facts.hasMobxReactLite = facts.hasMobxReactLite || getDependencySpec(packageJson, MOBX_REACT_LITE_PACKAGE_NAME) !== null;
|
|
34194
|
-
facts.hasMobxStateTree = facts.hasMobxStateTree || getDependencySpec(packageJson, MOBX_STATE_TREE_PACKAGE_NAME) !== null;
|
|
34195
|
-
facts.hasMobxReactObserver = facts.hasMobxReactObserver || getDependencySpec(packageJson, MOBX_REACT_OBSERVER_PACKAGE_NAME) !== null;
|
|
34196
|
-
const zustandSpec = getDependencySpec(packageJson, "zustand");
|
|
34197
|
-
if (zustandSpec !== null) {
|
|
34198
|
-
const nextZustandFact = {
|
|
34199
|
-
version: resolveCatalogBackedDependencyVersion({
|
|
34200
|
-
rootDirectory: directory,
|
|
34201
|
-
rootPackageJson: packageJson,
|
|
34202
|
-
packageName: "zustand",
|
|
34203
|
-
version: zustandSpec
|
|
34204
|
-
}),
|
|
34205
|
-
sourceDirectory: directory
|
|
34206
|
-
};
|
|
34207
|
-
if (shouldReplaceSupportedDependencyFact(facts.zustand, nextZustandFact, 5)) facts.zustand = nextZustandFact;
|
|
34208
|
-
}
|
|
34209
34164
|
if (facts.reanimatedVersion === null) {
|
|
34210
34165
|
const spec = getDependencySpec(packageJson, REANIMATED_DEPENDENCY_NAME);
|
|
34211
34166
|
if (spec !== null) facts.reanimatedVersion = spec;
|
|
34212
34167
|
}
|
|
34213
|
-
if (facts.valtioVersion === null) {
|
|
34214
|
-
const spec = getDependencySpec(packageJson, "valtio");
|
|
34215
|
-
if (spec !== null) facts.valtioVersion = spec;
|
|
34216
|
-
}
|
|
34217
34168
|
facts.hasReactNativeAwarePackage = facts.hasReactNativeAwarePackage || isPackageJsonReactNativeAware(packageJson);
|
|
34218
34169
|
facts.hasReanimatedAwarePackage = facts.hasReanimatedAwarePackage || isPackageJsonReanimatedAware(packageJson);
|
|
34219
34170
|
facts.hasSsrDependency = facts.hasSsrDependency || isPackageJsonSsrAware(packageJson);
|
|
34220
|
-
const remotionSpec = getDependencySpec(packageJson, "remotion");
|
|
34221
|
-
if (remotionSpec !== null) {
|
|
34222
|
-
facts.hasRemotionDependency = true;
|
|
34223
|
-
const resolvedRemotionVersion = resolveCatalogBackedDependencyVersion({
|
|
34224
|
-
rootDirectory,
|
|
34225
|
-
rootPackageJson,
|
|
34226
|
-
packageName: "remotion",
|
|
34227
|
-
version: remotionSpec
|
|
34228
|
-
});
|
|
34229
|
-
const remotionMajorVersion = resolvedRemotionVersion === null ? null : getLowestDependencyMajor(resolvedRemotionVersion);
|
|
34230
|
-
if (remotionMajorVersion === null) {
|
|
34231
|
-
facts.hasUnknownRemotionVersion = true;
|
|
34232
|
-
facts.remotionVersion = null;
|
|
34233
|
-
} else if (!facts.hasUnknownRemotionVersion) {
|
|
34234
|
-
const currentRemotionMajorVersion = facts.remotionVersion === null ? null : getLowestDependencyMajor(facts.remotionVersion);
|
|
34235
|
-
if (currentRemotionMajorVersion === null || remotionMajorVersion < currentRemotionMajorVersion) facts.remotionVersion = resolvedRemotionVersion;
|
|
34236
|
-
}
|
|
34237
|
-
}
|
|
34238
34171
|
};
|
|
34239
34172
|
const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGroup }) => {
|
|
34240
34173
|
const facts = {
|
|
@@ -34254,28 +34187,12 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34254
34187
|
version: null,
|
|
34255
34188
|
sourceDirectory: null
|
|
34256
34189
|
},
|
|
34257
|
-
valtioVersion: null,
|
|
34258
|
-
mobx: {
|
|
34259
|
-
version: null,
|
|
34260
|
-
sourceDirectory: null
|
|
34261
|
-
},
|
|
34262
|
-
hasMobxReact: false,
|
|
34263
|
-
hasMobxReactLite: false,
|
|
34264
|
-
hasMobxStateTree: false,
|
|
34265
|
-
hasMobxReactObserver: false,
|
|
34266
|
-
zustand: {
|
|
34267
|
-
version: null,
|
|
34268
|
-
sourceDirectory: null
|
|
34269
|
-
},
|
|
34270
34190
|
hasReactNativeAwarePackage: false,
|
|
34271
34191
|
hasReanimatedAwarePackage: false,
|
|
34272
34192
|
hasSsrDependency: false,
|
|
34273
|
-
hasRemotionDependency: false,
|
|
34274
|
-
hasUnknownRemotionVersion: false,
|
|
34275
|
-
remotionVersion: null,
|
|
34276
34193
|
reanimatedVersion: null
|
|
34277
34194
|
};
|
|
34278
|
-
evaluateManifestFacts(facts, rootPackageJson, rootDirectory
|
|
34195
|
+
evaluateManifestFacts(facts, rootPackageJson, rootDirectory);
|
|
34279
34196
|
let isReactGroupSettled = !collectReactGroup;
|
|
34280
34197
|
const visitedDirectories = /* @__PURE__ */ new Set();
|
|
34281
34198
|
for (const pattern of getWorkspacePatterns(rootDirectory, rootPackageJson)) {
|
|
@@ -34284,7 +34201,7 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34284
34201
|
if (visitedDirectories.has(workspaceDirectory)) continue;
|
|
34285
34202
|
visitedDirectories.add(workspaceDirectory);
|
|
34286
34203
|
const workspacePackageJson = readPackageJson(Path.join(workspaceDirectory, "package.json"));
|
|
34287
|
-
evaluateManifestFacts(facts, workspacePackageJson, workspaceDirectory
|
|
34204
|
+
evaluateManifestFacts(facts, workspacePackageJson, workspaceDirectory);
|
|
34288
34205
|
const info = extractDependencyInfo(workspacePackageJson);
|
|
34289
34206
|
if (info.framework !== "unknown" && frameworkMergeRank(info.framework) < frameworkMergeRank(facts.framework)) facts.framework = info.framework;
|
|
34290
34207
|
if (isReactGroupSettled) continue;
|
|
@@ -34508,24 +34425,11 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
34508
34425
|
tailwindVersion: null,
|
|
34509
34426
|
zodVersion: null,
|
|
34510
34427
|
zodMajorVersion: null,
|
|
34511
|
-
mobxVersion: null,
|
|
34512
|
-
mobxMajorVersion: null,
|
|
34513
|
-
hasMobxReact: false,
|
|
34514
|
-
hasMobxReactLite: false,
|
|
34515
|
-
hasMobxStateTree: false,
|
|
34516
|
-
hasMobxReactObserver: false,
|
|
34517
|
-
zustandVersion: null,
|
|
34518
|
-
zustandMajorVersion: null,
|
|
34519
34428
|
framework: "unknown",
|
|
34520
34429
|
hasTypeScript: hasOwnTsConfig,
|
|
34521
34430
|
hasReactCompiler: false,
|
|
34522
34431
|
hasReactCompilerLintPlugin: false,
|
|
34523
34432
|
hasTanStackQuery: false,
|
|
34524
|
-
valtioVersion: null,
|
|
34525
|
-
valtioMajorVersion: null,
|
|
34526
|
-
hasRemotion: false,
|
|
34527
|
-
remotionVersion: null,
|
|
34528
|
-
remotionMajorVersion: null,
|
|
34529
34433
|
hasSsrDependency: false,
|
|
34530
34434
|
preactVersion: null,
|
|
34531
34435
|
preactMajorVersion: null,
|
|
@@ -34624,12 +34528,6 @@ const discoverProject = (directory) => {
|
|
|
34624
34528
|
packageName: SHOPIFY_FLASH_LIST_PACKAGE_NAME,
|
|
34625
34529
|
version: workspaceFacts.shopifyFlashList.version
|
|
34626
34530
|
}) : null;
|
|
34627
|
-
const zustandVersion = resolveCatalogBackedDependencyVersion({
|
|
34628
|
-
rootDirectory: directory,
|
|
34629
|
-
rootPackageJson: packageJson,
|
|
34630
|
-
packageName: "zustand",
|
|
34631
|
-
version: workspaceFacts.zustand.version
|
|
34632
|
-
});
|
|
34633
34531
|
const hasReanimated = hasReactNativeWorkspace && workspaceFacts.hasReanimatedAwarePackage;
|
|
34634
34532
|
const reanimatedVersion = hasReanimated ? workspaceFacts.reanimatedVersion : null;
|
|
34635
34533
|
const nextjsVersion = framework === "nextjs" ? resolveCatalogBackedDependencyVersion({
|
|
@@ -34638,20 +34536,7 @@ const discoverProject = (directory) => {
|
|
|
34638
34536
|
packageName: "next",
|
|
34639
34537
|
version: workspaceFacts.next.version
|
|
34640
34538
|
}) : null;
|
|
34641
|
-
const valtioVersion = resolveCatalogBackedDependencyVersion({
|
|
34642
|
-
rootDirectory: directory,
|
|
34643
|
-
rootPackageJson: packageJson,
|
|
34644
|
-
packageName: "valtio",
|
|
34645
|
-
version: workspaceFacts.valtioVersion
|
|
34646
|
-
});
|
|
34647
|
-
const mobxVersion = resolveCatalogBackedDependencyVersion({
|
|
34648
|
-
rootDirectory: directory,
|
|
34649
|
-
rootPackageJson: packageJson,
|
|
34650
|
-
packageName: "mobx",
|
|
34651
|
-
version: workspaceFacts.mobx.version
|
|
34652
|
-
});
|
|
34653
34539
|
const preactVersion = getPreactVersion(packageJson);
|
|
34654
|
-
const remotionVersion = workspaceFacts.remotionVersion;
|
|
34655
34540
|
const isPreES2023Target = hasTypeScript && detectPreES2023Target(directory);
|
|
34656
34541
|
const projectInfo = {
|
|
34657
34542
|
rootDirectory: directory,
|
|
@@ -34661,24 +34546,11 @@ const discoverProject = (directory) => {
|
|
|
34661
34546
|
tailwindVersion,
|
|
34662
34547
|
zodVersion,
|
|
34663
34548
|
zodMajorVersion: zodVersion === null ? null : getLowestDependencyMajor(zodVersion),
|
|
34664
|
-
mobxVersion,
|
|
34665
|
-
mobxMajorVersion: mobxVersion === null ? null : getLowestDependencyMajor(mobxVersion),
|
|
34666
|
-
hasMobxReact: workspaceFacts.hasMobxReact,
|
|
34667
|
-
hasMobxReactLite: workspaceFacts.hasMobxReactLite,
|
|
34668
|
-
hasMobxStateTree: workspaceFacts.hasMobxStateTree,
|
|
34669
|
-
hasMobxReactObserver: workspaceFacts.hasMobxReactObserver,
|
|
34670
|
-
zustandVersion,
|
|
34671
|
-
zustandMajorVersion: zustandVersion === null ? null : getLowestDependencyMajor(zustandVersion),
|
|
34672
34549
|
framework,
|
|
34673
34550
|
hasTypeScript,
|
|
34674
34551
|
hasReactCompiler: detectReactCompiler(directory, packageJson),
|
|
34675
34552
|
hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
|
|
34676
34553
|
hasTanStackQuery: hasTanStackQuery(packageJson),
|
|
34677
|
-
valtioVersion,
|
|
34678
|
-
valtioMajorVersion: valtioVersion === null ? null : getLowestDependencyMajor(valtioVersion),
|
|
34679
|
-
hasRemotion: workspaceFacts.hasRemotionDependency,
|
|
34680
|
-
remotionVersion,
|
|
34681
|
-
remotionMajorVersion: remotionVersion === null ? null : getLowestDependencyMajor(remotionVersion),
|
|
34682
34554
|
hasSsrDependency: workspaceFacts.hasSsrDependency,
|
|
34683
34555
|
preactVersion,
|
|
34684
34556
|
preactMajorVersion: parseReactMajor(preactVersion),
|
|
@@ -37981,24 +37853,9 @@ const buildCapabilities = (project) => {
|
|
|
37981
37853
|
})) capabilities.add("tailwind:3.4");
|
|
37982
37854
|
if (project.zodVersion !== null) capabilities.add("zod");
|
|
37983
37855
|
if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
|
|
37984
|
-
if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
|
|
37985
|
-
if (project.hasMobxReact === true) capabilities.add("mobx-react");
|
|
37986
|
-
if (project.hasMobxReactLite === true) capabilities.add("mobx-react-lite");
|
|
37987
|
-
if (project.hasMobxReact === true || project.hasMobxReactLite === true) capabilities.add("mobx-react-binding");
|
|
37988
|
-
if (project.hasMobxStateTree === true) capabilities.add("mobx-state-tree");
|
|
37989
|
-
if (project.hasMobxReactObserver === true) capabilities.add("mobx-react-observer");
|
|
37990
|
-
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6) addMajorLadder(capabilities, "mobx", project.mobxMajorVersion, 4, 6);
|
|
37991
|
-
if (project.zustandVersion !== void 0 && project.zustandVersion !== null) capabilities.add("zustand");
|
|
37992
|
-
if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5) addMajorLadder(capabilities, "zustand", project.zustandMajorVersion, 1, 5);
|
|
37993
37856
|
if (project.isPreES2023Target) capabilities.add("pre-es2023");
|
|
37994
37857
|
if (project.hasReactCompiler) capabilities.add("react-compiler");
|
|
37995
37858
|
if (project.hasTanStackQuery) capabilities.add("tanstack-query");
|
|
37996
|
-
if (project.valtioVersion !== null) capabilities.add("valtio");
|
|
37997
|
-
addMajorLadder(capabilities, "valtio", project.valtioMajorVersion, 1, 10);
|
|
37998
|
-
if (project.hasRemotion) {
|
|
37999
|
-
capabilities.add("remotion");
|
|
38000
|
-
addMajorLadder(capabilities, "remotion", project.remotionMajorVersion ?? null, 4, 30);
|
|
38001
|
-
}
|
|
38002
37859
|
if (project.hasTypeScript) capabilities.add("typescript");
|
|
38003
37860
|
if (project.preactVersion !== null) capabilities.add("preact");
|
|
38004
37861
|
addMajorLadder(capabilities, "preact", project.preactMajorVersion, 10, 20);
|
|
@@ -43982,4 +43839,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
43982
43839
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
43983
43840
|
|
|
43984
43841
|
//# sourceMappingURL=index.js.map
|
|
43985
|
-
//# debugId=
|
|
43842
|
+
//# debugId=ba0e3885-0c68-5322-b382-578d3d89d5c5
|
package/dist/lsp.js
CHANGED
|
@@ -34173,10 +34173,6 @@ const listWorkspacePackages = (rootDirectory) => {
|
|
|
34173
34173
|
return packages;
|
|
34174
34174
|
};
|
|
34175
34175
|
const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
|
|
34176
|
-
const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
34177
|
-
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
34178
|
-
const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
|
|
34179
|
-
const MOBX_REACT_OBSERVER_PACKAGE_NAME = "mobx-react-observer";
|
|
34180
34176
|
const SHOPIFY_FLASH_LIST_PACKAGE_NAME = "@shopify/flash-list";
|
|
34181
34177
|
const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootDirectory, rootPackageJson, sections, workspaceDirectory, workspacePackageJson }) => {
|
|
34182
34178
|
const dependencyDeclaration = getDependencyDeclaration({
|
|
@@ -34195,18 +34191,7 @@ const shouldReplaceReactVersion = (currentVersion, nextVersion) => {
|
|
|
34195
34191
|
if (nextMajor === null) return false;
|
|
34196
34192
|
return nextMajor < currentMajor;
|
|
34197
34193
|
};
|
|
34198
|
-
const
|
|
34199
|
-
if (currentFact.version === null) return true;
|
|
34200
|
-
if (nextFact.version === null) return false;
|
|
34201
|
-
const currentMajor = getLowestDependencyMajor(currentFact.version);
|
|
34202
|
-
const nextMajor = getLowestDependencyMajor(nextFact.version);
|
|
34203
|
-
if (currentMajor === null) return false;
|
|
34204
|
-
if (nextMajor === null) return true;
|
|
34205
|
-
if (currentMajor > latestSupportedMajor) return false;
|
|
34206
|
-
if (nextMajor > latestSupportedMajor) return true;
|
|
34207
|
-
return nextMajor < currentMajor;
|
|
34208
|
-
};
|
|
34209
|
-
const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, rootPackageJson) => {
|
|
34194
|
+
const evaluateManifestFacts = (facts, packageJson, directory) => {
|
|
34210
34195
|
if (facts.expo.version === null) {
|
|
34211
34196
|
const spec = getDependencySpec(packageJson, "expo");
|
|
34212
34197
|
if (spec !== null) facts.expo = {
|
|
@@ -34228,65 +34213,13 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34228
34213
|
sourceDirectory: directory
|
|
34229
34214
|
};
|
|
34230
34215
|
}
|
|
34231
|
-
const mobxSpec = getDependencySpec(packageJson, "mobx");
|
|
34232
|
-
if (mobxSpec !== null) {
|
|
34233
|
-
const nextMobxFact = {
|
|
34234
|
-
version: resolveCatalogBackedDependencyVersion({
|
|
34235
|
-
rootDirectory: directory,
|
|
34236
|
-
rootPackageJson: packageJson,
|
|
34237
|
-
packageName: "mobx",
|
|
34238
|
-
version: mobxSpec
|
|
34239
|
-
}),
|
|
34240
|
-
sourceDirectory: directory
|
|
34241
|
-
};
|
|
34242
|
-
if (shouldReplaceSupportedDependencyFact(facts.mobx, nextMobxFact, 6)) facts.mobx = nextMobxFact;
|
|
34243
|
-
}
|
|
34244
|
-
facts.hasMobxReact = facts.hasMobxReact || getDependencySpec(packageJson, MOBX_REACT_PACKAGE_NAME) !== null;
|
|
34245
|
-
facts.hasMobxReactLite = facts.hasMobxReactLite || getDependencySpec(packageJson, MOBX_REACT_LITE_PACKAGE_NAME) !== null;
|
|
34246
|
-
facts.hasMobxStateTree = facts.hasMobxStateTree || getDependencySpec(packageJson, MOBX_STATE_TREE_PACKAGE_NAME) !== null;
|
|
34247
|
-
facts.hasMobxReactObserver = facts.hasMobxReactObserver || getDependencySpec(packageJson, MOBX_REACT_OBSERVER_PACKAGE_NAME) !== null;
|
|
34248
|
-
const zustandSpec = getDependencySpec(packageJson, "zustand");
|
|
34249
|
-
if (zustandSpec !== null) {
|
|
34250
|
-
const nextZustandFact = {
|
|
34251
|
-
version: resolveCatalogBackedDependencyVersion({
|
|
34252
|
-
rootDirectory: directory,
|
|
34253
|
-
rootPackageJson: packageJson,
|
|
34254
|
-
packageName: "zustand",
|
|
34255
|
-
version: zustandSpec
|
|
34256
|
-
}),
|
|
34257
|
-
sourceDirectory: directory
|
|
34258
|
-
};
|
|
34259
|
-
if (shouldReplaceSupportedDependencyFact(facts.zustand, nextZustandFact, 5)) facts.zustand = nextZustandFact;
|
|
34260
|
-
}
|
|
34261
34216
|
if (facts.reanimatedVersion === null) {
|
|
34262
34217
|
const spec = getDependencySpec(packageJson, REANIMATED_DEPENDENCY_NAME);
|
|
34263
34218
|
if (spec !== null) facts.reanimatedVersion = spec;
|
|
34264
34219
|
}
|
|
34265
|
-
if (facts.valtioVersion === null) {
|
|
34266
|
-
const spec = getDependencySpec(packageJson, "valtio");
|
|
34267
|
-
if (spec !== null) facts.valtioVersion = spec;
|
|
34268
|
-
}
|
|
34269
34220
|
facts.hasReactNativeAwarePackage = facts.hasReactNativeAwarePackage || isPackageJsonReactNativeAware(packageJson);
|
|
34270
34221
|
facts.hasReanimatedAwarePackage = facts.hasReanimatedAwarePackage || isPackageJsonReanimatedAware(packageJson);
|
|
34271
34222
|
facts.hasSsrDependency = facts.hasSsrDependency || isPackageJsonSsrAware(packageJson);
|
|
34272
|
-
const remotionSpec = getDependencySpec(packageJson, "remotion");
|
|
34273
|
-
if (remotionSpec !== null) {
|
|
34274
|
-
facts.hasRemotionDependency = true;
|
|
34275
|
-
const resolvedRemotionVersion = resolveCatalogBackedDependencyVersion({
|
|
34276
|
-
rootDirectory,
|
|
34277
|
-
rootPackageJson,
|
|
34278
|
-
packageName: "remotion",
|
|
34279
|
-
version: remotionSpec
|
|
34280
|
-
});
|
|
34281
|
-
const remotionMajorVersion = resolvedRemotionVersion === null ? null : getLowestDependencyMajor(resolvedRemotionVersion);
|
|
34282
|
-
if (remotionMajorVersion === null) {
|
|
34283
|
-
facts.hasUnknownRemotionVersion = true;
|
|
34284
|
-
facts.remotionVersion = null;
|
|
34285
|
-
} else if (!facts.hasUnknownRemotionVersion) {
|
|
34286
|
-
const currentRemotionMajorVersion = facts.remotionVersion === null ? null : getLowestDependencyMajor(facts.remotionVersion);
|
|
34287
|
-
if (currentRemotionMajorVersion === null || remotionMajorVersion < currentRemotionMajorVersion) facts.remotionVersion = resolvedRemotionVersion;
|
|
34288
|
-
}
|
|
34289
|
-
}
|
|
34290
34223
|
};
|
|
34291
34224
|
const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGroup }) => {
|
|
34292
34225
|
const facts = {
|
|
@@ -34306,28 +34239,12 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34306
34239
|
version: null,
|
|
34307
34240
|
sourceDirectory: null
|
|
34308
34241
|
},
|
|
34309
|
-
valtioVersion: null,
|
|
34310
|
-
mobx: {
|
|
34311
|
-
version: null,
|
|
34312
|
-
sourceDirectory: null
|
|
34313
|
-
},
|
|
34314
|
-
hasMobxReact: false,
|
|
34315
|
-
hasMobxReactLite: false,
|
|
34316
|
-
hasMobxStateTree: false,
|
|
34317
|
-
hasMobxReactObserver: false,
|
|
34318
|
-
zustand: {
|
|
34319
|
-
version: null,
|
|
34320
|
-
sourceDirectory: null
|
|
34321
|
-
},
|
|
34322
34242
|
hasReactNativeAwarePackage: false,
|
|
34323
34243
|
hasReanimatedAwarePackage: false,
|
|
34324
34244
|
hasSsrDependency: false,
|
|
34325
|
-
hasRemotionDependency: false,
|
|
34326
|
-
hasUnknownRemotionVersion: false,
|
|
34327
|
-
remotionVersion: null,
|
|
34328
34245
|
reanimatedVersion: null
|
|
34329
34246
|
};
|
|
34330
|
-
evaluateManifestFacts(facts, rootPackageJson, rootDirectory
|
|
34247
|
+
evaluateManifestFacts(facts, rootPackageJson, rootDirectory);
|
|
34331
34248
|
let isReactGroupSettled = !collectReactGroup;
|
|
34332
34249
|
const visitedDirectories = /* @__PURE__ */ new Set();
|
|
34333
34250
|
for (const pattern of getWorkspacePatterns(rootDirectory, rootPackageJson)) {
|
|
@@ -34336,7 +34253,7 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34336
34253
|
if (visitedDirectories.has(workspaceDirectory)) continue;
|
|
34337
34254
|
visitedDirectories.add(workspaceDirectory);
|
|
34338
34255
|
const workspacePackageJson = readPackageJson(Path.join(workspaceDirectory, "package.json"));
|
|
34339
|
-
evaluateManifestFacts(facts, workspacePackageJson, workspaceDirectory
|
|
34256
|
+
evaluateManifestFacts(facts, workspacePackageJson, workspaceDirectory);
|
|
34340
34257
|
const info = extractDependencyInfo(workspacePackageJson);
|
|
34341
34258
|
if (info.framework !== "unknown" && frameworkMergeRank(info.framework) < frameworkMergeRank(facts.framework)) facts.framework = info.framework;
|
|
34342
34259
|
if (isReactGroupSettled) continue;
|
|
@@ -34560,24 +34477,11 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
34560
34477
|
tailwindVersion: null,
|
|
34561
34478
|
zodVersion: null,
|
|
34562
34479
|
zodMajorVersion: null,
|
|
34563
|
-
mobxVersion: null,
|
|
34564
|
-
mobxMajorVersion: null,
|
|
34565
|
-
hasMobxReact: false,
|
|
34566
|
-
hasMobxReactLite: false,
|
|
34567
|
-
hasMobxStateTree: false,
|
|
34568
|
-
hasMobxReactObserver: false,
|
|
34569
|
-
zustandVersion: null,
|
|
34570
|
-
zustandMajorVersion: null,
|
|
34571
34480
|
framework: "unknown",
|
|
34572
34481
|
hasTypeScript: hasOwnTsConfig,
|
|
34573
34482
|
hasReactCompiler: false,
|
|
34574
34483
|
hasReactCompilerLintPlugin: false,
|
|
34575
34484
|
hasTanStackQuery: false,
|
|
34576
|
-
valtioVersion: null,
|
|
34577
|
-
valtioMajorVersion: null,
|
|
34578
|
-
hasRemotion: false,
|
|
34579
|
-
remotionVersion: null,
|
|
34580
|
-
remotionMajorVersion: null,
|
|
34581
34485
|
hasSsrDependency: false,
|
|
34582
34486
|
preactVersion: null,
|
|
34583
34487
|
preactMajorVersion: null,
|
|
@@ -34676,12 +34580,6 @@ const discoverProject = (directory) => {
|
|
|
34676
34580
|
packageName: SHOPIFY_FLASH_LIST_PACKAGE_NAME,
|
|
34677
34581
|
version: workspaceFacts.shopifyFlashList.version
|
|
34678
34582
|
}) : null;
|
|
34679
|
-
const zustandVersion = resolveCatalogBackedDependencyVersion({
|
|
34680
|
-
rootDirectory: directory,
|
|
34681
|
-
rootPackageJson: packageJson,
|
|
34682
|
-
packageName: "zustand",
|
|
34683
|
-
version: workspaceFacts.zustand.version
|
|
34684
|
-
});
|
|
34685
34583
|
const hasReanimated = hasReactNativeWorkspace && workspaceFacts.hasReanimatedAwarePackage;
|
|
34686
34584
|
const reanimatedVersion = hasReanimated ? workspaceFacts.reanimatedVersion : null;
|
|
34687
34585
|
const nextjsVersion = framework === "nextjs" ? resolveCatalogBackedDependencyVersion({
|
|
@@ -34690,20 +34588,7 @@ const discoverProject = (directory) => {
|
|
|
34690
34588
|
packageName: "next",
|
|
34691
34589
|
version: workspaceFacts.next.version
|
|
34692
34590
|
}) : null;
|
|
34693
|
-
const valtioVersion = resolveCatalogBackedDependencyVersion({
|
|
34694
|
-
rootDirectory: directory,
|
|
34695
|
-
rootPackageJson: packageJson,
|
|
34696
|
-
packageName: "valtio",
|
|
34697
|
-
version: workspaceFacts.valtioVersion
|
|
34698
|
-
});
|
|
34699
|
-
const mobxVersion = resolveCatalogBackedDependencyVersion({
|
|
34700
|
-
rootDirectory: directory,
|
|
34701
|
-
rootPackageJson: packageJson,
|
|
34702
|
-
packageName: "mobx",
|
|
34703
|
-
version: workspaceFacts.mobx.version
|
|
34704
|
-
});
|
|
34705
34591
|
const preactVersion = getPreactVersion(packageJson);
|
|
34706
|
-
const remotionVersion = workspaceFacts.remotionVersion;
|
|
34707
34592
|
const isPreES2023Target = hasTypeScript && detectPreES2023Target(directory);
|
|
34708
34593
|
const projectInfo = {
|
|
34709
34594
|
rootDirectory: directory,
|
|
@@ -34713,24 +34598,11 @@ const discoverProject = (directory) => {
|
|
|
34713
34598
|
tailwindVersion,
|
|
34714
34599
|
zodVersion,
|
|
34715
34600
|
zodMajorVersion: zodVersion === null ? null : getLowestDependencyMajor(zodVersion),
|
|
34716
|
-
mobxVersion,
|
|
34717
|
-
mobxMajorVersion: mobxVersion === null ? null : getLowestDependencyMajor(mobxVersion),
|
|
34718
|
-
hasMobxReact: workspaceFacts.hasMobxReact,
|
|
34719
|
-
hasMobxReactLite: workspaceFacts.hasMobxReactLite,
|
|
34720
|
-
hasMobxStateTree: workspaceFacts.hasMobxStateTree,
|
|
34721
|
-
hasMobxReactObserver: workspaceFacts.hasMobxReactObserver,
|
|
34722
|
-
zustandVersion,
|
|
34723
|
-
zustandMajorVersion: zustandVersion === null ? null : getLowestDependencyMajor(zustandVersion),
|
|
34724
34601
|
framework,
|
|
34725
34602
|
hasTypeScript,
|
|
34726
34603
|
hasReactCompiler: detectReactCompiler(directory, packageJson),
|
|
34727
34604
|
hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
|
|
34728
34605
|
hasTanStackQuery: hasTanStackQuery(packageJson),
|
|
34729
|
-
valtioVersion,
|
|
34730
|
-
valtioMajorVersion: valtioVersion === null ? null : getLowestDependencyMajor(valtioVersion),
|
|
34731
|
-
hasRemotion: workspaceFacts.hasRemotionDependency,
|
|
34732
|
-
remotionVersion,
|
|
34733
|
-
remotionMajorVersion: remotionVersion === null ? null : getLowestDependencyMajor(remotionVersion),
|
|
34734
34606
|
hasSsrDependency: workspaceFacts.hasSsrDependency,
|
|
34735
34607
|
preactVersion,
|
|
34736
34608
|
preactMajorVersion: parseReactMajor(preactVersion),
|
|
@@ -37959,24 +37831,9 @@ const buildCapabilities = (project) => {
|
|
|
37959
37831
|
})) capabilities.add("tailwind:3.4");
|
|
37960
37832
|
if (project.zodVersion !== null) capabilities.add("zod");
|
|
37961
37833
|
if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
|
|
37962
|
-
if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
|
|
37963
|
-
if (project.hasMobxReact === true) capabilities.add("mobx-react");
|
|
37964
|
-
if (project.hasMobxReactLite === true) capabilities.add("mobx-react-lite");
|
|
37965
|
-
if (project.hasMobxReact === true || project.hasMobxReactLite === true) capabilities.add("mobx-react-binding");
|
|
37966
|
-
if (project.hasMobxStateTree === true) capabilities.add("mobx-state-tree");
|
|
37967
|
-
if (project.hasMobxReactObserver === true) capabilities.add("mobx-react-observer");
|
|
37968
|
-
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6) addMajorLadder(capabilities, "mobx", project.mobxMajorVersion, 4, 6);
|
|
37969
|
-
if (project.zustandVersion !== void 0 && project.zustandVersion !== null) capabilities.add("zustand");
|
|
37970
|
-
if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5) addMajorLadder(capabilities, "zustand", project.zustandMajorVersion, 1, 5);
|
|
37971
37834
|
if (project.isPreES2023Target) capabilities.add("pre-es2023");
|
|
37972
37835
|
if (project.hasReactCompiler) capabilities.add("react-compiler");
|
|
37973
37836
|
if (project.hasTanStackQuery) capabilities.add("tanstack-query");
|
|
37974
|
-
if (project.valtioVersion !== null) capabilities.add("valtio");
|
|
37975
|
-
addMajorLadder(capabilities, "valtio", project.valtioMajorVersion, 1, 10);
|
|
37976
|
-
if (project.hasRemotion) {
|
|
37977
|
-
capabilities.add("remotion");
|
|
37978
|
-
addMajorLadder(capabilities, "remotion", project.remotionMajorVersion ?? null, 4, 30);
|
|
37979
|
-
}
|
|
37980
37837
|
if (project.hasTypeScript) capabilities.add("typescript");
|
|
37981
37838
|
if (project.preactVersion !== null) capabilities.add("preact");
|
|
37982
37839
|
addMajorLadder(capabilities, "preact", project.preactMajorVersion, 10, 20);
|
|
@@ -45602,5 +45459,5 @@ const startLanguageServer = () => {
|
|
|
45602
45459
|
};
|
|
45603
45460
|
//#endregion
|
|
45604
45461
|
export { startLanguageServer };
|
|
45605
|
-
!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]="
|
|
45606
|
-
//# 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
|
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.90e794f",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
66
66
|
"vscode-uri": "^3.1.0",
|
|
67
67
|
"yaml": "^2.9.0",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
68
|
+
"oxlint-plugin-react-doctor": "0.8.1-dev.90e794f",
|
|
69
|
+
"deslop-js": "0.8.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"@xterm/headless": "^6.0.0",
|
|
75
75
|
"commander": "^14.0.3",
|
|
76
76
|
"ora": "^9.4.0",
|
|
77
|
+
"@react-doctor/core": "0.8.1",
|
|
77
78
|
"@react-doctor/api": "0.8.1",
|
|
78
|
-
"@react-doctor/language-server": "0.8.1"
|
|
79
|
-
"@react-doctor/core": "0.8.1"
|
|
79
|
+
"@react-doctor/language-server": "0.8.1"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": "^20.19.0 || >=22.13.0"
|