@sorrell/cli-utilities 1.0.14 → 1.0.15

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.
@@ -0,0 +1,8 @@
1
+ import type { PromptConfig } from "@sorrell/inquirer-file-selector";
2
+ export type FFileSelectorConfigFull = PromptConfig & {
3
+ allowCancel?: false;
4
+ multiple?: false;
5
+ };
6
+ export type FFileSelectorConfigBase = Omit<FFileSelectorConfigFull, "message" | "allowCancel">;
7
+ export type FFileSelectorConfig = Pick<FFileSelectorConfigFull, "filter" | "message" | "type"> & Partial<Pick<FFileSelectorConfigFull, "allowCancel" | "basePath">>;
8
+ //# sourceMappingURL=FileSelector.Types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileSelector.Types.d.ts","sourceRoot":"","sources":["../Source/FileSelector.Types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,MAAM,MAAM,uBAAuB,GAC/B,YAAY,GACZ;IACI,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC;CACpB,CAAC;AAEN,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,uBAAuB,EAAG,SAAS,GAAG,aAAa,CAAC,CAAC;AAEhG,MAAM,MAAM,mBAAmB,GAC3B,IAAI,CAAC,uBAAuB,EACtB,QAAQ,GACR,SAAS,GACT,MAAM,CACX,GACD,OAAO,CAAC,IAAI,CACR,uBAAuB,EACrB,aAAa,GACb,UAAU,CACf,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /* File: FileSelector.Types.ts
2
+ * Author: Gage Sorrell <gage@sorrell.sh>
3
+ * Copyright: (c) 2026 Gage Sorrell
4
+ * License: MIT
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=FileSelector.Types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileSelector.Types.js","sourceRoot":"","sources":["../Source/FileSelector.Types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -1,2 +1,4 @@
1
- export * from "@sorrell/inquirer-file-selector";
1
+ import type { FFileSelectorConfig } from "./index.js";
2
+ import { type Item } from "@sorrell/inquirer-file-selector";
3
+ export declare function FileSelector(Config: FFileSelectorConfig): Promise<Item>;
2
4
  //# sourceMappingURL=FileSelector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileSelector.d.ts","sourceRoot":"","sources":["../Source/FileSelector.ts"],"names":[],"mappings":"AAMA,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"FileSelector.d.ts","sourceRoot":"","sources":["../Source/FileSelector.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,mBAAmB,EAEM,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,KAAK,IAAI,EAAgB,MAAM,iCAAiC,CAAC;AAE1E,wBAAsB,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyC7E"}
@@ -3,5 +3,37 @@
3
3
  * Copyright: (c) 2026 Gage Sorrell
4
4
  * License: MIT
5
5
  */
6
- export * from "@sorrell/inquirer-file-selector";
6
+ import { fileSelector } from "@sorrell/inquirer-file-selector";
7
+ export async function FileSelector(Config) {
8
+ const BaseConfig = {
9
+ keybinds: {
10
+ back: ["left"],
11
+ confirm: ["enter", "return"],
12
+ down: ["down"],
13
+ forward: ["right"],
14
+ up: ["up"]
15
+ },
16
+ loop: true,
17
+ multiple: false,
18
+ theme: {
19
+ labels: {
20
+ hints: {
21
+ confirm: "{{confirm}} to place the new module here."
22
+ },
23
+ keys: {
24
+ back: "←",
25
+ down: "↓",
26
+ forward: "→",
27
+ up: "↑"
28
+ }
29
+ }
30
+ },
31
+ type: "directory"
32
+ };
33
+ const MergedConfig = {
34
+ ...BaseConfig,
35
+ ...Config
36
+ };
37
+ return await fileSelector(MergedConfig);
38
+ }
7
39
  //# sourceMappingURL=FileSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileSelector.js","sourceRoot":"","sources":["../Source/FileSelector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"FileSelector.js","sourceRoot":"","sources":["../Source/FileSelector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAa,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE1E,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAA2B;IAE1D,MAAM,UAAU,GACZ;QACI,QAAQ,EACR;YACI,IAAI,EAAE,CAAE,MAAM,CAAE;YAChB,OAAO,EAAE,CAAE,OAAO,EAAE,QAAQ,CAAE;YAC9B,IAAI,EAAE,CAAE,MAAM,CAAE;YAChB,OAAO,EAAE,CAAE,OAAO,CAAE;YACpB,EAAE,EAAE,CAAE,IAAI,CAAE;SACf;QACD,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,KAAK;QACf,KAAK,EACL;YACI,MAAM,EACN;gBACI,KAAK,EACL;oBACI,OAAO,EAAE,2CAA2C;iBACvD;gBACD,IAAI,EACJ;oBACI,IAAI,EAAE,GAAG;oBACT,IAAI,EAAE,GAAG;oBACT,OAAO,EAAE,GAAG;oBACZ,EAAE,EAAE,GAAG;iBACV;aACJ;SACJ;QACD,IAAI,EAAE,WAAW;KACpB,CAAC;IAEN,MAAM,YAAY,GACd;QACI,GAAG,UAAU;QACb,GAAG,MAAM;KACZ,CAAC;IAEN,OAAO,MAAM,YAAY,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export * from "./Confirm.js";
2
2
  export * from "./Confirm.Types.js";
3
3
  export * from "./FileSelector.js";
4
+ export * from "./FileSelector.Types.js";
4
5
  export * from "./Print.js";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAMA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAMA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC"}
@@ -6,5 +6,6 @@
6
6
  export * from "./Confirm.js";
7
7
  export * from "./Confirm.Types.js";
8
8
  export * from "./FileSelector.js";
9
+ export * from "./FileSelector.Types.js";
9
10
  export * from "./Print.js";
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sorrell/cli-utilities",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "Utilities for CLI tools.",
5
5
  "keywords": [
6
6
  "cli",