@hype-stack/cli 0.2.4 → 0.3.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.
- package/dist/{cli-waqZgBpt.js → cli-BG-vvtIY.js} +1234 -1122
- package/dist/commands/compose.d.ts.map +1 -1
- package/dist/commands/template.d.ts.map +1 -1
- package/dist/config/bin.js +1 -1
- package/dist/index.js +1 -1
- package/dist/ui/pack-multiselect.d.ts +68 -0
- package/dist/ui/pack-multiselect.d.ts.map +1 -0
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/commands/compose.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,cAAc,EAEd,aAAa,EAEb,WAAW,EAEZ,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/commands/compose.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,cAAc,EAEd,aAAa,EAEb,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AAkB3B,wBAAsB,cAAc,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmMhF;AAmFD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAIhE;AAED,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,CAShE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,WAAW,CAYxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/commands/template.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/commands/template.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAIV,sBAAsB,EAEvB,MAAM,mBAAmB,CAAC;AAgB3B;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAwRzF"}
|
package/dist/config/bin.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./cli-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./cli-BG-vvtIY.js";
|
|
2
2
|
export { t as composeCommand, a as createCommand, o as createProgram, e as ensureInit, r as initCommand, i as loginCommand, n as logoutCommand };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Prompt } from '@clack/core';
|
|
2
|
+
import { Option, isCancel } from '@clack/prompts';
|
|
3
|
+
import { Key } from 'node:readline';
|
|
4
|
+
import { Readable, Writable } from 'node:stream';
|
|
5
|
+
export { isCancel };
|
|
6
|
+
export interface PackMultiSelectOption<Value> {
|
|
7
|
+
value: Value;
|
|
8
|
+
label: string;
|
|
9
|
+
hint?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface PackMultiSelectOptions<Value> {
|
|
13
|
+
message: string;
|
|
14
|
+
options: PackMultiSelectOption<Value>[];
|
|
15
|
+
initialValues?: Value[];
|
|
16
|
+
required?: boolean;
|
|
17
|
+
continueLabel?: string;
|
|
18
|
+
maxItems?: number;
|
|
19
|
+
input?: Readable;
|
|
20
|
+
output?: Writable;
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Multiselect prompt where Enter toggles the focused option and a trailing
|
|
25
|
+
* "Continue" row submits. Built on @clack/core's public Prompt base because the
|
|
26
|
+
* built-in @clack/prompts multiselect always submits on Enter with no rebind,
|
|
27
|
+
* and its toggle methods are private to its own subclass.
|
|
28
|
+
*
|
|
29
|
+
* Keys:
|
|
30
|
+
* Up/Down (or k/j): move the cursor through packs and the Continue row
|
|
31
|
+
* Enter or Space: toggle the focused pack (no-op on Continue)
|
|
32
|
+
* a: toggle every enabled pack
|
|
33
|
+
* Enter on Continue: submit the current selection
|
|
34
|
+
* Esc / Ctrl+C: cancel (resolves to clack's cancel symbol; check with isCancel)
|
|
35
|
+
*/
|
|
36
|
+
export declare class PackMultiSelectPrompt<Value> extends Prompt<Value[]> {
|
|
37
|
+
options: PackMultiSelectOption<Value>[];
|
|
38
|
+
cursor: number;
|
|
39
|
+
selected: Set<Value>;
|
|
40
|
+
required: boolean;
|
|
41
|
+
continueLabel: string;
|
|
42
|
+
maxItems?: number;
|
|
43
|
+
message: string;
|
|
44
|
+
constructor(opts: PackMultiSelectOptions<Value>);
|
|
45
|
+
/** Total selectable rows: one per pack plus the Continue row. */
|
|
46
|
+
private get rowCount();
|
|
47
|
+
/** True when the cursor sits on the trailing Continue row. */
|
|
48
|
+
get atContinue(): boolean;
|
|
49
|
+
protected _shouldSubmit(): boolean;
|
|
50
|
+
/** Move the cursor, wrapping across packs and the Continue row. */
|
|
51
|
+
move(dir: 1 | -1): void;
|
|
52
|
+
/** Toggle the focused pack if it is enabled; never toggles the Continue row. */
|
|
53
|
+
toggleCurrent(): void;
|
|
54
|
+
/** Select every enabled pack when any are unselected, otherwise clear all. */
|
|
55
|
+
toggleAll(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Key handler for non-navigation keys. Enter toggles the focused pack; on the
|
|
58
|
+
* Continue row it does nothing here so {@link _shouldSubmit} can submit. `a`
|
|
59
|
+
* toggles every pack.
|
|
60
|
+
*/
|
|
61
|
+
handleKey(char: string | undefined, info: Key): void;
|
|
62
|
+
/** Render the current frame. Mirrors @clack/prompts multiselect so the look matches. */
|
|
63
|
+
private renderFrame;
|
|
64
|
+
}
|
|
65
|
+
/** Functional entry point matching @clack/prompts' multiselect shape. */
|
|
66
|
+
export declare function packMultiSelect<Value>(opts: PackMultiSelectOptions<Value>): Promise<Value[] | symbol>;
|
|
67
|
+
export type { Option };
|
|
68
|
+
//# sourceMappingURL=pack-multiselect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-multiselect.d.ts","sourceRoot":"","sources":["../../src/ui/pack-multiselect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAsB,MAAM,aAAa,CAAC;AACzD,OAAO,EACL,KAAK,MAAM,EAOX,QAAQ,EAKT,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGtD,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,MAAM,WAAW,qBAAqB,CAAC,KAAK;IAC1C,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB,CAAC,KAAK;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC;IACxC,aAAa,CAAC,EAAE,KAAK,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAID;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAqB,CAAC,KAAK,CAAE,SAAQ,MAAM,CAAC,KAAK,EAAE,CAAC;IAC/D,OAAO,EAAE,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC;IACxC,MAAM,SAAK;IACX,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;gBAEJ,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC;IA+C/C,iEAAiE;IACjE,OAAO,KAAK,QAAQ,GAEnB;IAED,8DAA8D;IAC9D,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,SAAS,CAAC,aAAa,IAAI,OAAO;IAIlC,mEAAmE;IACnE,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI;IAKvB,gFAAgF;IAChF,aAAa,IAAI,IAAI;IASrB,8EAA8E;IAC9E,SAAS,IAAI,IAAI;IAOjB;;;;OAIG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI;IAQpD,wFAAwF;IACxF,OAAO,CAAC,WAAW;CAqEpB;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,CAErG;AAGD,YAAY,EAAE,MAAM,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hype-stack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@clack/core": "^1.3.0",
|
|
32
33
|
"@clack/prompts": "^1.2.0",
|
|
33
34
|
"@hyper-fetch/core": "^8.1.1",
|
|
34
35
|
"commander": "^13.0.0",
|