@stryke/capnp 0.12.45 → 0.12.46

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.
Files changed (97) hide show
  1. package/bin/capnpc.mjs.map +1 -1
  2. package/dist/_virtual/rolldown_runtime.cjs +1 -0
  3. package/dist/_virtual/rolldown_runtime.mjs +1 -0
  4. package/dist/compile.cjs +1 -1
  5. package/dist/compile.d.cts +40 -3
  6. package/dist/compile.d.cts.map +1 -0
  7. package/dist/compile.d.mts +40 -3
  8. package/dist/compile.d.mts.map +1 -0
  9. package/dist/compile.mjs +2 -1
  10. package/dist/compile.mjs.map +1 -0
  11. package/dist/helpers.cjs +1 -1
  12. package/dist/helpers.d.cts +1 -1
  13. package/dist/helpers.d.mts +1 -1
  14. package/dist/helpers.mjs +2 -1
  15. package/dist/helpers.mjs.map +1 -0
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.cts +2 -2
  18. package/dist/index.d.mts +2 -2
  19. package/dist/index.mjs +1 -1
  20. package/dist/packages/convert/src/to-array.cjs +1 -0
  21. package/dist/packages/convert/src/to-array.mjs +2 -0
  22. package/dist/packages/convert/src/to-array.mjs.map +1 -0
  23. package/dist/rpc-helpers.cjs +1 -1
  24. package/dist/rpc-helpers.mjs +1 -1
  25. package/dist/rpc-helpers.mjs.map +1 -1
  26. package/dist/types.cjs +1 -1
  27. package/dist/types.d.cts +55 -2
  28. package/dist/types.d.cts.map +1 -0
  29. package/dist/types.d.mts +55 -2
  30. package/dist/types.d.mts.map +1 -0
  31. package/dist/types.mjs +2 -1
  32. package/dist/types.mjs.map +1 -0
  33. package/package.json +9 -9
  34. package/schemas/_virtual/rolldown_runtime.cjs +1 -0
  35. package/schemas/_virtual/rolldown_runtime.mjs +1 -0
  36. package/schemas/packages/capnp/src/compile.cjs +1 -0
  37. package/{dist/compile-DccxA7WZ.d.cts → schemas/packages/capnp/src/compile.d.mts} +4 -4
  38. package/{dist/compile-DccxA7WZ.d.cts.map → schemas/packages/capnp/src/compile.d.mts.map} +1 -1
  39. package/schemas/packages/capnp/src/compile.mjs +1 -0
  40. package/schemas/packages/capnp/src/helpers.cjs +1 -0
  41. package/schemas/packages/capnp/src/helpers.mjs +1 -0
  42. package/schemas/packages/capnp/src/index.cjs +1 -0
  43. package/schemas/packages/capnp/src/index.d.mts +13 -0
  44. package/schemas/packages/capnp/src/index.d.mts.map +1 -0
  45. package/schemas/packages/capnp/src/index.mjs +1 -0
  46. package/{dist/types-D03SjfBL.d.mts → schemas/packages/capnp/src/types.d.mts} +2 -2
  47. package/{dist/types-D03SjfBL.d.mts.map → schemas/packages/capnp/src/types.d.mts.map} +1 -1
  48. package/schemas/persistent.cjs +1 -1
  49. package/schemas/persistent.d.cts +1 -1
  50. package/schemas/persistent.d.mts +1 -1
  51. package/schemas/persistent.mjs +1 -1
  52. package/schemas/persistent.mjs.map +1 -1
  53. package/schemas/rpc-twoparty.cjs +1 -1
  54. package/schemas/rpc-twoparty.d.cts +1 -1
  55. package/schemas/rpc-twoparty.d.mts +1 -1
  56. package/schemas/rpc-twoparty.mjs +1 -1
  57. package/schemas/rpc-twoparty.mjs.map +1 -1
  58. package/schemas/rpc.cjs +1 -1
  59. package/schemas/rpc.d.cts +1 -1
  60. package/schemas/rpc.d.mts +1 -1
  61. package/schemas/rpc.mjs +1 -1
  62. package/schemas/rpc.mjs.map +1 -1
  63. package/schemas/schema.cjs +1 -1
  64. package/schemas/schema.d.cts +1 -1
  65. package/schemas/schema.d.mts +1 -1
  66. package/schemas/schema.mjs +1 -1
  67. package/schemas/schema.mjs.map +1 -1
  68. package/{dist/compile-UkKIpqrK.d.mts → schemas/src/compile.d.cts} +4 -4
  69. package/schemas/src/compile.d.cts.map +1 -0
  70. package/schemas/src/index.d.cts +13 -0
  71. package/schemas/src/index.d.cts.map +1 -0
  72. package/{dist/types-D52qMMoK.d.cts → schemas/src/types.d.cts} +2 -2
  73. package/schemas/src/types.d.cts.map +1 -0
  74. package/dist/capnp-es.GpvEvMIK-BsgDzeBH.mjs +0 -12
  75. package/dist/capnp-es.GpvEvMIK-BsgDzeBH.mjs.map +0 -1
  76. package/dist/capnp-es.GpvEvMIK-xNDcbmgx.cjs +0 -11
  77. package/dist/compile-ChbJ-p6B.cjs +0 -169
  78. package/dist/compile-DJUj4hs3.mjs +0 -163
  79. package/dist/compile-DJUj4hs3.mjs.map +0 -1
  80. package/dist/compile-UkKIpqrK.d.mts.map +0 -1
  81. package/dist/dist-C1gSYYrg.cjs +0 -1
  82. package/dist/dist-CK47iMja.mjs +0 -2
  83. package/dist/dist-CK47iMja.mjs.map +0 -1
  84. package/dist/helpers-BoKbpcuO.mjs +0 -27
  85. package/dist/helpers-BoKbpcuO.mjs.map +0 -1
  86. package/dist/helpers-DSMRKdw1.cjs +0 -26
  87. package/dist/types-BujoAx-K.mjs +0 -2
  88. package/dist/types-BujoAx-K.mjs.map +0 -1
  89. package/dist/types-D52qMMoK.d.cts.map +0 -1
  90. package/dist/types-D6FuBB1k.cjs +0 -1
  91. package/schemas/index-BAJMwFip.d.mts +0 -96
  92. package/schemas/index-BAJMwFip.d.mts.map +0 -1
  93. package/schemas/index-b7dam4EA.d.cts +0 -96
  94. package/schemas/index-b7dam4EA.d.cts.map +0 -1
  95. package/schemas/src-CGrmR2BO.cjs +0 -11
  96. package/schemas/src-DqIy7I3p.mjs +0 -12
  97. package/schemas/src-DqIy7I3p.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__commonJSMin=o,exports.__toESM=c;
