@storm-software/config-tools 1.144.14 → 1.145.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.
- package/README.md +1 -1
- package/bin/config.cjs +125 -22
- package/bin/config.js +125 -22
- package/dist/{chunk-EPBOQXUS.cjs → chunk-2V7MZG6O.cjs} +15 -15
- package/dist/{chunk-IKXDQ7DB.js → chunk-2VKMRURF.js} +1 -1
- package/dist/{chunk-GMMTDKYU.cjs → chunk-32ACHDIU.cjs} +11 -11
- package/dist/{chunk-GFL2DSZK.js → chunk-3ONZMUOD.js} +2 -2
- package/dist/{chunk-FXFNC4WC.js → chunk-4E4DSFC4.js} +1 -1
- package/dist/{chunk-CEEL5LLM.js → chunk-5GDS63DU.js} +1 -1
- package/dist/{chunk-EOQEK2MM.cjs → chunk-5K6CXYFF.cjs} +2 -2
- package/dist/{chunk-MZ5BNE43.js → chunk-CSIXX72P.js} +6 -6
- package/dist/{chunk-HSNM6VD2.cjs → chunk-FI7WN47Y.cjs} +4 -4
- package/dist/{chunk-R4O6ILOD.js → chunk-HDI7BCVL.js} +1 -1
- package/dist/chunk-HESFC24Z.cjs +245 -0
- package/dist/{chunk-YES7WAZK.js → chunk-HFGQYKYH.js} +2 -2
- package/dist/{chunk-6QCPF7DE.js → chunk-JCGZTN5H.js} +1 -1
- package/dist/{chunk-QGYINXXY.js → chunk-JHFMRUZ3.js} +1 -1
- package/dist/{chunk-MXRRZKNO.js → chunk-JVA7N2JV.js} +3 -3
- package/dist/{chunk-HE7RJB2E.cjs → chunk-LXAJWZ37.cjs} +9 -9
- package/dist/{chunk-B6J2YUGO.cjs → chunk-MAMYTWWY.cjs} +3 -3
- package/dist/{chunk-7FBGW2FI.js → chunk-MICZPWNF.js} +1 -1
- package/dist/chunk-MLUBD3PU.js +245 -0
- package/dist/{chunk-SA4LVIO6.cjs → chunk-MPQ5PFCS.cjs} +9 -9
- package/dist/{chunk-5BKIG4XN.cjs → chunk-P5GFKFI6.cjs} +2 -2
- package/dist/{chunk-SPNVYBT4.cjs → chunk-QPSRWTSZ.cjs} +11 -11
- package/dist/{chunk-DXUUXBG3.cjs → chunk-UJPJQXGA.cjs} +2 -2
- package/dist/{chunk-KRKGLKPD.cjs → chunk-ZQWK7Y2J.cjs} +9 -9
- package/dist/config-file/get-config-file.cjs +8 -8
- package/dist/config-file/get-config-file.js +7 -7
- package/dist/config-file/index.cjs +8 -8
- package/dist/config-file/index.js +7 -7
- package/dist/create-storm-config.cjs +11 -11
- package/dist/create-storm-config.js +10 -10
- package/dist/env/get-env.cjs +3 -3
- package/dist/env/get-env.js +2 -2
- package/dist/env/index.cjs +4 -4
- package/dist/env/index.js +3 -3
- package/dist/env/set-env.cjs +3 -3
- package/dist/env/set-env.js +2 -2
- package/dist/get-config.cjs +12 -12
- package/dist/get-config.js +11 -11
- package/dist/index.cjs +37 -13
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +37 -13
- package/dist/logger/console.cjs +5 -5
- package/dist/logger/console.js +4 -4
- package/dist/logger/create-logger.cjs +6 -6
- package/dist/logger/create-logger.js +5 -5
- package/dist/logger/index.cjs +6 -6
- package/dist/logger/index.js +5 -5
- package/dist/utilities/apply-workspace-tokens.cjs +4 -4
- package/dist/utilities/apply-workspace-tokens.js +3 -3
- package/dist/utilities/correct-paths.cjs +26 -2
- package/dist/utilities/correct-paths.d.cts +22 -11
- package/dist/utilities/correct-paths.d.ts +22 -11
- package/dist/utilities/correct-paths.js +27 -3
- package/dist/utilities/find-workspace-root.cjs +3 -3
- package/dist/utilities/find-workspace-root.js +2 -2
- package/dist/utilities/get-default-config.cjs +4 -4
- package/dist/utilities/get-default-config.js +3 -3
- package/dist/utilities/index.cjs +31 -7
- package/dist/utilities/index.d.cts +2 -1
- package/dist/utilities/index.d.ts +2 -1
- package/dist/utilities/index.js +32 -8
- package/dist/utilities/process-handler.cjs +6 -6
- package/dist/utilities/process-handler.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-CRQ4EVX5.cjs +0 -32
- package/dist/chunk-LQJJD6FB.js +0 -32
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/bin/config.cjs
CHANGED
|
@@ -244,44 +244,147 @@ var COLOR_KEYS = [
|
|
|
244
244
|
// src/utilities/get-default-config.ts
|
|
245
245
|
var import_node_fs2 = require("fs");
|
|
246
246
|
var import_promises = require("fs/promises");
|
|
247
|
-
var
|
|
247
|
+
var import_node_path2 = require("path");
|
|
248
248
|
|
|
249
249
|
// src/utilities/correct-paths.ts
|
|
250
|
-
var
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
250
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
251
|
+
function normalizeWindowsPath(input = "") {
|
|
252
|
+
if (!input) {
|
|
253
|
+
return input;
|
|
254
|
+
}
|
|
255
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
256
|
+
}
|
|
257
|
+
__name(normalizeWindowsPath, "normalizeWindowsPath");
|
|
258
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
259
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
260
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
261
|
+
var correctPaths = /* @__PURE__ */ __name(function(path) {
|
|
262
|
+
if (!path || path.length === 0) {
|
|
263
|
+
return ".";
|
|
264
|
+
}
|
|
265
|
+
path = normalizeWindowsPath(path);
|
|
266
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
267
|
+
const isPathAbsolute = isAbsolute(path);
|
|
268
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
269
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
270
|
+
if (path.length === 0) {
|
|
271
|
+
if (isPathAbsolute) {
|
|
272
|
+
return "/";
|
|
261
273
|
}
|
|
262
|
-
return
|
|
274
|
+
return trailingSeparator ? "./" : ".";
|
|
263
275
|
}
|
|
264
|
-
|
|
276
|
+
if (trailingSeparator) {
|
|
277
|
+
path += "/";
|
|
278
|
+
}
|
|
279
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
280
|
+
path += "/";
|
|
281
|
+
}
|
|
282
|
+
if (isUNCPath) {
|
|
283
|
+
if (!isPathAbsolute) {
|
|
284
|
+
return `//./${path}`;
|
|
285
|
+
}
|
|
286
|
+
return `//${path}`;
|
|
287
|
+
}
|
|
288
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
265
289
|
}, "correctPaths");
|
|
266
|
-
var joinPaths = /* @__PURE__ */ __name((...
|
|
267
|
-
|
|
268
|
-
|
|
290
|
+
var joinPaths = /* @__PURE__ */ __name(function(...segments) {
|
|
291
|
+
let path = "";
|
|
292
|
+
for (const seg of segments) {
|
|
293
|
+
if (!seg) {
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
if (path.length > 0) {
|
|
297
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
298
|
+
const segLeading = seg[0] === "/";
|
|
299
|
+
const both = pathTrailing && segLeading;
|
|
300
|
+
if (both) {
|
|
301
|
+
path += seg.slice(1);
|
|
302
|
+
} else {
|
|
303
|
+
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
304
|
+
}
|
|
305
|
+
} else {
|
|
306
|
+
path += seg;
|
|
307
|
+
}
|
|
269
308
|
}
|
|
270
|
-
return correctPaths(
|
|
309
|
+
return correctPaths(path);
|
|
271
310
|
}, "joinPaths");
|
|
311
|
+
function normalizeString(path, allowAboveRoot) {
|
|
312
|
+
let res = "";
|
|
313
|
+
let lastSegmentLength = 0;
|
|
314
|
+
let lastSlash = -1;
|
|
315
|
+
let dots = 0;
|
|
316
|
+
let char = null;
|
|
317
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
318
|
+
if (index < path.length) {
|
|
319
|
+
char = path[index];
|
|
320
|
+
} else if (char === "/") {
|
|
321
|
+
break;
|
|
322
|
+
} else {
|
|
323
|
+
char = "/";
|
|
324
|
+
}
|
|
325
|
+
if (char === "/") {
|
|
326
|
+
if (lastSlash === index - 1 || dots === 1) {
|
|
327
|
+
} else if (dots === 2) {
|
|
328
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
329
|
+
if (res.length > 2) {
|
|
330
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
331
|
+
if (lastSlashIndex === -1) {
|
|
332
|
+
res = "";
|
|
333
|
+
lastSegmentLength = 0;
|
|
334
|
+
} else {
|
|
335
|
+
res = res.slice(0, lastSlashIndex);
|
|
336
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
337
|
+
}
|
|
338
|
+
lastSlash = index;
|
|
339
|
+
dots = 0;
|
|
340
|
+
continue;
|
|
341
|
+
} else if (res.length > 0) {
|
|
342
|
+
res = "";
|
|
343
|
+
lastSegmentLength = 0;
|
|
344
|
+
lastSlash = index;
|
|
345
|
+
dots = 0;
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (allowAboveRoot) {
|
|
350
|
+
res += res.length > 0 ? "/.." : "..";
|
|
351
|
+
lastSegmentLength = 2;
|
|
352
|
+
}
|
|
353
|
+
} else {
|
|
354
|
+
if (res.length > 0) {
|
|
355
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
356
|
+
} else {
|
|
357
|
+
res = path.slice(lastSlash + 1, index);
|
|
358
|
+
}
|
|
359
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
360
|
+
}
|
|
361
|
+
lastSlash = index;
|
|
362
|
+
dots = 0;
|
|
363
|
+
} else if (char === "." && dots !== -1) {
|
|
364
|
+
++dots;
|
|
365
|
+
} else {
|
|
366
|
+
dots = -1;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return res;
|
|
370
|
+
}
|
|
371
|
+
__name(normalizeString, "normalizeString");
|
|
372
|
+
var isAbsolute = /* @__PURE__ */ __name(function(p) {
|
|
373
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
374
|
+
}, "isAbsolute");
|
|
272
375
|
|
|
273
376
|
// src/utilities/find-up.ts
|
|
274
377
|
var import_node_fs = require("fs");
|
|
275
|
-
var
|
|
378
|
+
var import_node_path = require("path");
|
|
276
379
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
277
380
|
var depth = 0;
|
|
278
381
|
function findFolderUp(startPath, endFileNames) {
|
|
279
382
|
const _startPath = startPath ?? process.cwd();
|
|
280
|
-
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0,
|
|
383
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
|
|
281
384
|
return _startPath;
|
|
282
385
|
}
|
|
283
386
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
284
|
-
const parent = (0,
|
|
387
|
+
const parent = (0, import_node_path.join)(_startPath, "..");
|
|
285
388
|
return findFolderUp(parent, endFileNames);
|
|
286
389
|
}
|
|
287
390
|
return void 0;
|
|
@@ -378,7 +481,7 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
|
378
481
|
let namespace = void 0;
|
|
379
482
|
let repository = void 0;
|
|
380
483
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
381
|
-
if ((0, import_node_fs2.existsSync)((0,
|
|
484
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
382
485
|
const file = await (0, import_promises.readFile)(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
383
486
|
if (file) {
|
|
384
487
|
const packageJson = JSON.parse(file);
|
package/bin/config.js
CHANGED
|
@@ -212,44 +212,147 @@ var COLOR_KEYS = [
|
|
|
212
212
|
// src/utilities/get-default-config.ts
|
|
213
213
|
import { existsSync as existsSync2 } from "node:fs";
|
|
214
214
|
import { readFile } from "node:fs/promises";
|
|
215
|
-
import { join as
|
|
215
|
+
import { join as join2 } from "node:path";
|
|
216
216
|
|
|
217
217
|
// src/utilities/correct-paths.ts
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
218
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
219
|
+
function normalizeWindowsPath(input = "") {
|
|
220
|
+
if (!input) {
|
|
221
|
+
return input;
|
|
222
|
+
}
|
|
223
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
224
|
+
}
|
|
225
|
+
__name(normalizeWindowsPath, "normalizeWindowsPath");
|
|
226
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
227
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
228
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
229
|
+
var correctPaths = /* @__PURE__ */ __name(function(path) {
|
|
230
|
+
if (!path || path.length === 0) {
|
|
231
|
+
return ".";
|
|
232
|
+
}
|
|
233
|
+
path = normalizeWindowsPath(path);
|
|
234
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
235
|
+
const isPathAbsolute = isAbsolute(path);
|
|
236
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
237
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
238
|
+
if (path.length === 0) {
|
|
239
|
+
if (isPathAbsolute) {
|
|
240
|
+
return "/";
|
|
229
241
|
}
|
|
230
|
-
return
|
|
242
|
+
return trailingSeparator ? "./" : ".";
|
|
231
243
|
}
|
|
232
|
-
|
|
244
|
+
if (trailingSeparator) {
|
|
245
|
+
path += "/";
|
|
246
|
+
}
|
|
247
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
248
|
+
path += "/";
|
|
249
|
+
}
|
|
250
|
+
if (isUNCPath) {
|
|
251
|
+
if (!isPathAbsolute) {
|
|
252
|
+
return `//./${path}`;
|
|
253
|
+
}
|
|
254
|
+
return `//${path}`;
|
|
255
|
+
}
|
|
256
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
233
257
|
}, "correctPaths");
|
|
234
|
-
var joinPaths = /* @__PURE__ */ __name((...
|
|
235
|
-
|
|
236
|
-
|
|
258
|
+
var joinPaths = /* @__PURE__ */ __name(function(...segments) {
|
|
259
|
+
let path = "";
|
|
260
|
+
for (const seg of segments) {
|
|
261
|
+
if (!seg) {
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (path.length > 0) {
|
|
265
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
266
|
+
const segLeading = seg[0] === "/";
|
|
267
|
+
const both = pathTrailing && segLeading;
|
|
268
|
+
if (both) {
|
|
269
|
+
path += seg.slice(1);
|
|
270
|
+
} else {
|
|
271
|
+
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
path += seg;
|
|
275
|
+
}
|
|
237
276
|
}
|
|
238
|
-
return correctPaths(
|
|
277
|
+
return correctPaths(path);
|
|
239
278
|
}, "joinPaths");
|
|
279
|
+
function normalizeString(path, allowAboveRoot) {
|
|
280
|
+
let res = "";
|
|
281
|
+
let lastSegmentLength = 0;
|
|
282
|
+
let lastSlash = -1;
|
|
283
|
+
let dots = 0;
|
|
284
|
+
let char = null;
|
|
285
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
286
|
+
if (index < path.length) {
|
|
287
|
+
char = path[index];
|
|
288
|
+
} else if (char === "/") {
|
|
289
|
+
break;
|
|
290
|
+
} else {
|
|
291
|
+
char = "/";
|
|
292
|
+
}
|
|
293
|
+
if (char === "/") {
|
|
294
|
+
if (lastSlash === index - 1 || dots === 1) {
|
|
295
|
+
} else if (dots === 2) {
|
|
296
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
297
|
+
if (res.length > 2) {
|
|
298
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
299
|
+
if (lastSlashIndex === -1) {
|
|
300
|
+
res = "";
|
|
301
|
+
lastSegmentLength = 0;
|
|
302
|
+
} else {
|
|
303
|
+
res = res.slice(0, lastSlashIndex);
|
|
304
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
305
|
+
}
|
|
306
|
+
lastSlash = index;
|
|
307
|
+
dots = 0;
|
|
308
|
+
continue;
|
|
309
|
+
} else if (res.length > 0) {
|
|
310
|
+
res = "";
|
|
311
|
+
lastSegmentLength = 0;
|
|
312
|
+
lastSlash = index;
|
|
313
|
+
dots = 0;
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (allowAboveRoot) {
|
|
318
|
+
res += res.length > 0 ? "/.." : "..";
|
|
319
|
+
lastSegmentLength = 2;
|
|
320
|
+
}
|
|
321
|
+
} else {
|
|
322
|
+
if (res.length > 0) {
|
|
323
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
324
|
+
} else {
|
|
325
|
+
res = path.slice(lastSlash + 1, index);
|
|
326
|
+
}
|
|
327
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
328
|
+
}
|
|
329
|
+
lastSlash = index;
|
|
330
|
+
dots = 0;
|
|
331
|
+
} else if (char === "." && dots !== -1) {
|
|
332
|
+
++dots;
|
|
333
|
+
} else {
|
|
334
|
+
dots = -1;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return res;
|
|
338
|
+
}
|
|
339
|
+
__name(normalizeString, "normalizeString");
|
|
340
|
+
var isAbsolute = /* @__PURE__ */ __name(function(p) {
|
|
341
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
342
|
+
}, "isAbsolute");
|
|
240
343
|
|
|
241
344
|
// src/utilities/find-up.ts
|
|
242
345
|
import { existsSync } from "node:fs";
|
|
243
|
-
import { join
|
|
346
|
+
import { join } from "node:path";
|
|
244
347
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
245
348
|
var depth = 0;
|
|
246
349
|
function findFolderUp(startPath, endFileNames) {
|
|
247
350
|
const _startPath = startPath ?? process.cwd();
|
|
248
|
-
if (endFileNames.some((endFileName) => existsSync(
|
|
351
|
+
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
|
|
249
352
|
return _startPath;
|
|
250
353
|
}
|
|
251
354
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
252
|
-
const parent =
|
|
355
|
+
const parent = join(_startPath, "..");
|
|
253
356
|
return findFolderUp(parent, endFileNames);
|
|
254
357
|
}
|
|
255
358
|
return void 0;
|
|
@@ -346,7 +449,7 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
|
346
449
|
let namespace = void 0;
|
|
347
450
|
let repository = void 0;
|
|
348
451
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
349
|
-
if (existsSync2(
|
|
452
|
+
if (existsSync2(join2(workspaceRoot, "package.json"))) {
|
|
350
453
|
const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
351
454
|
if (file) {
|
|
352
455
|
const packageJson = JSON.parse(file);
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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
|
|
3
|
+
var _chunkMPQ5PFCScjs = require('./chunk-MPQ5PFCS.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk5K6CXYFFcjs = require('./chunk-5K6CXYFF.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkFI7WN47Ycjs = require('./chunk-FI7WN47Y.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkMAMYTWWYcjs = require('./chunk-MAMYTWWY.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk32ACHDIUcjs = require('./chunk-32ACHDIU.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkLXAJWZ37cjs = require('./chunk-LXAJWZ37.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
var _chunkJXLUUN7Zcjs = require('./chunk-JXLUUN7Z.cjs');
|
|
@@ -35,13 +35,13 @@ var createStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, as
|
|
|
35
35
|
if (!_optionalChain([_static_cache, 'optionalAccess', _ => _.data]) || !_optionalChain([_static_cache, 'optionalAccess', _2 => _2.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
36
36
|
let _workspaceRoot = workspaceRoot;
|
|
37
37
|
if (!_workspaceRoot) {
|
|
38
|
-
_workspaceRoot =
|
|
38
|
+
_workspaceRoot = _chunkMAMYTWWYcjs.findWorkspaceRoot.call(void 0, );
|
|
39
39
|
}
|
|
40
|
-
const configEnv =
|
|
41
|
-
const defaultConfig = await
|
|
42
|
-
const configFile = await
|
|
40
|
+
const configEnv = _chunkLXAJWZ37cjs.getConfigEnv.call(void 0, );
|
|
41
|
+
const defaultConfig = await _chunkFI7WN47Ycjs.getDefaultConfig.call(void 0, _workspaceRoot);
|
|
42
|
+
const configFile = await _chunkMPQ5PFCScjs.getConfigFile.call(void 0, _workspaceRoot);
|
|
43
43
|
if (!configFile && !skipLogs) {
|
|
44
|
-
|
|
44
|
+
_chunk5K6CXYFFcjs.writeWarning.call(void 0, "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
|
|
45
45
|
logLevel: "all"
|
|
46
46
|
});
|
|
47
47
|
}
|
|
@@ -69,7 +69,7 @@ var createConfigExtension = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0
|
|
|
69
69
|
if (_extension_cache.has(extension_cache_key)) {
|
|
70
70
|
return _extension_cache.get(extension_cache_key);
|
|
71
71
|
}
|
|
72
|
-
let extension =
|
|
72
|
+
let extension = _chunkLXAJWZ37cjs.getExtensionEnv.call(void 0, extensionName);
|
|
73
73
|
if (schema) {
|
|
74
74
|
extension = schema.parse(extension);
|
|
75
75
|
}
|
|
@@ -78,10 +78,10 @@ var createConfigExtension = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0
|
|
|
78
78
|
}, "createConfigExtension");
|
|
79
79
|
var loadStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot, skipLogs = false) => {
|
|
80
80
|
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
81
|
-
|
|
81
|
+
_chunk32ACHDIUcjs.setConfigEnv.call(void 0, config);
|
|
82
82
|
if (!skipLogs) {
|
|
83
|
-
|
|
84
|
-
${
|
|
83
|
+
_chunk5K6CXYFFcjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm configuration:
|
|
84
|
+
${_chunk5K6CXYFFcjs.formatLogMessage.call(void 0, config)}`, config);
|
|
85
85
|
}
|
|
86
86
|
return config;
|
|
87
87
|
}, "loadStormConfig");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
|
3
|
+
var _chunkHESFC24Zcjs = require('./chunk-HESFC24Z.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk3NWKPYIGcjs = require('./chunk-3NWKPYIG.cjs');
|
|
@@ -79,31 +79,31 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
79
79
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
80
80
|
}
|
|
81
81
|
if (config.configFile) {
|
|
82
|
-
process.env[`${prefix}CONFIG_FILE`] =
|
|
82
|
+
process.env[`${prefix}CONFIG_FILE`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.configFile);
|
|
83
83
|
}
|
|
84
84
|
if (config.workspaceRoot) {
|
|
85
|
-
process.env[`${prefix}WORKSPACE_ROOT`] =
|
|
86
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
87
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
85
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
86
|
+
process.env.NX_WORKSPACE_ROOT = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
87
|
+
process.env.NX_WORKSPACE_ROOT_PATH = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
88
88
|
}
|
|
89
89
|
if (config.directories) {
|
|
90
90
|
if (!config.skipCache && config.directories.cache) {
|
|
91
|
-
process.env[`${prefix}CACHE_DIR`] =
|
|
91
|
+
process.env[`${prefix}CACHE_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.cache);
|
|
92
92
|
}
|
|
93
93
|
if (config.directories.data) {
|
|
94
|
-
process.env[`${prefix}DATA_DIR`] =
|
|
94
|
+
process.env[`${prefix}DATA_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.data);
|
|
95
95
|
}
|
|
96
96
|
if (config.directories.config) {
|
|
97
|
-
process.env[`${prefix}CONFIG_DIR`] =
|
|
97
|
+
process.env[`${prefix}CONFIG_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.config);
|
|
98
98
|
}
|
|
99
99
|
if (config.directories.temp) {
|
|
100
|
-
process.env[`${prefix}TEMP_DIR`] =
|
|
100
|
+
process.env[`${prefix}TEMP_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.temp);
|
|
101
101
|
}
|
|
102
102
|
if (config.directories.log) {
|
|
103
|
-
process.env[`${prefix}LOG_DIR`] =
|
|
103
|
+
process.env[`${prefix}LOG_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.log);
|
|
104
104
|
}
|
|
105
105
|
if (config.directories.build) {
|
|
106
|
-
process.env[`${prefix}BUILD_DIR`] =
|
|
106
|
+
process.env[`${prefix}BUILD_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.build);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
if (config.skipCache !== void 0) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
|
3
|
+
var _chunkFI7WN47Ycjs = require('./chunk-FI7WN47Y.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkSLGVSUEVcjs = require('./chunk-SLGVSUEV.cjs');
|
|
@@ -23,7 +23,7 @@ var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
|
|
|
23
23
|
|
|
24
24
|
// src/logger/console.ts
|
|
25
25
|
var getLogFn = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (logLevel = _chunkIRCFHYKZcjs.LogLevel.INFO, config = {}, _chalk = _chunkSLGVSUEVcjs.getChalk.call(void 0, )) => {
|
|
26
|
-
const colors = !_optionalChain([config, 'access', _2 => _2.colors, 'optionalAccess', _3 => _3.dark]) && !_optionalChain([config, 'access', _4 => _4.colors, 'optionalAccess', _5 => _5["base"]]) && !_optionalChain([config, 'access', _6 => _6.colors, 'optionalAccess', _7 => _7["base"], 'optionalAccess', _8 => _8.dark]) ?
|
|
26
|
+
const colors = !_optionalChain([config, 'access', _2 => _2.colors, 'optionalAccess', _3 => _3.dark]) && !_optionalChain([config, 'access', _4 => _4.colors, 'optionalAccess', _5 => _5["base"]]) && !_optionalChain([config, 'access', _6 => _6.colors, 'optionalAccess', _7 => _7["base"], 'optionalAccess', _8 => _8.dark]) ? _chunkFI7WN47Ycjs.DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _9 => _9.colors, 'optionalAccess', _10 => _10.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _11 => _11.colors, 'optionalAccess', _12 => _12["base"], 'optionalAccess', _13 => _13.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _14 => _14.colors, 'optionalAccess', _15 => _15["base"]]) ? _optionalChain([config, 'access', _16 => _16.colors, 'optionalAccess', _17 => _17["base"]]) : _chunkFI7WN47Ycjs.DEFAULT_COLOR_CONFIG;
|
|
27
27
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || _chunkIRCFHYKZcjs.LogLevelLabel.INFO;
|
|
28
28
|
if (logLevel > _chunk3NWKPYIGcjs.getLogLevel.call(void 0, configLogLevel) || logLevel <= _chunkIRCFHYKZcjs.LogLevel.SILENT || _chunk3NWKPYIGcjs.getLogLevel.call(void 0, configLogLevel) <= _chunkIRCFHYKZcjs.LogLevel.SILENT) {
|
|
29
29
|
return (_) => {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConfigFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JVA7N2JV.js";
|
|
4
4
|
import {
|
|
5
5
|
formatLogMessage,
|
|
6
6
|
writeTrace,
|
|
7
7
|
writeWarning
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5GDS63DU.js";
|
|
9
9
|
import {
|
|
10
10
|
getDefaultConfig
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HFGQYKYH.js";
|
|
12
12
|
import {
|
|
13
13
|
findWorkspaceRoot
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4E4DSFC4.js";
|
|
15
15
|
import {
|
|
16
16
|
setConfigEnv
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2VKMRURF.js";
|
|
18
18
|
import {
|
|
19
19
|
getConfigEnv,
|
|
20
20
|
getExtensionEnv
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HDI7BCVL.js";
|
|
22
22
|
import {
|
|
23
23
|
StormConfigSchema
|
|
24
24
|
} from "./chunk-WRGFZXJE.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMAMYTWWYcjs = require('./chunk-MAMYTWWY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkJXLUUN7Zcjs = require('./chunk-JXLUUN7Z.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkHESFC24Zcjs = require('./chunk-HESFC24Z.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
|
|
@@ -50,9 +50,9 @@ var getDefaultConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, asy
|
|
|
50
50
|
let name = void 0;
|
|
51
51
|
let namespace = void 0;
|
|
52
52
|
let repository = void 0;
|
|
53
|
-
const workspaceRoot =
|
|
53
|
+
const workspaceRoot = _chunkMAMYTWWYcjs.findWorkspaceRoot.call(void 0, root);
|
|
54
54
|
if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
|
|
55
|
-
const file = await _promises.readFile.call(void 0,
|
|
55
|
+
const file = await _promises.readFile.call(void 0, _chunkHESFC24Zcjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
|
|
56
56
|
if (file) {
|
|
57
57
|
const packageJson = JSON.parse(file);
|
|
58
58
|
if (packageJson.name) {
|