@storm-software/config-tools 1.150.5 → 1.150.9
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/bin/config.cjs +14795 -283
- package/bin/config.js +14806 -266
- package/dist/chunk-2MY3KGBB.cjs +70 -0
- package/dist/chunk-322YBAWX.js +6 -0
- package/dist/chunk-3BGF4LNL.cjs +67 -0
- package/dist/chunk-3OZGKUMC.js +1120 -0
- package/dist/chunk-4CTFS6DM.js +143 -0
- package/dist/chunk-4YA7DJB5.cjs +451 -0
- package/dist/chunk-56RY3KW7.cjs +6 -0
- package/dist/chunk-5LYWI7E7.cjs +49 -0
- package/dist/chunk-5SDU662B.js +274 -0
- package/dist/chunk-5XAQKBRL.js +510 -0
- package/dist/chunk-6JG5O6FD.js +2645 -0
- package/dist/chunk-6R6FJLKT.cjs +84 -0
- package/dist/chunk-6ZPVROB4.js +51 -0
- package/dist/chunk-73C3QB67.js +27 -0
- package/dist/chunk-77YC3XPW.js +9228 -0
- package/dist/chunk-7PDFNXOV.js +67 -0
- package/dist/chunk-B2HXAAFT.cjs +274 -0
- package/dist/chunk-BKJUQIEL.cjs +6 -0
- package/dist/chunk-CHYZZRN6.cjs +165 -0
- package/dist/chunk-CUX3BOLK.cjs +6 -0
- package/dist/chunk-DYTSQ3L3.js +14 -0
- package/dist/chunk-E554LMEP.cjs +28 -0
- package/dist/chunk-FUALBFYR.cjs +247 -0
- package/dist/chunk-FZMUKCM5.js +50 -0
- package/dist/chunk-G62PQROD.cjs +510 -0
- package/dist/chunk-GJDVCWVL.cjs +27 -0
- package/dist/chunk-GZ6SGFYZ.cjs +2645 -0
- package/dist/chunk-HAYTD5F2.js +247 -0
- package/dist/chunk-HBJSM6VU.js +6 -0
- package/dist/chunk-HLB4MOTZ.js +6 -0
- package/dist/chunk-HUMXKKE6.js +765 -0
- package/dist/chunk-HVVHVCVH.js +24 -0
- package/dist/chunk-I2LFMHGF.cjs +14 -0
- package/dist/chunk-I5FJ2QOS.js +84 -0
- package/dist/chunk-IYMLNFGA.cjs +33 -0
- package/dist/chunk-JN37L7NL.js +33 -0
- package/dist/chunk-JVONSFJS.cjs +765 -0
- package/dist/chunk-KN7POPML.cjs +21 -0
- package/dist/chunk-KONO4OMT.cjs +9231 -0
- package/dist/chunk-KQLERSRE.js +93 -0
- package/dist/chunk-KXHNOCVY.cjs +24 -0
- package/dist/chunk-LAIQ2Z5B.cjs +93 -0
- package/dist/chunk-LUQRLSMI.js +6 -0
- package/dist/chunk-M3KQNO7N.cjs +93 -0
- package/dist/chunk-MJL6D7T3.js +28 -0
- package/dist/chunk-MKB5GTL4.js +451 -0
- package/dist/chunk-MMMRCNC6.js +77 -0
- package/dist/chunk-NERZUU47.js +93 -0
- package/dist/chunk-NVXMXDZM.js +70 -0
- package/dist/chunk-NWFS53UA.js +21 -0
- package/dist/chunk-PBEGXSGU.js +165 -0
- package/dist/chunk-PMRCDW2Q.cjs +44 -0
- package/dist/chunk-RDWCJD4I.cjs +30 -0
- package/dist/chunk-RN5XBSCX.cjs +77 -0
- package/dist/chunk-TJ7RSPG3.cjs +6 -0
- package/dist/chunk-US52HP52.cjs +143 -0
- package/dist/chunk-UXYX4UF4.cjs +50 -0
- package/dist/chunk-W7YJIINP.js +49 -0
- package/dist/chunk-WTHXS4H2.js +44 -0
- package/dist/chunk-X3T2GC65.cjs +51 -0
- package/dist/chunk-XUGBUGHC.cjs +1120 -0
- package/dist/chunk-YO6XHACG.js +30 -0
- package/dist/config-file/get-config-file.cjs +26 -66
- package/dist/config-file/get-config-file.js +25 -65
- package/dist/config-file/index.cjs +31 -1
- package/dist/config-file/index.js +31 -1
- package/dist/create-storm-config.cjs +30 -68
- package/dist/create-storm-config.js +29 -67
- package/dist/env/get-env.cjs +8 -152
- package/dist/env/get-env.js +7 -151
- package/dist/env/index.cjs +19 -2
- package/dist/env/index.js +19 -2
- package/dist/env/set-env.cjs +8 -259
- package/dist/env/set-env.js +7 -258
- package/dist/esm-HKV66HQZ.js +1716 -0
- package/dist/esm-TZUWSATN.cjs +1716 -0
- package/dist/get-config.cjs +29 -9
- package/dist/get-config.js +29 -9
- package/dist/index.cjs +180 -7
- package/dist/index.js +180 -7
- package/dist/json5-NI4CISQP.cjs +10 -0
- package/dist/json5-XMK3UBET.js +10 -0
- package/dist/jsonc-GYGN4BMZ.js +15 -0
- package/dist/jsonc-TDL6NXBV.cjs +15 -0
- package/dist/logger/chalk.cjs +4 -30
- package/dist/logger/chalk.js +3 -29
- package/dist/logger/console-icons.cjs +5 -15
- package/dist/logger/console-icons.js +5 -15
- package/dist/logger/console.cjs +37 -125
- package/dist/logger/console.js +23 -111
- package/dist/logger/create-logger.cjs +15 -31
- package/dist/logger/create-logger.js +14 -30
- package/dist/logger/format-timestamp.cjs +3 -5
- package/dist/logger/format-timestamp.js +3 -5
- package/dist/logger/get-log-level.cjs +6 -56
- package/dist/logger/get-log-level.js +6 -56
- package/dist/logger/index.cjs +61 -7
- package/dist/logger/index.js +61 -7
- package/dist/logger/is-unicode-supported.cjs +4 -16
- package/dist/logger/is-unicode-supported.js +3 -15
- package/dist/toml-5NX5FGDD.cjs +10 -0
- package/dist/toml-ZYXFVZLI.js +10 -0
- package/dist/types.cjs +6 -24
- package/dist/types.js +5 -23
- package/dist/utilities/apply-workspace-tokens.cjs +9 -55
- package/dist/utilities/apply-workspace-tokens.js +8 -54
- package/dist/utilities/correct-paths.cjs +33 -242
- package/dist/utilities/correct-paths.js +16 -225
- package/dist/utilities/file-path-utils.cjs +5 -18
- package/dist/utilities/file-path-utils.js +4 -17
- package/dist/utilities/find-up.cjs +4 -22
- package/dist/utilities/find-up.js +3 -21
- package/dist/utilities/find-workspace-root.cjs +7 -64
- package/dist/utilities/find-workspace-root.js +6 -63
- package/dist/utilities/get-default-config.cjs +7 -79
- package/dist/utilities/get-default-config.js +7 -79
- package/dist/utilities/index.cjs +84 -7
- package/dist/utilities/index.js +84 -7
- package/dist/utilities/process-handler.cjs +16 -35
- package/dist/utilities/process-handler.js +16 -35
- package/dist/utilities/run.cjs +6 -34
- package/dist/utilities/run.js +5 -33
- package/dist/yaml-GRT7ORXT.cjs +10 -0
- package/dist/yaml-WD4DF2QH.js +10 -0
- package/package.json +7 -4
- package/dist/chunk-SHUYVCID.js +0 -6
- package/dist/chunk-USNT2KNT.cjs +0 -6
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name,
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-W7YJIINP.js";
|
|
5
|
+
|
|
6
|
+
// src/utilities/correct-paths.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
9
|
+
function normalizeWindowsPath(input = "") {
|
|
10
|
+
if (!input) {
|
|
11
|
+
return input;
|
|
12
|
+
}
|
|
13
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
14
|
+
}
|
|
15
|
+
__name(normalizeWindowsPath, "normalizeWindowsPath");
|
|
16
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
17
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
18
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
19
|
+
var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
20
|
+
var _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
21
|
+
var _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
22
|
+
var sep = "/";
|
|
23
|
+
var correctPaths = /* @__PURE__ */ __name(function(path) {
|
|
24
|
+
if (!path || path.length === 0) {
|
|
25
|
+
return ".";
|
|
26
|
+
}
|
|
27
|
+
path = normalizeWindowsPath(path);
|
|
28
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
29
|
+
const isPathAbsolute = isAbsolute(path);
|
|
30
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
31
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
32
|
+
if (path.length === 0) {
|
|
33
|
+
if (isPathAbsolute) {
|
|
34
|
+
return "/";
|
|
35
|
+
}
|
|
36
|
+
return trailingSeparator ? "./" : ".";
|
|
37
|
+
}
|
|
38
|
+
if (trailingSeparator) {
|
|
39
|
+
path += "/";
|
|
40
|
+
}
|
|
41
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
42
|
+
path += "/";
|
|
43
|
+
}
|
|
44
|
+
if (isUNCPath) {
|
|
45
|
+
if (!isPathAbsolute) {
|
|
46
|
+
return `//./${path}`;
|
|
47
|
+
}
|
|
48
|
+
return `//${path}`;
|
|
49
|
+
}
|
|
50
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
51
|
+
}, "correctPaths");
|
|
52
|
+
var joinPaths = /* @__PURE__ */ __name(function(...segments) {
|
|
53
|
+
let path = "";
|
|
54
|
+
for (const seg of segments) {
|
|
55
|
+
if (!seg) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (path.length > 0) {
|
|
59
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
60
|
+
const segLeading = seg[0] === "/";
|
|
61
|
+
const both = pathTrailing && segLeading;
|
|
62
|
+
if (both) {
|
|
63
|
+
path += seg.slice(1);
|
|
64
|
+
} else {
|
|
65
|
+
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
path += seg;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return correctPaths(path);
|
|
72
|
+
}, "joinPaths");
|
|
73
|
+
function cwd() {
|
|
74
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
75
|
+
return process.cwd().replace(/\\/g, "/");
|
|
76
|
+
}
|
|
77
|
+
return "/";
|
|
78
|
+
}
|
|
79
|
+
__name(cwd, "cwd");
|
|
80
|
+
var resolve = /* @__PURE__ */ __name(function(...arguments_) {
|
|
81
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
82
|
+
let resolvedPath = "";
|
|
83
|
+
let resolvedAbsolute = false;
|
|
84
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
85
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
86
|
+
if (!path || path.length === 0) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
90
|
+
resolvedAbsolute = isAbsolute(path);
|
|
91
|
+
}
|
|
92
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
93
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
94
|
+
return `/${resolvedPath}`;
|
|
95
|
+
}
|
|
96
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
97
|
+
}, "resolve");
|
|
98
|
+
function normalizeString(path, allowAboveRoot) {
|
|
99
|
+
let res = "";
|
|
100
|
+
let lastSegmentLength = 0;
|
|
101
|
+
let lastSlash = -1;
|
|
102
|
+
let dots = 0;
|
|
103
|
+
let char = null;
|
|
104
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
105
|
+
if (index < path.length) {
|
|
106
|
+
char = path[index];
|
|
107
|
+
} else if (char === "/") {
|
|
108
|
+
break;
|
|
109
|
+
} else {
|
|
110
|
+
char = "/";
|
|
111
|
+
}
|
|
112
|
+
if (char === "/") {
|
|
113
|
+
if (lastSlash === index - 1 || dots === 1) {
|
|
114
|
+
} else if (dots === 2) {
|
|
115
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
116
|
+
if (res.length > 2) {
|
|
117
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
118
|
+
if (lastSlashIndex === -1) {
|
|
119
|
+
res = "";
|
|
120
|
+
lastSegmentLength = 0;
|
|
121
|
+
} else {
|
|
122
|
+
res = res.slice(0, lastSlashIndex);
|
|
123
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
124
|
+
}
|
|
125
|
+
lastSlash = index;
|
|
126
|
+
dots = 0;
|
|
127
|
+
continue;
|
|
128
|
+
} else if (res.length > 0) {
|
|
129
|
+
res = "";
|
|
130
|
+
lastSegmentLength = 0;
|
|
131
|
+
lastSlash = index;
|
|
132
|
+
dots = 0;
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (allowAboveRoot) {
|
|
137
|
+
res += res.length > 0 ? "/.." : "..";
|
|
138
|
+
lastSegmentLength = 2;
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
if (res.length > 0) {
|
|
142
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
143
|
+
} else {
|
|
144
|
+
res = path.slice(lastSlash + 1, index);
|
|
145
|
+
}
|
|
146
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
147
|
+
}
|
|
148
|
+
lastSlash = index;
|
|
149
|
+
dots = 0;
|
|
150
|
+
} else if (char === "." && dots !== -1) {
|
|
151
|
+
++dots;
|
|
152
|
+
} else {
|
|
153
|
+
dots = -1;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return res;
|
|
157
|
+
}
|
|
158
|
+
__name(normalizeString, "normalizeString");
|
|
159
|
+
var isAbsolute = /* @__PURE__ */ __name(function(p) {
|
|
160
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
161
|
+
}, "isAbsolute");
|
|
162
|
+
var toNamespacedPath = /* @__PURE__ */ __name(function(p) {
|
|
163
|
+
return normalizeWindowsPath(p);
|
|
164
|
+
}, "toNamespacedPath");
|
|
165
|
+
var extname = /* @__PURE__ */ __name(function(p) {
|
|
166
|
+
if (p === "..") return "";
|
|
167
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
168
|
+
return match && match[1] || "";
|
|
169
|
+
}, "extname");
|
|
170
|
+
var relative = /* @__PURE__ */ __name(function(from, to) {
|
|
171
|
+
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
172
|
+
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
173
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
|
174
|
+
return _to.join("/");
|
|
175
|
+
}
|
|
176
|
+
const _fromCopy = [
|
|
177
|
+
..._from
|
|
178
|
+
];
|
|
179
|
+
for (const segment of _fromCopy) {
|
|
180
|
+
if (_to[0] !== segment) {
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
_from.shift();
|
|
184
|
+
_to.shift();
|
|
185
|
+
}
|
|
186
|
+
return [
|
|
187
|
+
..._from.map(() => ".."),
|
|
188
|
+
..._to
|
|
189
|
+
].join("/");
|
|
190
|
+
}, "relative");
|
|
191
|
+
var dirname = /* @__PURE__ */ __name(function(p) {
|
|
192
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
193
|
+
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
|
194
|
+
segments[0] += "/";
|
|
195
|
+
}
|
|
196
|
+
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
197
|
+
}, "dirname");
|
|
198
|
+
var format = /* @__PURE__ */ __name(function(p) {
|
|
199
|
+
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
|
|
200
|
+
const segments = [
|
|
201
|
+
p.root,
|
|
202
|
+
p.dir,
|
|
203
|
+
p.base ?? (p.name ?? "") + ext
|
|
204
|
+
].filter(Boolean);
|
|
205
|
+
return normalizeWindowsPath(p.root ? resolve(...segments) : segments.join("/"));
|
|
206
|
+
}, "format");
|
|
207
|
+
var basename = /* @__PURE__ */ __name(function(p, extension) {
|
|
208
|
+
const segments = normalizeWindowsPath(p).split("/");
|
|
209
|
+
let lastSegment = "";
|
|
210
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
211
|
+
const val = segments[i];
|
|
212
|
+
if (val) {
|
|
213
|
+
lastSegment = val;
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
218
|
+
}, "basename");
|
|
219
|
+
var parse = /* @__PURE__ */ __name(function(p) {
|
|
220
|
+
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
221
|
+
const base = basename(p);
|
|
222
|
+
const extension = extname(base);
|
|
223
|
+
return {
|
|
224
|
+
root,
|
|
225
|
+
dir: dirname(p),
|
|
226
|
+
base,
|
|
227
|
+
ext: extension,
|
|
228
|
+
name: base.slice(0, base.length - extension.length)
|
|
229
|
+
};
|
|
230
|
+
}, "parse");
|
|
231
|
+
|
|
232
|
+
export {
|
|
233
|
+
normalizeWindowsPath,
|
|
234
|
+
sep,
|
|
235
|
+
correctPaths,
|
|
236
|
+
joinPaths,
|
|
237
|
+
resolve,
|
|
238
|
+
normalizeString,
|
|
239
|
+
isAbsolute,
|
|
240
|
+
toNamespacedPath,
|
|
241
|
+
extname,
|
|
242
|
+
relative,
|
|
243
|
+
dirname,
|
|
244
|
+
format,
|
|
245
|
+
basename,
|
|
246
|
+
parse
|
|
247
|
+
};
|