@stryke/capnp 0.4.1 → 0.4.2
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/bin/capnpc.cjs +17 -21
- package/bin/capnpc.js +17 -21
- package/dist/{chunk-3FC7SST2.js → chunk-BIIH7QKH.js} +17 -21
- package/dist/{chunk-GFNNH76I.cjs → chunk-WYA7EDMT.cjs} +17 -21
- package/dist/compile.cjs +2 -2
- package/dist/compile.d.cts +6 -0
- package/dist/compile.d.ts +6 -0
- package/dist/compile.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/bin/capnpc.cjs
CHANGED
|
@@ -989,30 +989,26 @@ var import_compiler = require("capnp-es/compiler");
|
|
|
989
989
|
var import_node_buffer2 = require("buffer");
|
|
990
990
|
var import_node_child_process = require("child_process");
|
|
991
991
|
var import_node_fs6 = require("fs");
|
|
992
|
-
async function readStdin() {
|
|
993
|
-
if (process.stdin.isTTY) {
|
|
994
|
-
return import_node_buffer2.Buffer.alloc(0);
|
|
995
|
-
}
|
|
996
|
-
const chunks = [];
|
|
997
|
-
process.stdin.on("data", (chunk) => {
|
|
998
|
-
chunks.push(chunk);
|
|
999
|
-
});
|
|
1000
|
-
await new Promise((resolve) => {
|
|
1001
|
-
process.stdin.on("end", resolve);
|
|
1002
|
-
});
|
|
1003
|
-
const reqBuffer = import_node_buffer2.Buffer.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
|
|
1004
|
-
let i = 0;
|
|
1005
|
-
for (const chunk of chunks) {
|
|
1006
|
-
chunk.copy(reqBuffer, i);
|
|
1007
|
-
i += chunk.byteLength;
|
|
1008
|
-
}
|
|
1009
|
-
return reqBuffer;
|
|
1010
|
-
}
|
|
1011
|
-
__name(readStdin, "readStdin");
|
|
1012
992
|
async function capnpc(options) {
|
|
1013
993
|
try {
|
|
1014
994
|
const { output, tsconfig, schema = [] } = options;
|
|
1015
|
-
let dataBuf =
|
|
995
|
+
let dataBuf = import_node_buffer2.Buffer.alloc(0);
|
|
996
|
+
if (!process.stdin.isTTY) {
|
|
997
|
+
const chunks = [];
|
|
998
|
+
process.stdin.on("data", (chunk) => {
|
|
999
|
+
chunks.push(chunk);
|
|
1000
|
+
});
|
|
1001
|
+
await new Promise((resolve) => {
|
|
1002
|
+
process.stdin.on("end", resolve);
|
|
1003
|
+
});
|
|
1004
|
+
const reqBuffer = import_node_buffer2.Buffer.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
|
|
1005
|
+
let i = 0;
|
|
1006
|
+
for (const chunk of chunks) {
|
|
1007
|
+
chunk.copy(reqBuffer, i);
|
|
1008
|
+
i += chunk.byteLength;
|
|
1009
|
+
}
|
|
1010
|
+
dataBuf = reqBuffer;
|
|
1011
|
+
}
|
|
1016
1012
|
if (dataBuf.byteLength === 0) {
|
|
1017
1013
|
const opts = [];
|
|
1018
1014
|
if (output) {
|
package/bin/capnpc.js
CHANGED
|
@@ -957,30 +957,26 @@ import { compileAll } from "capnp-es/compiler";
|
|
|
957
957
|
import { Buffer as Buffer3 } from "node:buffer";
|
|
958
958
|
import { exec } from "node:child_process";
|
|
959
959
|
import { existsSync as existsSync3 } from "node:fs";
|
|
960
|
-
async function readStdin() {
|
|
961
|
-
if (process.stdin.isTTY) {
|
|
962
|
-
return Buffer3.alloc(0);
|
|
963
|
-
}
|
|
964
|
-
const chunks = [];
|
|
965
|
-
process.stdin.on("data", (chunk) => {
|
|
966
|
-
chunks.push(chunk);
|
|
967
|
-
});
|
|
968
|
-
await new Promise((resolve) => {
|
|
969
|
-
process.stdin.on("end", resolve);
|
|
970
|
-
});
|
|
971
|
-
const reqBuffer = Buffer3.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
|
|
972
|
-
let i = 0;
|
|
973
|
-
for (const chunk of chunks) {
|
|
974
|
-
chunk.copy(reqBuffer, i);
|
|
975
|
-
i += chunk.byteLength;
|
|
976
|
-
}
|
|
977
|
-
return reqBuffer;
|
|
978
|
-
}
|
|
979
|
-
__name(readStdin, "readStdin");
|
|
980
960
|
async function capnpc(options) {
|
|
981
961
|
try {
|
|
982
962
|
const { output, tsconfig, schema = [] } = options;
|
|
983
|
-
let dataBuf =
|
|
963
|
+
let dataBuf = Buffer3.alloc(0);
|
|
964
|
+
if (!process.stdin.isTTY) {
|
|
965
|
+
const chunks = [];
|
|
966
|
+
process.stdin.on("data", (chunk) => {
|
|
967
|
+
chunks.push(chunk);
|
|
968
|
+
});
|
|
969
|
+
await new Promise((resolve) => {
|
|
970
|
+
process.stdin.on("end", resolve);
|
|
971
|
+
});
|
|
972
|
+
const reqBuffer = Buffer3.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
|
|
973
|
+
let i = 0;
|
|
974
|
+
for (const chunk of chunks) {
|
|
975
|
+
chunk.copy(reqBuffer, i);
|
|
976
|
+
i += chunk.byteLength;
|
|
977
|
+
}
|
|
978
|
+
dataBuf = reqBuffer;
|
|
979
|
+
}
|
|
984
980
|
if (dataBuf.byteLength === 0) {
|
|
985
981
|
const opts = [];
|
|
986
982
|
if (output) {
|
|
@@ -886,30 +886,26 @@ import { compileAll } from "capnp-es/compiler";
|
|
|
886
886
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
887
887
|
import { exec } from "node:child_process";
|
|
888
888
|
import { existsSync as existsSync2 } from "node:fs";
|
|
889
|
-
async function readStdin() {
|
|
890
|
-
if (process.stdin.isTTY) {
|
|
891
|
-
return Buffer2.alloc(0);
|
|
892
|
-
}
|
|
893
|
-
const chunks = [];
|
|
894
|
-
process.stdin.on("data", (chunk) => {
|
|
895
|
-
chunks.push(chunk);
|
|
896
|
-
});
|
|
897
|
-
await new Promise((resolve) => {
|
|
898
|
-
process.stdin.on("end", resolve);
|
|
899
|
-
});
|
|
900
|
-
const reqBuffer = Buffer2.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
|
|
901
|
-
let i = 0;
|
|
902
|
-
for (const chunk of chunks) {
|
|
903
|
-
chunk.copy(reqBuffer, i);
|
|
904
|
-
i += chunk.byteLength;
|
|
905
|
-
}
|
|
906
|
-
return reqBuffer;
|
|
907
|
-
}
|
|
908
|
-
__name(readStdin, "readStdin");
|
|
909
889
|
async function capnpc(options) {
|
|
910
890
|
try {
|
|
911
891
|
const { output, tsconfig, schema = [] } = options;
|
|
912
|
-
let dataBuf =
|
|
892
|
+
let dataBuf = Buffer2.alloc(0);
|
|
893
|
+
if (!process.stdin.isTTY) {
|
|
894
|
+
const chunks = [];
|
|
895
|
+
process.stdin.on("data", (chunk) => {
|
|
896
|
+
chunks.push(chunk);
|
|
897
|
+
});
|
|
898
|
+
await new Promise((resolve) => {
|
|
899
|
+
process.stdin.on("end", resolve);
|
|
900
|
+
});
|
|
901
|
+
const reqBuffer = Buffer2.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
|
|
902
|
+
let i = 0;
|
|
903
|
+
for (const chunk of chunks) {
|
|
904
|
+
chunk.copy(reqBuffer, i);
|
|
905
|
+
i += chunk.byteLength;
|
|
906
|
+
}
|
|
907
|
+
dataBuf = reqBuffer;
|
|
908
|
+
}
|
|
913
909
|
if (dataBuf.byteLength === 0) {
|
|
914
910
|
const opts = [];
|
|
915
911
|
if (output) {
|
|
@@ -886,30 +886,26 @@ var _compiler = require('capnp-es/compiler');
|
|
|
886
886
|
|
|
887
887
|
var _child_process = require('child_process');
|
|
888
888
|
|
|
889
|
-
async function readStdin() {
|
|
890
|
-
if (process.stdin.isTTY) {
|
|
891
|
-
return _buffer.Buffer.alloc(0);
|
|
892
|
-
}
|
|
893
|
-
const chunks = [];
|
|
894
|
-
process.stdin.on("data", (chunk) => {
|
|
895
|
-
chunks.push(chunk);
|
|
896
|
-
});
|
|
897
|
-
await new Promise((resolve) => {
|
|
898
|
-
process.stdin.on("end", resolve);
|
|
899
|
-
});
|
|
900
|
-
const reqBuffer = _buffer.Buffer.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
|
|
901
|
-
let i = 0;
|
|
902
|
-
for (const chunk of chunks) {
|
|
903
|
-
chunk.copy(reqBuffer, i);
|
|
904
|
-
i += chunk.byteLength;
|
|
905
|
-
}
|
|
906
|
-
return reqBuffer;
|
|
907
|
-
}
|
|
908
|
-
_chunkUSNT2KNTcjs.__name.call(void 0, readStdin, "readStdin");
|
|
909
889
|
async function capnpc(options) {
|
|
910
890
|
try {
|
|
911
891
|
const { output, tsconfig, schema = [] } = options;
|
|
912
|
-
let dataBuf =
|
|
892
|
+
let dataBuf = _buffer.Buffer.alloc(0);
|
|
893
|
+
if (!process.stdin.isTTY) {
|
|
894
|
+
const chunks = [];
|
|
895
|
+
process.stdin.on("data", (chunk) => {
|
|
896
|
+
chunks.push(chunk);
|
|
897
|
+
});
|
|
898
|
+
await new Promise((resolve) => {
|
|
899
|
+
process.stdin.on("end", resolve);
|
|
900
|
+
});
|
|
901
|
+
const reqBuffer = _buffer.Buffer.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
|
|
902
|
+
let i = 0;
|
|
903
|
+
for (const chunk of chunks) {
|
|
904
|
+
chunk.copy(reqBuffer, i);
|
|
905
|
+
i += chunk.byteLength;
|
|
906
|
+
}
|
|
907
|
+
dataBuf = reqBuffer;
|
|
908
|
+
}
|
|
913
909
|
if (dataBuf.byteLength === 0) {
|
|
914
910
|
const opts = [];
|
|
915
911
|
if (output) {
|
package/dist/compile.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkWYA7EDMTcjs = require('./chunk-WYA7EDMT.cjs');
|
|
4
4
|
require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.capnpc =
|
|
7
|
+
exports.capnpc = _chunkWYA7EDMTcjs.capnpc;
|
package/dist/compile.d.cts
CHANGED
|
@@ -2,6 +2,12 @@ import { CapnpcOptions, CapnpcResult } from './types.cjs';
|
|
|
2
2
|
import 'capnp-es/capnp/schema';
|
|
3
3
|
import 'typescript';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Compiles Cap'n Proto schemas into TypeScript files.
|
|
7
|
+
*
|
|
8
|
+
* @param options - The options for the compilation process.
|
|
9
|
+
* @returns A promise that resolves to the compilation result.
|
|
10
|
+
*/
|
|
5
11
|
declare function capnpc(options: CapnpcOptions): Promise<CapnpcResult>;
|
|
6
12
|
|
|
7
13
|
export { capnpc };
|
package/dist/compile.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ import { CapnpcOptions, CapnpcResult } from './types.js';
|
|
|
2
2
|
import 'capnp-es/capnp/schema';
|
|
3
3
|
import 'typescript';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Compiles Cap'n Proto schemas into TypeScript files.
|
|
7
|
+
*
|
|
8
|
+
* @param options - The options for the compilation process.
|
|
9
|
+
* @returns A promise that resolves to the compilation result.
|
|
10
|
+
*/
|
|
5
11
|
declare function capnpc(options: CapnpcOptions): Promise<CapnpcResult>;
|
|
6
12
|
|
|
7
13
|
export { capnpc };
|
package/dist/compile.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkWYA7EDMTcjs = require('./chunk-WYA7EDMT.cjs');
|
|
4
4
|
require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
require('./chunk-ORA4UQMU.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.capnpc =
|
|
8
|
+
exports.capnpc = _chunkWYA7EDMTcjs.capnpc;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED