@flowscripter/flowscripter-io-cli 3.0.6 → 3.0.8

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/bun.lock CHANGED
@@ -5,16 +5,16 @@
5
5
  "": {
6
6
  "name": "@flowscripter/flowscripter-io-cli",
7
7
  "dependencies": {
8
- "@flowscripter/dynamic-cli-framework": "^11.0.0",
9
- "@flowscripter/dynamic-cli-framework-api": "^5.0.2",
10
- "@flowscripter/dynamic-plugin-framework": "^2.2.25",
11
- "@flowscripter/flowscripter-io-cli-hash-native": "^1.0.18",
12
- "@flowscripter/pluggable-io-framework": "^2.1.2",
13
- "@flowscripter/pluggable-io-framework-api": "^3.1.3",
8
+ "@flowscripter/dynamic-cli-framework": "^11.1.0",
9
+ "@flowscripter/dynamic-cli-framework-api": "^5.1.1",
10
+ "@flowscripter/dynamic-plugin-framework": "^2.3.0",
11
+ "@flowscripter/flowscripter-io-cli-hash-native": "^2.0.1",
12
+ "@flowscripter/pluggable-io-framework": "^2.1.6",
13
+ "@flowscripter/pluggable-io-framework-api": "^3.1.4",
14
14
  "zod": "^4.6.7",
15
15
  },
16
16
  "devDependencies": {
17
- "@flowscripter/io-plugin-filesystem": "^2.0.3",
17
+ "@flowscripter/io-plugin-filesystem": "^2.0.5",
18
18
  "@types/bun": "^1.4.3",
19
19
  "@types/node": "^26.6.5",
20
20
  "oxfmt": "0.73.0",
@@ -26,19 +26,19 @@
26
26
  },
27
27
  },
