vize 0.343.0 → 0.347.7
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 +1 -1
- package/dist/cli.mjs +41 -20
- package/dist/cli.mjs.map +1 -1
- package/dist/{config-D1VKwrsv.d.mts → config-B0NHKCD3.d.mts} +5 -1
- package/dist/config-B0NHKCD3.d.mts.map +1 -0
- package/dist/config.d.mts +1 -1
- package/dist/index.d.mts +1 -1
- package/package.json +7 -4
- package/pkl/LanguageServerConfig.pkl +3 -0
- package/pkl/jsonschema/MuseaSchemaDefinitions.pkl +119 -0
- package/pkl/jsonschema/generate.pkl +10 -120
- package/pkl/vize.pkl +1 -0
- package/schemas/vize.config.schema.json +4 -0
- package/src/init/args.ts +1 -1
- package/src/init/plan-project.ts +19 -20
- package/src/init/select.ts +7 -4
- package/src/init/templates.ts +19 -0
- package/src/setup/config.ts +4 -1
- package/src/types/generated.ts +4 -0
- package/dist/config-D1VKwrsv.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ Add scripts to your project and run Vize through your package manager:
|
|
|
71
71
|
"vize:build": "vize build src",
|
|
72
72
|
"vize:fmt": "vize fmt --write src",
|
|
73
73
|
"vize:lint": "vize lint --preset happy-path src",
|
|
74
|
-
"vize:check": "vize check
|
|
74
|
+
"vize:check": "vize check",
|
|
75
75
|
"vize:ready": "vize ready src",
|
|
76
76
|
"vize:upgrade": "vize upgrade"
|
|
77
77
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -94,7 +94,7 @@ const DEFAULT_SCRIPTS = {
|
|
|
94
94
|
"vize:fmt": "vize fmt --check src",
|
|
95
95
|
"vize:fmt:fix": "vize fmt --write src",
|
|
96
96
|
"vize:lint": "vize lint --preset happy-path --max-warnings 0 src",
|
|
97
|
-
"vize:check": "vize check
|
|
97
|
+
"vize:check": "vize check",
|
|
98
98
|
"vize:musea": "vize musea",
|
|
99
99
|
"vize:ready": "vize ready src"
|
|
100
100
|
};
|
|
@@ -110,6 +110,7 @@ export default defineConfig({
|
|
|
110
110
|
typeChecker: {
|
|
111
111
|
enabled: true,
|
|
112
112
|
strict: true,
|
|
113
|
+
jsxTypecheck: true,
|
|
113
114
|
},
|
|
114
115
|
vite: {
|
|
115
116
|
scanPatterns: ["src/**/*.vue"],
|
|
@@ -249,6 +250,7 @@ function renderVizeConfig(features) {
|
|
|
249
250
|
if (features.typecheck) blocks.push(` typeChecker: {
|
|
250
251
|
enabled: true,
|
|
251
252
|
strict: true,
|
|
253
|
+
jsxTypecheck: true,
|
|
252
254
|
},`);
|
|
253
255
|
if (features.vite) blocks.push(` vite: {
|
|
254
256
|
scanPatterns: ["src/**/*.vue"],
|
|
@@ -260,6 +262,26 @@ ${blocks.join("\n")}
|
|
|
260
262
|
});
|
|
261
263
|
`;
|
|
262
264
|
}
|
|
265
|
+
/** Minimum project config written only when typechecking is selected and no config exists. */
|
|
266
|
+
function renderTypecheckTsconfig(typescript) {
|
|
267
|
+
const compilerOptions = {
|
|
268
|
+
strict: true,
|
|
269
|
+
target: "ES2022",
|
|
270
|
+
module: "ESNext",
|
|
271
|
+
moduleResolution: "Bundler",
|
|
272
|
+
jsx: "preserve"
|
|
273
|
+
};
|
|
274
|
+
if (!typescript) {
|
|
275
|
+
compilerOptions.allowJs = true;
|
|
276
|
+
compilerOptions.checkJs = true;
|
|
277
|
+
}
|
|
278
|
+
compilerOptions.noEmit = true;
|
|
279
|
+
compilerOptions.skipLibCheck = true;
|
|
280
|
+
return `${JSON.stringify({
|
|
281
|
+
compilerOptions,
|
|
282
|
+
include: ["src/**/*"]
|
|
283
|
+
}, null, 2)}\n`;
|
|
284
|
+
}
|
|
263
285
|
/**
|
|
264
286
|
* Config for the `oxlint` binary.
|
|
265
287
|
*
|
|
@@ -768,14 +790,14 @@ function fmtOffer(detection) {
|
|
|
768
790
|
};
|
|
769
791
|
}
|
|
770
792
|
function typecheckOffer(detection) {
|
|
771
|
-
const configured = detection.vizeConfig !== null && "vize:check" in detection.scripts;
|
|
793
|
+
const configured = detection.tsconfig !== null && detection.vizeConfig !== null && "vize:check" in detection.scripts;
|
|
772
794
|
return {
|
|
773
795
|
id: "typecheck",
|
|
774
796
|
label: "typecheck (vize check)",
|
|
775
|
-
available:
|
|
797
|
+
available: true,
|
|
776
798
|
configured,
|
|
777
|
-
note: configured ? "already configured" : detection.tsconfig === null ? "
|
|
778
|
-
defaultSelected:
|
|
799
|
+
note: configured ? "already configured" : detection.tsconfig === null ? "creates tsconfig.json" : "",
|
|
800
|
+
defaultSelected: true
|
|
779
801
|
};
|
|
780
802
|
}
|
|
781
803
|
function editorOffer(detection) {
|
|
@@ -898,7 +920,7 @@ Options:
|
|
|
898
920
|
--nuxt nuxt module (forces the Nuxt target)
|
|
899
921
|
--bundler/--no-bundler vite plugin or nuxt module, auto-detected
|
|
900
922
|
--fmt / --no-fmt vize fmt
|
|
901
|
-
--typecheck vize check (
|
|
923
|
+
--typecheck vize check (creates tsconfig.json when missing)
|
|
902
924
|
--no-typecheck
|
|
903
925
|
--editor / --no-editor .vscode/extensions.json recommendation
|
|
904
926
|
--dry-run Print the plan without writing anything
|
|
@@ -1301,24 +1323,23 @@ const FEATURE_SCRIPTS = {
|
|
|
1301
1323
|
* guess that loses their settings.
|
|
1302
1324
|
*/
|
|
1303
1325
|
function planVizeConfig(detection, selection, draft) {
|
|
1326
|
+
if (selection.typecheck && detection.tsconfig === null) {
|
|
1327
|
+
draft.files.push({
|
|
1328
|
+
filename: path.join(detection.root, "tsconfig.json"),
|
|
1329
|
+
source: renderTypecheckTsconfig(detection.typescript)
|
|
1330
|
+
});
|
|
1331
|
+
draft.createdFiles.push("tsconfig.json");
|
|
1332
|
+
}
|
|
1304
1333
|
for (const id of ["fmt", "typecheck"]) {
|
|
1305
1334
|
if (!selection[id]) {
|
|
1306
|
-
draft.features.push(
|
|
1307
|
-
continue;
|
|
1308
|
-
}
|
|
1309
|
-
if (id === "typecheck" && detection.tsconfig === null) {
|
|
1310
|
-
draft.features.push({
|
|
1311
|
-
id,
|
|
1312
|
-
outcome: "blocked",
|
|
1313
|
-
detail: "vize check needs a tsconfig.json; none was found",
|
|
1314
|
-
snippet: null
|
|
1315
|
-
});
|
|
1335
|
+
draft.features.push(skipped(id));
|
|
1316
1336
|
continue;
|
|
1317
1337
|
}
|
|
1338
|
+
const scaffoldsTsconfig = id === "typecheck" && detection.tsconfig === null;
|
|
1318
1339
|
draft.features.push({
|
|
1319
1340
|
id,
|
|
1320
|
-
outcome: detection.vizeConfig === null ? "configured" : "unchanged",
|
|
1321
|
-
detail: detection.vizeConfig === null ? "writes vize.config.ts" : `${detection.vizeConfig} already exists and was left unchanged`,
|
|
1341
|
+
outcome: scaffoldsTsconfig || detection.vizeConfig === null ? "configured" : "unchanged",
|
|
1342
|
+
detail: scaffoldsTsconfig ? detection.vizeConfig === null ? "writes tsconfig.json and vize.config.ts" : `writes tsconfig.json; ${detection.vizeConfig} already exists and was left unchanged` : detection.vizeConfig === null ? "writes vize.config.ts" : `${detection.vizeConfig} already exists and was left unchanged`,
|
|
1322
1343
|
snippet: null
|
|
1323
1344
|
});
|
|
1324
1345
|
}
|
|
@@ -1328,7 +1349,7 @@ function planVizeConfig(detection, selection, draft) {
|
|
|
1328
1349
|
source: renderVizeConfig({
|
|
1329
1350
|
lint: selection.lint,
|
|
1330
1351
|
fmt: selection.fmt,
|
|
1331
|
-
typecheck: selection.typecheck
|
|
1352
|
+
typecheck: selection.typecheck,
|
|
1332
1353
|
vite: detection.framework === "vite"
|
|
1333
1354
|
})
|
|
1334
1355
|
});
|
|
@@ -1348,7 +1369,7 @@ function planScripts(detection, selection, draft) {
|
|
|
1348
1369
|
"fmt",
|
|
1349
1370
|
"typecheck"
|
|
1350
1371
|
]) {
|
|
1351
|
-
if (!selection[id]
|
|
1372
|
+
if (!selection[id]) continue;
|
|
1352
1373
|
wanted.push(...FEATURE_SCRIPTS[id]);
|
|
1353
1374
|
}
|
|
1354
1375
|
const missing = wanted.filter((name) => !(name in detection.scripts));
|