@lizard-build/cli 0.1.0 → 0.3.29
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/.github/workflows/release.yml +90 -0
- package/README.md +41 -0
- package/dist/commands/add.js +318 -45
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +68 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/docs.d.ts +2 -0
- package/dist/commands/docs.js +13 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/domain.d.ts +9 -0
- package/dist/commands/domain.js +195 -0
- package/dist/commands/domain.js.map +1 -0
- package/dist/commands/git.js +175 -36
- package/dist/commands/git.js.map +1 -1
- package/dist/commands/init.d.ts +24 -0
- package/dist/commands/init.js +128 -86
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/link.d.ts +7 -0
- package/dist/commands/link.js +104 -33
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/login.js +4 -3
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logs.js +223 -30
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/open.js +3 -2
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/port.d.ts +7 -0
- package/dist/commands/port.js +49 -0
- package/dist/commands/port.js.map +1 -0
- package/dist/commands/projects.js +36 -6
- package/dist/commands/projects.js.map +1 -1
- package/dist/commands/ps.js +32 -39
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/redeploy.js +48 -8
- package/dist/commands/redeploy.js.map +1 -1
- package/dist/commands/regions.js +2 -5
- package/dist/commands/regions.js.map +1 -1
- package/dist/commands/restart.js +84 -10
- package/dist/commands/restart.js.map +1 -1
- package/dist/commands/run.d.ts +9 -0
- package/dist/commands/run.js +61 -22
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/scale.d.ts +10 -0
- package/dist/commands/scale.js +166 -0
- package/dist/commands/scale.js.map +1 -0
- package/dist/commands/secrets.js +200 -89
- package/dist/commands/secrets.js.map +1 -1
- package/dist/commands/service-set.d.ts +49 -0
- package/dist/commands/service-set.js +552 -0
- package/dist/commands/service-set.js.map +1 -0
- package/dist/commands/service-show.d.ts +11 -0
- package/dist/commands/service-show.js +44 -0
- package/dist/commands/service-show.js.map +1 -0
- package/dist/commands/service.d.ts +8 -0
- package/dist/commands/service.js +262 -0
- package/dist/commands/service.js.map +1 -0
- package/dist/commands/ssh.d.ts +2 -0
- package/dist/commands/ssh.js +161 -0
- package/dist/commands/ssh.js.map +1 -0
- package/dist/commands/status.d.ts +7 -0
- package/dist/commands/status.js +49 -38
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/unlink.d.ts +5 -0
- package/dist/commands/unlink.js +18 -0
- package/dist/commands/unlink.js.map +1 -0
- package/dist/commands/up.d.ts +9 -0
- package/dist/commands/up.js +417 -0
- package/dist/commands/up.js.map +1 -0
- package/dist/commands/upgrade.d.ts +2 -0
- package/dist/commands/upgrade.js +79 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/whoami.js +26 -6
- package/dist/commands/whoami.js.map +1 -1
- package/dist/commands/workspace.d.ts +8 -0
- package/dist/commands/workspace.js +36 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/index.js +204 -82
- package/dist/index.js.map +1 -1
- package/dist/lib/api.d.ts +17 -2
- package/dist/lib/api.js +85 -51
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/auth.d.ts +3 -11
- package/dist/lib/auth.js +16 -36
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/config.d.ts +36 -15
- package/dist/lib/config.js +71 -58
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/format.d.ts +1 -0
- package/dist/lib/format.js +17 -4
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/name.d.ts +11 -0
- package/dist/lib/name.js +26 -0
- package/dist/lib/name.js.map +1 -0
- package/dist/lib/picker.d.ts +32 -0
- package/dist/lib/picker.js +91 -0
- package/dist/lib/picker.js.map +1 -0
- package/dist/lib/resolve.d.ts +85 -0
- package/dist/lib/resolve.js +203 -0
- package/dist/lib/resolve.js.map +1 -0
- package/dist/lib/updater.d.ts +16 -0
- package/dist/lib/updater.js +102 -0
- package/dist/lib/updater.js.map +1 -0
- package/lizard-wrapper.sh +2 -0
- package/package.json +11 -3
- package/src/commands/add.ts +388 -56
- package/src/commands/config.ts +80 -0
- package/src/commands/docs.ts +15 -0
- package/src/commands/domain.ts +248 -0
- package/src/commands/git.ts +201 -40
- package/src/commands/init.ts +149 -100
- package/src/commands/link.ts +127 -35
- package/src/commands/login.ts +4 -3
- package/src/commands/logs.ts +283 -27
- package/src/commands/open.ts +3 -2
- package/src/commands/port.ts +57 -0
- package/src/commands/projects.ts +43 -6
- package/src/commands/ps.ts +39 -60
- package/src/commands/redeploy.ts +51 -10
- package/src/commands/regions.ts +2 -6
- package/src/commands/restart.ts +84 -10
- package/src/commands/run.ts +68 -24
- package/src/commands/scale.ts +216 -0
- package/src/commands/secrets.ts +277 -100
- package/src/commands/service-set.ts +669 -0
- package/src/commands/service-show.ts +52 -0
- package/src/commands/service.ts +298 -0
- package/src/commands/ssh.ts +176 -0
- package/src/commands/status.ts +51 -46
- package/src/commands/unlink.ts +17 -0
- package/src/commands/up.ts +461 -0
- package/src/commands/upgrade.ts +87 -0
- package/src/commands/whoami.ts +34 -6
- package/src/commands/workspace.ts +44 -0
- package/src/index.ts +214 -85
- package/src/lib/api.ts +114 -51
- package/src/lib/auth.ts +22 -46
- package/src/lib/config.ts +100 -65
- package/src/lib/format.ts +18 -4
- package/src/lib/name.ts +27 -0
- package/src/lib/picker.ts +133 -0
- package/src/lib/resolve.ts +285 -0
- package/src/lib/updater.ts +106 -0
- package/test/cli.test.ts +491 -0
- package/test/fixtures/hello-app/Dockerfile +5 -0
- package/test/fixtures/hello-app/index.js +5 -0
- package/test/unit/api.test.ts +66 -0
- package/test/unit/config.test.ts +94 -0
- package/test/unit/init.test.ts +211 -0
- package/test/unit/json.test.ts +208 -0
- package/test/unit/picker.test.ts +161 -0
- package/test/unit/resolve.test.ts +124 -0
- package/test/unit/service-set.test.ts +355 -0
- package/vitest.config.ts +10 -0
- package/dist/commands/connect.d.ts +0 -2
- package/dist/commands/connect.js +0 -117
- package/dist/commands/connect.js.map +0 -1
- package/dist/commands/context.d.ts +0 -2
- package/dist/commands/context.js +0 -71
- package/dist/commands/context.js.map +0 -1
- package/dist/commands/deploy.d.ts +0 -2
- package/dist/commands/deploy.js +0 -120
- package/dist/commands/deploy.js.map +0 -1
- package/dist/commands/destroy.d.ts +0 -2
- package/dist/commands/destroy.js +0 -51
- package/dist/commands/destroy.js.map +0 -1
- package/dist/commands/update.d.ts +0 -2
- package/dist/commands/update.js +0 -41
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/version.d.ts +0 -2
- package/dist/commands/version.js +0 -37
- package/dist/commands/version.js.map +0 -1
- package/src/commands/connect.ts +0 -145
- package/src/commands/context.ts +0 -93
- package/src/commands/deploy.ts +0 -153
- package/src/commands/destroy.ts +0 -51
- package/src/commands/update.ts +0 -44
- package/src/commands/version.ts +0 -37
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type ResourceScope } from "./api.js";
|
|
2
|
+
/**
|
|
3
|
+
* Build a ResourceScope for an arbitrary project. When the project matches the
|
|
4
|
+
* cwd link, reuse its workspaceId (no extra round-trip). Otherwise fetch the
|
|
5
|
+
* project's workspace once so cross-project commands (`-p other-project`) still
|
|
6
|
+
* get `?workspaceId=…` on the request — without it the backend can 404 a
|
|
7
|
+
* project the user reaches via workspace membership.
|
|
8
|
+
*/
|
|
9
|
+
export declare function scopeForProject(projectId: string): Promise<ResourceScope>;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a service (app or addon) within a project. Match by ID or name.
|
|
12
|
+
* Throws with a helpful list of available services when not found.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveService(projectId: string, nameOrId: string): Promise<{
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
kind: "app" | "addon";
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Pick the active service for a command:
|
|
21
|
+
* 1. --service flag (resolve by name/id)
|
|
22
|
+
* 2. linked service in cwd
|
|
23
|
+
* 3. throw with hint to pass --service
|
|
24
|
+
*/
|
|
25
|
+
export declare function getActiveService(serviceFlag: string | undefined, projectId: string): Promise<{
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Same as `getActiveService`, but also returns whether the target is an app
|
|
31
|
+
* or an addon. Costs one extra `/services` lookup when the service is taken
|
|
32
|
+
* from the cwd link (which otherwise resolves locally), so use this only when
|
|
33
|
+
* the caller branches on kind (e.g. `lizard scale`).
|
|
34
|
+
*/
|
|
35
|
+
export declare function getActiveServiceWithKind(serviceFlag: string | undefined, projectId: string): Promise<{
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
kind: "app" | "addon";
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Look up the workspace id for a project. Used to lazy-fill legacy links
|
|
42
|
+
* that were saved before workspaces existed. Returns null if the project
|
|
43
|
+
* isn't accessible to the current user.
|
|
44
|
+
*/
|
|
45
|
+
export declare function lookupProjectWorkspace(projectId: string): Promise<{
|
|
46
|
+
workspaceId?: string | null;
|
|
47
|
+
workspaceName?: string | null;
|
|
48
|
+
} | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Resolve a project flag → `{ projectId, scope }`. Scope carries
|
|
51
|
+
* workspaceId for `withScope(url, scope)` queries.
|
|
52
|
+
*
|
|
53
|
+
* For the linked project, lazy-fills missing workspaceId into the cwd link.
|
|
54
|
+
* For a different project (`-p other-project`), fetches the target's
|
|
55
|
+
* workspace so the scope reflects the target — not whatever the cwd link
|
|
56
|
+
* happened to be pointing at.
|
|
57
|
+
*/
|
|
58
|
+
export declare function resolveProjectScope(projectFlag?: string): Promise<{
|
|
59
|
+
projectId: string;
|
|
60
|
+
scope: ResourceScope;
|
|
61
|
+
}>;
|
|
62
|
+
export interface ResolvedContext {
|
|
63
|
+
projectId: string;
|
|
64
|
+
workspaceId?: string;
|
|
65
|
+
workspaceName?: string;
|
|
66
|
+
service?: {
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Build the scope object for `withScope(url, scope)` API calls. */
|
|
72
|
+
export declare function getScope(ctx: ResolvedContext): ResourceScope;
|
|
73
|
+
/**
|
|
74
|
+
* Convenience: resolve project + active service in one go.
|
|
75
|
+
*
|
|
76
|
+
* Lazily backfills `workspaceId` into the cwd link when missing (legacy
|
|
77
|
+
* configs written before workspaces existed). Once filled, subsequent
|
|
78
|
+
* commands get the scope param for free.
|
|
79
|
+
*/
|
|
80
|
+
export declare function resolveContext(opts: {
|
|
81
|
+
projectFlag?: string;
|
|
82
|
+
serviceFlag?: string;
|
|
83
|
+
workspaceFlag?: string;
|
|
84
|
+
requireService?: boolean;
|
|
85
|
+
}): Promise<ResolvedContext>;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { api, withScope } from "./api.js";
|
|
2
|
+
import { getProjectLink, resolveProjectId, updateProjectLink, } from "./config.js";
|
|
3
|
+
/**
|
|
4
|
+
* Build a ResourceScope for an arbitrary project. When the project matches the
|
|
5
|
+
* cwd link, reuse its workspaceId (no extra round-trip). Otherwise fetch the
|
|
6
|
+
* project's workspace once so cross-project commands (`-p other-project`) still
|
|
7
|
+
* get `?workspaceId=…` on the request — without it the backend can 404 a
|
|
8
|
+
* project the user reaches via workspace membership.
|
|
9
|
+
*/
|
|
10
|
+
export async function scopeForProject(projectId) {
|
|
11
|
+
const link = getProjectLink();
|
|
12
|
+
if (link?.projectId === projectId && link.workspaceId) {
|
|
13
|
+
return { workspaceId: link.workspaceId };
|
|
14
|
+
}
|
|
15
|
+
const fetched = await lookupProjectWorkspace(projectId);
|
|
16
|
+
return { workspaceId: fetched?.workspaceId ?? null };
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolve a service (app or addon) within a project. Match by ID or name.
|
|
20
|
+
* Throws with a helpful list of available services when not found.
|
|
21
|
+
*/
|
|
22
|
+
export async function resolveService(projectId, nameOrId) {
|
|
23
|
+
const data = await api.get(withScope(`/api/projects/${projectId}/services`, await scopeForProject(projectId)));
|
|
24
|
+
const apps = data.apps || [];
|
|
25
|
+
const addons = data.addons || [];
|
|
26
|
+
const lower = nameOrId.toLowerCase();
|
|
27
|
+
const app = apps.find((a) => a.id.toLowerCase() === lower || a.name?.toLowerCase() === lower);
|
|
28
|
+
if (app)
|
|
29
|
+
return { id: app.id, name: app.name, kind: "app" };
|
|
30
|
+
const addon = addons.find((a) => a.id.toLowerCase() === lower ||
|
|
31
|
+
a.name?.toLowerCase() === lower ||
|
|
32
|
+
a.addonType?.toLowerCase() === lower);
|
|
33
|
+
if (addon) {
|
|
34
|
+
return { id: addon.id, name: addon.name || addon.addonType || "", kind: "addon" };
|
|
35
|
+
}
|
|
36
|
+
const available = [
|
|
37
|
+
...apps.map((a) => a.name),
|
|
38
|
+
...addons.map((a) => a.name || a.addonType),
|
|
39
|
+
].filter(Boolean);
|
|
40
|
+
throw new Error(`Service "${nameOrId}" not found in project. ` +
|
|
41
|
+
(available.length ? `Available: ${available.join(", ")}` : "No services exist."));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Pick the active service for a command:
|
|
45
|
+
* 1. --service flag (resolve by name/id)
|
|
46
|
+
* 2. linked service in cwd
|
|
47
|
+
* 3. throw with hint to pass --service
|
|
48
|
+
*/
|
|
49
|
+
export async function getActiveService(serviceFlag, projectId) {
|
|
50
|
+
if (serviceFlag) {
|
|
51
|
+
const resolved = await resolveService(projectId, serviceFlag);
|
|
52
|
+
return { id: resolved.id, name: resolved.name };
|
|
53
|
+
}
|
|
54
|
+
const link = getProjectLink();
|
|
55
|
+
if (link?.serviceId) {
|
|
56
|
+
return {
|
|
57
|
+
id: link.serviceId,
|
|
58
|
+
name: link.serviceName || link.serviceId,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
throw new Error("No service specified. Pass --service <name> or run `lizard service link <name>`.");
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Same as `getActiveService`, but also returns whether the target is an app
|
|
65
|
+
* or an addon. Costs one extra `/services` lookup when the service is taken
|
|
66
|
+
* from the cwd link (which otherwise resolves locally), so use this only when
|
|
67
|
+
* the caller branches on kind (e.g. `lizard scale`).
|
|
68
|
+
*/
|
|
69
|
+
export async function getActiveServiceWithKind(serviceFlag, projectId) {
|
|
70
|
+
if (serviceFlag) {
|
|
71
|
+
return resolveService(projectId, serviceFlag);
|
|
72
|
+
}
|
|
73
|
+
const link = getProjectLink();
|
|
74
|
+
if (link?.serviceId) {
|
|
75
|
+
const data = await api.get(withScope(`/api/projects/${projectId}/services`, await scopeForProject(projectId)));
|
|
76
|
+
const app = data.apps?.find((a) => a.id === link.serviceId);
|
|
77
|
+
if (app)
|
|
78
|
+
return { id: app.id, name: app.name, kind: "app" };
|
|
79
|
+
const addon = data.addons?.find((a) => a.id === link.serviceId);
|
|
80
|
+
if (addon) {
|
|
81
|
+
return {
|
|
82
|
+
id: addon.id,
|
|
83
|
+
name: addon.name || addon.addonType || link.serviceName || link.serviceId,
|
|
84
|
+
kind: "addon",
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
throw new Error(`Linked service "${link.serviceName || link.serviceId}" no longer exists in this project.`);
|
|
88
|
+
}
|
|
89
|
+
throw new Error("No service specified. Pass --service <name> or run `lizard service link <name>`.");
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Look up the workspace id for a project. Used to lazy-fill legacy links
|
|
93
|
+
* that were saved before workspaces existed. Returns null if the project
|
|
94
|
+
* isn't accessible to the current user.
|
|
95
|
+
*/
|
|
96
|
+
export async function lookupProjectWorkspace(projectId) {
|
|
97
|
+
try {
|
|
98
|
+
const proj = await api.get(`/api/projects/${projectId}`);
|
|
99
|
+
return {
|
|
100
|
+
workspaceId: proj.workspaceId ?? null,
|
|
101
|
+
workspaceName: proj.workspaceName ?? null,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Resolve a project flag → `{ projectId, scope }`. Scope carries
|
|
110
|
+
* workspaceId for `withScope(url, scope)` queries.
|
|
111
|
+
*
|
|
112
|
+
* For the linked project, lazy-fills missing workspaceId into the cwd link.
|
|
113
|
+
* For a different project (`-p other-project`), fetches the target's
|
|
114
|
+
* workspace so the scope reflects the target — not whatever the cwd link
|
|
115
|
+
* happened to be pointing at.
|
|
116
|
+
*/
|
|
117
|
+
export async function resolveProjectScope(projectFlag) {
|
|
118
|
+
const projectId = await resolveProjectId(projectFlag);
|
|
119
|
+
const link = getProjectLink();
|
|
120
|
+
// Same project as the cwd link — reuse cached workspaceId, lazy-fill if missing.
|
|
121
|
+
if (link?.projectId === projectId) {
|
|
122
|
+
let workspaceId = link.workspaceId ?? null;
|
|
123
|
+
let workspaceName = link.workspaceName;
|
|
124
|
+
if (!workspaceId) {
|
|
125
|
+
const fetched = await lookupProjectWorkspace(projectId);
|
|
126
|
+
if (fetched?.workspaceId) {
|
|
127
|
+
workspaceId = fetched.workspaceId;
|
|
128
|
+
workspaceName = fetched.workspaceName ?? undefined;
|
|
129
|
+
try {
|
|
130
|
+
updateProjectLink({ workspaceId, workspaceName });
|
|
131
|
+
}
|
|
132
|
+
catch { }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return { projectId, scope: { workspaceId: workspaceId ?? null } };
|
|
136
|
+
}
|
|
137
|
+
// Different project — never reuse the link's workspaceId. Look up the
|
|
138
|
+
// target project's workspace directly. Mirrors `scopeForProject`.
|
|
139
|
+
const scope = await scopeForProject(projectId);
|
|
140
|
+
return { projectId, scope };
|
|
141
|
+
}
|
|
142
|
+
/** Build the scope object for `withScope(url, scope)` API calls. */
|
|
143
|
+
export function getScope(ctx) {
|
|
144
|
+
return {
|
|
145
|
+
workspaceId: ctx.workspaceId ?? null,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Convenience: resolve project + active service in one go.
|
|
150
|
+
*
|
|
151
|
+
* Lazily backfills `workspaceId` into the cwd link when missing (legacy
|
|
152
|
+
* configs written before workspaces existed). Once filled, subsequent
|
|
153
|
+
* commands get the scope param for free.
|
|
154
|
+
*/
|
|
155
|
+
export async function resolveContext(opts) {
|
|
156
|
+
const projectId = await resolveProjectId(opts.projectFlag);
|
|
157
|
+
let service;
|
|
158
|
+
const link = getProjectLink();
|
|
159
|
+
if (opts.serviceFlag || opts.requireService) {
|
|
160
|
+
service = await getActiveService(opts.serviceFlag, projectId);
|
|
161
|
+
}
|
|
162
|
+
else if (link?.serviceId) {
|
|
163
|
+
service = {
|
|
164
|
+
id: link.serviceId,
|
|
165
|
+
name: link.serviceName || link.serviceId,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
// Workspace resolution: only reuse the link's workspaceId when it
|
|
169
|
+
// describes the same project. For cross-project commands we fetch the
|
|
170
|
+
// target project's workspace so the scope is correct — using the link's
|
|
171
|
+
// ws here would scope into the wrong workspace.
|
|
172
|
+
let workspaceId;
|
|
173
|
+
let workspaceName;
|
|
174
|
+
if (link?.projectId === projectId) {
|
|
175
|
+
workspaceId = link.workspaceId;
|
|
176
|
+
workspaceName = link.workspaceName;
|
|
177
|
+
if (!workspaceId) {
|
|
178
|
+
const fetched = await lookupProjectWorkspace(projectId);
|
|
179
|
+
if (fetched?.workspaceId) {
|
|
180
|
+
workspaceId = fetched.workspaceId;
|
|
181
|
+
workspaceName = fetched.workspaceName ?? undefined;
|
|
182
|
+
try {
|
|
183
|
+
updateProjectLink({ workspaceId, workspaceName });
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
// Non-fatal: link may not exist for this cwd (e.g. --project flag).
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
const fetched = await lookupProjectWorkspace(projectId);
|
|
193
|
+
workspaceId = fetched?.workspaceId ?? undefined;
|
|
194
|
+
workspaceName = fetched?.workspaceName ?? undefined;
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
projectId,
|
|
198
|
+
workspaceId,
|
|
199
|
+
workspaceName,
|
|
200
|
+
service,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/lib/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAsB,MAAM,UAAU,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,SAAiB;IACrD,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,IAAI,IAAI,EAAE,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QACtD,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;IAC3C,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC,SAAS,CAAC,CAAC;IACxD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,CAAC;AACvD,CAAC;AAoBD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,SAAiB,EACjB,QAAgB;IAEhB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CACxB,SAAS,CAAC,iBAAiB,SAAS,WAAW,EAAE,MAAM,eAAe,CAAC,SAAS,CAAC,CAAC,CACnF,CAA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AAO;QACL,SAAS;QACT,WAAW;QACX,aAAa;QACb,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const CURRENT_VERSION = "0.3.29";
|
|
2
|
+
export type LatestVersionResult = {
|
|
3
|
+
kind: "ok";
|
|
4
|
+
version: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "rate-limited";
|
|
7
|
+
resetAt: number;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "error";
|
|
10
|
+
};
|
|
11
|
+
export declare function getLatestVersion(): Promise<LatestVersionResult>;
|
|
12
|
+
export declare function selfUpdate(onProgress?: (msg: string) => void): Promise<boolean>;
|
|
13
|
+
/** Check for a newer version and auto-install it in the background.
|
|
14
|
+
* Prints a one-line notice on exit — either "Updated to vX.Y.Z" or nothing on failure.
|
|
15
|
+
* Never blocks or crashes the current command. */
|
|
16
|
+
export declare function checkForUpdateInBackground(): void;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { createWriteStream, existsSync, renameSync, chmodSync } from "node:fs";
|
|
2
|
+
import { pipeline } from "node:stream/promises";
|
|
3
|
+
import { Readable } from "node:stream";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
export const CURRENT_VERSION = "0.3.29";
|
|
7
|
+
const RELEASES_API = "https://api.github.com/repos/lizard-build/lizard-cli/releases/latest";
|
|
8
|
+
const RELEASE_BASE = "https://github.com/lizard-build/lizard-cli/releases/latest/download";
|
|
9
|
+
function getBinaryName() {
|
|
10
|
+
const os = process.platform;
|
|
11
|
+
const arch = process.arch;
|
|
12
|
+
if (os === "darwin" && arch === "arm64")
|
|
13
|
+
return "lizard-darwin-arm64";
|
|
14
|
+
if (os === "darwin" && arch === "x64")
|
|
15
|
+
return "lizard-darwin-x64";
|
|
16
|
+
if (os === "linux" && arch === "x64")
|
|
17
|
+
return "lizard-linux-x64";
|
|
18
|
+
if (os === "linux" && arch === "arm64")
|
|
19
|
+
return "lizard-linux-arm64";
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
export async function getLatestVersion() {
|
|
23
|
+
try {
|
|
24
|
+
const res = await fetch(RELEASES_API, {
|
|
25
|
+
headers: { "User-Agent": "lizard-cli" },
|
|
26
|
+
signal: AbortSignal.timeout(5000),
|
|
27
|
+
});
|
|
28
|
+
if (res.status === 403 && res.headers.get("x-ratelimit-remaining") === "0") {
|
|
29
|
+
const reset = Number(res.headers.get("x-ratelimit-reset"));
|
|
30
|
+
return { kind: "rate-limited", resetAt: Number.isFinite(reset) ? reset : 0 };
|
|
31
|
+
}
|
|
32
|
+
if (!res.ok)
|
|
33
|
+
return { kind: "error" };
|
|
34
|
+
const data = (await res.json());
|
|
35
|
+
const version = data.tag_name?.replace(/^v/, "");
|
|
36
|
+
return version ? { kind: "ok", version } : { kind: "error" };
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return { kind: "error" };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export async function selfUpdate(onProgress) {
|
|
43
|
+
const binaryName = getBinaryName();
|
|
44
|
+
if (!binaryName)
|
|
45
|
+
return false;
|
|
46
|
+
// Find current executable path
|
|
47
|
+
const currentBin = process.execPath;
|
|
48
|
+
if (!existsSync(currentBin))
|
|
49
|
+
return false;
|
|
50
|
+
const url = `${RELEASE_BASE}/${binaryName}`;
|
|
51
|
+
const tmp = join(tmpdir(), `lizard-update-${Date.now()}`);
|
|
52
|
+
onProgress?.(`Downloading ${binaryName}...`);
|
|
53
|
+
const res = await fetch(url, { signal: AbortSignal.timeout(60000) });
|
|
54
|
+
if (!res.ok)
|
|
55
|
+
throw new Error(`Download failed: ${res.status}`);
|
|
56
|
+
const writer = createWriteStream(tmp);
|
|
57
|
+
await pipeline(Readable.fromWeb(res.body), writer);
|
|
58
|
+
chmodSync(tmp, 0o755);
|
|
59
|
+
onProgress?.("Installing...");
|
|
60
|
+
renameSync(tmp, currentBin);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
/** Check for a newer version and auto-install it in the background.
|
|
64
|
+
* Prints a one-line notice on exit — either "Updated to vX.Y.Z" or nothing on failure.
|
|
65
|
+
* Never blocks or crashes the current command. */
|
|
66
|
+
export function checkForUpdateInBackground() {
|
|
67
|
+
// Only auto-update in TTY; skip CI / piped output
|
|
68
|
+
if (!process.stdout.isTTY)
|
|
69
|
+
return;
|
|
70
|
+
let updateMessage = null;
|
|
71
|
+
const promise = getLatestVersion().then(async (r) => {
|
|
72
|
+
if (r.kind !== "ok")
|
|
73
|
+
return;
|
|
74
|
+
const latest = r.version;
|
|
75
|
+
if (latest === CURRENT_VERSION)
|
|
76
|
+
return;
|
|
77
|
+
const [maj, min, pat] = latest.split(".").map(Number);
|
|
78
|
+
const [cmaj, cmin, cpat] = CURRENT_VERSION.split(".").map(Number);
|
|
79
|
+
const isNewer = maj > cmaj || (maj === cmaj && min > cmin) || (maj === cmaj && min === cmin && pat > cpat);
|
|
80
|
+
if (!isNewer)
|
|
81
|
+
return;
|
|
82
|
+
try {
|
|
83
|
+
const ok = await selfUpdate();
|
|
84
|
+
if (ok) {
|
|
85
|
+
updateMessage =
|
|
86
|
+
`\n Updating lizard v${CURRENT_VERSION} → v${latest}...\n` +
|
|
87
|
+
` lizard updated to v${latest}\n`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// silent — don't interrupt the current command
|
|
92
|
+
}
|
|
93
|
+
}).catch(() => { });
|
|
94
|
+
process.on("exit", () => {
|
|
95
|
+
if (updateMessage)
|
|
96
|
+
process.stderr.write(updateMessage);
|
|
97
|
+
});
|
|
98
|
+
// Don't block process exit
|
|
99
|
+
if (typeof promise.unref === "function")
|
|
100
|
+
promise.unref();
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=updater.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updater.js","sourceRoot":"","sources":["../../src/lib/updater.ts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AG,CAAC,MAAM,CAAC,CAAC;QAClE,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC;QAC3G,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,MAAM,UAAU,EAAE,CAAC;YAC9B,IAAI,EAAE,EAAE,CAAC;gBACP,aAAa;oBACX,wBAAwB,eAAe,OAAO,MAAM,OAAO;wBAC3D,wBAAwB,MAAM,IAAI,CAAC;YACvC,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,+CAA+C;QACjD,CAAC;IACH,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAEnB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;QACtB,IAAI,aAAa;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,2BAA2B;IAC3B,IAAI,OAAQ,OAAe,CAAC,KAAK,KAAK,UAAU;QAAG,OAAe,CAAC,KAAK,EAAE,CAAC;AAC7E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lizard-build/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.29",
|
|
4
4
|
"description": "Lizard CLI — deploy and manage apps on Lizard",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"dev": "tsx src/index.ts",
|
|
11
11
|
"build": "tsc",
|
|
12
|
-
"start": "node dist/index.js"
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"test": "vitest run test/cli.test.ts",
|
|
14
|
+
"test:unit": "vitest run test/unit"
|
|
13
15
|
},
|
|
14
16
|
"keywords": [
|
|
15
17
|
"cli",
|
|
@@ -17,6 +19,10 @@
|
|
|
17
19
|
"paas",
|
|
18
20
|
"lizard"
|
|
19
21
|
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/lizard-build/lizard-cli.git"
|
|
25
|
+
},
|
|
20
26
|
"author": "Lizard Build",
|
|
21
27
|
"license": "MIT",
|
|
22
28
|
"dependencies": {
|
|
@@ -29,7 +35,9 @@
|
|
|
29
35
|
},
|
|
30
36
|
"devDependencies": {
|
|
31
37
|
"@types/node": "^25.6.0",
|
|
38
|
+
"execa": "^9.6.1",
|
|
32
39
|
"tsx": "^4.21.0",
|
|
33
|
-
"typescript": "^6.0.3"
|
|
40
|
+
"typescript": "^6.0.3",
|
|
41
|
+
"vitest": "^4.1.5"
|
|
34
42
|
}
|
|
35
43
|
}
|