@stryke/capnp 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/capnpc.cjs CHANGED
@@ -657,11 +657,21 @@ async function readJsonFile(path, options) {
657
657
  }
658
658
  __name(readJsonFile, "readJsonFile");
659
659
 
660
+ // ../path/src/exists.ts
661
+ var import_node_fs2 = require("fs");
662
+ var import_promises2 = require("fs/promises");
663
+ var existsSync2 = /* @__PURE__ */ __name((filePath) => {
664
+ return (0, import_node_fs2.existsSync)(filePath);
665
+ }, "existsSync");
666
+ var exists = /* @__PURE__ */ __name(async (filePath) => {
667
+ return (0, import_promises2.access)(filePath, import_promises2.constants.F_OK).then(() => true).catch(() => false);
668
+ }, "exists");
669
+
660
670
  // ../path/src/file-path-fns.ts
661
671
  var import_node_path = require("path");
662
672
 
663
673
  // ../path/src/is-file.ts
664
- var import_node_fs2 = require("fs");
674
+ var import_node_fs3 = require("fs");
665
675
 
666
676
  // ../path/src/join-paths.ts
667
677
  var _DRIVE_LETTER_START_RE = /^[A-Z]:\//i;
@@ -940,16 +950,6 @@ __name(findFilePath, "findFilePath");
940
950
  var import_commander = require("commander");
941
951
  var import_typescript = __toESM(require("typescript"), 1);
942
952
 
943
- // ../path/src/exists.ts
944
- var import_node_fs3 = require("fs");
945
- var import_promises2 = require("fs/promises");
946
- var existsSync2 = /* @__PURE__ */ __name((filePath) => {
947
- return (0, import_node_fs3.existsSync)(filePath);
948
- }, "existsSync");
949
- var exists = /* @__PURE__ */ __name(async (filePath) => {
950
- return (0, import_promises2.access)(filePath, import_promises2.constants.F_OK).then(() => true).catch(() => false);
951
- }, "exists");
952
-
953
953
  // ../fs/src/helpers.ts
954
954
  var import_nanotar = require("nanotar");
955
955
  var import_node_fs4 = require("fs");
