vite-doctor 0.1.0 → 0.1.2
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/README.md +23 -1
- package/dist/{cli-_Q17sv0d.mjs → cli-DAyaFyYp.mjs} +1 -1
- package/dist/{cli-main-Da1obxJF.mjs → cli-main-CyF0P2ec.mjs} +8 -8
- package/dist/cli.mjs +1 -1
- package/dist/{config-wMPOujpB.d.mts → config-Vi7rSzhn.d.mts} +8 -1
- package/dist/config.d.mts +1 -1
- package/dist/{core-B4BOHv0k.mjs → core-CaB3tfE8.mjs} +218 -34
- package/dist/{doctor-BCyOugNC.mjs → doctor-B_MuQCG9.mjs} +8 -8
- package/dist/{doctor-BBw4hDI8.mjs → doctor-keXSmA0d.mjs} +1 -1
- package/dist/doctor-process.mjs +1 -1
- package/dist/{extension-DlygaoWY.d.mts → extension-BWauKIzu.d.mts} +1 -1
- package/dist/extension.d.mts +2 -2
- package/dist/{index-C7xDcvOY.d.mts → index-B8J7duVA.d.mts} +1 -1
- package/dist/index-C-XOuvIV.d.mts +2 -0
- package/dist/index-CWqoD7Dt.d.mts +1 -0
- package/dist/{index-BcOraqZ_.d.mts → index-DEy2t14t.d.mts} +2 -2
- package/dist/{index-BTmWIb6U.d.mts → index-vyjK90RR.d.mts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{migration-DbxjbKWV.mjs → migration-BKDeSg5K.mjs} +2 -2
- package/dist/{module-CdkPnJ0X.d.mts → module-BYcUuLDi.d.mts} +7 -3
- package/dist/{module-CoWauFE9.mjs → module-Dkz3TqoG.mjs} +25 -4
- package/dist/nitro-CPo75d0U.mjs +2 -0
- package/dist/{no-route-middleware-api-security-DNbGlKfk.mjs → no-route-middleware-api-security-D8_B1fZx.mjs} +38 -5
- package/dist/nuxt-cli.mjs +1 -1
- package/dist/nuxt.d.mts +1 -1
- package/dist/nuxt.mjs +1 -1
- package/dist/{package-Cb63ia0y.mjs → package-C6h9Qtda.mjs} +1 -1
- package/dist/{pinia-Cegz0NNK.mjs → pinia-BOSWuj_L.mjs} +6 -6
- package/dist/plugin-Dd5QxPcQ.mjs +383 -0
- package/dist/{plugin-_V-dd4-g.d.mts → plugin-NkM7-RMx.d.mts} +3 -3
- package/dist/plugin-run-CzodTs31.mjs +2 -0
- package/dist/plugin-run-DVWUGgM8.mjs +55 -0
- package/dist/plugin-worker.mjs +1 -1
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.mjs +1 -1
- package/dist/{primitives-CxYw0KOu.d.mts → primitives-nC-P1qet.d.mts} +22 -1
- package/dist/{rule-authoring-gVUkGPkZ.mjs → rule-authoring-BdNe410l.mjs} +1 -1
- package/dist/rule-packs/nitro/index.d.mts +2 -2
- package/dist/rule-packs/nitro/index.mjs +2 -2
- package/dist/rule-packs/nitro/rules.d.mts +1 -1
- package/dist/rule-packs/nitro/rules.mjs +1 -1
- package/dist/rule-packs/nuxt/index.d.mts +2 -2
- package/dist/rule-packs/nuxt/index.mjs +8 -7
- package/dist/rule-packs/nuxt/module.d.mts +2 -2
- package/dist/rule-packs/nuxt/module.mjs +1 -1
- package/dist/rule-packs/nuxt/rules/index.d.mts +5 -5
- package/dist/rule-packs/nuxt/rules/index.mjs +4118 -1580
- package/dist/rule-packs/package/index.d.mts +1 -1
- package/dist/rule-packs/package/index.mjs +1 -1
- package/dist/rule-packs/pinia/index.d.mts +2 -2
- package/dist/rule-packs/pinia/index.mjs +1 -1
- package/dist/rule-packs/shadcn/index.d.mts +2 -2
- package/dist/rule-packs/shadcn/index.mjs +1 -1
- package/dist/rule-packs/typescript/index.d.mts +1 -1
- package/dist/rule-packs/typescript/index.mjs +2 -2
- package/dist/rule-packs/typescript/rules/index.d.mts +1 -1
- package/dist/rule-packs/typescript/rules/index.mjs +1 -1
- package/dist/rule-packs/vite/index.d.mts +1 -1
- package/dist/rule-packs/vite/index.mjs +1 -1
- package/dist/rule-packs/vite/rules/index.d.mts +1 -1
- package/dist/rule-packs/vite/rules/index.mjs +1 -1
- package/dist/rule-packs/vue/index.d.mts +1 -1
- package/dist/rule-packs/vue/index.mjs +1 -1
- package/dist/rule-packs/vue/rules.d.mts +1 -1
- package/dist/rule-packs/vue/rules.mjs +1 -1
- package/dist/{rules-BQKfUqwp.mjs → rules-BEz9as7i.mjs} +1 -1
- package/dist/rules-CW8Ec0h7.mjs +2 -0
- package/dist/{rules-DkWIvywE.mjs → rules-DTXdi7Ka.mjs} +27 -51
- package/dist/{rules-BGhf-scZ.mjs → rules-DYeVClNx.mjs} +20 -65
- package/dist/{rules-D34uZYuj.mjs → rules-Dg84VwNY.mjs} +15 -89
- package/dist/{rules-rM2Zb1Jk.d.mts → rules-NQvZWSQD.d.mts} +3 -3
- package/dist/rules.d.mts +1 -1
- package/dist/rules.mjs +2 -2
- package/dist/{runtime-graph-gvjT33RA.mjs → runtime-graph-DB9xVYJ4.mjs} +46 -1
- package/dist/script-scope-KkOa4q8R.mjs +136 -0
- package/dist/{server-BZlWIOUx.mjs → server-Ds24tvve.mjs} +1 -1
- package/dist/{shadcn-BfqffCih.mjs → shadcn-CpFqGWl3.mjs} +1 -1
- package/dist/testkit.d.mts +3 -3
- package/dist/testkit.mjs +1 -1
- package/dist/typescript-DP3Wc7UQ.mjs +2 -0
- package/docs/skills/doctor/SKILL.md +4 -0
- package/package.json +2 -3
- package/dist/index-cepLKshI.d.mts +0 -1
- package/dist/index-sXIP3SGR.d.mts +0 -2
- package/dist/nitro-8WdNQ5gx.mjs +0 -2
- package/dist/plugin-cp6Cn0HK.mjs +0 -185
- package/dist/plugin-run-BWfwE3hT.mjs +0 -33
- package/dist/plugin-run-_jr341xA.mjs +0 -2
- package/dist/rules-BEpsfGKF.mjs +0 -2
- package/dist/typescript-CHW5k6tw.mjs +0 -2
package/README.md
CHANGED
|
@@ -11,9 +11,14 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
-
<a href="https://vite-doctor.onmax.me">Docs</a>
|
|
14
|
+
<a href="https://vite-doctor.onmax.me">Docs</a> · <a href="https://comark-ui.onmax.me/lint/vite-doctor/">Comark UI extension</a>
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
|
+
[](https://www.npmjs.com/package/vite-doctor)
|
|
18
|
+
[](https://www.npmjs.com/package/vite-doctor)
|
|
19
|
+
[](https://github.com/onmax/vite-doctor/blob/main/LICENSE)
|
|
20
|
+
[](https://vite-doctor.onmax.me)
|
|
21
|
+
|
|
17
22
|
## Usage
|
|
18
23
|
|
|
19
24
|
Run Vite Doctor from the project root:
|
|
@@ -59,6 +64,18 @@ pnpm nuxt doctor
|
|
|
59
64
|
|
|
60
65
|
Use `--framework` only when Doctor cannot identify the framework automatically.
|
|
61
66
|
|
|
67
|
+
For CI, add a package script and run it before the build. Doctor reads source and config, not build output. Nuxt projects only need `nuxt prepare` first:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"scripts": {
|
|
72
|
+
"check:doctor": "vite-doctor . --max-warnings 0"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Don't name the script `doctor`. `pnpm doctor` and `npm doctor` run the package manager's built-in health check instead of your script.
|
|
78
|
+
|
|
62
79
|
Check a migration before changing dependencies:
|
|
63
80
|
|
|
64
81
|
```bash
|
|
@@ -169,6 +186,11 @@ unique within a Doctor Run. Shared final slash-delimited segments require full n
|
|
|
169
186
|
Config Extends; registering duplicate full names fails with the internal `DOC0023`
|
|
170
187
|
authoring diagnostic.
|
|
171
188
|
|
|
189
|
+
[`comark-linter`](https://comark-ui.onmax.me/lint/vite-doctor/) is a published Doctor
|
|
190
|
+
Extension: it checks [Comark](https://comark.dev) Markdown documents and the plugins from
|
|
191
|
+
[Comark UI](https://comark-ui.onmax.me). Register `comark()` from `comark-linter/doctor` in
|
|
192
|
+
`doctor.config.ts`, add `comark/recommended` to `extends`, and run with `--config`.
|
|
193
|
+
|
|
172
194
|
## Development
|
|
173
195
|
|
|
174
196
|
```bash
|
|
@@ -9,7 +9,7 @@ async function main(args = process.argv.slice(2), cwd = process.cwd(), surface =
|
|
|
9
9
|
process.stdout.write(`${viteDoctorVersion}\n`);
|
|
10
10
|
return 0;
|
|
11
11
|
}
|
|
12
|
-
return (await import("./cli-main-
|
|
12
|
+
return (await import("./cli-main-CyF0P2ec.mjs")).main(args, cwd, surface);
|
|
13
13
|
}
|
|
14
14
|
/** The `vite-doctor` binary: a Doctor Run goes through the long-lived Doctor process when opted in. */
|
|
15
15
|
async function runCli(args = process.argv.slice(2), cwd = process.cwd()) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as explainRule, n as createReport, r as createRulesReport, s as reportStatus } from "./core-CaB3tfE8.mjs";
|
|
2
2
|
import { t as viteDoctorVersion } from "./version-Qod0rU4x.mjs";
|
|
3
3
|
import { n as loadDoctorConfig } from "./config-CaJ0DqB3.mjs";
|
|
4
4
|
import { n as DOCTOR_PROCESS_ENV } from "./protocol-CcLGBETF.mjs";
|
|
@@ -135,7 +135,7 @@ async function main(args = process.argv.slice(2), cwd = process.cwd(), surface =
|
|
|
135
135
|
exitCode = 2;
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
const { createMigrationReport, formatMigrationReport } = await import("./migration-
|
|
138
|
+
const { createMigrationReport, formatMigrationReport } = await import("./migration-BKDeSg5K.mjs");
|
|
139
139
|
const report = await createMigrationReport(root, options.to ? [options.to] : []);
|
|
140
140
|
process.stdout.write(formatMigrationReport(report, format));
|
|
141
141
|
exitCode = report.summary.errors > 0 ? 1 : 0;
|
|
@@ -150,7 +150,7 @@ async function main(args = process.argv.slice(2), cwd = process.cwd(), surface =
|
|
|
150
150
|
applyHostExtensions(runOptions, surface, options);
|
|
151
151
|
validateCliRunOptions(runOptions);
|
|
152
152
|
runOptions.config = await loadCliConfig(cwd, stringFlag(options.config));
|
|
153
|
-
const { viteDoctorRulePacks } = await import("./doctor-
|
|
153
|
+
const { viteDoctorRulePacks } = await import("./doctor-keXSmA0d.mjs");
|
|
154
154
|
process.stdout.write(createRulesReport(await viteDoctorRulePacks(runOptions), format));
|
|
155
155
|
});
|
|
156
156
|
cli.command("explain <diagnostic>", "Explain a Doctor Diagnostic Code or Rule.").option("--config <path>", "Explicitly load an executable Doctor config.").option("--host-extensions", hostExtensionsHelp).option("--format <format>", "Output: text, json, or agent.").option("--framework <framework>", "Framework override.").action(async (diagnostic, options) => {
|
|
@@ -163,7 +163,7 @@ async function main(args = process.argv.slice(2), cwd = process.cwd(), surface =
|
|
|
163
163
|
applyHostExtensions(runOptions, surface, options);
|
|
164
164
|
validateCliRunOptions(runOptions);
|
|
165
165
|
runOptions.config = await loadCliConfig(cwd, stringFlag(options.config));
|
|
166
|
-
const { viteDoctorRulePacks } = await import("./doctor-
|
|
166
|
+
const { viteDoctorRulePacks } = await import("./doctor-keXSmA0d.mjs");
|
|
167
167
|
const report = explainRule(await viteDoctorRulePacks(runOptions), diagnostic, format);
|
|
168
168
|
if (!report) {
|
|
169
169
|
await writeCliError(`Unknown Diagnostic Code or Rule: ${diagnostic}`, format);
|
|
@@ -178,7 +178,7 @@ async function main(args = process.argv.slice(2), cwd = process.cwd(), surface =
|
|
|
178
178
|
const runOptions = { root: cwd };
|
|
179
179
|
applyDoctorOptions(runOptions, options);
|
|
180
180
|
validateCliRunOptions(runOptions);
|
|
181
|
-
const { viteDoctorCacheStatus } = await import("./doctor-
|
|
181
|
+
const { viteDoctorCacheStatus } = await import("./doctor-keXSmA0d.mjs");
|
|
182
182
|
const status = await viteDoctorCacheStatus(cwd, await loadCliConfig(cwd, stringFlag(options.config)), runOptions.framework === "auto" ? void 0 : runOptions.framework);
|
|
183
183
|
process.stdout.write(formatCacheStatus(status, format));
|
|
184
184
|
return;
|
|
@@ -187,7 +187,7 @@ async function main(args = process.argv.slice(2), cwd = process.cwd(), surface =
|
|
|
187
187
|
const runOptions = { root: cwd };
|
|
188
188
|
applyDoctorOptions(runOptions, options);
|
|
189
189
|
validateCliRunOptions(runOptions);
|
|
190
|
-
const { cleanViteDoctorCache } = await import("./doctor-
|
|
190
|
+
const { cleanViteDoctorCache } = await import("./doctor-keXSmA0d.mjs");
|
|
191
191
|
await cleanViteDoctorCache(cwd, await loadCliConfig(cwd, stringFlag(options.config)), runOptions.framework === "auto" ? void 0 : runOptions.framework);
|
|
192
192
|
consola.log("Doctor cache cleaned");
|
|
193
193
|
return;
|
|
@@ -316,7 +316,7 @@ function addDoctorRunCommand(cli, args, cwd, surface, setExitCode) {
|
|
|
316
316
|
}
|
|
317
317
|
async function watchDoctorCommand(args, cwd, surface, root, options) {
|
|
318
318
|
if (options.fix || options.unsafeFix || options.updateBaseline) throw new Error("--watch cannot be combined with --fix, --unsafe-fix, or --update-baseline.");
|
|
319
|
-
const [{ watchDoctorRuns }, { viteDoctorCacheStatus }] = await Promise.all([import("./watch-DMUy9-YX.mjs"), import("./doctor-
|
|
319
|
+
const [{ watchDoctorRuns }, { viteDoctorCacheStatus }] = await Promise.all([import("./watch-DMUy9-YX.mjs"), import("./doctor-keXSmA0d.mjs")]);
|
|
320
320
|
const cache = await viteDoctorCacheStatus(root, options.config, options.framework === "auto" ? void 0 : options.framework);
|
|
321
321
|
const runArgs = args.filter((arg) => arg !== "--watch");
|
|
322
322
|
const controller = new AbortController();
|
|
@@ -337,7 +337,7 @@ async function watchDoctorCommand(args, cwd, surface, root, options) {
|
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
async function runDoctorCommand(options, format, configFile) {
|
|
340
|
-
const { runViteDoctor, shouldFailDoctorRun } = await import("./doctor-
|
|
340
|
+
const { runViteDoctor, shouldFailDoctorRun } = await import("./doctor-keXSmA0d.mjs");
|
|
341
341
|
const result = await runViteDoctor(options);
|
|
342
342
|
process.stdout.write(createReport(result, format, {
|
|
343
343
|
runOptions: options,
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as DoctorReportFormat, d as DoctorSerializableConfig, i as DoctorExtensionInput, m as ProjectInfo, o as DoctorFramework, w as RuntimeTarget } from "./primitives-
|
|
1
|
+
import { c as DoctorReportFormat, d as DoctorSerializableConfig, i as DoctorExtensionInput, m as ProjectInfo, o as DoctorFramework, w as RuntimeTarget } from "./primitives-nC-P1qet.mjs";
|
|
2
2
|
//#region src/core/config.d.ts
|
|
3
3
|
interface DoctorConfig extends DoctorSerializableConfig {
|
|
4
4
|
extensions?: DoctorExtensionInput[];
|
|
@@ -11,6 +11,13 @@ interface DoctorRunOptions {
|
|
|
11
11
|
extends?: "auto" | string[];
|
|
12
12
|
changed?: boolean;
|
|
13
13
|
since?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Files whose Diagnostics this run reports, absolute or relative to `root`. Like `changed`, the
|
|
16
|
+
* run analyzes the whole project so cross-file Rules keep their context, but it reports only
|
|
17
|
+
* Diagnostics located in these files. Plugin Surfaces pass the files a dev server saw change.
|
|
18
|
+
* Combined with `changed` or `since`, the report narrows to changed lines in these files.
|
|
19
|
+
*/
|
|
20
|
+
affectedFiles?: string[];
|
|
14
21
|
format?: DoctorReportFormat;
|
|
15
22
|
baseline?: string;
|
|
16
23
|
updateBaseline?: boolean;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as loadDoctorConfig, i as defineDoctorConfig, n as DoctorRunOptions, r as LoadDoctorConfigOptions, t as DoctorConfig } from "./config-
|
|
1
|
+
import { a as loadDoctorConfig, i as defineDoctorConfig, n as DoctorRunOptions, r as LoadDoctorConfigOptions, t as DoctorConfig } from "./config-Vi7rSzhn.mjs";
|
|
2
2
|
export { type DoctorConfig, type DoctorRunOptions, type LoadDoctorConfigOptions, defineDoctorConfig, loadDoctorConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as resolveNuxtCompatibility, d as parseScriptResult, f as parseScriptSync, i as isNuxtManifestCurrent, l as resolveRuntimeGraph, o as readNuxtConfigGranularCachedData, s as readNuxtConfigSsr, t as applyRuntimeTarget, u as parseScript } from "./runtime-graph-DB9xVYJ4.mjs";
|
|
2
2
|
import { a as codeForRuleId, c as diagnosticForCode, i as defineRulePack, l as doctorDiagnosticsHost, o as defineDoctorDiagnostics, u as DOCTOR_DIAGNOSTICS_DOCS_BASE } from "./primitives-QDMBsnjd.mjs";
|
|
3
3
|
import { t as doctorInternalDiagnostics } from "./internal-diagnostic-handles-R_2cBQaP.mjs";
|
|
4
4
|
import { t as RuleInputs } from "./rule-inputs-GzH5Uyjz.mjs";
|
|
@@ -1141,6 +1141,17 @@ function expandBraces(pattern) {
|
|
|
1141
1141
|
return expansions;
|
|
1142
1142
|
}
|
|
1143
1143
|
//#endregion
|
|
1144
|
+
//#region src/core/internal/lazy-parsers.ts
|
|
1145
|
+
const require = createRequire(import.meta.url);
|
|
1146
|
+
let typescript;
|
|
1147
|
+
let vueCompilerSfc;
|
|
1148
|
+
function loadTypeScript() {
|
|
1149
|
+
return typescript ??= require("typescript");
|
|
1150
|
+
}
|
|
1151
|
+
function loadVueCompilerSfc() {
|
|
1152
|
+
return vueCompilerSfc ??= require("@vue/compiler-sfc");
|
|
1153
|
+
}
|
|
1154
|
+
//#endregion
|
|
1144
1155
|
//#region src/core/internal/project.ts
|
|
1145
1156
|
async function detectProject(root, requested = "auto", runtimeTarget) {
|
|
1146
1157
|
const packageJson = readJson(join(root, "package.json"));
|
|
@@ -1186,11 +1197,12 @@ async function detectProject(root, requested = "auto", runtimeTarget) {
|
|
|
1186
1197
|
inventory: { packages: deps }
|
|
1187
1198
|
};
|
|
1188
1199
|
const unappliedConfigs = workspaceNuxt.filter((item) => item.nuxt.doctorConfig);
|
|
1189
|
-
|
|
1200
|
+
const evidenceGaps = [...owner ? missingNuxtManifestGaps(root, owner.root, owner.nuxt, workspacePackages) : [], ...unappliedConfigs.map((item) => ({
|
|
1190
1201
|
source: "vite-doctor/workspace-nuxt",
|
|
1191
1202
|
message: `Doctor options from the vite-doctor/nuxt module in ${item.root} only apply when Doctor runs from that package. Run Doctor from ${item.root} to apply them.`,
|
|
1192
1203
|
files: [relative(root, item.nuxt.manifestPath ?? join(root, item.root))]
|
|
1193
|
-
}));
|
|
1204
|
+
}))];
|
|
1205
|
+
if (evidenceGaps.length) project.evidenceGaps = evidenceGaps;
|
|
1194
1206
|
rememberProjectFileWalk(project, walk);
|
|
1195
1207
|
return project;
|
|
1196
1208
|
}
|
|
@@ -1381,6 +1393,11 @@ async function detectNuxt(root, version, deps, { manifest, manifestPath, manifes
|
|
|
1381
1393
|
priority: 0
|
|
1382
1394
|
}],
|
|
1383
1395
|
localLayerAliases: manifest?.localLayerAliases,
|
|
1396
|
+
productionBuildCache: manifestCurrent ? manifest?.productionBuildCache : void 0,
|
|
1397
|
+
granularCachedData: manifestCurrent && typeof manifest?.granularCachedData === "boolean" ? {
|
|
1398
|
+
enabled: manifest.granularCachedData,
|
|
1399
|
+
source: "manifest"
|
|
1400
|
+
} : readNuxtConfigGranularCachedData(root, configs),
|
|
1384
1401
|
routeRules: manifest?.routeRules ?? readRouteRules(config.primary),
|
|
1385
1402
|
ssr: (manifestCurrent ? manifest?.ssr : void 0) ?? readNuxtConfigSsr(root, configs),
|
|
1386
1403
|
runtimeConfig: manifest?.runtimeConfig,
|
|
@@ -1401,6 +1418,133 @@ async function detectNuxtAppRoots(root) {
|
|
|
1401
1418
|
if (!configs.length) return [root];
|
|
1402
1419
|
return [...new Set(configs.map((file) => resolve(file, "..")))].sort();
|
|
1403
1420
|
}
|
|
1421
|
+
function missingNuxtManifestGaps(root, packageRoot, nuxt, workspacePackages) {
|
|
1422
|
+
const appRoot = join(root, packageRoot);
|
|
1423
|
+
const ownAppRoots = nuxt.appRoots.filter((appDir) => owningWorkspacePackage(workspacePackages, relative(root, appDir)) === packageRoot || isNuxtLayerAppRoot(appRoot, appDir, workspacePackages, root));
|
|
1424
|
+
if (nuxt.manifestPath || !registersDoctorModule(appRoot, {
|
|
1425
|
+
...nuxt,
|
|
1426
|
+
appRoots: ownAppRoots
|
|
1427
|
+
})) return [];
|
|
1428
|
+
const manifest = relative(root, join(appRoot, ".nuxt/doctor.manifest.json"));
|
|
1429
|
+
return [{
|
|
1430
|
+
source: "vite-doctor/nuxt",
|
|
1431
|
+
message: `nuxt.config registers vite-doctor/nuxt, but ${manifest} does not exist, so this Doctor Run ignored the doctor options in nuxt.config and Nuxt's resolved auto-imports, components, and server handlers. Run nuxt prepare first; it does not need a build.`,
|
|
1432
|
+
files: [manifest]
|
|
1433
|
+
}];
|
|
1434
|
+
}
|
|
1435
|
+
function isNuxtLayerAppRoot(appRoot, candidateRoot, workspacePackages, workspaceRoot) {
|
|
1436
|
+
if (candidateRoot === appRoot) return false;
|
|
1437
|
+
const config = readNuxtConfigText(appRoot).anyFormat;
|
|
1438
|
+
if (!config) return false;
|
|
1439
|
+
const extendsValues = readNuxtExtendsValues(config);
|
|
1440
|
+
const candidatePackage = owningWorkspacePackage(workspacePackages, relative(workspaceRoot, candidateRoot));
|
|
1441
|
+
const candidate = workspacePackages.find((item) => item.root === candidatePackage);
|
|
1442
|
+
return extendsValues.some((value) => {
|
|
1443
|
+
return resolve(appRoot, value) === candidateRoot || value === candidate?.name;
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
function readNuxtExtendsValues(config) {
|
|
1447
|
+
const ts = loadTypeScript();
|
|
1448
|
+
const source = ts.createSourceFile("nuxt.config.ts", config, ts.ScriptTarget.Latest, true);
|
|
1449
|
+
const values = [];
|
|
1450
|
+
const visit = (node) => {
|
|
1451
|
+
if (ts.isPropertyAssignment(node)) {
|
|
1452
|
+
const name = node.name;
|
|
1453
|
+
if ((ts.isIdentifier(name) || ts.isStringLiteral(name) ? name.text : void 0) === "extends") {
|
|
1454
|
+
const value = node.initializer;
|
|
1455
|
+
if (ts.isStringLiteral(value) || ts.isNoSubstitutionTemplateLiteral(value)) values.push(value.text);
|
|
1456
|
+
else if (ts.isArrayLiteralExpression(value)) {
|
|
1457
|
+
for (const element of value.elements) if (ts.isStringLiteral(element) || ts.isNoSubstitutionTemplateLiteral(element)) values.push(element.text);
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
ts.forEachChild(node, visit);
|
|
1462
|
+
};
|
|
1463
|
+
visit(source);
|
|
1464
|
+
return values;
|
|
1465
|
+
}
|
|
1466
|
+
function registersDoctorModule(appRoot, nuxt) {
|
|
1467
|
+
return [.../* @__PURE__ */ new Set([
|
|
1468
|
+
appRoot,
|
|
1469
|
+
...nuxt.appRoots,
|
|
1470
|
+
...nuxt.layers.map((layer) => resolve(appRoot, layer.root))
|
|
1471
|
+
])].some((root) => registersDoctorModuleInConfig(readNuxtConfigText(root).anyFormat));
|
|
1472
|
+
}
|
|
1473
|
+
function registersDoctorModuleInConfig(config) {
|
|
1474
|
+
if (!config) return false;
|
|
1475
|
+
const ts = loadTypeScript();
|
|
1476
|
+
const source = ts.createSourceFile("nuxt.config.ts", config, ts.ScriptTarget.Latest, true);
|
|
1477
|
+
const nodeScopes = /* @__PURE__ */ new WeakMap();
|
|
1478
|
+
const rootScope = {
|
|
1479
|
+
parent: null,
|
|
1480
|
+
bindings: /* @__PURE__ */ new Map()
|
|
1481
|
+
};
|
|
1482
|
+
const scopeNodes = /* @__PURE__ */ new Set([
|
|
1483
|
+
ts.SyntaxKind.SourceFile,
|
|
1484
|
+
ts.SyntaxKind.Block,
|
|
1485
|
+
ts.SyntaxKind.ModuleBlock,
|
|
1486
|
+
ts.SyntaxKind.CatchClause
|
|
1487
|
+
]);
|
|
1488
|
+
const collectScopes = (node, scope) => {
|
|
1489
|
+
const current = scopeNodes.has(node.kind) && node !== source ? {
|
|
1490
|
+
parent: scope,
|
|
1491
|
+
bindings: /* @__PURE__ */ new Map()
|
|
1492
|
+
} : scope;
|
|
1493
|
+
nodeScopes.set(node, current);
|
|
1494
|
+
if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) current.bindings.set(node.name.text, node.initializer);
|
|
1495
|
+
ts.forEachChild(node, (child) => collectScopes(child, current));
|
|
1496
|
+
};
|
|
1497
|
+
collectScopes(source, rootScope);
|
|
1498
|
+
const resolve = (name, scope) => {
|
|
1499
|
+
for (let current = scope; current; current = current.parent) {
|
|
1500
|
+
const binding = current.bindings.get(name);
|
|
1501
|
+
if (binding) return binding;
|
|
1502
|
+
}
|
|
1503
|
+
};
|
|
1504
|
+
const resolving = /* @__PURE__ */ new Set();
|
|
1505
|
+
const hasDoctorModule = (value, scope) => {
|
|
1506
|
+
if (ts.isStringLiteral(value) || ts.isNoSubstitutionTemplateLiteral(value)) return value.text === "vite-doctor/nuxt";
|
|
1507
|
+
if (ts.isIdentifier(value)) {
|
|
1508
|
+
const binding = resolve(value.text, scope);
|
|
1509
|
+
if (!binding || resolving.has(binding)) return false;
|
|
1510
|
+
resolving.add(binding);
|
|
1511
|
+
const found = hasDoctorModule(binding, nodeScopes.get(binding));
|
|
1512
|
+
resolving.delete(binding);
|
|
1513
|
+
return found;
|
|
1514
|
+
}
|
|
1515
|
+
if (ts.isArrayLiteralExpression(value)) return value.elements.some((element) => ts.isSpreadElement(element) ? hasDoctorModule(element.expression, scope) : element.kind !== ts.SyntaxKind.OmittedExpression && hasDoctorModule(element, scope));
|
|
1516
|
+
return false;
|
|
1517
|
+
};
|
|
1518
|
+
const inspectConfig = (value, scope) => {
|
|
1519
|
+
if (ts.isParenthesizedExpression(value) || ts.isAsExpression(value) || ts.isTypeAssertionExpression(value) || ts.isSatisfiesExpression(value)) return inspectConfig(value.expression, scope);
|
|
1520
|
+
if (ts.isIdentifier(value)) {
|
|
1521
|
+
const binding = resolve(value.text, scope);
|
|
1522
|
+
if (!binding || resolving.has(binding)) return false;
|
|
1523
|
+
resolving.add(binding);
|
|
1524
|
+
const found = inspectConfig(binding, nodeScopes.get(binding));
|
|
1525
|
+
resolving.delete(binding);
|
|
1526
|
+
return found;
|
|
1527
|
+
}
|
|
1528
|
+
if (ts.isCallExpression(value)) return value.arguments.some((arg) => inspectConfig(arg, scope));
|
|
1529
|
+
if (ts.isArrowFunction(value) || ts.isFunctionExpression(value)) {
|
|
1530
|
+
if (ts.isBlock(value.body)) return value.body.statements.some((statement) => ts.isReturnStatement(statement) && statement.expression ? inspectConfig(statement.expression, nodeScopes.get(statement)) : false);
|
|
1531
|
+
return inspectConfig(value.body, nodeScopes.get(value.body));
|
|
1532
|
+
}
|
|
1533
|
+
if (!ts.isObjectLiteralExpression(value)) return false;
|
|
1534
|
+
return value.properties.some((property) => {
|
|
1535
|
+
if (ts.isPropertyAssignment(property)) return property.name.getText(source).replace(/["']/g, "") === "modules" ? hasDoctorModule(property.initializer, scope) : false;
|
|
1536
|
+
return ts.isShorthandPropertyAssignment(property) && property.name.text === "modules" ? hasDoctorModule(property.name, nodeScopes.get(property)) : false;
|
|
1537
|
+
});
|
|
1538
|
+
};
|
|
1539
|
+
for (const statement of source.statements) {
|
|
1540
|
+
if (ts.isExportAssignment(statement)) {
|
|
1541
|
+
if (inspectConfig(statement.expression, nodeScopes.get(statement))) return true;
|
|
1542
|
+
continue;
|
|
1543
|
+
}
|
|
1544
|
+
if (ts.isExpressionStatement(statement) && ts.isBinaryExpression(statement.expression) && statement.expression.operatorToken.kind === ts.SyntaxKind.EqualsToken && ts.isPropertyAccessExpression(statement.expression.left) && ts.isIdentifier(statement.expression.left.expression) && statement.expression.left.expression.text === "module" && statement.expression.left.name.text === "exports" && inspectConfig(statement.expression.right, nodeScopes.get(statement))) return true;
|
|
1545
|
+
}
|
|
1546
|
+
return false;
|
|
1547
|
+
}
|
|
1404
1548
|
function readJson(file) {
|
|
1405
1549
|
try {
|
|
1406
1550
|
return JSON.parse(readFileSync(file, "utf8"));
|
|
@@ -1875,6 +2019,27 @@ var GitChangeUnavailableError = class extends Error {
|
|
|
1875
2019
|
}
|
|
1876
2020
|
};
|
|
1877
2021
|
async function selectSourceInventory(root, config, options, project, memo) {
|
|
2022
|
+
const affected = options.affectedFiles ? new Set(options.affectedFiles.map((file) => resolve(root, file))) : void 0;
|
|
2023
|
+
const selection = await selectGitOrAllFiles(root, config, options, project, memo);
|
|
2024
|
+
if (!affected || selection.git?.status === "unavailable") return selection;
|
|
2025
|
+
return {
|
|
2026
|
+
...selection,
|
|
2027
|
+
files: selection.files.map((file) => {
|
|
2028
|
+
if (!affected.has(file.path)) return omitEligibility(file);
|
|
2029
|
+
if (selection.git) return file;
|
|
2030
|
+
return {
|
|
2031
|
+
...file,
|
|
2032
|
+
reportEligibility: { kind: "file" }
|
|
2033
|
+
};
|
|
2034
|
+
})
|
|
2035
|
+
};
|
|
2036
|
+
}
|
|
2037
|
+
function omitEligibility(file) {
|
|
2038
|
+
if (!file.reportEligibility) return file;
|
|
2039
|
+
const { reportEligibility: _, ...rest } = file;
|
|
2040
|
+
return rest;
|
|
2041
|
+
}
|
|
2042
|
+
async function selectGitOrAllFiles(root, config, options, project, memo) {
|
|
1878
2043
|
if (options.changed || options.since) {
|
|
1879
2044
|
const include = config.include ?? defaultIncludeForProject(project);
|
|
1880
2045
|
const exclude = [...DEFAULT_EXCLUDE, ...config.exclude ?? []];
|
|
@@ -2597,6 +2762,7 @@ async function createScanSession(options) {
|
|
|
2597
2762
|
project,
|
|
2598
2763
|
files,
|
|
2599
2764
|
gitChanges: sourceInventory.git,
|
|
2765
|
+
scopedReport: Boolean(sourceInventory.git || options.affectedFiles),
|
|
2600
2766
|
handles: [],
|
|
2601
2767
|
handlesByPath,
|
|
2602
2768
|
sourceTexts: /* @__PURE__ */ new Map(),
|
|
@@ -2639,10 +2805,10 @@ async function runPhase(session, name, run) {
|
|
|
2639
2805
|
}
|
|
2640
2806
|
function persistScanCache(session) {
|
|
2641
2807
|
const { options } = session;
|
|
2642
|
-
const subset = Boolean(options.rules) || Boolean(options.analyses) ||
|
|
2808
|
+
const subset = Boolean(options.rules) || Boolean(options.analyses) || session.scopedReport;
|
|
2643
2809
|
session.cache.persist({
|
|
2644
2810
|
files: session.files.length,
|
|
2645
|
-
activeRuleKeys: subset ? new Set(session.
|
|
2811
|
+
activeRuleKeys: subset ? new Set(session.scopedReport || options.analyses && !options.rules ? [] : session.ruleKeys.values()) : void 0
|
|
2646
2812
|
});
|
|
2647
2813
|
}
|
|
2648
2814
|
function cacheDirectory(root, config) {
|
|
@@ -2951,19 +3117,6 @@ function ruleKeys(registry, rules, context) {
|
|
|
2951
3117
|
}));
|
|
2952
3118
|
}
|
|
2953
3119
|
//#endregion
|
|
2954
|
-
//#region src/core/internal/lazy-parsers.ts
|
|
2955
|
-
const require = createRequire(import.meta.url);
|
|
2956
|
-
let typescriptESLintParser;
|
|
2957
|
-
let typescript;
|
|
2958
|
-
let vueCompilerSfc;
|
|
2959
|
-
const parseForESLint = (code, options) => (typescriptESLintParser ??= require("@typescript-eslint/parser")).parseForESLint(code, options);
|
|
2960
|
-
function loadTypeScript() {
|
|
2961
|
-
return typescript ??= require("typescript");
|
|
2962
|
-
}
|
|
2963
|
-
function loadVueCompilerSfc() {
|
|
2964
|
-
return vueCompilerSfc ??= require("@vue/compiler-sfc");
|
|
2965
|
-
}
|
|
2966
|
-
//#endregion
|
|
2967
3120
|
//#region src/core/internal/diagnostic-policy.ts
|
|
2968
3121
|
function applyDiagnosticPolicy(input) {
|
|
2969
3122
|
const suppressed = [];
|
|
@@ -4285,6 +4438,26 @@ const allDoctorDiagnosticRegistry = defineDoctorDiagnostics([
|
|
|
4285
4438
|
{
|
|
4286
4439
|
code: "NUXT0090",
|
|
4287
4440
|
ruleId: "nuxt/config/no-runtime-env-in-build-options"
|
|
4441
|
+
},
|
|
4442
|
+
{
|
|
4443
|
+
code: "NUXT0091",
|
|
4444
|
+
ruleId: "nuxt/config/no-per-build-value-in-cache-key"
|
|
4445
|
+
},
|
|
4446
|
+
{
|
|
4447
|
+
code: "NUXT0092",
|
|
4448
|
+
ruleId: "nuxt/fetch/cached-data-respects-refresh"
|
|
4449
|
+
},
|
|
4450
|
+
{
|
|
4451
|
+
code: "NUXT0093",
|
|
4452
|
+
ruleId: "nuxt/config/no-unhashed-build-cache-input"
|
|
4453
|
+
},
|
|
4454
|
+
{
|
|
4455
|
+
code: "NUXT0094",
|
|
4456
|
+
ruleId: "nuxt/routing/keepalive-requires-max"
|
|
4457
|
+
},
|
|
4458
|
+
{
|
|
4459
|
+
code: "NUXT0095",
|
|
4460
|
+
ruleId: "nuxt/fetch/no-ssr-refetch-of-shared-key"
|
|
4288
4461
|
}
|
|
4289
4462
|
]);
|
|
4290
4463
|
const allDiagnosticCodesByRuleId = allDoctorDiagnosticRegistry.codesByRuleId;
|
|
@@ -4343,7 +4516,7 @@ function reportStaleBaseline(session, baseline) {
|
|
|
4343
4516
|
}
|
|
4344
4517
|
function reportUnusedConfigSuppressions(session) {
|
|
4345
4518
|
const { options, root } = session;
|
|
4346
|
-
if (
|
|
4519
|
+
if (session.scopedReport || options.rules || options.analyses) return;
|
|
4347
4520
|
const ran = new Set(session.enabledRules.map((rule) => rule.meta.id));
|
|
4348
4521
|
const effectiveExtends = options.extends ?? session.config.extends;
|
|
4349
4522
|
const unscoped = (effectiveExtends === void 0 || effectiveExtends === "auto" || Array.isArray(effectiveExtends) && effectiveExtends.includes("auto")) && !Object.values(session.config.rules ?? {}).includes("off");
|
|
@@ -4469,7 +4642,7 @@ function suppressionEntryBounds(source, section, index) {
|
|
|
4469
4642
|
}
|
|
4470
4643
|
}
|
|
4471
4644
|
function applyReportEligibility(session) {
|
|
4472
|
-
if (!session.
|
|
4645
|
+
if (!session.scopedReport) return;
|
|
4473
4646
|
const eligibility = new Map(session.files.map((file) => [file.path, file.reportEligibility]));
|
|
4474
4647
|
const sources = { get: (file) => session.handlesByPath.get(file)?.text };
|
|
4475
4648
|
if (session.project.evidenceGaps) session.project.evidenceGaps = session.project.evidenceGaps.filter((gap) => gap.source !== "script-parser" && gap.source !== "vue-sfc-parser" || gap.files.some((file) => eligibility.get(file)));
|
|
@@ -4477,6 +4650,7 @@ function applyReportEligibility(session) {
|
|
|
4477
4650
|
return [diagnostic, ...diagnostic.related ?? []].some((location) => {
|
|
4478
4651
|
const fileEligibility = eligibility.get(location.file);
|
|
4479
4652
|
if (!fileEligibility) return false;
|
|
4653
|
+
if (fileEligibility.kind === "file") return true;
|
|
4480
4654
|
if (!location.range) return diagnostic.range === void 0;
|
|
4481
4655
|
const endLine = diagnosticEndLine(location.range, sources.get(location.file));
|
|
4482
4656
|
return fileEligibility.ranges.some((range) => location.range.line <= range.endLine && endLine >= range.startLine);
|
|
@@ -5376,7 +5550,7 @@ async function prepareSourceFile(session, file, fileId) {
|
|
|
5376
5550
|
fileId
|
|
5377
5551
|
});
|
|
5378
5552
|
}
|
|
5379
|
-
if (session.
|
|
5553
|
+
if (session.scopedReport && !file.reportEligibility) return createSourceHandle(session, file, content.hash, {
|
|
5380
5554
|
session,
|
|
5381
5555
|
entry: file,
|
|
5382
5556
|
text: content.text,
|
|
@@ -5417,7 +5591,7 @@ async function loadSourceFile(handle) {
|
|
|
5417
5591
|
}
|
|
5418
5592
|
/**
|
|
5419
5593
|
* Bit 1: SFC, bit 2: script AST, bit 4: template AST, known without parsing cached files.
|
|
5420
|
-
* Undefined for a file a
|
|
5594
|
+
* Undefined for a file a scoped run has not parsed yet.
|
|
5421
5595
|
*/
|
|
5422
5596
|
function sourceShape(handle) {
|
|
5423
5597
|
const state = sourceStates.get(handle);
|
|
@@ -6740,10 +6914,10 @@ async function runFileRules(session) {
|
|
|
6740
6914
|
files: 0
|
|
6741
6915
|
})) : void 0;
|
|
6742
6916
|
const workspacePackages = projectWorkspacePackages(session.project);
|
|
6743
|
-
const
|
|
6917
|
+
const reportedFiles = session.scopedReport ? new Set(session.files.flatMap((file) => file.reportEligibility ? [file.path] : [])) : void 0;
|
|
6744
6918
|
for (const file of session.handles) {
|
|
6745
6919
|
const owner = session.ruleScopes.size ? owningWorkspacePackage(workspacePackages, file.relativePath) : ".";
|
|
6746
|
-
const candidates =
|
|
6920
|
+
const candidates = reportedFiles && !reportedFiles.has(file.path) ? [...rules.keys()].filter((index) => rules[index].meta.reportScope === "project") : [...rules.keys()];
|
|
6747
6921
|
if (!candidates.length) continue;
|
|
6748
6922
|
if (sourceShape(file) === void 0) await loadSourceFile(file);
|
|
6749
6923
|
const pending = [];
|
|
@@ -6892,7 +7066,7 @@ function manifestRuleProjects(session, rule, nuxtRoots) {
|
|
|
6892
7066
|
async function buildGraphPhase(session) {
|
|
6893
7067
|
const analyses = selectedAnalyses(session);
|
|
6894
7068
|
const graphAnalyses = analyses.has("dead-code") || analyses.has("graph");
|
|
6895
|
-
if (session.
|
|
7069
|
+
if (session.scopedReport && !graphAnalyses) return;
|
|
6896
7070
|
const key = graphKey(session);
|
|
6897
7071
|
if (!graphAnalyses) {
|
|
6898
7072
|
const cached = session.cache.graph(key);
|
|
@@ -7385,14 +7559,7 @@ function createTextReport(result) {
|
|
|
7385
7559
|
const items = result.diagnostics.filter((diagnostic) => diagnostic.severity === severity);
|
|
7386
7560
|
if (!items.length) continue;
|
|
7387
7561
|
lines.push(pc.bold(labelSeverity(severity)));
|
|
7388
|
-
for (const diagnostic of items)
|
|
7389
|
-
const path = relative(result.root, diagnostic.file) || ".";
|
|
7390
|
-
const loc = diagnostic.range ? `${path}:${diagnostic.range.line}:${diagnostic.range.column}` : path;
|
|
7391
|
-
lines.push(indent(formatDiagnostic(diagnostic.diagnostic), " "));
|
|
7392
|
-
lines.push(` rule: ${diagnostic.ruleId}`);
|
|
7393
|
-
lines.push(` source: ${loc}`);
|
|
7394
|
-
lines.push(` confidence: ${diagnostic.confidence ?? "heuristic-medium"}`);
|
|
7395
|
-
}
|
|
7562
|
+
for (const diagnostic of items) lines.push(formatTextDiagnostic(result.root, diagnostic));
|
|
7396
7563
|
lines.push("");
|
|
7397
7564
|
}
|
|
7398
7565
|
lines.push("Summary");
|
|
@@ -7415,6 +7582,20 @@ function createTextReport(result) {
|
|
|
7415
7582
|
}
|
|
7416
7583
|
return lines.join("\n");
|
|
7417
7584
|
}
|
|
7585
|
+
/** One Diagnostic as the text report renders it, indented for a severity section. */
|
|
7586
|
+
function formatTextDiagnostic(root, diagnostic) {
|
|
7587
|
+
return [
|
|
7588
|
+
indent(formatDiagnostic(diagnostic.diagnostic), " "),
|
|
7589
|
+
` rule: ${diagnostic.ruleId}`,
|
|
7590
|
+
` source: ${diagnosticLocation(root, diagnostic)}`,
|
|
7591
|
+
` confidence: ${diagnostic.confidence ?? "heuristic-medium"}`
|
|
7592
|
+
].join("\n");
|
|
7593
|
+
}
|
|
7594
|
+
/** `path:line:column` relative to `root`, or the path alone for an unlocated Diagnostic. */
|
|
7595
|
+
function diagnosticLocation(root, diagnostic) {
|
|
7596
|
+
const path = relative(root, diagnostic.file) || ".";
|
|
7597
|
+
return diagnostic.range ? `${path}:${diagnostic.range.line}:${diagnostic.range.column}` : path;
|
|
7598
|
+
}
|
|
7418
7599
|
function confidenceMix(result) {
|
|
7419
7600
|
const mix = {
|
|
7420
7601
|
proven: 0,
|
|
@@ -7863,6 +8044,9 @@ async function executeDoctorRun(options) {
|
|
|
7863
8044
|
base: session.gitChanges.base,
|
|
7864
8045
|
files: session.files.filter((file) => file.reportEligibility).length,
|
|
7865
8046
|
deletedFiles: session.gitChanges.files.filter((file) => file.kind === "deleted").length
|
|
8047
|
+
} : options.affectedFiles ? {
|
|
8048
|
+
mode: "affected",
|
|
8049
|
+
files: session.files.filter((file) => file.reportEligibility).length
|
|
7866
8050
|
} : {
|
|
7867
8051
|
mode: "all",
|
|
7868
8052
|
files: session.files.length
|
|
@@ -7880,4 +8064,4 @@ async function executeDoctorRun(options) {
|
|
|
7880
8064
|
return result;
|
|
7881
8065
|
}
|
|
7882
8066
|
//#endregion
|
|
7883
|
-
export {
|
|
8067
|
+
export { findTemplateAttribute as A, nuxtInventoryOwner as C, parseSfcFile as D, createVueScriptForParsing as E, templateExpressionReferences as F, walkTemplate as I, getNodeVisitorKeys as L, parseTemplateExpression as M, startTagEnd as N, parseVueScripts as O, templateDirectiveBindings as P, detectWorkspacePackages as S, workspaceFramework as T, detectProject as _, explainRule as a, findDefaultNuxtModuleDefinition as b, namePattern as c, collectRulePacks as d, resolveProjectDoctorConfig as f, selectScanFiles as g, projectWorkspacePackages as h, diagnosticLocation as i, findTemplateDirective as j, TemplateNodeType as k, cacheStatus as l, evaluateRuntimeRange as m, createReport as n, formatTextDiagnostic as o, evaluateRuleApplicability as p, createRulesReport as r, reportStatus as s, runDoctor as t, cleanCache as u, loadTypeScript as v, owningWorkspacePackage as w, unwrapExpression as x, loadVueCompilerSfc as y };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as nuxtInventoryOwner, S as detectWorkspacePackages, T as workspaceFramework, _ as detectProject, d as collectRulePacks, f as resolveProjectDoctorConfig, l as cacheStatus, t as runDoctor, u as cleanCache } from "./core-CaB3tfE8.mjs";
|
|
2
2
|
import { n as defineDoctorExtension } from "./primitives-QDMBsnjd.mjs";
|
|
3
3
|
import { t as doctorInternalDiagnostics } from "./internal-diagnostic-handles-R_2cBQaP.mjs";
|
|
4
4
|
import { t as viteDoctorVersion } from "./version-Qod0rU4x.mjs";
|
|
5
|
-
import { t as packageRulePack } from "./package-
|
|
6
|
-
import { t as viteRulePack } from "./rules-
|
|
7
|
-
import "./rules-
|
|
8
|
-
import { t as typescriptRulePack } from "./rules-
|
|
9
|
-
import "./typescript-
|
|
10
|
-
import { t as shadcnRulePack } from "./shadcn-
|
|
11
|
-
import { t as piniaRulePack } from "./pinia-
|
|
5
|
+
import { t as packageRulePack } from "./package-C6h9Qtda.mjs";
|
|
6
|
+
import { t as viteRulePack } from "./rules-DYeVClNx.mjs";
|
|
7
|
+
import "./rules-CW8Ec0h7.mjs";
|
|
8
|
+
import { t as typescriptRulePack } from "./rules-BEz9as7i.mjs";
|
|
9
|
+
import "./typescript-DP3Wc7UQ.mjs";
|
|
10
|
+
import { t as shadcnRulePack } from "./shadcn-CpFqGWl3.mjs";
|
|
11
|
+
import { t as piniaRulePack } from "./pinia-BOSWuj_L.mjs";
|
|
12
12
|
import { readFileSync } from "node:fs";
|
|
13
13
|
import { isAbsolute, join } from "pathe";
|
|
14
14
|
import { pathToFileURL } from "node:url";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as viteDoctorCacheStatus, i as shouldFailDoctorRun, n as hostDoctorExtensions, o as viteDoctorExtensions, r as runViteDoctor, s as viteDoctorRulePacks, t as cleanViteDoctorCache } from "./doctor-
|
|
1
|
+
import { a as viteDoctorCacheStatus, i as shouldFailDoctorRun, n as hostDoctorExtensions, o as viteDoctorExtensions, r as runViteDoctor, s as viteDoctorRulePacks, t as cleanViteDoctorCache } from "./doctor-B_MuQCG9.mjs";
|
|
2
2
|
export { cleanViteDoctorCache, hostDoctorExtensions, runViteDoctor, shouldFailDoctorRun, viteDoctorCacheStatus, viteDoctorExtensions, viteDoctorRulePacks };
|
package/dist/doctor-process.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import module from "node:module";
|
|
2
2
|
//#region src/doctor-process.ts
|
|
3
3
|
module.enableCompileCache();
|
|
4
|
-
const { parseServerOptions, serveDoctorProcess } = await import("./server-
|
|
4
|
+
const { parseServerOptions, serveDoctorProcess } = await import("./server-Ds24tvve.mjs");
|
|
5
5
|
const server = await serveDoctorProcess(parseServerOptions(process.argv[2]));
|
|
6
6
|
if (server) {
|
|
7
7
|
for (const signal of [
|
package/dist/extension.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as DoctorDiagnosticHandle, A as SourceRange, B as TemplateNodeKinds, C as RuntimeEvidenceContributor, D as ScriptAstNodeType, E as ScriptAstNodeOf, F as TemplateDirectiveNode, G as TemplateTextNode, H as TemplateParentNode, I as TemplateElementNode, J as defineDoctorExtension, K as TemplateVisitor, L as TemplateExpressionNode, M as TemplateAttributeNode, N as TemplateChildNode, O as ScriptVisitor, P as TemplateCommentNode, Q as DoctorDiagnosticCodeEntry, R as TemplateInterpolationNode, S as RuleVisitor, T as ScriptAstNode, U as TemplateRootNode, V as TemplateNodeParents, W as TemplateSourceLocation, X as defineRulePack, Y as defineDoctorPluginApi, Z as DefineDoctorDiagnosticsOptions, _ as RuleLifecycleHooks, a as DoctorExtensionLoader, b as RulePrefilter, et as DoctorDiagnosticParams, g as RuleContext, h as ProjectInventoryContributor, i as DoctorExtensionInput, j as TemplateAstNode, k as SourceFileHandle, l as DoctorRule, m as ProjectInfo, n as DoctorExtension, nt as defineExtensionDiagnostics, q as createRule, r as DoctorExtensionApi, s as DoctorPluginApi, tt as DoctorDiagnosticRegistry, v as RuleMeta, x as RuleReportMetadata, y as RulePack, z as TemplateNodeKind } from "./primitives-
|
|
2
|
-
import { t as RESERVED_DIAGNOSTIC_CODE_PREFIXES } from "./extension-
|
|
1
|
+
import { $ as DoctorDiagnosticHandle, A as SourceRange, B as TemplateNodeKinds, C as RuntimeEvidenceContributor, D as ScriptAstNodeType, E as ScriptAstNodeOf, F as TemplateDirectiveNode, G as TemplateTextNode, H as TemplateParentNode, I as TemplateElementNode, J as defineDoctorExtension, K as TemplateVisitor, L as TemplateExpressionNode, M as TemplateAttributeNode, N as TemplateChildNode, O as ScriptVisitor, P as TemplateCommentNode, Q as DoctorDiagnosticCodeEntry, R as TemplateInterpolationNode, S as RuleVisitor, T as ScriptAstNode, U as TemplateRootNode, V as TemplateNodeParents, W as TemplateSourceLocation, X as defineRulePack, Y as defineDoctorPluginApi, Z as DefineDoctorDiagnosticsOptions, _ as RuleLifecycleHooks, a as DoctorExtensionLoader, b as RulePrefilter, et as DoctorDiagnosticParams, g as RuleContext, h as ProjectInventoryContributor, i as DoctorExtensionInput, j as TemplateAstNode, k as SourceFileHandle, l as DoctorRule, m as ProjectInfo, n as DoctorExtension, nt as defineExtensionDiagnostics, q as createRule, r as DoctorExtensionApi, s as DoctorPluginApi, tt as DoctorDiagnosticRegistry, v as RuleMeta, x as RuleReportMetadata, y as RulePack, z as TemplateNodeKind } from "./primitives-nC-P1qet.mjs";
|
|
2
|
+
import { t as RESERVED_DIAGNOSTIC_CODE_PREFIXES } from "./extension-BWauKIzu.mjs";
|
|
3
3
|
export { type DefineDoctorDiagnosticsOptions, type DoctorDiagnosticCodeEntry, type DoctorDiagnosticHandle, type DoctorDiagnosticParams, type DoctorDiagnosticRegistry, type DoctorExtension, type DoctorExtensionApi, type DoctorExtensionInput, type DoctorExtensionLoader, type DoctorPluginApi, type DoctorRule, type ProjectInfo, type ProjectInventoryContributor, RESERVED_DIAGNOSTIC_CODE_PREFIXES, type RuleContext, type RuleLifecycleHooks, type RuleMeta, type RulePack, type RulePrefilter, type RuleReportMetadata, type RuleVisitor, type RuntimeEvidenceContributor, type ScriptAstNode, type ScriptAstNodeOf, type ScriptAstNodeType, type ScriptVisitor, type SourceFileHandle, type SourceRange, type TemplateAstNode, type TemplateAttributeNode, type TemplateChildNode, type TemplateCommentNode, type TemplateDirectiveNode, type TemplateElementNode, type TemplateExpressionNode, type TemplateInterpolationNode, type TemplateNodeKind, type TemplateNodeKinds, type TemplateNodeParents, type TemplateParentNode, type TemplateRootNode, type TemplateSourceLocation, type TemplateTextNode, type TemplateVisitor, createRule, defineExtensionDiagnostics as defineDoctorDiagnostics, defineDoctorExtension, defineDoctorPluginApi, defineRulePack };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as DoctorRule, y as RulePack } from "./primitives-
|
|
1
|
+
import { l as DoctorRule, y as RulePack } from "./primitives-nC-P1qet.mjs";
|
|
2
2
|
//#region src/rule-packs/typescript/rules/no-array-filter-map.d.ts
|
|
3
3
|
declare const noArrayFilterMap: DoctorRule;
|
|
4
4
|
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index-DEy2t14t.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as DoctorRule, y as RulePack } from "./primitives-
|
|
2
|
-
import "./extension-
|
|
1
|
+
import { l as DoctorRule, y as RulePack } from "./primitives-nC-P1qet.mjs";
|
|
2
|
+
import "./extension-BWauKIzu.mjs";
|
|
3
3
|
//#region src/rule-packs/nitro/rules/no-use-nuxt-app-in-nitro.d.ts
|
|
4
4
|
declare const noUseNuxtAppInNitro: DoctorRule;
|
|
5
5
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as DoctorRule, y as RulePack } from "./primitives-
|
|
1
|
+
import { l as DoctorRule, y as RulePack } from "./primitives-nC-P1qet.mjs";
|
|
2
2
|
//#region src/rule-packs/vite/rules/define.d.ts
|
|
3
3
|
declare const noUnusedDefine: DoctorRule;
|
|
4
4
|
declare const noUntypedDefine: DoctorRule;
|