@flowscripter/flowscripter-io-cli 1.2.3 → 1.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/README.md CHANGED
@@ -51,7 +51,15 @@ You can download and extract the binary zip files from the
51
51
  behaviour as `copy`
52
52
  - `hash <path> [--algorithm]` - hash a file by piping its readable stream
53
53
  through a `Bun.CryptoHasher` (default `sha256`) - demonstrates consuming a
54
- `pluggable-io-framework` stream directly, outside the framework itself
54
+ `pluggable-io-framework` stream directly, outside the framework itself.
55
+ `--algorithm` is restricted to a curated set (`sha1`, `sha256`, `sha384`,
56
+ `sha512`, `md5`)
57
+
58
+ Any argument omitted on the command line (e.g. running `copy` with no
59
+ `source`/`destination`) is interactively prompted for instead of failing,
60
+ via [dynamic-cli-framework](https://github.com/flowscripter/dynamic-cli-framework)'s
61
+ `ArgumentPrompterService`. Confirmation messages (`copy`, `move`, `delete`,
62
+ `set-properties`) are prefixed with a success icon.
55
63
 
56
64
  All commands operate against a filesystem source/sink provider - rooted at
57
65
  `/`, so any absolute or cwd-relative path works, the same as any normal file
package/bun.lock CHANGED
@@ -5,17 +5,17 @@
5
5
  "": {
6
6
  "name": "@flowscripter/flowscripter-io-cli",
7
7
  "dependencies": {
8
- "@flowscripter/dynamic-cli-framework": "^5.4.8",
9
- "@flowscripter/dynamic-cli-framework-api": "^2.3.4",
10
- "@flowscripter/dynamic-plugin-framework": "^2.2.6",
11
- "@flowscripter/flowscripter-io-cli-hash-native": "^1.0.3",
12
- "@flowscripter/pluggable-io-framework": "^1.1.5",
13
- "@flowscripter/pluggable-io-framework-api": "^1.0.9",
8
+ "@flowscripter/dynamic-cli-framework": "^5.4.13",
9
+ "@flowscripter/dynamic-cli-framework-api": "^2.3.6",
10
+ "@flowscripter/dynamic-plugin-framework": "^2.2.8",
11
+ "@flowscripter/flowscripter-io-cli-hash-native": "^1.0.6",
12
+ "@flowscripter/pluggable-io-framework": "^1.2.1",
13
+ "@flowscripter/pluggable-io-framework-api": "^1.1.1",
14
14
  },
15
15
  "devDependencies": {
16
- "@flowscripter/io-plugin-filesystem": "^1.0.6",
16
+ "@flowscripter/io-plugin-filesystem": "^1.1.0",
17
17
  "@types/bun": "^1.4.2",
18
- "@types/node": "^26.4.1",
18
+ "@types/node": "^26.5.1",
19
19
  "oxfmt": "0.67.0",
20
20
  "oxlint": "1.82.0",
21
21
  },
@@ -25,19 +25,19 @@
25
25
  },
26
26
  },
