@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.
- package/README.md +1 -1
- package/dist/config-file/get-config-file.cjs +66 -22
- package/dist/config-file/get-config-file.js +65 -21
- package/dist/config-file/index.cjs +1 -27
- package/dist/config-file/index.js +1 -27
- package/dist/create-storm-config.cjs +68 -26
- package/dist/create-storm-config.js +67 -25
- package/dist/env/get-env.cjs +152 -9
- package/dist/env/get-env.js +151 -8
- package/dist/env/index.cjs +2 -20
- package/dist/env/index.js +2 -20
- package/dist/env/set-env.cjs +259 -8
- package/dist/env/set-env.js +258 -7
- package/dist/get-config.cjs +9 -25
- package/dist/get-config.js +9 -25
- package/dist/index.cjs +7 -171
- package/dist/index.js +7 -171
- package/dist/logger/chalk.cjs +30 -4
- package/dist/logger/chalk.js +29 -3
- package/dist/logger/console-icons.cjs +15 -5
- package/dist/logger/console-icons.js +15 -5
- package/dist/logger/console.cjs +126 -38
- package/dist/logger/console.js +112 -24
- package/dist/logger/create-logger.cjs +31 -16
- package/dist/logger/create-logger.js +30 -15
- package/dist/logger/format-timestamp.cjs +5 -3
- package/dist/logger/format-timestamp.js +5 -3
- package/dist/logger/get-log-level.cjs +56 -6
- package/dist/logger/get-log-level.js +56 -6
- package/dist/logger/index.cjs +7 -62
- package/dist/logger/index.js +7 -62
- package/dist/logger/is-unicode-supported.cjs +16 -4
- package/dist/logger/is-unicode-supported.js +15 -3
- package/dist/types.cjs +24 -6
- package/dist/types.js +22 -4
- package/dist/utilities/apply-workspace-tokens.cjs +55 -9
- package/dist/utilities/apply-workspace-tokens.js +54 -8
- package/dist/utilities/correct-paths.cjs +242 -33
- package/dist/utilities/correct-paths.js +225 -16
- package/dist/utilities/file-path-utils.cjs +18 -5
- package/dist/utilities/file-path-utils.js +17 -4
- package/dist/utilities/find-up.cjs +22 -4
- package/dist/utilities/find-up.js +21 -3
- package/dist/utilities/find-workspace-root.cjs +64 -7
- package/dist/utilities/find-workspace-root.js +63 -6
- package/dist/utilities/get-default-config.cjs +79 -8
- package/dist/utilities/get-default-config.js +79 -8
- package/dist/utilities/index.cjs +7 -85
- package/dist/utilities/index.js +7 -85
- package/dist/utilities/process-handler.cjs +35 -17
- package/dist/utilities/process-handler.js +35 -17
- package/dist/utilities/run.cjs +34 -6
- package/dist/utilities/run.js +33 -5
- package/package.json +1 -1
- package/dist/chunk-2AVLCXLT.js +0 -0
- package/dist/chunk-2IKEUEGY.cjs +0 -94
- package/dist/chunk-2ZXJS2DW.js +0 -49
- package/dist/chunk-3557WSPY.js +0 -168
- package/dist/chunk-3NWKPYIG.cjs +0 -68
- package/dist/chunk-4DLP6LZY.cjs +0 -65
- package/dist/chunk-65SWKEHV.cjs +0 -1
- package/dist/chunk-6OM23J4N.js +0 -65
- package/dist/chunk-6T3V5XJK.js +0 -180
- package/dist/chunk-7CYF3NP3.cjs +0 -19
- package/dist/chunk-7NSHGJWY.cjs +0 -12
- package/dist/chunk-7PV6L7I7.cjs +0 -1
- package/dist/chunk-B7WWBK5Z.cjs +0 -93
- package/dist/chunk-BHZFTVXN.js +0 -42
- package/dist/chunk-C3W5DCMU.js +0 -19
- package/dist/chunk-DD3HX2NX.cjs +0 -1
- package/dist/chunk-GKI43HTL.cjs +0 -44
- package/dist/chunk-GZFXEQPB.js +0 -94
- package/dist/chunk-HESFC24Z.cjs +0 -245
- package/dist/chunk-HI33NNPB.js +0 -68
- package/dist/chunk-HSCCBYAV.js +0 -25
- package/dist/chunk-IRCFHYKZ.cjs +0 -28
- package/dist/chunk-IUT7Y2UY.js +0 -26
- package/dist/chunk-IWD6YQKX.cjs +0 -1
- package/dist/chunk-J2TOMCZU.cjs +0 -168
- package/dist/chunk-JHJGK3T7.js +0 -272
- package/dist/chunk-KNLWLA7O.cjs +0 -75
- package/dist/chunk-L6UNTUC4.js +0 -0
- package/dist/chunk-LOSUA6RB.js +0 -79
- package/dist/chunk-M7ASNATT.js +0 -142
- package/dist/chunk-MLUBD3PU.js +0 -245
- package/dist/chunk-NJVL3GF4.js +0 -0
- package/dist/chunk-OIEEXHKO.js +0 -75
- package/dist/chunk-POXTJ6GF.js +0 -28
- package/dist/chunk-PR7RQHRE.js +0 -12
- package/dist/chunk-QBS3OCHH.js +0 -22
- package/dist/chunk-QNYJXMP3.cjs +0 -79
- package/dist/chunk-RRKB32OH.js +0 -0
- package/dist/chunk-RVM5N5ZI.cjs +0 -22
- package/dist/chunk-SLGVSUEV.cjs +0 -36
- package/dist/chunk-SVQE7WVB.cjs +0 -180
- package/dist/chunk-SWX2MJHI.cjs +0 -28
- package/dist/chunk-TCTVN2ED.js +0 -44
- package/dist/chunk-U34AT42J.cjs +0 -49
- package/dist/chunk-ULZULP7Q.cjs +0 -142
- package/dist/chunk-XAJB3BSF.cjs +0 -25
- package/dist/chunk-XDBACKKN.cjs +0 -42
- package/dist/chunk-XQPQRRG3.js +0 -28
- package/dist/chunk-XY2LDOQ4.cjs +0 -26
- package/dist/chunk-XZ2SIQVM.js +0 -93
- package/dist/chunk-YBGTC6FM.cjs +0 -272
- 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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
} from "
|
|
5
|
-
|
|
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
|
|
4
|
-
require('
|
|
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 =
|
|
25
|
+
exports.findFolderUp = findFolderUp;
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "
|
|
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
|
};
|