@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.
- package/dist/commands/open.js +10 -2
- package/dist/commands/open.js.map +1 -1
- package/dist/lib/updater.d.ts +1 -1
- package/dist/lib/updater.js +1 -1
- package/package.json +1 -1
- package/src/commands/open.ts +12 -2
- package/src/lib/updater.ts +1 -1
package/dist/commands/open.js
CHANGED
|
@@ -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
|
-
|
|
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":"A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E,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"}
|
package/dist/lib/updater.d.ts
CHANGED
package/dist/lib/updater.js
CHANGED
|
@@ -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.
|
|
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
package/src/commands/open.ts
CHANGED
|
@@ -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
|
-
|
|
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 });
|
package/src/lib/updater.ts
CHANGED
|
@@ -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.
|
|
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
|
|