@kimchi-dev/kimchictl 0.0.7 → 0.0.9
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/api/templates.d.ts +46 -0
- package/dist/api/templates.d.ts.map +1 -0
- package/dist/api/templates.js +110 -0
- package/dist/api/templates.js.map +1 -0
- package/dist/api/workspaces.d.ts +2 -0
- package/dist/api/workspaces.d.ts.map +1 -1
- package/dist/api/workspaces.js +1 -0
- package/dist/api/workspaces.js.map +1 -1
- package/dist/commands/guard.d.ts.map +1 -1
- package/dist/commands/guard.js +3 -0
- package/dist/commands/guard.js.map +1 -1
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +2 -0
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/templates.d.ts +15 -0
- package/dist/commands/templates.d.ts.map +1 -0
- package/dist/commands/templates.js +174 -0
- package/dist/commands/templates.js.map +1 -0
- package/dist/commands/workspace.d.ts.map +1 -1
- package/dist/commands/workspace.js +4 -1
- package/dist/commands/workspace.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
- package/src/api/templates.ts +187 -0
- package/src/api/workspaces.ts +3 -0
- package/src/commands/guard.ts +3 -0
- package/src/commands/registry.ts +2 -0
- package/src/commands/templates.test.ts +126 -0
- package/src/commands/templates.ts +204 -0
- package/src/commands/workspace.test.ts +4 -4
- package/src/commands/workspace.ts +4 -1
- package/src/version.ts +1 -1
|
@@ -323,11 +323,11 @@ describe("kimchictl workspace list", () => {
|
|
|
323
323
|
expect(code).toBe(0)
|
|
324
324
|
// formatTable prints the whole table as one console call.
|
|
325
325
|
const table = lines[0]?.split("\n") ?? []
|
|
326
|
-
expect(table[0]).toMatch(/^NAME\s+STATUS\s+CLUSTER\s+AGE\s+CPU\s+RAM\s+PVC\s+URI$/)
|
|
326
|
+
expect(table[0]).toMatch(/^NAME\s+STATUS\s+CLUSTER\s+TEMPLATE\s+AGE\s+CPU\s+RAM\s+PVC\s+URI$/)
|
|
327
327
|
expect(table[1]).toMatch(
|
|
328
|
-
/^bright-oak-otter\s+active\s+krep-us\s+3h\s+2\s+4Gi\s+20Gi\s+bright-oak-otter\.remote\.kimchi\.dev$/,
|
|
328
|
+
/^bright-oak-otter\s+active\s+krep-us\s+-\s+3h\s+2\s+4Gi\s+20Gi\s+bright-oak-otter\.remote\.kimchi\.dev$/,
|
|
329
329
|
)
|
|
330
|
-
expect(table[2]).toMatch(/^demo\s+suspended\s+krep-us\s+2d\s+-\s+-\s+-\s+demo\.remote\.kimchi\.dev$/)
|
|
330
|
+
expect(table[2]).toMatch(/^demo\s+suspended\s+krep-us\s+-\s+2d\s+-\s+-\s+-\s+demo\.remote\.kimchi\.dev$/)
|
|
331
331
|
expect(table).toHaveLength(3)
|
|
332
332
|
})
|
|
333
333
|
|
|
@@ -338,7 +338,7 @@ describe("kimchictl workspace list", () => {
|
|
|
338
338
|
expect(JSON.parse(jsonRun.lines.join(""))).toEqual([])
|
|
339
339
|
|
|
340
340
|
const tableRun = await run(["list"], fetch)
|
|
341
|
-
expect(tableRun.lines).toEqual(["NAME STATUS CLUSTER AGE CPU RAM PVC URI"])
|
|
341
|
+
expect(tableRun.lines).toEqual(["NAME STATUS CLUSTER TEMPLATE AGE CPU RAM PVC URI"])
|
|
342
342
|
})
|
|
343
343
|
|
|
344
344
|
it("rejects an unsupported output flavor", async () => {
|
|
@@ -263,13 +263,14 @@ async function runList(args: string[], deps: WorkspaceDeps): Promise<number> {
|
|
|
263
263
|
w.alias,
|
|
264
264
|
w.status,
|
|
265
265
|
w.cluster,
|
|
266
|
+
w.templateName || "-",
|
|
266
267
|
formatAge(w.createdAt, now),
|
|
267
268
|
formatMillicores(w.cpuMillicores),
|
|
268
269
|
formatBytes(w.ramBytes),
|
|
269
270
|
formatBytes(w.pvcSizeBytes),
|
|
270
271
|
w.uri ?? "",
|
|
271
272
|
])
|
|
272
|
-
console.log(formatTable(["NAME", "STATUS", "CLUSTER", "AGE", "CPU", "RAM", "PVC", "URI"], rows))
|
|
273
|
+
console.log(formatTable(["NAME", "STATUS", "CLUSTER", "TEMPLATE", "AGE", "CPU", "RAM", "PVC", "URI"], rows))
|
|
273
274
|
return 0
|
|
274
275
|
}
|
|
275
276
|
|
|
@@ -371,6 +372,7 @@ function renderWorkspaceCard(
|
|
|
371
372
|
const meta = [
|
|
372
373
|
workspace.cluster ? `cluster ${workspace.cluster}` : "",
|
|
373
374
|
workspace.clientType,
|
|
375
|
+
workspace.templateName ? `from ${workspace.templateName}` : "",
|
|
374
376
|
`created ${formatAge(workspace.createdAt, now)} ago`,
|
|
375
377
|
].filter(Boolean)
|
|
376
378
|
if (meta.length > 0) lines.push(dim(` ${meta.join(" · ")}`, color))
|
|
@@ -404,6 +406,7 @@ function serializeWorkspace(w: Workspace): Record<string, unknown> {
|
|
|
404
406
|
status: w.status,
|
|
405
407
|
...(w.cluster ? { cluster: w.cluster } : {}),
|
|
406
408
|
...(w.clientType ? { clientType: w.clientType } : {}),
|
|
409
|
+
...(w.templateName ? { templateName: w.templateName } : {}),
|
|
407
410
|
...(w.uri ? { uri: w.uri } : {}),
|
|
408
411
|
createdAt: w.createdAt.getTime() > 0 ? w.createdAt.toISOString() : undefined,
|
|
409
412
|
resources: {
|
package/src/version.ts
CHANGED