@@ -0,0 +1 @@
1
+ import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),u=e(import.meta.url);export{s as __commonJSMin,u as __require,l as __toESM};
package/dist/compile.cjs CHANGED
@@ -1 +1 @@
1
- require(`./helpers-DSMRKdw1.cjs`);const e=require(`./compile-ChbJ-p6B.cjs`);exports.capnpc=e.t,exports.compile=e.n;
1
+ const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./node_modules/.pnpm/@storm-software_config-tools@1.188.68/node_modules/@storm-software/config-tools/dist/chunk-UU2P3WKA.cjs`),n=require(`./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.CbTQkT9D.cjs`),r=require(`./helpers.cjs`);let i=require(`@stryke/fs/exists`),a=require(`defu`);a=e.__toESM(a);let o=require(`node:buffer`),s=require(`node:child_process`);async function c(e){let{output:r,tsconfig:a,schemas:c=[],tty:l}=e,u=o.Buffer.alloc(0);if(l){let e=[];process.stdin.on(`data`,t=>{e.push(t)}),await new Promise(e=>{process.stdin.on(`end`,e)});let t=o.Buffer.alloc(e.reduce((e,t)=>e+t.byteLength,0)),n=0;for(let r of e)r.copy(t,n),n+=r.byteLength;u=t}if(u.byteLength===0){let e=[];r&&(0,i.existsSync)(r)?e.push(`-o-:${r}`):(r&&!(0,i.existsSync)(r)&&t.writeWarning(`Output directory "${r}" does not exist, will write to schema path...`),e.push(`-o-`)),u=await new Promise(t=>{(0,s.exec)(`capnpc ${e.join(` `)} ${c.join(` `)}`,{encoding:`buffer`},(e,n,r)=>{if(r.length>0&&process.stderr.write(r),e)throw e;t(n)})})}return n.compileAll(u,{ts:e.ts??!0,js:!1,dts:!1,tsconfig:a.options})}async function l(e,i){let o=await r.resolveOptions(i);if(!o){t.writeWarning(`✖ Unable to resolve Cap'n Proto compiler options - the program will terminate`,{logLevel:`all`});return}return n.compileAll(e,(0,a.default)({tsconfig:o.tsconfig.options},o,{ts:!0,js:!1,dts:!1}))}exports.capnpc=c,exports.compile=l;
@@ -1,3 +1,40 @@
1
- import "./types-D52qMMoK.cjs";
2
- import { n as compile, t as capnpc } from "./compile-DccxA7WZ.cjs";
3
- export { capnpc, compile };
1
+ import { CapnpcOptions, CapnpcResolvedOptions, CapnpcResult } from "./types.cjs";
2
+ import * as capnp_es_capnp_schema0 from "capnp-es/capnp/schema";
3
+ import { Buffer } from "node:buffer";
4
+
5
+ //#region src/compile.d.ts
6
+
7
+ /**
8
+ * Compiles Cap'n Proto schemas into TypeScript files.
9
+ *
10
+ * @param options - The options for the compilation process.
11
+ * @returns A promise that resolves to the compilation result.
12
+ */
13
+ declare function capnpc(options: CapnpcResolvedOptions): Promise<CapnpcResult>;
14
+ /**
15
+ * Compiles Cap'n Proto schemas into TypeScript files.
16
+ *
17
+ * @param dataBuf - The buffer containing the Cap'n Proto schema data.
18
+ * @param options - The options for the compilation process.
19
+ * @returns A promise that resolves to the compilation result.
20
+ */
21
+ declare function compile(dataBuf: Buffer, options: CapnpcOptions): Promise<{
22
+ ctx: {
23
+ files: {
24
+ readonly req: capnp_es_capnp_schema0.CodeGeneratorRequest;
25
+ readonly file: capnp_es_capnp_schema0.CodeGeneratorRequest_RequestedFile;
26
+ readonly nodes: capnp_es_capnp_schema0.Node[];
27
+ readonly imports: capnp_es_capnp_schema0.CodeGeneratorRequest_RequestedFile_Import[];
28
+ concreteLists: Array<[string, capnp_es_capnp_schema0.Field]>;
29
+ generatedNodeIds: Set<string>;
30
+ generatedResultsPromiseIds: Set<bigint>;
31
+ tsPath: string;
32
+ codeParts: string[];
33
+ toString(): string;
34
+ }[];
35
+ };
36
+ files: Map<string, string>;
37
+ } | undefined>;
38
+ //#endregion
39
+ export { capnpc, compile };
40
+ //# sourceMappingURL=compile.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.d.cts","names":[],"sources":["../../src/compile.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAqCA;;;AAEG,iBAFmB,MAAA,CAEnB,OAAA,EADQ,qBACR,CAAA,EAAA,OAAA,CAAQ,YAAR,CAAA;;AA0EH;;;;;;iBAAsB,OAAA,UAAiB,iBAAiB,gBAAa;;;oBAAA,sBAAA,CAAA;;;MAAA,SAAA,OAAA,oEAAA;MAAA,aAAA,OAAA,CAAA,CAAA,MAAA,+BAAA,CAAA"}
@@ -1,3 +1,40 @@
1
- import "./types-D03SjfBL.mjs";
2
- import { n as compile, t as capnpc } from "./compile-UkKIpqrK.mjs";
3
- export { capnpc, compile };
1
+ import { CapnpcOptions, CapnpcResolvedOptions, CapnpcResult } from "./types.mjs";
2
+ import { Buffer } from "node:buffer";
3
+ import * as capnp_es_capnp_schema0 from "capnp-es/capnp/schema";
4
+
5
+ //#region src/compile.d.ts
6
+
7
+ /**
8
+ * Compiles Cap'n Proto schemas into TypeScript files.
9
+ *
10
+ * @param options - The options for the compilation process.
11
+ * @returns A promise that resolves to the compilation result.
12
+ */
13
+ declare function capnpc(options: CapnpcResolvedOptions): Promise<CapnpcResult>;
14
+ /**
15
+ * Compiles Cap'n Proto schemas into TypeScript files.
16
+ *
17
+ * @param dataBuf - The buffer containing the Cap'n Proto schema data.
18
+ * @param options - The options for the compilation process.
19
+ * @returns A promise that resolves to the compilation result.
20
+ */
21
+ declare function compile(dataBuf: Buffer, options: CapnpcOptions): Promise<{
22
+ ctx: {
23
+ files: {
24
+ readonly req: capnp_es_capnp_schema0.CodeGeneratorRequest;
25
+ readonly file: capnp_es_capnp_schema0.CodeGeneratorRequest_RequestedFile;
26
+ readonly nodes: capnp_es_capnp_schema0.Node[];
27
+ readonly imports: capnp_es_capnp_schema0.CodeGeneratorRequest_RequestedFile_Import[];
28
+ concreteLists: Array<[string, capnp_es_capnp_schema0.Field]>;
29
+ generatedNodeIds: Set<string>;
30
+ generatedResultsPromiseIds: Set<bigint>;
31
+ tsPath: string;
32
+ codeParts: string[];
33
+ toString(): string;
34
+ }[];
35
+ };
36
+ files: Map<string, string>;
37
+ } | undefined>;
38
+ //#endregion
39
+ export { capnpc, compile };
40
+ //# sourceMappingURL=compile.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.d.mts","names":[],"sources":["../../src/compile.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAqCA;;;AAEG,iBAFmB,MAAA,CAEnB,OAAA,EADQ,qBACR,CAAA,EAAA,OAAA,CAAQ,YAAR,CAAA;;AA0EH;;;;;;iBAAsB,OAAA,UAAiB,iBAAiB,gBAAa;;;oBAAA,sBAAA,CAAA;;;MAAA,SAAA,OAAA,oEAAA;MAAA,aAAA,OAAA,CAAA,CAAA,MAAA,+BAAA,CAAA"}
package/dist/compile.mjs CHANGED
@@ -1 +1,2 @@
1
- import"./helpers-BoKbpcuO.mjs";import{n as e,t}from"./compile-DJUj4hs3.mjs";export{t as capnpc,e as compile};
1
+ import{writeWarning as e}from"./node_modules/.pnpm/@storm-software_config-tools@1.188.68/node_modules/@storm-software/config-tools/dist/chunk-UU2P3WKA.mjs";import{compileAll as t}from"./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.CbTQkT9D.mjs";import{resolveOptions as n}from"./helpers.mjs";import{existsSync as r}from"@stryke/fs/exists";import i from"defu";import{Buffer as a}from"node:buffer";import{exec as o}from"node:child_process";async function s(n){let{output:i,tsconfig:s,schemas:c=[],tty:l}=n,u=a.alloc(0);if(l){let e=[];process.stdin.on(`data`,t=>{e.push(t)}),await new Promise(e=>{process.stdin.on(`end`,e)});let t=a.alloc(e.reduce((e,t)=>e+t.byteLength,0)),n=0;for(let r of e)r.copy(t,n),n+=r.byteLength;u=t}if(u.byteLength===0){let t=[];i&&r(i)?t.push(`-o-:${i}`):(i&&!r(i)&&e(`Output directory "${i}" does not exist, will write to schema path...`),t.push(`-o-`)),u=await new Promise(e=>{o(`capnpc ${t.join(` `)} ${c.join(` `)}`,{encoding:`buffer`},(t,n,r)=>{if(r.length>0&&process.stderr.write(r),t)throw t;e(n)})})}return t(u,{ts:n.ts??!0,js:!1,dts:!1,tsconfig:s.options})}async function c(r,a){let o=await n(a);if(!o){e(`✖ Unable to resolve Cap'n Proto compiler options - the program will terminate`,{logLevel:`all`});return}return t(r,i({tsconfig:o.tsconfig.options},o,{ts:!0,js:!1,dts:!1}))}export{s as capnpc,c as compile};
2
+ //# sourceMappingURL=compile.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.mjs","names":["dataBuf: Buffer","chunks: Buffer[]","opts: string[]"],"sources":["../../src/compile.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\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/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { writeWarning } from \"@storm-software/config-tools/logger/console\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { compileAll } from \"capnp-es/compiler\";\nimport defu from \"defu\";\nimport { Buffer } from \"node:buffer\";\nimport { exec } from \"node:child_process\";\nimport { resolveOptions } from \"./helpers.js\";\nimport type {\n CapnpcOptions,\n CapnpcResolvedOptions,\n CapnpcResult\n} from \"./types.js\";\n\n/**\n * Compiles Cap'n Proto schemas into TypeScript files.\n *\n * @param options - The options for the compilation process.\n * @returns A promise that resolves to the compilation result.\n */\nexport async function capnpc(\n options: CapnpcResolvedOptions\n): Promise<CapnpcResult> {\n const { output, tsconfig, schemas = [], tty } = options;\n\n let dataBuf: Buffer = Buffer.alloc(0);\n if (tty) {\n const chunks: Buffer[] = [];\n process.stdin.on(\"data\", (chunk: Buffer) => {\n chunks.push(chunk);\n });\n\n await new Promise(resolve => {\n process.stdin.on(\"end\", resolve);\n });\n\n const reqBuffer = Buffer.alloc(\n chunks.reduce((l, chunk) => l + chunk.byteLength, 0)\n );\n\n let i = 0;\n for (const chunk of chunks) {\n chunk.copy(reqBuffer, i);\n i += chunk.byteLength;\n }\n\n dataBuf = reqBuffer;\n }\n\n if (dataBuf.byteLength === 0) {\n const opts: string[] = [];\n\n if (output && existsSync(output)) {\n opts.push(`-o-:${output}`);\n } else {\n if (output && !existsSync(output)) {\n writeWarning(\n `Output directory \"${output}\" does not exist, will write to schema path...`\n );\n }\n\n opts.push(\"-o-\");\n }\n\n dataBuf = await new Promise<Buffer>(resolve => {\n exec(\n `capnpc ${opts.join(\" \")} ${schemas.join(\" \")}`,\n { encoding: \"buffer\" },\n (error, stdout, stderr) => {\n if (stderr.length > 0) {\n process.stderr.write(stderr);\n }\n if (error) {\n throw error;\n }\n resolve(stdout);\n }\n );\n });\n }\n\n return compileAll(dataBuf, {\n ts: options.ts ?? true,\n js: false,\n dts: false,\n tsconfig: tsconfig.options\n });\n}\n\n/**\n * Compiles Cap'n Proto schemas into TypeScript files.\n *\n * @param dataBuf - The buffer containing the Cap'n Proto schema data.\n * @param options - The options for the compilation process.\n * @returns A promise that resolves to the compilation result.\n */\nexport async function compile(dataBuf: Buffer, options: CapnpcOptions) {\n const resolvedOptions = await resolveOptions(\n options as Parameters<typeof resolveOptions>[0]\n );\n if (!resolvedOptions) {\n writeWarning(\n \"✖ Unable to resolve Cap'n Proto compiler options - the program will terminate\",\n { logLevel: \"all\" }\n );\n return;\n }\n\n return compileAll(\n dataBuf,\n defu(\n {\n tsconfig: resolvedOptions.tsconfig.options\n },\n resolvedOptions,\n {\n ts: true,\n js: false,\n dts: false\n }\n )\n );\n}\n"],"mappings":"ojBAqCA,eAAsB,EACpB,EACuB,CACvB,GAAM,CAAE,SAAQ,WAAU,UAAU,EAAE,CAAE,OAAQ,EAE5CA,EAAkB,EAAO,MAAM,EAAE,CACrC,GAAI,EAAK,CACP,IAAMC,EAAmB,EAAE,CAC3B,QAAQ,MAAM,GAAG,OAAS,GAAkB,CAC1C,EAAO,KAAK,EAAM,EAClB,CAEF,MAAM,IAAI,QAAQ,GAAW,CAC3B,QAAQ,MAAM,GAAG,MAAO,EAAQ,EAChC,CAEF,IAAM,EAAY,EAAO,MACvB,EAAO,QAAQ,EAAG,IAAU,EAAI,EAAM,WAAY,EAAE,CACrD,CAEG,EAAI,EACR,IAAK,IAAM,KAAS,EAClB,EAAM,KAAK,EAAW,EAAE,CACxB,GAAK,EAAM,WAGb,EAAU,EAGZ,GAAI,EAAQ,aAAe,EAAG,CAC5B,IAAMC,EAAiB,EAAE,CAErB,GAAU,EAAW,EAAO,CAC9B,EAAK,KAAK,OAAO,IAAS,EAEtB,GAAU,CAAC,EAAW,EAAO,EAC/B,EACE,qBAAqB,EAAO,gDAC7B,CAGH,EAAK,KAAK,MAAM,EAGlB,EAAU,MAAM,IAAI,QAAgB,GAAW,CAC7C,EACE,UAAU,EAAK,KAAK,IAAI,CAAC,GAAG,EAAQ,KAAK,IAAI,GAC7C,CAAE,SAAU,SAAU,EACrB,EAAO,EAAQ,IAAW,CAIzB,GAHI,EAAO,OAAS,GAClB,QAAQ,OAAO,MAAM,EAAO,CAE1B,EACF,MAAM,EAER,EAAQ,EAAO,EAElB,EACD,CAGJ,OAAO,EAAW,EAAS,CACzB,GAAI,EAAQ,IAAM,GAClB,GAAI,GACJ,IAAK,GACL,SAAU,EAAS,QACpB,CAAC,CAUJ,eAAsB,EAAQ,EAAiB,EAAwB,CACrE,IAAM,EAAkB,MAAM,EAC5B,EACD,CACD,GAAI,CAAC,EAAiB,CACpB,EACE,gFACA,CAAE,SAAU,MAAO,CACpB,CACD,OAGF,OAAO,EACL,EACA,EACE,CACE,SAAU,EAAgB,SAAS,QACpC,CACD,EACA,CACE,GAAI,GACJ,GAAI,GACJ,IAAK,GACN,CACF,CACF"}
package/dist/helpers.cjs CHANGED
@@ -1 +1 @@
1
- const e=require(`./helpers-DSMRKdw1.cjs`);exports.resolveOptions=e.t;
1
+ const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./node_modules/.pnpm/@storm-software_config-tools@1.188.68/node_modules/@storm-software/config-tools/dist/chunk-UU2P3WKA.cjs`),n=require(`./packages/convert/src/to-array.cjs`);let r=require(`@stryke/fs/exists`),i=require(`typescript`),a=require(`@stryke/fs/json`),o=require(`@stryke/fs/list-files`),s=require(`@stryke/path/file-path-fns`),c=require(`@stryke/path/join-paths`);async function l(e){let l=e.tsconfigPath?e.tsconfigPath.replace(`{projectRoot}`,e.projectRoot).replace(`{workspaceRoot}`,e.workspaceRoot):(0,c.joinPaths)(e.projectRoot,`tsconfig.json`),u=n.toArray(e.schemas?e.schemas:(0,c.joinPaths)(e.projectRoot,`schemas/**/*.capnp`)).filter(Boolean).map(t=>t.replace(`{projectRoot}`,e.projectRoot).replace(`{workspaceRoot}`,e.workspaceRoot)),d;if(e.tsconfig)d=e.tsconfig;else{if(!l||!(0,r.existsSync)(l)){let e=l?`✖ The specified TypeScript configuration file "${l}" does not exist. Please provide a valid path.`:`✖ The specified TypeScript configuration file does not exist. Please provide a valid path.`;throw t.writeFatal(e,{logLevel:`all`}),Error(e)}if(d=(0,i.parseJsonConfigFileContent)(await(0,a.readJsonFile)(l),i.sys,(0,s.findFilePath)(l)),!d){let e=`✖ The specified TypeScript configuration file "${l}" is invalid. Please provide a valid configuration.`;throw t.writeFatal(e,{logLevel:`all`}),Error(e)}d.options.configFilePath=l,d.options.noImplicitOverride=!1,d.options.noUnusedLocals=!1,d.options.noUnusedParameters=!1}let f=[];for(let e of u){let t=e;!e.endsWith(`.capnp`)&&!e.includes(`*`)&&(t=`${e.replace(/\/$/g,``)}/*.capnp`),f.push(...await(0,o.listFiles)(t))}if(f.length===0||!f[0])return t.writeWarning(`✖ No Cap'n Proto schema files found in the specified source paths: ${u.join(`, `)}. As a result, the Cap'n Proto compiler will not be able to generate any output files. Please ensure that the paths are correct and contain .capnp files.`,{logLevel:`all`}),null;let p=e.output?e.output.replace(`{projectRoot}`,e.projectRoot).replace(`{workspaceRoot}`,e.workspaceRoot):(0,c.joinPaths)(e.projectRoot,(0,s.relativePath)(l?(0,s.findFilePath)(l):e.projectRoot,(0,c.joinPaths)(e.workspaceRoot,f[0].endsWith(`.capnp`)?(0,s.findFilePath)(f[0]):f[0])));return d.options.outDir=p,{...e,importPath:e.importPath?e.importPath.split(`,`).map(e=>e.trim()):[],workspaceRoot:e.workspaceRoot,projectRoot:e.projectRoot,schemas:f,output:p,js:e.js===!0,ts:e.noTs!==!0,dts:e.dts??e.noDts!==!0,tsconfig:d}}exports.resolveOptions=l;
@@ -1,4 +1,4 @@
1
- import { n as CapnpcOptions, r as CapnpcResolvedOptions } from "./types-D52qMMoK.cjs";
1
+ import { CapnpcOptions, CapnpcResolvedOptions } from "./types.cjs";
2
2
 
3
3
  //#region src/helpers.d.ts
4
4
 
@@ -1,4 +1,4 @@
1
- import { n as CapnpcOptions, r as CapnpcResolvedOptions } from "./types-D03SjfBL.mjs";
1
+ import { CapnpcOptions, CapnpcResolvedOptions } from "./types.mjs";
2
2
 
3
3
  //#region src/helpers.d.ts
4
4
 
package/dist/helpers.mjs CHANGED
@@ -1 +1,2 @@
1
- import{t as e}from"./helpers-BoKbpcuO.mjs";export{e as resolveOptions};
1
+ import{writeFatal as e,writeWarning as t}from"./node_modules/.pnpm/@storm-software_config-tools@1.188.68/node_modules/@storm-software/config-tools/dist/chunk-UU2P3WKA.mjs";import{toArray as n}from"./packages/convert/src/to-array.mjs";import{existsSync as r}from"@stryke/fs/exists";import{parseJsonConfigFileContent as i,sys as a}from"typescript";import{readJsonFile as o}from"@stryke/fs/json";import{listFiles as s}from"@stryke/fs/list-files";import{findFilePath as c,relativePath as l}from"@stryke/path/file-path-fns";import{joinPaths as u}from"@stryke/path/join-paths";async function d(d){let f=d.tsconfigPath?d.tsconfigPath.replace(`{projectRoot}`,d.projectRoot).replace(`{workspaceRoot}`,d.workspaceRoot):u(d.projectRoot,`tsconfig.json`),p=n(d.schemas?d.schemas:u(d.projectRoot,`schemas/**/*.capnp`)).filter(Boolean).map(e=>e.replace(`{projectRoot}`,d.projectRoot).replace(`{workspaceRoot}`,d.workspaceRoot)),m;if(d.tsconfig)m=d.tsconfig;else{if(!f||!r(f)){let t=f?`✖ The specified TypeScript configuration file "${f}" does not exist. Please provide a valid path.`:`✖ The specified TypeScript configuration file does not exist. Please provide a valid path.`;throw e(t,{logLevel:`all`}),Error(t)}if(m=i(await o(f),a,c(f)),!m){let t=`✖ The specified TypeScript configuration file "${f}" is invalid. Please provide a valid configuration.`;throw e(t,{logLevel:`all`}),Error(t)}m.options.configFilePath=f,m.options.noImplicitOverride=!1,m.options.noUnusedLocals=!1,m.options.noUnusedParameters=!1}let h=[];for(let e of p){let t=e;!e.endsWith(`.capnp`)&&!e.includes(`*`)&&(t=`${e.replace(/\/$/g,``)}/*.capnp`),h.push(...await s(t))}if(h.length===0||!h[0])return t(`✖ No Cap'n Proto schema files found in the specified source paths: ${p.join(`, `)}. As a result, the Cap'n Proto compiler will not be able to generate any output files. Please ensure that the paths are correct and contain .capnp files.`,{logLevel:`all`}),null;let g=d.output?d.output.replace(`{projectRoot}`,d.projectRoot).replace(`{workspaceRoot}`,d.workspaceRoot):u(d.projectRoot,l(f?c(f):d.projectRoot,u(d.workspaceRoot,h[0].endsWith(`.capnp`)?c(h[0]):h[0])));return m.options.outDir=g,{...d,importPath:d.importPath?d.importPath.split(`,`).map(e=>e.trim()):[],workspaceRoot:d.workspaceRoot,projectRoot:d.projectRoot,schemas:h,output:g,js:d.js===!0,ts:d.noTs!==!0,dts:d.dts??d.noDts!==!0,tsconfig:m}}export{d as resolveOptions};
2
+ //# sourceMappingURL=helpers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.mjs","names":["resolvedTsconfig!: ParsedCommandLine"],"sources":["../../src/helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\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/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n writeFatal,\n writeWarning\n} from \"@storm-software/config-tools/logger/console\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { readJsonFile } from \"@stryke/fs/json\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { findFilePath, relativePath } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { TsConfigJson } from \"@stryke/types/tsconfig\";\nimport type { ParsedCommandLine } from \"typescript\";\nimport { parseJsonConfigFileContent, sys } from \"typescript\";\nimport type { CapnpcOptions, CapnpcResolvedOptions } from \"./types.js\";\n\n/**\n * Resolves the options for the Cap'n Proto compiler.\n *\n * @param options - The options to resolve\n * @returns The resolved options\n */\nexport async function resolveOptions(\n options: Omit<CapnpcOptions, \"workspaceRoot\" | \"projectRoot\"> &\n Required<Pick<CapnpcOptions, \"workspaceRoot\" | \"projectRoot\">>\n): Promise<CapnpcResolvedOptions | null> {\n const tsconfigPath = options.tsconfigPath\n ? options.tsconfigPath\n .replace(\"{projectRoot}\", options.projectRoot)\n .replace(\"{workspaceRoot}\", options.workspaceRoot)\n : joinPaths(options.projectRoot, \"tsconfig.json\");\n const schemas = toArray(\n options.schemas\n ? options.schemas\n : joinPaths(options.projectRoot, \"schemas/**/*.capnp\")\n )\n .filter(Boolean)\n .map(schema =>\n schema\n .replace(\"{projectRoot}\", options.projectRoot)\n .replace(\"{workspaceRoot}\", options.workspaceRoot)\n );\n\n let resolvedTsconfig!: ParsedCommandLine;\n if (options.tsconfig) {\n resolvedTsconfig = options.tsconfig;\n } else {\n if (!tsconfigPath || !existsSync(tsconfigPath)) {\n const errorMessage = tsconfigPath\n ? `✖ The specified TypeScript configuration file \"${tsconfigPath}\" does not exist. Please provide a valid path.`\n : \"✖ The specified TypeScript configuration file does not exist. Please provide a valid path.\";\n writeFatal(errorMessage, { logLevel: \"all\" });\n\n throw new Error(errorMessage);\n }\n\n const tsconfigFile = await readJsonFile<TsConfigJson>(tsconfigPath);\n resolvedTsconfig = parseJsonConfigFileContent(\n tsconfigFile,\n sys,\n findFilePath(tsconfigPath)\n );\n if (!resolvedTsconfig) {\n const errorMessage = `✖ The specified TypeScript configuration file \"${tsconfigPath}\" is invalid. Please provide a valid configuration.`;\n writeFatal(errorMessage, { logLevel: \"all\" });\n\n throw new Error(errorMessage);\n }\n\n resolvedTsconfig.options.configFilePath = tsconfigPath;\n resolvedTsconfig.options.noImplicitOverride = false;\n resolvedTsconfig.options.noUnusedLocals = false;\n resolvedTsconfig.options.noUnusedParameters = false;\n }\n\n const resolvedSchemas = [] as string[];\n for (const schema of schemas) {\n let formattedSchema = schema;\n if (!schema.endsWith(\".capnp\") && !schema.includes(\"*\")) {\n formattedSchema = `${schema.replace(/\\/$/g, \"\")}/*.capnp`;\n }\n\n resolvedSchemas.push(...(await listFiles(formattedSchema)));\n }\n\n if (resolvedSchemas.length === 0 || !resolvedSchemas[0]) {\n writeWarning(\n `✖ No Cap'n Proto schema files found in the specified source paths: ${schemas.join(\n \", \"\n )}. As a result, the Cap'n Proto compiler will not be able to generate any output files. Please ensure that the paths are correct and contain .capnp files.`,\n { logLevel: \"all\" }\n );\n\n return null;\n }\n\n const output = options.output\n ? options.output\n .replace(\"{projectRoot}\", options.projectRoot)\n .replace(\"{workspaceRoot}\", options.workspaceRoot)\n : joinPaths(\n options.projectRoot,\n relativePath(\n tsconfigPath ? findFilePath(tsconfigPath) : options.projectRoot,\n joinPaths(\n options.workspaceRoot,\n resolvedSchemas[0].endsWith(\".capnp\")\n ? findFilePath(resolvedSchemas[0])\n : resolvedSchemas[0]\n )\n )\n );\n resolvedTsconfig.options.outDir = output;\n\n return {\n ...options,\n importPath: options.importPath\n ? options.importPath.split(\",\").map(dir => dir.trim())\n : [],\n workspaceRoot: options.workspaceRoot,\n projectRoot: options.projectRoot,\n schemas: resolvedSchemas,\n output,\n js: options.js === true,\n ts: options.noTs !== true,\n dts: options.dts ?? options.noDts !== true,\n tsconfig: resolvedTsconfig\n };\n}\n"],"mappings":"2jBAuCA,eAAsB,EACpB,EAEuC,CACvC,IAAM,EAAe,EAAQ,aACzB,EAAQ,aACL,QAAQ,gBAAiB,EAAQ,YAAY,CAC7C,QAAQ,kBAAmB,EAAQ,cAAc,CACpD,EAAU,EAAQ,YAAa,gBAAgB,CAC7C,EAAU,EACd,EAAQ,QACJ,EAAQ,QACR,EAAU,EAAQ,YAAa,qBAAqB,CACzD,CACE,OAAO,QAAQ,CACf,IAAI,GACH,EACG,QAAQ,gBAAiB,EAAQ,YAAY,CAC7C,QAAQ,kBAAmB,EAAQ,cAAc,CACrD,CAECA,EACJ,GAAI,EAAQ,SACV,EAAmB,EAAQ,aACtB,CACL,GAAI,CAAC,GAAgB,CAAC,EAAW,EAAa,CAAE,CAC9C,IAAM,EAAe,EACjB,kDAAkD,EAAa,gDAC/D,6FAGJ,MAFA,EAAW,EAAc,CAAE,SAAU,MAAO,CAAC,CAEnC,MAAM,EAAa,CAS/B,GALA,EAAmB,EADE,MAAM,EAA2B,EAAa,CAGjE,EACA,EAAa,EAAa,CAC3B,CACG,CAAC,EAAkB,CACrB,IAAM,EAAe,kDAAkD,EAAa,qDAGpF,MAFA,EAAW,EAAc,CAAE,SAAU,MAAO,CAAC,CAEnC,MAAM,EAAa,CAG/B,EAAiB,QAAQ,eAAiB,EAC1C,EAAiB,QAAQ,mBAAqB,GAC9C,EAAiB,QAAQ,eAAiB,GAC1C,EAAiB,QAAQ,mBAAqB,GAGhD,IAAM,EAAkB,EAAE,CAC1B,IAAK,IAAM,KAAU,EAAS,CAC5B,IAAI,EAAkB,EAClB,CAAC,EAAO,SAAS,SAAS,EAAI,CAAC,EAAO,SAAS,IAAI,GACrD,EAAkB,GAAG,EAAO,QAAQ,OAAQ,GAAG,CAAC,WAGlD,EAAgB,KAAK,GAAI,MAAM,EAAU,EAAgB,CAAE,CAG7D,GAAI,EAAgB,SAAW,GAAK,CAAC,EAAgB,GAQnD,OAPA,EACE,sEAAsE,EAAQ,KAC5E,KACD,CAAC,2JACF,CAAE,SAAU,MAAO,CACpB,CAEM,KAGT,IAAM,EAAS,EAAQ,OACnB,EAAQ,OACL,QAAQ,gBAAiB,EAAQ,YAAY,CAC7C,QAAQ,kBAAmB,EAAQ,cAAc,CACpD,EACE,EAAQ,YACR,EACE,EAAe,EAAa,EAAa,CAAG,EAAQ,YACpD,EACE,EAAQ,cACR,EAAgB,GAAG,SAAS,SAAS,CACjC,EAAa,EAAgB,GAAG,CAChC,EAAgB,GACrB,CACF,CACF,CAGL,MAFA,GAAiB,QAAQ,OAAS,EAE3B,CACL,GAAG,EACH,WAAY,EAAQ,WAChB,EAAQ,WAAW,MAAM,IAAI,CAAC,IAAI,GAAO,EAAI,MAAM,CAAC,CACpD,EAAE,CACN,cAAe,EAAQ,cACvB,YAAa,EAAQ,YACrB,QAAS,EACT,SACA,GAAI,EAAQ,KAAO,GACnB,GAAI,EAAQ,OAAS,GACrB,IAAK,EAAQ,KAAO,EAAQ,QAAU,GACtC,SAAU,EACX"}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- require(`./helpers-DSMRKdw1.cjs`);const e=require(`./capnp-es.GpvEvMIK-xNDcbmgx.cjs`),t=require(`./compile-ChbJ-p6B.cjs`),n=require(`./types-D6FuBB1k.cjs`),r=require(`./dist-C1gSYYrg.cjs`);exports.AnyPointerList=r.t,exports.BoolList=r.n,exports.CodeGeneratorContext=n.t,exports.CompositeList=e.r,exports.Conn=r.r,exports.Data=e.g,exports.DataList=r.i,exports.Deferred=r.T,exports.DeferredTransport=r.a,exports.ErrorClient=e.v,exports.Float32List=r.o,exports.Float64List=r.s,exports.Int16List=r.c,exports.Int32List=r.l,exports.Int64List=r.u,exports.Int8List=r.d,exports.Interface=r.E,exports.InterfaceList=r.f,exports.List=e.x,exports.ListElementSize=e.S,exports.Message=e.t,exports.ObjectSize=e.T,exports.Orphan=e.E,exports.Pipeline=r.D,exports.Pointer=e.D,exports.PointerList=r.p,exports.PointerType=e.k,exports.Registry=r.O,exports.Server=r.k,exports.Struct=e.q,exports.Text=e.J,exports.TextList=r.m,exports.Uint16List=r.h,exports.Uint32List=r.g,exports.Uint64List=r._,exports.Uint8List=r.v,exports.Void=r.y,exports.VoidList=r.b,exports.answerPipelineClient=r.x,exports.capnpc=t.t,exports.clientFromResolution=r.S,exports.clientOrNull=e.$,exports.compile=t.n,exports.copyCall=r.A,exports.getBitMask=e.i,exports.getFloat32Mask=e.a,exports.getFloat64Mask=e.o,exports.getInt16Mask=e.s,exports.getInt32Mask=e.c,exports.getInt64Mask=e.l,exports.getInt8Mask=e.u,exports.getUint16Mask=e.d,exports.getUint32Mask=e.f,exports.getUint64Mask=e.p,exports.getUint8Mask=e.m,exports.isDataCall=r.j,exports.isFuncCall=r.M,exports.isSameClient=r.C,exports.placeParams=r.N,exports.readRawPointer=e.n,exports.utils=r.w;
1
+ const e=require(`./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.0-_cOx6D.cjs`),t=require(`./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.BvfUH5E6.cjs`),n=require(`./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.GpvEvMIK.cjs`),r=require(`./compile.cjs`),i=require(`./types.cjs`),a=require(`./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.UAt3nLGq.cjs`),o=require(`./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/index.cjs`);exports.AnyPointerList=o.AnyPointerList,exports.BoolList=o.BoolList,exports.CodeGeneratorContext=i.CodeGeneratorContext,exports.CompositeList=t.CompositeList,exports.Conn=o.Conn,exports.Data=e.Data,exports.DataList=o.DataList,exports.Deferred=a.Deferred,exports.DeferredTransport=o.DeferredTransport,exports.ErrorClient=e.ErrorClient,exports.Float32List=o.Float32List,exports.Float64List=o.Float64List,exports.Int16List=o.Int16List,exports.Int32List=o.Int32List,exports.Int64List=o.Int64List,exports.Int8List=o.Int8List,exports.Interface=a.Interface,exports.InterfaceList=o.InterfaceList,exports.List=e.List,exports.ListElementSize=e.ListElementSize,exports.Message=n.Message,exports.ObjectSize=e.ObjectSize,exports.Orphan=e.Orphan,exports.Pipeline=a.Pipeline,exports.Pointer=e.Pointer,exports.PointerList=o.PointerList,exports.PointerType=e.PointerType,exports.Registry=a.Registry,exports.Server=a.Server,exports.Struct=e.Struct,exports.Text=e.Text,exports.TextList=o.TextList,exports.Uint16List=o.Uint16List,exports.Uint32List=o.Uint32List,exports.Uint64List=o.Uint64List,exports.Uint8List=o.Uint8List,exports.Void=o.Void,exports.VoidList=o.VoidList,exports.answerPipelineClient=o.answerPipelineClient,exports.capnpc=r.capnpc,exports.clientFromResolution=o.clientFromResolution,exports.clientOrNull=e.clientOrNull,exports.compile=r.compile,exports.copyCall=a.copyCall,exports.getBitMask=t.getBitMask,exports.getFloat32Mask=t.getFloat32Mask,exports.getFloat64Mask=t.getFloat64Mask,exports.getInt16Mask=t.getInt16Mask,exports.getInt32Mask=t.getInt32Mask,exports.getInt64Mask=t.getInt64Mask,exports.getInt8Mask=t.getInt8Mask,exports.getUint16Mask=t.getUint16Mask,exports.getUint32Mask=t.getUint32Mask,exports.getUint64Mask=t.getUint64Mask,exports.getUint8Mask=t.getUint8Mask,exports.isDataCall=a.isDataCall,exports.isFuncCall=a.isFuncCall,exports.isSameClient=o.isSameClient,exports.placeParams=a.placeParams,exports.readRawPointer=n.readRawPointer,exports.utils=o.utils;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as CodeGeneratorContext, i as CapnpcResult, n as CapnpcOptions, o as CodeGeneratorFileContext, r as CapnpcResolvedOptions, t as CapnpcCLIOptions } from "./types-D52qMMoK.cjs";
2
- import { n as compile, t as capnpc } from "./compile-DccxA7WZ.cjs";
1
+ import { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext } from "./types.cjs";
2
+ import { capnpc, compile } from "./compile.cjs";
3
3
  export * from "capnp-es";
