@powerlines/engine 0.46.6 → 0.47.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/api.cjs +18 -18
- package/dist/api.d.mts +1 -1
- package/dist/api.mjs +16 -16
- package/dist/{base-context-CbFlRUd-.cjs → base-context-DLemGRbd.cjs} +12 -12
- package/dist/{base-context-Ce9PuQ9z.mjs → base-context-DUha4Lz-.mjs} +17 -17
- package/dist/{base-context-Ce9PuQ9z.mjs.map → base-context-DUha4Lz-.mjs.map} +1 -1
- package/dist/context/index.cjs +3 -3
- package/dist/context/index.d.mts +1 -1
- package/dist/context/index.mjs +3 -3
- package/dist/{engine-context-CEbC9dHR.mjs → engine-context-BfFiKN53.mjs} +3 -3
- package/dist/{engine-context-CEbC9dHR.mjs.map → engine-context-BfFiKN53.mjs.map} +1 -1
- package/dist/{engine-context-D-rpz-J2.cjs → engine-context-D0y88i_J.cjs} +2 -2
- package/dist/{execution-context-DUtt6PWE.mjs → execution-context-CE5H90Um.mjs} +51 -50
- package/dist/execution-context-CE5H90Um.mjs.map +1 -0
- package/dist/{execution-context-9aXwcpL6.cjs → execution-context-CnyaM3Ul.cjs} +33 -32
- package/dist/{execution-context-Da_wozne.d.mts → execution-context-YrjFeD9k.d.mts} +1 -1
- package/dist/{execution-context-Da_wozne.d.mts.map → execution-context-YrjFeD9k.d.mts.map} +1 -1
- package/dist/{fs-D1nIP45P.mjs → fs-Dcle8lUp.mjs} +1 -1
- package/dist/{fs-D1nIP45P.mjs.map → fs-Dcle8lUp.mjs.map} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +5 -5
- package/dist/rpc/client.cjs +74 -0
- package/dist/rpc/client.d.cts +31 -0
- package/dist/rpc/client.d.cts.map +1 -0
- package/dist/rpc/client.d.mts +31 -0
- package/dist/rpc/client.d.mts.map +1 -0
- package/dist/rpc/client.mjs +71 -0
- package/dist/rpc/client.mjs.map +1 -0
- package/dist/rpc/serialization.cjs +82 -0
- package/dist/rpc/serialization.d.cts +46 -0
- package/dist/rpc/serialization.d.cts.map +1 -0
- package/dist/rpc/serialization.d.mts +46 -0
- package/dist/rpc/serialization.d.mts.map +1 -0
- package/dist/rpc/serialization.mjs +76 -0
- package/dist/rpc/serialization.mjs.map +1 -0
- package/dist/rpc/server.cjs +69 -0
- package/dist/rpc/server.d.cts +29 -0
- package/dist/rpc/server.d.cts.map +1 -0
- package/dist/rpc/server.d.mts +29 -0
- package/dist/rpc/server.d.mts.map +1 -0
- package/dist/rpc/server.mjs +66 -0
- package/dist/rpc/server.mjs.map +1 -0
- package/dist/rpc/types.cjs +0 -0
- package/dist/rpc/types.d.cts +70 -0
- package/dist/rpc/types.d.cts.map +1 -0
- package/dist/rpc/types.d.mts +70 -0
- package/dist/rpc/types.d.mts.map +1 -0
- package/dist/rpc/types.mjs +1 -0
- package/dist/schemas.cjs +1 -1
- package/dist/schemas.mjs +1 -1
- package/dist/storage/base.cjs +216 -0
- package/dist/storage/base.d.cts +199 -0
- package/dist/storage/base.d.cts.map +1 -0
- package/dist/storage/base.d.mts +199 -0
- package/dist/storage/base.d.mts.map +1 -0
- package/dist/storage/base.mjs +215 -0
- package/dist/storage/base.mjs.map +1 -0
- package/dist/storage/file-system.cjs +180 -0
- package/dist/storage/file-system.d.cts +127 -0
- package/dist/storage/file-system.d.cts.map +1 -0
- package/dist/storage/file-system.d.mts +127 -0
- package/dist/storage/file-system.d.mts.map +1 -0
- package/dist/storage/file-system.mjs +179 -0
- package/dist/storage/file-system.mjs.map +1 -0
- package/dist/storage/helpers.cjs +37 -0
- package/dist/storage/helpers.d.cts +25 -0
- package/dist/storage/helpers.d.cts.map +1 -0
- package/dist/storage/helpers.d.mts +25 -0
- package/dist/storage/helpers.d.mts.map +1 -0
- package/dist/storage/helpers.mjs +34 -0
- package/dist/storage/helpers.mjs.map +1 -0
- package/dist/storage/index.cjs +10 -7
- package/dist/storage/index.d.cts +5 -419
- package/dist/storage/index.d.mts +5 -419
- package/dist/storage/index.mjs +4 -1
- package/dist/storage/virtual.cjs +98 -0
- package/dist/storage/virtual.d.cts +80 -0
- package/dist/storage/virtual.d.cts.map +1 -0
- package/dist/storage/virtual.d.mts +80 -0
- package/dist/storage/virtual.d.mts.map +1 -0
- package/dist/storage/virtual.mjs +97 -0
- package/dist/storage/virtual.mjs.map +1 -0
- package/dist/{ts-morph-D0CaA37w.mjs → ts-morph-C6YBNc46.mjs} +1 -1
- package/dist/{ts-morph-D0CaA37w.mjs.map → ts-morph-C6YBNc46.mjs.map} +1 -1
- package/dist/{tsconfig-BUDqmOaT.cjs → tsconfig-DeKMGasE.cjs} +2 -2
- package/dist/{tsconfig-MeFEs21S.mjs → tsconfig-HzJsMUrr.mjs} +3 -3
- package/dist/{tsconfig-MeFEs21S.mjs.map → tsconfig-HzJsMUrr.mjs.map} +1 -1
- package/dist/typescript/index.cjs +2 -2
- package/dist/typescript/index.mjs +2 -2
- package/package.json +5 -4
- package/dist/execution-context-DUtt6PWE.mjs.map +0 -1
- package/dist/storage/index.d.cts.map +0 -1
- package/dist/storage/index.d.mts.map +0 -1
- package/dist/virtual-CYGZHTDd.mjs +0 -513
- package/dist/virtual-CYGZHTDd.mjs.map +0 -1
- package/dist/virtual-Ct3ZqPeN.cjs +0 -548
- /package/dist/{fs-XogSgMqT.cjs → fs-CeEdzPKE.cjs} +0 -0
- /package/dist/{ts-morph-BaLPVAdB.cjs → ts-morph-BbM83PT9.cjs} +0 -0
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-C0xms8kb.cjs');
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const require_tsconfig = require('./tsconfig-
|
|
6
|
-
|
|
7
|
-
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
8
|
-
let _stryke_fs_resolve = require("@stryke/fs/resolve");
|
|
9
|
-
let _stryke_path_join = require("@stryke/path/join");
|
|
10
|
-
let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
|
|
11
|
-
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
12
|
-
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
13
|
-
let jest_worker = require("jest-worker");
|
|
14
|
-
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
2
|
+
const require_fs = require('./fs-CeEdzPKE.cjs');
|
|
3
|
+
const require_storage_file_system = require('./storage/file-system.cjs');
|
|
4
|
+
const require_storage_virtual = require('./storage/virtual.cjs');
|
|
5
|
+
const require_tsconfig = require('./tsconfig-DeKMGasE.cjs');
|
|
6
|
+
const require_base_context = require('./base-context-DLemGRbd.cjs');
|
|
15
7
|
let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
|
|
8
|
+
let _powerlines_core_lib_utilities_format = require("@powerlines/core/lib/utilities/format");
|
|
16
9
|
let _powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
|
|
17
10
|
let _powerlines_core_plugin_utils_logging = require("@powerlines/core/plugin-utils/logging");
|
|
18
|
-
let
|
|
19
|
-
let _stryke_path_append = require("@stryke/path/append");
|
|
20
|
-
let _stryke_path_replace = require("@stryke/path/replace");
|
|
21
|
-
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
22
|
-
let chalk = require("chalk");
|
|
23
|
-
chalk = require_chunk.__toESM(chalk, 1);
|
|
24
|
-
let defu = require("defu");
|
|
25
|
-
defu = require_chunk.__toESM(defu, 1);
|
|
26
|
-
let node_fs = require("node:fs");
|
|
27
|
-
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
28
|
-
let _powerlines_core_lib_utilities_format = require("@powerlines/core/lib/utilities/format");
|
|
11
|
+
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
29
12
|
let _stryke_fs_exists = require("@stryke/fs/exists");
|
|
13
|
+
let _stryke_fs_resolve = require("@stryke/fs/resolve");
|
|
30
14
|
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
31
15
|
let _stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
16
|
+
let _stryke_path_append = require("@stryke/path/append");
|
|
32
17
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
33
18
|
let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
19
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
20
|
+
let _stryke_path_replace = require("@stryke/path/replace");
|
|
34
21
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
35
22
|
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
36
23
|
let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
|
|
24
|
+
let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
|
|
25
|
+
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
26
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
27
|
+
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
28
|
+
let chalk = require("chalk");
|
|
29
|
+
chalk = require_chunk.__toESM(chalk, 1);
|
|
30
|
+
let defu = require("defu");
|
|
31
|
+
defu = require_chunk.__toESM(defu, 1);
|
|
32
|
+
let _powerlines_core_constants = require("@powerlines/core/constants");
|
|
37
33
|
let _stryke_fs_json = require("@stryke/fs/json");
|
|
38
34
|
let _stryke_helpers_deep_clone = require("@stryke/helpers/deep-clone");
|
|
35
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
39
36
|
let _powerlines_core_lib_entry = require("@powerlines/core/lib/entry");
|
|
37
|
+
let _stryke_env_get_env_paths = require("@stryke/env/get-env-paths");
|
|
40
38
|
let _stryke_fs_get_workspace_root = require("@stryke/fs/get-workspace-root");
|
|
41
39
|
let _stryke_hash = require("@stryke/hash");
|
|
42
40
|
let _stryke_hash_node = require("@stryke/hash/node");
|
|
@@ -46,9 +44,12 @@ let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined
|
|
|
46
44
|
let bundle_require = require("bundle-require");
|
|
47
45
|
let compatx = require("compatx");
|
|
48
46
|
let flat_cache = require("flat-cache");
|
|
47
|
+
let node_fs = require("node:fs");
|
|
49
48
|
let oxc_parser = require("oxc-parser");
|
|
50
49
|
let undici = require("undici");
|
|
51
50
|
require("@stryke/fs/remove-file");
|
|
51
|
+
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
52
|
+
let jest_worker = require("jest-worker");
|
|
52
53
|
let _stryke_capnp = require("@stryke/capnp");
|
|
53
54
|
_stryke_capnp = require_chunk.__toESM(_stryke_capnp, 1);
|
|
54
55
|
let _stryke_fs_buffer = require("@stryke/fs/buffer");
|
|
@@ -353,7 +354,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
353
354
|
relativeKey: path,
|
|
354
355
|
adapter: this.#storage[""]
|
|
355
356
|
};
|
|
356
|
-
this.#storage[path] = preset === "virtual" ? new
|
|
357
|
+
this.#storage[path] = preset === "virtual" ? new require_storage_virtual.VirtualStorageAdapter(this.#context, { base: path }) : new require_storage_file_system.FileSystemStorageAdapter(this.#context, { base: path });
|
|
357
358
|
return {
|
|
358
359
|
base: path,
|
|
359
360
|
relativeKey: "",
|
|
@@ -651,18 +652,18 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
651
652
|
*/
|
|
652
653
|
constructor(context, fs) {
|
|
653
654
|
this.#context = context;
|
|
654
|
-
this.#storage = { "": new
|
|
655
|
+
this.#storage = { "": new require_storage_file_system.FileSystemStorageAdapter(context) };
|
|
655
656
|
if ((0, _stryke_type_checks_is_set_object.isSetObject)(this.#context.config.output.storage)) this.#storage = {
|
|
656
657
|
...this.#storage,
|
|
657
658
|
...this.#context.config.output.storage
|
|
658
659
|
};
|
|
659
|
-
this.#storage.virtual ??= new
|
|
660
|
-
this.#storage[this.#context.config.output.path] ??= new
|
|
661
|
-
if (this.#context.config.output.copy && this.#context.config.output.copy.path) this.#storage[this.#context.config.output.copy.path] ??= new
|
|
660
|
+
this.#storage.virtual ??= new require_storage_virtual.VirtualStorageAdapter(context, { base: "/_virtual" });
|
|
661
|
+
this.#storage[this.#context.config.output.path] ??= new require_storage_file_system.FileSystemStorageAdapter(context, { base: this.#context.config.output.path });
|
|
662
|
+
if (this.#context.config.output.copy && this.#context.config.output.copy.path) this.#storage[this.#context.config.output.copy.path] ??= new require_storage_file_system.FileSystemStorageAdapter(context, { base: this.#context.config.output.copy.path });
|
|
662
663
|
if (this.#context.config.output.storage !== "fs") {
|
|
663
|
-
this.#storage[this.#context.artifactsPath] ??= new
|
|
664
|
-
this.#storage[this.#context.builtinsPath] ??= new
|
|
665
|
-
this.#storage[this.#context.entryPath] ??= new
|
|
664
|
+
this.#storage[this.#context.artifactsPath] ??= new require_storage_virtual.VirtualStorageAdapter(context, { base: this.#context.artifactsPath });
|
|
665
|
+
this.#storage[this.#context.builtinsPath] ??= new require_storage_virtual.VirtualStorageAdapter(context, { base: this.#context.builtinsPath });
|
|
666
|
+
this.#storage[this.#context.entryPath] ??= new require_storage_virtual.VirtualStorageAdapter(context, { base: this.#context.entryPath });
|
|
666
667
|
}
|
|
667
668
|
this.#metadata = {};
|
|
668
669
|
if (fs._hasMetadata()) this.#metadata = fs.metadata.values().reduce((ret, metadata) => {
|
|
@@ -644,4 +644,4 @@ declare class PowerlinesExecutionContext<TResolvedConfig extends ResolvedConfig
|
|
|
644
644
|
}
|
|
645
645
|
//#endregion
|
|
646
646
|
export { PowerlinesContext as n, PowerlinesBaseContext as r, PowerlinesExecutionContext as t };
|
|
647
|
-
//# sourceMappingURL=execution-context-
|
|
647
|
+
//# sourceMappingURL=execution-context-YrjFeD9k.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-context-
|
|
1
|
+
{"version":3,"file":"execution-context-YrjFeD9k.d.mts","names":[],"sources":["../src/context/base-context.ts","../src/context/context.ts","../src/context/execution-context.ts"],"mappings":";;;;;;;;;;;cA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AAA;EFxJ5B;;;;;EE8KM,SAAA,CAAU,MAAA,EAAQ,MAAA,CAAO,aAAA,CAAc,eAAA,KAAiB,OAAA;EFnIxC;;;;;;EEmJhB,cAAA,CAAe,IAAA,YAAa,OAAA,CAAA,kBAAA,CAAA,eAAA;EFrIrB;;;;;;EE6LP,kBAAA,CACX,IAAA,YACC,OAAA,CAAQ,kBAAA,CAAmB,eAAA;EF3KrB;;;;;;;;EE2LI,aAAA,CAAA,GAAiB,OAAA,CAAQ,kBAAA,CAAmB,eAAA;AAAA"}
|
|
@@ -223,4 +223,4 @@ FileSystem._Metadata = $.CompositeList(FileMetadata);
|
|
|
223
223
|
|
|
224
224
|
//#endregion
|
|
225
225
|
export { FileSystem as a, FileStorage as i, FileMetadata as n, _capnpFileId as o, FileMetadata_KeyValuePair as r, FileId as t };
|
|
226
|
-
//# sourceMappingURL=fs-
|
|
226
|
+
//# sourceMappingURL=fs-Dcle8lUp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-D1nIP45P.mjs","names":[],"sources":["../schemas/fs.ts"],"sourcesContent":["/* eslint-disable */\n// biome-ignore lint: disable\n// Generated by storm-capnpc\n// Note: Do not edit this file manually - it will be overwritten automatically\nimport * as $ from \"@stryke/capnp\";\nexport const _capnpFileId = BigInt(\"0xa56c61324b9d6e49\");\nexport class FileMetadata_KeyValuePair extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"KeyValuePair\",\n id: \"eabb26cf58b2a14c\",\n size: new $.ObjectSize(0, 2),\n };\n get key(): string {\n return $.utils.getText(0, this);\n }\n set key(value: string) {\n $.utils.setText(0, value, this);\n }\n get value(): string {\n return $.utils.getText(1, this);\n }\n set value(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileMetadata_KeyValuePair_\" + super.toString(); }\n}\n/**\n* The identifier for the file data.\n*\n*/\nexport class FileMetadata extends $.Struct {\n static readonly KeyValuePair = FileMetadata_KeyValuePair;\n public static override readonly _capnp = {\n displayName: \"FileMetadata\",\n id: \"8e2cab5d7e28c7b3\",\n size: new $.ObjectSize(8, 3),\n defaultType: \"normal\"\n };\n static _Properties: $.ListCtor<FileMetadata_KeyValuePair>;\n /**\n* The type of the file.\n*\n*/\n get id(): string {\n return $.utils.getText(0, this);\n }\n set id(value: string) {\n $.utils.setText(0, value, this);\n }\n /**\n* The timestamp representing the file's creation date.\n*\n*/\n get type(): string {\n return $.utils.getText(1, this, FileMetadata._capnp.defaultType);\n }\n set type(value: string) {\n $.utils.setText(1, value, this);\n }\n /**\n* Additional metadata associated with the file.\n*\n*/\n get timestamp(): number {\n return $.utils.getUint32(0, this);\n }\n set timestamp(value: number) {\n $.utils.setUint32(0, value, this);\n }\n _adoptProperties(value: $.Orphan<$.List<FileMetadata_KeyValuePair>>): void {\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownProperties(): $.Orphan<$.List<FileMetadata_KeyValuePair>> {\n return $.utils.disown(this.properties);\n }\n get properties(): $.List<FileMetadata_KeyValuePair> {\n return $.utils.getList(2, FileMetadata._Properties, this);\n }\n _hasProperties(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n _initProperties(length: number): $.List<FileMetadata_KeyValuePair> {\n return $.utils.initList(2, FileMetadata._Properties, length, this);\n }\n set properties(value: $.List<FileMetadata_KeyValuePair>) {\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"FileMetadata_\" + super.toString(); }\n}\n/**\n* An identifier for the file.\n*\n*/\nexport class FileId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileId\",\n id: \"990d6a471072f997\",\n size: new $.ObjectSize(0, 2),\n };\n /**\n* A virtual (or actual) path to the file in the file system.\n*\n*/\n get id(): string {\n return $.utils.getText(0, this);\n }\n set id(value: string) {\n $.utils.setText(0, value, this);\n }\n get path(): string {\n return $.utils.getText(1, this);\n }\n set path(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileId_\" + super.toString(); }\n}\n/**\n* An identifier for the file.\n*\n*/\nexport class FileStorage extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileStorage\",\n id: \"9dca66ac858c9ebe\",\n size: new $.ObjectSize(0, 2),\n };\n /**\n* A virtual (or actual) path to the file in the file system.\n*\n*/\n get path(): string {\n return $.utils.getText(0, this);\n }\n set path(value: string) {\n $.utils.setText(0, value, this);\n }\n get code(): string {\n return $.utils.getText(1, this);\n }\n set code(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileStorage_\" + super.toString(); }\n}\nexport class FileSystem extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileSystem\",\n id: \"ae0c23d43e56abcf\",\n size: new $.ObjectSize(0, 3),\n };\n static _Ids: $.ListCtor<FileId>;\n static _Storage: $.ListCtor<FileStorage>;\n static _Metadata: $.ListCtor<FileMetadata>;\n _adoptIds(value: $.Orphan<$.List<FileId>>): void {\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownIds(): $.Orphan<$.List<FileId>> {\n return $.utils.disown(this.ids);\n }\n get ids(): $.List<FileId> {\n return $.utils.getList(0, FileSystem._Ids, this);\n }\n _hasIds(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initIds(length: number): $.List<FileId> {\n return $.utils.initList(0, FileSystem._Ids, length, this);\n }\n set ids(value: $.List<FileId>) {\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptStorage(value: $.Orphan<$.List<FileStorage>>): void {\n $.utils.adopt(value, $.utils.getPointer(1, this));\n }\n _disownStorage(): $.Orphan<$.List<FileStorage>> {\n return $.utils.disown(this.storage);\n }\n get storage(): $.List<FileStorage> {\n return $.utils.getList(1, FileSystem._Storage, this);\n }\n _hasStorage(): boolean {\n return !$.utils.isNull($.utils.getPointer(1, this));\n }\n _initStorage(length: number): $.List<FileStorage> {\n return $.utils.initList(1, FileSystem._Storage, length, this);\n }\n set storage(value: $.List<FileStorage>) {\n $.utils.copyFrom(value, $.utils.getPointer(1, this));\n }\n _adoptMetadata(value: $.Orphan<$.List<FileMetadata>>): void {\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownMetadata(): $.Orphan<$.List<FileMetadata>> {\n return $.utils.disown(this.metadata);\n }\n get metadata(): $.List<FileMetadata> {\n return $.utils.getList(2, FileSystem._Metadata, this);\n }\n _hasMetadata(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n _initMetadata(length: number): $.List<FileMetadata> {\n return $.utils.initList(2, FileSystem._Metadata, length, this);\n }\n set metadata(value: $.List<FileMetadata>) {\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"FileSystem_\" + super.toString(); }\n}\nFileMetadata._Properties = $.CompositeList(FileMetadata_KeyValuePair);\nFileSystem._Ids = $.CompositeList(FileId);\nFileSystem._Storage = $.CompositeList(FileStorage);\nFileSystem._Metadata = $.CompositeList(FileMetadata);\n"],"mappings":";;;AAKA,MAAa,eAAe,OAAO,qBAAqB;AACxD,IAAa,4BAAb,cAA+C,EAAE,OAAO;CACtD,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAI,EAAE,WAAW,GAAG,EAAE;EAC7B;CACD,IAAI,MAAc;AAChB,SAAO,EAAE,MAAM,QAAQ,GAAG,KAAK;;CAEjC,IAAI,IAAI,OAAe;AACrB,IAAE,MAAM,QAAQ,GAAG,OAAO,KAAK;;CAEjC,IAAI,QAAgB;AAClB,SAAO,EAAE,MAAM,QAAQ,GAAG,KAAK;;CAEjC,IAAI,MAAM,OAAe;AACvB,IAAE,MAAM,QAAQ,GAAG,OAAO,KAAK;;CAEjC,AAAgB,WAAmB;AAAE,SAAO,+BAA+B,MAAM,UAAU;;;;;;;AAM7F,IAAa,eAAb,MAAa,qBAAqB,EAAE,OAAO;CACzC,OAAgB,eAAe;CAC/B,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAI,EAAE,WAAW,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Ac,OAAO;AACzC,WAAW,WAAW,EAAE,cAAc,YAAY;AAClD,WAAW,YAAY,EAAE,cAAc,aAAa"}
|
|
1
|
+
{"version":3,"file":"fs-Dcle8lUp.mjs","names":[],"sources":["../schemas/fs.ts"],"sourcesContent":["/* eslint-disable */\n// biome-ignore lint: disable\n// Generated by storm-capnpc\n// Note: Do not edit this file manually - it will be overwritten automatically\nimport * as $ from \"@stryke/capnp\";\nexport const _capnpFileId = BigInt(\"0xa56c61324b9d6e49\");\nexport class FileMetadata_KeyValuePair extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"KeyValuePair\",\n id: \"eabb26cf58b2a14c\",\n size: new $.ObjectSize(0, 2),\n };\n get key(): string {\n return $.utils.getText(0, this);\n }\n set key(value: string) {\n $.utils.setText(0, value, this);\n }\n get value(): string {\n return $.utils.getText(1, this);\n }\n set value(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileMetadata_KeyValuePair_\" + super.toString(); }\n}\n/**\n* The identifier for the file data.\n*\n*/\nexport class FileMetadata extends $.Struct {\n static readonly KeyValuePair = FileMetadata_KeyValuePair;\n public static override readonly _capnp = {\n displayName: \"FileMetadata\",\n id: \"8e2cab5d7e28c7b3\",\n size: new $.ObjectSize(8, 3),\n defaultType: \"normal\"\n };\n static _Properties: $.ListCtor<FileMetadata_KeyValuePair>;\n /**\n* The type of the file.\n*\n*/\n get id(): string {\n return $.utils.getText(0, this);\n }\n set id(value: string) {\n $.utils.setText(0, value, this);\n }\n /**\n* The timestamp representing the file's creation date.\n*\n*/\n get type(): string {\n return $.utils.getText(1, this, FileMetadata._capnp.defaultType);\n }\n set type(value: string) {\n $.utils.setText(1, value, this);\n }\n /**\n* Additional metadata associated with the file.\n*\n*/\n get timestamp(): number {\n return $.utils.getUint32(0, this);\n }\n set timestamp(value: number) {\n $.utils.setUint32(0, value, this);\n }\n _adoptProperties(value: $.Orphan<$.List<FileMetadata_KeyValuePair>>): void {\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownProperties(): $.Orphan<$.List<FileMetadata_KeyValuePair>> {\n return $.utils.disown(this.properties);\n }\n get properties(): $.List<FileMetadata_KeyValuePair> {\n return $.utils.getList(2, FileMetadata._Properties, this);\n }\n _hasProperties(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n _initProperties(length: number): $.List<FileMetadata_KeyValuePair> {\n return $.utils.initList(2, FileMetadata._Properties, length, this);\n }\n set properties(value: $.List<FileMetadata_KeyValuePair>) {\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"FileMetadata_\" + super.toString(); }\n}\n/**\n* An identifier for the file.\n*\n*/\nexport class FileId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileId\",\n id: \"990d6a471072f997\",\n size: new $.ObjectSize(0, 2),\n };\n /**\n* A virtual (or actual) path to the file in the file system.\n*\n*/\n get id(): string {\n return $.utils.getText(0, this);\n }\n set id(value: string) {\n $.utils.setText(0, value, this);\n }\n get path(): string {\n return $.utils.getText(1, this);\n }\n set path(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileId_\" + super.toString(); }\n}\n/**\n* An identifier for the file.\n*\n*/\nexport class FileStorage extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileStorage\",\n id: \"9dca66ac858c9ebe\",\n size: new $.ObjectSize(0, 2),\n };\n /**\n* A virtual (or actual) path to the file in the file system.\n*\n*/\n get path(): string {\n return $.utils.getText(0, this);\n }\n set path(value: string) {\n $.utils.setText(0, value, this);\n }\n get code(): string {\n return $.utils.getText(1, this);\n }\n set code(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileStorage_\" + super.toString(); }\n}\nexport class FileSystem extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileSystem\",\n id: \"ae0c23d43e56abcf\",\n size: new $.ObjectSize(0, 3),\n };\n static _Ids: $.ListCtor<FileId>;\n static _Storage: $.ListCtor<FileStorage>;\n static _Metadata: $.ListCtor<FileMetadata>;\n _adoptIds(value: $.Orphan<$.List<FileId>>): void {\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownIds(): $.Orphan<$.List<FileId>> {\n return $.utils.disown(this.ids);\n }\n get ids(): $.List<FileId> {\n return $.utils.getList(0, FileSystem._Ids, this);\n }\n _hasIds(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initIds(length: number): $.List<FileId> {\n return $.utils.initList(0, FileSystem._Ids, length, this);\n }\n set ids(value: $.List<FileId>) {\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptStorage(value: $.Orphan<$.List<FileStorage>>): void {\n $.utils.adopt(value, $.utils.getPointer(1, this));\n }\n _disownStorage(): $.Orphan<$.List<FileStorage>> {\n return $.utils.disown(this.storage);\n }\n get storage(): $.List<FileStorage> {\n return $.utils.getList(1, FileSystem._Storage, this);\n }\n _hasStorage(): boolean {\n return !$.utils.isNull($.utils.getPointer(1, this));\n }\n _initStorage(length: number): $.List<FileStorage> {\n return $.utils.initList(1, FileSystem._Storage, length, this);\n }\n set storage(value: $.List<FileStorage>) {\n $.utils.copyFrom(value, $.utils.getPointer(1, this));\n }\n _adoptMetadata(value: $.Orphan<$.List<FileMetadata>>): void {\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownMetadata(): $.Orphan<$.List<FileMetadata>> {\n return $.utils.disown(this.metadata);\n }\n get metadata(): $.List<FileMetadata> {\n return $.utils.getList(2, FileSystem._Metadata, this);\n }\n _hasMetadata(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n _initMetadata(length: number): $.List<FileMetadata> {\n return $.utils.initList(2, FileSystem._Metadata, length, this);\n }\n set metadata(value: $.List<FileMetadata>) {\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"FileSystem_\" + super.toString(); }\n}\nFileMetadata._Properties = $.CompositeList(FileMetadata_KeyValuePair);\nFileSystem._Ids = $.CompositeList(FileId);\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CAE/D,IAAI,QAAQ,OAA4B;AACtC,IAAE,MAAM,SAAS,OAAO,EAAE,MAAM,WAAW,GAAG,KAAK,CAAC;;CAEtD,eAAe,OAA6C;AAC1D,IAAE,MAAM,MAAM,OAAO,EAAE,MAAM,WAAW,GAAG,KAAK,CAAC;;CAEnD,kBAAkD;AAChD,SAAO,EAAE,MAAM,OAAO,KAAK,SAAS;;CAEtC,IAAI,WAAiC;AACnC,SAAO,EAAE,MAAM,QAAQ,GAAG,WAAW,WAAW,KAAK;;CAEvD,eAAwB;AACtB,SAAO,CAAC,EAAE,MAAM,OAAO,EAAE,MAAM,WAAW,GAAG,KAAK,CAAC;;CAErD,cAAc,QAAsC;AAClD,SAAO,EAAE,MAAM,SAAS,GAAG,WAAW,WAAW,QAAQ,KAAK;;CAEhE,IAAI,SAAS,OAA6B;AACxC,IAAE,MAAM,SAAS,OAAO,EAAE,MAAM,WAAW,GAAG,KAAK,CAAC;;CAEtD,AAAgB,WAAmB;AAAE,SAAO,gBAAgB,MAAM,UAAU;;;AAE9E,aAAa,cAAc,EAAE,cAAc,0BAA0B;AACrE,WAAW,OAAO,EAAE,cAAc,OAAO;AACzC,WAAW,WAAW,EAAE,cAAc,YAAY;AAClD,WAAW,YAAY,EAAE,cAAc,aAAa"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_chunk = require('./chunk-C0xms8kb.cjs');
|
|
3
|
-
const require_engine_context = require('./engine-context-
|
|
4
|
-
let _powerlines_core_constants = require("@powerlines/core/constants");
|
|
3
|
+
const require_engine_context = require('./engine-context-D0y88i_J.cjs');
|
|
5
4
|
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
6
5
|
let _stryke_fs_resolve = require("@stryke/fs/resolve");
|
|
7
|
-
let _stryke_path_join = require("@stryke/path/join");
|
|
8
6
|
let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
|
|
9
7
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
8
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
10
9
|
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
11
|
-
let
|
|
10
|
+
let _powerlines_core_constants = require("@powerlines/core/constants");
|
|
11
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
12
12
|
let jest_worker = require("jest-worker");
|
|
13
|
+
let date_fns_formatDuration = require("date-fns/formatDuration");
|
|
13
14
|
let node_stream = require("node:stream");
|
|
14
15
|
let node_util = require("node:util");
|
|
15
|
-
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
16
16
|
|
|
17
17
|
//#region src/_internal/ipc/parse.ts
|
|
18
18
|
function parseIpcMessage(data) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { t as PowerlinesEngineContext } from "./engine-context-
|
|
2
|
-
import { POWERLINES_API_FUNCTIONS } from "@powerlines/core/constants";
|
|
1
|
+
import { t as PowerlinesEngineContext } from "./engine-context-BfFiKN53.mjs";
|
|
3
2
|
import { toArray } from "@stryke/convert/to-array";
|
|
4
3
|
import { resolvePackage } from "@stryke/fs/resolve";
|
|
5
|
-
import { joinPaths } from "@stryke/path/join";
|
|
6
4
|
import { isSet } from "@stryke/type-checks/is-set";
|
|
7
5
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
6
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
8
7
|
import { isString } from "@stryke/type-checks/is-string";
|
|
9
|
-
import {
|
|
8
|
+
import { POWERLINES_API_FUNCTIONS } from "@powerlines/core/constants";
|
|
9
|
+
import { joinPaths } from "@stryke/path/join";
|
|
10
10
|
import { Worker } from "jest-worker";
|
|
11
|
+
import { formatDuration } from "date-fns/formatDuration";
|
|
11
12
|
import { Transform } from "node:stream";
|
|
12
13
|
import { parseArgs } from "node:util";
|
|
13
|
-
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
14
14
|
|
|
15
15
|
//#region src/_internal/ipc/parse.ts
|
|
16
16
|
function parseIpcMessage(data) {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_chunk = require('../chunk-C0xms8kb.cjs');
|
|
3
|
+
const require_rpc_serialization = require('./serialization.cjs');
|
|
4
|
+
let birpc = require("birpc");
|
|
5
|
+
let structured_clone_es = require("structured-clone-es");
|
|
6
|
+
|
|
7
|
+
//#region src/rpc/client.ts
|
|
8
|
+
function createRpcClient(functions, options) {
|
|
9
|
+
const { channel, rpcOptions = {} } = options;
|
|
10
|
+
return (0, birpc.createBirpc)(functions, {
|
|
11
|
+
...channel,
|
|
12
|
+
timeout: -1,
|
|
13
|
+
...rpcOptions,
|
|
14
|
+
proxify: false
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function NOOP() {}
|
|
18
|
+
const EMPTY_DEFS = /* @__PURE__ */ new Map();
|
|
19
|
+
/**
|
|
20
|
+
* Build a birpc `ChannelOptions` object backed by a browser `WebSocket`.
|
|
21
|
+
* Pass the result straight to `createRpcClient`'s `channel` option.
|
|
22
|
+
*/
|
|
23
|
+
function createWsRpcChannel(options) {
|
|
24
|
+
let url = options.url;
|
|
25
|
+
if (options.authToken) url = `${url}?vite_devtools_auth_token=${encodeURIComponent(options.authToken)}`;
|
|
26
|
+
const ws = new WebSocket(url);
|
|
27
|
+
const { onConnected = NOOP, onError = NOOP, onDisconnected = NOOP, definitions = EMPTY_DEFS } = options;
|
|
28
|
+
ws.addEventListener("open", (e) => {
|
|
29
|
+
onConnected(e);
|
|
30
|
+
});
|
|
31
|
+
ws.addEventListener("error", (e) => {
|
|
32
|
+
onError(e instanceof Error ? e : new Error(e.type));
|
|
33
|
+
});
|
|
34
|
+
ws.addEventListener("close", (e) => {
|
|
35
|
+
onDisconnected(e);
|
|
36
|
+
});
|
|
37
|
+
const pendingRequestMethods = /* @__PURE__ */ new Map();
|
|
38
|
+
return {
|
|
39
|
+
on: (handler) => {
|
|
40
|
+
ws.addEventListener("message", (e) => {
|
|
41
|
+
handler(e.data);
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
post: (data) => {
|
|
45
|
+
if (ws.readyState === WebSocket.OPEN) ws.send(data);
|
|
46
|
+
else {
|
|
47
|
+
function handler() {
|
|
48
|
+
ws.send(data);
|
|
49
|
+
ws.removeEventListener("open", handler);
|
|
50
|
+
}
|
|
51
|
+
ws.addEventListener("open", handler);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
serialize: (msg) => {
|
|
55
|
+
let method;
|
|
56
|
+
if (msg.t === "q") method = msg.m;
|
|
57
|
+
else {
|
|
58
|
+
method = pendingRequestMethods.get(msg.i);
|
|
59
|
+
pendingRequestMethods.delete(msg.i);
|
|
60
|
+
}
|
|
61
|
+
if (!!method && definitions.get(method)?.jsonSerializable === true) return require_rpc_serialization.strictJsonStringify(msg, method ?? "");
|
|
62
|
+
return `${"s:"}${(0, structured_clone_es.stringify)(msg)}`;
|
|
63
|
+
},
|
|
64
|
+
deserialize: (raw) => {
|
|
65
|
+
const msg = raw.startsWith("s:") ? (0, structured_clone_es.parse)(raw.slice("s:".length)) : JSON.parse(raw);
|
|
66
|
+
if (msg.t === "q" && msg.i && msg.m) pendingRequestMethods.set(msg.i, msg.m);
|
|
67
|
+
return msg;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
exports.createRpcClient = createRpcClient;
|
|
74
|
+
exports.createWsRpcChannel = createWsRpcChannel;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RpcFunctionDefinitionAny } from "./types.cjs";
|
|
2
|
+
import { BirpcOptions, BirpcReturn, ChannelOptions } from "birpc";
|
|
3
|
+
|
|
4
|
+
//#region src/rpc/client.d.ts
|
|
5
|
+
declare function createRpcClient<ServerFunctions extends object = Record<string, never>, ClientFunctions extends object = Record<string, never>>(functions: ClientFunctions, options: {
|
|
6
|
+
channel: ChannelOptions;
|
|
7
|
+
rpcOptions?: Partial<BirpcOptions<ServerFunctions, ClientFunctions, boolean>>;
|
|
8
|
+
}): BirpcReturn<ServerFunctions, ClientFunctions, false>;
|
|
9
|
+
interface WsRpcChannelOptions {
|
|
10
|
+
url: string;
|
|
11
|
+
onConnected?: (e: Event) => void;
|
|
12
|
+
onError?: (e: Error) => void;
|
|
13
|
+
onDisconnected?: (e: CloseEvent) => void;
|
|
14
|
+
authToken?: string;
|
|
15
|
+
/**
|
|
16
|
+
* RPC function definitions (or just the `jsonSerializable` flag per
|
|
17
|
+
* method) used to dispatch the per-call wire serializer. Pass an
|
|
18
|
+
* empty / partial map on clients that don't have the full registry —
|
|
19
|
+
* encoding falls back to structured-clone (the safer superset) and
|
|
20
|
+
* decoding still routes correctly via the wire prefix.
|
|
21
|
+
*/
|
|
22
|
+
definitions?: ReadonlyMap<string, Pick<RpcFunctionDefinitionAny, "jsonSerializable">>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build a birpc `ChannelOptions` object backed by a browser `WebSocket`.
|
|
26
|
+
* Pass the result straight to `createRpcClient`'s `channel` option.
|
|
27
|
+
*/
|
|
28
|
+
declare function createWsRpcChannel(options: WsRpcChannelOptions): ChannelOptions;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { WsRpcChannelOptions, createRpcClient, createWsRpcChannel };
|
|
31
|
+
//# sourceMappingURL=client.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.cts","names":[],"sources":["../../src/rpc/client.ts"],"mappings":";;;;iBA4BgB,eAAA,kCACmB,MAAA,kDACA,MAAA,gBAAA,CAEjC,SAAA,EAAW,eAAA,EACX,OAAA;EACE,OAAA,EAAS,cAAA;EACT,UAAA,GAAa,OAAA,CACX,YAAA,CAAa,eAAA,EAAiB,eAAA;AAAA,IAGjC,WAAA,CAAY,eAAA,EAAiB,eAAA;AAAA,UAWf,mBAAA;EACf,GAAA;EACA,WAAA,IAAe,CAAA,EAAG,KAAA;EAClB,OAAA,IAAW,CAAA,EAAG,KAAA;EACd,cAAA,IAAkB,CAAA,EAAG,UAAA;EACrB,SAAA;EAnBkC;;;;;;;EA2BlC,WAAA,GAAc,WAAA,SAEZ,IAAA,CAAK,wBAAA;AAAA;;;;;iBAeO,kBAAA,CACd,OAAA,EAAS,mBAAA,GACR,cAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RpcFunctionDefinitionAny } from "./types.mjs";
|
|
2
|
+
import { BirpcOptions, BirpcReturn, ChannelOptions } from "birpc";
|
|
3
|
+
|
|
4
|
+
//#region src/rpc/client.d.ts
|
|
5
|
+
declare function createRpcClient<ServerFunctions extends object = Record<string, never>, ClientFunctions extends object = Record<string, never>>(functions: ClientFunctions, options: {
|
|
6
|
+
channel: ChannelOptions;
|
|
7
|
+
rpcOptions?: Partial<BirpcOptions<ServerFunctions, ClientFunctions, boolean>>;
|
|
8
|
+
}): BirpcReturn<ServerFunctions, ClientFunctions, false>;
|
|
9
|
+
interface WsRpcChannelOptions {
|
|
10
|
+
url: string;
|
|
11
|
+
onConnected?: (e: Event) => void;
|
|
12
|
+
onError?: (e: Error) => void;
|
|
13
|
+
onDisconnected?: (e: CloseEvent) => void;
|
|
14
|
+
authToken?: string;
|
|
15
|
+
/**
|
|
16
|
+
* RPC function definitions (or just the `jsonSerializable` flag per
|
|
17
|
+
* method) used to dispatch the per-call wire serializer. Pass an
|
|
18
|
+
* empty / partial map on clients that don't have the full registry —
|
|
19
|
+
* encoding falls back to structured-clone (the safer superset) and
|
|
20
|
+
* decoding still routes correctly via the wire prefix.
|
|
21
|
+
*/
|
|
22
|
+
definitions?: ReadonlyMap<string, Pick<RpcFunctionDefinitionAny, "jsonSerializable">>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build a birpc `ChannelOptions` object backed by a browser `WebSocket`.
|
|
26
|
+
* Pass the result straight to `createRpcClient`'s `channel` option.
|
|
27
|
+
*/
|
|
28
|
+
declare function createWsRpcChannel(options: WsRpcChannelOptions): ChannelOptions;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { WsRpcChannelOptions, createRpcClient, createWsRpcChannel };
|
|
31
|
+
//# sourceMappingURL=client.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.mts","names":[],"sources":["../../src/rpc/client.ts"],"mappings":";;;;iBA4BgB,eAAA,kCACmB,MAAA,kDACA,MAAA,gBAAA,CAEjC,SAAA,EAAW,eAAA,EACX,OAAA;EACE,OAAA,EAAS,cAAA;EACT,UAAA,GAAa,OAAA,CACX,YAAA,CAAa,eAAA,EAAiB,eAAA;AAAA,IAGjC,WAAA,CAAY,eAAA,EAAiB,eAAA;AAAA,UAWf,mBAAA;EACf,GAAA;EACA,WAAA,IAAe,CAAA,EAAG,KAAA;EAClB,OAAA,IAAW,CAAA,EAAG,KAAA;EACd,cAAA,IAAkB,CAAA,EAAG,UAAA;EACrB,SAAA;EAnBkC;;;;;;;EA2BlC,WAAA,GAAc,WAAA,SAEZ,IAAA,CAAK,wBAAA;AAAA;;;;;iBAeO,kBAAA,CACd,OAAA,EAAS,mBAAA,GACR,cAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { STRUCTURED_CLONE_PREFIX, strictJsonStringify, structuredCloneParse, structuredCloneStringify } from "./serialization.mjs";
|
|
2
|
+
import { createBirpc } from "birpc";
|
|
3
|
+
|
|
4
|
+
//#region src/rpc/client.ts
|
|
5
|
+
function createRpcClient(functions, options) {
|
|
6
|
+
const { channel, rpcOptions = {} } = options;
|
|
7
|
+
return createBirpc(functions, {
|
|
8
|
+
...channel,
|
|
9
|
+
timeout: -1,
|
|
10
|
+
...rpcOptions,
|
|
11
|
+
proxify: false
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function NOOP() {}
|
|
15
|
+
const EMPTY_DEFS = /* @__PURE__ */ new Map();
|
|
16
|
+
/**
|
|
17
|
+
* Build a birpc `ChannelOptions` object backed by a browser `WebSocket`.
|
|
18
|
+
* Pass the result straight to `createRpcClient`'s `channel` option.
|
|
19
|
+
*/
|
|
20
|
+
function createWsRpcChannel(options) {
|
|
21
|
+
let url = options.url;
|
|
22
|
+
if (options.authToken) url = `${url}?vite_devtools_auth_token=${encodeURIComponent(options.authToken)}`;
|
|
23
|
+
const ws = new WebSocket(url);
|
|
24
|
+
const { onConnected = NOOP, onError = NOOP, onDisconnected = NOOP, definitions = EMPTY_DEFS } = options;
|
|
25
|
+
ws.addEventListener("open", (e) => {
|
|
26
|
+
onConnected(e);
|
|
27
|
+
});
|
|
28
|
+
ws.addEventListener("error", (e) => {
|
|
29
|
+
onError(e instanceof Error ? e : new Error(e.type));
|
|
30
|
+
});
|
|
31
|
+
ws.addEventListener("close", (e) => {
|
|
32
|
+
onDisconnected(e);
|
|
33
|
+
});
|
|
34
|
+
const pendingRequestMethods = /* @__PURE__ */ new Map();
|
|
35
|
+
return {
|
|
36
|
+
on: (handler) => {
|
|
37
|
+
ws.addEventListener("message", (e) => {
|
|
38
|
+
handler(e.data);
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
post: (data) => {
|
|
42
|
+
if (ws.readyState === WebSocket.OPEN) ws.send(data);
|
|
43
|
+
else {
|
|
44
|
+
function handler() {
|
|
45
|
+
ws.send(data);
|
|
46
|
+
ws.removeEventListener("open", handler);
|
|
47
|
+
}
|
|
48
|
+
ws.addEventListener("open", handler);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
serialize: (msg) => {
|
|
52
|
+
let method;
|
|
53
|
+
if (msg.t === "q") method = msg.m;
|
|
54
|
+
else {
|
|
55
|
+
method = pendingRequestMethods.get(msg.i);
|
|
56
|
+
pendingRequestMethods.delete(msg.i);
|
|
57
|
+
}
|
|
58
|
+
if (!!method && definitions.get(method)?.jsonSerializable === true) return strictJsonStringify(msg, method ?? "");
|
|
59
|
+
return `${"s:"}${structuredCloneStringify(msg)}`;
|
|
60
|
+
},
|
|
61
|
+
deserialize: (raw) => {
|
|
62
|
+
const msg = raw.startsWith("s:") ? structuredCloneParse(raw.slice("s:".length)) : JSON.parse(raw);
|
|
63
|
+
if (msg.t === "q" && msg.i && msg.m) pendingRequestMethods.set(msg.i, msg.m);
|
|
64
|
+
return msg;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
export { createRpcClient, createWsRpcChannel };
|
|
71
|
+
//# sourceMappingURL=client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.mjs","names":[],"sources":["../../src/rpc/client.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { BirpcOptions, BirpcReturn, ChannelOptions } from \"birpc\";\nimport { createBirpc } from \"birpc\";\nimport {\n strictJsonStringify,\n STRUCTURED_CLONE_PREFIX,\n structuredCloneParse,\n structuredCloneStringify\n} from \"./serialization\";\nimport type { RpcFunctionDefinitionAny } from \"./types\";\n\nexport function createRpcClient<\n ServerFunctions extends object = Record<string, never>,\n ClientFunctions extends object = Record<string, never>\n>(\n functions: ClientFunctions,\n options: {\n channel: ChannelOptions;\n rpcOptions?: Partial<\n BirpcOptions<ServerFunctions, ClientFunctions, boolean>\n >;\n }\n): BirpcReturn<ServerFunctions, ClientFunctions, false> {\n const { channel, rpcOptions = {} } = options;\n\n return createBirpc<ServerFunctions, ClientFunctions, false>(functions, {\n ...channel,\n timeout: -1,\n ...rpcOptions,\n proxify: false\n });\n}\n\nexport interface WsRpcChannelOptions {\n url: string;\n onConnected?: (e: Event) => void;\n onError?: (e: Error) => void;\n onDisconnected?: (e: CloseEvent) => void;\n authToken?: string;\n /**\n * RPC function definitions (or just the `jsonSerializable` flag per\n * method) used to dispatch the per-call wire serializer. Pass an\n * empty / partial map on clients that don't have the full registry —\n * encoding falls back to structured-clone (the safer superset) and\n * decoding still routes correctly via the wire prefix.\n */\n definitions?: ReadonlyMap<\n string,\n Pick<RpcFunctionDefinitionAny, \"jsonSerializable\">\n >;\n}\n\nfunction NOOP() {}\n\nconst EMPTY_DEFS: ReadonlyMap<\n string,\n Pick<RpcFunctionDefinitionAny, \"jsonSerializable\">\n> = new Map();\n\n/**\n * Build a birpc `ChannelOptions` object backed by a browser `WebSocket`.\n * Pass the result straight to `createRpcClient`'s `channel` option.\n */\nexport function createWsRpcChannel(\n options: WsRpcChannelOptions\n): ChannelOptions {\n let url = options.url;\n if (options.authToken) {\n url = `${url}?vite_devtools_auth_token=${encodeURIComponent(options.authToken)}`;\n }\n const ws = new WebSocket(url);\n const {\n onConnected = NOOP,\n onError = NOOP,\n onDisconnected = NOOP,\n definitions = EMPTY_DEFS\n } = options;\n\n ws.addEventListener(\"open\", e => {\n onConnected(e);\n });\n\n ws.addEventListener(\"error\", e => {\n const _e = e instanceof Error ? e : new Error(e.type);\n onError(_e);\n });\n\n ws.addEventListener(\"close\", e => {\n onDisconnected(e);\n });\n\n // Per-channel state: maps an incoming request id to its method name\n // so the matching outgoing response can independently look the\n // method up in `definitions` and pick the right encoder.\n const pendingRequestMethods = new Map<string, string>();\n\n return {\n on: (handler: (data: string) => void) => {\n ws.addEventListener(\"message\", e => {\n handler(e.data);\n });\n },\n post: (data: string) => {\n if (ws.readyState === WebSocket.OPEN) {\n ws.send(data);\n } else {\n function handler() {\n ws.send(data);\n ws.removeEventListener(\"open\", handler);\n }\n ws.addEventListener(\"open\", handler);\n }\n },\n serialize: (msg: any): string => {\n let method: string | undefined;\n if (msg.t === \"q\") {\n method = msg.m;\n } else {\n method = pendingRequestMethods.get(msg.i);\n pendingRequestMethods.delete(msg.i);\n }\n const useJson =\n !!method && definitions.get(method)?.jsonSerializable === true;\n if (useJson) return strictJsonStringify(msg, method ?? \"\");\n return `${STRUCTURED_CLONE_PREFIX}${structuredCloneStringify(msg)}`;\n },\n deserialize: (raw: string): any => {\n const msg: any = raw.startsWith(STRUCTURED_CLONE_PREFIX)\n ? structuredCloneParse(raw.slice(STRUCTURED_CLONE_PREFIX.length))\n : JSON.parse(raw);\n if (msg.t === \"q\" && msg.i && msg.m)\n pendingRequestMethods.set(msg.i, msg.m);\n return msg;\n }\n };\n}\n"],"mappings":";;;;AA4BA,SAAgB,gBAId,WACA,SAMsD;CACtD,MAAM,EAAE,SAAS,aAAa,EAAE,KAAK;AAErC,QAAO,YAAqD,WAAW;EACrE,GAAG;EACH,SAAS;EACT,GAAG;EACH,SAAS;EACV,CAAC;;AAsBJ,SAAS,OAAO;AAEhB,MAAM,6BAGF,IAAI,KAAK;;;;;AAMb,SAAgB,mBACd,SACgB;CAChB,IAAI,MAAM,QAAQ;AAClB,KAAI,QAAQ,UACV,OAAM,GAAG,IAAI,4BAA4B,mBAAmB,QAAQ,UAAU;CAEhF,MAAM,KAAK,IAAI,UAAU,IAAI;CAC7B,MAAM,EACJ,cAAc,MACd,UAAU,MACV,iBAAiB,MACjB,cAAc,eACZ;AAEJ,IAAG,iBAAiB,SAAQ,MAAK;AAC/B,cAAY,EAAE;GACd;AAEF,IAAG,iBAAiB,UAAS,MAAK;AAEhC,UADW,aAAa,QAAQ,IAAI,IAAI,MAAM,EAAE,KAAK,CAC1C;GACX;AAEF,IAAG,iBAAiB,UAAS,MAAK;AAChC,iBAAe,EAAE;GACjB;CAKF,MAAM,wCAAwB,IAAI,KAAqB;AAEvD,QAAO;EACL,KAAK,YAAoC;AACvC,MAAG,iBAAiB,YAAW,MAAK;AAClC,YAAQ,EAAE,KAAK;KACf;;EAEJ,OAAO,SAAiB;AACtB,OAAI,GAAG,eAAe,UAAU,KAC9B,IAAG,KAAK,KAAK;QACR;IACL,SAAS,UAAU;AACjB,QAAG,KAAK,KAAK;AACb,QAAG,oBAAoB,QAAQ,QAAQ;;AAEzC,OAAG,iBAAiB,QAAQ,QAAQ;;;EAGxC,YAAY,QAAqB;GAC/B,IAAI;AACJ,OAAI,IAAI,MAAM,IACZ,UAAS,IAAI;QACR;AACL,aAAS,sBAAsB,IAAI,IAAI,EAAE;AACzC,0BAAsB,OAAO,IAAI,EAAE;;AAIrC,OADE,CAAC,CAAC,UAAU,YAAY,IAAI,OAAO,EAAE,qBAAqB,KAC/C,QAAO,oBAAoB,KAAK,UAAU,GAAG;AAC1D,UAAO,UAA6B,yBAAyB,IAAI;;EAEnE,cAAc,QAAqB;GACjC,MAAM,MAAW,IAAI,gBAAmC,GACpD,qBAAqB,IAAI,WAA8B,OAAO,CAAC,GAC/D,KAAK,MAAM,IAAI;AACnB,OAAI,IAAI,MAAM,OAAO,IAAI,KAAK,IAAI,EAChC,uBAAsB,IAAI,IAAI,GAAG,IAAI,EAAE;AACzC,UAAO;;EAEV"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_chunk = require('../chunk-C0xms8kb.cjs');
|
|
3
|
+
let structured_clone_es = require("structured-clone-es");
|
|
4
|
+
|
|
5
|
+
//#region src/rpc/serialization.ts
|
|
6
|
+
/**
|
|
7
|
+
* Wire format used by the WS RPC transport.
|
|
8
|
+
*
|
|
9
|
+
* - **JSON (default, unprefixed):** payload is plain JSON text. Used when
|
|
10
|
+
* the dispatched method is declared `jsonSerializable: true`. Encoded
|
|
11
|
+
* via {@link strictJsonStringify} (rejects non-JSON values), decoded
|
|
12
|
+
* via `JSON.parse`.
|
|
13
|
+
* - **Structured-clone (`s:` prefix):** payload is `s:` followed by
|
|
14
|
+
* `structured-clone-es` text. Used when the method is declared
|
|
15
|
+
* `jsonSerializable: false` (or omitted, the default). Round-trips
|
|
16
|
+
* `Map`, `Set`, `Date`, `BigInt`, cycles, and class instances.
|
|
17
|
+
*
|
|
18
|
+
* birpc envelopes always start with `{`, so a leading byte that is not
|
|
19
|
+
* `s` is unambiguously JSON. Each direction independently chooses its
|
|
20
|
+
* encoding from local definitions — request and response are not
|
|
21
|
+
* coupled by a mirror rule.
|
|
22
|
+
*/
|
|
23
|
+
const STRUCTURED_CLONE_PREFIX = "s:";
|
|
24
|
+
/**
|
|
25
|
+
* `JSON.stringify` with a single-pass strict replacer.
|
|
26
|
+
*
|
|
27
|
+
* Throws `DF0020` synchronously when the value contains a type JSON
|
|
28
|
+
* cannot round-trip losslessly: `Map`, `Set`, `Date`, `BigInt`, class
|
|
29
|
+
* instances, or `undefined` inside an array (silently becomes `null`).
|
|
30
|
+
*
|
|
31
|
+
* Native pass-throughs (no extra work needed):
|
|
32
|
+
* - circular references — `JSON.stringify` raises `TypeError`.
|
|
33
|
+
* - `BigInt` at top level — caught here for a friendlier error path.
|
|
34
|
+
*
|
|
35
|
+
* Lenient cases (allowed without throwing):
|
|
36
|
+
* - `undefined` as an object property — legitimate optional field;
|
|
37
|
+
* JSON.stringify just omits it.
|
|
38
|
+
* - `undefined` at the root — legitimate "action returned nothing".
|
|
39
|
+
* - `Symbol` / `Function` values — semantically "drop me" in JSON.
|
|
40
|
+
*
|
|
41
|
+
* `fnName` is used only for the diagnostic message — pass the RPC
|
|
42
|
+
* function name when calling from a wire serializer / dump writer so
|
|
43
|
+
* the error points at the offending function.
|
|
44
|
+
*/
|
|
45
|
+
function strictJsonStringify(value, fnName = "") {
|
|
46
|
+
return JSON.stringify(value, function strictReplacer(key, val) {
|
|
47
|
+
const holder = this;
|
|
48
|
+
const original = holder != null ? holder[key] : val;
|
|
49
|
+
if (original === void 0) {
|
|
50
|
+
if (Array.isArray(holder)) throw nonJsonAt(fnName, "undefined", holder, key);
|
|
51
|
+
return val;
|
|
52
|
+
}
|
|
53
|
+
if (original === null) return val;
|
|
54
|
+
if (typeof original === "bigint") throw nonJsonAt(fnName, "BigInt", holder, key);
|
|
55
|
+
if (typeof original === "object") {
|
|
56
|
+
if (original instanceof Map) throw nonJsonAt(fnName, "Map", holder, key);
|
|
57
|
+
if (original instanceof Set) throw nonJsonAt(fnName, "Set", holder, key);
|
|
58
|
+
if (original instanceof Date) throw nonJsonAt(fnName, "Date", holder, key);
|
|
59
|
+
if (Array.isArray(original)) return val;
|
|
60
|
+
const proto = Object.getPrototypeOf(original);
|
|
61
|
+
if (proto !== null && proto !== Object.prototype) throw nonJsonAt(fnName, original.constructor?.name ?? "class instance", holder, key);
|
|
62
|
+
}
|
|
63
|
+
return val;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function nonJsonAt(fnName, type, parent, key) {
|
|
67
|
+
const path = formatPath(parent, key);
|
|
68
|
+
return /* @__PURE__ */ new Error(`Serialization error: ${fnName || "<anonymous>"} - ${type} at ${path}`);
|
|
69
|
+
}
|
|
70
|
+
function formatPath(parent, key) {
|
|
71
|
+
if (Array.isArray(parent)) return `[${key}]`;
|
|
72
|
+
if (key === "") return "<root>";
|
|
73
|
+
return key;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
exports.STRUCTURED_CLONE_PREFIX = STRUCTURED_CLONE_PREFIX;
|
|
78
|
+
exports.strictJsonStringify = strictJsonStringify;
|
|
79
|
+
exports.structuredCloneDeserialize = structured_clone_es.deserialize;
|
|
80
|
+
exports.structuredCloneParse = structured_clone_es.parse;
|
|
81
|
+
exports.structuredCloneSerialize = structured_clone_es.serialize;
|
|
82
|
+
exports.structuredCloneStringify = structured_clone_es.stringify;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { deserialize as structuredCloneDeserialize, parse as structuredCloneParse, serialize as structuredCloneSerialize, stringify as structuredCloneStringify } from "structured-clone-es";
|
|
2
|
+
|
|
3
|
+
//#region src/rpc/serialization.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Wire format used by the WS RPC transport.
|
|
6
|
+
*
|
|
7
|
+
* - **JSON (default, unprefixed):** payload is plain JSON text. Used when
|
|
8
|
+
* the dispatched method is declared `jsonSerializable: true`. Encoded
|
|
9
|
+
* via {@link strictJsonStringify} (rejects non-JSON values), decoded
|
|
10
|
+
* via `JSON.parse`.
|
|
11
|
+
* - **Structured-clone (`s:` prefix):** payload is `s:` followed by
|
|
12
|
+
* `structured-clone-es` text. Used when the method is declared
|
|
13
|
+
* `jsonSerializable: false` (or omitted, the default). Round-trips
|
|
14
|
+
* `Map`, `Set`, `Date`, `BigInt`, cycles, and class instances.
|
|
15
|
+
*
|
|
16
|
+
* birpc envelopes always start with `{`, so a leading byte that is not
|
|
17
|
+
* `s` is unambiguously JSON. Each direction independently chooses its
|
|
18
|
+
* encoding from local definitions — request and response are not
|
|
19
|
+
* coupled by a mirror rule.
|
|
20
|
+
*/
|
|
21
|
+
declare const STRUCTURED_CLONE_PREFIX = "s:";
|
|
22
|
+
/**
|
|
23
|
+
* `JSON.stringify` with a single-pass strict replacer.
|
|
24
|
+
*
|
|
25
|
+
* Throws `DF0020` synchronously when the value contains a type JSON
|
|
26
|
+
* cannot round-trip losslessly: `Map`, `Set`, `Date`, `BigInt`, class
|
|
27
|
+
* instances, or `undefined` inside an array (silently becomes `null`).
|
|
28
|
+
*
|
|
29
|
+
* Native pass-throughs (no extra work needed):
|
|
30
|
+
* - circular references — `JSON.stringify` raises `TypeError`.
|
|
31
|
+
* - `BigInt` at top level — caught here for a friendlier error path.
|
|
32
|
+
*
|
|
33
|
+
* Lenient cases (allowed without throwing):
|
|
34
|
+
* - `undefined` as an object property — legitimate optional field;
|
|
35
|
+
* JSON.stringify just omits it.
|
|
36
|
+
* - `undefined` at the root — legitimate "action returned nothing".
|
|
37
|
+
* - `Symbol` / `Function` values — semantically "drop me" in JSON.
|
|
38
|
+
*
|
|
39
|
+
* `fnName` is used only for the diagnostic message — pass the RPC
|
|
40
|
+
* function name when calling from a wire serializer / dump writer so
|
|
41
|
+
* the error points at the offending function.
|
|
42
|
+
*/
|
|
43
|
+
declare function strictJsonStringify(value: unknown, fnName?: string): string;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { STRUCTURED_CLONE_PREFIX, strictJsonStringify, structuredCloneDeserialize, structuredCloneParse, structuredCloneSerialize, structuredCloneStringify };
|
|
46
|
+
//# sourceMappingURL=serialization.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialization.d.cts","names":[],"sources":["../../src/rpc/serialization.ts"],"mappings":";;;;AAiDA;;;;;AAuBA;;;;;;;;;;;cAvBa,uBAAA;;;;;;;;;;;;;;;;;;;;;;iBAuBG,mBAAA,CACd,KAAA,WACA,MAAA"}
|