28
28
  "packages": {
29
- "@flowscripter/dynamic-cli-framework": ["@flowscripter/dynamic-cli-framework@11.0.0", "", { "dependencies": { "@flowscripter/dynamic-cli-framework-api": "^5.0.2", "@flowscripter/dynamic-plugin-framework": "^2.2.22", "emphasize": "^7.0.0", "fastest-levenshtein": "^1.0.16", "figlet": "^1.12.0", "highlight.js": "^11.12.0", "prettier": "^3.9.10", "semver": "^7.8.5", "supports-color": "^11.0.0", "supports-terminal-graphics": "^0.1.0" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-gNNR5xmHM18CmnNGPIqScypxZkMXRoPqRDhJSPOxYdkrT+fXepXs4Hj+XOCY8Fxyx11kywEtd7+eFdGz/MYQ1Q=="],
29
+ "@flowscripter/dynamic-cli-framework": ["@flowscripter/dynamic-cli-framework@11.1.0", "", { "dependencies": { "@flowscripter/dynamic-cli-framework-api": "^5.1.0", "@flowscripter/dynamic-plugin-framework": "^2.2.22", "emphasize": "^7.0.0", "fastest-levenshtein": "^1.0.16", "figlet": "^1.12.0", "highlight.js": "^11.12.0", "prettier": "^3.9.10", "semver": "^7.8.5", "supports-color": "^11.0.0", "supports-terminal-graphics": "^0.1.0" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-qQjbH8l/wa9zZa9ZSsXqvXs0nBt9KcEVLjE7NxTvt3+KtsrIt5l0Wq+v74j2BZXhV09RYPS03cbzQvJzPQfwfA=="],
30
30
 
31
- "@flowscripter/dynamic-cli-framework-api": ["@flowscripter/dynamic-cli-framework-api@5.0.2", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-e5eUP/6S9KTY6Va0mhe/UmIrt0W9k5KDnugvhiQxlGbqcGnzuwjhHvmXdeYSjHTaUSxcj8YTWvDIsj7m2P1c1w=="],
31
+ "@flowscripter/dynamic-cli-framework-api": ["@flowscripter/dynamic-cli-framework-api@5.1.1", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-aazJEwk81ip5miHsE4YgR2pg5YlbCqKycoDGLsABO2yJpGPsmZLfYldkv7ZIqsc815NAY0pM6brBE6lqPxdI1w=="],
32
32
 
33
- "@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@2.2.25", "", { "dependencies": { "semver": "^7.8.5" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-12bvEep1XsbTS2kFwhd5veLUFU6pQxgKqOT4x8K8j/aS/uBzGMoeLgiHh+9kp8BpfJmwnPLQrFPj7/ffdPxZPw=="],
33
+ "@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@2.3.0", "", { "dependencies": { "semver": "^7.8.5" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-zKgUf08rCXQf9bcYWl7vRO5oxrCNJ1fJeqZwZ6S4msYsRgWqX4zanUse0XQ3cNQL9ASC6UZ3mAPfU623Frxk1g=="],
34
34
 
35
- "@flowscripter/flowscripter-io-cli-hash-native": ["@flowscripter/flowscripter-io-cli-hash-native@1.0.18", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-r726UVFwuyawFoRvCEl+zcdnZKhxydw0eUVk4yYSZXjTtc/evVj3LvP0PSQits3aHbcj4k/UD0sH1MliMoWyyw=="],
35
+ "@flowscripter/flowscripter-io-cli-hash-native": ["@flowscripter/flowscripter-io-cli-hash-native@2.0.1", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-uaUioWn4Qf6L++HAROpRbWolAa2IT7dvvsBQjsZ/SCIj0yLrUaw75lTZeHbKqDYt1ePdVWIkHVZjHZ3Lgev8+A=="],
36
36
 
37
- "@flowscripter/io-plugin-filesystem": ["@flowscripter/io-plugin-filesystem@2.0.3", "", { "dependencies": { "@flowscripter/pluggable-io-framework-api": "^3.1.2", "zod": "^4.6.6" }, "peerDependencies": { "@flowscripter/dynamic-plugin-framework": "*", "typescript": "^7.0.2" } }, "sha512-RYYXfy3t7Nt0w3b+BmxIn1CdsyMh6z/3BoCTFLqkhMSe+3tcQs+jLnZp1f456FQKR3hq5dS4MxAalaepfdy4fg=="],
37
+ "@flowscripter/io-plugin-filesystem": ["@flowscripter/io-plugin-filesystem@2.0.5", "", { "dependencies": { "@flowscripter/pluggable-io-framework-api": "^3.1.3", "zod": "^4.6.7" }, "peerDependencies": { "@flowscripter/dynamic-plugin-framework": "*", "typescript": "^7.0.2" } }, "sha512-SfKvAfr4kDT9Z09sI4N7lUpwFo8EeqquLQmCPNs7LlW9hmLLIUatiRWtxoO4MhUMvjIfKFQHZl9Y8DgTzuNe0Q=="],
38
38
 
39
- "@flowscripter/pluggable-io-framework": ["@flowscripter/pluggable-io-framework@2.1.2", "", { "dependencies": { "@flowscripter/dynamic-plugin-framework": "^2.2.22", "@flowscripter/pluggable-io-framework-api": "^3.1.3" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-95YoKYQPFYC2DLA5IaZ5tlFjB4Ev+Ww+7jZ3UPrMhHDvQC8KVo5IBim0w0Xy6+qlUyQqHSXgRExjCatoworrbA=="],
39
+ "@flowscripter/pluggable-io-framework": ["@flowscripter/pluggable-io-framework@2.1.6", "", { "dependencies": { "@flowscripter/dynamic-plugin-framework": "^2.3.0", "@flowscripter/pluggable-io-framework-api": "^3.1.4" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-eARHU13uXeGp8OWDH5uRwHOwhm5SUk11HLA3m0t5/RKw8B69b5It7OjRgQ5vXqR7YButTvBNPTsyprasNqt8aA=="],
40
40
 
41
- "@flowscripter/pluggable-io-framework-api": ["@flowscripter/pluggable-io-framework-api@3.1.3", "", { "dependencies": { "zod": "^4.6.7", "zod-to-json-schema": "^3.25.2" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-rmyPJd7O/bbSRqwrfxmsVDyjTHwxb4VDaqpbqrIwj8+t/g8hPoxcuUGfLZnYBaIMIMN2QN3IZkQN84IEBHSQOQ=="],
41
+ "@flowscripter/pluggable-io-framework-api": ["@flowscripter/pluggable-io-framework-api@3.1.4", "", { "dependencies": { "zod": "^4.6.7", "zod-to-json-schema": "^3.25.2" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-r75MFp3bs+qPHSPTTlINt942+XJMdrkJUfsJ2o9k3nW6HjihTL0z8O8QZah8oX9eNBnOXyM+863uRZ16vhJtxw=="],
42
42
 
43
43
  "@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.73.0", "", { "os": "android", "cpu": "arm" }, "sha512-dhunAdMbi/4o0Y66/+Wl6rpsNqpvE4i26Qw6bB77A97L2lJoktWg6m+X9QOon8iOEEqzD9rEZqFi5uZ4oIzhCA=="],
44
44
 
@@ -206,6 +206,8 @@
206
206
 
207
207
  "zod-to-json-schema": ["zod-to-json-schema@3.25.2", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="],
208
208
 
209
+ "bun-types/undici-types": ["undici-types@8.12.2", "", {}, "sha512-VoMeD2O0KdHhcn+oPqOrpivN+7aDOklVSwOLD7JNjbzV1CboAFek9IFOXnreoufTUtAsCsOK0iETiERPNR/fDA=="],
210
+
209
211
  "emphasize/highlight.js": ["highlight.js@11.9.0", "", {}, "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw=="],
210
212
 
211
213
  "lowlight/highlight.js": ["highlight.js@11.9.0", "", {}, "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw=="],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/flowscripter-io-cli",
3
- "version": "3.0.6",
3
+ "version": "3.0.8",
4
4
  "description": "CLI for https://github.com/flowscripter/pluggable-io-framework",
5
5
  "keywords": [
6
6
  "bun",
@@ -21,16 +21,16 @@
21
21
  "access": "public"
22
22
  },
23
23
  "dependencies": {
24
- "@flowscripter/dynamic-cli-framework": "^11.0.0",
25
- "@flowscripter/dynamic-cli-framework-api": "^5.0.2",
26
- "@flowscripter/dynamic-plugin-framework": "^2.2.25",
27
- "@flowscripter/flowscripter-io-cli-hash-native": "^1.0.18",
28
- "@flowscripter/pluggable-io-framework": "^2.1.2",
29
- "@flowscripter/pluggable-io-framework-api": "^3.1.3",
24
+ "@flowscripter/dynamic-cli-framework": "^11.1.0",
25
+ "@flowscripter/dynamic-cli-framework-api": "^5.1.1",
26
+ "@flowscripter/dynamic-plugin-framework": "^2.3.0",
27
+ "@flowscripter/flowscripter-io-cli-hash-native": "^2.0.1",
28
+ "@flowscripter/pluggable-io-framework": "^2.1.6",
29
+ "@flowscripter/pluggable-io-framework-api": "^3.1.4",
30
30
  "zod": "^4.6.7"
31
31
  },
32
32
  "devDependencies": {
33
- "@flowscripter/io-plugin-filesystem": "^2.0.3",
33
+ "@flowscripter/io-plugin-filesystem": "^2.0.5",
34
34
  "@types/bun": "^1.4.3",
35
35
  "@types/node": "^26.6.5",
36
36
  "oxfmt": "0.73.0",
@@ -11,7 +11,7 @@ import {
11
11
  } from "@flowscripter/dynamic-cli-framework";
12
12
  import type { ProviderRegistry } from "@flowscripter/pluggable-io-framework";
13
13
  import { type Item, PayloadKind } from "@flowscripter/pluggable-io-framework-api";
14
- import { Sha256Hasher } from "@flowscripter/flowscripter-io-cli-hash-native";
14
+ import { initNativeLib, Sha256Hasher } from "@flowscripter/flowscripter-io-cli-hash-native";
15
15
  import { createByteScale } from "../util/byteScale.ts";
16
16
  import { createLocationOption } from "../util/location/createLocationOption.ts";
17
17
  import { toStructuredLocation } from "../util/location/toStructuredLocation.ts";
@@ -112,6 +112,7 @@ async function hashWithNativeSha256(
112
112
  reader: ReadableStreamDefaultReader<Item>,
113
113
  onChunk: (chunkLength: number) => void,
114
114
  ): Promise<string> {
115
+ await initNativeLib();
115
116
  const hasher = new Sha256Hasher();
116
117
  for (;;) {
117
118
  const { done, value } = await reader.read();
@@ -0,0 +1,23 @@
1
+ import { expect, test } from "bun:test";
2
+ import { existsSync, mkdtempSync, rmSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+
6
+ test("importing the hash command does not resolve or download the native library", async () => {
7
+ const home = mkdtempSync(join(tmpdir(), "hash-lazy-load-"));
8
+ try {
9
+ const hashModule = join(import.meta.dir, "../../src/commands/hash.ts");
10
+ const proc = Bun.spawn(
11
+ [process.execPath, "--eval", "await import(process.argv[1])", hashModule],
12
+ {
13
+ env: { ...process.env, HOME: home, USERPROFILE: home },
14
+ stdout: "pipe",
15
+ stderr: "pipe",
16
+ },
17
+ );
18
+ expect(await proc.exited).toBe(0);
19
+ expect(existsSync(join(home, ".flowscripter"))).toBe(false);
20
+ } finally {
21
+ rmSync(home, { recursive: true, force: true });
22
+ }
23
+ });
@@ -3,6 +3,7 @@ import { mkdtemp, rm, stat, writeFile } from "node:fs/promises";
3
3
  import { tmpdir } from "node:os";
4
4
  import { join } from "node:path";
5
5
  import { Icon } from "@flowscripter/dynamic-cli-framework";
6
+ import type { ValidationContext } from "@flowscripter/dynamic-cli-framework-api";
6
7
  import type { ProviderRegistry } from "@flowscripter/pluggable-io-framework";
7
8
  import { fileLocation, installFilesystemPlugin } from "../fixtures/pluginStore.ts";
8
9
  import { createStubContext } from "../fixtures/testContext.ts";
@@ -28,6 +29,8 @@ afterEach(async () => {
28
29
  await rm(root, { recursive: true, force: true });
29
30
  });
30
31
 
32
+ const validationContext = {} as ValidationContext;
33
+
31
34
  describe("set-properties", () => {
32
35
  test("applies the protocol's properties and last-modified, with a spinner", async () => {
33
36
  await writeFile(join(root, "a.txt"), "hello");
@@ -62,7 +65,9 @@ describe("set-properties", () => {
62
65
  test("validates --last-modified", () => {
63
66
  const command = createSetPropertiesCommand(registry);
64
67
  const lastModified = command.options.find((option) => option.name === "last-modified");
65
- expect(lastModified?.validate?.("not a date")).toBe("must be an ISO 8601 date");
66
- expect(lastModified?.validate?.("2020-01-02")).toBeUndefined();
68
+ expect(lastModified?.validate?.("not a date", validationContext)).toBe(
69
+ "must be an ISO 8601 date",
70
+ );
71
+ expect(lastModified?.validate?.("2020-01-02", validationContext)).toBeUndefined();
67
72
  });
68
73
  });
@@ -75,6 +75,7 @@ export function createStubContext(): StubPrinter {
75
75
 
76
76
  const context: Context = {
77
77
  cliConfig: { name: "test", version: "0.0.0" },
78
+ isTty: { stdin: false, stdout: false, stderr: false },
78
79
  getServiceById: (id: string) => services[id],
79
80
  doesServiceExist: (id: string) => id in services,
80
81
  };
@@ -2,6 +2,7 @@ import { describe, expect, test } from "bun:test";
2
2
  import { ComplexValueTypeName, ValueTypeName } from "@flowscripter/dynamic-cli-framework";
3
3
  import type { ProviderRegistry } from "@flowscripter/pluggable-io-framework";
4
4
  import type { IOProviderFactory } from "@flowscripter/pluggable-io-framework-api";
5
+ import type { ValidationContext } from "@flowscripter/dynamic-cli-framework-api";
5
6
  import { z } from "zod";
6
7
  import { createLocationOption } from "../../../src/util/location/createLocationOption.ts";
7
8
 
@@ -20,6 +21,8 @@ const registry = {
20
21
  getFactory: (protocol: string) => factories[protocol],
21
22
  } as unknown as ProviderRegistry;
22
23
 
24
+ const validationContext = {} as ValidationContext;
25
+
23
26
  describe("createLocationOption", () => {
24
27
  test("has a protocol property and one optional group per protocol", () => {
25
28
  const option = createLocationOption(registry, "source", "Source location");
@@ -63,11 +66,13 @@ describe("createLocationOption", () => {
63
66
  test("validates the selected protocol's group against its location schema", () => {
64
67
  const { validate } = createLocationOption(registry, "source", "Source location");
65
68
 
66
- expect(validate?.({ protocol: "file" })).toBeUndefined();
67
- expect(validate?.({ protocol: "s3", s3: { bucket: "b" } })).toBeUndefined();
68
- expect(validate?.({ protocol: "s3", file: { path: "/" } })).toStartWith(
69
+ expect(validate?.({ protocol: "file" }, validationContext)).toBeUndefined();
70
+ expect(validate?.({ protocol: "s3", s3: { bucket: "b" } }, validationContext)).toBeUndefined();
71
+ expect(validate?.({ protocol: "s3", file: { path: "/" } }, validationContext)).toStartWith(
69
72
  "Invalid s3 location: bucket:",
70
73
  );
71
- expect(validate?.({ protocol: "ftp" })).toBe('No provider installed for protocol "ftp"');
74
+ expect(validate?.({ protocol: "ftp" }, validationContext)).toBe(
75
+ 'No provider installed for protocol "ftp"',
76
+ );
72
77
  });
73
78
  });