vite-doctor 0.0.8 → 0.0.9
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 +6 -12
- package/dist/{module-DWXrUl_H.d.mts → module-2_e5b-LZ.d.mts} +3 -6
- package/dist/{module--Dgf9XPW.mjs → module-DVHJKJkW.mjs} +13 -8
- package/dist/nuxt.d.mts +1 -1
- package/dist/nuxt.mjs +1 -1
- package/dist/rule-packs/nuxt/index.d.mts +1 -1
- package/dist/rule-packs/nuxt/index.mjs +1 -1
- package/dist/rule-packs/nuxt/module.d.mts +1 -1
- package/dist/rule-packs/nuxt/module.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -144,18 +144,12 @@ Use the Nuxt module surface for Nuxt-specific configuration:
|
|
|
144
144
|
```ts
|
|
145
145
|
// nuxt.config.ts
|
|
146
146
|
export default defineNuxtConfig({
|
|
147
|
-
modules: [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
"nuxt/routing/prefer-nuxt-useroute": "error",
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
],
|
|
147
|
+
modules: ["vite-doctor/nuxt"],
|
|
148
|
+
doctor: {
|
|
149
|
+
rules: {
|
|
150
|
+
"nuxt/routing/prefer-nuxt-useroute": "error",
|
|
151
|
+
},
|
|
152
|
+
},
|
|
159
153
|
});
|
|
160
154
|
```
|
|
161
155
|
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { o as NuxtDoctorManifest, s as RulePack, t as DoctorExtension } from "./primitives-3i5qmm5e.mjs";
|
|
2
2
|
import { t as DoctorConfig } from "./config-BF-tCiTu.mjs";
|
|
3
3
|
import "./index-B6nzQEFO.mjs";
|
|
4
|
+
import { NuxtModule } from "nuxt/schema";
|
|
4
5
|
//#region src/rule-packs/nuxt/module.d.ts
|
|
5
|
-
|
|
6
|
-
config?: DoctorConfig;
|
|
7
|
-
extends?: "auto" | string[];
|
|
8
|
-
extensions?: DoctorExtension[];
|
|
9
|
-
}
|
|
6
|
+
type NuxtDoctorModuleOptions = DoctorConfig;
|
|
10
7
|
type EvidenceBuildManifest = {
|
|
11
8
|
hasBuildManifest: boolean;
|
|
12
9
|
chunks: Array<{
|
|
@@ -31,7 +28,7 @@ type NuxtDoctorEvidence = {
|
|
|
31
28
|
importDirs?: unknown[];
|
|
32
29
|
autoImportContext?: NuxtAutoImportContext;
|
|
33
30
|
};
|
|
34
|
-
declare
|
|
31
|
+
declare const nuxtDoctorModule: NuxtModule<NuxtDoctorModuleOptions>;
|
|
35
32
|
declare function collectNuxtDoctorRulePacks(nuxt: any): Promise<RulePack[]>;
|
|
36
33
|
declare function collectNuxtDoctorExtensions(nuxt: any): Promise<DoctorExtension[]>;
|
|
37
34
|
declare function writeManifest(nuxt: any, evidence?: NuxtDoctorEvidence): Promise<NuxtDoctorManifest>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { join, relative, resolve } from "pathe";
|
|
2
2
|
import { existsSync, mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { defineNuxtModule } from "nuxt/kit";
|
|
3
4
|
//#region src/rule-packs/nuxt/module.ts
|
|
4
|
-
async function
|
|
5
|
+
async function setupNuxtDoctor(options, nuxt) {
|
|
5
6
|
nuxt.options ??= {};
|
|
6
|
-
nuxt.options.doctor
|
|
7
|
-
nuxt.options.doctor.config ??= options.config;
|
|
8
|
-
nuxt.options.doctor.extends ??= options.extends;
|
|
9
|
-
nuxt.options.doctor.extensions ??= options.extensions;
|
|
7
|
+
nuxt.options.doctor = options;
|
|
10
8
|
const evidence = {
|
|
11
9
|
pages: [],
|
|
12
10
|
prerenderRoutes: /* @__PURE__ */ new Set(),
|
|
@@ -55,6 +53,15 @@ async function nuxtDoctorModule(options = {}, nuxt) {
|
|
|
55
53
|
await writeManifest(nuxt, evidence);
|
|
56
54
|
});
|
|
57
55
|
}
|
|
56
|
+
const nuxtDoctorModule = defineNuxtModule({
|
|
57
|
+
meta: {
|
|
58
|
+
name: "vite-doctor",
|
|
59
|
+
configKey: "doctor",
|
|
60
|
+
compatibility: { nuxt: ">=4" },
|
|
61
|
+
docs: "https://vite-doctor.onmax.me/nuxt"
|
|
62
|
+
},
|
|
63
|
+
setup: setupNuxtDoctor
|
|
64
|
+
});
|
|
58
65
|
async function collectNuxtDoctorRulePacks(nuxt) {
|
|
59
66
|
const extraRulePacks = [];
|
|
60
67
|
await nuxt.callHook?.("doctor:extendRules", extraRulePacks);
|
|
@@ -195,9 +202,7 @@ function normalizeModuleSource(source) {
|
|
|
195
202
|
appDirs: source.appDirs?.map((dir) => resolve(dir))
|
|
196
203
|
};
|
|
197
204
|
}
|
|
198
|
-
function serializableDoctorConfig(
|
|
199
|
-
const config = { ...doctor.config };
|
|
200
|
-
config.extends ??= doctor.extends;
|
|
205
|
+
function serializableDoctorConfig(config = {}) {
|
|
201
206
|
const payload = {};
|
|
202
207
|
if (config.extends !== void 0) payload.extends = config.extends;
|
|
203
208
|
if (config.include !== void 0) payload.include = config.include;
|
package/dist/nuxt.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as nuxtDoctorModule, t as NuxtDoctorModuleOptions } from "./module-
|
|
1
|
+
import { i as nuxtDoctorModule, t as NuxtDoctorModuleOptions } from "./module-2_e5b-LZ.mjs";
|
|
2
2
|
export { type NuxtDoctorModuleOptions, nuxtDoctorModule as default };
|
package/dist/nuxt.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as nuxtDoctorModule } from "./module
|
|
1
|
+
import { r as nuxtDoctorModule } from "./module-DVHJKJkW.mjs";
|
|
2
2
|
export { nuxtDoctorModule as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { o as NuxtDoctorManifest } from "../../primitives-3i5qmm5e.mjs";
|
|
2
|
-
import { a as writeManifest, i as nuxtDoctorModule, n as collectNuxtDoctorExtensions, r as collectNuxtDoctorRulePacks, t as NuxtDoctorModuleOptions } from "../../module-
|
|
2
|
+
import { a as writeManifest, i as nuxtDoctorModule, n as collectNuxtDoctorExtensions, r as collectNuxtDoctorRulePacks, t as NuxtDoctorModuleOptions } from "../../module-2_e5b-LZ.mjs";
|
|
3
3
|
export { type NuxtDoctorManifest, NuxtDoctorModuleOptions, collectNuxtDoctorExtensions, collectNuxtDoctorRulePacks, nuxtDoctorModule as default, writeManifest };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as writeManifest, n as collectNuxtDoctorRulePacks, r as nuxtDoctorModule, t as collectNuxtDoctorExtensions } from "../../module
|
|
1
|
+
import { i as writeManifest, n as collectNuxtDoctorRulePacks, r as nuxtDoctorModule, t as collectNuxtDoctorExtensions } from "../../module-DVHJKJkW.mjs";
|
|
2
2
|
export { collectNuxtDoctorExtensions, collectNuxtDoctorRulePacks, nuxtDoctorModule as default, writeManifest };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { o as NuxtDoctorManifest } from "../../primitives-3i5qmm5e.mjs";
|
|
2
|
-
import { a as writeManifest, i as nuxtDoctorModule, n as collectNuxtDoctorExtensions, r as collectNuxtDoctorRulePacks, t as NuxtDoctorModuleOptions } from "../../module-
|
|
2
|
+
import { a as writeManifest, i as nuxtDoctorModule, n as collectNuxtDoctorExtensions, r as collectNuxtDoctorRulePacks, t as NuxtDoctorModuleOptions } from "../../module-2_e5b-LZ.mjs";
|
|
3
3
|
export { type NuxtDoctorManifest, NuxtDoctorModuleOptions, collectNuxtDoctorExtensions, collectNuxtDoctorRulePacks, nuxtDoctorModule as default, writeManifest };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as writeManifest, n as collectNuxtDoctorRulePacks, r as nuxtDoctorModule, t as collectNuxtDoctorExtensions } from "../../module
|
|
1
|
+
import { i as writeManifest, n as collectNuxtDoctorRulePacks, r as nuxtDoctorModule, t as collectNuxtDoctorExtensions } from "../../module-DVHJKJkW.mjs";
|
|
2
2
|
export { collectNuxtDoctorExtensions, collectNuxtDoctorRulePacks, nuxtDoctorModule as default, writeManifest };
|