@flowscripter/flowscripter-io-cli 1.2.2 → 1.3.0
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 +9 -1
- package/bun.lock +59 -59
- package/package.json +10 -10
- package/src/cli.ts +1 -0
- package/src/commands/copy.ts +2 -1
- package/src/commands/delete.ts +2 -1
- package/src/commands/hash.ts +1 -0
- package/src/commands/move.ts +2 -1
- package/src/commands/set-properties.ts +2 -1
- package/tests/commands_test.ts +16 -4
- package/tests/testContext.ts +6 -2
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,19 +5,19 @@
|
|
|
5
5
|
"": {
|
|
6
6
|
"name": "@flowscripter/flowscripter-io-cli",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@flowscripter/dynamic-cli-framework": "^5.4.
|
|
8
|
+
"@flowscripter/dynamic-cli-framework": "^5.4.8",
|
|
9
9
|
"@flowscripter/dynamic-cli-framework-api": "^2.3.4",
|
|
10
|
-
"@flowscripter/dynamic-plugin-framework": "^2.2.
|
|
11
|
-
"@flowscripter/flowscripter-io-cli-hash-native": "^1.0.
|
|
12
|
-
"@flowscripter/pluggable-io-framework": "^1.1.
|
|
13
|
-
"@flowscripter/pluggable-io-framework-api": "^1.0.
|
|
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",
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@flowscripter/io-plugin-filesystem": "^1.0.
|
|
17
|
-
"@types/bun": "^1.4.
|
|
16
|
+
"@flowscripter/io-plugin-filesystem": "^1.0.6",
|
|
17
|
+
"@types/bun": "^1.4.2",
|
|
18
18
|
"@types/node": "^26.4.1",
|
|
19
|
-
"oxfmt": "0.
|
|
20
|
-
"oxlint": "1.
|
|
19
|
+
"oxfmt": "0.67.0",
|
|
20
|
+
"oxlint": "1.82.0",
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"typescript": "^7.0.2",
|
|
@@ -25,97 +25,97 @@
|
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
"packages": {
|
|
28
|
-
"@flowscripter/dynamic-cli-framework": ["@flowscripter/dynamic-cli-framework@5.4.
|
|
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=="],
|
|
29
29
|
|
|
30
30
|
"@flowscripter/dynamic-cli-framework-api": ["@flowscripter/dynamic-cli-framework-api@2.3.4", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-IisiSF13BYxvnISWM4Y9OaKiTMulPJO/Q6Ahx1yzZdfnradCSwcZJVE3QeiMuP9mkiVF4/8LpJcn1DEm4UOqLA=="],
|
|
31
31
|
|
|
32
|
-
"@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@2.2.
|
|
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=="],
|
|
33
33
|
|
|
34
|
-
"@flowscripter/flowscripter-io-cli-hash-native": ["@flowscripter/flowscripter-io-cli-hash-native@1.0.
|
|
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=="],
|
|
35
35
|
|
|
36
|
-
"@flowscripter/io-plugin-filesystem": ["@flowscripter/io-plugin-filesystem@1.0.
|
|
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=="],
|
|
37
37
|
|
|
38
|
-
"@flowscripter/pluggable-io-framework": ["@flowscripter/pluggable-io-framework@1.1.
|
|
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=="],
|
|
39
39
|
|
|
40
|
-
"@flowscripter/pluggable-io-framework-api": ["@flowscripter/pluggable-io-framework-api@1.0.
|
|
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=="],
|
|
41
41
|
|
|
42
|
-
"@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.
|
|
42
|
+
"@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.67.0", "", { "os": "android", "cpu": "arm" }, "sha512-2olh3ioEmc4gRzQm7jxyB1b/PFBoFvTq8KdgYySeNpysDtA6DEg2Mvya4/I6flhL7G0eOrE8RD7JCNCIMhE16Q=="],
|
|
43
43
|
|
|
44
|
-
"@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.
|
|
44
|
+
"@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.67.0", "", { "os": "android", "cpu": "arm64" }, "sha512-ulfw8EHN1MBq/MFFDXw2/M1VAFu5mRUcnuZ8Hqbv9viAnFzO9t1jKSAsDqKYYDGMlytF/uj6Z5z5n/tHupnKhw=="],
|
|
45
45
|
|
|
46
|
-
"@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.
|
|
46
|
+
"@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.67.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-MfONZx/O2o9M5v2jDFol556G9+A+P9xCuJ4DZ+qhE+RnaCdoscy6Eu5nq1dbuNxhwdJyZ6kLI7fnG9mwEeOeGg=="],
|
|
47
47
|
|
|
48
|
-
"@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.
|
|
48
|
+
"@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.67.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-CYnIx5LvFVJnyJcCqwH2jxMKjFjqo5678MPjdmNFoSGMhlOvZ/xRZqvhDcolKrXc8fezW3AKh+C4wyoFuWOSSg=="],
|
|
49
49
|
|
|
50
|
-
"@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.
|
|
50
|
+
"@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.67.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-7/iF1orvIS9mxhKUqnmtMgm+OrSQ5acPwuvdQrm6ECgqbwPmC+Pw9cdke3sNfVN6pT2hbJ58+jP8BCThl5HXOg=="],
|
|
51
51
|
|
|
52
|
-
"@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.
|
|
52
|
+
"@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.67.0", "", { "os": "linux", "cpu": "arm" }, "sha512-yy+OGys07IZOpOmYPZoObKyUQLkfxeQqeCypk+1jaZd8HGo77hzvU1Jg8X3+W75o+9lszOjBfg0nkGtlwYywXw=="],
|
|
53
53
|
|
|
54
|
-
"@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.
|
|
54
|
+
"@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.67.0", "", { "os": "linux", "cpu": "arm" }, "sha512-wPIeeigXgJpwNw3wydYRt3U9iN9Y/ejpOZuYL9IA7igxWs7LIQMOkhKxTumRvy6dIv0iXKk3RTw3Vmjg0i+2sg=="],
|
|
55
55
|
|
|
56
|
-
"@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.
|
|
56
|
+
"@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.67.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-0+XNxcdbkTfxdcD4qW6Ci9n+mBNJ8xTBumnxKvKBmRFOdx0Wf8/KiHjCJayooXmYkqRpRVd98Q5egvzx5BLSgQ=="],
|
|
57
57
|
|
|
58
|
-
"@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.
|
|
58
|
+
"@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.67.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-I75LKPJyNOYUzkqAiAMIE31+Ye7xtQXZdoty1IXn4B+bw5Zpmez5wfG19ejGpNnS/BzQ7LFS+7jxuTPb+vHiZw=="],
|
|
59
59
|
|
|
60
|
-
"@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.
|
|
60
|
+
"@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.67.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-c2M5iRpe1QMZSRE/UvZoPdXBWb5Ic/ycvOyNiKCqPwQ/OyOKIMiJs02ynlNnjb7ZZJnRXYLmGcohoINOcwDK3w=="],
|
|
61
61
|
|
|
62
|
-
"@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.
|
|
62
|
+
"@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.67.0", "", { "os": "linux", "cpu": "none" }, "sha512-dQzzYlV24Udhfm5ECuSdgqRvFJU/CGHzcYYEO3dLM6W6+CHiBFrq9OjIllkdCcPhsoSQ8o223Dja84MOSzed9A=="],
|
|
63
63
|
|
|
64
|
-
"@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.
|
|
64
|
+
"@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.67.0", "", { "os": "linux", "cpu": "none" }, "sha512-rFNq1CgX4qMJANOq42LkAs90JE80GpiaEohAV2qn/gT2hGjQTW1zBO5zQBxArI4926pM1OSzo3CN0tBszGBIaA=="],
|
|
65
65
|
|
|
66
|
-
"@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.
|
|
66
|
+
"@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.67.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-Sky6rEdz2o5IGq01lPhS12yEvDdChVEcaYrcLHkveh4Fx0qPjljE/Iul6SX/bRMl6lNc8J7J/mDQdzgBdA++Pg=="],
|
|
67
67
|
|
|
68
|
-
"@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.
|
|
68
|
+
"@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.67.0", "", { "os": "linux", "cpu": "x64" }, "sha512-vPXmlNORV8AZq2Ocxh07pxwMjfENUWCV/eZArnao0qC3NO/hDeTVkQvee7SJJUbIiF5PZbBa4kYmaXnu7Rk58w=="],
|
|
69
69
|
|
|
70
|
-
"@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.
|
|
70
|
+
"@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.67.0", "", { "os": "linux", "cpu": "x64" }, "sha512-x/WAtFqYtVr3vZ9ni8nr4kn9whSitg8fOljq/pZzBpxopRdY1BMLZCZkrbIbaBcYkm46qGbqVea2FCWmtQ2P9w=="],
|
|
71
71
|
|
|
72
|
-
"@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.
|
|
72
|
+
"@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.67.0", "", { "os": "none", "cpu": "arm64" }, "sha512-eRw9Neh4/aA6i+q/R3WU1gGQINhVM0J4fXIm6t27caOamkr/37uAkp1IdBx4zlJH97hmXR63z/q9n5c5dN7MzA=="],
|
|
73
73
|
|
|
74
|
-
"@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.
|
|
74
|
+
"@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.67.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-YIMvb+sGNYN2uc6+QK2HLPeEKM2vl7QZ5onQzpAJRb6pnf0DwUFP5R8tdS9R0l8hdUil2gu4Uxd0Yxrop0iT4w=="],
|
|
75
75
|
|
|
76
|
-
"@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.
|
|
76
|
+
"@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.67.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-LzmU9MyACPzwNDIK0ItMedHPz735Ug7ELWguxo4/kuy6zWuDoeglOAEFCY8jLg0PzRpFO3hDyLFe2Gu2eFDeGA=="],
|
|
77
77
|
|
|
78
|
-
"@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.
|
|
78
|
+
"@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.67.0", "", { "os": "win32", "cpu": "x64" }, "sha512-sbQOIDNLUEeVZcAJcSL5VURn7kfjvilPviody4Yl5n8lQCDtUm+C9oHTTwZS/m4d/Z6Vv3jNEiAofH932NPPCg=="],
|
|
79
79
|
|
|
80
|
-
"@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.
|
|
80
|
+
"@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.82.0", "", { "os": "android", "cpu": "arm" }, "sha512-a3LB+C5Dsj5b/qtmG/mv5WrzuiXEpg1KF5nXWcEvaoN5TYAqkIvxPOwTPp3Jy/FoGpRo8zsTFhMElMXfeoOEzA=="],
|
|
81
81
|
|
|
82
|
-
"@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.
|
|
82
|
+
"@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.82.0", "", { "os": "android", "cpu": "arm64" }, "sha512-OBlhRgNqFblGpGenno/aqOfJLOkQ2B8Ig3iDAalfn0H8hJGZKXPeexCRTDm6uwv6YUjSA9Xnwt1y/Bgj5ZH8uw=="],
|
|
83
83
|
|
|
84
|
-
"@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.
|
|
84
|
+
"@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.82.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-dsopxqtY5ZdyT9uLHyGt1SyiLop6hi7hWI3PKpePodkRQOkLaCm+OE4fR9CAz9qdfjiFO8531tX/QDyP/psjFg=="],
|
|
85
85
|
|
|
86
|
-
"@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.
|
|
86
|
+
"@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.82.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-94Lu0SgTClKColU66g1VDuigV3HkcbkJBnTtZjGYfE8UPugaWDgKrm2icjC6HJVUYler2OXaHP/X0TBy8+CowQ=="],
|
|
87
87
|
|
|
88
|
-
"@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.
|
|
88
|
+
"@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.82.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-hne/V06ewhh1i0w8+l7GDNROAGCGPmyFuOwiP7YTRu0JycyStJ4785dmF8xU5p0uUwt2emvIF9vc7Xjis+cJ0g=="],
|
|
89
89
|
|
|
90
|
-
"@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.
|
|
90
|
+
"@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.82.0", "", { "os": "linux", "cpu": "arm" }, "sha512-aWY2xtbZf1LneW9Qsv/n2Sp8gOu74JrlQzEtj4coHX2SHFrCfhmAumaU+sI/A5nr+yoTRTSmI/pL2s6ADlNSkw=="],
|
|
91
91
|
|
|
92
|
-
"@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.
|
|
92
|
+
"@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.82.0", "", { "os": "linux", "cpu": "arm" }, "sha512-Fe+TtXCXMh/5f7kWlZ2VAwsMumZWtraFlKVk1NJlL52/beGwfDE7ov+/8gVirHzWokzGu7X65hSPq0ucPDskWQ=="],
|
|
93
93
|
|
|
94
|
-
"@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.
|
|
94
|
+
"@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.82.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-6azCZ6OJudlvipNttXCCQcyeFfcJ/NvUZdSN1z8elo73kCHtyQC7WTiUcSjWYvJ1jaq9KDUyMAoAS/vNzhBomA=="],
|
|
95
95
|
|
|
96
|
-
"@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.
|
|
96
|
+
"@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.82.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-PLEaSD8IAIIlwW4dwOd9YaxuxeOpwiXL4J24rcnE4iNtyM5j9Q9/3+gti08oXpx0u2ygNjRDx9xjWWpQonuJEw=="],
|
|
97
97
|
|
|
98
|
-
"@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.
|
|
98
|
+
"@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.82.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-D94em/BwknNTn4vqxjHh5wb2oL566eFhArabqKIr0cNZMHOJuiraFp1A8tXpH05bbE5tqwEfLXTI0MWEGtn3Dw=="],
|
|
99
99
|
|
|
100
|
-
"@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.
|
|
100
|
+
"@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.82.0", "", { "os": "linux", "cpu": "none" }, "sha512-MOprxBaoYU2D4VgxXCl3ghydThWtx7Um1lL51kGYNeQ5Al7WzsH7/tqGdNtbLrIWnjq3bsm13+nz/gRIxjrOXw=="],
|
|
101
101
|
|
|
102
|
-
"@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.
|
|
102
|
+
"@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.82.0", "", { "os": "linux", "cpu": "none" }, "sha512-5h55QsfJ/luDXZzC20k6SNOY1Az+dCP9WvntKtcUWh2JhckAdwApY2ZusaBTwLENnReXU+A2fJtSrYvZJNKNPg=="],
|
|
103
103
|
|
|
104
|
-
"@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.
|
|
104
|
+
"@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.82.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-IE8NJNLlHr0CaXyGJPGVn0eTkUyoj1I2UfA8x7I4PSOYKsQ/6btVC7Pywrj5onk0cMH25r6Z38SoN3AvE5Zuog=="],
|
|
105
105
|
|
|
106
|
-
"@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.
|
|
106
|
+
"@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.82.0", "", { "os": "linux", "cpu": "x64" }, "sha512-XUUUxaBo9XKl+J1B9EmP1cTGQPddzeURvoGkfwh/94PGnbW+hBprDljneoI2M1jzC1bzrIV3ihc7iM9UXl8+tg=="],
|
|
107
107
|
|
|
108
|
-
"@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.
|
|
108
|
+
"@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.82.0", "", { "os": "linux", "cpu": "x64" }, "sha512-SWLSFulX9TDuH6yvbPYp4+VNn6jkkIvvI+KiujDM5rWBRHEfkesCC/pCneIIUr6ovkxZ5fRtpi2v5Cz5FrMJZg=="],
|
|
109
109
|
|
|
110
|
-
"@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.
|
|
110
|
+
"@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.82.0", "", { "os": "none", "cpu": "arm64" }, "sha512-BQy35f6ZUdNr9a6c7B7orxQTcLjByGT2z3WAgmRovpRwmPYAaJ+NTplmMzhdjdJ4qSchfMNZy/Ukg+qRg6zseQ=="],
|
|
111
111
|
|
|
112
|
-
"@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.
|
|
112
|
+
"@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.82.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-V4QhSTg5gctZue8RJjsGi7NpQPThr/p1/HfmiMC5kfe1KFEup9SQRVub4A6kijQjdHfxj7bLL1KO3QO7/5bwMQ=="],
|
|
113
113
|
|
|
114
|
-
"@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.
|
|
114
|
+
"@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.82.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-TUSCLaKB2yktpFAJ/r3HAUYsaV/3DT7JS4iNKyoh3a9YNwD0UG7Ezh4D8m23654vQcU6P/RQrCAjRPKe4peP/A=="],
|
|
115
115
|
|
|
116
|
-
"@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.
|
|
116
|
+
"@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.82.0", "", { "os": "win32", "cpu": "x64" }, "sha512-VTVoRIWJTb+wvUX8EYoPArfFH02whuR10goFXE/LHRRX33ajRrFgqbcONXZMiF4C5rnattfkm87HqYn8jb8hmQ=="],
|
|
117
117
|
|
|
118
|
-
"@types/bun": ["@types/bun@1.4.
|
|
118
|
+
"@types/bun": ["@types/bun@1.4.2", "", { "dependencies": { "bun-types": "1.4.2" } }, "sha512-GimotNn7+ZV0uVArItBbriZsR1oNf0+WTzPkdcFrzShI7k2norL0uzEaJT8T33dWr7O/c9ZDuAFQrctKCi72oQ=="],
|
|
119
119
|
|
|
120
120
|
"@types/hast": ["@types/hast@3.0.5", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],
|
|
121
121
|
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
|
|
164
164
|
"@typescript/typescript-win32-x64": ["@typescript/typescript-win32-x64@7.0.2", "", { "os": "win32", "cpu": "x64" }, "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g=="],
|
|
165
165
|
|
|
166
|
-
"bun-types": ["bun-types@1.4.
|
|
166
|
+
"bun-types": ["bun-types@1.4.2", "", { "dependencies": { "@types/node": "*" } }, "sha512-bxV1FgK7yBIzjRe5zBozIM4Bem11ZJcCXSrjWRG3YWLt8yFDePu4cLjpebO8OvPeIE9trbyPF4fuj3Cia4Fj3w=="],
|
|
167
167
|
|
|
168
168
|
"chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="],
|
|
169
169
|
|
|
@@ -183,9 +183,9 @@
|
|
|
183
183
|
|
|
184
184
|
"lowlight": ["lowlight@3.1.0", "", { "dependencies": { "@types/hast": "^3.0.0", "devlop": "^1.0.0", "highlight.js": "~11.9.0" } }, "sha512-CEbNVoSikAxwDMDPjXlqlFYiZLkDJHwyGu/MfOsJnF3d7f3tds5J3z8s/l9TMXhzfsJCCJEAsD78842mwmg0PQ=="],
|
|
185
185
|
|
|
186
|
-
"oxfmt": ["oxfmt@0.
|
|
186
|
+
"oxfmt": ["oxfmt@0.67.0", "", { "dependencies": { "tinypool": "2.1.2" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.67.0", "@oxfmt/binding-android-arm64": "0.67.0", "@oxfmt/binding-darwin-arm64": "0.67.0", "@oxfmt/binding-darwin-x64": "0.67.0", "@oxfmt/binding-freebsd-x64": "0.67.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.67.0", "@oxfmt/binding-linux-arm-musleabihf": "0.67.0", "@oxfmt/binding-linux-arm64-gnu": "0.67.0", "@oxfmt/binding-linux-arm64-musl": "0.67.0", "@oxfmt/binding-linux-ppc64-gnu": "0.67.0", "@oxfmt/binding-linux-riscv64-gnu": "0.67.0", "@oxfmt/binding-linux-riscv64-musl": "0.67.0", "@oxfmt/binding-linux-s390x-gnu": "0.67.0", "@oxfmt/binding-linux-x64-gnu": "0.67.0", "@oxfmt/binding-linux-x64-musl": "0.67.0", "@oxfmt/binding-openharmony-arm64": "0.67.0", "@oxfmt/binding-win32-arm64-msvc": "0.67.0", "@oxfmt/binding-win32-ia32-msvc": "0.67.0", "@oxfmt/binding-win32-x64-msvc": "0.67.0" }, "peerDependencies": { "svelte": "^5.0.0", "vite-plus": "*" }, "optionalPeers": ["svelte", "vite-plus"], "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-vV7sSiPsaO0mSxdoUdayipVDFPzW/UQ+hrezEHa20+Tx1dnMdZLSRHMT0PdS67FFbhd74M1n08asW21aLGeCrA=="],
|
|
187
187
|
|
|
188
|
-
"oxlint": ["oxlint@1.
|
|
188
|
+
"oxlint": ["oxlint@1.82.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.82.0", "@oxlint/binding-android-arm64": "1.82.0", "@oxlint/binding-darwin-arm64": "1.82.0", "@oxlint/binding-darwin-x64": "1.82.0", "@oxlint/binding-freebsd-x64": "1.82.0", "@oxlint/binding-linux-arm-gnueabihf": "1.82.0", "@oxlint/binding-linux-arm-musleabihf": "1.82.0", "@oxlint/binding-linux-arm64-gnu": "1.82.0", "@oxlint/binding-linux-arm64-musl": "1.82.0", "@oxlint/binding-linux-ppc64-gnu": "1.82.0", "@oxlint/binding-linux-riscv64-gnu": "1.82.0", "@oxlint/binding-linux-riscv64-musl": "1.82.0", "@oxlint/binding-linux-s390x-gnu": "1.82.0", "@oxlint/binding-linux-x64-gnu": "1.82.0", "@oxlint/binding-linux-x64-musl": "1.82.0", "@oxlint/binding-openharmony-arm64": "1.82.0", "@oxlint/binding-win32-arm64-msvc": "1.82.0", "@oxlint/binding-win32-ia32-msvc": "1.82.0", "@oxlint/binding-win32-x64-msvc": "1.82.0" }, "peerDependencies": { "oxlint-tsgolint": ">=7.0.2001", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-+iFM1BGw1ntYJt3QngbJmjbrGxPaKMUADOXOijpWGnYcBPq8YZnQftSS1C+pVcDYy9YxqDVJKQqQkTazTQMboQ=="],
|
|
189
189
|
|
|
190
190
|
"prettier": ["prettier@3.9.6", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g=="],
|
|
191
191
|
|
|
@@ -195,13 +195,13 @@
|
|
|
195
195
|
|
|
196
196
|
"supports-terminal-graphics": ["supports-terminal-graphics@0.1.0", "", {}, "sha512-+KdfozhS0Fw8y5Sghw8kkZNGT8nWYzJ1EzcoIvVjxhl+26TJTs26y02yfBgvc1jh5AS/c8jcI3xtahhR95KRyQ=="],
|
|
197
197
|
|
|
198
|
-
"tinypool": ["tinypool@2.1.
|
|
198
|
+
"tinypool": ["tinypool@2.1.2", "", {}, "sha512-9YodfrxS9g9IbFr/KOjE5bAeJ0p61n3bW6mqvy0jtoeKd1kTW1Cxm0oulm6KX2lyM9Gl6WIe8nEbY7LWv5ZJww=="],
|
|
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
202
|
"undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
|
|
203
203
|
|
|
204
|
-
"zod": ["zod@4.
|
|
204
|
+
"zod": ["zod@4.6.1", "", {}, "sha512-341aRWQsve0rvronKNTqZpjmzdbUDlFuzHaI/XLg/Ej82qffDJRRfBTCuv7+9q/rMjB6LSLyEBnW4InJeMtt/Q=="],
|
|
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.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Example CLI using https://github.com/flowscripter/pluggable-io-framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@flowscripter/dynamic-cli-framework": "^5.4.
|
|
24
|
+
"@flowscripter/dynamic-cli-framework": "^5.4.8",
|
|
25
25
|
"@flowscripter/dynamic-cli-framework-api": "^2.3.4",
|
|
26
|
-
"@flowscripter/dynamic-plugin-framework": "^2.2.
|
|
27
|
-
"@flowscripter/flowscripter-io-cli-hash-native": "^1.0.
|
|
28
|
-
"@flowscripter/pluggable-io-framework": "^1.1.
|
|
29
|
-
"@flowscripter/pluggable-io-framework-api": "^1.0.
|
|
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"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@flowscripter/io-plugin-filesystem": "^1.0.
|
|
33
|
-
"@types/bun": "^1.4.
|
|
32
|
+
"@flowscripter/io-plugin-filesystem": "^1.0.6",
|
|
33
|
+
"@types/bun": "^1.4.2",
|
|
34
34
|
"@types/node": "^26.4.1",
|
|
35
|
-
"oxfmt": "0.
|
|
36
|
-
"oxlint": "1.
|
|
35
|
+
"oxfmt": "0.67.0",
|
|
36
|
+
"oxlint": "1.82.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"typescript": "^7.0.2"
|
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",
|
package/src/commands/copy.ts
CHANGED
|
@@ -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
|
}
|
package/src/commands/delete.ts
CHANGED
|
@@ -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
|
}
|
package/src/commands/hash.ts
CHANGED
package/src/commands/move.ts
CHANGED
|
@@ -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
|
}
|
package/tests/commands_test.ts
CHANGED
|
@@ -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();
|
package/tests/testContext.ts
CHANGED
|
@@ -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
|
}
|