@storm-software/config-tools 1.148.2 → 1.148.4

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.
Files changed (106) hide show
  1. package/README.md +1 -1
  2. package/dist/config-file/get-config-file.cjs +66 -22
  3. package/dist/config-file/get-config-file.js +65 -21
  4. package/dist/config-file/index.cjs +1 -27
  5. package/dist/config-file/index.js +1 -27
  6. package/dist/create-storm-config.cjs +68 -26
  7. package/dist/create-storm-config.js +67 -25
  8. package/dist/env/get-env.cjs +152 -9
  9. package/dist/env/get-env.js +151 -8
  10. package/dist/env/index.cjs +2 -20
  11. package/dist/env/index.js +2 -20
  12. package/dist/env/set-env.cjs +259 -8
  13. package/dist/env/set-env.js +258 -7
  14. package/dist/get-config.cjs +9 -25
  15. package/dist/get-config.js +9 -25
  16. package/dist/index.cjs +7 -171
  17. package/dist/index.js +7 -171
  18. package/dist/logger/chalk.cjs +30 -4
  19. package/dist/logger/chalk.js +29 -3
  20. package/dist/logger/console-icons.cjs +15 -5
  21. package/dist/logger/console-icons.js +15 -5
  22. package/dist/logger/console.cjs +126 -38
  23. package/dist/logger/console.js +112 -24
  24. package/dist/logger/create-logger.cjs +31 -16
  25. package/dist/logger/create-logger.js +30 -15
  26. package/dist/logger/format-timestamp.cjs +5 -3
  27. package/dist/logger/format-timestamp.js +5 -3
  28. package/dist/logger/get-log-level.cjs +56 -6
  29. package/dist/logger/get-log-level.js +56 -6
  30. package/dist/logger/index.cjs +7 -62
  31. package/dist/logger/index.js +7 -62
  32. package/dist/logger/is-unicode-supported.cjs +16 -4
  33. package/dist/logger/is-unicode-supported.js +15 -3
  34. package/dist/types.cjs +24 -6
  35. package/dist/types.js +22 -4
  36. package/dist/utilities/apply-workspace-tokens.cjs +55 -9
  37. package/dist/utilities/apply-workspace-tokens.js +54 -8
  38. package/dist/utilities/correct-paths.cjs +242 -33
  39. package/dist/utilities/correct-paths.js +225 -16
  40. package/dist/utilities/file-path-utils.cjs +18 -5
  41. package/dist/utilities/file-path-utils.js +17 -4
  42. package/dist/utilities/find-up.cjs +22 -4
  43. package/dist/utilities/find-up.js +21 -3
  44. package/dist/utilities/find-workspace-root.cjs +64 -7
  45. package/dist/utilities/find-workspace-root.js +63 -6
  46. package/dist/utilities/get-default-config.cjs +79 -8
  47. package/dist/utilities/get-default-config.js +79 -8
  48. package/dist/utilities/index.cjs +7 -85
  49. package/dist/utilities/index.js +7 -85
  50. package/dist/utilities/process-handler.cjs +35 -17
  51. package/dist/utilities/process-handler.js +35 -17
  52. package/dist/utilities/run.cjs +34 -6
  53. package/dist/utilities/run.js +33 -5
  54. package/package.json +1 -1
  55. package/dist/chunk-2AVLCXLT.js +0 -0
  56. package/dist/chunk-2IKEUEGY.cjs +0 -94
  57. package/dist/chunk-2ZXJS2DW.js +0 -49
  58. package/dist/chunk-3557WSPY.js +0 -168
  59. package/dist/chunk-3NWKPYIG.cjs +0 -68
  60. package/dist/chunk-4DLP6LZY.cjs +0 -65
  61. package/dist/chunk-65SWKEHV.cjs +0 -1
  62. package/dist/chunk-6OM23J4N.js +0 -65
  63. package/dist/chunk-6T3V5XJK.js +0 -180
  64. package/dist/chunk-7CYF3NP3.cjs +0 -19
  65. package/dist/chunk-7NSHGJWY.cjs +0 -12
  66. package/dist/chunk-7PV6L7I7.cjs +0 -1
  67. package/dist/chunk-B7WWBK5Z.cjs +0 -93
  68. package/dist/chunk-BHZFTVXN.js +0 -42
  69. package/dist/chunk-C3W5DCMU.js +0 -19
  70. package/dist/chunk-DD3HX2NX.cjs +0 -1
  71. package/dist/chunk-GKI43HTL.cjs +0 -44
  72. package/dist/chunk-GZFXEQPB.js +0 -94
  73. package/dist/chunk-HESFC24Z.cjs +0 -245
  74. package/dist/chunk-HI33NNPB.js +0 -68
  75. package/dist/chunk-HSCCBYAV.js +0 -25
  76. package/dist/chunk-IRCFHYKZ.cjs +0 -28
  77. package/dist/chunk-IUT7Y2UY.js +0 -26
  78. package/dist/chunk-IWD6YQKX.cjs +0 -1
  79. package/dist/chunk-J2TOMCZU.cjs +0 -168
  80. package/dist/chunk-JHJGK3T7.js +0 -272
  81. package/dist/chunk-KNLWLA7O.cjs +0 -75
  82. package/dist/chunk-L6UNTUC4.js +0 -0
  83. package/dist/chunk-LOSUA6RB.js +0 -79
  84. package/dist/chunk-M7ASNATT.js +0 -142
  85. package/dist/chunk-MLUBD3PU.js +0 -245
  86. package/dist/chunk-NJVL3GF4.js +0 -0
  87. package/dist/chunk-OIEEXHKO.js +0 -75
  88. package/dist/chunk-POXTJ6GF.js +0 -28
  89. package/dist/chunk-PR7RQHRE.js +0 -12
  90. package/dist/chunk-QBS3OCHH.js +0 -22
  91. package/dist/chunk-QNYJXMP3.cjs +0 -79
  92. package/dist/chunk-RRKB32OH.js +0 -0
  93. package/dist/chunk-RVM5N5ZI.cjs +0 -22
  94. package/dist/chunk-SLGVSUEV.cjs +0 -36
  95. package/dist/chunk-SVQE7WVB.cjs +0 -180
  96. package/dist/chunk-SWX2MJHI.cjs +0 -28
  97. package/dist/chunk-TCTVN2ED.js +0 -44
  98. package/dist/chunk-U34AT42J.cjs +0 -49
  99. package/dist/chunk-ULZULP7Q.cjs +0 -142
  100. package/dist/chunk-XAJB3BSF.cjs +0 -25
  101. package/dist/chunk-XDBACKKN.cjs +0 -42
  102. package/dist/chunk-XQPQRRG3.js +0 -28
  103. package/dist/chunk-XY2LDOQ4.cjs +0 -26
  104. package/dist/chunk-XZ2SIQVM.js +0 -93
  105. package/dist/chunk-YBGTC6FM.cjs +0 -272
  106. package/dist/chunk-ZA4IO7YJ.js +0 -36
