@stryke/capnp 0.11.0 → 0.11.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.
@@ -14,6 +14,14 @@ function toArray(array) {
14
14
  }
15
15
  _chunkUSNT2KNTcjs.__name.call(void 0, toArray, "toArray");
16
16
 
17
+ // ../fs/src/exists.ts
18
+ var _fs = require('fs');
19
+ var _promises = require('fs/promises');
20
+ function existsSync(filePath) {
21
+ return _fs.existsSync.call(void 0, filePath);
22
+ }
23
+ _chunkUSNT2KNTcjs.__name.call(void 0, existsSync, "existsSync");
24
+
17
25
  // ../type-checks/src/get-object-tag.ts
18
26
  var getObjectTag = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (value) => {
19
27
  if (value == null) {
@@ -578,8 +586,8 @@ var isError = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (obj) => {
578
586
  }, "isError");
579
587
 
580
588
  // ../fs/src/read-file.ts
581
- var _fs = require('fs');
582
- var _promises = require('fs/promises');
589
+
590
+
583
591
  var readFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (filePath) => {
584
592
  try {
585
593
  if (!filePath) {
@@ -593,30 +601,46 @@ var readFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (file
593
601
  }
594
602
  }, "readFile");
595
603
 
596
- // ../path/src/is-file.ts
604
+ // ../path/src/regex.ts
605
+ var DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
606
+ var DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
607
+ var UNC_REGEX = /^[/\\]{2}/;
608
+ var ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
609
+ var ROOT_FOLDER_REGEX = /^\/([A-Z]:)?$/i;
597
610
 
611
+ // ../path/src/slash.ts
612
+ function slash(path) {
613
+ if (path.startsWith("\\\\?\\")) {
614
+ return path;
615
+ }
616
+ return path.replace(/\\/g, "/");
617
+ }
618
+ _chunkUSNT2KNTcjs.__name.call(void 0, slash, "slash");
619
+
620
+ // ../path/src/is-type.ts
621
+ function isAbsolutePath(path) {
622
+ return ABSOLUTE_PATH_REGEX.test(slash(path));
623
+ }
624
+ _chunkUSNT2KNTcjs.__name.call(void 0, isAbsolutePath, "isAbsolutePath");
625
+ function isAbsolute(path) {
626
+ return isAbsolutePath(path);
627
+ }
628
+ _chunkUSNT2KNTcjs.__name.call(void 0, isAbsolute, "isAbsolute");
598
629
 
599
630
  // ../path/src/join-paths.ts
600
- var _DRIVE_LETTER_START_RE = /^[A-Z]:\//i;
601
631
  function normalizeWindowsPath(input = "") {
602
632
  if (!input) {
603
633
  return input;
604
634
  }
605
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
635
+ return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
606
636
  }
607
637
  _chunkUSNT2KNTcjs.__name.call(void 0, normalizeWindowsPath, "normalizeWindowsPath");
608
- var _UNC_REGEX = /^[/\\]{2}/;
609
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i;
610
- var _DRIVE_LETTER_RE = /^[A-Z]:$/i;
611
- var isAbsolute = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(p) {
612
- return _IS_ABSOLUTE_RE.test(p);
613
- }, "isAbsolute");
614
- var correctPaths = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(path) {
638
+ function correctPaths(path) {
615
639
  if (!path || path.length === 0) {
616
640
  return ".";
617
641
  }
618
642
  path = normalizeWindowsPath(path);
619
- const isUNCPath = path.match(_UNC_REGEX);
643
+ const isUNCPath = path.match(UNC_REGEX);
620
644
  const isPathAbsolute = isAbsolute(path);
621
645
  const trailingSeparator = path[path.length - 1] === "/";
622
646
  path = normalizeString(path, !isPathAbsolute);
@@ -629,7 +653,7 @@ var correctPaths = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, functio
629
653
  if (trailingSeparator) {
630
654
  path += "/";
631
655
  }
632
- if (_DRIVE_LETTER_RE.test(path)) {
656
+ if (DRIVE_LETTER_REGEX.test(path)) {
633
657
  path += "/";
634
658
  }
635
659
  if (isUNCPath) {
@@ -639,8 +663,9 @@ var correctPaths = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, functio
639
663
  return `//${path}`;
640
664
  }
641
665
  return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
642
- }, "correctPaths");
643
- var joinPaths = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(...segments) {
666
+ }
667
+ _chunkUSNT2KNTcjs.__name.call(void 0, correctPaths, "correctPaths");
668
+ function joinPaths(...segments) {
644
669
  let path = "";
645
670
  for (const seg of segments) {
646
671
  if (!seg) {
@@ -660,7 +685,8 @@ var joinPaths = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(.
660
685
  }
661
686
  }
662
687
  return correctPaths(path);
663
- }, "joinPaths");
688
+ }
689
+ _chunkUSNT2KNTcjs.__name.call(void 0, joinPaths, "joinPaths");
664
690
  function normalizeString(path, allowAboveRoot) {
665
691
  let res = "";
666
692
  let lastSegmentLength = 0;
@@ -723,18 +749,6 @@ function normalizeString(path, allowAboveRoot) {
723
749
  }
724
750
  _chunkUSNT2KNTcjs.__name.call(void 0, normalizeString, "normalizeString");
725
751
 
726
- // ../path/src/regex.ts
727
- var DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
728
-
729
- // ../path/src/slash.ts
730
- function slash(path) {
731
- if (path.startsWith("\\\\?\\")) {
732
- return path;
733
- }
734
- return path.replace(/\\/g, "/");
735
- }
736
- _chunkUSNT2KNTcjs.__name.call(void 0, slash, "slash");
737
-
738
752
  // ../path/src/correct-path.ts
739
753
  function normalizeWindowsPath2(input = "") {
740
754
  if (!input) {
@@ -743,19 +757,67 @@ function normalizeWindowsPath2(input = "") {
743
757
  return slash(input).replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
744
758
  }
745
759
  _chunkUSNT2KNTcjs.__name.call(void 0, normalizeWindowsPath2, "normalizeWindowsPath");
746
-
747
- // ../path/src/exists.ts
748
-
749
-
750
- var existsSync2 = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (filePath) => {
751
- return _fs.existsSync.call(void 0, filePath);
752
- }, "existsSync");
753
-
754
- // ../path/src/file-path-fns.ts
755
- var _path = require('path');
756
-
757
- // ../path/src/get-workspace-root.ts
758
- var _configtools = require('@storm-software/config-tools');
760
+ function normalizeString2(path, allowAboveRoot) {
761
+ let res = "";
762
+ let lastSegmentLength = 0;
763
+ let lastSlash = -1;
764
+ let dots = 0;
765
+ let char = null;
766
+ for (let index = 0; index <= path.length; ++index) {
767
+ if (index < path.length) {
768
+ char = path[index];
769
+ } else if (char === "/") {
770
+ break;
771
+ } else {
772
+ char = "/";
773
+ }
774
+ if (char === "/") {
775
+ if (lastSlash === index - 1 || dots === 1) {
776
+ } else if (dots === 2) {
777
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
778
+ if (res.length > 2) {
779
+ const lastSlashIndex = res.lastIndexOf("/");
780
+ if (lastSlashIndex === -1) {
781
+ res = "";
782
+ lastSegmentLength = 0;
783
+ } else {
784
+ res = res.slice(0, lastSlashIndex);
785
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
786
+ }
787
+ lastSlash = index;
788
+ dots = 0;
789
+ continue;
790
+ } else if (res.length > 0) {
791
+ res = "";
792
+ lastSegmentLength = 0;
793
+ lastSlash = index;
794
+ dots = 0;
795
+ continue;
796
+ }
797
+ }
798
+ if (allowAboveRoot) {
799
+ res += res.length > 0 ? "/.." : "..";
800
+ lastSegmentLength = 2;
801
+ }
802
+ } else {
803
+ if (res.length > 0) {
804
+ res += `/${path.slice(lastSlash + 1, index)}`;
805
+ } else {
806
+ res = path.slice(lastSlash + 1, index);
807
+ }
808
+ lastSegmentLength = index - lastSlash - 1;
809
+ }
810
+ lastSlash = index;
811
+ dots = 0;
812
+ } else if (char === "." && dots !== -1) {
813
+ ++dots;
814
+ } else {
815
+ dots = -1;
816
+ }
817
+ }
818
+ return res;
819
+ }
820
+ _chunkUSNT2KNTcjs.__name.call(void 0, normalizeString2, "normalizeString");
759
821
 
760
822
  // ../path/src/file-path-fns.ts
761
823
  function findFileName(filePath, options = {}) {
@@ -778,8 +840,56 @@ function findFilePath(filePath) {
778
840
  return result === "/" ? result : result.replace(/\/$/, "");
779
841
  }
780
842
  _chunkUSNT2KNTcjs.__name.call(void 0, findFilePath, "findFilePath");
843
+ function resolve(...paths) {
844
+ paths = paths.map((argument) => normalizeWindowsPath2(argument));
845
+ let resolvedPath = "";
846
+ let resolvedAbsolute = false;
847
+ for (let index = paths.length - 1; index >= -1 && !resolvedAbsolute; index--) {
848
+ const path = index >= 0 ? paths[index] : currentDir();
849
+ if (!path || path.length === 0) {
850
+ continue;
851
+ }
852
+ resolvedPath = `${path}/${resolvedPath}`;
853
+ resolvedAbsolute = isAbsolute(path);
854
+ }
855
+ resolvedPath = normalizeString2(resolvedPath, !resolvedAbsolute);
856
+ if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
857
+ return `/${resolvedPath}`;
858
+ }
859
+ return resolvedPath.length > 0 ? resolvedPath : ".";
860
+ }
861
+ _chunkUSNT2KNTcjs.__name.call(void 0, resolve, "resolve");
862
+ function currentDir() {
863
+ if (typeof process !== "undefined" && typeof process.cwd === "function") {
864
+ return process.cwd().replace(/\\/g, "/");
865
+ }
866
+ return "/";
867
+ }
868
+ _chunkUSNT2KNTcjs.__name.call(void 0, currentDir, "currentDir");
869
+ function relative(from, to) {
870
+ const _from = resolve(from).replace(ROOT_FOLDER_REGEX, "$1").split("/");
871
+ const _to = resolve(to).replace(ROOT_FOLDER_REGEX, "$1").split("/");
872
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
873
+ return _to.join("/");
874
+ }
875
+ const _fromCopy = [
876
+ ..._from
877
+ ];
878
+ for (const segment of _fromCopy) {
879
+ if (_to[0] !== segment) {
880
+ break;
881
+ }
882
+ _from.shift();
883
+ _to.shift();
884
+ }
885
+ return [
886
+ ..._from.map(() => ".."),
887
+ ..._to
888
+ ].join("/");
889
+ }
890
+ _chunkUSNT2KNTcjs.__name.call(void 0, relative, "relative");
781
891
  function relativePath(from, to, withEndSlash = false) {
782
- return _path.relative.call(void 0, withEndSlash !== true ? from.replace(/\/$/, "") : from, withEndSlash !== true ? to.replace(/\/$/, "") : to);
892
+ return relative(withEndSlash !== true ? from.replace(/\/$/, "") : from, withEndSlash !== true ? to.replace(/\/$/, "") : to);
783
893
  }
784
894
  _chunkUSNT2KNTcjs.__name.call(void 0, relativePath, "relativePath");
785
895
 
@@ -840,7 +950,7 @@ async function resolveOptions(options) {
840
950
  if (options.tsconfig) {
841
951
  resolvedTsconfig = options.tsconfig;
842
952
  } else {
843
- if (!tsconfigPath || !existsSync2(tsconfigPath)) {
953
+ if (!tsconfigPath || !existsSync(tsconfigPath)) {
844
954
  const errorMessage = tsconfigPath ? `\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.";
845
955
  _console.writeFatal.call(void 0, errorMessage, {
846
956
  logLevel: "all"
@@ -893,4 +1003,4 @@ _chunkUSNT2KNTcjs.__name.call(void 0, resolveOptions, "resolveOptions");
893
1003
 
894
1004
 
895
1005
 
896
- exports.existsSync = existsSync2; exports.resolveOptions = resolveOptions;
1006
+ exports.existsSync = existsSync; exports.resolveOptions = resolveOptions;
@@ -14,6 +14,14 @@ function toArray(array) {
14
14
  }
15
15
  __name(toArray, "toArray");
16
16
 
17
+ // ../fs/src/exists.ts
18
+ import { existsSync as existsSyncFs } from "node:fs";
19
+ import { access, constants } from "node:fs/promises";
20
+ function existsSync(filePath) {
21
+ return existsSyncFs(filePath);
22
+ }
23
+ __name(existsSync, "existsSync");
24
+
17
25
  // ../type-checks/src/get-object-tag.ts
18
26
  var getObjectTag = /* @__PURE__ */ __name((value) => {
19
27
  if (value == null) {
@@ -578,7 +586,7 @@ var isError = /* @__PURE__ */ __name((obj) => {
578
586
  }, "isError");
579
587
 
580
588
  // ../fs/src/read-file.ts
581
- import { existsSync, readFileSync as readFileSyncFs } from "node:fs";
589
+ import { existsSync as existsSync2, readFileSync as readFileSyncFs } from "node:fs";
582
590
  import { readFile as readFileFs } from "node:fs/promises";
583
591
  var readFile = /* @__PURE__ */ __name(async (filePath) => {
584
592
  try {
@@ -593,30 +601,46 @@ var readFile = /* @__PURE__ */ __name(async (filePath) => {
593
601
  }
594
602
  }, "readFile");
595
603
 
596
- // ../path/src/is-file.ts
597
- import { lstatSync, statSync } from "node:fs";
604
+ // ../path/src/regex.ts
605
+ var DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
606
+ var DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
607
+ var UNC_REGEX = /^[/\\]{2}/;
608
+ var ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
609
+ var ROOT_FOLDER_REGEX = /^\/([A-Z]:)?$/i;
610
+
611
+ // ../path/src/slash.ts
612
+ function slash(path) {
613
+ if (path.startsWith("\\\\?\\")) {
614
+ return path;
615
+ }
616
+ return path.replace(/\\/g, "/");
617
+ }
618
+ __name(slash, "slash");
619
+
620
+ // ../path/src/is-type.ts
621
+ function isAbsolutePath(path) {
622
+ return ABSOLUTE_PATH_REGEX.test(slash(path));
623
+ }
624
+ __name(isAbsolutePath, "isAbsolutePath");
625
+ function isAbsolute(path) {
626
+ return isAbsolutePath(path);
627
+ }
628
+ __name(isAbsolute, "isAbsolute");
598
629
 
599
630
  // ../path/src/join-paths.ts
600
- var _DRIVE_LETTER_START_RE = /^[A-Z]:\//i;
601
631
  function normalizeWindowsPath(input = "") {
602
632
  if (!input) {
603
633
  return input;
604
634
  }
605
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
635
+ return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
606
636
  }
607
637
  __name(normalizeWindowsPath, "normalizeWindowsPath");
608
- var _UNC_REGEX = /^[/\\]{2}/;
609
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i;
610
- var _DRIVE_LETTER_RE = /^[A-Z]:$/i;
611
- var isAbsolute = /* @__PURE__ */ __name(function(p) {
612
- return _IS_ABSOLUTE_RE.test(p);
613
- }, "isAbsolute");
614
- var correctPaths = /* @__PURE__ */ __name(function(path) {
638
+ function correctPaths(path) {
615
639
  if (!path || path.length === 0) {
616
640
  return ".";
617
641
  }
618
642
  path = normalizeWindowsPath(path);
619
- const isUNCPath = path.match(_UNC_REGEX);
643
+ const isUNCPath = path.match(UNC_REGEX);
620
644
  const isPathAbsolute = isAbsolute(path);
621
645
  const trailingSeparator = path[path.length - 1] === "/";
622
646
  path = normalizeString(path, !isPathAbsolute);
@@ -629,7 +653,7 @@ var correctPaths = /* @__PURE__ */ __name(function(path) {
629
653
  if (trailingSeparator) {
630
654
  path += "/";
631
655
  }
632
- if (_DRIVE_LETTER_RE.test(path)) {
656
+ if (DRIVE_LETTER_REGEX.test(path)) {
633
657
  path += "/";
634
658
  }
635
659
  if (isUNCPath) {
@@ -639,8 +663,9 @@ var correctPaths = /* @__PURE__ */ __name(function(path) {
639
663
  return `//${path}`;
640
664
  }
641
665
  return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
642
- }, "correctPaths");
643
- var joinPaths = /* @__PURE__ */ __name(function(...segments) {
666
+ }
667
+ __name(correctPaths, "correctPaths");
668
+ function joinPaths(...segments) {
644
669
  let path = "";
645
670
  for (const seg of segments) {
646
671
  if (!seg) {
@@ -660,7 +685,8 @@ var joinPaths = /* @__PURE__ */ __name(function(...segments) {
660
685
  }
661
686
  }
662
687
  return correctPaths(path);
663
- }, "joinPaths");
688
+ }
689
+ __name(joinPaths, "joinPaths");
664
690
  function normalizeString(path, allowAboveRoot) {
665
691
  let res = "";
666
692
  let lastSegmentLength = 0;
@@ -723,18 +749,6 @@ function normalizeString(path, allowAboveRoot) {
723
749
  }
724
750
  __name(normalizeString, "normalizeString");
725
751
 
726
- // ../path/src/regex.ts
727
- var DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
728
-
729
- // ../path/src/slash.ts
730
- function slash(path) {
731
- if (path.startsWith("\\\\?\\")) {
732
- return path;
733
- }
734
- return path.replace(/\\/g, "/");
735
- }
736
- __name(slash, "slash");
737
-
738
752
  // ../path/src/correct-path.ts
739
753
  function normalizeWindowsPath2(input = "") {
740
754
  if (!input) {
@@ -743,19 +757,67 @@ function normalizeWindowsPath2(input = "") {
743
757
  return slash(input).replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
744
758
  }
745
759
  __name(normalizeWindowsPath2, "normalizeWindowsPath");
746
-
747
- // ../path/src/exists.ts
748
- import { existsSync as existsSyncFs } from "node:fs";
749
- import { access, constants } from "node:fs/promises";
750
- var existsSync2 = /* @__PURE__ */ __name((filePath) => {
751
- return existsSyncFs(filePath);
752
- }, "existsSync");
753
-
754
- // ../path/src/file-path-fns.ts
755
- import { relative } from "node:path";
756
-
757
- // ../path/src/get-workspace-root.ts
758
- import { findWorkspaceRootSafe } from "@storm-software/config-tools";
760
+ function normalizeString2(path, allowAboveRoot) {
761
+ let res = "";
762
+ let lastSegmentLength = 0;
763
+ let lastSlash = -1;
764
+ let dots = 0;
765
+ let char = null;
766
+ for (let index = 0; index <= path.length; ++index) {
767
+ if (index < path.length) {
768
+ char = path[index];
769
+ } else if (char === "/") {
770
+ break;
771
+ } else {
772
+ char = "/";
773
+ }
774
+ if (char === "/") {
775
+ if (lastSlash === index - 1 || dots === 1) {
776
+ } else if (dots === 2) {
777
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
778
+ if (res.length > 2) {
779
+ const lastSlashIndex = res.lastIndexOf("/");
780
+ if (lastSlashIndex === -1) {
781
+ res = "";
782
+ lastSegmentLength = 0;
783
+ } else {
784
+ res = res.slice(0, lastSlashIndex);
785
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
786
+ }
787
+ lastSlash = index;
788
+ dots = 0;
789
+ continue;
790
+ } else if (res.length > 0) {
791
+ res = "";
792
+ lastSegmentLength = 0;
793
+ lastSlash = index;
794
+ dots = 0;
795
+ continue;
796
+ }
797
+ }
798
+ if (allowAboveRoot) {
799
+ res += res.length > 0 ? "/.." : "..";
800
+ lastSegmentLength = 2;
801
+ }
802
+ } else {
803
+ if (res.length > 0) {
804
+ res += `/${path.slice(lastSlash + 1, index)}`;
805
+ } else {
806
+ res = path.slice(lastSlash + 1, index);
807
+ }
808
+ lastSegmentLength = index - lastSlash - 1;
809
+ }
810
+ lastSlash = index;
811
+ dots = 0;
812
+ } else if (char === "." && dots !== -1) {
813
+ ++dots;
814
+ } else {
815
+ dots = -1;
816
+ }
817
+ }
818
+ return res;
819
+ }
820
+ __name(normalizeString2, "normalizeString");
759
821
 
760
822
  // ../path/src/file-path-fns.ts
761
823
  function findFileName(filePath, options = {}) {
@@ -778,6 +840,54 @@ function findFilePath(filePath) {
778
840
  return result === "/" ? result : result.replace(/\/$/, "");
779
841
  }
780
842
  __name(findFilePath, "findFilePath");
843
+ function resolve(...paths) {
844
+ paths = paths.map((argument) => normalizeWindowsPath2(argument));
845
+ let resolvedPath = "";
846
+ let resolvedAbsolute = false;
847
+ for (let index = paths.length - 1; index >= -1 && !resolvedAbsolute; index--) {
848
+ const path = index >= 0 ? paths[index] : currentDir();
849
+ if (!path || path.length === 0) {
850
+ continue;
851
+ }
852
+ resolvedPath = `${path}/${resolvedPath}`;
853
+ resolvedAbsolute = isAbsolute(path);
854
+ }
855
+ resolvedPath = normalizeString2(resolvedPath, !resolvedAbsolute);
856
+ if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
857
+ return `/${resolvedPath}`;
858
+ }
859
+ return resolvedPath.length > 0 ? resolvedPath : ".";
860
+ }
861
+ __name(resolve, "resolve");
862
+ function currentDir() {
863
+ if (typeof process !== "undefined" && typeof process.cwd === "function") {
864
+ return process.cwd().replace(/\\/g, "/");
865
+ }
866
+ return "/";
867
+ }
868
+ __name(currentDir, "currentDir");
869
+ function relative(from, to) {
870
+ const _from = resolve(from).replace(ROOT_FOLDER_REGEX, "$1").split("/");
871
+ const _to = resolve(to).replace(ROOT_FOLDER_REGEX, "$1").split("/");
872
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
873
+ return _to.join("/");
874
+ }
875
+ const _fromCopy = [
876
+ ..._from
877
+ ];
878
+ for (const segment of _fromCopy) {
879
+ if (_to[0] !== segment) {
880
+ break;
881
+ }
882
+ _from.shift();
883
+ _to.shift();
884
+ }
885
+ return [
886
+ ..._from.map(() => ".."),
887
+ ..._to
888
+ ].join("/");
889
+ }
890
+ __name(relative, "relative");
781
891
  function relativePath(from, to, withEndSlash = false) {
782
892
  return relative(withEndSlash !== true ? from.replace(/\/$/, "") : from, withEndSlash !== true ? to.replace(/\/$/, "") : to);
783
893
  }
@@ -840,7 +950,7 @@ async function resolveOptions(options) {
840
950
  if (options.tsconfig) {
841
951
  resolvedTsconfig = options.tsconfig;
842
952
  } else {
843
- if (!tsconfigPath || !existsSync2(tsconfigPath)) {
953
+ if (!tsconfigPath || !existsSync(tsconfigPath)) {
844
954
  const errorMessage = tsconfigPath ? `\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.";
845
955
  writeFatal(errorMessage, {
846
956
  logLevel: "all"
@@ -891,6 +1001,6 @@ async function resolveOptions(options) {
891
1001
  __name(resolveOptions, "resolveOptions");
892
1002
 
893
1003
  export {
894
- existsSync2 as existsSync,
1004
+ existsSync,
895
1005
  resolveOptions
896
1006
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17; var _class18; var _class19; var _class20; var _class21; var _class22; var _class23; var _class24; var _class25; var _class26; var _class27; var _class28; var _class29; var _class30; var _class31; var _class32; var _class33; var _class34; var _class35; var _class36; var _class37;
2
2
 
3
3
 
4
- var _chunkSL27DJSCcjs = require('./chunk-SL27DJSC.cjs');
4
+ var _chunkBNRR6LB3cjs = require('./chunk-BNRR6LB3.cjs');
5
5
 
6
6
 
7
7
 
@@ -4053,10 +4053,10 @@ async function capnpc(options) {
4053
4053
  }
4054
4054
  if (dataBuf.byteLength === 0) {
4055
4055
  const opts = [];
4056
- if (output && _chunkSL27DJSCcjs.existsSync.call(void 0, output)) {
4056
+ if (output && _chunkBNRR6LB3cjs.existsSync.call(void 0, output)) {
4057
4057
  opts.push(`-o-:${output}`);
4058
4058
  } else {
4059
- if (output && !_chunkSL27DJSCcjs.existsSync.call(void 0, output)) {
4059
+ if (output && !_chunkBNRR6LB3cjs.existsSync.call(void 0, output)) {
4060
4060
  _console.writeWarning.call(void 0, `Output directory "${output}" does not exist, will write to schema path...`);
4061
4061
  }
4062
4062
  opts.push("-o-");
@@ -4084,7 +4084,7 @@ async function capnpc(options) {
4084
4084
  }
4085
4085
  _chunkUSNT2KNTcjs.__name.call(void 0, capnpc, "capnpc");
4086
4086
  async function compile(dataBuf, options) {
4087
- const resolvedOptions = await _chunkSL27DJSCcjs.resolveOptions.call(void 0, options);
4087
+ const resolvedOptions = await _chunkBNRR6LB3cjs.resolveOptions.call(void 0, options);
4088
4088
  if (!resolvedOptions) {
4089
4089
  _console.writeWarning.call(void 0, "\u2716 Unable to resolve Cap'n Proto compiler options - the program will terminate", {
4090
4090
  logLevel: "all"
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  existsSync,
3
3
  resolveOptions
4
- } from "./chunk-U6Y2C7CE.js";
4
+ } from "./chunk-COEROLIE.js";
5
5
  import {
6
6
  CompositeList,
7
7
  Message,
package/dist/compile.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunk4G5JV6WGcjs = require('./chunk-4G5JV6WG.cjs');
5
- require('./chunk-SL27DJSC.cjs');
4
+ var _chunkKDRGCBBAcjs = require('./chunk-KDRGCBBA.cjs');
5
+ require('./chunk-BNRR6LB3.cjs');
6
6
  require('./chunk-KXWOF6H4.cjs');
7
7
  require('./chunk-USNT2KNT.cjs');
8
8
 
9
9
 
10
10
 
11
- exports.capnpc = _chunk4G5JV6WGcjs.capnpc; exports.compile = _chunk4G5JV6WGcjs.compile;
11
+ exports.capnpc = _chunkKDRGCBBAcjs.capnpc; exports.compile = _chunkKDRGCBBAcjs.compile;
package/dist/compile.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  capnpc,
3
3
  compile
4
- } from "./chunk-5QODNLKN.js";
5
- import "./chunk-U6Y2C7CE.js";
4
+ } from "./chunk-SIFFDR2W.js";
5
+ import "./chunk-COEROLIE.js";
6
6
  import "./chunk-5VHN3KGS.js";
7
7
  import "./chunk-SHUYVCID.js";
8
8
  export {
package/dist/helpers.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkSL27DJSCcjs = require('./chunk-SL27DJSC.cjs');
3
+ var _chunkBNRR6LB3cjs = require('./chunk-BNRR6LB3.cjs');
4
4
  require('./chunk-USNT2KNT.cjs');
5
5
 
6
6
 
7
- exports.resolveOptions = _chunkSL27DJSCcjs.resolveOptions;
7
+ exports.resolveOptions = _chunkBNRR6LB3cjs.resolveOptions;
package/dist/helpers.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveOptions
3
- } from "./chunk-U6Y2C7CE.js";
3
+ } from "./chunk-COEROLIE.js";
4
4
  import "./chunk-SHUYVCID.js";
5
5
  export {
6
6
  resolveOptions