vize 0.429.1 → 0.430.1

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 CHANGED
@@ -135,6 +135,8 @@ export default defineConfig({
135
135
  typeChecker: {
136
136
  enabled: true,
137
137
  strict: true,
138
+ // Large cold LSP projects can raise the default 60-second Corsa request bound.
139
+ lspRequestTimeoutMs: 90000,
138
140
  },
139
141
  });
140
142
  ```
package/dist/cli.mjs CHANGED
@@ -280,7 +280,19 @@ ${blocks.join("\n")}
280
280
  `;
281
281
  }
282
282
  /** Minimum project config written only when typechecking is selected and no config exists. */
283
- function renderTypecheckTsconfig(typescript) {
283
+ function renderTypecheckTsconfig(typescript, nuxtMajor) {
284
+ if (nuxtMajor !== void 0) {
285
+ const config = nuxtMajor !== null && nuxtMajor >= 4 ? {
286
+ files: [],
287
+ references: [
288
+ "app",
289
+ "server",
290
+ "shared",
291
+ "node"
292
+ ].map((part) => ({ path: `./.nuxt/tsconfig.${part}.json` }))
293
+ } : { extends: "./.nuxt/tsconfig.json" };
294
+ return `${JSON.stringify(config, null, 2)}\n`;
295
+ }
284
296
  const compilerOptions = {
285
297
  strict: true,
286
298
  target: "ES2022",
@@ -1030,6 +1042,7 @@ function detectProject(root) {
1030
1042
  packageManager: detectPackageManager(root),
1031
1043
  framework: detectFramework(nuxtConfig, viteConfigs, dependencies),
1032
1044
  nuxtConfig,
1045
+ nuxtMajor: declaredNuxtMajor(packageJson),
1033
1046
  viteConfigs,
1034
1047
  usesVitePlus: detectVitePlus(dependencies, viteSource, scripts),
1035
1048
  typescript: dependencies.has("typescript") || fs.existsSync(path.join(root, "tsconfig.json")),
@@ -1044,6 +1057,20 @@ function detectProject(root) {
1044
1057
  vscodeRecommendsVize: detectVscodeRecommendation(root)
1045
1058
  };
1046
1059
  }
1060
+ function declaredNuxtMajor(packageJson) {
1061
+ for (const field of [
1062
+ "dependencies",
1063
+ "devDependencies",
1064
+ "optionalDependencies"
1065
+ ]) {
1066
+ const group = packageJson[field];
1067
+ if (group === null || typeof group !== "object" || Array.isArray(group)) continue;
1068
+ const version = group.nuxt;
1069
+ const major = typeof version === "string" ? /^[~^<>=\s]*(\d+)(?:\.|$)/u.exec(version) : null;
1070
+ if (major) return Number(major[1]);
1071
+ }
1072
+ return null;
1073
+ }
1047
1074
  function detectFramework(nuxtConfig, viteConfigs, dependencies) {
1048
1075
  if (nuxtConfig !== null || dependencies.has("nuxt")) return "nuxt";
1049
1076
  return viteConfigs.length > 0 ? "vite" : "none";
@@ -1343,7 +1370,7 @@ function planVizeConfig(detection, selection, draft) {
1343
1370
  if (selection.typecheck && detection.tsconfig === null) {
1344
1371
  draft.files.push({
1345
1372
  filename: path.join(detection.root, "tsconfig.json"),
1346
- source: renderTypecheckTsconfig(detection.typescript)
1373
+ source: renderTypecheckTsconfig(detection.typescript, detection.framework === "nuxt" ? detection.nuxtMajor : void 0)
1347
1374
  });
1348
1375
  draft.createdFiles.push("tsconfig.json");
1349
1376
  }
@@ -1395,7 +1422,7 @@ function planScripts(detection, selection, draft) {
1395
1422
  const source = fs.readFileSync(packagePath, "utf8");
1396
1423
  const packageJson = parsePackageJson(packagePath, source);
1397
1424
  const scripts = { ...detection.scripts };
1398
- for (const name of missing) scripts[name] = DEFAULT_SCRIPTS[name];
1425
+ for (const name of missing) scripts[name] = name === "vize:check" && detection.framework === "nuxt" ? "nuxt prepare && vize check" : DEFAULT_SCRIPTS[name];
1399
1426
  packageJson.scripts = scripts;
1400
1427
  draft.files.push({
1401
1428
  filename: packagePath,