@storm-software/config-tools 1.136.3 → 1.137.0
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/acorn-646RJR5S.mjs +3131 -0
- package/dist/acorn-BKIQKJ4F.js +3131 -0
- package/dist/angular-BK32YZBC.mjs +3014 -0
- package/dist/angular-IJH6AEQ2.js +3014 -0
- package/dist/babel-FTNSNFRG.mjs +7166 -0
- package/dist/babel-MD4YJE3Y.js +7166 -0
- package/dist/{chunk-RP57MH2N.js → chunk-2HT4ORYA.js} +14 -14
- package/dist/chunk-35WYVRRU.js +1120 -0
- package/dist/chunk-3FDEYZAK.js +765 -0
- package/dist/{chunk-BOM7LGB4.js → chunk-3WTN23SK.js} +37 -37
- package/dist/chunk-43PFM5U5.js +1736 -0
- package/dist/{chunk-SWW23TCX.js → chunk-444WTFCK.js} +28 -26
- package/dist/chunk-4C5ULXHZ.js +6 -0
- package/dist/{chunk-CO2NVYPR.js → chunk-4JZSUGPE.js} +23 -23
- package/dist/chunk-5QGWRJPB.mjs +84 -0
- package/dist/{chunk-RBSVNX4W.js → chunk-5YOGYZEG.js} +13 -1
- package/dist/chunk-5YZA7ARA.mjs +765 -0
- package/dist/chunk-5Z3NLDDE.mjs +451 -0
- package/dist/chunk-A2B7JKBP.js +7601 -0
- package/dist/chunk-ARQBMHSM.mjs +510 -0
- package/dist/chunk-AVHETSFN.js +39947 -0
- package/dist/{chunk-VK6ZC6XP.js → chunk-B5LYXPCJ.js} +7 -7
- package/dist/{chunk-36YIAZMD.mjs → chunk-BKXOCTTA.mjs} +3 -3
- package/dist/{chunk-BDBWBTMW.mjs → chunk-BP57EQU7.mjs} +3 -3
- package/dist/{chunk-QOJMUMJR.mjs → chunk-CMYWKSBB.mjs} +1 -1
- package/dist/{chunk-72XOK5QO.mjs → chunk-D6HJ3XEE.mjs} +3 -3
- package/dist/{chunk-OONRDTMT.mjs → chunk-D7EEDW3J.mjs} +1 -1
- package/dist/{chunk-7LUIP6PQ.js → chunk-DANGEXD7.js} +6 -6
- package/dist/chunk-E25ESST2.mjs +7601 -0
- package/dist/{chunk-ITHOTGIJ.mjs → chunk-E3KP6D4W.mjs} +4 -4
- package/dist/{chunk-MJS5XRE6.mjs → chunk-EMP3EUPT.mjs} +1 -1
- package/dist/{chunk-Z5UYG3QU.js → chunk-FMJGAM5D.js} +4 -4
- package/dist/chunk-G6TE7BPR.js +84 -0
- package/dist/{chunk-ZHN5GXW7.mjs → chunk-GGBZLABE.mjs} +2 -2
- package/dist/{chunk-F526RRYA.mjs → chunk-GRGCVKMG.mjs} +11 -9
- package/dist/{chunk-K7V3S3BW.js → chunk-GVQZFZ6E.js} +3 -3
- package/dist/{chunk-PYKV5UE3.js → chunk-GWRO5VMM.js} +3 -3
- package/dist/chunk-HDZVYW2P.js +70 -0
- package/dist/{chunk-LJLITR54.mjs → chunk-HHCEURYJ.mjs} +1 -1
- package/dist/chunk-IXG2QO76.mjs +39948 -0
- package/dist/chunk-JBD6MOCX.mjs +1733 -0
- package/dist/{chunk-2Z2NUZGO.mjs → chunk-JTLTCOIF.mjs} +1 -1
- package/dist/{chunk-UNJVNXY7.js → chunk-LGIWVSRE.js} +10 -10
- package/dist/{chunk-D47HPUO7.mjs → chunk-LL5L564L.mjs} +11 -11
- package/dist/chunk-LNE3WDH6.js +6 -0
- package/dist/chunk-N34NGVL6.js +2644 -0
- package/dist/{chunk-5GHDZSSH.mjs → chunk-N3H7WTUT.mjs} +1 -1
- package/dist/{chunk-7GSJ2YLJ.js → chunk-O3Q5GFR2.js} +4 -4
- package/dist/chunk-OKAFRVSY.mjs +4054 -0
- package/dist/chunk-OL53L7AE.mjs +1120 -0
- package/dist/chunk-OW5ANXN5.mjs +2644 -0
- package/dist/chunk-PHAIVEXJ.js +6 -0
- package/dist/{chunk-LQCUO5PV.mjs → chunk-Q5A4EAHJ.mjs} +1 -1
- package/dist/{chunk-R2YPKFGO.mjs → chunk-QJ35PYO3.mjs} +1 -1
- package/dist/chunk-QP46I4IQ.js +451 -0
- package/dist/{chunk-LQGTS5ON.mjs → chunk-R4TY5O2X.mjs} +1 -1
- package/dist/{chunk-EG4OHTQF.mjs → chunk-RGQF4WBS.mjs} +2 -2
- package/dist/chunk-RRSNGPTK.js +4054 -0
- package/dist/{chunk-EVEP57Q3.mjs → chunk-RZYA76H7.mjs} +13 -0
- package/dist/{chunk-KVGJIBF2.mjs → chunk-SNQO46A7.mjs} +1 -1
- package/dist/{chunk-GQAPQGTR.mjs → chunk-UJDQ4JJ2.mjs} +4 -4
- package/dist/chunk-UMD3QNEF.js +510 -0
- package/dist/{chunk-T7WO327S.js → chunk-V2UDLRHO.js} +8 -8
- package/dist/{chunk-AYVEVLX7.js → chunk-VRFMKUF5.js} +27 -27
- package/dist/chunk-WAL7JRLU.js +6 -0
- package/dist/{chunk-WUGUATQE.mjs → chunk-WCZGQC7L.mjs} +2 -2
- package/dist/{chunk-DKTC7KUS.mjs → chunk-WDQJ7FQS.mjs} +1 -1
- package/dist/chunk-WT74SYKM.js +28 -0
- package/dist/{chunk-SEQZA3NM.js → chunk-WVJHCVAR.js} +3 -3
- package/dist/{chunk-OQLT27Y3.js → chunk-X3LZL2FA.js} +2 -2
- package/dist/config-file/get-config-file.js +26 -20
- package/dist/config-file/get-config-file.mjs +25 -19
- package/dist/config-file/index.js +27 -21
- package/dist/config-file/index.mjs +26 -20
- package/dist/create-storm-config.js +34 -28
- package/dist/create-storm-config.mjs +28 -22
- package/dist/dist-ESY54GEK.mjs +17570 -0
- package/dist/dist-IKT3RN2B.js +17571 -0
- package/dist/env/get-env.js +7 -7
- package/dist/env/get-env.mjs +6 -6
- package/dist/env/index.js +9 -9
- package/dist/env/index.mjs +8 -8
- package/dist/env/set-env.js +6 -6
- package/dist/env/set-env.mjs +5 -5
- package/dist/esm-CHY33BEA.js +1716 -0
- package/dist/esm-GXBYTNSY.mjs +1716 -0
- package/dist/estree-OISRK7S3.mjs +4859 -0
- package/dist/estree-ROOTGONW.js +4859 -0
- package/dist/execa-OBTCQJ4R.js +2424 -0
- package/dist/execa-Q37TRODQ.mjs +2424 -0
- package/dist/flow-6CYXU2JU.js +28076 -0
- package/dist/flow-CVR7JYJR.mjs +28076 -0
- package/dist/glimmer-HPLV3CEI.mjs +3062 -0
- package/dist/glimmer-KC46TXCG.js +3062 -0
- package/dist/graphql-HGTQLI6G.mjs +1355 -0
- package/dist/graphql-QEQ22DRF.js +1355 -0
- package/dist/html-BQF3QJLP.mjs +3036 -0
- package/dist/html-SQTQQXQE.js +3036 -0
- package/dist/index.js +33 -27
- package/dist/index.mjs +37 -31
- package/dist/json5-FGCHX2C5.js +10 -0
- package/dist/json5-PFHFTE3S.mjs +10 -0
- package/dist/jsonc-JYPKWISW.js +15 -0
- package/dist/jsonc-QMXWMKWV.mjs +15 -0
- package/dist/logger/chalk.js +3 -3
- package/dist/logger/chalk.mjs +2 -2
- package/dist/logger/console-icons.js +5 -5
- package/dist/logger/console-icons.mjs +4 -4
- package/dist/logger/console.js +14 -14
- package/dist/logger/console.mjs +13 -13
- package/dist/logger/format-timestamp.js +3 -3
- package/dist/logger/format-timestamp.mjs +2 -2
- package/dist/logger/get-log-level.js +4 -4
- package/dist/logger/get-log-level.mjs +3 -3
- package/dist/logger/index.js +15 -15
- package/dist/logger/index.mjs +20 -20
- package/dist/logger/is-unicode-supported.js +3 -3
- package/dist/logger/is-unicode-supported.mjs +2 -2
- package/dist/markdown-GDAB6YZK.mjs +3846 -0
- package/dist/markdown-VAH7N2ZD.js +3846 -0
- package/dist/meriyah-64TJZ2NR.mjs +2720 -0
- package/dist/meriyah-KXJRAU2O.js +2720 -0
- package/dist/multipart-parser-ACF3MON7.js +187 -0
- package/dist/multipart-parser-XTEGLYUH.mjs +187 -0
- package/dist/postcss-CTT2C6VM.mjs +5440 -0
- package/dist/postcss-ULTRDB4V.js +5440 -0
- package/dist/prettier-DDE3QA5F.mjs +23559 -0
- package/dist/prettier-V6MPEGHT.js +23560 -0
- package/dist/toml-5DG5WNM7.mjs +10 -0
- package/dist/toml-S745O2YV.js +10 -0
- package/dist/types.js +3 -3
- package/dist/types.mjs +2 -2
- package/dist/typescript-CCR5BUC6.js +14956 -0
- package/dist/typescript-DSR4LFJ2.mjs +14956 -0
- package/dist/utilities/apply-workspace-tokens.js +6 -6
- package/dist/utilities/apply-workspace-tokens.mjs +5 -5
- package/dist/utilities/correct-paths.js +3 -3
- package/dist/utilities/correct-paths.mjs +2 -2
- package/dist/utilities/file-path-utils.js +3 -3
- package/dist/utilities/file-path-utils.mjs +2 -2
- package/dist/utilities/find-up.js +3 -3
- package/dist/utilities/find-up.mjs +2 -2
- package/dist/utilities/find-workspace-root.js +5 -5
- package/dist/utilities/find-workspace-root.mjs +4 -4
- package/dist/utilities/get-default-config.js +7 -7
- package/dist/utilities/get-default-config.mjs +6 -6
- package/dist/utilities/index.js +19 -19
- package/dist/utilities/index.mjs +18 -18
- package/dist/utilities/process-handler.js +15 -15
- package/dist/utilities/process-handler.mjs +14 -14
- package/dist/utilities/run.js +3 -3
- package/dist/utilities/run.mjs +2 -2
- package/dist/yaml-FXUEXKW3.js +10 -0
- package/dist/yaml-I7POIORV.js +4584 -0
- package/dist/yaml-KYTKYGLP.mjs +10 -0
- package/dist/yaml-SVET52GC.mjs +4584 -0
- package/package.json +2 -2
- package/dist/chunk-22DJFJ62.js +0 -6
- package/dist/chunk-2K7AEY66.mjs +0 -545
- package/dist/chunk-5EN3BWVN.mjs +0 -28
- package/dist/chunk-6AYXKAF5.js +0 -28
- package/dist/chunk-H2652TPM.js +0 -6
- package/dist/chunk-HHAOVN3O.js +0 -545
- package/dist/chunk-JYGRRNZP.js +0 -28
- package/dist/chunk-OLORJVVT.js +0 -6
- package/dist/chunk-PIDYVUHK.js +0 -6
- package/dist/chunk-PYET3L7X.js +0 -431
- package/dist/chunk-T3JLYD7F.js +0 -70
- package/dist/chunk-VGI5MGGT.mjs +0 -431
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/config-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.137.0",
|
|
4
4
|
"description": "⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "github",
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
"sullivanpj",
|
|
198
198
|
"monorepo"
|
|
199
199
|
],
|
|
200
|
-
"dependencies": { "zod": "^3.24.0" },
|
|
200
|
+
"dependencies": { "jiti": "^2.4.2", "zod": "^3.24.0" },
|
|
201
201
|
"devDependencies": {
|
|
202
202
|
"@types/node": "^22.10.2",
|
|
203
203
|
"c12": "^2.0.0-beta.2",
|
package/dist/chunk-22DJFJ62.js
DELETED
package/dist/chunk-2K7AEY66.mjs
DELETED
|
@@ -1,545 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
writeSystem
|
|
3
|
-
} from "./chunk-D47HPUO7.mjs";
|
|
4
|
-
import {
|
|
5
|
-
findWorkspaceRoot
|
|
6
|
-
} from "./chunk-36YIAZMD.mjs";
|
|
7
|
-
import {
|
|
8
|
-
joinPaths
|
|
9
|
-
} from "./chunk-5EN3BWVN.mjs";
|
|
10
|
-
import {
|
|
11
|
-
__name,
|
|
12
|
-
init_esm_shims
|
|
13
|
-
} from "./chunk-EVEP57Q3.mjs";
|
|
14
|
-
|
|
15
|
-
// src/config-file/get-config-file.ts
|
|
16
|
-
init_esm_shims();
|
|
17
|
-
|
|
18
|
-
// ../../node_modules/.pnpm/c12@2.0.1/node_modules/c12/dist/index.mjs
|
|
19
|
-
init_esm_shims();
|
|
20
|
-
|
|
21
|
-
// ../../node_modules/.pnpm/c12@2.0.1/node_modules/c12/dist/shared/c12.B4fc1S0C.mjs
|
|
22
|
-
init_esm_shims();
|
|
23
|
-
import { existsSync, promises } from "node:fs";
|
|
24
|
-
import { rm, readFile } from "node:fs/promises";
|
|
25
|
-
import { homedir } from "node:os";
|
|
26
|
-
import { resolve, join, dirname, basename, extname } from "pathe";
|
|
27
|
-
import { createJiti } from "jiti";
|
|
28
|
-
import { fileURLToPath } from "mlly";
|
|
29
|
-
import * as rc9 from "rc9";
|
|
30
|
-
|
|
31
|
-
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
32
|
-
init_esm_shims();
|
|
33
|
-
function isPlainObject(value) {
|
|
34
|
-
if (value === null || typeof value !== "object") {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
const prototype = Object.getPrototypeOf(value);
|
|
38
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
if (Symbol.iterator in value) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
if (Symbol.toStringTag in value) {
|
|
45
|
-
return Object.prototype.toString.call(value) === "[object Module]";
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
__name(isPlainObject, "isPlainObject");
|
|
50
|
-
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
51
|
-
if (!isPlainObject(defaults)) {
|
|
52
|
-
return _defu(baseObject, {}, namespace, merger);
|
|
53
|
-
}
|
|
54
|
-
const object = Object.assign({}, defaults);
|
|
55
|
-
for (const key in baseObject) {
|
|
56
|
-
if (key === "__proto__" || key === "constructor") {
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
const value = baseObject[key];
|
|
60
|
-
if (value === null || value === void 0) {
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
if (merger && merger(object, key, value, namespace)) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
67
|
-
object[key] = [...value, ...object[key]];
|
|
68
|
-
} else if (isPlainObject(value) && isPlainObject(object[key])) {
|
|
69
|
-
object[key] = _defu(
|
|
70
|
-
value,
|
|
71
|
-
object[key],
|
|
72
|
-
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
73
|
-
merger
|
|
74
|
-
);
|
|
75
|
-
} else {
|
|
76
|
-
object[key] = value;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return object;
|
|
80
|
-
}
|
|
81
|
-
__name(_defu, "_defu");
|
|
82
|
-
function createDefu(merger) {
|
|
83
|
-
return (...arguments_) => (
|
|
84
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
85
|
-
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
__name(createDefu, "createDefu");
|
|
89
|
-
var defu = createDefu();
|
|
90
|
-
var defuFn = createDefu((object, key, currentValue) => {
|
|
91
|
-
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
92
|
-
object[key] = currentValue(object[key]);
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
97
|
-
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
98
|
-
object[key] = currentValue(object[key]);
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
// ../../node_modules/.pnpm/c12@2.0.1/node_modules/c12/dist/shared/c12.B4fc1S0C.mjs
|
|
104
|
-
import { hash } from "ohash";
|
|
105
|
-
import { findWorkspaceDir, readPackageJSON } from "pkg-types";
|
|
106
|
-
import * as dotenv from "dotenv";
|
|
107
|
-
async function setupDotenv(options) {
|
|
108
|
-
const targetEnvironment = options.env ?? process.env;
|
|
109
|
-
const environment = await loadDotenv({
|
|
110
|
-
cwd: options.cwd,
|
|
111
|
-
fileName: options.fileName ?? ".env",
|
|
112
|
-
env: targetEnvironment,
|
|
113
|
-
interpolate: options.interpolate ?? true
|
|
114
|
-
});
|
|
115
|
-
for (const key in environment) {
|
|
116
|
-
if (!key.startsWith("_") && targetEnvironment[key] === void 0) {
|
|
117
|
-
targetEnvironment[key] = environment[key];
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return environment;
|
|
121
|
-
}
|
|
122
|
-
__name(setupDotenv, "setupDotenv");
|
|
123
|
-
async function loadDotenv(options) {
|
|
124
|
-
const environment = /* @__PURE__ */ Object.create(null);
|
|
125
|
-
const dotenvFile = resolve(options.cwd, options.fileName);
|
|
126
|
-
if (existsSync(dotenvFile)) {
|
|
127
|
-
const parsed = dotenv.parse(await promises.readFile(dotenvFile, "utf8"));
|
|
128
|
-
Object.assign(environment, parsed);
|
|
129
|
-
}
|
|
130
|
-
if (!options.env?._applied) {
|
|
131
|
-
Object.assign(environment, options.env);
|
|
132
|
-
environment._applied = true;
|
|
133
|
-
}
|
|
134
|
-
if (options.interpolate) {
|
|
135
|
-
interpolate(environment);
|
|
136
|
-
}
|
|
137
|
-
return environment;
|
|
138
|
-
}
|
|
139
|
-
__name(loadDotenv, "loadDotenv");
|
|
140
|
-
function interpolate(target, source = {}, parse2 = (v) => v) {
|
|
141
|
-
function getValue(key) {
|
|
142
|
-
return source[key] === void 0 ? target[key] : source[key];
|
|
143
|
-
}
|
|
144
|
-
__name(getValue, "getValue");
|
|
145
|
-
function interpolate2(value, parents = []) {
|
|
146
|
-
if (typeof value !== "string") {
|
|
147
|
-
return value;
|
|
148
|
-
}
|
|
149
|
-
const matches = value.match(/(.?\${?(?:[\w:]+)?}?)/g) || [];
|
|
150
|
-
return parse2(
|
|
151
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
152
|
-
matches.reduce((newValue, match) => {
|
|
153
|
-
const parts = /(.?)\${?([\w:]+)?}?/g.exec(match) || [];
|
|
154
|
-
const prefix = parts[1];
|
|
155
|
-
let value2, replacePart;
|
|
156
|
-
if (prefix === "\\") {
|
|
157
|
-
replacePart = parts[0] || "";
|
|
158
|
-
value2 = replacePart.replace(String.raw`\$`, "$");
|
|
159
|
-
} else {
|
|
160
|
-
const key = parts[2];
|
|
161
|
-
replacePart = (parts[0] || "").slice(prefix.length);
|
|
162
|
-
if (parents.includes(key)) {
|
|
163
|
-
console.warn(
|
|
164
|
-
`Please avoid recursive environment variables ( loop: ${parents.join(
|
|
165
|
-
" > "
|
|
166
|
-
)} > ${key} )`
|
|
167
|
-
);
|
|
168
|
-
return "";
|
|
169
|
-
}
|
|
170
|
-
value2 = getValue(key);
|
|
171
|
-
value2 = interpolate2(value2, [...parents, key]);
|
|
172
|
-
}
|
|
173
|
-
return value2 === void 0 ? newValue : newValue.replace(replacePart, value2);
|
|
174
|
-
}, value)
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
__name(interpolate2, "interpolate2");
|
|
178
|
-
for (const key in target) {
|
|
179
|
-
target[key] = interpolate2(getValue(key));
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
__name(interpolate, "interpolate");
|
|
183
|
-
var _normalize = /* @__PURE__ */ __name((p) => p?.replace(/\\/g, "/"), "_normalize");
|
|
184
|
-
var ASYNC_LOADERS = {
|
|
185
|
-
".yaml": /* @__PURE__ */ __name(() => import("confbox/yaml").then((r) => r.parseYAML), ".yaml"),
|
|
186
|
-
".yml": /* @__PURE__ */ __name(() => import("confbox/yaml").then((r) => r.parseYAML), ".yml"),
|
|
187
|
-
".jsonc": /* @__PURE__ */ __name(() => import("confbox/jsonc").then((r) => r.parseJSONC), ".jsonc"),
|
|
188
|
-
".json5": /* @__PURE__ */ __name(() => import("confbox/json5").then((r) => r.parseJSON5), ".json5"),
|
|
189
|
-
".toml": /* @__PURE__ */ __name(() => import("confbox/toml").then((r) => r.parseTOML), ".toml")
|
|
190
|
-
};
|
|
191
|
-
var SUPPORTED_EXTENSIONS = [
|
|
192
|
-
// with jiti
|
|
193
|
-
".js",
|
|
194
|
-
".ts",
|
|
195
|
-
".mjs",
|
|
196
|
-
".cjs",
|
|
197
|
-
".mts",
|
|
198
|
-
".cts",
|
|
199
|
-
".json",
|
|
200
|
-
// with confbox
|
|
201
|
-
".jsonc",
|
|
202
|
-
".json5",
|
|
203
|
-
".yaml",
|
|
204
|
-
".yml",
|
|
205
|
-
".toml"
|
|
206
|
-
];
|
|
207
|
-
async function loadConfig(options) {
|
|
208
|
-
options.cwd = resolve(process.cwd(), options.cwd || ".");
|
|
209
|
-
options.name = options.name || "config";
|
|
210
|
-
options.envName = options.envName ?? process.env.NODE_ENV;
|
|
211
|
-
options.configFile = options.configFile ?? (options.name === "config" ? "config" : `${options.name}.config`);
|
|
212
|
-
options.rcFile = options.rcFile ?? `.${options.name}rc`;
|
|
213
|
-
if (options.extend !== false) {
|
|
214
|
-
options.extend = {
|
|
215
|
-
extendKey: "extends",
|
|
216
|
-
...options.extend
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
const _merger = options.merger || defu;
|
|
220
|
-
options.jiti = options.jiti || createJiti(join(options.cwd, options.configFile), {
|
|
221
|
-
interopDefault: true,
|
|
222
|
-
moduleCache: false,
|
|
223
|
-
extensions: [...SUPPORTED_EXTENSIONS],
|
|
224
|
-
...options.jitiOptions
|
|
225
|
-
});
|
|
226
|
-
const r = {
|
|
227
|
-
config: {},
|
|
228
|
-
cwd: options.cwd,
|
|
229
|
-
configFile: resolve(options.cwd, options.configFile),
|
|
230
|
-
layers: []
|
|
231
|
-
};
|
|
232
|
-
const _configs = {
|
|
233
|
-
overrides: options.overrides,
|
|
234
|
-
main: void 0,
|
|
235
|
-
rc: void 0,
|
|
236
|
-
packageJson: void 0,
|
|
237
|
-
defaultConfig: options.defaultConfig
|
|
238
|
-
};
|
|
239
|
-
if (options.dotenv) {
|
|
240
|
-
await setupDotenv({
|
|
241
|
-
cwd: options.cwd,
|
|
242
|
-
...options.dotenv === true ? {} : options.dotenv
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
const _mainConfig = await resolveConfig(".", options);
|
|
246
|
-
if (_mainConfig.configFile) {
|
|
247
|
-
_configs.main = _mainConfig.config;
|
|
248
|
-
r.configFile = _mainConfig.configFile;
|
|
249
|
-
}
|
|
250
|
-
if (options.rcFile) {
|
|
251
|
-
const rcSources = [];
|
|
252
|
-
rcSources.push(rc9.read({ name: options.rcFile, dir: options.cwd }));
|
|
253
|
-
if (options.globalRc) {
|
|
254
|
-
const workspaceDir = await findWorkspaceDir(options.cwd).catch(() => {
|
|
255
|
-
});
|
|
256
|
-
if (workspaceDir) {
|
|
257
|
-
rcSources.push(rc9.read({ name: options.rcFile, dir: workspaceDir }));
|
|
258
|
-
}
|
|
259
|
-
rcSources.push(rc9.readUser({ name: options.rcFile, dir: options.cwd }));
|
|
260
|
-
}
|
|
261
|
-
_configs.rc = _merger({}, ...rcSources);
|
|
262
|
-
}
|
|
263
|
-
if (options.packageJson) {
|
|
264
|
-
const keys = (Array.isArray(options.packageJson) ? options.packageJson : [
|
|
265
|
-
typeof options.packageJson === "string" ? options.packageJson : options.name
|
|
266
|
-
]).filter((t) => t && typeof t === "string");
|
|
267
|
-
const pkgJsonFile = await readPackageJSON(options.cwd).catch(() => {
|
|
268
|
-
});
|
|
269
|
-
const values = keys.map((key) => pkgJsonFile?.[key]);
|
|
270
|
-
_configs.packageJson = _merger({}, ...values);
|
|
271
|
-
}
|
|
272
|
-
const configs = {};
|
|
273
|
-
for (const key in _configs) {
|
|
274
|
-
const value = _configs[key];
|
|
275
|
-
configs[key] = await (typeof value === "function" ? value({ configs }) : value);
|
|
276
|
-
}
|
|
277
|
-
r.config = _merger(
|
|
278
|
-
configs.overrides,
|
|
279
|
-
configs.main,
|
|
280
|
-
configs.rc,
|
|
281
|
-
configs.packageJson,
|
|
282
|
-
configs.defaultConfig
|
|
283
|
-
);
|
|
284
|
-
if (options.extend) {
|
|
285
|
-
await extendConfig(r.config, options);
|
|
286
|
-
r.layers = r.config._layers;
|
|
287
|
-
delete r.config._layers;
|
|
288
|
-
r.config = _merger(r.config, ...r.layers.map((e) => e.config));
|
|
289
|
-
}
|
|
290
|
-
const baseLayers = [
|
|
291
|
-
configs.overrides && {
|
|
292
|
-
config: configs.overrides,
|
|
293
|
-
configFile: void 0,
|
|
294
|
-
cwd: void 0
|
|
295
|
-
},
|
|
296
|
-
{ config: configs.main, configFile: options.configFile, cwd: options.cwd },
|
|
297
|
-
configs.rc && { config: configs.rc, configFile: options.rcFile },
|
|
298
|
-
configs.packageJson && {
|
|
299
|
-
config: configs.packageJson,
|
|
300
|
-
configFile: "package.json"
|
|
301
|
-
}
|
|
302
|
-
].filter((l) => l && l.config);
|
|
303
|
-
r.layers = [...baseLayers, ...r.layers];
|
|
304
|
-
if (options.defaults) {
|
|
305
|
-
r.config = _merger(r.config, options.defaults);
|
|
306
|
-
}
|
|
307
|
-
if (options.omit$Keys) {
|
|
308
|
-
for (const key in r.config) {
|
|
309
|
-
if (key.startsWith("$")) {
|
|
310
|
-
delete r.config[key];
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return r;
|
|
315
|
-
}
|
|
316
|
-
__name(loadConfig, "loadConfig");
|
|
317
|
-
async function extendConfig(config, options) {
|
|
318
|
-
config._layers = config._layers || [];
|
|
319
|
-
if (!options.extend) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
let keys = options.extend.extendKey;
|
|
323
|
-
if (typeof keys === "string") {
|
|
324
|
-
keys = [keys];
|
|
325
|
-
}
|
|
326
|
-
const extendSources = [];
|
|
327
|
-
for (const key of keys) {
|
|
328
|
-
extendSources.push(
|
|
329
|
-
...(Array.isArray(config[key]) ? config[key] : [config[key]]).filter(
|
|
330
|
-
Boolean
|
|
331
|
-
)
|
|
332
|
-
);
|
|
333
|
-
delete config[key];
|
|
334
|
-
}
|
|
335
|
-
for (let extendSource of extendSources) {
|
|
336
|
-
const originalExtendSource = extendSource;
|
|
337
|
-
let sourceOptions = {};
|
|
338
|
-
if (extendSource.source) {
|
|
339
|
-
sourceOptions = extendSource.options || {};
|
|
340
|
-
extendSource = extendSource.source;
|
|
341
|
-
}
|
|
342
|
-
if (Array.isArray(extendSource)) {
|
|
343
|
-
sourceOptions = extendSource[1] || {};
|
|
344
|
-
extendSource = extendSource[0];
|
|
345
|
-
}
|
|
346
|
-
if (typeof extendSource !== "string") {
|
|
347
|
-
console.warn(
|
|
348
|
-
`Cannot extend config from \`${JSON.stringify(
|
|
349
|
-
originalExtendSource
|
|
350
|
-
)}\` in ${options.cwd}`
|
|
351
|
-
);
|
|
352
|
-
continue;
|
|
353
|
-
}
|
|
354
|
-
const _config = await resolveConfig(extendSource, options, sourceOptions);
|
|
355
|
-
if (!_config.config) {
|
|
356
|
-
console.warn(
|
|
357
|
-
`Cannot extend config from \`${extendSource}\` in ${options.cwd}`
|
|
358
|
-
);
|
|
359
|
-
continue;
|
|
360
|
-
}
|
|
361
|
-
await extendConfig(_config.config, { ...options, cwd: _config.cwd });
|
|
362
|
-
config._layers.push(_config);
|
|
363
|
-
if (_config.config._layers) {
|
|
364
|
-
config._layers.push(..._config.config._layers);
|
|
365
|
-
delete _config.config._layers;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
__name(extendConfig, "extendConfig");
|
|
370
|
-
var GIGET_PREFIXES = [
|
|
371
|
-
"gh:",
|
|
372
|
-
"github:",
|
|
373
|
-
"gitlab:",
|
|
374
|
-
"bitbucket:",
|
|
375
|
-
"https://",
|
|
376
|
-
"http://"
|
|
377
|
-
];
|
|
378
|
-
var NPM_PACKAGE_RE = /^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/;
|
|
379
|
-
async function resolveConfig(source, options, sourceOptions = {}) {
|
|
380
|
-
if (options.resolve) {
|
|
381
|
-
const res2 = await options.resolve(source, options);
|
|
382
|
-
if (res2) {
|
|
383
|
-
return res2;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
const _merger = options.merger || defu;
|
|
387
|
-
if (options.giget !== false && GIGET_PREFIXES.some((prefix) => source.startsWith(prefix))) {
|
|
388
|
-
const { downloadTemplate } = await import("giget");
|
|
389
|
-
const cloneName = source.replace(/\W+/g, "_").split("_").splice(0, 3).join("_") + "_" + hash(source);
|
|
390
|
-
let cloneDir;
|
|
391
|
-
const localNodeModules = resolve(options.cwd, "node_modules");
|
|
392
|
-
const parentDir = dirname(options.cwd);
|
|
393
|
-
if (basename(parentDir) === ".c12") {
|
|
394
|
-
cloneDir = join(parentDir, cloneName);
|
|
395
|
-
} else if (existsSync(localNodeModules)) {
|
|
396
|
-
cloneDir = join(localNodeModules, ".c12", cloneName);
|
|
397
|
-
} else {
|
|
398
|
-
cloneDir = process.env.XDG_CACHE_HOME ? resolve(process.env.XDG_CACHE_HOME, "c12", cloneName) : resolve(homedir(), ".cache/c12", cloneName);
|
|
399
|
-
}
|
|
400
|
-
if (existsSync(cloneDir) && !sourceOptions.install) {
|
|
401
|
-
await rm(cloneDir, { recursive: true });
|
|
402
|
-
}
|
|
403
|
-
const cloned = await downloadTemplate(source, {
|
|
404
|
-
dir: cloneDir,
|
|
405
|
-
install: sourceOptions.install,
|
|
406
|
-
force: sourceOptions.install,
|
|
407
|
-
auth: sourceOptions.auth,
|
|
408
|
-
...options.giget,
|
|
409
|
-
...sourceOptions.giget
|
|
410
|
-
});
|
|
411
|
-
source = cloned.dir;
|
|
412
|
-
}
|
|
413
|
-
const tryResolve = /* @__PURE__ */ __name((id) => {
|
|
414
|
-
const resolved = options.jiti.esmResolve(id, { try: true });
|
|
415
|
-
return resolved ? fileURLToPath(resolved) : void 0;
|
|
416
|
-
}, "tryResolve");
|
|
417
|
-
if (NPM_PACKAGE_RE.test(source)) {
|
|
418
|
-
source = tryResolve(source) || source;
|
|
419
|
-
}
|
|
420
|
-
const ext = extname(source);
|
|
421
|
-
const isDir = !ext || ext === basename(source);
|
|
422
|
-
const cwd = resolve(options.cwd, isDir ? source : dirname(source));
|
|
423
|
-
if (isDir) {
|
|
424
|
-
source = options.configFile;
|
|
425
|
-
}
|
|
426
|
-
const res = {
|
|
427
|
-
config: void 0,
|
|
428
|
-
configFile: void 0,
|
|
429
|
-
cwd,
|
|
430
|
-
source,
|
|
431
|
-
sourceOptions
|
|
432
|
-
};
|
|
433
|
-
res.configFile = tryResolve(resolve(cwd, source)) || tryResolve(resolve(cwd, ".config", source.replace(/\.config$/, ""))) || tryResolve(resolve(cwd, ".config", source)) || source;
|
|
434
|
-
if (!existsSync(res.configFile)) {
|
|
435
|
-
return res;
|
|
436
|
-
}
|
|
437
|
-
const configFileExt = extname(res.configFile) || "";
|
|
438
|
-
if (configFileExt in ASYNC_LOADERS) {
|
|
439
|
-
const asyncLoader = await ASYNC_LOADERS[configFileExt]();
|
|
440
|
-
const contents = await readFile(res.configFile, "utf8");
|
|
441
|
-
res.config = asyncLoader(contents);
|
|
442
|
-
} else {
|
|
443
|
-
res.config = await options.jiti.import(res.configFile, {
|
|
444
|
-
default: true
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
if (res.config instanceof Function) {
|
|
448
|
-
res.config = await res.config();
|
|
449
|
-
}
|
|
450
|
-
if (options.envName) {
|
|
451
|
-
const envConfig = {
|
|
452
|
-
...res.config["$" + options.envName],
|
|
453
|
-
...res.config.$env?.[options.envName]
|
|
454
|
-
};
|
|
455
|
-
if (Object.keys(envConfig).length > 0) {
|
|
456
|
-
res.config = _merger(envConfig, res.config);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
res.meta = defu(res.sourceOptions.meta, res.config.$meta);
|
|
460
|
-
delete res.config.$meta;
|
|
461
|
-
if (res.sourceOptions.overrides) {
|
|
462
|
-
res.config = _merger(res.sourceOptions.overrides, res.config);
|
|
463
|
-
}
|
|
464
|
-
res.configFile = _normalize(res.configFile);
|
|
465
|
-
res.source = _normalize(res.source);
|
|
466
|
-
return res;
|
|
467
|
-
}
|
|
468
|
-
__name(resolveConfig, "resolveConfig");
|
|
469
|
-
|
|
470
|
-
// ../../node_modules/.pnpm/c12@2.0.1/node_modules/c12/dist/index.mjs
|
|
471
|
-
import { debounce } from "perfect-debounce";
|
|
472
|
-
import { resolve as resolve2 } from "pathe";
|
|
473
|
-
import { diff } from "ohash";
|
|
474
|
-
import "node:fs";
|
|
475
|
-
import "node:fs/promises";
|
|
476
|
-
import "node:os";
|
|
477
|
-
import "jiti";
|
|
478
|
-
import "mlly";
|
|
479
|
-
import "rc9";
|
|
480
|
-
import "pkg-types";
|
|
481
|
-
import "dotenv";
|
|
482
|
-
|
|
483
|
-
// src/config-file/get-config-file.ts
|
|
484
|
-
var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, options = {}) => {
|
|
485
|
-
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
486
|
-
let config = await loadConfig({
|
|
487
|
-
cwd: workspacePath,
|
|
488
|
-
packageJson: true,
|
|
489
|
-
name: fileName,
|
|
490
|
-
envName: fileName?.toUpperCase(),
|
|
491
|
-
jitiOptions: {
|
|
492
|
-
debug: false,
|
|
493
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
494
|
-
},
|
|
495
|
-
...options
|
|
496
|
-
});
|
|
497
|
-
if (!config || Object.keys(config).length === 0) {
|
|
498
|
-
config = await loadConfig({
|
|
499
|
-
cwd: workspacePath,
|
|
500
|
-
packageJson: true,
|
|
501
|
-
name: fileName,
|
|
502
|
-
envName: fileName?.toUpperCase(),
|
|
503
|
-
jitiOptions: {
|
|
504
|
-
debug: false,
|
|
505
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
506
|
-
},
|
|
507
|
-
configFile: fileName,
|
|
508
|
-
...options
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
return config;
|
|
512
|
-
}, "getConfigFileByName");
|
|
513
|
-
var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
|
|
514
|
-
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
515
|
-
const result = await getConfigFileByName("storm", workspacePath);
|
|
516
|
-
let config = result.config;
|
|
517
|
-
const configFile = result.configFile;
|
|
518
|
-
if (config && configFile && Object.keys(config).length > 0) {
|
|
519
|
-
writeSystem(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
520
|
-
logLevel: "all"
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
524
|
-
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
525
|
-
for (const result2 of results) {
|
|
526
|
-
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
527
|
-
writeSystem(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
528
|
-
logLevel: "all"
|
|
529
|
-
});
|
|
530
|
-
config = defu(result2.config ?? {}, config ?? {});
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
if (!config) {
|
|
535
|
-
return void 0;
|
|
536
|
-
}
|
|
537
|
-
config.configFile = configFile;
|
|
538
|
-
return config;
|
|
539
|
-
}, "getConfigFile");
|
|
540
|
-
|
|
541
|
-
export {
|
|
542
|
-
defu,
|
|
543
|
-
getConfigFileByName,
|
|
544
|
-
getConfigFile
|
|
545
|
-
};
|
package/dist/chunk-5EN3BWVN.mjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name,
|
|
3
|
-
init_esm_shims
|
|
4
|
-
} from "./chunk-EVEP57Q3.mjs";
|
|
5
|
-
|
|
6
|
-
// src/utilities/correct-paths.ts
|
|
7
|
-
init_esm_shims();
|
|
8
|
-
import { joinPathFragments } from "@nx/devkit";
|
|
9
|
-
var correctPaths = /* @__PURE__ */ __name((path) => {
|
|
10
|
-
if (!path) {
|
|
11
|
-
return "";
|
|
12
|
-
}
|
|
13
|
-
if (!path.toUpperCase().startsWith("C:") && path.includes("\\")) {
|
|
14
|
-
path = `C:${path}`;
|
|
15
|
-
}
|
|
16
|
-
return path.replaceAll("\\", "/");
|
|
17
|
-
}, "correctPaths");
|
|
18
|
-
var joinPaths = /* @__PURE__ */ __name((...paths) => {
|
|
19
|
-
if (!paths || paths.length === 0) {
|
|
20
|
-
return "";
|
|
21
|
-
}
|
|
22
|
-
return correctPaths(joinPathFragments(...paths.map((path) => correctPaths(path))));
|
|
23
|
-
}, "joinPaths");
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
correctPaths,
|
|
27
|
-
joinPaths
|
|
28
|
-
};
|
package/dist/chunk-6AYXKAF5.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkSEQZA3NMjs = require('./chunk-SEQZA3NM.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkOQLT27Y3js = require('./chunk-OQLT27Y3.js');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _chunkRBSVNX4Wjs = require('./chunk-RBSVNX4W.js');
|
|
11
|
-
|
|
12
|
-
// src/logger/console-icons.ts
|
|
13
|
-
_chunkRBSVNX4Wjs.init_cjs_shims.call(void 0, );
|
|
14
|
-
var useIcon = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (c, fallback) => _chunkSEQZA3NMjs.isUnicodeSupported.call(void 0, ) ? c : fallback, "useIcon");
|
|
15
|
-
var CONSOLE_ICONS = {
|
|
16
|
-
[_chunkOQLT27Y3js.LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
17
|
-
[_chunkOQLT27Y3js.LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
18
|
-
[_chunkOQLT27Y3js.LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
19
|
-
[_chunkOQLT27Y3js.LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
20
|
-
[_chunkOQLT27Y3js.LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
21
|
-
[_chunkOQLT27Y3js.LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
22
|
-
[_chunkOQLT27Y3js.LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
23
|
-
[_chunkOQLT27Y3js.LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
exports.CONSOLE_ICONS = CONSOLE_ICONS;
|