@@ -1011,17 +1011,17 @@ async function readStdin() {
1011
1011
  __name(readStdin, "readStdin");
1012
1012
  async function capnpc(options) {
1013
1013
  try {
1014
- const { outputPath, tsconfig, sourcePath = [] } = options;
1014
+ const { output, tsconfig, schema = [] } = options;
1015
1015
  let dataBuf = await readStdin();
1016
1016
  if (dataBuf.byteLength === 0) {
1017
1017
  const opts = [];
1018
- if (outputPath) {
1019
- opts.push(`-o-:${outputPath}`);
1018
+ if (output) {
1019
+ opts.push(`-o-:${output}`);
1020
1020
  } else {
1021
1021
  opts.push("-o-");
1022
1022
  }
1023
1023
  dataBuf = await new Promise((resolve) => {
1024
- (0, import_node_child_process.exec)(`capnpc ${opts.join(" ")} ${sourcePath.join(" ")}`, {
1024
+ (0, import_node_child_process.exec)(`capnpc ${opts.join(" ")} ${schema.join(" ")}`, {
1025
1025
  encoding: "buffer"
1026
1026
  }, (error, stdout, stderr) => {
1027
1027
  if (stderr.length > 0) {
@@ -1048,8 +1048,8 @@ async function capnpc(options) {
1048
1048
  filePath = fullPath;
1049
1049
  }
1050
1050
  }
1051
- if (outputPath) {
1052
- filePath = joinPaths(outputPath, fileName);
1051
+ if (output) {
1052
+ filePath = joinPaths(output, fileName);
1053
1053
  }
1054
1054
  if (!(0, import_node_fs6.existsSync)(findFilePath(filePath))) {
1055
1055
  await createDirectory(findFilePath(filePath));
@@ -1101,42 +1101,51 @@ function createProgram() {
1101
1101
  });
1102
1102
  const generateId = new import_commander.Option("-i --generate-id", "Generate a new 64-bit unique ID for use in a Cap'n Proto schema").default(true);
1103
1103
  const standardImportOption = new import_commander.Option("--standard-import", "Add default import paths; use only those specified by -I").default(true);
1104
- const outputPathOption = new import_commander.Option("-o --output-path <path>", "The directory to output the generated files to").default(process.cwd());
1105
- const sourceOption = new import_commander.Option("--source-path <path...>", "The directories containing the Cap'n Proto schema files to compile (default: current working directory)").default([
1104
+ const schemaOption = new import_commander.Option("-s --schema <path...>", "The directories containing the Cap'n Proto schema files to compile (default: current working directory)").default([
1106
1105
  joinPaths(process.cwd(), "**/*.capnp")
1107
1106
  ]).argParser((val) => {
1108
- if (val.startsWith("--source") || val.startsWith("-s")) {
1109
- return val.split(",").map((dir) => dir.trim());
1107
+ let result = [];
1108
+ if (val.startsWith("--schema") || val.startsWith("-s")) {
1109
+ result = val.split(",").map((dir) => dir.trim());
1110
1110
  }
1111
- return [
1111
+ result = [
1112
1112
  val.trim()
1113
1113
  ];
1114
+ return result.map((dir) => dir.endsWith(".capnp") ? dir : joinPaths(dir, "**/*.capnp"));
1114
1115
  });
1115
- const tsconfigPathOption = new import_commander.Option("--tsconfig-path <path>", "The path to the TypeScript configuration file to use for compilation").default(joinPaths(process.cwd(), "tsconfig.json"));
1116
+ const outputOption = new import_commander.Option("-o --output <path>", "The directory to output the generated files to");
1117
+ const tsconfigOption = new import_commander.Option("-p --tsconfig <path>", "The path to the TypeScript configuration file to use for compilation").default(joinPaths(process.cwd(), "tsconfig.json"));
1116
1118
  program.command("compile", {
1117
1119
  isDefault: true
1118
- }).description("Run the Storm Cap'n Proto compiler").addOption(sourceOption).addOption(outputPathOption).addOption(importPathOption).addOption(tsconfigPathOption).addOption(generateId).addOption(standardImportOption).addOption(tsOption).addOption(jsOption).addOption(dtsOption).action(compileAction).showSuggestionAfterError(true).showHelpAfterError(true);
1120
+ }).description("Run the Storm Cap'n Proto compiler").addOption(schemaOption).addOption(outputOption).addOption(importPathOption).addOption(tsconfigOption).addOption(generateId).addOption(standardImportOption).addOption(tsOption).addOption(jsOption).addOption(dtsOption).action(compileAction).showSuggestionAfterError(true).showHelpAfterError(true);
1119
1121
  return program;
1120
1122
  }
1121
1123
  __name(createProgram, "createProgram");
1122
1124
  async function compileAction(options) {
1123
- (0, import_console.writeInfo)(`\u{1F4E6} Storm Cap'n Proto Compiler will output ${options.ts ? "TypeScript code" : ""}${options.js ? options.ts ? ", JavaScript code" : "JavaScript code" : ""}${options.dts ? options.ts || options.js ? ", TypeScript declarations" : "TypeScript declarations" : ""} files to ${options.outputPath}...`, {
1125
+ (0, import_console.writeInfo)(`\u{1F4E6} Storm Cap'n Proto Compiler will output ${options.ts ? "TypeScript code" : ""}${options.js ? options.ts ? ", JavaScript code" : "JavaScript code" : ""}${options.dts ? options.ts || options.js ? ", TypeScript declarations" : "TypeScript declarations" : ""} files ${options.output ? `to ${options.output}...` : ""}`, {
1124
1126
  logLevel: "all"
1125
1127
  });
1126
- const resolvedTsconfig = await readJsonFile(options.tsconfigPath);
1127
- const tsconfig = import_typescript.default.parseJsonConfigFileContent(resolvedTsconfig, import_typescript.default.sys, findFilePath(options.tsconfigPath));
1128
- const sourcefiles = [];
1129
- for (const sourcePath of options.sourcePath) {
1130
- if (!sourcePath) {
1131
- (0, import_console.writeFatal)(`\u274C The source path "${sourcePath}" is invalid. Please provide a valid path.`, {
1128
+ if (!existsSync2(options.tsconfig)) {
1129
+ (0, import_console.writeFatal)(options.tsconfig ? `\u2716 The specified TypeScript configuration file "${options.tsconfig}" does not exist. Please provide a valid path.` : "\u2716 The specified TypeScript configuration file does not exist. Please provide a valid path.", {
1130
+ logLevel: "all"
1131
+ });
1132
+ return;
1133
+ }
1134
+ const resolvedTsconfig = await readJsonFile(options.tsconfig);
1135
+ const tsconfig = import_typescript.default.parseJsonConfigFileContent(resolvedTsconfig, import_typescript.default.sys, findFilePath(options.tsconfig));
1136
+ tsconfig.options.configFilePath = options.tsconfig;
1137
+ const schema = [];
1138
+ for (const schemaPath of options.schema) {
1139
+ if (!schemaPath || !schemaPath.includes("*") && !existsSync2(schemaPath)) {
1140
+ (0, import_console.writeFatal)(`\u274C The schema path "${schemaPath}" is invalid. Please provide a valid path.`, {
1132
1141
  logLevel: "all"
1133
1142
  });
1134
1143
  return;
1135
1144
  }
1136
- sourcefiles.push(...await listFiles(sourcePath));
1145
+ schema.push(...await listFiles(schemaPath));
1137
1146
  }
1138
- if (sourcefiles.length === 0) {
1139
- (0, import_console.writeFatal)(`\u274C No Cap'n Proto schema files found in the specified source paths: ${options.sourcePath.join(", ")}. Please ensure that the paths are correct and contain .capnp files.`, {
1147
+ if (schema.length === 0) {
1148
+ (0, import_console.writeFatal)(`\u274C No Cap'n Proto schema files found in the specified source paths: ${options.schema.join(", ")}. Please ensure that the paths are correct and contain .capnp files.`, {
1140
1149
  logLevel: "all"
1141
1150
  });
1142
1151
  return;
@@ -1144,7 +1153,8 @@ async function compileAction(options) {
1144
1153
  const result = await capnpc({
1145
1154
  ...options,
1146
1155
  tsconfig,
1147
- sourcePath: sourcefiles
1156
+ schema,
1157
+ output: options.output ? options.output : schema.length > 0 && schema[0] ? findFilePath(schema[0]) : process.cwd()
1148
1158
  });
1149
1159
  if (result.files.size === 0) {
1150
1160
  (0, import_console.writeInfo)("\u26A0\uFE0F No files were generated. Please check your schema files.", {
package/bin/capnpc.js CHANGED
@@ -625,6 +625,16 @@ async function readJsonFile(path, options) {
625
625
  }
626
626
  __name(readJsonFile, "readJsonFile");
627
627
 
628
+ // ../path/src/exists.ts
629
+ import { existsSync as existsSyncFs } from "node:fs";
630
+ import { access, constants } from "node:fs/promises";
631
+ var existsSync2 = /* @__PURE__ */ __name((filePath) => {
632
+ return existsSyncFs(filePath);
633
+ }, "existsSync");
634
+ var exists = /* @__PURE__ */ __name(async (filePath) => {
635
+ return access(filePath, constants.F_OK).then(() => true).catch(() => false);
636
+ }, "exists");
637
+
628
638
  // ../path/src/file-path-fns.ts
629
639
  import { relative } from "node:path";
630
640
 
@@ -908,16 +918,6 @@ __name(findFilePath, "findFilePath");
908
918
  import { Command, Option } from "commander";
909
919
  import ts from "typescript";
910
920
 
911
- // ../path/src/exists.ts
912
- import { existsSync as existsSyncFs } from "node:fs";
913
- import { access, constants } from "node:fs/promises";
914
- var existsSync2 = /* @__PURE__ */ __name((filePath) => {
915
- return existsSyncFs(filePath);
916
- }, "existsSync");
917
- var exists = /* @__PURE__ */ __name(async (filePath) => {
918
- return access(filePath, constants.F_OK).then(() => true).catch(() => false);
919
- }, "exists");
920
-
921
921
  // ../fs/src/helpers.ts
922
922
  import { parseTar, parseTarGzip } from "nanotar";
923
923
  import { createWriteStream, mkdirSync, rmSync } from "node:fs";
@@ -979,17 +979,17 @@ async function readStdin() {
979
979
  __name(readStdin, "readStdin");
980
980
  async function capnpc(options) {
981
981
  try {
982
- const { outputPath, tsconfig, sourcePath = [] } = options;
982
+ const { output, tsconfig, schema = [] } = options;
983
983
  let dataBuf = await readStdin();
984
984
  if (dataBuf.byteLength === 0) {
985
985
  const opts = [];
986
- if (outputPath) {
987
- opts.push(`-o-:${outputPath}`);
986
+ if (output) {
987
+ opts.push(`-o-:${output}`);
988
988
  } else {
989
989
  opts.push("-o-");
990
990
  }
991
991
  dataBuf = await new Promise((resolve) => {
992
- exec(`capnpc ${opts.join(" ")} ${sourcePath.join(" ")}`, {
992
+ exec(`capnpc ${opts.join(" ")} ${schema.join(" ")}`, {
993
993
  encoding: "buffer"
994
994
  }, (error, stdout, stderr) => {
995
995
  if (stderr.length > 0) {
@@ -1016,8 +1016,8 @@ async function capnpc(options) {
1016
1016
  filePath = fullPath;
1017
1017
  }
1018
1018
  }
1019
- if (outputPath) {
1020
- filePath = joinPaths(outputPath, fileName);
1019
+ if (output) {
1020
+ filePath = joinPaths(output, fileName);
1021
1021
  }
1022
1022
  if (!existsSync3(findFilePath(filePath))) {
1023
1023
  await createDirectory(findFilePath(filePath));
@@ -1069,42 +1069,51 @@ function createProgram() {
1069
1069
  });
1070
1070
  const generateId = new Option("-i --generate-id", "Generate a new 64-bit unique ID for use in a Cap'n Proto schema").default(true);
1071
1071
  const standardImportOption = new Option("--standard-import", "Add default import paths; use only those specified by -I").default(true);
1072
- const outputPathOption = new Option("-o --output-path <path>", "The directory to output the generated files to").default(process.cwd());
1073
- const sourceOption = new Option("--source-path <path...>", "The directories containing the Cap'n Proto schema files to compile (default: current working directory)").default([
1072
+ const schemaOption = new Option("-s --schema <path...>", "The directories containing the Cap'n Proto schema files to compile (default: current working directory)").default([
1074
1073
  joinPaths(process.cwd(), "**/*.capnp")
1075
1074
  ]).argParser((val) => {
1076
- if (val.startsWith("--source") || val.startsWith("-s")) {
1077
- return val.split(",").map((dir) => dir.trim());
1075
+ let result = [];
1076
+ if (val.startsWith("--schema") || val.startsWith("-s")) {
1077
+ result = val.split(",").map((dir) => dir.trim());
1078
1078
  }
1079
- return [
1079
+ result = [
1080
1080
  val.trim()
1081
1081
  ];
1082
+ return result.map((dir) => dir.endsWith(".capnp") ? dir : joinPaths(dir, "**/*.capnp"));
1082
1083
  });
1083
- const tsconfigPathOption = new Option("--tsconfig-path <path>", "The path to the TypeScript configuration file to use for compilation").default(joinPaths(process.cwd(), "tsconfig.json"));
1084
+ const outputOption = new Option("-o --output <path>", "The directory to output the generated files to");
1085
+ const tsconfigOption = new Option("-p --tsconfig <path>", "The path to the TypeScript configuration file to use for compilation").default(joinPaths(process.cwd(), "tsconfig.json"));
1084
1086
  program.command("compile", {
1085
1087
  isDefault: true
1086
- }).description("Run the Storm Cap'n Proto compiler").addOption(sourceOption).addOption(outputPathOption).addOption(importPathOption).addOption(tsconfigPathOption).addOption(generateId).addOption(standardImportOption).addOption(tsOption).addOption(jsOption).addOption(dtsOption).action(compileAction).showSuggestionAfterError(true).showHelpAfterError(true);
1088
+ }).description("Run the Storm Cap'n Proto compiler").addOption(schemaOption).addOption(outputOption).addOption(importPathOption).addOption(tsconfigOption).addOption(generateId).addOption(standardImportOption).addOption(tsOption).addOption(jsOption).addOption(dtsOption).action(compileAction).showSuggestionAfterError(true).showHelpAfterError(true);
1087
1089
  return program;
1088
1090
  }
1089
1091
  __name(createProgram, "createProgram");
1090
1092
  async function compileAction(options) {
1091
- writeInfo(`\u{1F4E6} Storm Cap'n Proto Compiler will output ${options.ts ? "TypeScript code" : ""}${options.js ? options.ts ? ", JavaScript code" : "JavaScript code" : ""}${options.dts ? options.ts || options.js ? ", TypeScript declarations" : "TypeScript declarations" : ""} files to ${options.outputPath}...`, {
1093
+ writeInfo(`\u{1F4E6} Storm Cap'n Proto Compiler will output ${options.ts ? "TypeScript code" : ""}${options.js ? options.ts ? ", JavaScript code" : "JavaScript code" : ""}${options.dts ? options.ts || options.js ? ", TypeScript declarations" : "TypeScript declarations" : ""} files ${options.output ? `to ${options.output}...` : ""}`, {
1092
1094
  logLevel: "all"
1093
1095
  });
1094
- const resolvedTsconfig = await readJsonFile(options.tsconfigPath);
1095
- const tsconfig = ts.parseJsonConfigFileContent(resolvedTsconfig, ts.sys, findFilePath(options.tsconfigPath));
1096
- const sourcefiles = [];
1097
- for (const sourcePath of options.sourcePath) {
1098
- if (!sourcePath) {
1099
- writeFatal(`\u274C The source path "${sourcePath}" is invalid. Please provide a valid path.`, {
1096
+ if (!existsSync2(options.tsconfig)) {
1097
+ writeFatal(options.tsconfig ? `\u2716 The specified TypeScript configuration file "${options.tsconfig}" does not exist. Please provide a valid path.` : "\u2716 The specified TypeScript configuration file does not exist. Please provide a valid path.", {
1098
+ logLevel: "all"
1099
+ });
1100
+ return;
1101
+ }
1102
+ const resolvedTsconfig = await readJsonFile(options.tsconfig);
1103
+ const tsconfig = ts.parseJsonConfigFileContent(resolvedTsconfig, ts.sys, findFilePath(options.tsconfig));
1104
+ tsconfig.options.configFilePath = options.tsconfig;
1105
+ const schema = [];
1106
+ for (const schemaPath of options.schema) {
1107
+ if (!schemaPath || !schemaPath.includes("*") && !existsSync2(schemaPath)) {
1108
+ writeFatal(`\u274C The schema path "${schemaPath}" is invalid. Please provide a valid path.`, {
1100
1109
  logLevel: "all"
1101
1110
  });
1102
1111
  return;
1103
1112
  }
1104
- sourcefiles.push(...await listFiles(sourcePath));
1113
+ schema.push(...await listFiles(schemaPath));
1105
1114
  }
1106
- if (sourcefiles.length === 0) {
1107
- writeFatal(`\u274C No Cap'n Proto schema files found in the specified source paths: ${options.sourcePath.join(", ")}. Please ensure that the paths are correct and contain .capnp files.`, {
1115
+ if (schema.length === 0) {
1116
+ writeFatal(`\u274C No Cap'n Proto schema files found in the specified source paths: ${options.schema.join(", ")}. Please ensure that the paths are correct and contain .capnp files.`, {
1108
1117
  logLevel: "all"
1109
1118
  });
1110
1119
  return;
@@ -1112,7 +1121,8 @@ async function compileAction(options) {
1112
1121
  const result = await capnpc({
1113
1122
  ...options,
1114
1123
  tsconfig,
1115
- sourcePath: sourcefiles
1124
+ schema,
1125
+ output: options.output ? options.output : schema.length > 0 && schema[0] ? findFilePath(schema[0]) : process.cwd()
1116
1126
  });
1117
1127
  if (result.files.size === 0) {
1118
1128
  writeInfo("\u26A0\uFE0F No files were generated. Please check your schema files.", {
@@ -908,17 +908,17 @@ async function readStdin() {
908
908
  __name(readStdin, "readStdin");
909
909
  async function capnpc(options) {
910
910
  try {
911
- const { outputPath, tsconfig, sourcePath = [] } = options;
911
+ const { output, tsconfig, schema = [] } = options;
912
912
  let dataBuf = await readStdin();
913
913
  if (dataBuf.byteLength === 0) {
914
914
  const opts = [];
915
- if (outputPath) {
916
- opts.push(`-o-:${outputPath}`);
915
+ if (output) {
916
+ opts.push(`-o-:${output}`);
917
917
  } else {
918
918
  opts.push("-o-");
919
919
  }
920
920
  dataBuf = await new Promise((resolve) => {
921
- exec(`capnpc ${opts.join(" ")} ${sourcePath.join(" ")}`, {
921
+ exec(`capnpc ${opts.join(" ")} ${schema.join(" ")}`, {
922
922
  encoding: "buffer"
923
923
  }, (error, stdout, stderr) => {
924
924
  if (stderr.length > 0) {
@@ -945,8 +945,8 @@ async function capnpc(options) {
945
945
  filePath = fullPath;
946
946
  }
947
947
  }
948
- if (outputPath) {
949
- filePath = joinPaths(outputPath, fileName);
948
+ if (output) {
949
+ filePath = joinPaths(output, fileName);
950
950
  }
951
951
  if (!existsSync2(findFilePath(filePath))) {
952
952
  await createDirectory(findFilePath(filePath));
@@ -908,17 +908,17 @@ async function readStdin() {
908
908
  _chunkUSNT2KNTcjs.__name.call(void 0, readStdin, "readStdin");
909
909
  async function capnpc(options) {
910
910
  try {
911
- const { outputPath, tsconfig, sourcePath = [] } = options;
911
+ const { output, tsconfig, schema = [] } = options;
912
912
  let dataBuf = await readStdin();
913
913
  if (dataBuf.byteLength === 0) {
914
914
  const opts = [];
915
- if (outputPath) {
916
- opts.push(`-o-:${outputPath}`);
915
+ if (output) {
916
+ opts.push(`-o-:${output}`);
917
917
  } else {
918
918
  opts.push("-o-");
919
919
  }
920
920
  dataBuf = await new Promise((resolve) => {
921
- _child_process.exec.call(void 0, `capnpc ${opts.join(" ")} ${sourcePath.join(" ")}`, {
921
+ _child_process.exec.call(void 0, `capnpc ${opts.join(" ")} ${schema.join(" ")}`, {
922
922
  encoding: "buffer"
923
923
  }, (error, stdout, stderr) => {
924
924
  if (stderr.length > 0) {
@@ -945,8 +945,8 @@ async function capnpc(options) {
945
945
  filePath = fullPath;
946
946
  }
947
947
  }
948
- if (outputPath) {
949
- filePath = joinPaths(outputPath, fileName);
948
+ if (output) {
949
+ filePath = joinPaths(output, fileName);
950
950
  }
951
951
  if (!_fs.existsSync.call(void 0, findFilePath(filePath))) {
952
952
  await createDirectory(findFilePath(filePath));
package/dist/compile.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPV3OG5H3cjs = require('./chunk-PV3OG5H3.cjs');
3
+ var _chunkGFNNH76Icjs = require('./chunk-GFNNH76I.cjs');
4
4
  require('./chunk-USNT2KNT.cjs');
5
5
 
6
6
 
7
- exports.capnpc = _chunkPV3OG5H3cjs.capnpc;
7
+ exports.capnpc = _chunkGFNNH76Icjs.capnpc;
package/dist/compile.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  capnpc
3
- } from "./chunk-LY3GWW4E.js";
3
+ } from "./chunk-3FC7SST2.js";
4
4
  import "./chunk-SHUYVCID.js";
5
5
  export {
6
6
  capnpc
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPV3OG5H3cjs = require('./chunk-PV3OG5H3.cjs');
3
+ var _chunkGFNNH76Icjs = require('./chunk-GFNNH76I.cjs');
4
4
  require('./chunk-USNT2KNT.cjs');
5
5
  require('./chunk-ORA4UQMU.cjs');
6
6
 
7
7
 
8
- exports.capnpc = _chunkPV3OG5H3cjs.capnpc;
8
+ exports.capnpc = _chunkGFNNH76Icjs.capnpc;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  capnpc
3
- } from "./chunk-LY3GWW4E.js";
3
+ } from "./chunk-3FC7SST2.js";
4
4
  import "./chunk-SHUYVCID.js";
5
5
  import "./chunk-OULCUN6I.js";
6
6
  export {
package/dist/types.d.cts CHANGED
@@ -16,18 +16,18 @@ interface CodeGeneratorContext {
16
16
  files: CodeGeneratorFileContext[];
17
17
  }
18
18
  interface CapnpcCLIOptions {
19
- ts: boolean;
20
- js: boolean;
21
- dts: boolean;
22
- sourcePath: string[];
23
- outputPath: string;
24
- importPath: string[];
25
- tsconfigPath: string;
26
- generateId: boolean;
27
- standardImport: boolean;
19
+ ts?: boolean;
20
+ js?: boolean;
21
+ dts?: boolean;
22
+ schema: string[];
23
+ output?: string;
24
+ importPath?: string[];
25
+ tsconfig: string;
26
+ generateId?: boolean;
27
+ standardImport?: boolean;
28
28
  }
29
- type CapnpcOptions = Omit<CapnpcCLIOptions, "tsconfigPath"> & {
30
- tsconfig?: ts.ParsedCommandLine;
29
+ type CapnpcOptions = Omit<CapnpcCLIOptions, "tsconfig"> & {
30
+ tsconfig: ts.ParsedCommandLine;
31
31
  };
32
32
  interface CapnpcResult {
33
33
  ctx: CodeGeneratorContext;
package/dist/types.d.ts CHANGED
@@ -16,18 +16,18 @@ interface CodeGeneratorContext {
16
16
  files: CodeGeneratorFileContext[];
17
17
  }
18
18
  interface CapnpcCLIOptions {
19
- ts: boolean;
20
- js: boolean;
21
- dts: boolean;
22
- sourcePath: string[];
23
- outputPath: string;
24
- importPath: string[];
25
- tsconfigPath: string;
26
- generateId: boolean;
27
- standardImport: boolean;
19
+ ts?: boolean;
20
+ js?: boolean;
21
+ dts?: boolean;
22
+ schema: string[];
23
+ output?: string;
24
+ importPath?: string[];
25
+ tsconfig: string;
26
+ generateId?: boolean;
27
+ standardImport?: boolean;
28
28
  }
29
- type CapnpcOptions = Omit<CapnpcCLIOptions, "tsconfigPath"> & {
30
- tsconfig?: ts.ParsedCommandLine;
29
+ type CapnpcOptions = Omit<CapnpcCLIOptions, "tsconfig"> & {
30
+ tsconfig: ts.ParsedCommandLine;
31
31
  };
32
32
  interface CapnpcResult {
33
33
  ctx: CodeGeneratorContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/capnp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
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": {