@nwire/cli 0.11.0 → 0.12.0
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/commands/doctor.js +29 -3
- package/package.json +4 -4
package/dist/commands/doctor.js
CHANGED
|
@@ -194,14 +194,40 @@ const inspectMountCheck = {
|
|
|
194
194
|
};
|
|
195
195
|
const tsconfigCheck = {
|
|
196
196
|
name: "tsconfig",
|
|
197
|
-
description: "tsconfig
|
|
197
|
+
description: "tsconfig compiles — types resolve + Bundler module resolution",
|
|
198
198
|
run: (ctx) => {
|
|
199
199
|
const path = join(ctx.cwd, "tsconfig.json");
|
|
200
200
|
if (!existsSync(path))
|
|
201
201
|
return { status: "info", message: "no tsconfig.json" };
|
|
202
202
|
const text = readFileSync(path, "utf8");
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
// A `types` entry that points at an uninstalled package makes `tsc`
|
|
204
|
+
// fail before it reads a line of your code — the classic being
|
|
205
|
+
// "vite/client" with no `vite` installed. Catch it here so the doctor
|
|
206
|
+
// doesn't greenlight a project that won't typecheck. (Only when
|
|
207
|
+
// node_modules exists; pre-install we can't tell.)
|
|
208
|
+
if (existsSync(join(ctx.cwd, "node_modules"))) {
|
|
209
|
+
const typesArr = text.match(/"types"\s*:\s*\[([^\]]*)\]/);
|
|
210
|
+
const entries = typesArr
|
|
211
|
+
? (typesArr[1].match(/"([^"]+)"/g) ?? []).map((s) => s.slice(1, -1))
|
|
212
|
+
: [];
|
|
213
|
+
const missing = entries.filter((e) => {
|
|
214
|
+
const pkg = e.startsWith("@") ? e.split("/").slice(0, 2).join("/") : e.split("/")[0];
|
|
215
|
+
const real = pkg === "node" ? "@types/node" : pkg;
|
|
216
|
+
return !existsSync(join(ctx.cwd, "node_modules", real));
|
|
217
|
+
});
|
|
218
|
+
if (missing.length > 0) {
|
|
219
|
+
return {
|
|
220
|
+
status: "fail",
|
|
221
|
+
message: `tsconfig "types" references uninstalled package(s): ${missing.join(", ")}`,
|
|
222
|
+
hint: missing.some((m) => m.startsWith("vite/"))
|
|
223
|
+
? 'A backend needs no Vite client types — drop "vite/client" from compilerOptions.types ("import.meta.url" is standard ESM).'
|
|
224
|
+
: "Install the package(s) or remove them from compilerOptions.types.",
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (/Bundler/i.test(text)) {
|
|
229
|
+
return { status: "pass", message: 'moduleResolution: "Bundler"; types resolve' };
|
|
230
|
+
}
|
|
205
231
|
if (/NodeNext|node16/i.test(text)) {
|
|
206
232
|
return {
|
|
207
233
|
status: "warn",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nwire/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Nwire CLI — branded TUI. Dev, run, please, build, test, fmt, lint, check, ps, logs, cache, ls, studio. One surface for the whole framework.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"listr2": "^9.0.4",
|
|
37
37
|
"picocolors": "^1.1.1",
|
|
38
38
|
"react": "^18.3.1",
|
|
39
|
-
"@nwire/
|
|
40
|
-
"@nwire/scan": "0.
|
|
41
|
-
"@nwire/
|
|
39
|
+
"@nwire/mcp": "0.12.0",
|
|
40
|
+
"@nwire/scan": "0.12.0",
|
|
41
|
+
"@nwire/hooks": "0.12.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^22.19.9",
|