4
4
  export { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext, capnpc, compile };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as CodeGeneratorContext, i as CapnpcResult, n as CapnpcOptions, o as CodeGeneratorFileContext, r as CapnpcResolvedOptions, t as CapnpcCLIOptions } from "./types-D03SjfBL.mjs";
2
- import { n as compile, t as capnpc } from "./compile-UkKIpqrK.mjs";
1
+ import { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext } from "./types.mjs";
2
+ import { capnpc, compile } from "./compile.mjs";
3
3
  export * from "capnp-es";
4
4
  export { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext, capnpc, compile };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import"./helpers-BoKbpcuO.mjs";import{$ as e,D as t,E as n,J as r,S as i,T as a,a as o,c as s,d as c,f as l,g as u,i as d,k as f,l as p,m,n as h,o as g,p as _,q as v,r as y,s as b,t as x,u as S,v as C,x as w}from"./capnp-es.GpvEvMIK-BsgDzeBH.mjs";import{n as T,t as E}from"./compile-DJUj4hs3.mjs";import{t as D}from"./types-BujoAx-K.mjs";import{A as O,C as k,D as A,E as j,M,N,O as P,S as F,T as I,_ as L,a as R,b as z,c as B,d as V,f as H,g as U,h as W,i as G,j as K,k as q,l as J,m as Y,n as X,o as Z,p as Q,r as $,s as ee,t as te,u as ne,v as re,w as ie,x as ae,y as oe}from"./dist-CK47iMja.mjs";export{te as AnyPointerList,X as BoolList,D as CodeGeneratorContext,y as CompositeList,$ as Conn,u as Data,G as DataList,I as Deferred,R as DeferredTransport,C as ErrorClient,Z as Float32List,ee as Float64List,B as Int16List,J as Int32List,ne as Int64List,V as Int8List,j as Interface,H as InterfaceList,w as List,i as ListElementSize,x as Message,a as ObjectSize,n as Orphan,A as Pipeline,t as Pointer,Q as PointerList,f as PointerType,P as Registry,q as Server,v as Struct,r as Text,Y as TextList,W as Uint16List,U as Uint32List,L as Uint64List,re as Uint8List,oe as Void,z as VoidList,ae as answerPipelineClient,E as capnpc,F as clientFromResolution,e as clientOrNull,T as compile,O as copyCall,d as getBitMask,o as getFloat32Mask,g as getFloat64Mask,b as getInt16Mask,s as getInt32Mask,p as getInt64Mask,S as getInt8Mask,c as getUint16Mask,l as getUint32Mask,_ as getUint64Mask,m as getUint8Mask,K as isDataCall,M as isFuncCall,k as isSameClient,N as placeParams,h as readRawPointer,ie as utils};
