@stryke/capnp 0.10.0 → 0.10.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 +62 -30
- package/bin/capnpc.js +62 -30
- package/dist/chunk-3IOIINHW.js +895 -0
- package/dist/chunk-3ZOLKZQQ.cjs +895 -0
- package/dist/chunk-55455L4M.cjs +4103 -0
- package/dist/chunk-5VHN3KGS.js +3305 -0
- package/dist/chunk-CCU32X36.js +15 -0
- package/dist/chunk-GWW6WBAL.js +4103 -0
- package/dist/chunk-IBMXNAOT.cjs +4877 -0
- package/dist/chunk-KXWOF6H4.cjs +3305 -0
- package/dist/chunk-N2KNXTXN.js +4877 -0
- package/dist/chunk-R2JXWA7Q.cjs +15 -0
- package/dist/compile.cjs +7 -72
- package/dist/compile.d.cts +3 -3
- package/dist/compile.d.ts +3 -3
- package/dist/compile.js +6 -71
- package/dist/helpers.cjs +4 -49
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/helpers.js +3 -48
- package/dist/index.cjs +138 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +138 -4
- package/dist/rpc.cjs +6 -117
- package/dist/rpc.js +5 -116
- package/dist/types.cjs +3 -8
- package/dist/types.d.cts +13 -4
- package/dist/types.d.ts +13 -4
- package/dist/types.js +3 -8
- package/dts/index.d.cts +14 -5
- package/dts/index.d.ts +14 -5
- package/package.json +4 -4
- package/schemas/persistent.cjs +20 -20
- package/schemas/persistent.js +1 -1
- package/schemas/rpc-twoparty.cjs +32 -32
- package/schemas/rpc-twoparty.js +1 -1
- package/schemas/rpc.cjs +495 -495
- package/schemas/rpc.js +1 -1
- package/schemas/schema.cjs +675 -675
- package/schemas/schema.js +1 -1
- /package/schemas/{chunk-ZGPCLBI4.cjs → chunk-BM2HWFSD.cjs} +0 -0
- /package/schemas/{chunk-3CJYH45H.js → chunk-TAKPBFYZ.js} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;
|
|
2
|
+
|
|
3
|
+
var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
|
|
4
|
+
|
|
5
|
+
// src/types.ts
|
|
6
|
+
var CodeGeneratorContext = (_class = class {constructor() { _class.prototype.__init.call(this); }
|
|
7
|
+
static {
|
|
8
|
+
_chunkUSNT2KNTcjs.__name.call(void 0, this, "CodeGeneratorContext");
|
|
9
|
+
}
|
|
10
|
+
__init() {this.files = []}
|
|
11
|
+
}, _class);
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.CodeGeneratorContext = CodeGeneratorContext;
|
package/dist/compile.cjs
CHANGED
|
@@ -1,76 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
|
|
4
|
-
var _console = require('@storm-software/config-tools/logger/console');
|
|
5
|
-
var _compiler = require('capnp-es/compiler');
|
|
6
|
-
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
7
|
-
var _nodebuffer = require('node:buffer');
|
|
8
|
-
var _nodechild_process = require('node:child_process');
|
|
9
|
-
var _helpersjs = require('./helpers.js');
|
|
10
|
-
async function capnpc(options) {
|
|
11
|
-
const { output, tsconfig, schemas = [], tty } = options;
|
|
12
|
-
let dataBuf = _nodebuffer.Buffer.alloc(0);
|
|
13
|
-
if (tty) {
|
|
14
|
-
const chunks = [];
|
|
15
|
-
process.stdin.on("data", (chunk) => {
|
|
16
|
-
chunks.push(chunk);
|
|
17
|
-
});
|
|
18
|
-
await new Promise((resolve) => {
|
|
19
|
-
process.stdin.on("end", resolve);
|
|
20
|
-
});
|
|
21
|
-
const reqBuffer = _nodebuffer.Buffer.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
|
|
22
|
-
let i = 0;
|
|
23
|
-
for (const chunk of chunks) {
|
|
24
|
-
chunk.copy(reqBuffer, i);
|
|
25
|
-
i += chunk.byteLength;
|
|
26
|
-
}
|
|
27
|
-
dataBuf = reqBuffer;
|
|
28
|
-
}
|
|
29
|
-
if (dataBuf.byteLength === 0) {
|
|
30
|
-
const opts = [];
|
|
31
|
-
if (output) {
|
|
32
|
-
opts.push(`-o-:${output}`);
|
|
33
|
-
} else {
|
|
34
|
-
opts.push("-o-");
|
|
35
|
-
}
|
|
36
|
-
dataBuf = await new Promise((resolve) => {
|
|
37
|
-
_nodechild_process.exec.call(void 0, `capnpc ${opts.join(" ")} ${schemas.join(" ")}`, {
|
|
38
|
-
encoding: "buffer"
|
|
39
|
-
}, (error, stdout, stderr) => {
|
|
40
|
-
if (stderr.length > 0) {
|
|
41
|
-
process.stderr.write(stderr);
|
|
42
|
-
}
|
|
43
|
-
if (error) {
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
resolve(stdout);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return _compiler.compileAll.call(void 0, dataBuf, {
|
|
51
|
-
ts: _nullishCoalesce(options.ts, () => ( true)),
|
|
52
|
-
js: false,
|
|
53
|
-
dts: false,
|
|
54
|
-
tsconfig
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
_chunkUSNT2KNTcjs.__name.call(void 0, capnpc, "capnpc");
|
|
58
|
-
async function compile(dataBuf, options) {
|
|
59
|
-
const resolvedOptions = await _helpersjs.resolveOptions.call(void 0, options);
|
|
60
|
-
if (!resolvedOptions) {
|
|
61
|
-
_console.writeWarning.call(void 0, "\u2716 Unable to resolve Cap'n Proto compiler options - the program will terminate", {
|
|
62
|
-
logLevel: "all"
|
|
63
|
-
});
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
return _compiler.compileAll.call(void 0, dataBuf, _defu2.default.call(void 0, resolvedOptions, {
|
|
67
|
-
ts: true,
|
|
68
|
-
js: false,
|
|
69
|
-
dts: false
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
_chunkUSNT2KNTcjs.__name.call(void 0, compile, "compile");
|
|
73
3
|
|
|
4
|
+
var _chunk55455L4Mcjs = require('./chunk-55455L4M.cjs');
|
|
5
|
+
require('./chunk-3ZOLKZQQ.cjs');
|
|
6
|
+
require('./chunk-KXWOF6H4.cjs');
|
|
7
|
+
require('./chunk-USNT2KNT.cjs');
|
|
74
8
|
|
|
75
9
|
|
|
76
|
-
|
|
10
|
+
|
|
11
|
+
exports.capnpc = _chunk55455L4Mcjs.capnpc; exports.compile = _chunk55455L4Mcjs.compile;
|
package/dist/compile.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as capnp_es_capnp_schema from 'capnp-es/capnp/schema';
|
|
2
2
|
import { Buffer } from 'node:buffer';
|
|
3
|
-
import {
|
|
3
|
+
import { CapnpcResolvedOptions, CapnpcResult, CapnpcOptions } from './types.cjs';
|
|
4
4
|
import 'typescript';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -9,7 +9,7 @@ import 'typescript';
|
|
|
9
9
|
* @param options - The options for the compilation process.
|
|
10
10
|
* @returns A promise that resolves to the compilation result.
|
|
11
11
|
*/
|
|
12
|
-
declare function capnpc(options:
|
|
12
|
+
declare function capnpc(options: CapnpcResolvedOptions): Promise<CapnpcResult>;
|
|
13
13
|
/**
|
|
14
14
|
* Compiles Cap'n Proto schemas into TypeScript files.
|
|
15
15
|
*
|
|
@@ -17,7 +17,7 @@ declare function capnpc(options: CapnpcOptions): Promise<CapnpcResult>;
|
|
|
17
17
|
* @param options - The options for the compilation process.
|
|
18
18
|
* @returns A promise that resolves to the compilation result.
|
|
19
19
|
*/
|
|
20
|
-
declare function compile(dataBuf: Buffer, options:
|
|
20
|
+
declare function compile(dataBuf: Buffer, options: CapnpcOptions): Promise<{
|
|
21
21
|
ctx: {
|
|
22
22
|
files: {
|
|
23
23
|
readonly req: capnp_es_capnp_schema.CodeGeneratorRequest;
|
package/dist/compile.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as capnp_es_capnp_schema from 'capnp-es/capnp/schema';
|
|
2
2
|
import { Buffer } from 'node:buffer';
|
|
3
|
-
import {
|
|
3
|
+
import { CapnpcResolvedOptions, CapnpcResult, CapnpcOptions } from './types.js';
|
|
4
4
|
import 'typescript';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -9,7 +9,7 @@ import 'typescript';
|
|
|
9
9
|
* @param options - The options for the compilation process.
|
|
10
10
|
* @returns A promise that resolves to the compilation result.
|
|
11
11
|
*/
|
|
12
|
-
declare function capnpc(options:
|
|
12
|
+
declare function capnpc(options: CapnpcResolvedOptions): Promise<CapnpcResult>;
|
|
13
13
|
/**
|
|
14
14
|
* Compiles Cap'n Proto schemas into TypeScript files.
|
|
15
15
|
*
|
|
@@ -17,7 +17,7 @@ declare function capnpc(options: CapnpcOptions): Promise<CapnpcResult>;
|
|
|
17
17
|
* @param options - The options for the compilation process.
|
|
18
18
|
* @returns A promise that resolves to the compilation result.
|
|
19
19
|
*/
|
|
20
|
-
declare function compile(dataBuf: Buffer, options:
|
|
20
|
+
declare function compile(dataBuf: Buffer, options: CapnpcOptions): Promise<{
|
|
21
21
|
ctx: {
|
|
22
22
|
files: {
|
|
23
23
|
readonly req: capnp_es_capnp_schema.CodeGeneratorRequest;
|
package/dist/compile.js
CHANGED
|
@@ -1,75 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { exec } from "node:child_process";
|
|
9
|
-
import { resolveOptions } from "./helpers.js";
|
|
10
|
-
async function capnpc(options) {
|
|
11
|
-
const { output, tsconfig, schemas = [], tty } = options;
|
|
12
|
-
let dataBuf = Buffer.alloc(0);
|
|
13
|
-
if (tty) {
|
|
14
|
-
const chunks = [];
|
|
15
|
-
process.stdin.on("data", (chunk) => {
|
|
16
|
-
chunks.push(chunk);
|
|
17
|
-
});
|
|
18
|
-
await new Promise((resolve) => {
|
|
19
|
-
process.stdin.on("end", resolve);
|
|
20
|
-
});
|
|
21
|
-
const reqBuffer = Buffer.alloc(chunks.reduce((l, chunk) => l + chunk.byteLength, 0));
|
|
22
|
-
let i = 0;
|
|
23
|
-
for (const chunk of chunks) {
|
|
24
|
-
chunk.copy(reqBuffer, i);
|
|
25
|
-
i += chunk.byteLength;
|
|
26
|
-
}
|
|
27
|
-
dataBuf = reqBuffer;
|
|
28
|
-
}
|
|
29
|
-
if (dataBuf.byteLength === 0) {
|
|
30
|
-
const opts = [];
|
|
31
|
-
if (output) {
|
|
32
|
-
opts.push(`-o-:${output}`);
|
|
33
|
-
} else {
|
|
34
|
-
opts.push("-o-");
|
|
35
|
-
}
|
|
36
|
-
dataBuf = await new Promise((resolve) => {
|
|
37
|
-
exec(`capnpc ${opts.join(" ")} ${schemas.join(" ")}`, {
|
|
38
|
-
encoding: "buffer"
|
|
39
|
-
}, (error, stdout, stderr) => {
|
|
40
|
-
if (stderr.length > 0) {
|
|
41
|
-
process.stderr.write(stderr);
|
|
42
|
-
}
|
|
43
|
-
if (error) {
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
resolve(stdout);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return compileAll(dataBuf, {
|
|
51
|
-
ts: options.ts ?? true,
|
|
52
|
-
js: false,
|
|
53
|
-
dts: false,
|
|
54
|
-
tsconfig
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
__name(capnpc, "capnpc");
|
|
58
|
-
async function compile(dataBuf, options) {
|
|
59
|
-
const resolvedOptions = await resolveOptions(options);
|
|
60
|
-
if (!resolvedOptions) {
|
|
61
|
-
writeWarning("\u2716 Unable to resolve Cap'n Proto compiler options - the program will terminate", {
|
|
62
|
-
logLevel: "all"
|
|
63
|
-
});
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
return compileAll(dataBuf, defu(resolvedOptions, {
|
|
67
|
-
ts: true,
|
|
68
|
-
js: false,
|
|
69
|
-
dts: false
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
__name(compile, "compile");
|
|
2
|
+
capnpc,
|
|
3
|
+
compile
|
|
4
|
+
} from "./chunk-GWW6WBAL.js";
|
|
5
|
+
import "./chunk-3IOIINHW.js";
|
|
6
|
+
import "./chunk-5VHN3KGS.js";
|
|
7
|
+
import "./chunk-SHUYVCID.js";
|
|
73
8
|
export {
|
|
74
9
|
capnpc,
|
|
75
10
|
compile
|
package/dist/helpers.cjs
CHANGED
|
@@ -1,52 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var _json = require('@stryke/fs/json');
|
|
6
|
-
var _listfiles = require('@stryke/fs/list-files');
|
|
7
|
-
var _exists = require('@stryke/path/exists');
|
|
8
|
-
var _filepathfns = require('@stryke/path/file-path-fns');
|
|
9
|
-
var _joinpaths = require('@stryke/path/join-paths');
|
|
10
|
-
var _typescript = require('typescript');
|
|
11
|
-
async function resolveOptions(options) {
|
|
12
|
-
const tsconfigPath = _optionalChain([options, 'access', _ => _.tsconfig, 'optionalAccess', _2 => _2.replace, 'call', _3 => _3("{projectRoot}", options.projectRoot), 'optionalAccess', _4 => _4.replace, 'call', _5 => _5("{workspaceRoot}", options.workspaceRoot)]);
|
|
13
|
-
const schema = options.schema ? options.schema.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot) : options.projectRoot;
|
|
14
|
-
if (!_exists.existsSync.call(void 0, tsconfigPath)) {
|
|
15
|
-
const errorMessage = options.tsconfig ? `\u2716 The specified TypeScript configuration file "${tsconfigPath}" does not exist. Please provide a valid path.` : "\u2716 The specified TypeScript configuration file does not exist. Please provide a valid path.";
|
|
16
|
-
_console.writeFatal.call(void 0, errorMessage, {
|
|
17
|
-
logLevel: "all"
|
|
18
|
-
});
|
|
19
|
-
throw new Error(errorMessage);
|
|
20
|
-
}
|
|
21
|
-
const resolvedTsconfig = await _json.readJsonFile.call(void 0, tsconfigPath);
|
|
22
|
-
const tsconfig = _typescript.parseJsonConfigFileContent.call(void 0, resolvedTsconfig, _typescript.sys, _filepathfns.findFilePath.call(void 0, tsconfigPath));
|
|
23
|
-
tsconfig.options.configFilePath = tsconfigPath;
|
|
24
|
-
tsconfig.options.noImplicitOverride = false;
|
|
25
|
-
tsconfig.options.noUnusedLocals = false;
|
|
26
|
-
tsconfig.options.noUnusedParameters = false;
|
|
27
|
-
tsconfig.options.outDir = _joinpaths.joinPaths.call(void 0, options.projectRoot, _filepathfns.relativePath.call(void 0, _filepathfns.findFilePath.call(void 0, tsconfigPath), _joinpaths.joinPaths.call(void 0, options.workspaceRoot, schema.endsWith(".capnp") ? _filepathfns.findFilePath.call(void 0, schema) : schema)));
|
|
28
|
-
const schemas = [];
|
|
29
|
-
if (!schema || !schema.includes("*") && !_exists.existsSync.call(void 0, schema)) {
|
|
30
|
-
throw new Error(`\u2716 The schema path "${schema}" is invalid. Please provide a valid path.`);
|
|
31
|
-
}
|
|
32
|
-
schemas.push(...await _listfiles.listFiles.call(void 0, schema.includes("*") ? schema.endsWith(".capnp") ? schema : `${schema}.capnp` : _joinpaths.joinPaths.call(void 0, schema, "**/*.capnp")));
|
|
33
|
-
if (schemas.length === 0) {
|
|
34
|
-
_console.writeWarning.call(void 0, `\u2716 No Cap'n Proto schema files found in the specified source paths: ${schemas.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.`, {
|
|
35
|
-
logLevel: "all"
|
|
36
|
-
});
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
workspaceRoot: options.workspaceRoot,
|
|
41
|
-
projectRoot: options.projectRoot,
|
|
42
|
-
schemas,
|
|
43
|
-
js: _nullishCoalesce(options.js, () => ( false)),
|
|
44
|
-
ts: _nullishCoalesce(options.ts, () => ( (options.noTs !== void 0 ? !options.noTs : true))),
|
|
45
|
-
dts: _nullishCoalesce(options.dts, () => ( (options.noDts !== void 0 ? !options.noDts : true))),
|
|
46
|
-
tsconfig: _optionalChain([tsconfig, 'optionalAccess', _6 => _6.options])
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
_chunkUSNT2KNTcjs.__name.call(void 0, resolveOptions, "resolveOptions");
|
|
3
|
+
var _chunk3ZOLKZQQcjs = require('./chunk-3ZOLKZQQ.cjs');
|
|
4
|
+
require('./chunk-USNT2KNT.cjs');
|
|
50
5
|
|
|
51
6
|
|
|
52
|
-
exports.resolveOptions = resolveOptions;
|
|
7
|
+
exports.resolveOptions = _chunk3ZOLKZQQcjs.resolveOptions;
|
package/dist/helpers.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CapnpcOptions, CapnpcResolvedOptions } from './types.cjs';
|
|
2
2
|
import 'capnp-es/capnp/schema';
|
|
3
3
|
import 'typescript';
|
|
4
4
|
|
|
@@ -8,6 +8,6 @@ import 'typescript';
|
|
|
8
8
|
* @param options - The options to resolve
|
|
9
9
|
* @returns The resolved options
|
|
10
10
|
*/
|
|
11
|
-
declare function resolveOptions(options:
|
|
11
|
+
declare function resolveOptions(options: CapnpcOptions): Promise<CapnpcResolvedOptions | null>;
|
|
12
12
|
|
|
13
13
|
export { resolveOptions };
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CapnpcOptions, CapnpcResolvedOptions } from './types.js';
|
|
2
2
|
import 'capnp-es/capnp/schema';
|
|
3
3
|
import 'typescript';
|
|
4
4
|
|
|
@@ -8,6 +8,6 @@ import 'typescript';
|
|
|
8
8
|
* @param options - The options to resolve
|
|
9
9
|
* @returns The resolved options
|
|
10
10
|
*/
|
|
11
|
-
declare function resolveOptions(options:
|
|
11
|
+
declare function resolveOptions(options: CapnpcOptions): Promise<CapnpcResolvedOptions | null>;
|
|
12
12
|
|
|
13
13
|
export { resolveOptions };
|
package/dist/helpers.js
CHANGED
|
@@ -1,52 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import
|
|
5
|
-
import { readJsonFile } from "@stryke/fs/json";
|
|
6
|
-
import { listFiles } from "@stryke/fs/list-files";
|
|
7
|
-
import { existsSync } from "@stryke/path/exists";
|
|
8
|
-
import { findFilePath, relativePath } from "@stryke/path/file-path-fns";
|
|
9
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
10
|
-
import { parseJsonConfigFileContent, sys } from "typescript";
|
|
11
|
-
async function resolveOptions(options) {
|
|
12
|
-
const tsconfigPath = options.tsconfig?.replace("{projectRoot}", options.projectRoot)?.replace("{workspaceRoot}", options.workspaceRoot);
|
|
13
|
-
const schema = options.schema ? options.schema.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot) : options.projectRoot;
|
|
14
|
-
if (!existsSync(tsconfigPath)) {
|
|
15
|
-
const errorMessage = options.tsconfig ? `\u2716 The specified TypeScript configuration file "${tsconfigPath}" does not exist. Please provide a valid path.` : "\u2716 The specified TypeScript configuration file does not exist. Please provide a valid path.";
|
|
16
|
-
writeFatal(errorMessage, {
|
|
17
|
-
logLevel: "all"
|
|
18
|
-
});
|
|
19
|
-
throw new Error(errorMessage);
|
|
20
|
-
}
|
|
21
|
-
const resolvedTsconfig = await readJsonFile(tsconfigPath);
|
|
22
|
-
const tsconfig = parseJsonConfigFileContent(resolvedTsconfig, sys, findFilePath(tsconfigPath));
|
|
23
|
-
tsconfig.options.configFilePath = tsconfigPath;
|
|
24
|
-
tsconfig.options.noImplicitOverride = false;
|
|
25
|
-
tsconfig.options.noUnusedLocals = false;
|
|
26
|
-
tsconfig.options.noUnusedParameters = false;
|
|
27
|
-
tsconfig.options.outDir = joinPaths(options.projectRoot, relativePath(findFilePath(tsconfigPath), joinPaths(options.workspaceRoot, schema.endsWith(".capnp") ? findFilePath(schema) : schema)));
|
|
28
|
-
const schemas = [];
|
|
29
|
-
if (!schema || !schema.includes("*") && !existsSync(schema)) {
|
|
30
|
-
throw new Error(`\u2716 The schema path "${schema}" is invalid. Please provide a valid path.`);
|
|
31
|
-
}
|
|
32
|
-
schemas.push(...await listFiles(schema.includes("*") ? schema.endsWith(".capnp") ? schema : `${schema}.capnp` : joinPaths(schema, "**/*.capnp")));
|
|
33
|
-
if (schemas.length === 0) {
|
|
34
|
-
writeWarning(`\u2716 No Cap'n Proto schema files found in the specified source paths: ${schemas.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.`, {
|
|
35
|
-
logLevel: "all"
|
|
36
|
-
});
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
workspaceRoot: options.workspaceRoot,
|
|
41
|
-
projectRoot: options.projectRoot,
|
|
42
|
-
schemas,
|
|
43
|
-
js: options.js ?? false,
|
|
44
|
-
ts: options.ts ?? (options.noTs !== void 0 ? !options.noTs : true),
|
|
45
|
-
dts: options.dts ?? (options.noDts !== void 0 ? !options.noDts : true),
|
|
46
|
-
tsconfig: tsconfig?.options
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
__name(resolveOptions, "resolveOptions");
|
|
2
|
+
resolveOptions
|
|
3
|
+
} from "./chunk-3IOIINHW.js";
|
|
4
|
+
import "./chunk-SHUYVCID.js";
|
|
50
5
|
export {
|
|
51
6
|
resolveOptions
|
|
52
7
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,138 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk55455L4Mcjs = require('./chunk-55455L4M.cjs');
|
|
5
|
+
require('./chunk-3ZOLKZQQ.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
var _chunkIBMXNAOTcjs = require('./chunk-IBMXNAOT.cjs');
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
var _chunkKXWOF6H4cjs = require('./chunk-KXWOF6H4.cjs');
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
var _chunkR2JXWA7Qcjs = require('./chunk-R2JXWA7Q.cjs');
|
|
73
|
+
require('./chunk-USNT2KNT.cjs');
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
exports.AnyPointerList = _chunkIBMXNAOTcjs.AnyPointerList; exports.BoolList = _chunkIBMXNAOTcjs.BoolList; exports.CapnpRPC = _chunkIBMXNAOTcjs.CapnpRPC; exports.CodeGeneratorContext = _chunkR2JXWA7Qcjs.CodeGeneratorContext; exports.CompositeList = _chunkKXWOF6H4cjs.CompositeList; exports.Conn = _chunkIBMXNAOTcjs.Conn; exports.Data = _chunkKXWOF6H4cjs.Data; exports.DataList = _chunkIBMXNAOTcjs.DataList; exports.Deferred = _chunkIBMXNAOTcjs.Deferred; exports.DeferredTransport = _chunkIBMXNAOTcjs.DeferredTransport; exports.ErrorClient = _chunkKXWOF6H4cjs.ErrorClient; exports.Float32List = _chunkIBMXNAOTcjs.Float32List; exports.Float64List = _chunkIBMXNAOTcjs.Float64List; exports.Int16List = _chunkIBMXNAOTcjs.Int16List; exports.Int32List = _chunkIBMXNAOTcjs.Int32List; exports.Int64List = _chunkIBMXNAOTcjs.Int64List; exports.Int8List = _chunkIBMXNAOTcjs.Int8List; exports.Interface = _chunkIBMXNAOTcjs.Interface; exports.InterfaceList = _chunkIBMXNAOTcjs.InterfaceList; exports.List = _chunkKXWOF6H4cjs.List; exports.ListElementSize = _chunkKXWOF6H4cjs.ListElementSize; exports.Message = _chunkKXWOF6H4cjs.Message; exports.MessageChannelTransport = _chunkIBMXNAOTcjs.MessageChannelTransport; exports.ObjectSize = _chunkKXWOF6H4cjs.ObjectSize; exports.Orphan = _chunkKXWOF6H4cjs.Orphan; exports.Pipeline = _chunkIBMXNAOTcjs.Pipeline; exports.Pointer = _chunkKXWOF6H4cjs.Pointer; exports.PointerList = _chunkIBMXNAOTcjs.PointerList; exports.PointerType = _chunkKXWOF6H4cjs.PointerType; exports.Registry = _chunkIBMXNAOTcjs.Registry; exports.Server = _chunkIBMXNAOTcjs.Server; exports.Struct = _chunkKXWOF6H4cjs.Struct; exports.Text = _chunkKXWOF6H4cjs.Text; exports.TextList = _chunkIBMXNAOTcjs.TextList; exports.Uint16List = _chunkIBMXNAOTcjs.Uint16List; exports.Uint32List = _chunkIBMXNAOTcjs.Uint32List; exports.Uint64List = _chunkIBMXNAOTcjs.Uint64List; exports.Uint8List = _chunkIBMXNAOTcjs.Uint8List; exports.Void = _chunkIBMXNAOTcjs.Void; exports.VoidList = _chunkIBMXNAOTcjs.VoidList; exports.answerPipelineClient = _chunkIBMXNAOTcjs.answerPipelineClient; exports.capnpc = _chunk55455L4Mcjs.capnpc; exports.clientFromResolution = _chunkIBMXNAOTcjs.clientFromResolution; exports.clientOrNull = _chunkKXWOF6H4cjs.clientOrNull; exports.compile = _chunk55455L4Mcjs.compile; exports.copyCall = _chunkIBMXNAOTcjs.copyCall; exports.getBitMask = _chunkKXWOF6H4cjs.getBitMask; exports.getFloat32Mask = _chunkKXWOF6H4cjs.getFloat32Mask; exports.getFloat64Mask = _chunkKXWOF6H4cjs.getFloat64Mask; exports.getInt16Mask = _chunkKXWOF6H4cjs.getInt16Mask; exports.getInt32Mask = _chunkKXWOF6H4cjs.getInt32Mask; exports.getInt64Mask = _chunkKXWOF6H4cjs.getInt64Mask; exports.getInt8Mask = _chunkKXWOF6H4cjs.getInt8Mask; exports.getUint16Mask = _chunkKXWOF6H4cjs.getUint16Mask; exports.getUint32Mask = _chunkKXWOF6H4cjs.getUint32Mask; exports.getUint64Mask = _chunkKXWOF6H4cjs.getUint64Mask; exports.getUint8Mask = _chunkKXWOF6H4cjs.getUint8Mask; exports.isDataCall = _chunkIBMXNAOTcjs.isDataCall; exports.isFuncCall = _chunkIBMXNAOTcjs.isFuncCall; exports.isSameClient = _chunkIBMXNAOTcjs.isSameClient; exports.placeParams = _chunkIBMXNAOTcjs.placeParams; exports.readRawPointer = _chunkKXWOF6H4cjs.readRawPointer; exports.utils = _chunkIBMXNAOTcjs.utils;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { capnpc, compile } from './compile.cjs';
|
|
2
2
|
export { CapnpRPC, MessageChannelTransport } from './rpc.cjs';
|
|
3
|
-
export { CapnpcCLIOptions, CapnpcOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext } from './types.cjs';
|
|
3
|
+
export { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext } from './types.cjs';
|
|
4
4
|
export * from 'capnp-es';
|
|
5
5
|
import 'capnp-es/capnp/schema';
|
|
6
6
|
import 'node:buffer';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { capnpc, compile } from './compile.js';
|
|
2
2
|
export { CapnpRPC, MessageChannelTransport } from './rpc.js';
|
|
3
|
-
export { CapnpcCLIOptions, CapnpcOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext } from './types.js';
|
|
3
|
+
export { CapnpcCLIOptions, CapnpcOptions, CapnpcResolvedOptions, CapnpcResult, CodeGeneratorContext, CodeGeneratorFileContext } from './types.js';
|
|
4
4
|
export * from 'capnp-es';
|
|
5
5
|
import 'capnp-es/capnp/schema';
|
|
6
6
|
import 'node:buffer';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,138 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
capnpc,
|
|
3
|
+
compile
|
|
4
|
+
} from "./chunk-GWW6WBAL.js";
|
|
5
|
+
import "./chunk-3IOIINHW.js";
|
|
6
|
+
import {
|
|
7
|
+
AnyPointerList,
|
|
8
|
+
BoolList,
|
|
9
|
+
CapnpRPC,
|
|
10
|
+
Conn,
|
|
11
|
+
DataList,
|
|
12
|
+
Deferred,
|
|
13
|
+
DeferredTransport,
|
|
14
|
+
Float32List,
|
|
15
|
+
Float64List,
|
|
16
|
+
Int16List,
|
|
17
|
+
Int32List,
|
|
18
|
+
Int64List,
|
|
19
|
+
Int8List,
|
|
20
|
+
Interface,
|
|
21
|
+
InterfaceList,
|
|
22
|
+
MessageChannelTransport,
|
|
23
|
+
Pipeline,
|
|
24
|
+
PointerList,
|
|
25
|
+
Registry,
|
|
26
|
+
Server,
|
|
27
|
+
TextList,
|
|
28
|
+
Uint16List,
|
|
29
|
+
Uint32List,
|
|
30
|
+
Uint64List,
|
|
31
|
+
Uint8List,
|
|
32
|
+
Void,
|
|
33
|
+
VoidList,
|
|
34
|
+
answerPipelineClient,
|
|
35
|
+
clientFromResolution,
|
|
36
|
+
copyCall,
|
|
37
|
+
isDataCall,
|
|
38
|
+
isFuncCall,
|
|
39
|
+
isSameClient,
|
|
40
|
+
placeParams,
|
|
41
|
+
utils
|
|
42
|
+
} from "./chunk-N2KNXTXN.js";
|
|
43
|
+
import {
|
|
44
|
+
CompositeList,
|
|
45
|
+
Data,
|
|
46
|
+
ErrorClient,
|
|
47
|
+
List,
|
|
48
|
+
ListElementSize,
|
|
49
|
+
Message,
|
|
50
|
+
ObjectSize,
|
|
51
|
+
Orphan,
|
|
52
|
+
Pointer,
|
|
53
|
+
PointerType,
|
|
54
|
+
Struct,
|
|
55
|
+
Text,
|
|
56
|
+
clientOrNull,
|
|
57
|
+
getBitMask,
|
|
58
|
+
getFloat32Mask,
|
|
59
|
+
getFloat64Mask,
|
|
60
|
+
getInt16Mask,
|
|
61
|
+
getInt32Mask,
|
|
62
|
+
getInt64Mask,
|
|
63
|
+
getInt8Mask,
|
|
64
|
+
getUint16Mask,
|
|
65
|
+
getUint32Mask,
|
|
66
|
+
getUint64Mask,
|
|
67
|
+
getUint8Mask,
|
|
68
|
+
readRawPointer
|
|
69
|
+
} from "./chunk-5VHN3KGS.js";
|
|
70
|
+
import {
|
|
71
|
+
CodeGeneratorContext
|
|
72
|
+
} from "./chunk-CCU32X36.js";
|
|
73
|
+
import "./chunk-SHUYVCID.js";
|
|
74
|
+
export {
|
|
75
|
+
AnyPointerList,
|
|
76
|
+
BoolList,
|
|
77
|
+
CapnpRPC,
|
|
78
|
+
CodeGeneratorContext,
|
|
79
|
+
CompositeList,
|
|
80
|
+
Conn,
|
|
81
|
+
Data,
|
|
82
|
+
DataList,
|
|
83
|
+
Deferred,
|
|
84
|
+
DeferredTransport,
|
|
85
|
+
ErrorClient,
|
|
86
|
+
Float32List,
|
|
87
|
+
Float64List,
|
|
88
|
+
Int16List,
|
|
89
|
+
Int32List,
|
|
90
|
+
Int64List,
|
|
91
|
+
Int8List,
|
|
92
|
+
Interface,
|
|
93
|
+
InterfaceList,
|
|
94
|
+
List,
|
|
95
|
+
ListElementSize,
|
|
96
|
+
Message,
|
|
97
|
+
MessageChannelTransport,
|
|
98
|
+
ObjectSize,
|
|
99
|
+
Orphan,
|
|
100
|
+
Pipeline,
|
|
101
|
+
Pointer,
|
|
102
|
+
PointerList,
|
|
103
|
+
PointerType,
|
|
104
|
+
Registry,
|
|
105
|
+
Server,
|
|
106
|
+
Struct,
|
|
107
|
+
Text,
|
|
108
|
+
TextList,
|
|
109
|
+
Uint16List,
|
|
110
|
+
Uint32List,
|
|
111
|
+
Uint64List,
|
|
112
|
+
Uint8List,
|
|
113
|
+
Void,
|
|
114
|
+
VoidList,
|
|
115
|
+
answerPipelineClient,
|
|
116
|
+
capnpc,
|
|
117
|
+
clientFromResolution,
|
|
118
|
+
clientOrNull,
|
|
119
|
+
compile,
|
|
120
|
+
copyCall,
|
|
121
|
+
getBitMask,
|
|
122
|
+
getFloat32Mask,
|
|
123
|
+
getFloat64Mask,
|
|
124
|
+
getInt16Mask,
|
|
125
|
+
getInt32Mask,
|
|
126
|
+
getInt64Mask,
|
|
127
|
+
getInt8Mask,
|
|
128
|
+
getUint16Mask,
|
|
129
|
+
getUint32Mask,
|
|
130
|
+
getUint64Mask,
|
|
131
|
+
getUint8Mask,
|
|
132
|
+
isDataCall,
|
|
133
|
+
isFuncCall,
|
|
134
|
+
isSameClient,
|
|
135
|
+
placeParams,
|
|
136
|
+
readRawPointer,
|
|
137
|
+
utils
|
|
138
|
+
};
|