@@ -1,33 +1,242 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
- var _chunkHESFC24Zcjs = require('../chunk-HESFC24Z.cjs');
17
- require('../chunk-USNT2KNT.cjs');
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
- exports.basename = _chunkHESFC24Zcjs.basename; exports.correctPaths = _chunkHESFC24Zcjs.correctPaths; exports.dirname = _chunkHESFC24Zcjs.dirname; exports.extname = _chunkHESFC24Zcjs.extname; exports.format = _chunkHESFC24Zcjs.format; exports.isAbsolute = _chunkHESFC24Zcjs.isAbsolute; exports.joinPaths = _chunkHESFC24Zcjs.joinPaths; exports.normalizeString = _chunkHESFC24Zcjs.normalizeString; exports.normalizeWindowsPath = _chunkHESFC24Zcjs.normalizeWindowsPath; exports.parse = _chunkHESFC24Zcjs.parse; exports.relative = _chunkHESFC24Zcjs.relative; exports.resolve = _chunkHESFC24Zcjs.resolve; exports.sep = _chunkHESFC24Zcjs.sep; exports.toNamespacedPath = _chunkHESFC24Zcjs.toNamespacedPath;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
2
+
3
+ var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
+ const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
5
+ function normalizeWindowsPath(input = "") {
6
+ if (!input) {
7
+ return input;
8
+ }
9
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
10
+ }
11
+ _chunkUSNT2KNTcjs.__name.call(void 0, normalizeWindowsPath, "normalizeWindowsPath");
12
+ const _UNC_REGEX = /^[/\\]{2}/;
13
+ const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
14
+ const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
15
+ const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
16
+ const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
17
+ const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
18
+ const sep = "/";
19
+ const correctPaths = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(path) {
20
+ if (!path || path.length === 0) {
21
+ return ".";
22
+ }
23
+ path = normalizeWindowsPath(path);
24
+ const isUNCPath = path.match(_UNC_REGEX);
25
+ const isPathAbsolute = isAbsolute(path);
26
+ const trailingSeparator = path[path.length - 1] === "/";
27
+ path = normalizeString(path, !isPathAbsolute);
28
+ if (path.length === 0) {
29
+ if (isPathAbsolute) {
30
+ return "/";
31
+ }
32
+ return trailingSeparator ? "./" : ".";
33
+ }
34
+ if (trailingSeparator) {
35
+ path += "/";
36
+ }
37
+ if (_DRIVE_LETTER_RE.test(path)) {
38
+ path += "/";
39
+ }
40
+ if (isUNCPath) {
41
+ if (!isPathAbsolute) {
42
+ return `//./${path}`;
43
+ }
44
+ return `//${path}`;
45
+ }
46
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
47
+ }, "correctPaths");
48
+ const joinPaths = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(...segments) {
49
+ let path = "";
50
+ for (const seg of segments) {
51
+ if (!seg) {
52
+ continue;
53
+ }
54
+ if (path.length > 0) {
55
+ const pathTrailing = path[path.length - 1] === "/";
56
+ const segLeading = seg[0] === "/";
57
+ const both = pathTrailing && segLeading;
58
+ if (both) {
59
+ path += seg.slice(1);
60
+ } else {
61
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
62
+ }
63
+ } else {
64
+ path += seg;
65
+ }
66
+ }
67
+ return correctPaths(path);
68
+ }, "joinPaths");
69
+ function cwd() {
70
+ if (typeof process !== "undefined" && typeof process.cwd === "function") {
71
+ return process.cwd().replace(/\\/g, "/");
72
+ }
73
+ return "/";
74
+ }
75
+ _chunkUSNT2KNTcjs.__name.call(void 0, cwd, "cwd");
76
+ const resolve = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(...arguments_) {
77
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
78
+ let resolvedPath = "";
79
+ let resolvedAbsolute = false;
80
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
81
+ const path = index >= 0 ? arguments_[index] : cwd();
82
+ if (!path || path.length === 0) {
83
+ continue;
84
+ }
85
+ resolvedPath = `${path}/${resolvedPath}`;
86
+ resolvedAbsolute = isAbsolute(path);
87
+ }
88
+ resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
89
+ if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
90
+ return `/${resolvedPath}`;
91
+ }
92
+ return resolvedPath.length > 0 ? resolvedPath : ".";
93
+ }, "resolve");
94
+ function normalizeString(path, allowAboveRoot) {
95
+ let res = "";
96
+ let lastSegmentLength = 0;
97
+ let lastSlash = -1;
98
+ let dots = 0;
99
+ let char = null;
100
+ for (let index = 0; index <= path.length; ++index) {
101
+ if (index < path.length) {
102
+ char = path[index];
103
+ } else if (char === "/") {
104
+ break;
105
+ } else {
106
+ char = "/";
107
+ }
108
+ if (char === "/") {
109
+ if (lastSlash === index - 1 || dots === 1) {
110
+ } else if (dots === 2) {
111
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
112
+ if (res.length > 2) {
113
+ const lastSlashIndex = res.lastIndexOf("/");
114
+ if (lastSlashIndex === -1) {
115
+ res = "";
116
+ lastSegmentLength = 0;
117
+ } else {
118
+ res = res.slice(0, lastSlashIndex);
119
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
120
+ }
121
+ lastSlash = index;
122
+ dots = 0;
123
+ continue;
124
+ } else if (res.length > 0) {
125
+ res = "";
126
+ lastSegmentLength = 0;
127
+ lastSlash = index;
128
+ dots = 0;
129
+ continue;
130
+ }
131
+ }
132
+ if (allowAboveRoot) {
133
+ res += res.length > 0 ? "/.." : "..";
134
+ lastSegmentLength = 2;
135
+ }
136
+ } else {
137
+ if (res.length > 0) {
138
+ res += `/${path.slice(lastSlash + 1, index)}`;
139
+ } else {
140
+ res = path.slice(lastSlash + 1, index);
141
+ }
142
+ lastSegmentLength = index - lastSlash - 1;
143
+ }
144
+ lastSlash = index;
145
+ dots = 0;
146
+ } else if (char === "." && dots !== -1) {
147
+ ++dots;
148
+ } else {
149
+ dots = -1;
150
+ }
151
+ }
152
+ return res;
153
+ }
154
+ _chunkUSNT2KNTcjs.__name.call(void 0, normalizeString, "normalizeString");
155
+ const isAbsolute = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(p) {
156
+ return _IS_ABSOLUTE_RE.test(p);
157
+ }, "isAbsolute");
158
+ const toNamespacedPath = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(p) {
159
+ return normalizeWindowsPath(p);
160
+ }, "toNamespacedPath");
161
+ const extname = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(p) {
162
+ if (p === "..") return "";
163
+ const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
164
+ return match && match[1] || "";
165
+ }, "extname");
166
+ const relative = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(from, to) {
167
+ const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
168
+ const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
169
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
170
+ return _to.join("/");
171
+ }
172
+ const _fromCopy = [
173
+ ..._from
174
+ ];
175
+ for (const segment of _fromCopy) {
176
+ if (_to[0] !== segment) {
177
+ break;
178
+ }
179
+ _from.shift();
180
+ _to.shift();
181
+ }
182
+ return [
183
+ ..._from.map(() => ".."),
184
+ ..._to
185
+ ].join("/");
186
+ }, "relative");
187
+ const dirname = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(p) {
188
+ const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
189
+ if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
190
+ segments[0] += "/";
191
+ }
192
+ return segments.join("/") || (isAbsolute(p) ? "/" : ".");
193
+ }, "dirname");
194
+ const format = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(p) {
195
+ const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
196
+ const segments = [
197
+ p.root,
198
+ p.dir,
199
+ _nullishCoalesce(p.base, () => ( (_nullishCoalesce(p.name, () => ( ""))) + ext))
200
+ ].filter(Boolean);
201
+ return normalizeWindowsPath(p.root ? resolve(...segments) : segments.join("/"));
202
+ }, "format");
203
+ const basename = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(p, extension) {
204
+ const segments = normalizeWindowsPath(p).split("/");
205
+ let lastSegment = "";
206
+ for (let i = segments.length - 1; i >= 0; i--) {
207
+ const val = segments[i];
208
+ if (val) {
209
+ lastSegment = val;
210
+ break;
211
+ }
212
+ }
213
+ return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
214
+ }, "basename");
215
+ const parse = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(p) {
216
+ const root = _optionalChain([_PATH_ROOT_RE, 'access', _ => _.exec, 'call', _2 => _2(p), 'optionalAccess', _3 => _3[0], 'optionalAccess', _4 => _4.replace, 'call', _5 => _5(/\\/g, "/")]) || "";
217
+ const base = basename(p);
218
+ const extension = extname(base);
219
+ return {
220
+ root,
221
+ dir: dirname(p),
222
+ base,
223
+ ext: extension,
224
+ name: base.slice(0, base.length - extension.length)
225
+ };
226
+ }, "parse");
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+ exports.basename = basename; exports.correctPaths = correctPaths; exports.dirname = dirname; exports.extname = extname; exports.format = format; exports.isAbsolute = isAbsolute; exports.joinPaths = joinPaths; exports.normalizeString = normalizeString; exports.normalizeWindowsPath = normalizeWindowsPath; exports.parse = parse; exports.relative = relative; exports.resolve = resolve; exports.sep = sep; exports.toNamespacedPath = toNamespacedPath;
@@ -1,20 +1,229 @@
1
1
  import {
2
- basename,
3
- correctPaths,
4
- dirname,
5
- extname,
6
- format,
7
- isAbsolute,
8
- joinPaths,
9
- normalizeString,
10
- normalizeWindowsPath,
11
- parse,
12
- relative,
13
- resolve,
14
- sep,
15
- toNamespacedPath
16
- } from "../chunk-MLUBD3PU.js";
17
- import "../chunk-SHUYVCID.js";
2
+ __name
3
+ } from "../chunk-SHUYVCID.js";
4
+ const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
5
+ function normalizeWindowsPath(input = "") {
6
+ if (!input) {
7
+ return input;
8
+ }
9
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
10
+ }
11
+ __name(normalizeWindowsPath, "normalizeWindowsPath");
12
+ const _UNC_REGEX = /^[/\\]{2}/;
13
+ const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
14
+ const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
15
+ const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
16
+ const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
17
+ const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
18
+ const sep = "/";
19
+ const correctPaths = /* @__PURE__ */ __name(function(path) {
20
+ if (!path || path.length === 0) {
21
+ return ".";
22
+ }
23
+ path = normalizeWindowsPath(path);
24
+ const isUNCPath = path.match(_UNC_REGEX);
25
+ const isPathAbsolute = isAbsolute(path);
26
+ const trailingSeparator = path[path.length - 1] === "/";
27
+ path = normalizeString(path, !isPathAbsolute);
28
+ if (path.length === 0) {
29
+ if (isPathAbsolute) {
30
+ return "/";
31
+ }
32
+ return trailingSeparator ? "./" : ".";
33
+ }
34
+ if (trailingSeparator) {
35
+ path += "/";
36
+ }
37
+ if (_DRIVE_LETTER_RE.test(path)) {
38
+ path += "/";
39
+ }
40
+ if (isUNCPath) {
41
+ if (!isPathAbsolute) {
42
+ return `//./${path}`;
43
+ }
44
+ return `//${path}`;
45
+ }
46
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
47
+ }, "correctPaths");
48
+ const joinPaths = /* @__PURE__ */ __name(function(...segments) {
49
+ let path = "";
50
+ for (const seg of segments) {
51
+ if (!seg) {
52
+ continue;
53
+ }
54
+ if (path.length > 0) {
55
+ const pathTrailing = path[path.length - 1] === "/";
56
+ const segLeading = seg[0] === "/";
57
+ const both = pathTrailing && segLeading;
58
+ if (both) {
59
+ path += seg.slice(1);
60
+ } else {
61
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
62
+ }
63
+ } else {
64
+ path += seg;
65
+ }
66
+ }
67
+ return correctPaths(path);
68
+ }, "joinPaths");
69
+ function cwd() {
70
+ if (typeof process !== "undefined" && typeof process.cwd === "function") {
71
+ return process.cwd().replace(/\\/g, "/");
72
+ }
73
+ return "/";
74
+ }
75
+ __name(cwd, "cwd");
76
+ const resolve = /* @__PURE__ */ __name(function(...arguments_) {
77
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
78
+ let resolvedPath = "";
79
+ let resolvedAbsolute = false;
80
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
81
+ const path = index >= 0 ? arguments_[index] : cwd();
82
+ if (!path || path.length === 0) {
83
+ continue;
84
+ }
85
+ resolvedPath = `${path}/${resolvedPath}`;
86
+ resolvedAbsolute = isAbsolute(path);
87
+ }
88
+ resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
89
+ if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
90
+ return `/${resolvedPath}`;
91
+ }
92
+ return resolvedPath.length > 0 ? resolvedPath : ".";
93
+ }, "resolve");
94
+ function normalizeString(path, allowAboveRoot) {
95
+ let res = "";
96
+ let lastSegmentLength = 0;
97
+ let lastSlash = -1;
98
+ let dots = 0;
99
+ let char = null;
100
+ for (let index = 0; index <= path.length; ++index) {
101
+ if (index < path.length) {
102
+ char = path[index];
103
+ } else if (char === "/") {
104
+ break;
105
+ } else {
106
+ char = "/";
107
+ }
108
+ if (char === "/") {
109
+ if (lastSlash === index - 1 || dots === 1) {
110
+ } else if (dots === 2) {
111
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
112
+ if (res.length > 2) {
113
+ const lastSlashIndex = res.lastIndexOf("/");
114
+ if (lastSlashIndex === -1) {
115
+ res = "";
116
+ lastSegmentLength = 0;
117
+ } else {
118
+ res = res.slice(0, lastSlashIndex);
119
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
120
+ }
121
+ lastSlash = index;
122
+ dots = 0;
123
+ continue;
124
+ } else if (res.length > 0) {
125
+ res = "";
126
+ lastSegmentLength = 0;
127
+ lastSlash = index;
128
+ dots = 0;
129
+ continue;
130
+ }
131
+ }
132
+ if (allowAboveRoot) {
133
+ res += res.length > 0 ? "/.." : "..";
134
+ lastSegmentLength = 2;
135
+ }
136
+ } else {
137
+ if (res.length > 0) {
138
+ res += `/${path.slice(lastSlash + 1, index)}`;
139
+ } else {
140
+ res = path.slice(lastSlash + 1, index);
141
+ }
142
+ lastSegmentLength = index - lastSlash - 1;
143
+ }
144
+ lastSlash = index;
145
+ dots = 0;
146
+ } else if (char === "." && dots !== -1) {
147
+ ++dots;
148
+ } else {
149
+ dots = -1;
150
+ }
151
+ }
152
+ return res;
153
+ }
154
+ __name(normalizeString, "normalizeString");
155
+ const isAbsolute = /* @__PURE__ */ __name(function(p) {
156
+ return _IS_ABSOLUTE_RE.test(p);
157
+ }, "isAbsolute");
158
+ const toNamespacedPath = /* @__PURE__ */ __name(function(p) {
159
+ return normalizeWindowsPath(p);
160
+ }, "toNamespacedPath");
161
+ const extname = /* @__PURE__ */ __name(function(p) {
162
+ if (p === "..") return "";
163
+ const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
164
+ return match && match[1] || "";
165
+ }, "extname");
166
+ const relative = /* @__PURE__ */ __name(function(from, to) {
167
+ const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
168
+ const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
169
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
170
+ return _to.join("/");
171
+ }
172
+ const _fromCopy = [
173
+ ..._from
174
+ ];
175
+ for (const segment of _fromCopy) {
176
+ if (_to[0] !== segment) {
177
+ break;
178
+ }
179
+ _from.shift();
180
+ _to.shift();
181
+ }
182
+ return [
183
+ ..._from.map(() => ".."),
184
+ ..._to
185
+ ].join("/");
186
+ }, "relative");
187
+ const dirname = /* @__PURE__ */ __name(function(p) {
188
+ const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
189
+ if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
190
+ segments[0] += "/";
191
+ }
192
+ return segments.join("/") || (isAbsolute(p) ? "/" : ".");
193
+ }, "dirname");
194
+ const format = /* @__PURE__ */ __name(function(p) {
195
+ const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
196
+ const segments = [
197
+ p.root,
198
+ p.dir,
199
+ p.base ?? (p.name ?? "") + ext
200
+ ].filter(Boolean);
201
+ return normalizeWindowsPath(p.root ? resolve(...segments) : segments.join("/"));
202
+ }, "format");
203
+ const basename = /* @__PURE__ */ __name(function(p, extension) {
204
+ const segments = normalizeWindowsPath(p).split("/");
205
+ let lastSegment = "";
206
+ for (let i = segments.length - 1; i >= 0; i--) {
207
+ const val = segments[i];
208
+ if (val) {
209
+ lastSegment = val;
210
+ break;
211
+ }
212
+ }
213
+ return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
214
+ }, "basename");
215
+ const parse = /* @__PURE__ */ __name(function(p) {
216
+ const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
217
+ const base = basename(p);
218
+ const extension = extname(base);
219
+ return {
220
+ root,
221
+ dir: dirname(p),
222
+ base,
223
+ ext: extension,
224
+ name: base.slice(0, base.length - extension.length)
225
+ };
226
+ }, "parse");
18
227
  export {
19
228
  basename,
20
229
  correctPaths,
@@ -1,9 +1,22 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
2
2
 
3
+ var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
+ var _nodepath = require('node:path');
5
+ const removeExtension = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (filePath) => {
6
+ const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
7
+ if (result.startsWith("./")) {
8
+ return result.substring(2);
9
+ }
10
+ if (result.startsWith(".") || result.startsWith("/")) {
11
+ return result.substring(1);
12
+ }
13
+ return result;
14
+ }, "removeExtension");
15
+ function findFileName(filePath) {
16
+ return _nullishCoalesce(_optionalChain([filePath, 'optionalAccess', _ => _.split, 'call', _2 => _2(_optionalChain([filePath, 'optionalAccess', _3 => _3.includes, 'call', _4 => _4(_nodepath.sep)]) ? _nodepath.sep : _optionalChain([filePath, 'optionalAccess', _5 => _5.includes, 'call', _6 => _6("/")]) ? "/" : "\\"), 'optionalAccess', _7 => _7.pop, 'call', _8 => _8()]), () => ( ""));
17
+ }
18
+ _chunkUSNT2KNTcjs.__name.call(void 0, findFileName, "findFileName");
3
19
 
