@vxil/cli 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/dist/vxil.js +7 -4
  2. package/package.json +9 -10
package/dist/vxil.js CHANGED
@@ -2849,6 +2849,9 @@ async function prompt(q, opts = {}) {
2849
2849
  res(a.trim());
2850
2850
  }));
2851
2851
  }
2852
+ function envLabelFor(base) {
2853
+ return /(^|\.)api\.vxil\.com$/.test(new URL(base).hostname) ? "production" : "staging";
2854
+ }
2852
2855
  function dashboardBase(edge) {
2853
2856
  return process.env.VXIL_DASHBOARD_URL ?? edge.replace(/^https?:\/\/api\./, (m) => m.replace("api.", "app."));
2854
2857
  }
@@ -2879,7 +2882,7 @@ function persistLink(slug, tenantId, apiKey, base) {
2879
2882
  const creds = loadCredentials();
2880
2883
  creds.keys = { ...creds.keys, [slug]: apiKey };
2881
2884
  saveCredentials(creds);
2882
- saveProject({ tenant_id: tenantId, slug, edge_url: base, env: flag("env") ?? "staging" });
2885
+ saveProject({ tenant_id: tenantId, slug, edge_url: base, env: flag("env") ?? envLabelFor(base) });
2883
2886
  }
2884
2887
  async function resolveDashCookie(dash) {
2885
2888
  const creds = loadCredentials();
@@ -3373,7 +3376,7 @@ try {
3373
3376
  const creds = loadCredentials();
3374
3377
  creds.keys = { ...creds.keys, [d.app_slug]: d.api_key };
3375
3378
  saveCredentials(creds);
3376
- saveProject({ tenant_id: d.tenant_id, slug: d.app_slug, edge_url: d.edge_url ?? base, env: flag("env") ?? "staging" });
3379
+ saveProject({ tenant_id: d.tenant_id, slug: d.app_slug, edge_url: d.edge_url ?? base, env: flag("env") ?? envLabelFor(base) });
3377
3380
  if (!existsSync3(resolve4(process.cwd(), "vxil.config.ts"))) initProject();
3378
3381
  console.log(`
3379
3382
  \u2713 tenant '${d.app_slug}' created \xB7 enabled: ${(d.enabled ?? []).join(", ")}`);
@@ -3437,7 +3440,7 @@ try {
3437
3440
  tenant_id: result.tenant_id,
3438
3441
  slug: result.slug,
3439
3442
  edge_url: base,
3440
- env: flag("env") ?? "staging",
3443
+ env: flag("env") ?? envLabelFor(base),
3441
3444
  ephemeral: true,
3442
3445
  ...result.expires_at ? { expires_at: result.expires_at } : {}
3443
3446
  });
@@ -3483,7 +3486,7 @@ try {
3483
3486
  const creds2 = loadCredentials();
3484
3487
  creds2.keys = { ...creds2.keys, [slug]: directKey };
3485
3488
  saveCredentials(creds2);
3486
- saveProject({ tenant_id: tenantId, slug, edge_url: base, env: flag("env") ?? "staging" });
3489
+ saveProject({ tenant_id: tenantId, slug, edge_url: base, env: flag("env") ?? envLabelFor(base) });
3487
3490
  console.log(`\u2713 linked '${slug}' (using provided --key)`);
3488
3491
  break;
3489
3492
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@vxil/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
- "description": "The vxil CLI (`npx vxil`) \u2014 config-as-code (`vxil/config`), typed-client generation, functions deploy, for the whole vxil backend.",
5
+ "description": "The vxil CLI (`npx vxil`) — config-as-code (`vxil/config`), typed-client generation, functions deploy, for the whole vxil backend.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://vxil.com",
8
8
  "keywords": [
@@ -29,11 +29,6 @@
29
29
  "engines": {
30
30
  "node": ">=22"
31
31
  },
32
- "scripts": {
33
- "build": "pnpm --filter @vxil/feature-configs run build && pnpm --filter @vxil/config run build && esbuild bin/vxil.ts --bundle --platform=node --format=esm --target=node22 --outfile=dist/vxil.js --banner:js='#!/usr/bin/env node' --external:esbuild --external:miniflare && esbuild src/config-entry.ts --bundle --platform=node --format=esm --target=node22 --outfile=dist/config.js && node scripts/build-config-dts.mjs",
34
- "postbuild": "chmod +x dist/vxil.js",
35
- "prepublishOnly": "pnpm run build"
36
- },
37
32
  "publishConfig": {
38
33
  "access": "public"
39
34
  },
@@ -50,8 +45,12 @@
50
45
  }
51
46
  },
52
47
  "devDependencies": {
53
- "@vxil/config": "workspace:*",
54
- "@vxil/runtime": "workspace:*",
55
- "miniflare": "^4.20260611.0"
48
+ "miniflare": "^4.20260611.0",
49
+ "@vxil/config": "0.1.2",
50
+ "@vxil/runtime": "0.0.1"
51
+ },
52
+ "scripts": {
53
+ "build": "pnpm --filter @vxil/feature-configs run build && pnpm --filter @vxil/config run build && esbuild bin/vxil.ts --bundle --platform=node --format=esm --target=node22 --outfile=dist/vxil.js --banner:js='#!/usr/bin/env node' --external:esbuild --external:miniflare && esbuild src/config-entry.ts --bundle --platform=node --format=esm --target=node22 --outfile=dist/config.js && node scripts/build-config-dts.mjs",
54
+ "postbuild": "chmod +x dist/vxil.js"
56
55
  }
57
56
  }