@zveltio/cli 3.0.0-beta.68 → 3.0.0-beta.71
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/index.js +22 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2320,6 +2320,7 @@ ${c14.bold("Extension status")}
|
|
|
2320
2320
|
console.log(` Registry: ${c14.dim(registryUrl)}
|
|
2321
2321
|
`);
|
|
2322
2322
|
const listRes = await fetch(`${registryUrl}/api/extensions/list`).catch(() => null);
|
|
2323
|
+
unreachable(listRes);
|
|
2323
2324
|
if (listRes?.ok) {
|
|
2324
2325
|
const body = await listRes.json();
|
|
2325
2326
|
const found = body.extensions.find((e) => e.name === name);
|
|
@@ -2331,6 +2332,7 @@ ${c14.bold("Extension status")}
|
|
|
2331
2332
|
}
|
|
2332
2333
|
}
|
|
2333
2334
|
const detailRes = await fetch(`${registryUrl}/api/dev/extensions/by-name/${encodeURIComponent(name)}`).catch(() => null);
|
|
2335
|
+
unreachable(detailRes);
|
|
2334
2336
|
if (detailRes?.ok) {
|
|
2335
2337
|
const body = await detailRes.json();
|
|
2336
2338
|
const statusColor = body.status === "published" ? c14.green : body.status === "pending" ? c14.yellow : c14.red;
|
|
@@ -2365,6 +2367,12 @@ ${c14.bold("Extension status")}
|
|
|
2365
2367
|
` + " - First-party / bundled extensions are not surfaced by this command \u2014 they ship with the engine binary directly."));
|
|
2366
2368
|
console.log("");
|
|
2367
2369
|
}
|
|
2370
|
+
function unreachable(res) {
|
|
2371
|
+
if (res && res.status < 500)
|
|
2372
|
+
return;
|
|
2373
|
+
console.error(c14.red(` \u2717 Registry unreachable (${res ? `HTTP ${res.status}` : "network error"}).`));
|
|
2374
|
+
process.exit(1);
|
|
2375
|
+
}
|
|
2368
2376
|
var c14;
|
|
2369
2377
|
var init_extension_status = __esm(() => {
|
|
2370
2378
|
c14 = {
|
|
@@ -4339,6 +4347,14 @@ function validateManifest(input) {
|
|
|
4339
4347
|
if (typeof obj.zveltioMaxVersion === "string" && !SEMVER_RE.test(obj.zveltioMaxVersion)) {
|
|
4340
4348
|
out.push(err("MANIFEST_BAD_MAX_VERSION", `zveltioMaxVersion "${obj.zveltioMaxVersion}" is not valid semver`));
|
|
4341
4349
|
}
|
|
4350
|
+
if (obj.apiKeyRoutes !== undefined) {
|
|
4351
|
+
const routes = Array.isArray(obj.apiKeyRoutes) ? obj.apiKeyRoutes : [obj.apiKeyRoutes];
|
|
4352
|
+
for (const r of routes) {
|
|
4353
|
+
if (typeof r !== "string" || !/^(GET|POST|PUT|PATCH|DELETE) \S+$/.test(r)) {
|
|
4354
|
+
out.push(err("MANIFEST_BAD_API_KEY_ROUTE", `apiKeyRoutes entry ${JSON.stringify(r)} must be "<GET|POST|PUT|PATCH|DELETE> <pattern>"`));
|
|
4355
|
+
}
|
|
4356
|
+
}
|
|
4357
|
+
}
|
|
4342
4358
|
if (typeof obj.category === "string" && !KNOWN_CATEGORIES.has(obj.category)) {
|
|
4343
4359
|
out.push(warn("MANIFEST_UNKNOWN_CATEGORY", `category "${obj.category}" isn't in the known set \u2014 typo? Known: ${[...KNOWN_CATEGORIES].sort().join(", ")}`));
|
|
4344
4360
|
}
|
|
@@ -6317,8 +6333,9 @@ var rollbackCommand = new Command("rollback").description("Rollback database mig
|
|
|
6317
6333
|
console.log(`
|
|
6318
6334
|
\u2705 Rolled back to schema version ${targetVersion}.
|
|
6319
6335
|
`);
|
|
6320
|
-
console.log(" \u26A0\uFE0F
|
|
6321
|
-
console.log(
|
|
6336
|
+
console.log(" \u26A0\uFE0F Before restarting, install the engine build that matches this");
|
|
6337
|
+
console.log(" schema version, or set MIGRATIONS_AUTO=false \u2014 restarting this build");
|
|
6338
|
+
console.log(` re-applies the rolled-back migrations.
|
|
6322
6339
|
`);
|
|
6323
6340
|
} catch (err2) {
|
|
6324
6341
|
console.error(`
|
|
@@ -6743,7 +6760,7 @@ async function getLocalVersion() {
|
|
|
6743
6760
|
// package.json
|
|
6744
6761
|
var package_default = {
|
|
6745
6762
|
name: "@zveltio/cli",
|
|
6746
|
-
version: "3.0.0-beta.
|
|
6763
|
+
version: "3.0.0-beta.71",
|
|
6747
6764
|
type: "module",
|
|
6748
6765
|
bin: {
|
|
6749
6766
|
zveltio: "./dist/index.js"
|
|
@@ -6758,7 +6775,7 @@ var package_default = {
|
|
|
6758
6775
|
dev: "bun run --watch src/index.ts"
|
|
6759
6776
|
},
|
|
6760
6777
|
dependencies: {
|
|
6761
|
-
"@zveltio/sdk": "3.0.0-beta.
|
|
6778
|
+
"@zveltio/sdk": "3.0.0-beta.71",
|
|
6762
6779
|
commander: "^12.1.0"
|
|
6763
6780
|
},
|
|
6764
6781
|
devDependencies: {
|
|
@@ -6773,7 +6790,7 @@ var package_default = {
|
|
|
6773
6790
|
|
|
6774
6791
|
// src/index.ts
|
|
6775
6792
|
var program2 = new Command;
|
|
6776
|
-
program2.name("zveltio").description("The official Zveltio CLI").version(package_default.version);
|
|
6793
|
+
program2.name("zveltio").allowExcessArguments(false).description("The official Zveltio CLI").version(package_default.version);
|
|
6777
6794
|
program2.command("init [dir]").description("Initialize a new Zveltio project (interactive)").option("--template <template>", "Starter template to use", "default").action(initCommand);
|
|
6778
6795
|
program2.command("dev").description("Start Zveltio in development mode (with hot reload)").option("-p, --port <port>", "Port to listen on", "3000").option("--no-studio", "Disable Studio embed (API only)").action(devCommand);
|
|
6779
6796
|
program2.command("start").description("Start Zveltio in production mode (uses compiled binary if available)").option("-p, --port <port>", "Port to listen on", "3000").option("--binary <path>", "Path to compiled binary").action(startCommand);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zveltio/cli",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.71",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"zveltio": "./dist/index.js"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dev": "bun run --watch src/index.ts"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@zveltio/sdk": "3.0.0-beta.
|
|
18
|
+
"@zveltio/sdk": "3.0.0-beta.71",
|
|
19
19
|
"commander": "^12.1.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|