react-doctor 0.4.0-dev.ee9ab33 → 0.4.0-dev.f61adc4
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 +24 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +21 -3
- package/dist/lsp.js +21 -3
- 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]="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([
|
|
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;
|
|
@@ -9765,6 +9782,7 @@ const buildCapabilities = (project) => {
|
|
|
9765
9782
|
capabilities.add(project.framework);
|
|
9766
9783
|
if (project.framework === "expo" || project.framework === "react-native" || project.hasReactNativeWorkspace) capabilities.add("react-native");
|
|
9767
9784
|
if (project.expoVersion !== null) capabilities.add("expo");
|
|
9785
|
+
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
|
|
9768
9786
|
const reactMajor = project.reactMajorVersion;
|
|
9769
9787
|
if (reactMajor !== null) {
|
|
9770
9788
|
const cappedReactMajor = Math.min(reactMajor, 30);
|
|
@@ -12197,7 +12215,7 @@ const makeNoopConsole = () => ({
|
|
|
12197
12215
|
});
|
|
12198
12216
|
//#endregion
|
|
12199
12217
|
//#region src/cli/utils/version.ts
|
|
12200
|
-
const VERSION = "0.4.0-dev.
|
|
12218
|
+
const VERSION = "0.4.0-dev.f61adc4";
|
|
12201
12219
|
//#endregion
|
|
12202
12220
|
//#region src/cli/utils/json-mode.ts
|
|
12203
12221
|
let context = null;
|
|
@@ -12555,13 +12573,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
12555
12573
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
12556
12574
|
* standard `SENTRY_RELEASE` override.
|
|
12557
12575
|
*/
|
|
12558
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.4.0-dev.
|
|
12576
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.4.0-dev.f61adc4`;
|
|
12559
12577
|
/**
|
|
12560
12578
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
12561
12579
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
12562
12580
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
12563
12581
|
*/
|
|
12564
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.4.0-dev.
|
|
12582
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.4.0-dev.f61adc4") ? "development" : "production");
|
|
12565
12583
|
/**
|
|
12566
12584
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
12567
12585
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -21454,4 +21472,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
21454
21472
|
export {};
|
|
21455
21473
|
|
|
21456
21474
|
//# sourceMappingURL=cli.js.map
|
|
21457
|
-
//# debugId=
|
|
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]="
|
|
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([
|
|
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;
|
|
@@ -6698,6 +6715,7 @@ const buildCapabilities = (project) => {
|
|
|
6698
6715
|
capabilities.add(project.framework);
|
|
6699
6716
|
if (project.framework === "expo" || project.framework === "react-native" || project.hasReactNativeWorkspace) capabilities.add("react-native");
|
|
6700
6717
|
if (project.expoVersion !== null) capabilities.add("expo");
|
|
6718
|
+
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
|
|
6701
6719
|
const reactMajor = project.reactMajorVersion;
|
|
6702
6720
|
if (reactMajor !== null) {
|
|
6703
6721
|
const cappedReactMajor = Math.min(reactMajor, 30);
|
|
@@ -8935,4 +8953,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
8935
8953
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
8936
8954
|
|
|
8937
8955
|
//# sourceMappingURL=index.js.map
|
|
8938
|
-
//# debugId=
|
|
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([
|
|
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;
|
|
@@ -6635,6 +6652,7 @@ const buildCapabilities = (project) => {
|
|
|
6635
6652
|
capabilities.add(project.framework);
|
|
6636
6653
|
if (project.framework === "expo" || project.framework === "react-native" || project.hasReactNativeWorkspace) capabilities.add("react-native");
|
|
6637
6654
|
if (project.expoVersion !== null) capabilities.add("expo");
|
|
6655
|
+
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
|
|
6638
6656
|
const reactMajor = project.reactMajorVersion;
|
|
6639
6657
|
if (reactMajor !== null) {
|
|
6640
6658
|
const cappedReactMajor = Math.min(reactMajor, 30);
|
|
@@ -10806,5 +10824,5 @@ const startLanguageServer = () => {
|
|
|
10806
10824
|
};
|
|
10807
10825
|
//#endregion
|
|
10808
10826
|
export { startLanguageServer };
|
|
10809
|
-
!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]="
|
|
10810
|
-
//# debugId=
|
|
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.
|
|
3
|
+
"version": "0.4.0-dev.f61adc4",
|
|
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.
|
|
58
|
+
"deslop-js": "^0.0.21",
|
|
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.
|
|
69
|
+
"oxlint-plugin-react-doctor": "0.4.0-dev.f61adc4"
|
|
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/api": "0.2.20",
|
|
77
78
|
"@react-doctor/core": "0.3.0",
|
|
78
|
-
"@react-doctor/language-server": "0.2.12"
|
|
79
|
-
"@react-doctor/api": "0.2.20"
|
|
79
|
+
"@react-doctor/language-server": "0.2.12"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": "^20.19.0 || >=22.12.0"
|