27
27
  "packages": {
28
- "@flowscripter/dynamic-cli-framework": ["@flowscripter/dynamic-cli-framework@5.4.8", "", { "dependencies": { "@flowscripter/dynamic-cli-framework-api": "^2.3.4", "@flowscripter/dynamic-plugin-framework": "^2.2.6", "emphasize": "^7.0.0", "fastest-levenshtein": "^1.0.16", "figlet": "^1.11.4", "highlight.js": "^11.12.0", "prettier": "^3.9.6", "semver": "^7.8.5", "supports-color": "^11.0.0", "supports-terminal-graphics": "^0.1.0" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-rBC5IfJicgOEjtv3dd9AYFUTv/m0RjoWkaBwfxA4xGBPMl9tnRLVMp90BFu20AM7dhR2TB11n1OmJGc3l2Ejaw=="],
28
+ "@flowscripter/dynamic-cli-framework": ["@flowscripter/dynamic-cli-framework@5.4.13", "", { "dependencies": { "@flowscripter/dynamic-cli-framework-api": "^2.3.6", "@flowscripter/dynamic-plugin-framework": "^2.2.8", "emphasize": "^7.0.0", "fastest-levenshtein": "^1.0.16", "figlet": "^1.11.4", "highlight.js": "^11.12.0", "prettier": "^3.9.6", "semver": "^7.8.5", "supports-color": "^11.0.0", "supports-terminal-graphics": "^0.1.0" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-5A/m0LY3UymMQUSijO/kxUrZ054HrVU2Qsl1K4d6K22hMsMztA66J4qXVBCgEZX6hbliXxCgo6qJtKiQjLFg+g=="],
29
29
 
30
- "@flowscripter/dynamic-cli-framework-api": ["@flowscripter/dynamic-cli-framework-api@2.3.4", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-IisiSF13BYxvnISWM4Y9OaKiTMulPJO/Q6Ahx1yzZdfnradCSwcZJVE3QeiMuP9mkiVF4/8LpJcn1DEm4UOqLA=="],
30
+ "@flowscripter/dynamic-cli-framework-api": ["@flowscripter/dynamic-cli-framework-api@2.3.6", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-WPwSy2ZFXzrilyAcQ4mkqQfGxNzJ5mMG7bsDq2BRXR6c1wR8r36Mdvm20eShKslCgniPmolwlEZo7JuTN10k3w=="],
31
31
 
32
- "@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@2.2.6", "", { "dependencies": { "semver": "^7.8.5" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-21Rkr3zFJUsygMKEPvuts4Y3Xl5sqRgk6vjqb4R4DXg0bFx4B/nS1I8Msn1SJY09tLYR3PjMViXmtE2aF+kXCA=="],
32
+ "@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@2.2.8", "", { "dependencies": { "semver": "^7.8.5" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-yhEoSPi/xPs6529tmGvapo78k7zWRdKMUnBsoG/ocrt8nfPefrAkIhb735VRXI0fhD9g5lUjgFUIsbLDkVj3GQ=="],
33
33
 
34
- "@flowscripter/flowscripter-io-cli-hash-native": ["@flowscripter/flowscripter-io-cli-hash-native@1.0.3", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-ThKrrED3VA7AyEmZ2s/dqtgplNhyws3l+Jfht9SPP808OTPxxXc4z49+dWBMEXjvqslgHMO7896nF6z7OPDnlA=="],
34
+ "@flowscripter/flowscripter-io-cli-hash-native": ["@flowscripter/flowscripter-io-cli-hash-native@1.0.6", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-MSmIPWHzvJlU4V/kPuSVKV5aULBxtv68ep/VtWSdr3QCtyFJHH5qcEDD4iYPhl/+XdeDEfONQ6TLNyHuLPebqA=="],
35
35
 
36
- "@flowscripter/io-plugin-filesystem": ["@flowscripter/io-plugin-filesystem@1.0.6", "", { "dependencies": { "@flowscripter/pluggable-io-framework-api": "^1.0.8", "zod": "^4.5.4" }, "peerDependencies": { "@flowscripter/dynamic-plugin-framework": "*", "typescript": "^7.0.2" } }, "sha512-zGDqJ//OGMwoDOhz4BhvjXRXf3tknZVk0kKshmqlWoLMpD0u83SiqwIMU0n1lF+DMfXoN1MaWM9BO8D9F/eDqg=="],
36
+ "@flowscripter/io-plugin-filesystem": ["@flowscripter/io-plugin-filesystem@1.1.0", "", { "dependencies": { "@flowscripter/pluggable-io-framework-api": "^1.1.0", "zod": "^4.6.1" }, "peerDependencies": { "@flowscripter/dynamic-plugin-framework": "*", "typescript": "^7.0.2" } }, "sha512-r4gafnW8VfN86ZGSNIo++BVd2+HPcMC4ztIeCK5a4hXAMC4wHX8GmZ3kOvCLXgHpQR3UboBSesPYX93WHSl4mQ=="],
37
37
 
38
- "@flowscripter/pluggable-io-framework": ["@flowscripter/pluggable-io-framework@1.1.5", "", { "dependencies": { "@flowscripter/dynamic-plugin-framework": "^2.2.6", "@flowscripter/pluggable-io-framework-api": "^1.0.9" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-p+jvaTVEgS3Fhz90cU7rAdl+AfwGPCWckhy4yofwKsLCCA8rvGvsiIqrb3VqUZyO1LCgKrmYP9TnSKICH9Bw/A=="],
38
+ "@flowscripter/pluggable-io-framework": ["@flowscripter/pluggable-io-framework@1.2.1", "", { "dependencies": { "@flowscripter/dynamic-plugin-framework": "^2.2.8", "@flowscripter/pluggable-io-framework-api": "^1.1.1" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-nN2vHtj4/fmGtIrmCUqqj2KNGpXsWl/kytf4LWztYonromaDMAxQhhi6OkDzOjBsRs/Z8YK1S3LAm2Y5PxN/7g=="],
39
39
 
40
- "@flowscripter/pluggable-io-framework-api": ["@flowscripter/pluggable-io-framework-api@1.0.9", "", { "dependencies": { "zod": "^4.6.1", "zod-to-json-schema": "^3.25.2" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-MyVaTD94kk8YUZfc2ont83EPLH6uCIdOqL/xFVUmNvDNidsqesLqF/1u8eC5UEcNmeHJrMhRkr0HtCrfwokeiA=="],
40
+ "@flowscripter/pluggable-io-framework-api": ["@flowscripter/pluggable-io-framework-api@1.1.1", "", { "dependencies": { "zod": "^4.6.5", "zod-to-json-schema": "^3.25.2" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-fIiDBxHHAaomv3NmqRFPAUfb8Yf9z5DyyEQyK3BJm0DHmLNvLN4bV252frCLB22lIz2F3mnOL5v2tgOE66UM3g=="],
41
41
 
42
42
  "@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.67.0", "", { "os": "android", "cpu": "arm" }, "sha512-2olh3ioEmc4gRzQm7jxyB1b/PFBoFvTq8KdgYySeNpysDtA6DEg2Mvya4/I6flhL7G0eOrE8RD7JCNCIMhE16Q=="],
43
43
 
@@ -119,7 +119,7 @@
119
119
 
120
120
  "@types/hast": ["@types/hast@3.0.5", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],
121
121
 
122
- "@types/node": ["@types/node@26.4.1", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-k97ENvZWtvA6yqz5/FS6a7duDgOPEeOQOc2iKS/nY6mX6qJUKtLnWzQS+Xj6tXweyj6ZcTAK2Qecetnvi9nCLA=="],
122
+ "@types/node": ["@types/node@26.5.1", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-CzNm2FezW4VR/LjG6yUdiEgLE/rAQ9Slj5gCu/C2VrdcW7I0ahNZ8DRbHT7zOZ6r3ONgd/bsQIeSaoDGrd1C6g=="],
123
123
 
124
124
  "@types/unist": ["@types/unist@3.0.3", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],
125
125
 
@@ -199,9 +199,9 @@
199
199
 
200
200
  "typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="],
201
201
 
202
- "undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
202
+ "undici-types": ["undici-types@8.9.0", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="],
203
203
 
204
- "zod": ["zod@4.6.1", "", {}, "sha512-341aRWQsve0rvronKNTqZpjmzdbUDlFuzHaI/XLg/Ej82qffDJRRfBTCuv7+9q/rMjB6LSLyEBnW4InJeMtt/Q=="],
204
+ "zod": ["zod@4.6.5", "", {}, "sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q=="],
205
205
 
206
206
  "zod-to-json-schema": ["zod-to-json-schema@3.25.2", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="],
207
207
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/flowscripter-io-cli",
3
- "version": "1.2.3",
3
+ "version": "1.3.1",
4
4
  "description": "Example CLI using https://github.com/flowscripter/pluggable-io-framework",
5
5
  "keywords": [
6
6
  "bun",
@@ -21,17 +21,17 @@
21
21
  "access": "public"
22
22
  },
23
23
  "dependencies": {
24
- "@flowscripter/dynamic-cli-framework": "^5.4.8",
25
- "@flowscripter/dynamic-cli-framework-api": "^2.3.4",
26
- "@flowscripter/dynamic-plugin-framework": "^2.2.6",
27
- "@flowscripter/flowscripter-io-cli-hash-native": "^1.0.3",
28
- "@flowscripter/pluggable-io-framework": "^1.1.5",
29
- "@flowscripter/pluggable-io-framework-api": "^1.0.9"
24
+ "@flowscripter/dynamic-cli-framework": "^5.4.13",
25
+ "@flowscripter/dynamic-cli-framework-api": "^2.3.6",
26
+ "@flowscripter/dynamic-plugin-framework": "^2.2.8",
27
+ "@flowscripter/flowscripter-io-cli-hash-native": "^1.0.6",
28
+ "@flowscripter/pluggable-io-framework": "^1.2.1",
29
+ "@flowscripter/pluggable-io-framework-api": "^1.1.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@flowscripter/io-plugin-filesystem": "^1.0.6",
32
+ "@flowscripter/io-plugin-filesystem": "^1.1.0",
33
33
  "@types/bun": "^1.4.2",
34
- "@types/node": "^26.4.1",
34
+ "@types/node": "^26.5.1",
35
35
  "oxfmt": "0.67.0",
36
36
  "oxlint": "1.82.0"
37
37
  },
package/src/cli.ts CHANGED
@@ -24,6 +24,7 @@ export async function cli(): Promise<void> {
24
24
  packageJson.version,
25
25
  [new PrettyPrinterServiceProvider(40), new SyntaxHighlighterServiceProvider(35)],
26
26
  {
27
+ argumentPrompterServiceEnabled: true,
27
28
  pluginServiceEnabled: true,
28
29
  pluginServiceRemoteConfig: {
29
30
  name: "npmjs",
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Icon,
2
3
  PRINTER_SERVICE_ID,
3
4
  type Context,
4
5
  type PrinterService,
@@ -51,7 +52,7 @@ const copy: SubCommand = {
51
52
  } finally {
52
53
  await printerService.hideProgressBar(handle);
53
54
  }
54
- await printerService.print(`Copied ${source} to ${destination}\n`);
55
+ await printerService.print(`Copied ${source} to ${destination}\n`, Icon.SUCCESS);
55
56
  } finally {
56
57
  await provider[Symbol.asyncDispose]();
57
58
  }
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Icon,
2
3
  PRINTER_SERVICE_ID,
3
4
  type Context,
4
5
  type PrinterService,
@@ -31,7 +32,7 @@ const deleteCommand: SubCommand = {
31
32
  } finally {
32
33
  await printerService.hideSpinner();
33
34
  }
34
- await printerService.print(`Deleted ${path}\n`);
35
+ await printerService.print(`Deleted ${path}\n`, Icon.SUCCESS);
35
36
  } finally {
36
37
  await provider[Symbol.asyncDispose]();
37
38
  }
@@ -29,6 +29,7 @@ const hash: SubCommand = {
29
29
  shortAlias: "a",
30
30
  isOptional: true,
31
31
  defaultValue: "sha256",
32
+ allowableValues: ["sha1", "sha256", "sha384", "sha512", "md5"],
32
33
  },
33
34
  ],
34
35
  async execute(context: Context, argumentValues: Values): Promise<void> {
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Icon,
2
3
  PRINTER_SERVICE_ID,
3
4
  type Context,
4
5
  type PrinterService,
@@ -51,7 +52,7 @@ const move: SubCommand = {
51
52
  } finally {
52
53
  await printerService.hideProgressBar(handle);
53
54
  }
54
- await printerService.print(`Moved ${source} to ${destination}\n`);
55
+ await printerService.print(`Moved ${source} to ${destination}\n`, Icon.SUCCESS);
55
56
  } finally {
56
57
  await provider[Symbol.asyncDispose]();
57
58
  }
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Icon,
2
3
  PRINTER_SERVICE_ID,
3
4
  type Context,
4
5
  type PrinterService,
@@ -40,7 +41,7 @@ const setProperties: SubCommand = {
40
41
  } finally {
41
42
  await printerService.hideSpinner();
42
43
  }
43
- await printerService.print(`Updated properties for ${path}\n`);
44
+ await printerService.print(`Updated properties for ${path}\n`, Icon.SUCCESS);
44
45
  } finally {
45
46
  await provider[Symbol.asyncDispose]();
46
47
  }
@@ -2,6 +2,7 @@ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } fr
2
2
  import { mkdir, mkdtemp, rm, symlink, writeFile } from "node:fs/promises";
3
3
  import { tmpdir } from "node:os";
4
4
  import { join, resolve } from "node:path";
5
+ import { Icon } from "@flowscripter/dynamic-cli-framework";
5
6
  import copy from "../src/commands/copy.ts";
6
7
  import deleteCommand from "../src/commands/delete.ts";
7
8
  import getProperties from "../src/commands/get-properties.ts";
@@ -69,7 +70,7 @@ describe("get-properties", () => {
69
70
  describe("set-properties", () => {
70
71
  test("applies mode", async () => {
71
72
  await writeFile(join(root, "a.txt"), "hello");
72
- const { context } = createStubContext();
73
+ const { context, icons } = createStubContext();
73
74
 
74
75
  await setProperties.execute(context, { path: join(root, "a.txt"), mode: 0o600 });
75
76
 
@@ -79,6 +80,7 @@ describe("set-properties", () => {
79
80
  if (process.platform !== "win32") {
80
81
  expect(properties.properties.mode & 0o777).toBe(0o600);
81
82
  }
83
+ expect(icons).toEqual([Icon.SUCCESS]);
82
84
  });
83
85
 
84
86
  test("shows a spinner while applying properties", async () => {
@@ -94,13 +96,14 @@ describe("set-properties", () => {
94
96
  describe("delete", () => {
95
97
  test("removes a file", async () => {
96
98
  await writeFile(join(root, "a.txt"), "hello");
97
- const { context } = createStubContext();
99
+ const { context, icons } = createStubContext();
98
100
 
99
101
  await deleteCommand.execute(context, { path: join(root, "a.txt") });
100
102
 
101
103
  const { lines, context: listContext } = createStubContext();
102
104
  await list.execute(listContext, { path: root });
103
105
  expect(lines.length).toBe(0);
106
+ expect(icons).toEqual([Icon.SUCCESS]);
104
107
  });
105
108
 
106
109
  test("shows a spinner while deleting", async () => {
@@ -116,7 +119,7 @@ describe("delete", () => {
116
119
  describe("copy", () => {
117
120
  test("copies a file", async () => {
118
121
  await writeFile(join(root, "a.txt"), "hello");
119
- const { context } = createStubContext();
122
+ const { context, icons } = createStubContext();
120
123
 
121
124
  await copy.execute(context, { source: join(root, "a.txt"), destination: join(root, "b.txt") });
122
125
 
@@ -125,23 +128,32 @@ describe("copy", () => {
125
128
  await getProperties.execute(getPropsContext, { path: join(root, "b.txt") });
126
129
  expect(JSON.parse(getPropsLines[0]!).size).toBe(5);
127
130
  expect(lines).toEqual([]);
131
+ expect(icons).toEqual([Icon.SUCCESS]);
128
132
  });
129
133
  });
130
134
 
131
135
  describe("move", () => {
132
136
  test("moves a file", async () => {
133
137
  await writeFile(join(root, "a.txt"), "hello");
134
- const { context } = createStubContext();
138
+ const { context, icons } = createStubContext();
135
139
 
136
140
  await move.execute(context, { source: join(root, "a.txt"), destination: join(root, "b.txt") });
137
141
 
138
142
  const { lines, context: listContext } = createStubContext();
139
143
  await list.execute(listContext, { path: root });
140
144
  expect(lines.map((line) => JSON.parse(line).path)).toEqual(["b.txt"]);
145
+ expect(icons).toEqual([Icon.SUCCESS]);
141
146
  });
142
147
  });
143
148
 
144
149
  describe("hash", () => {
150
+ test("algorithm option has a curated set of allowable values", () => {
151
+ const algorithmOption = hash.options.find((option) => option.name === "algorithm") as
152
+ | { allowableValues?: readonly unknown[] }
153
+ | undefined;
154
+ expect(algorithmOption?.allowableValues).toEqual(["sha1", "sha256", "sha384", "sha512", "md5"]);
155
+ });
156
+
145
157
  test("hashes a file with the default algorithm using the native hasher", async () => {
146
158
  await writeFile(join(root, "a.txt"), "hello");
147
159
  const { lines, context } = createStubContext();
@@ -5,11 +5,13 @@ import {
5
5
  PRINTER_SERVICE_ID,
6
6
  SYNTAX_HIGHLIGHTER_SERVICE_ID,
7
7
  type Context,
8
+ type Icon,
8
9
  type PrinterService,
9
10
  } from "@flowscripter/dynamic-cli-framework";
10
11
 
11
12
  export interface StubPrinter {
12
13
  lines: string[];
14
+ icons: (Icon | undefined)[];
13
15
  spinnerMessages: string[];
14
16
  progressUpdates: number[];
15
17
  context: Context;
@@ -26,11 +28,13 @@ export interface StubPrinter {
26
28
  */
27
29
  export function createStubContext(): StubPrinter {
28
30
  const lines: string[] = [];
31
+ const icons: (Icon | undefined)[] = [];
29
32
  const spinnerMessages: string[] = [];
30
33
  const progressUpdates: number[] = [];
31
34
  const printerService = {
32
- print: async (message: string) => {
35
+ print: async (message: string, icon?: Icon) => {
33
36
  lines.push(message);
37
+ icons.push(icon);
34
38
  },
35
39
  showProgressBar: async () => 0,
36
40
  updateProgressBar: (_handle: number, current: number) => {
@@ -59,5 +63,5 @@ export function createStubContext(): StubPrinter {
59
63
  doesServiceExist: (id: string) => id in services,
60
64
  };
61
65
 
62
- return { lines, spinnerMessages, progressUpdates, context };
66
+ return { lines, icons, spinnerMessages, progressUpdates, context };
63
67
  }