react-doctor 0.4.0-dev.73dcb20 → 0.4.0-dev.a11faa2

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 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]="301c4437-ca87-5afb-b69d-b7a7c3678175")}catch(e){}}();
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]="6ef6b306-718a-5ef6-81bb-b6465cd32f04")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
5
5
  import * as path$1 from "node:path";
@@ -6004,6 +6004,11 @@ const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson,
6004
6004
  if (!isFile(monorepoPackageJsonPath)) return version;
6005
6005
  return resolveCatalogVersion(readPackageJson$1(monorepoPackageJsonPath), packageName, monorepoRoot, catalogName) ?? version;
6006
6006
  };
6007
+ const getNextjsDependencySpec = (packageJson) => {
6008
+ const spec = packageJson.dependencies?.next ?? packageJson.devDependencies?.next ?? packageJson.peerDependencies?.next ?? packageJson.optionalDependencies?.next;
6009
+ return typeof spec === "string" ? spec : null;
6010
+ };
6011
+ const findNextjsVersion = (rootDirectory, rootPackageJson) => findInWorkspacePackageJsons(rootDirectory, rootPackageJson, getNextjsDependencySpec);
6007
6012
  const getPreactVersion = (packageJson) => {
6008
6013
  return {
6009
6014
  ...packageJson.peerDependencies,
@@ -6253,6 +6258,12 @@ const discoverProject = (directory) => {
6253
6258
  version: findShopifyFlashListVersion(directory, packageJson)
6254
6259
  }) : null;
6255
6260
  const hasReanimated = hasReactNativeWorkspace && someWorkspacePackageJson(directory, packageJson, isPackageJsonReanimatedAware);
6261
+ const nextjsVersion = framework === "nextjs" ? resolveCatalogBackedDependencyVersion({
6262
+ rootDirectory: directory,
6263
+ rootPackageJson: packageJson,
6264
+ packageName: "next",
6265
+ version: findNextjsVersion(directory, packageJson)
6266
+ }) : null;
6256
6267
  const preactVersion = getPreactVersion(packageJson);
6257
6268
  const projectInfo = {
6258
6269
  rootDirectory: directory,
@@ -6269,6 +6280,8 @@ const discoverProject = (directory) => {
6269
6280
  preactVersion,
6270
6281
  preactMajorVersion: parseReactMajor(preactVersion),
6271
6282
  hasReactNativeWorkspace,
6283
+ nextjsVersion,
6284
+ nextjsMajorVersion: nextjsVersion === null ? null : getLowestDependencyMajor(nextjsVersion),
6272
6285
  expoVersion,
6273
6286
  shopifyFlashListVersion,
6274
6287
  shopifyFlashListMajorVersion: shopifyFlashListVersion === null ? null : getLowestDependencyMajor(shopifyFlashListVersion),
@@ -6392,7 +6405,11 @@ const DIAGNOSTIC_CATEGORY_BUCKETS = [
6392
6405
  "Accessibility",
6393
6406
  "Maintainability"
6394
6407
  ];
6395
- const APP_ONLY_RULE_KEYS = new Set(["react-hooks-js/static-components", "react-doctor/no-render-prop-children"]);
6408
+ const APP_ONLY_RULE_KEYS = new Set([
6409
+ "react-hooks-js/static-components",
6410
+ "react-doctor/no-render-prop-children",
6411
+ "react-doctor/prefer-explicit-variants"
6412
+ ]);
6396
6413
  const COMPILER_CLEANUP_BUCKET = "compiler-cleanup";
6397
6414
  const COMPILER_CLEANUP_RULE_KEYS = new Set(["react-doctor/react-compiler-no-manual-memoization"]);
6398
6415
  const MAX_GLOB_PATTERN_LENGTH_CHARS = 1024;
@@ -8394,6 +8411,7 @@ const checkReducedMotion = (rootDirectory) => {
8394
8411
  if (!hasMotionLibrary) return [];
8395
8412
  const result = spawnSync("git", [
8396
8413
  "grep",
8414
+ "--untracked",
8397
8415
  "-ql",
8398
8416
  "-E",
8399
8417
  REDUCED_MOTION_GREP_PATTERN,
@@ -9764,6 +9782,7 @@ const buildCapabilities = (project) => {
9764
9782
  capabilities.add(project.framework);
9765
9783
  if (project.framework === "expo" || project.framework === "react-native" || project.hasReactNativeWorkspace) capabilities.add("react-native");
9766
9784
  if (project.expoVersion !== null) capabilities.add("expo");
9785
+ if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
9767
9786
  const reactMajor = project.reactMajorVersion;
9768
9787
  if (reactMajor !== null) {
9769
9788
  const cappedReactMajor = Math.min(reactMajor, 30);
@@ -10708,7 +10727,12 @@ const SANITIZED_ENV = (() => {
10708
10727
  const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLINT_SPAWN_TIMEOUT_MS, outputMaxBytes = OXLINT_OUTPUT_MAX_BYTES) => new Promise((resolve, reject) => {
10709
10728
  const child = spawn(nodeBinaryPath, args, {
10710
10729
  cwd: rootDirectory,
10711
- env: SANITIZED_ENV
10730
+ env: SANITIZED_ENV,
10731
+ stdio: [
10732
+ "ignore",
10733
+ "pipe",
10734
+ "pipe"
10735
+ ]
10712
10736
  });
10713
10737
  const timeoutHandle = setTimeout(() => {
10714
10738
  child.kill("SIGKILL");
@@ -12191,7 +12215,7 @@ const makeNoopConsole = () => ({
12191
12215
  });
12192
12216
  //#endregion
12193
12217
  //#region src/cli/utils/version.ts
12194
- const VERSION = "0.4.0-dev.73dcb20";
12218
+ const VERSION = "0.4.0-dev.a11faa2";
12195
12219
  //#endregion
12196
12220
  //#region src/cli/utils/json-mode.ts
12197
12221
  let context = null;
@@ -12549,13 +12573,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
12549
12573
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
12550
12574
  * standard `SENTRY_RELEASE` override.
12551
12575
  */
12552
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.4.0-dev.73dcb20`;
12576
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.4.0-dev.a11faa2`;
12553
12577
  /**
12554
12578
  * Deployment environment shown in Sentry's environment filter. Defaults to
12555
12579
  * `production` for tagged releases and `development` for dev/unbuilt versions,
12556
12580
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
12557
12581
  */
12558
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.4.0-dev.73dcb20") ? "development" : "production");
12582
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.4.0-dev.a11faa2") ? "development" : "production");
12559
12583
  /**
12560
12584
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
12561
12585
  * (set to `0` to disable tracing) and falls back to
@@ -21448,4 +21472,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
21448
21472
  export {};
21449
21473
 
21450
21474
  //# sourceMappingURL=cli.js.map
21451
- //# debugId=301c4437-ca87-5afb-b69d-b7a7c3678175
21475
+ //# debugId=6ef6b306-718a-5ef6-81bb-b6465cd32f04
package/dist/index.d.ts CHANGED
@@ -453,6 +453,8 @@ interface ProjectInfo {
453
453
  * — no `rn-*` rules load for the project at all.
454
454
  */
455
455
  hasReactNativeWorkspace: boolean;
456
+ nextjsVersion: string | null;
457
+ nextjsMajorVersion: number | null;
456
458
  /**
457
459
  * The declared `expo` package version spec (e.g. `"~51.0.0"`), looked up
458
460
  * in the project or any of its workspace packages, or `null` when `expo`
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]="44e73f8d-b81f-599b-a04e-22497cd72bb2")}catch(e){}}();
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]="f737dd06-c590-5a34-8fb0-b8aa0278cc0d")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import * as Schema from "effect/Schema";
5
5
  import * as fs$1 from "node:fs";
@@ -2981,6 +2981,11 @@ const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson,
2981
2981
  if (!isFile(monorepoPackageJsonPath)) return version;
2982
2982
  return resolveCatalogVersion(readPackageJson(monorepoPackageJsonPath), packageName, monorepoRoot, catalogName) ?? version;
2983
2983
  };
2984
+ const getNextjsDependencySpec = (packageJson) => {
2985
+ const spec = packageJson.dependencies?.next ?? packageJson.devDependencies?.next ?? packageJson.peerDependencies?.next ?? packageJson.optionalDependencies?.next;
2986
+ return typeof spec === "string" ? spec : null;
2987
+ };
2988
+ const findNextjsVersion = (rootDirectory, rootPackageJson) => findInWorkspacePackageJsons(rootDirectory, rootPackageJson, getNextjsDependencySpec);
2984
2989
  const getPreactVersion = (packageJson) => {
2985
2990
  return {
2986
2991
  ...packageJson.peerDependencies,
@@ -3233,6 +3238,12 @@ const discoverProject = (directory) => {
3233
3238
  version: findShopifyFlashListVersion(directory, packageJson)
3234
3239
  }) : null;
3235
3240
  const hasReanimated = hasReactNativeWorkspace && someWorkspacePackageJson(directory, packageJson, isPackageJsonReanimatedAware);
3241
+ const nextjsVersion = framework === "nextjs" ? resolveCatalogBackedDependencyVersion({
3242
+ rootDirectory: directory,
3243
+ rootPackageJson: packageJson,
3244
+ packageName: "next",
3245
+ version: findNextjsVersion(directory, packageJson)
3246
+ }) : null;
3236
3247
  const preactVersion = getPreactVersion(packageJson);
3237
3248
  const projectInfo = {
3238
3249
  rootDirectory: directory,
@@ -3249,6 +3260,8 @@ const discoverProject = (directory) => {
3249
3260
  preactVersion,
3250
3261
  preactMajorVersion: parseReactMajor(preactVersion),
3251
3262
  hasReactNativeWorkspace,
3263
+ nextjsVersion,
3264
+ nextjsMajorVersion: nextjsVersion === null ? null : getLowestDependencyMajor(nextjsVersion),
3252
3265
  expoVersion,
3253
3266
  shopifyFlashListVersion,
3254
3267
  shopifyFlashListMajorVersion: shopifyFlashListVersion === null ? null : getLowestDependencyMajor(shopifyFlashListVersion),
@@ -3363,7 +3376,11 @@ const DIAGNOSTIC_CATEGORY_BUCKETS = [
3363
3376
  "Accessibility",
3364
3377
  "Maintainability"
3365
3378
  ];
3366
- const APP_ONLY_RULE_KEYS = new Set(["react-hooks-js/static-components", "react-doctor/no-render-prop-children"]);
3379
+ const APP_ONLY_RULE_KEYS = new Set([
3380
+ "react-hooks-js/static-components",
3381
+ "react-doctor/no-render-prop-children",
3382
+ "react-doctor/prefer-explicit-variants"
3383
+ ]);
3367
3384
  const COMPILER_CLEANUP_BUCKET = "compiler-cleanup";
3368
3385
  const COMPILER_CLEANUP_RULE_KEYS = new Set(["react-doctor/react-compiler-no-manual-memoization"]);
3369
3386
  const MAX_GLOB_PATTERN_LENGTH_CHARS = 1024;
@@ -5343,6 +5360,7 @@ const checkReducedMotion = (rootDirectory) => {
5343
5360
  if (!hasMotionLibrary) return [];
5344
5361
  const result = spawnSync("git", [
5345
5362
  "grep",
5363
+ "--untracked",
5346
5364
  "-ql",
5347
5365
  "-E",
5348
5366
  REDUCED_MOTION_GREP_PATTERN,
@@ -6697,6 +6715,7 @@ const buildCapabilities = (project) => {
6697
6715
  capabilities.add(project.framework);
6698
6716
  if (project.framework === "expo" || project.framework === "react-native" || project.hasReactNativeWorkspace) capabilities.add("react-native");
6699
6717
  if (project.expoVersion !== null) capabilities.add("expo");
6718
+ if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
6700
6719
  const reactMajor = project.reactMajorVersion;
6701
6720
  if (reactMajor !== null) {
6702
6721
  const cappedReactMajor = Math.min(reactMajor, 30);
@@ -7641,7 +7660,12 @@ const SANITIZED_ENV = (() => {
7641
7660
  const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLINT_SPAWN_TIMEOUT_MS, outputMaxBytes = OXLINT_OUTPUT_MAX_BYTES) => new Promise((resolve, reject) => {
7642
7661
  const child = spawn(nodeBinaryPath, args, {
7643
7662
  cwd: rootDirectory,
7644
- env: SANITIZED_ENV
7663
+ env: SANITIZED_ENV,
7664
+ stdio: [
7665
+ "ignore",
7666
+ "pipe",
7667
+ "pipe"
7668
+ ]
7645
7669
  });
7646
7670
  const timeoutHandle = setTimeout(() => {
7647
7671
  child.kill("SIGKILL");
@@ -8929,4 +8953,4 @@ const toJsonReport = (result, options) => buildJsonReport({
8929
8953
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
8930
8954
 
8931
8955
  //# sourceMappingURL=index.js.map
8932
- //# debugId=44e73f8d-b81f-599b-a04e-22497cd72bb2
8956
+ //# debugId=f737dd06-c590-5a34-8fb0-b8aa0278cc0d
package/dist/lsp.js CHANGED
@@ -2992,6 +2992,11 @@ const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson,
2992
2992
  if (!isFile(monorepoPackageJsonPath)) return version;
2993
2993
  return resolveCatalogVersion(readPackageJson(monorepoPackageJsonPath), packageName, monorepoRoot, catalogName) ?? version;
2994
2994
  };
2995
+ const getNextjsDependencySpec = (packageJson) => {
2996
+ const spec = packageJson.dependencies?.next ?? packageJson.devDependencies?.next ?? packageJson.peerDependencies?.next ?? packageJson.optionalDependencies?.next;
2997
+ return typeof spec === "string" ? spec : null;
2998
+ };
2999
+ const findNextjsVersion = (rootDirectory, rootPackageJson) => findInWorkspacePackageJsons(rootDirectory, rootPackageJson, getNextjsDependencySpec);
2995
3000
  const getPreactVersion = (packageJson) => {
2996
3001
  return {
2997
3002
  ...packageJson.peerDependencies,
@@ -3244,6 +3249,12 @@ const discoverProject = (directory) => {
3244
3249
  version: findShopifyFlashListVersion(directory, packageJson)
3245
3250
  }) : null;
3246
3251
  const hasReanimated = hasReactNativeWorkspace && someWorkspacePackageJson(directory, packageJson, isPackageJsonReanimatedAware);
3252
+ const nextjsVersion = framework === "nextjs" ? resolveCatalogBackedDependencyVersion({
3253
+ rootDirectory: directory,
3254
+ rootPackageJson: packageJson,
3255
+ packageName: "next",
3256
+ version: findNextjsVersion(directory, packageJson)
3257
+ }) : null;
3247
3258
  const preactVersion = getPreactVersion(packageJson);
3248
3259
  const projectInfo = {
3249
3260
  rootDirectory: directory,
@@ -3260,6 +3271,8 @@ const discoverProject = (directory) => {
3260
3271
  preactVersion,
3261
3272
  preactMajorVersion: parseReactMajor(preactVersion),
3262
3273
  hasReactNativeWorkspace,
3274
+ nextjsVersion,
3275
+ nextjsMajorVersion: nextjsVersion === null ? null : getLowestDependencyMajor(nextjsVersion),
3263
3276
  expoVersion,
3264
3277
  shopifyFlashListVersion,
3265
3278
  shopifyFlashListMajorVersion: shopifyFlashListVersion === null ? null : getLowestDependencyMajor(shopifyFlashListVersion),
@@ -3374,7 +3387,11 @@ const DIAGNOSTIC_CATEGORY_BUCKETS = [
3374
3387
  "Accessibility",
3375
3388
  "Maintainability"
3376
3389
  ];
3377
- const APP_ONLY_RULE_KEYS = new Set(["react-hooks-js/static-components", "react-doctor/no-render-prop-children"]);
3390
+ const APP_ONLY_RULE_KEYS = new Set([
3391
+ "react-hooks-js/static-components",
3392
+ "react-doctor/no-render-prop-children",
3393
+ "react-doctor/prefer-explicit-variants"
3394
+ ]);
3378
3395
  const COMPILER_CLEANUP_BUCKET = "compiler-cleanup";
3379
3396
  const COMPILER_CLEANUP_RULE_KEYS = new Set(["react-doctor/react-compiler-no-manual-memoization"]);
3380
3397
  const MAX_GLOB_PATTERN_LENGTH_CHARS = 1024;
@@ -5280,6 +5297,7 @@ const checkReducedMotion = (rootDirectory) => {
5280
5297
  if (!hasMotionLibrary) return [];
5281
5298
  const result = spawnSync("git", [
5282
5299
  "grep",
5300
+ "--untracked",
5283
5301
  "-ql",
5284
5302
  "-E",
5285
5303
  REDUCED_MOTION_GREP_PATTERN,
@@ -6634,6 +6652,7 @@ const buildCapabilities = (project) => {
6634
6652
  capabilities.add(project.framework);
6635
6653
  if (project.framework === "expo" || project.framework === "react-native" || project.hasReactNativeWorkspace) capabilities.add("react-native");
6636
6654
  if (project.expoVersion !== null) capabilities.add("expo");
6655
+ if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
6637
6656
  const reactMajor = project.reactMajorVersion;
6638
6657
  if (reactMajor !== null) {
6639
6658
  const cappedReactMajor = Math.min(reactMajor, 30);
@@ -7578,7 +7597,12 @@ const SANITIZED_ENV = (() => {
7578
7597
  const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLINT_SPAWN_TIMEOUT_MS, outputMaxBytes = OXLINT_OUTPUT_MAX_BYTES) => new Promise((resolve, reject) => {
7579
7598
  const child = spawn(nodeBinaryPath, args, {
7580
7599
  cwd: rootDirectory,
7581
- env: SANITIZED_ENV
7600
+ env: SANITIZED_ENV,
7601
+ stdio: [
7602
+ "ignore",
7603
+ "pipe",
7604
+ "pipe"
7605
+ ]
7582
7606
  });
7583
7607
  const timeoutHandle = setTimeout(() => {
7584
7608
  child.kill("SIGKILL");
@@ -10800,5 +10824,5 @@ const startLanguageServer = () => {
10800
10824
  };
10801
10825
  //#endregion
10802
10826
  export { startLanguageServer };
10803
- !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]="367f0c6f-8633-512f-b006-f1bb7ab5a35a")}catch(e){}}();
10804
- //# debugId=367f0c6f-8633-512f-b006-f1bb7ab5a35a
10827
+ !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]="e1a275ed-7044-5c7c-a852-3681c0fcd099")}catch(e){}}();
10828
+ //# debugId=e1a275ed-7044-5c7c-a852-3681c0fcd099
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.4.0-dev.73dcb20",
3
+ "version": "0.4.0-dev.a11faa2",
4
4
  "description": "Diagnose and fix React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -55,7 +55,7 @@
55
55
  "agent-install": "0.0.5",
56
56
  "conf": "^15.1.0",
57
57
  "confbox": "^0.2.4",
58
- "deslop-js": "^0.0.19",
58
+ "deslop-js": "^0.0.20",
59
59
  "effect": "4.0.0-beta.70",
60
60
  "eslint-plugin-react-hooks": "^7.1.1",
61
61
  "jiti": "^2.7.0",
@@ -66,7 +66,7 @@
66
66
  "vscode-languageserver": "^9.0.1",
67
67
  "vscode-languageserver-textdocument": "^1.0.12",
68
68
  "vscode-uri": "^3.1.0",
69
- "oxlint-plugin-react-doctor": "0.4.0-dev.73dcb20"
69
+ "oxlint-plugin-react-doctor": "0.4.0-dev.a11faa2"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/babel__code-frame": "^7.27.0",
@@ -74,8 +74,8 @@
74
74
  "@xterm/headless": "^6.0.0",
75
75
  "commander": "^14.0.3",
76
76
  "ora": "^9.4.0",
77
- "@react-doctor/api": "0.2.20",
78
77
  "@react-doctor/core": "0.3.0",
78
+ "@react-doctor/api": "0.2.20",
79
79
  "@react-doctor/language-server": "0.2.12"
80
80
  },
81
81
  "engines": {