@lizard-build/cli 0.3.63 → 0.3.64

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.
@@ -1,6 +1,6 @@
1
1
  import open from "open";
2
2
  import { resolveProjectId } from "../lib/config.js";
3
- import { getBaseURL } from "../lib/api.js";
3
+ import { api, getBaseURL } from "../lib/api.js";
4
4
  import { success, isJSONMode, printJSON } from "../lib/format.js";
5
5
  export function registerOpen(program) {
6
6
  program
@@ -9,7 +9,15 @@ export function registerOpen(program) {
9
9
  .option("-p, --project <id>", "Project name, slug, or ID")
10
10
  .action(async (opts) => {
11
11
  const projectId = await resolveProjectId(opts.project);
12
- const url = `${getBaseURL()}/projects/${projectId}`;
12
+ // The dashboard routes projects as `/<workspaceSlug>/<projectSlug>` —
13
+ // there is no `/projects/<id>` route, so we must resolve both slugs.
14
+ // `/api/projects` is the only endpoint that returns workspaceSlug.
15
+ const projects = await api.get("/api/projects");
16
+ const project = projects.find((p) => p.id === projectId);
17
+ if (!project?.slug || !project.workspaceSlug) {
18
+ throw new Error("Could not resolve project URL (missing slug).");
19
+ }
20
+ const url = `${getBaseURL()}/${project.workspaceSlug}/${project.slug}`;
13
21
  // JSON / headless mode: report the URL instead of popping a browser
14
22
  if (isJSONMode()) {
15
23
  printJSON({ url, opened: false });
@@ -1 +1 @@
1
- {"version":3,"file":"open.js","sourceRoot":"","sources":["../../src/commands/open.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,yBAAyB,CAAC;SACtC,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AAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;YAC7C,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,GAAG,GAAG,GAAG,UAAU,EAAE,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACvE,oEAAoE;QACpE,IAAI,UAAU,EAAE,EAAE,CAAC;YACjB,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;YAClC,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare const CURRENT_VERSION = "0.3.63";
1
+ export declare const CURRENT_VERSION = "0.3.64";
2
2
  /**
3
3
  * True only when running as the Bun-compiled standalone binary. Under
4
4
  * npm/node, `process.execPath` is the *node* executable — self-update would
@@ -4,7 +4,7 @@ import { Readable } from "node:stream";
4
4
  import { join, dirname } from "node:path";
5
5
  import os from "node:os";
6
6
  import { spawn } from "node:child_process";
7
- export const CURRENT_VERSION = "0.3.63";
7
+ export const CURRENT_VERSION = "0.3.64";
8
8
  const RELEASES_API = "https://api.github.com/repos/lizard-build/lizard-cli/releases/latest";
9
9
  const RELEASE_BASE = "https://github.com/lizard-build/lizard-cli/releases/latest/download";
10
10
  /** Minimum gap between background update checks. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lizard-build/cli",
3
- "version": "0.3.63",
3
+ "version": "0.3.64",
4
4
  "description": "Lizard CLI — deploy and manage apps on Lizard",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  import { Command } from "commander";
2
2
  import open from "open";
3
3
  import { resolveProjectId } from "../lib/config.js";
4
- import { getBaseURL } from "../lib/api.js";
4
+ import { api, getBaseURL } from "../lib/api.js";
5
5
  import { success, isJSONMode, printJSON } from "../lib/format.js";
6
6
 
7
7
  export function registerOpen(program: Command) {
@@ -11,7 +11,17 @@ export function registerOpen(program: Command) {
11
11
  .option("-p, --project <id>", "Project name, slug, or ID")
12
12
  .action(async (opts) => {
13
13
  const projectId = await resolveProjectId(opts.project);
14
- const url = `${getBaseURL()}/projects/${projectId}`;
14
+ // The dashboard routes projects as `/<workspaceSlug>/<projectSlug>` —
15
+ // there is no `/projects/<id>` route, so we must resolve both slugs.
16
+ // `/api/projects` is the only endpoint that returns workspaceSlug.
17
+ const projects = await api.get<
18
+ Array<{ id: string; slug?: string; workspaceSlug?: string }>
19
+ >("/api/projects");
20
+ const project = projects.find((p) => p.id === projectId);
21
+ if (!project?.slug || !project.workspaceSlug) {
22
+ throw new Error("Could not resolve project URL (missing slug).");
23
+ }
24
+ const url = `${getBaseURL()}/${project.workspaceSlug}/${project.slug}`;
15
25
  // JSON / headless mode: report the URL instead of popping a browser
16
26
  if (isJSONMode()) {
17
27
  printJSON({ url, opened: false });
@@ -5,7 +5,7 @@ import { join, dirname } from "node:path";
5
5
  import os from "node:os";
6
6
  import { spawn } from "node:child_process";
7
7
 
8
- export const CURRENT_VERSION = "0.3.63";
8
+ export const CURRENT_VERSION = "0.3.64";
9
9
  const RELEASES_API = "https://api.github.com/repos/lizard-build/lizard-cli/releases/latest";
10
10
  const RELEASE_BASE = "https://github.com/lizard-build/lizard-cli/releases/latest/download";
11
11