4
- var _chunkXAJB3BSFcjs = require('../chunk-XAJB3BSF.cjs');
5
- require('../chunk-USNT2KNT.cjs');
6
20
 
7
21
 
8
-
9
- exports.findFileName = _chunkXAJB3BSFcjs.findFileName; exports.removeExtension = _chunkXAJB3BSFcjs.removeExtension;
22
+ exports.findFileName = findFileName; exports.removeExtension = removeExtension;
@@ -1,8 +1,21 @@
1
1
  import {
2
- findFileName,
3
- removeExtension
4
- } from "../chunk-HSCCBYAV.js";
5
- import "../chunk-SHUYVCID.js";
2
+ __name
3
+ } from "../chunk-SHUYVCID.js";
4
+ import { sep } from "node:path";
5
+ const removeExtension = /* @__PURE__ */ __name((filePath) => {
6
+ const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
7
+ if (result.startsWith("./")) {
8
+ return result.substring(2);
9
+ }
10
+ if (result.startsWith(".") || result.startsWith("/")) {
11
+ return result.substring(1);
12
+ }
13
+ return result;
14
+ }, "removeExtension");
15
+ function findFileName(filePath) {
16
+ return filePath?.split(filePath?.includes(sep) ? sep : filePath?.includes("/") ? "/" : "\\")?.pop() ?? "";
17
+ }
18
+ __name(findFileName, "findFileName");
6
19
  export {
7
20
  findFileName,
8
21
  removeExtension
@@ -1,7 +1,25 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkSWX2MJHIcjs = require('../chunk-SWX2MJHI.cjs');
4
- require('../chunk-USNT2KNT.cjs');
3
+ var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
+ var _nodefs = require('node:fs');
5
+ var _nodepath = require('node:path');
6
+ const MAX_PATH_SEARCH_DEPTH = 30;
7
+ let depth = 0;
8
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
9
+ const _startPath = _nullishCoalesce(startPath, () => ( process.cwd()));
10
+ if (endDirectoryNames.some((endDirName) => _nodefs.existsSync.call(void 0, _nodepath.join.call(void 0, _startPath, endDirName)))) {
11
+ return _startPath;
12
+ }
13
+ if (endFileNames.some((endFileName) => _nodefs.existsSync.call(void 0, _nodepath.join.call(void 0, _startPath, endFileName)))) {
14
+ return _startPath;
15
+ }
16
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
17
+ const parent = _nodepath.join.call(void 0, _startPath, "..");
18
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
19
+ }
20
+ return void 0;
21
+ }
22
+ _chunkUSNT2KNTcjs.__name.call(void 0, findFolderUp, "findFolderUp");
5
23
 
6
24
 
7
- exports.findFolderUp = _chunkSWX2MJHIcjs.findFolderUp;
25
+ exports.findFolderUp = findFolderUp;
@@ -1,7 +1,25 @@
1
1
  import {
2
- findFolderUp
3
- } from "../chunk-XQPQRRG3.js";
4
- import "../chunk-SHUYVCID.js";
2
+ __name
3
+ } from "../chunk-SHUYVCID.js";
4
+ import { existsSync } from "node:fs";
5
+ import { join } from "node:path";
6
+ const MAX_PATH_SEARCH_DEPTH = 30;
7
+ let depth = 0;
8
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
9
+ const _startPath = startPath ?? process.cwd();
10
+ if (endDirectoryNames.some((endDirName) => existsSync(join(_startPath, endDirName)))) {
11
+ return _startPath;
12
+ }
13
+ if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
14
+ return _startPath;
15
+ }
16
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
17
+ const parent = join(_startPath, "..");
18
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
19
+ }
20
+ return void 0;
21
+ }
22
+ __name(findFolderUp, "findFolderUp");
5
23
  export {
6
24
  findFolderUp
7
25
  };