@stryke/capnp 0.10.1 → 0.10.3

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
@@ -7970,11 +7970,13 @@ async function resolveOptions(options) {
7970
7970
  });
7971
7971
  return null;
7972
7972
  }
7973
- resolvedTsconfig.options.outDir = joinPaths(options.projectRoot, relativePath(tsconfigPath ? findFilePath(tsconfigPath) : options.projectRoot, joinPaths(options.workspaceRoot, resolvedSchemas[0].endsWith(".capnp") ? findFilePath(resolvedSchemas[0]) : resolvedSchemas[0])));
7973
+ const output = options.output ? options.output.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot) : joinPaths(options.projectRoot, relativePath(tsconfigPath ? findFilePath(tsconfigPath) : options.projectRoot, joinPaths(options.workspaceRoot, resolvedSchemas[0].endsWith(".capnp") ? findFilePath(resolvedSchemas[0]) : resolvedSchemas[0])));
7974
+ resolvedTsconfig.options.outDir = output;
7974
7975
  return {
7975
7976
  workspaceRoot: options.workspaceRoot,
7976
7977
  projectRoot: options.projectRoot,
7977
7978
  schemas: resolvedSchemas,
7979
+ output,
7978
7980
  js: options.js ?? false,
7979
7981
  ts: options.ts ?? (options.noTs !== void 0 ? !options.noTs : true),
7980
7982
  dts: options.dts ?? (options.noDts !== void 0 ? !options.noDts : true),
@@ -8006,6 +8008,10 @@ async function capnpc(options) {
8006
8008
  if (dataBuf.byteLength === 0) {
8007
8009
  const opts = [];
8008
8010
  if (output) {
8011
+ if (!existsSync(output)) {
8012
+ (0, import_console2.writeWarning)(`Output directory "${output}" does not exist, it will be created...`);
8013
+ await createDirectory(output);
8014
+ }
8009
8015
  opts.push(`-o-:${output}`);
8010
8016
  } else {
8011
8017
  opts.push("-o-");
package/bin/capnpc.js CHANGED
@@ -7939,11 +7939,13 @@ async function resolveOptions(options) {
7939
7939
  });
7940
7940
  return null;
7941
7941
  }
7942
- resolvedTsconfig.options.outDir = joinPaths(options.projectRoot, relativePath(tsconfigPath ? findFilePath(tsconfigPath) : options.projectRoot, joinPaths(options.workspaceRoot, resolvedSchemas[0].endsWith(".capnp") ? findFilePath(resolvedSchemas[0]) : resolvedSchemas[0])));
7942
+ const output = options.output ? options.output.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot) : joinPaths(options.projectRoot, relativePath(tsconfigPath ? findFilePath(tsconfigPath) : options.projectRoot, joinPaths(options.workspaceRoot, resolvedSchemas[0].endsWith(".capnp") ? findFilePath(resolvedSchemas[0]) : resolvedSchemas[0])));
7943
+ resolvedTsconfig.options.outDir = output;
7943
7944
  return {
7944
7945
  workspaceRoot: options.workspaceRoot,
7945
7946
  projectRoot: options.projectRoot,
7946
7947
  schemas: resolvedSchemas,
7948
+ output,
7947
7949
  js: options.js ?? false,
7948
7950
  ts: options.ts ?? (options.noTs !== void 0 ? !options.noTs : true),
7949
7951
  dts: options.dts ?? (options.noDts !== void 0 ? !options.noDts : true),
@@ -7975,6 +7977,10 @@ async function capnpc(options) {
7975
7977
  if (dataBuf.byteLength === 0) {
7976
7978
  const opts = [];
7977
7979
  if (output) {
7980
+ if (!existsSync(output)) {
7981
+ writeWarning2(`Output directory "${output}" does not exist, it will be created...`);
7982
+ await createDirectory(output);
7983
+ }
7978
7984
  opts.push(`-o-:${output}`);
7979
7985
  } else {
7980
7986
  opts.push("-o-");