1
+ import{Data as e,ErrorClient as t,List as n,ListElementSize as r,ObjectSize as i,Orphan as a,Pointer as o,PointerType as s,Struct as c,Text as l,clientOrNull as u}from"./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.0-_cOx6D.mjs";import{CompositeList as d,getBitMask as f,getFloat32Mask as p,getFloat64Mask as m,getInt16Mask as h,getInt32Mask as g,getInt64Mask as _,getInt8Mask as v,getUint16Mask as y,getUint32Mask as b,getUint64Mask as x,getUint8Mask as S}from"./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.BvfUH5E6.mjs";import{Message as C,readRawPointer as w}from"./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.GpvEvMIK.mjs";import{capnpc as T,compile as E}from"./compile.mjs";import{CodeGeneratorContext as D}from"./types.mjs";import{Deferred as O,Interface as k,Pipeline as A,Registry as j,Server as M,copyCall as N,isDataCall as P,isFuncCall as F,placeParams as I}from"./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.UAt3nLGq.mjs";import{AnyPointerList as L,BoolList as R,Conn as z,DataList as B,DeferredTransport as V,Float32List as H,Float64List as U,Int16List as W,Int32List as G,Int64List as K,Int8List as q,InterfaceList as J,PointerList as Y,TextList as X,Uint16List as Z,Uint32List as Q,Uint64List as $,Uint8List as ee,Void as te,VoidList as ne,answerPipelineClient as re,clientFromResolution as ie,isSameClient as ae,utils as oe}from"./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/index.mjs";export{L as AnyPointerList,R as BoolList,D as CodeGeneratorContext,d as CompositeList,z as Conn,e as Data,B as DataList,O as Deferred,V as DeferredTransport,t as ErrorClient,H as Float32List,U as Float64List,W as Int16List,G as Int32List,K as Int64List,q as Int8List,k as Interface,J as InterfaceList,n as List,r as ListElementSize,C as Message,i as ObjectSize,a as Orphan,A as Pipeline,o as Pointer,Y as PointerList,s as PointerType,j as Registry,M as Server,c as Struct,l as Text,X as TextList,Z as Uint16List,Q as Uint32List,$ as Uint64List,ee as Uint8List,te as Void,ne as VoidList,re as answerPipelineClient,T as capnpc,ie as clientFromResolution,u as clientOrNull,E as compile,N as copyCall,f as getBitMask,p as getFloat32Mask,m as getFloat64Mask,h as getInt16Mask,g as getInt32Mask,_ as getInt64Mask,v as getInt8Mask,y as getUint16Mask,b as getUint32Mask,x as getUint64Mask,S as getUint8Mask,P as isDataCall,F as isFuncCall,ae as isSameClient,I as placeParams,w as readRawPointer,oe as utils};
@@ -0,0 +1 @@
1
+ function e(e){return e??=[],Array.isArray(e)?e:[e]}exports.toArray=e;
@@ -0,0 +1,2 @@
1
+ function e(e){return e??=[],Array.isArray(e)?e:[e]}export{e as toArray};
2
+ //# sourceMappingURL=to-array.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-array.mjs","names":[],"sources":["../../../../../../convert/src/to-array.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\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/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Arrayable } from \"@stryke/types/array\";\nimport type { Nullable } from \"@stryke/types/utilities\";\n\n/**\n * Convert `Arrayable<T>` to `Array<T>`\n *\n * @param array - The `Arrayable<T>` to convert\n * @returns An `Array<T>` containing the elements of the input\n */\nexport function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T> {\n array = array ?? [];\n return Array.isArray(array) ? array : [array];\n}\n"],"mappings":"AA2BA,SAAgB,EAAW,EAA0C,CAEnE,MADA,KAAiB,EAAE,CACZ,MAAM,QAAQ,EAAM,CAAG,EAAQ,CAAC,EAAM"}
@@ -1 +1 @@
1
- const e=require(`./helpers-DSMRKdw1.cjs`),t=require(`./capnp-es.GpvEvMIK-xNDcbmgx.cjs`),n=require(`./dist-C1gSYYrg.cjs`);let r=require(`node:worker_threads`);var i=class extends n.a{port;constructor(e){super(),this.port=e,this.port.on(`message`,this.resolve),this.port.on(`messageerror`,this.reject),this.port.on(`close`,this.close)}close=()=>{this.port.off(`message`,this.resolve),this.port.off(`messageerror`,this.reject),this.port.off(`close`,this.close),this.port.close(),super.close()};sendMessage(e){let n=new t.t;n.setRoot(e);let r=n.toArrayBuffer();this.port.postMessage(r,[r])}},a=class{acceptQueue=[];connections={};connectQueue=[];connect(e=0){if(this.connections[e]!==void 0)return this.connections[e];let t=new r.MessageChannel,a=new n.r(new i(t.port1)),o=this.acceptQueue.pop();return this.connections[e]=a,o===void 0?this.connectQueue.push(t.port2):o.resolve(new n.r(new i(t.port2))),a}async accept(){let e=this.connectQueue.pop();if(e!==void 0)return Promise.resolve(new n.r(new i(e)));let t=new n.T;return this.acceptQueue.push(t),t.promise}close(){let e=this.acceptQueue.length;for(;--e>=0;)this.acceptQueue[e]?.reject();for(e=this.connectQueue.length;--e>=0;)this.connectQueue[e].close();for(let e in this.connections)this.connections[e]?.shutdown();this.acceptQueue.length=0,this.connectQueue.length=0,this.connections={}}};exports.CapnpRPC=a,exports.CapnpRPCMessageChannelTransport=i;
1
+ const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.GpvEvMIK.cjs`),n=require(`./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.UAt3nLGq.cjs`),r=require(`./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/index.cjs`);let i=require(`node:worker_threads`);var a=class extends r.DeferredTransport{port;constructor(e){super(),this.port=e,this.port.on(`message`,this.resolve),this.port.on(`messageerror`,this.reject),this.port.on(`close`,this.close)}close=()=>{this.port.off(`message`,this.resolve),this.port.off(`messageerror`,this.reject),this.port.off(`close`,this.close),this.port.close(),super.close()};sendMessage(e){let n=new t.Message;n.setRoot(e);let r=n.toArrayBuffer();this.port.postMessage(r,[r])}},o=class{acceptQueue=[];connections={};connectQueue=[];connect(e=0){if(this.connections[e]!==void 0)return this.connections[e];let t=new i.MessageChannel,n=new r.Conn(new a(t.port1)),o=this.acceptQueue.pop();return this.connections[e]=n,o===void 0?this.connectQueue.push(t.port2):o.resolve(new r.Conn(new a(t.port2))),n}async accept(){let e=this.connectQueue.pop();if(e!==void 0)return Promise.resolve(new r.Conn(new a(e)));let t=new n.Deferred;return this.acceptQueue.push(t),t.promise}close(){let e=this.acceptQueue.length;for(;--e>=0;)this.acceptQueue[e]?.reject();for(e=this.connectQueue.length;--e>=0;)this.connectQueue[e].close();for(let e in this.connections)this.connections[e]?.shutdown();this.acceptQueue.length=0,this.connectQueue.length=0,this.connections={}}};exports.CapnpRPC=o,exports.CapnpRPCMessageChannelTransport=a;
@@ -1,2 +1,2 @@
1
- import{t as e}from"./capnp-es.GpvEvMIK-BsgDzeBH.mjs";import{T as t,a as n,r}from"./dist-CK47iMja.mjs";import{MessageChannel as i}from"node:worker_threads";var a=class extends n{port;constructor(e){super(),this.port=e,this.port.on(`message`,this.resolve),this.port.on(`messageerror`,this.reject),this.port.on(`close`,this.close)}close=()=>{this.port.off(`message`,this.resolve),this.port.off(`messageerror`,this.reject),this.port.off(`close`,this.close),this.port.close(),super.close()};sendMessage(t){let n=new e;n.setRoot(t);let r=n.toArrayBuffer();this.port.postMessage(r,[r])}},o=class{acceptQueue=[];connections={};connectQueue=[];connect(e=0){if(this.connections[e]!==void 0)return this.connections[e];let t=new i,n=new r(new a(t.port1)),o=this.acceptQueue.pop();return this.connections[e]=n,o===void 0?this.connectQueue.push(t.port2):o.resolve(new r(new a(t.port2))),n}async accept(){let e=this.connectQueue.pop();if(e!==void 0)return Promise.resolve(new r(new a(e)));let n=new t;return this.acceptQueue.push(n),n.promise}close(){let e=this.acceptQueue.length;for(;--e>=0;)this.acceptQueue[e]?.reject();for(e=this.connectQueue.length;--e>=0;)this.connectQueue[e].close();for(let e in this.connections)this.connections[e]?.shutdown();this.acceptQueue.length=0,this.connectQueue.length=0,this.connections={}}};export{o as CapnpRPC,a as CapnpRPCMessageChannelTransport};
1
+ import{Message as e}from"./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.GpvEvMIK.mjs";import{Deferred as t}from"./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.UAt3nLGq.mjs";import{Conn as n,DeferredTransport as r}from"./node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/index.mjs";import{MessageChannel as i}from"node:worker_threads";var a=class extends r{port;constructor(e){super(),this.port=e,this.port.on(`message`,this.resolve),this.port.on(`messageerror`,this.reject),this.port.on(`close`,this.close)}close=()=>{this.port.off(`message`,this.resolve),this.port.off(`messageerror`,this.reject),this.port.off(`close`,this.close),this.port.close(),super.close()};sendMessage(t){let n=new e;n.setRoot(t);let r=n.toArrayBuffer();this.port.postMessage(r,[r])}},o=class{acceptQueue=[];connections={};connectQueue=[];connect(e=0){if(this.connections[e]!==void 0)return this.connections[e];let t=new i,r=new n(new a(t.port1)),o=this.acceptQueue.pop();return this.connections[e]=r,o===void 0?this.connectQueue.push(t.port2):o.resolve(new n(new a(t.port2))),r}async accept(){let e=this.connectQueue.pop();if(e!==void 0)return Promise.resolve(new n(new a(e)));let r=new t;return this.acceptQueue.push(r),r.promise}close(){let e=this.acceptQueue.length;for(;--e>=0;)this.acceptQueue[e]?.reject();for(e=this.connectQueue.length;--e>=0;)this.connectQueue[e].close();for(let e in this.connections)this.connections[e]?.shutdown();this.acceptQueue.length=0,this.connectQueue.length=0,this.connections={}}};export{o as CapnpRPC,a as CapnpRPCMessageChannelTransport};
2
2
  //# sourceMappingURL=rpc-helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-helpers.mjs","names":[],"sources":["../../src/rpc-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\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/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Conn, Deferred, DeferredTransport, Message } from \"capnp-es\";\nimport type { Message as RPCMessage } from \"capnp-es/capnp/rpc\";\nimport type { MessagePort } from \"node:worker_threads\";\nimport { MessageChannel } from \"node:worker_threads\";\n\n/**\n * A transport class for Cap'n Proto RPC that uses {@link MessageChannel} for communication.\n */\nexport class CapnpRPCMessageChannelTransport extends DeferredTransport {\n public port: MessagePort;\n\n public constructor(port: MessagePort) {\n super();\n\n this.port = port;\n\n this.port.on(\"message\", this.resolve);\n this.port.on(\"messageerror\", this.reject);\n this.port.on(\"close\", this.close);\n }\n\n /**\n * Closes the transport and removes all event listeners.\n */\n public override close = (): void => {\n this.port.off(\"message\", this.resolve);\n this.port.off(\"messageerror\", this.reject);\n this.port.off(\"close\", this.close);\n this.port.close();\n\n super.close();\n };\n\n /**\n * Sends a Cap'n Proto RPC message over the MessagePort.\n *\n * @param msg - The RPC message to send.\n */\n public sendMessage(msg: RPCMessage): void {\n const m = new Message();\n m.setRoot(msg);\n\n const buf = m.toArrayBuffer();\n this.port.postMessage(buf, [buf]);\n }\n}\n\n/**\n * A class that manages Cap'n Proto RPC connections.\n */\nexport class CapnpRPC {\n /**\n * A queue for deferred connections that are waiting to be accepted.\n *\n * @remarks\n * This is used to manage incoming connections when the accept method is called.\n */\n protected acceptQueue = new Array<Deferred<Conn>>();\n\n /**\n * A map of connections by their ID.\n *\n * @remarks\n * This is used to manage multiple connections and allows for easy retrieval by ID.\n */\n protected connections: Record<number, Conn> = {};\n\n /**\n * A queue for connections that are waiting to be accepted.\n *\n * @remarks\n * This is used to manage incoming connections when the accept method is called.\n */\n protected connectQueue = new Array<MessagePort>();\n\n /**\n * Creates a new {@link Conn} instance.\n *\n * @remarks\n * This class is used to manage connections and accept incoming connections using the {@link MessageChannel} API.\n */\n public connect(id = 0): Conn {\n if (this.connections[id] !== undefined) {\n return this.connections[id];\n }\n\n const ch = new MessageChannel();\n const conn = new Conn(new CapnpRPCMessageChannelTransport(ch.port1));\n const accept = this.acceptQueue.pop();\n this.connections[id] = conn;\n\n if (accept === undefined) {\n this.connectQueue.push(ch.port2);\n } else {\n accept.resolve(new Conn(new CapnpRPCMessageChannelTransport(ch.port2)));\n }\n\n return conn;\n }\n\n /**\n * Accepts a connection from the connect queue.\n *\n * @returns A promise that resolves to a Conn instance when a connection is accepted.\n * @throws If no connections are available in the connect queue.\n */\n public async accept(): Promise<Conn> {\n const port2 = this.connectQueue.pop();\n if (port2 !== undefined) {\n return Promise.resolve(\n new Conn(new CapnpRPCMessageChannelTransport(port2))\n );\n }\n\n const deferred = new Deferred<Conn>();\n this.acceptQueue.push(deferred);\n return deferred.promise;\n }\n\n /**\n * Closes all connections and clears the queues.\n *\n * @remarks\n * This method will reject all pending accept promises and close all\n * connections in the connect queue.\n */\n public close(): void {\n let i = this.acceptQueue.length;\n while (--i >= 0) {\n this.acceptQueue[i]?.reject();\n }\n\n i = this.connectQueue.length;\n while (--i >= 0) {\n this.connectQueue[i]!.close();\n }\n\n for (const id in this.connections) {\n this.connections[id]?.shutdown();\n }\n\n this.acceptQueue.length = 0;\n this.connectQueue.length = 0;\n this.connections = {};\n }\n}\n"],"mappings":"2JA0BA,IAAa,EAAb,cAAqD,CAAkB,CACrE,KAEA,YAAmB,EAAmB,CACpC,OAAO,CAEP,KAAK,KAAO,EAEZ,KAAK,KAAK,GAAG,UAAW,KAAK,QAAQ,CACrC,KAAK,KAAK,GAAG,eAAgB,KAAK,OAAO,CACzC,KAAK,KAAK,GAAG,QAAS,KAAK,MAAM,CAMnC,UAAoC,CAClC,KAAK,KAAK,IAAI,UAAW,KAAK,QAAQ,CACtC,KAAK,KAAK,IAAI,eAAgB,KAAK,OAAO,CAC1C,KAAK,KAAK,IAAI,QAAS,KAAK,MAAM,CAClC,KAAK,KAAK,OAAO,CAEjB,MAAM,OAAO,EAQf,YAAmB,EAAuB,CACxC,IAAM,EAAI,IAAI,EACd,EAAE,QAAQ,EAAI,CAEd,IAAM,EAAM,EAAE,eAAe,CAC7B,KAAK,KAAK,YAAY,EAAK,CAAC,EAAI,CAAC,GAOxB,EAAb,KAAsB,CAOpB,YAAwB,EAA2B,CAQnD,YAA8C,EAAE,CAQhD,aAAyB,EAAwB,CAQjD,QAAe,EAAK,EAAS,CAC3B,GAAI,KAAK,YAAY,KAAQ,IAAA,GAC3B,OAAO,KAAK,YAAY,GAG1B,IAAM,EAAK,IAAI,EACT,EAAO,IAAI,EAAK,IAAI,EAAgC,EAAG,MAAM,CAAC,CAC9D,EAAS,KAAK,YAAY,KAAK,CASrC,MARA,MAAK,YAAY,GAAM,EAEnB,IAAW,IAAA,GACb,KAAK,aAAa,KAAK,EAAG,MAAM,CAEhC,EAAO,QAAQ,IAAI,EAAK,IAAI,EAAgC,EAAG,MAAM,CAAC,CAAC,CAGlE,EAST,MAAa,QAAwB,CACnC,IAAM,EAAQ,KAAK,aAAa,KAAK,CACrC,GAAI,IAAU,IAAA,GACZ,OAAO,QAAQ,QACb,IAAI,EAAK,IAAI,EAAgC,EAAM,CAAC,CACrD,CAGH,IAAM,EAAW,IAAI,EAErB,OADA,KAAK,YAAY,KAAK,EAAS,CACxB,EAAS,QAUlB,OAAqB,CACnB,IAAI,EAAI,KAAK,YAAY,OACzB,KAAO,EAAE,GAAK,GACZ,KAAK,YAAY,IAAI,QAAQ,CAI/B,IADA,EAAI,KAAK,aAAa,OACf,EAAE,GAAK,GACZ,KAAK,aAAa,GAAI,OAAO,CAG/B,IAAK,IAAM,KAAM,KAAK,YACpB,KAAK,YAAY,IAAK,UAAU,CAGlC,KAAK,YAAY,OAAS,EAC1B,KAAK,aAAa,OAAS,EAC3B,KAAK,YAAc,EAAE"}
1
+ {"version":3,"file":"rpc-helpers.mjs","names":[],"sources":["../../src/rpc-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\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/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Conn, Deferred, DeferredTransport, Message } from \"capnp-es\";\nimport type { Message as RPCMessage } from \"capnp-es/capnp/rpc\";\nimport type { MessagePort } from \"node:worker_threads\";\nimport { MessageChannel } from \"node:worker_threads\";\n\n/**\n * A transport class for Cap'n Proto RPC that uses {@link MessageChannel} for communication.\n */\nexport class CapnpRPCMessageChannelTransport extends DeferredTransport {\n public port: MessagePort;\n\n public constructor(port: MessagePort) {\n super();\n\n this.port = port;\n\n this.port.on(\"message\", this.resolve);\n this.port.on(\"messageerror\", this.reject);\n this.port.on(\"close\", this.close);\n }\n\n /**\n * Closes the transport and removes all event listeners.\n */\n public override close = (): void => {\n this.port.off(\"message\", this.resolve);\n this.port.off(\"messageerror\", this.reject);\n this.port.off(\"close\", this.close);\n this.port.close();\n\n super.close();\n };\n\n /**\n * Sends a Cap'n Proto RPC message over the MessagePort.\n *\n * @param msg - The RPC message to send.\n */\n public sendMessage(msg: RPCMessage): void {\n const m = new Message();\n m.setRoot(msg);\n\n const buf = m.toArrayBuffer();\n this.port.postMessage(buf, [buf]);\n }\n}\n\n/**\n * A class that manages Cap'n Proto RPC connections.\n */\nexport class CapnpRPC {\n /**\n * A queue for deferred connections that are waiting to be accepted.\n *\n * @remarks\n * This is used to manage incoming connections when the accept method is called.\n */\n protected acceptQueue = new Array<Deferred<Conn>>();\n\n /**\n * A map of connections by their ID.\n *\n * @remarks\n * This is used to manage multiple connections and allows for easy retrieval by ID.\n */\n protected connections: Record<number, Conn> = {};\n\n /**\n * A queue for connections that are waiting to be accepted.\n *\n * @remarks\n * This is used to manage incoming connections when the accept method is called.\n */\n protected connectQueue = new Array<MessagePort>();\n\n /**\n * Creates a new {@link Conn} instance.\n *\n * @remarks\n * This class is used to manage connections and accept incoming connections using the {@link MessageChannel} API.\n */\n public connect(id = 0): Conn {\n if (this.connections[id] !== undefined) {\n return this.connections[id];\n }\n\n const ch = new MessageChannel();\n const conn = new Conn(new CapnpRPCMessageChannelTransport(ch.port1));\n const accept = this.acceptQueue.pop();\n this.connections[id] = conn;\n\n if (accept === undefined) {\n this.connectQueue.push(ch.port2);\n } else {\n accept.resolve(new Conn(new CapnpRPCMessageChannelTransport(ch.port2)));\n }\n\n return conn;\n }\n\n /**\n * Accepts a connection from the connect queue.\n *\n * @returns A promise that resolves to a Conn instance when a connection is accepted.\n * @throws If no connections are available in the connect queue.\n */\n public async accept(): Promise<Conn> {\n const port2 = this.connectQueue.pop();\n if (port2 !== undefined) {\n return Promise.resolve(\n new Conn(new CapnpRPCMessageChannelTransport(port2))\n );\n }\n\n const deferred = new Deferred<Conn>();\n this.acceptQueue.push(deferred);\n return deferred.promise;\n }\n\n /**\n * Closes all connections and clears the queues.\n *\n * @remarks\n * This method will reject all pending accept promises and close all\n * connections in the connect queue.\n */\n public close(): void {\n let i = this.acceptQueue.length;\n while (--i >= 0) {\n this.acceptQueue[i]?.reject();\n }\n\n i = this.connectQueue.length;\n while (--i >= 0) {\n this.connectQueue[i]!.close();\n }\n\n for (const id in this.connections) {\n this.connections[id]?.shutdown();\n }\n\n this.acceptQueue.length = 0;\n this.connectQueue.length = 0;\n this.connections = {};\n }\n}\n"],"mappings":"mrBA0BA,IAAa,EAAb,cAAqD,CAAkB,CACrE,KAEA,YAAmB,EAAmB,CACpC,OAAO,CAEP,KAAK,KAAO,EAEZ,KAAK,KAAK,GAAG,UAAW,KAAK,QAAQ,CACrC,KAAK,KAAK,GAAG,eAAgB,KAAK,OAAO,CACzC,KAAK,KAAK,GAAG,QAAS,KAAK,MAAM,CAMnC,UAAoC,CAClC,KAAK,KAAK,IAAI,UAAW,KAAK,QAAQ,CACtC,KAAK,KAAK,IAAI,eAAgB,KAAK,OAAO,CAC1C,KAAK,KAAK,IAAI,QAAS,KAAK,MAAM,CAClC,KAAK,KAAK,OAAO,CAEjB,MAAM,OAAO,EAQf,YAAmB,EAAuB,CACxC,IAAM,EAAI,IAAI,EACd,EAAE,QAAQ,EAAI,CAEd,IAAM,EAAM,EAAE,eAAe,CAC7B,KAAK,KAAK,YAAY,EAAK,CAAC,EAAI,CAAC,GAOxB,EAAb,KAAsB,CAOpB,YAAwB,EAA2B,CAQnD,YAA8C,EAAE,CAQhD,aAAyB,EAAwB,CAQjD,QAAe,EAAK,EAAS,CAC3B,GAAI,KAAK,YAAY,KAAQ,IAAA,GAC3B,OAAO,KAAK,YAAY,GAG1B,IAAM,EAAK,IAAI,EACT,EAAO,IAAI,EAAK,IAAI,EAAgC,EAAG,MAAM,CAAC,CAC9D,EAAS,KAAK,YAAY,KAAK,CASrC,MARA,MAAK,YAAY,GAAM,EAEnB,IAAW,IAAA,GACb,KAAK,aAAa,KAAK,EAAG,MAAM,CAEhC,EAAO,QAAQ,IAAI,EAAK,IAAI,EAAgC,EAAG,MAAM,CAAC,CAAC,CAGlE,EAST,MAAa,QAAwB,CACnC,IAAM,EAAQ,KAAK,aAAa,KAAK,CACrC,GAAI,IAAU,IAAA,GACZ,OAAO,QAAQ,QACb,IAAI,EAAK,IAAI,EAAgC,EAAM,CAAC,CACrD,CAGH,IAAM,EAAW,IAAI,EAErB,OADA,KAAK,YAAY,KAAK,EAAS,CACxB,EAAS,QAUlB,OAAqB,CACnB,IAAI,EAAI,KAAK,YAAY,OACzB,KAAO,EAAE,GAAK,GACZ,KAAK,YAAY,IAAI,QAAQ,CAI/B,IADA,EAAI,KAAK,aAAa,OACf,EAAE,GAAK,GACZ,KAAK,aAAa,GAAI,OAAO,CAG/B,IAAK,IAAM,KAAM,KAAK,YACpB,KAAK,YAAY,IAAK,UAAU,CAGlC,KAAK,YAAY,OAAS,EAC1B,KAAK,aAAa,OAAS,EAC3B,KAAK,YAAc,EAAE"}
package/dist/types.cjs CHANGED
@@ -1 +1 @@
1
- const e=require(`./types-D6FuBB1k.cjs`);exports.CodeGeneratorContext=e.t;
1
+ var e=class{files=[]};exports.CodeGeneratorContext=e;
package/dist/types.d.cts CHANGED
@@ -1,2 +1,55 @@
1
- import { a as CodeGeneratorContext, i as CapnpcResult, n as CapnpcOptions, o as CodeGeneratorFileContext, r as CapnpcResolvedOptions, t as CapnpcCLIOptions } from "./types-D52qMMoK.cjs";
2
- export { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext };
1
+ import { CodeGeneratorRequest_RequestedFile_Import, Field, Node } from "capnp-es/capnp/schema";
2
+ import { ParsedCommandLine } from "typescript";
3
+
4
+ //#region src/types.d.ts
5
+ interface CodeGeneratorFileContext {
6
+ readonly nodes: Node[];
7
+ readonly imports: CodeGeneratorRequest_RequestedFile_Import[];
8
+ concreteLists: Array<[string, Field]>;
9
+ generatedNodeIds: Set<string>;
10
+ generatedResultsPromiseIds: Set<bigint>;
11
+ tsPath: string;
12
+ codeParts?: string[];
13
+ constructor: any;
14
+ toString: () => string;
15
+ }
16
+ declare class CodeGeneratorContext {
17
+ files: CodeGeneratorFileContext[];
18
+ }
19
+ interface CapnpcCLIOptions {
20
+ noTs?: boolean;
21
+ js?: boolean;
22
+ dts?: boolean;
23
+ noDts?: boolean;
24
+ schema?: string;
25
+ output?: string;
26
+ importPath?: string;
27
+ tsconfig?: string;
28
+ skipGenerateId?: boolean;
29
+ noStandardImport?: boolean;
30
+ projectRoot?: string;
31
+ workspaceRoot?: string;
32
+ tty?: boolean;
33
+ }
34
+ type CapnpcOptions = Omit<CapnpcCLIOptions, "tsconfig" | "schema"> & {
35
+ schemas: string | string[];
36
+ } & ({
37
+ tsconfig: ParsedCommandLine;
38
+ tsconfigPath?: string;
39
+ } | {
40
+ tsconfig?: ParsedCommandLine;
41
+ tsconfigPath: string;
42
+ });
43
+ type CapnpcResolvedOptions = Omit<CapnpcOptions, "noTs" | "noDts" | "schemas" | "tsconfigPath" | "output" | "importPath" | "projectRoot" | "workspaceRoot"> & Required<Pick<CapnpcOptions, "output" | "projectRoot" | "workspaceRoot">> & {
44
+ ts: boolean;
45
+ importPath: string[];
46
+ schemas: string[];
47
+ tsconfig: ParsedCommandLine;
48
+ };
49
+ interface CapnpcResult {
50
+ ctx: CodeGeneratorContext;
51
+ files: Map<string, string>;
52
+ }
53
+ //#endregion
54
+ export { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext };
55
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/types.ts"],"sourcesContent":[],"mappings":";;;;UA4BiB,wBAAA;kBAEC;EAFD,SAAA,OAAA,EAGG,yCAHqB,EAAA;EAEvB,aAAA,EAID,KAJC,CAAA,CAAA,MAAA,EAIc,KAJd,CAAA,CAAA;EACE,gBAAA,EAIA,GAJA,CAAA,MAAA,CAAA;EAGY,0BAAA,EAEF,GAFE,CAAA,MAAA,CAAA;EAAf,MAAA,EAAA,MAAA;EACG,SAAA,CAAA,EAAA,MAAA,EAAA;EACU,WAAA,EAAA,GAAA;EAAG,QAAA,EAAA,GAAA,GAAA,MAAA;AASjC;AAIiB,cAJJ,oBAAA,CAIoB;EAgBrB,KAAA,EAnBH,wBAmBgB,EAAA;;AAAG,UAhBX,gBAAA,CAgBW;EAIV,IAAA,CAAA,EAAA,OAAA;EAIC,EAAA,CAAA,EAAA,OAAA;EAAiB,GAAA,CAAA,EAAA,OAAA;EAKxB,KAAA,CAAA,EAAA,OAAA;EACV,MAAA,CAAA,EAAA,MAAA;EADkC,MAAA,CAAA,EAAA,MAAA;EAWpB,UAAA,CAAA,EAAA,MAAA;EAAL,QAAA,CAAA,EAAA,MAAA;EAAT,cAAA,CAAA,EAAA,OAAA;EAIY,gBAAA,CAAA,EAAA,OAAA;EAAiB,WAAA,CAAA,EAAA,MAAA;EAGd,aAAA,CAAA,EAAY,MAAA;;;KA/BjB,aAAA,GAAgB,KAAK;;;YAIf;;;aAIC;;;KAKP,qBAAA,GAAwB,KAClC,4HAUA,SAAS,KAAK;;;;YAIF;;UAGG,YAAA;OACV;SACE"}
package/dist/types.d.mts CHANGED
@@ -1,2 +1,55 @@
1
- import { a as CodeGeneratorContext, i as CapnpcResult, n as CapnpcOptions, o as CodeGeneratorFileContext, r as CapnpcResolvedOptions, t as CapnpcCLIOptions } from "./types-D03SjfBL.mjs";
2
- export { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext };
1
+ import { ParsedCommandLine } from "typescript";
2
+ import { CodeGeneratorRequest_RequestedFile_Import, Field, Node } from "capnp-es/capnp/schema";
3
+
4
+ //#region src/types.d.ts
5
+ interface CodeGeneratorFileContext {
6
+ readonly nodes: Node[];
7
+ readonly imports: CodeGeneratorRequest_RequestedFile_Import[];
8
+ concreteLists: Array<[string, Field]>;
9
+ generatedNodeIds: Set<string>;
10
+ generatedResultsPromiseIds: Set<bigint>;
11
+ tsPath: string;
12
+ codeParts?: string[];
13
+ constructor: any;
14
+ toString: () => string;
15
+ }
16
+ declare class CodeGeneratorContext {
17
+ files: CodeGeneratorFileContext[];
18
+ }
19
+ interface CapnpcCLIOptions {
20
+ noTs?: boolean;
21
+ js?: boolean;
22
+ dts?: boolean;
23
+ noDts?: boolean;
24
+ schema?: string;
25
+ output?: string;
26
+ importPath?: string;
27
+ tsconfig?: string;
28
+ skipGenerateId?: boolean;
29
+ noStandardImport?: boolean;
30
+ projectRoot?: string;
31
+ workspaceRoot?: string;
32
+ tty?: boolean;
33
+ }
34
+ type CapnpcOptions = Omit<CapnpcCLIOptions, "tsconfig" | "schema"> & {
35
+ schemas: string | string[];
36
+ } & ({
37
+ tsconfig: ParsedCommandLine;
38
+ tsconfigPath?: string;
39
+ } | {
40
+ tsconfig?: ParsedCommandLine;
41
+ tsconfigPath: string;
42
+ });
43
+ type CapnpcResolvedOptions = Omit<CapnpcOptions, "noTs" | "noDts" | "schemas" | "tsconfigPath" | "output" | "importPath" | "projectRoot" | "workspaceRoot"> & Required<Pick<CapnpcOptions, "output" | "projectRoot" | "workspaceRoot">> & {
44
+ ts: boolean;
45
+ importPath: string[];
46
+ schemas: string[];
47
+ tsconfig: ParsedCommandLine;
48
+ };
49
+ interface CapnpcResult {
50
+ ctx: CodeGeneratorContext;
51
+ files: Map<string, string>;
52
+ }
53
+ //#endregion
54
+ export { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext };
55
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/types.ts"],"sourcesContent":[],"mappings":";;;;UA4BiB,wBAAA;kBAEC;EAFD,SAAA,OAAA,EAGG,yCAHqB,EAAA;EAEvB,aAAA,EAID,KAJC,CAAA,CAAA,MAAA,EAIc,KAJd,CAAA,CAAA;EACE,gBAAA,EAIA,GAJA,CAAA,MAAA,CAAA;EAGY,0BAAA,EAEF,GAFE,CAAA,MAAA,CAAA;EAAf,MAAA,EAAA,MAAA;EACG,SAAA,CAAA,EAAA,MAAA,EAAA;EACU,WAAA,EAAA,GAAA;EAAG,QAAA,EAAA,GAAA,GAAA,MAAA;AASjC;AAIiB,cAJJ,oBAAA,CAIoB;EAgBrB,KAAA,EAnBH,wBAmBgB,EAAA;;AAAG,UAhBX,gBAAA,CAgBW;EAIV,IAAA,CAAA,EAAA,OAAA;EAIC,EAAA,CAAA,EAAA,OAAA;EAAiB,GAAA,CAAA,EAAA,OAAA;EAKxB,KAAA,CAAA,EAAA,OAAA;EACV,MAAA,CAAA,EAAA,MAAA;EADkC,MAAA,CAAA,EAAA,MAAA;EAWpB,UAAA,CAAA,EAAA,MAAA;EAAL,QAAA,CAAA,EAAA,MAAA;EAAT,cAAA,CAAA,EAAA,OAAA;EAIY,gBAAA,CAAA,EAAA,OAAA;EAAiB,WAAA,CAAA,EAAA,MAAA;EAGd,aAAA,CAAA,EAAY,MAAA;;;KA/BjB,aAAA,GAAgB,KAAK;;;YAIf;;;aAIC;;;KAKP,qBAAA,GAAwB,KAClC,4HAUA,SAAS,KAAK;;;;YAIF;;UAGG,YAAA;OACV;SACE"}
package/dist/types.mjs CHANGED
@@ -1 +1,2 @@
1
- import{t as e}from"./types-BujoAx-K.mjs";export{e as CodeGeneratorContext};
1
+ var e=class{files=[]};export{e as CodeGeneratorContext};
2
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../src/types.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\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/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/* eslint-disable camelcase */\n\nimport type {\n CodeGeneratorRequest_RequestedFile_Import,\n Field,\n Node\n} from \"capnp-es/capnp/schema\";\n// eslint-disable-next-line ts/consistent-type-imports\nimport { ParsedCommandLine } from \"typescript\";\n\nexport interface CodeGeneratorFileContext {\n // inputs\n readonly nodes: Node[];\n readonly imports: CodeGeneratorRequest_RequestedFile_Import[];\n\n // outputs\n concreteLists: Array<[string, Field]>;\n generatedNodeIds: Set<string>;\n generatedResultsPromiseIds: Set<bigint>;\n tsPath: string;\n codeParts?: string[];\n\n constructor: any;\n\n toString: () => string;\n}\n\nexport class CodeGeneratorContext {\n files: CodeGeneratorFileContext[] = [];\n}\n\nexport interface CapnpcCLIOptions {\n noTs?: boolean;\n js?: boolean;\n dts?: boolean;\n noDts?: boolean;\n schema?: string;\n output?: string;\n importPath?: string;\n tsconfig?: string;\n skipGenerateId?: boolean;\n noStandardImport?: boolean;\n projectRoot?: string;\n workspaceRoot?: string;\n tty?: boolean;\n}\n\nexport type CapnpcOptions = Omit<CapnpcCLIOptions, \"tsconfig\" | \"schema\"> & {\n schemas: string | string[];\n} & (\n | {\n tsconfig: ParsedCommandLine;\n tsconfigPath?: string;\n }\n | {\n tsconfig?: ParsedCommandLine;\n tsconfigPath: string;\n }\n );\n\nexport type CapnpcResolvedOptions = Omit<\n CapnpcOptions,\n | \"noTs\"\n | \"noDts\"\n | \"schemas\"\n | \"tsconfigPath\"\n | \"output\"\n | \"importPath\"\n | \"projectRoot\"\n | \"workspaceRoot\"\n> &\n Required<Pick<CapnpcOptions, \"output\" | \"projectRoot\" | \"workspaceRoot\">> & {\n ts: boolean;\n importPath: string[];\n schemas: string[];\n tsconfig: ParsedCommandLine;\n };\n\nexport interface CapnpcResult {\n ctx: CodeGeneratorContext;\n files: Map<string, string>;\n}\n"],"mappings":"AA6CA,IAAa,EAAb,KAAkC,CAChC,MAAoC,EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/capnp",
3
- "version": "0.12.45",
3
+ "version": "0.12.46",
4
4
  "type": "module",
5
5
  "description": "A package to assist in running the Cap'n Proto compiler and creating Cap'n Proto serialization protocol schemas.",
6
6
  "repository": {
@@ -106,24 +106,24 @@
106
106
  "peerDependencies": { "typescript": ">=4.0.0" },
107
107
  "peerDependenciesMeta": { "typescript": { "optional": false } },
108
108
  "dependencies": {
109
- "@stryke/fs": "^0.33.20",
110
- "@stryke/path": "^0.22.11",
109
+ "@stryke/fs": "^0.33.21",
110
+ "@stryke/path": "^0.22.12",
111
111
  "defu": "^6.1.4",
112
112
  "hex2dec": "^1.1.2",
113
113
  "nanotar": "^0.2.0"
114
114
  },
115
115
  "devDependencies": {
116
- "@storm-software/config": "^1.134.60",
117
- "@storm-software/config-tools": "^1.188.60",
118
- "@storm-software/testing-tools": "^1.119.60",
119
- "@types/node": "^24.10.1",
116
+ "@storm-software/config": "^1.134.68",
117
+ "@storm-software/config-tools": "^1.188.68",
118
+ "@storm-software/testing-tools": "^1.119.67",
119
+ "@types/node": "^24.10.4",
120
120
  "capnp-es": "^0.0.11",
121
121
  "chalk": "^5.6.2",
122
122
  "commander": "^14.0.2",
123
123
  "dts-bundle-generator": "^9.5.1",
124
- "tsdown": "^0.17.1",
124
+ "tsdown": "^0.17.2",
125
125
  "tsx": "^4.21.0"
126
126
  },
127
127
  "publishConfig": { "access": "public" },
128
- "gitHead": "fd38508c876b697a52a0e27df1478b41ae011583"
128
+ "gitHead": "8f2e484743eb3ce54929e99096ca2ea188b4730e"
129
129
  }
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n&&e(r,Symbol.toStringTag,{value:`Module`}),r},a=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},o=(t,n,r,i)=>{i&&(e(t,Symbol.toStringTag,{value:`Module`}),r&&e(r,Symbol.toStringTag,{value:`Module`})),a(t,n,`default`),r&&a(r,n,`default`)};export{i as __export,o as __reExport};
@@ -0,0 +1 @@
1
+ const e=require(`../../../_virtual/rolldown_runtime.cjs`);require(`./helpers.cjs`),require(`@stryke/fs/exists`),require(`defu`);
@@ -1,6 +1,6 @@
1
- import { i as CapnpcResult, n as CapnpcOptions, r as CapnpcResolvedOptions } from "./types-D52qMMoK.cjs";
2
- import * as capnp_es_capnp_schema0 from "capnp-es/capnp/schema";
1
+ import { CapnpcOptions, CapnpcResolvedOptions, CapnpcResult } from "./types.mjs";
3
2
  import { Buffer } from "node:buffer";
3
+ import * as capnp_es_capnp_schema0 from "capnp-es/capnp/schema";
4
4
 
5
5
  //#region src/compile.d.ts
6
6
 
@@ -36,5 +36,5 @@ declare function compile(dataBuf: Buffer, options: CapnpcOptions): Promise<{
36
36
  files: Map<string, string>;
37
37
  } | undefined>;
38
38
  //#endregion
39
- export { compile as n, capnpc as t };
40
- //# sourceMappingURL=compile-DccxA7WZ.d.cts.map
39
+ export { capnpc, compile };
40
+ //# sourceMappingURL=compile.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compile-DccxA7WZ.d.cts","names":[],"sources":["../../src/compile.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAqCA;;;AAEG,iBAFmB,MAAA,CAEnB,OAAA,EADQ,qBACR,CAAA,EAAA,OAAA,CAAQ,YAAR,CAAA;;AA0EH;;;;;;iBAAsB,OAAA,UAAiB,iBAAiB,gBAAa;;;oBAAA,sBAAA,CAAA;;;MAAA,SAAA,OAAA,oEAAA;MAAA,aAAA,OAAA,CAAA,CAAA,MAAA,+BAAA,CAAA"}
1
+ {"version":3,"file":"compile.d.mts","names":[],"sources":["../../../../../src/compile.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAqCA;;;AAEG,iBAFmB,MAAA,CAEnB,OAAA,EADQ,qBACR,CAAA,EAAA,OAAA,CAAQ,YAAR,CAAA;;AA0EH;;;;;;iBAAsB,OAAA,UAAiB,iBAAiB,gBAAa;;;oBAAA,sBAAA,CAAA;;;MAAA,SAAA,OAAA,oEAAA;MAAA,aAAA,OAAA,CAAA,CAAA,MAAA,+BAAA,CAAA"}
@@ -0,0 +1 @@
1
+ import"./helpers.mjs";import"@stryke/fs/exists";import"defu";import{Buffer as e}from"node:buffer";export{};
@@ -0,0 +1 @@
1
+ require(`@stryke/fs/exists`),require(`typescript`),require(`@stryke/fs/json`),require(`@stryke/fs/list-files`),require(`@stryke/path/file-path-fns`),require(`@stryke/path/join-paths`);
@@ -0,0 +1 @@
1
+ import"@stryke/fs/exists";import"typescript";import"@stryke/fs/json";import"@stryke/fs/list-files";import"@stryke/path/file-path-fns";import"@stryke/path/join-paths";export{};
@@ -0,0 +1 @@
1
+ const e=require(`../../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.0-_cOx6D.cjs`),t=require(`../../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.BvfUH5E6.cjs`),n=require(`../../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.GpvEvMIK.cjs`);require(`./compile.cjs`);const r=require(`../../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.UAt3nLGq.cjs`),i=require(`../../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/index.cjs`);
@@ -0,0 +1,13 @@
1
+ import { __export, __reExport } from "../../../_virtual/rolldown_runtime.mjs";
2
+ import { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext } from "./types.mjs";
3
+ import { capnpc, compile } from "./compile.mjs";
4
+ export * from "capnp-es";
5
+
6
+ //#region src/index.d.ts
7
+ declare namespace index_d_exports {
8
+ export { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext, capnpc, compile };
9
+ }
10
+ import * as import_capnp_es from "capnp-es";
11
+ //#endregion
12
+ export { import_capnp_es as index_d_exports };
13
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../src/index.ts"],"sourcesContent":[],"mappings":""}
@@ -0,0 +1 @@
1
+ import{Data as e,ErrorClient as t,List as n,ListElementSize as r,ObjectSize as i,Orphan as a,Pointer as o,PointerType as s,Struct as c,Text as l,clientOrNull as u}from"../../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.0-_cOx6D.mjs";import{CompositeList as d,getBitMask as f,getUint16Mask as p,getUint8Mask as m}from"../../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.BvfUH5E6.mjs";import{Message as h,readRawPointer as g}from"../../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.GpvEvMIK.mjs";import"./compile.mjs";import{Deferred as _,Interface as v,Pipeline as y,Registry as b,Server as x,copyCall as S,isDataCall as C,placeParams as w}from"../../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/shared/capnp-es.UAt3nLGq.mjs";import{PointerList as T,Void as E,utils as D}from"../../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash_503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.3/node_modules/capnp-es/dist/index.mjs";export{};
@@ -51,5 +51,5 @@ interface CapnpcResult {
51
51
  files: Map<string, string>;
52
52
  }
53
53
  //#endregion
54
- export { CodeGeneratorContext as a, CapnpcResult as i, CapnpcOptions as n, CodeGeneratorFileContext as o, CapnpcResolvedOptions as r, CapnpcCLIOptions as t };
55
- //# sourceMappingURL=types-D03SjfBL.d.mts.map
54
+ export { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext };
55
+ //# sourceMappingURL=types.d.mts.map