@storm-software/tsup 0.2.243 → 0.2.247
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/{chunk-5A65TKUX.js → chunk-47ZU2HYO.js} +1 -1
- package/dist/{chunk-GBANGFK6.js → chunk-65OUHNDV.js} +2 -5
- package/dist/{chunk-DN7CN2YQ.js → chunk-CYC2JQFZ.js} +1379 -2294
- package/dist/{chunk-47XYLSL2.js → chunk-MMAU3VJM.js} +2 -2
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +2 -2
- package/dist/index.cjs +891 -1809
- package/dist/index.js +16 -16
- package/dist/options.cjs +1427 -2313
- package/dist/options.js +3 -3
- package/dist/rollup.cjs +2186 -878
- package/dist/types.js +2 -2
- package/package.json +18 -18
package/dist/index.cjs
CHANGED
|
@@ -33,16 +33,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
36
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/assets/cjs_shims.js
|
|
37
37
|
var init_cjs_shims = __esm({
|
|
38
|
-
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
38
|
+
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/assets/cjs_shims.js"() {
|
|
39
39
|
"use strict";
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
43
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/chunk-BYH4XDRH.js
|
|
44
44
|
var require_chunk_BYH4XDRH = __commonJS({
|
|
45
|
-
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
45
|
+
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/chunk-BYH4XDRH.js"(exports2) {
|
|
46
46
|
"use strict";
|
|
47
47
|
init_cjs_shims();
|
|
48
48
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -51,9 +51,9 @@ var require_chunk_BYH4XDRH = __commonJS({
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
54
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/chunk-TWFEYLU4.js
|
|
55
55
|
var require_chunk_TWFEYLU4 = __commonJS({
|
|
56
|
-
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
56
|
+
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/chunk-TWFEYLU4.js"(exports2) {
|
|
57
57
|
"use strict";
|
|
58
58
|
init_cjs_shims();
|
|
59
59
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -63,11 +63,11 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
63
63
|
function _optionalChain(ops) {
|
|
64
64
|
let lastAccessLHS = void 0;
|
|
65
65
|
let value = ops[0];
|
|
66
|
-
let
|
|
67
|
-
while (
|
|
68
|
-
const op = ops[
|
|
69
|
-
const fn = ops[
|
|
70
|
-
|
|
66
|
+
let i = 1;
|
|
67
|
+
while (i < ops.length) {
|
|
68
|
+
const op = ops[i];
|
|
69
|
+
const fn = ops[i + 1];
|
|
70
|
+
i += 2;
|
|
71
71
|
if ((op === "optionalAccess" || op === "optionalCall") && value == null) {
|
|
72
72
|
return void 0;
|
|
73
73
|
}
|
|
@@ -87,11 +87,11 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
87
87
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
88
88
|
var __getProtoOf2 = Object.getPrototypeOf;
|
|
89
89
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
90
|
-
var __require = /* @__PURE__ */ ((
|
|
91
|
-
get: (
|
|
92
|
-
}) :
|
|
90
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
91
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
92
|
+
}) : x)(function(x) {
|
|
93
93
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
94
|
-
throw Error('Dynamic require of "' +
|
|
94
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
95
95
|
});
|
|
96
96
|
var __commonJS2 = (cb, mod) => function __require2() {
|
|
97
97
|
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
@@ -121,7 +121,7 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
121
121
|
var singleComment = Symbol("singleComment");
|
|
122
122
|
var multiComment = Symbol("multiComment");
|
|
123
123
|
var stripWithoutWhitespace = () => "";
|
|
124
|
-
var stripWithWhitespace = (
|
|
124
|
+
var stripWithWhitespace = (string2, start, end) => string2.slice(start, end).replace(/\S/g, " ");
|
|
125
125
|
var isEscaped = (jsonString, quotePosition) => {
|
|
126
126
|
let index = quotePosition - 1;
|
|
127
127
|
let backslashCount = 0;
|
|
@@ -212,8 +212,8 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
212
212
|
return localRequire("@microsoft/api-extractor");
|
|
213
213
|
}
|
|
214
214
|
function localRequire(moduleName) {
|
|
215
|
-
const
|
|
216
|
-
return
|
|
215
|
+
const p = _resolvefrom2.default.silent(process.cwd(), moduleName);
|
|
216
|
+
return p && __require(p);
|
|
217
217
|
}
|
|
218
218
|
async function removeFiles(patterns, dir) {
|
|
219
219
|
const files = await _tinyglobby.glob.call(void 0, patterns, {
|
|
@@ -257,26 +257,26 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
257
257
|
function jsoncParse(data) {
|
|
258
258
|
try {
|
|
259
259
|
return new Function(`return ${stripJsonComments(data).trim()}`)();
|
|
260
|
-
} catch (
|
|
260
|
+
} catch (e2) {
|
|
261
261
|
return {};
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
function defaultOutExtension({
|
|
265
|
-
format
|
|
265
|
+
format,
|
|
266
266
|
pkgType
|
|
267
267
|
}) {
|
|
268
268
|
let jsExtension = ".js";
|
|
269
269
|
let dtsExtension = ".d.ts";
|
|
270
270
|
const isModule = pkgType === "module";
|
|
271
|
-
if (isModule &&
|
|
271
|
+
if (isModule && format === "cjs") {
|
|
272
272
|
jsExtension = ".cjs";
|
|
273
273
|
dtsExtension = ".d.cts";
|
|
274
274
|
}
|
|
275
|
-
if (!isModule &&
|
|
275
|
+
if (!isModule && format === "esm") {
|
|
276
276
|
jsExtension = ".mjs";
|
|
277
277
|
dtsExtension = ".d.mts";
|
|
278
278
|
}
|
|
279
|
-
if (
|
|
279
|
+
if (format === "iife") {
|
|
280
280
|
jsExtension = ".global.js";
|
|
281
281
|
}
|
|
282
282
|
return {
|
|
@@ -302,7 +302,7 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
302
302
|
if (!Array.isArray(entry)) {
|
|
303
303
|
return entry;
|
|
304
304
|
}
|
|
305
|
-
entry = entry.map((
|
|
305
|
+
entry = entry.map((e) => e.replace(/\\/g, "/"));
|
|
306
306
|
const ancestor = findLowestCommonAncestor(entry);
|
|
307
307
|
return entry.reduce(
|
|
308
308
|
(result, item) => {
|
|
@@ -334,11 +334,11 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
334
334
|
}
|
|
335
335
|
return ancestor.length <= 1 && ancestor[0] === "" ? `/${ancestor[0]}` : ancestor.join("/");
|
|
336
336
|
};
|
|
337
|
-
function toAbsolutePath(
|
|
338
|
-
if (_path2.default.isAbsolute(
|
|
339
|
-
return
|
|
337
|
+
function toAbsolutePath(p, cwd) {
|
|
338
|
+
if (_path2.default.isAbsolute(p)) {
|
|
339
|
+
return p;
|
|
340
340
|
}
|
|
341
|
-
return slash(_path2.default.normalize(_path2.default.join(cwd || process.cwd(),
|
|
341
|
+
return slash(_path2.default.normalize(_path2.default.join(cwd || process.cwd(), p)));
|
|
342
342
|
}
|
|
343
343
|
function writeFileSync(filePath, content) {
|
|
344
344
|
_fs2.default.mkdirSync(_path2.default.dirname(filePath), { recursive: true });
|
|
@@ -347,7 +347,7 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
347
347
|
function replaceDtsWithJsExtensions(dtsFilePath) {
|
|
348
348
|
return dtsFilePath.replace(
|
|
349
349
|
/\.d\.(ts|mts|cts)$/,
|
|
350
|
-
(
|
|
350
|
+
(_, fileExtension) => {
|
|
351
351
|
switch (fileExtension) {
|
|
352
352
|
case "ts":
|
|
353
353
|
return ".js";
|
|
@@ -380,7 +380,7 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
380
380
|
};
|
|
381
381
|
var resolveExperimentalDtsConfig = async (options2, tsconfig) => {
|
|
382
382
|
const resolvedEntryPaths = await resolveEntryPaths(
|
|
383
|
-
_optionalChain([options2, "access", (
|
|
383
|
+
_optionalChain([options2, "access", (_2) => _2.experimentalDts, "optionalAccess", (_3) => _3.entry]) || options2.entry
|
|
384
384
|
);
|
|
385
385
|
const experimentalDtsObjectEntry = Object.keys(resolvedEntryPaths).length === 0 ? Array.isArray(options2.entry) ? convertArrayEntriesToObjectEntries(options2.entry) : options2.entry : resolvedEntryPaths;
|
|
386
386
|
const normalizedExperimentalDtsConfig = {
|
|
@@ -430,9 +430,9 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
430
430
|
}
|
|
431
431
|
});
|
|
432
432
|
|
|
433
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
433
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/chunk-VGC3FXLU.js
|
|
434
434
|
var require_chunk_VGC3FXLU = __commonJS({
|
|
435
|
-
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
435
|
+
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/chunk-VGC3FXLU.js"(exports2) {
|
|
436
436
|
"use strict";
|
|
437
437
|
init_cjs_shims();
|
|
438
438
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -442,11 +442,11 @@ var require_chunk_VGC3FXLU = __commonJS({
|
|
|
442
442
|
function _optionalChain(ops) {
|
|
443
443
|
let lastAccessLHS = void 0;
|
|
444
444
|
let value = ops[0];
|
|
445
|
-
let
|
|
446
|
-
while (
|
|
447
|
-
const op = ops[
|
|
448
|
-
const fn = ops[
|
|
449
|
-
|
|
445
|
+
let i = 1;
|
|
446
|
+
while (i < ops.length) {
|
|
447
|
+
const op = ops[i];
|
|
448
|
+
const fn = ops[i + 1];
|
|
449
|
+
i += 2;
|
|
450
450
|
if ((op === "optionalAccess" || op === "optionalCall") && value == null) {
|
|
451
451
|
return void 0;
|
|
452
452
|
}
|
|
@@ -600,7 +600,7 @@ var require_chunk_VGC3FXLU = __commonJS({
|
|
|
600
600
|
switch (type) {
|
|
601
601
|
case "error": {
|
|
602
602
|
if (!_worker_threads.isMainThread) {
|
|
603
|
-
_optionalChain([_worker_threads.parentPort, "optionalAccess", (
|
|
603
|
+
_optionalChain([_worker_threads.parentPort, "optionalAccess", (_) => _.postMessage, "call", (_2) => _2({
|
|
604
604
|
type: "error",
|
|
605
605
|
text: _util2.default.format(...args)
|
|
606
606
|
})]);
|
|
@@ -636,12 +636,12 @@ var require_chunk_VGC3FXLU = __commonJS({
|
|
|
636
636
|
var padRight = (str, maxLength) => {
|
|
637
637
|
return str + " ".repeat(maxLength - str.length);
|
|
638
638
|
};
|
|
639
|
-
var reportSize = (logger,
|
|
639
|
+
var reportSize = (logger, format, files) => {
|
|
640
640
|
const filenames = Object.keys(files);
|
|
641
641
|
const maxLength = getLengthOfLongestString(filenames) + 1;
|
|
642
642
|
for (const name of filenames) {
|
|
643
643
|
logger.success(
|
|
644
|
-
|
|
644
|
+
format,
|
|
645
645
|
`${_picocolors2.default.bold(padRight(name, maxLength))}${_picocolors2.default.green(
|
|
646
646
|
prettyBytes(files[name])
|
|
647
647
|
)}`
|
|
@@ -659,9 +659,9 @@ var require_chunk_VGC3FXLU = __commonJS({
|
|
|
659
659
|
}
|
|
660
660
|
});
|
|
661
661
|
|
|
662
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
662
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/chunk-JZ25TPTY.js
|
|
663
663
|
var require_chunk_JZ25TPTY = __commonJS({
|
|
664
|
-
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
664
|
+
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/chunk-JZ25TPTY.js"(exports2) {
|
|
665
665
|
"use strict";
|
|
666
666
|
init_cjs_shims();
|
|
667
667
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -710,9 +710,9 @@ var require_chunk_JZ25TPTY = __commonJS({
|
|
|
710
710
|
}
|
|
711
711
|
});
|
|
712
712
|
|
|
713
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
713
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/commonjs-plugin.js
|
|
714
714
|
var require_commonjs_plugin = __commonJS({
|
|
715
|
-
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
715
|
+
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/commonjs-plugin.js"(exports2, module2) {
|
|
716
716
|
"use strict";
|
|
717
717
|
init_cjs_shims();
|
|
718
718
|
var __defProp2 = Object.defineProperty;
|
|
@@ -812,9 +812,9 @@ var require_commonjs_plugin = __commonJS({
|
|
|
812
812
|
return null;
|
|
813
813
|
default:
|
|
814
814
|
if (ch >= 48 && ch <= 55) {
|
|
815
|
-
let
|
|
816
|
-
if (
|
|
817
|
-
let octalStr =
|
|
815
|
+
let match = this.input.slice(this.pos - 1, this.pos + 2).match(/^[0-7]+/);
|
|
816
|
+
if (match === null) return null;
|
|
817
|
+
let octalStr = match[0];
|
|
818
818
|
let octal = parseInt(octalStr, 8);
|
|
819
819
|
if (octal > 255) {
|
|
820
820
|
octalStr = octalStr.slice(0, -1);
|
|
@@ -832,7 +832,7 @@ var require_commonjs_plugin = __commonJS({
|
|
|
832
832
|
readInt(radix, len) {
|
|
833
833
|
let start = this.pos;
|
|
834
834
|
let total = 0;
|
|
835
|
-
for (let
|
|
835
|
+
for (let i = 0; i < len; ++i, ++this.pos) {
|
|
836
836
|
let code = this.input.charCodeAt(this.pos);
|
|
837
837
|
let val;
|
|
838
838
|
if (code >= 97) {
|
|
@@ -867,15 +867,15 @@ var require_commonjs_plugin = __commonJS({
|
|
|
867
867
|
return code;
|
|
868
868
|
}
|
|
869
869
|
};
|
|
870
|
-
function orderedUniq(
|
|
870
|
+
function orderedUniq(array2) {
|
|
871
871
|
let ret = [], visited = /* @__PURE__ */ new Set();
|
|
872
|
-
for (let val of
|
|
872
|
+
for (let val of array2) if (!visited.has(val)) visited.add(val), ret.push(val);
|
|
873
873
|
return ret;
|
|
874
874
|
}
|
|
875
|
-
function cachedReduce(
|
|
876
|
-
let cache = [
|
|
875
|
+
function cachedReduce(array2, reducer, s) {
|
|
876
|
+
let cache = [s], cacheLen = 1, last = s;
|
|
877
877
|
return (len) => {
|
|
878
|
-
while (cacheLen <= len) cacheLen = cache.push(last = reducer(last,
|
|
878
|
+
while (cacheLen <= len) cacheLen = cache.push(last = reducer(last, array2[cacheLen - 1]));
|
|
879
879
|
return cache[len];
|
|
880
880
|
};
|
|
881
881
|
}
|
|
@@ -884,7 +884,7 @@ var require_commonjs_plugin = __commonJS({
|
|
|
884
884
|
var forbiddenIdentifiers = new Set(`${reservedWords} ${builtin}`.split(" "));
|
|
885
885
|
forbiddenIdentifiers.add("");
|
|
886
886
|
var makeLegalIdentifier = function makeLegalIdentifier2(str) {
|
|
887
|
-
let identifier = str.replace(/-(\w)/g, (
|
|
887
|
+
let identifier = str.replace(/-(\w)/g, (_, letter) => letter.toUpperCase()).replace(/[^$_a-zA-Z0-9]/g, "_");
|
|
888
888
|
if (/\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) {
|
|
889
889
|
identifier = `_${identifier}`;
|
|
890
890
|
}
|
|
@@ -892,8 +892,8 @@ var require_commonjs_plugin = __commonJS({
|
|
|
892
892
|
};
|
|
893
893
|
function prepend(code, prefix) {
|
|
894
894
|
if (code.startsWith("#!")) {
|
|
895
|
-
const
|
|
896
|
-
return code.slice(0,
|
|
895
|
+
const i = code.indexOf("\n") + 1;
|
|
896
|
+
return code.slice(0, i) + prefix + code.slice(i);
|
|
897
897
|
}
|
|
898
898
|
return prefix + code;
|
|
899
899
|
}
|
|
@@ -917,9 +917,9 @@ var require_commonjs_plugin = __commonJS({
|
|
|
917
917
|
onLoad({ filter }, async (args) => {
|
|
918
918
|
let parseCJS;
|
|
919
919
|
if (init_cjs_module_lexer) {
|
|
920
|
-
const { init, parse
|
|
920
|
+
const { init, parse } = await init_cjs_module_lexer;
|
|
921
921
|
await init();
|
|
922
|
-
parseCJS =
|
|
922
|
+
parseCJS = parse;
|
|
923
923
|
}
|
|
924
924
|
let contents;
|
|
925
925
|
try {
|
|
@@ -947,15 +947,15 @@ var require_commonjs_plugin = __commonJS({
|
|
|
947
947
|
exports22 = orderedUniq(cjsExports.exports.concat(exports22 ?? []));
|
|
948
948
|
sideEffects ?? (sideEffects = (transformConfig == null ? void 0 : transformConfig.sideEffects) ?? true);
|
|
949
949
|
let exportDefault = behavior === "node" ? "export default exports;" : "export default exports.__esModule ? exports.default : exports;";
|
|
950
|
-
let exportsMap = exports22.map((
|
|
951
|
-
if (exportsMap.some(([
|
|
950
|
+
let exportsMap = exports22.map((e) => [e, makeLegalIdentifier(e)]);
|
|
951
|
+
if (exportsMap.some(([e]) => e === "default")) {
|
|
952
952
|
if (behavior === "node") {
|
|
953
|
-
exportsMap = exportsMap.filter(([
|
|
953
|
+
exportsMap = exportsMap.filter(([e]) => e !== "default");
|
|
954
954
|
} else {
|
|
955
955
|
exportDefault = "";
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
|
-
let reexports = cjsExports.reexports.map((
|
|
958
|
+
let reexports = cjsExports.reexports.map((e) => `export * from ${JSON.stringify(e)};`).join("");
|
|
959
959
|
let transformed;
|
|
960
960
|
if (sideEffects === false) {
|
|
961
961
|
transformed = [
|
|
@@ -964,11 +964,11 @@ var require_commonjs_plugin = __commonJS({
|
|
|
964
964
|
"return module.exports})((mod = { exports: {} }).exports, mod); " + exportDefault
|
|
965
965
|
];
|
|
966
966
|
if (exportsMap.length > 0) {
|
|
967
|
-
for (const [
|
|
968
|
-
transformed.push(`var ${name} = /* @__PURE__ */ (() => exports[${JSON.stringify(
|
|
967
|
+
for (const [e, name] of exportsMap) {
|
|
968
|
+
transformed.push(`var ${name} = /* @__PURE__ */ (() => exports[${JSON.stringify(e)}])();`);
|
|
969
969
|
}
|
|
970
970
|
transformed.push(
|
|
971
|
-
`export { ${exportsMap.map(([
|
|
971
|
+
`export { ${exportsMap.map(([e, name]) => e === name ? e : `${name} as ${JSON.stringify(e)}`).join(", ")} };`
|
|
972
972
|
);
|
|
973
973
|
}
|
|
974
974
|
} else {
|
|
@@ -978,8 +978,8 @@ var require_commonjs_plugin = __commonJS({
|
|
|
978
978
|
];
|
|
979
979
|
if (exportsMap.length > 0) {
|
|
980
980
|
transformed.push(
|
|
981
|
-
`var { ${exportsMap.map(([
|
|
982
|
-
`export { ${exportsMap.map(([
|
|
981
|
+
`var { ${exportsMap.map(([e, name]) => e === name ? e : `${JSON.stringify(e)}: ${name}`).join(", ")} } = exports;`,
|
|
982
|
+
`export { ${exportsMap.map(([e, name]) => e === name ? e : `${name} as ${JSON.stringify(e)}`).join(", ")} };`
|
|
983
983
|
);
|
|
984
984
|
}
|
|
985
985
|
}
|
|
@@ -1001,14 +1001,14 @@ var require_commonjs_plugin = __commonJS({
|
|
|
1001
1001
|
({ warnings } = err);
|
|
1002
1002
|
}
|
|
1003
1003
|
let lines = contents.split("\n");
|
|
1004
|
-
let getOffset = cachedReduce(lines, (
|
|
1005
|
-
if (warnings && (warnings = warnings.filter((
|
|
1004
|
+
let getOffset = cachedReduce(lines, (a, b) => a + 1 + b.length, 0);
|
|
1005
|
+
if (warnings && (warnings = warnings.filter((e) => e.text.includes('"require" to "esm"'))).length) {
|
|
1006
1006
|
let edits = [];
|
|
1007
1007
|
let imports = [];
|
|
1008
1008
|
for (const { location } of warnings) {
|
|
1009
1009
|
if (location === null) continue;
|
|
1010
|
-
const { line, lineText, column, length:
|
|
1011
|
-
const leftBrace = column +
|
|
1010
|
+
const { line, lineText, column, length: length2 } = location;
|
|
1011
|
+
const leftBrace = column + length2 + 1;
|
|
1012
1012
|
const path2 = lexer.readString(lineText, leftBrace);
|
|
1013
1013
|
if (path2 === null || is_ignored(path2)) continue;
|
|
1014
1014
|
const rightBrace = lineText.indexOf(")", leftBrace + 2 + path2.length) + 1;
|
|
@@ -1041,9 +1041,9 @@ var require_commonjs_plugin = __commonJS({
|
|
|
1041
1041
|
}
|
|
1042
1042
|
});
|
|
1043
1043
|
|
|
1044
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
1044
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/index.js
|
|
1045
1045
|
var require_dist = __commonJS({
|
|
1046
|
-
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
1046
|
+
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__ef1fef24ce052691cc8bddab0b397938/node_modules/tsup/dist/index.js"(exports2) {
|
|
1047
1047
|
"use strict";
|
|
1048
1048
|
init_cjs_shims();
|
|
1049
1049
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -1076,11 +1076,11 @@ var require_dist = __commonJS({
|
|
|
1076
1076
|
function _optionalChain(ops) {
|
|
1077
1077
|
let lastAccessLHS = void 0;
|
|
1078
1078
|
let value = ops[0];
|
|
1079
|
-
let
|
|
1080
|
-
while (
|
|
1081
|
-
const op = ops[
|
|
1082
|
-
const fn = ops[
|
|
1083
|
-
|
|
1079
|
+
let i = 1;
|
|
1080
|
+
while (i < ops.length) {
|
|
1081
|
+
const op = ops[i];
|
|
1082
|
+
const fn = ops[i + 1];
|
|
1083
|
+
i += 2;
|
|
1084
1084
|
if ((op === "optionalAccess" || op === "optionalCall") && value == null) {
|
|
1085
1085
|
return void 0;
|
|
1086
1086
|
}
|
|
@@ -1186,12 +1186,12 @@ var require_dist = __commonJS({
|
|
|
1186
1186
|
setup(build22) {
|
|
1187
1187
|
let configCache;
|
|
1188
1188
|
const getPostcssConfig = async () => {
|
|
1189
|
-
const
|
|
1189
|
+
const loadConfig2 = _chunkTWFEYLU4js.__require.call(void 0, "postcss-load-config");
|
|
1190
1190
|
if (configCache) {
|
|
1191
1191
|
return configCache;
|
|
1192
1192
|
}
|
|
1193
1193
|
try {
|
|
1194
|
-
const result = await
|
|
1194
|
+
const result = await loadConfig2({}, options2.workspaceConfig?.workspaceRoot || process.cwd());
|
|
1195
1195
|
configCache = result;
|
|
1196
1196
|
return result;
|
|
1197
1197
|
} catch (error) {
|
|
@@ -1258,7 +1258,7 @@ var require_dist = __commonJS({
|
|
|
1258
1258
|
]
|
|
1259
1259
|
};
|
|
1260
1260
|
}
|
|
1261
|
-
const result = await _optionalChain([postcss, "optionalAccess", (
|
|
1261
|
+
const result = await _optionalChain([postcss, "optionalAccess", (_2) => _2.default, "call", (_3) => _3(plugins), "access", (_4) => _4.process, "call", (_5) => _5(contents, { ...options3, from: args.path })]);
|
|
1262
1262
|
contents = result.css;
|
|
1263
1263
|
}
|
|
1264
1264
|
if (inject) {
|
|
@@ -1286,7 +1286,7 @@ var require_dist = __commonJS({
|
|
|
1286
1286
|
}
|
|
1287
1287
|
};
|
|
1288
1288
|
};
|
|
1289
|
-
var useSvelteCssExtension = (
|
|
1289
|
+
var useSvelteCssExtension = (p) => p.replace(/\.svelte$/, ".svelte.css");
|
|
1290
1290
|
var sveltePlugin = ({
|
|
1291
1291
|
css,
|
|
1292
1292
|
options: options2
|
|
@@ -1423,10 +1423,10 @@ var require_dist = __commonJS({
|
|
|
1423
1423
|
}
|
|
1424
1424
|
};
|
|
1425
1425
|
};
|
|
1426
|
-
var getOutputExtensionMap = (options2,
|
|
1426
|
+
var getOutputExtensionMap = (options2, format, pkgType) => {
|
|
1427
1427
|
const outExtension = options2.outExtension || _chunkTWFEYLU4js.defaultOutExtension;
|
|
1428
|
-
const defaultExtension = _chunkTWFEYLU4js.defaultOutExtension.call(void 0, { format
|
|
1429
|
-
const extension = outExtension({ options: options2, format
|
|
1428
|
+
const defaultExtension = _chunkTWFEYLU4js.defaultOutExtension.call(void 0, { format, pkgType });
|
|
1429
|
+
const extension = outExtension({ options: options2, format, pkgType });
|
|
1430
1430
|
return {
|
|
1431
1431
|
".js": extension.js || defaultExtension.js
|
|
1432
1432
|
};
|
|
@@ -1445,7 +1445,7 @@ var require_dist = __commonJS({
|
|
|
1445
1445
|
return result;
|
|
1446
1446
|
};
|
|
1447
1447
|
async function runEsbuild(options2, {
|
|
1448
|
-
format
|
|
1448
|
+
format,
|
|
1449
1449
|
css,
|
|
1450
1450
|
logger: logger3,
|
|
1451
1451
|
buildDependencies,
|
|
@@ -1459,43 +1459,43 @@ var require_dist = __commonJS({
|
|
|
1459
1459
|
...await generateExternal(options2.external || [])
|
|
1460
1460
|
];
|
|
1461
1461
|
const outDir = options2.outDir;
|
|
1462
|
-
const outExtension = getOutputExtensionMap(options2,
|
|
1462
|
+
const outExtension = getOutputExtensionMap(options2, format, pkg.type);
|
|
1463
1463
|
const env = {
|
|
1464
1464
|
...options2.env
|
|
1465
1465
|
};
|
|
1466
1466
|
if (options2.replaceNodeEnv) {
|
|
1467
1467
|
env.NODE_ENV = options2.minify || options2.minifyWhitespace ? "production" : "development";
|
|
1468
1468
|
}
|
|
1469
|
-
logger3.info(
|
|
1469
|
+
logger3.info(format, "Build start");
|
|
1470
1470
|
const startTime = Date.now();
|
|
1471
1471
|
let result;
|
|
1472
|
-
const splitting =
|
|
1472
|
+
const splitting = format === "iife" ? false : typeof options2.splitting === "boolean" ? options2.splitting : format === "esm";
|
|
1473
1473
|
const platform = options2.platform || "node";
|
|
1474
1474
|
const loader = options2.loader || {};
|
|
1475
1475
|
const injectShims = options2.shims;
|
|
1476
1476
|
const bundle = typeof options2.bundle === "undefined" ? true : options2.bundle;
|
|
1477
1477
|
pluginContainer.setContext({
|
|
1478
|
-
format
|
|
1478
|
+
format,
|
|
1479
1479
|
splitting,
|
|
1480
1480
|
options: options2,
|
|
1481
1481
|
logger: logger3
|
|
1482
1482
|
});
|
|
1483
1483
|
await pluginContainer.buildStarted();
|
|
1484
1484
|
const esbuildPlugins = [
|
|
1485
|
-
|
|
1486
|
-
|
|
1485
|
+
format === "cjs" && options2.removeNodeProtocol && nodeProtocolPlugin(),
|
|
1486
|
+
format === "esm" && bundle && _commonjsPluginjs.commonjs.call(void 0),
|
|
1487
1487
|
{
|
|
1488
1488
|
name: "modify-options",
|
|
1489
1489
|
setup(build22) {
|
|
1490
1490
|
pluginContainer.modifyEsbuildOptions(build22.initialOptions);
|
|
1491
1491
|
if (options2.esbuildOptions) {
|
|
1492
|
-
options2.esbuildOptions(build22.initialOptions, { format
|
|
1492
|
+
options2.esbuildOptions(build22.initialOptions, { format });
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
},
|
|
1496
1496
|
// esbuild's `external` option doesn't support RegExp
|
|
1497
1497
|
// So here we use a custom plugin to implement it
|
|
1498
|
-
|
|
1498
|
+
format !== "iife" && externalPlugin({
|
|
1499
1499
|
external,
|
|
1500
1500
|
noExternal: options2.noExternal,
|
|
1501
1501
|
skipNodeModulesBundle: options2.skipNodeModulesBundle,
|
|
@@ -1512,12 +1512,12 @@ var require_dist = __commonJS({
|
|
|
1512
1512
|
sveltePlugin({ css, options: options2 }),
|
|
1513
1513
|
...options2.esbuildPlugins || []
|
|
1514
1514
|
];
|
|
1515
|
-
const banner = typeof options2.banner === "function" ? options2.banner({ format
|
|
1516
|
-
const footer = typeof options2.footer === "function" ? options2.footer({ format
|
|
1515
|
+
const banner = typeof options2.banner === "function" ? options2.banner({ format }) : options2.banner;
|
|
1516
|
+
const footer = typeof options2.footer === "function" ? options2.footer({ format }) : options2.footer;
|
|
1517
1517
|
try {
|
|
1518
1518
|
result = await _esbuild.build.call(void 0, {
|
|
1519
1519
|
entryPoints: options2.entry,
|
|
1520
|
-
format:
|
|
1520
|
+
format: format === "cjs" && splitting || options2.treeshake ? "esm" : format,
|
|
1521
1521
|
bundle,
|
|
1522
1522
|
platform,
|
|
1523
1523
|
globalName: options2.globalName,
|
|
@@ -1553,8 +1553,8 @@ var require_dist = __commonJS({
|
|
|
1553
1553
|
mainFields: platform === "node" ? ["module", "main"] : ["browser", "module", "main"],
|
|
1554
1554
|
plugins: esbuildPlugins.filter(_chunkTWFEYLU4js.truthy),
|
|
1555
1555
|
define: {
|
|
1556
|
-
TSUP_FORMAT: JSON.stringify(
|
|
1557
|
-
...
|
|
1556
|
+
TSUP_FORMAT: JSON.stringify(format),
|
|
1557
|
+
...format === "cjs" && injectShims ? {
|
|
1558
1558
|
"import.meta.url": "importMetaUrl"
|
|
1559
1559
|
} : {},
|
|
1560
1560
|
...options2.define,
|
|
@@ -1568,11 +1568,11 @@ var require_dist = __commonJS({
|
|
|
1568
1568
|
}, {})
|
|
1569
1569
|
},
|
|
1570
1570
|
inject: [
|
|
1571
|
-
|
|
1572
|
-
|
|
1571
|
+
format === "cjs" && injectShims ? _path2.default.join(__dirname, "../assets/cjs_shims.js") : "",
|
|
1572
|
+
format === "esm" && injectShims && platform === "node" ? _path2.default.join(__dirname, "../assets/esm_shims.js") : "",
|
|
1573
1573
|
...options2.inject || []
|
|
1574
1574
|
].filter(Boolean),
|
|
1575
|
-
outdir: options2.legacyOutput &&
|
|
1575
|
+
outdir: options2.legacyOutput && format !== "cjs" ? _path2.default.join(outDir, format) : outDir,
|
|
1576
1576
|
outExtension: options2.legacyOutput ? void 0 : outExtension,
|
|
1577
1577
|
write: false,
|
|
1578
1578
|
splitting,
|
|
@@ -1586,7 +1586,7 @@ var require_dist = __commonJS({
|
|
|
1586
1586
|
metafile: true
|
|
1587
1587
|
});
|
|
1588
1588
|
} catch (error) {
|
|
1589
|
-
logger3.error(
|
|
1589
|
+
logger3.error(format, "Build failed");
|
|
1590
1590
|
throw error;
|
|
1591
1591
|
}
|
|
1592
1592
|
if (result && result.warnings && !_chunkVGC3FXLUjs.getSilent.call(void 0)) {
|
|
@@ -1612,14 +1612,14 @@ var require_dist = __commonJS({
|
|
|
1612
1612
|
metafile: result.metafile
|
|
1613
1613
|
});
|
|
1614
1614
|
const timeInMs = Date.now() - startTime;
|
|
1615
|
-
logger3.success(
|
|
1615
|
+
logger3.success(format, `\u26A1\uFE0F Build success in ${Math.floor(timeInMs)}ms`);
|
|
1616
1616
|
}
|
|
1617
1617
|
if (result.metafile) {
|
|
1618
1618
|
for (const file of Object.keys(result.metafile.inputs)) {
|
|
1619
1619
|
buildDependencies.add(file);
|
|
1620
1620
|
}
|
|
1621
1621
|
if (options2.metafile) {
|
|
1622
|
-
const outPath = _path2.default.resolve(outDir, `metafile-${
|
|
1622
|
+
const outPath = _path2.default.resolve(outDir, `metafile-${format}.json`);
|
|
1623
1623
|
await _fs2.default.promises.mkdir(_path2.default.dirname(outPath), { recursive: true });
|
|
1624
1624
|
await _fs2.default.promises.writeFile(
|
|
1625
1625
|
outPath,
|
|
@@ -1632,7 +1632,7 @@ var require_dist = __commonJS({
|
|
|
1632
1632
|
var shebang = () => {
|
|
1633
1633
|
return {
|
|
1634
1634
|
name: "shebang",
|
|
1635
|
-
renderChunk(
|
|
1635
|
+
renderChunk(_, info) {
|
|
1636
1636
|
if (info.type === "chunk" && /\.(cjs|js|mjs)$/.test(info.path) && info.code.startsWith("#!")) {
|
|
1637
1637
|
info.mode = 493;
|
|
1638
1638
|
}
|
|
@@ -1727,7 +1727,7 @@ var require_dist = __commonJS({
|
|
|
1727
1727
|
type: "chunk",
|
|
1728
1728
|
path: file.path,
|
|
1729
1729
|
code: file.text,
|
|
1730
|
-
map: _optionalChain([outputFiles, "access", (_8) => _8.find, "call", (_9) => _9((
|
|
1730
|
+
map: _optionalChain([outputFiles, "access", (_8) => _8.find, "call", (_9) => _9((f) => f.path === `${file.path}.map`), "optionalAccess", (_10) => _10.text]),
|
|
1731
1731
|
entryPoint: _optionalChain([meta, "optionalAccess", (_11) => _11.entryPoint]),
|
|
1732
1732
|
exports: _optionalChain([meta, "optionalAccess", (_12) => _12.exports]),
|
|
1733
1733
|
imports: _optionalChain([meta, "optionalAccess", (_13) => _13.imports])
|
|
@@ -1815,10 +1815,10 @@ var require_dist = __commonJS({
|
|
|
1815
1815
|
if (!map) return "";
|
|
1816
1816
|
const prefix = isCssFile ? "/*" : "//";
|
|
1817
1817
|
const suffix = isCssFile ? " */" : "";
|
|
1818
|
-
const
|
|
1818
|
+
const url2 = inline ? `data:application/json;base64,${Buffer.from(
|
|
1819
1819
|
typeof map === "string" ? map : JSON.stringify(map)
|
|
1820
1820
|
).toString("base64")}` : `${_path2.default.basename(filepath)}.map`;
|
|
1821
|
-
return `${prefix}# sourceMappingURL=${
|
|
1821
|
+
return `${prefix}# sourceMappingURL=${url2}${suffix}`;
|
|
1822
1822
|
};
|
|
1823
1823
|
var TARGETS = ["es5", "es3"];
|
|
1824
1824
|
var swcTarget = () => {
|
|
@@ -1837,13 +1837,13 @@ var require_dist = __commonJS({
|
|
|
1837
1837
|
if (!enabled || !/\.(cjs|mjs|js)$/.test(info.path)) {
|
|
1838
1838
|
return;
|
|
1839
1839
|
}
|
|
1840
|
-
const
|
|
1841
|
-
if (!
|
|
1840
|
+
const swc = _chunkTWFEYLU4js.localRequire.call(void 0, "@swc/core");
|
|
1841
|
+
if (!swc) {
|
|
1842
1842
|
throw new (0, _chunkJZ25TPTYjs.PrettyError)(
|
|
1843
1843
|
`@swc/core is required for ${target} target. Please install it with \`npm install @swc/core -D\``
|
|
1844
1844
|
);
|
|
1845
1845
|
}
|
|
1846
|
-
const result = await
|
|
1846
|
+
const result = await swc.transform(code, {
|
|
1847
1847
|
filename: info.path,
|
|
1848
1848
|
sourceMaps: this.options.sourcemap,
|
|
1849
1849
|
minify: Boolean(this.options.minify),
|
|
@@ -1951,7 +1951,7 @@ var require_dist = __commonJS({
|
|
|
1951
1951
|
};
|
|
1952
1952
|
var terserPlugin = ({
|
|
1953
1953
|
minifyOptions,
|
|
1954
|
-
format
|
|
1954
|
+
format,
|
|
1955
1955
|
terserOptions = {},
|
|
1956
1956
|
globalName,
|
|
1957
1957
|
logger: logger3
|
|
@@ -1968,16 +1968,16 @@ var require_dist = __commonJS({
|
|
|
1968
1968
|
);
|
|
1969
1969
|
}
|
|
1970
1970
|
const { minify } = terser;
|
|
1971
|
-
const
|
|
1972
|
-
if (
|
|
1973
|
-
|
|
1974
|
-
} else if (!(
|
|
1975
|
-
|
|
1971
|
+
const defaultOptions = {};
|
|
1972
|
+
if (format === "esm") {
|
|
1973
|
+
defaultOptions.module = true;
|
|
1974
|
+
} else if (!(format === "iife" && globalName !== void 0)) {
|
|
1975
|
+
defaultOptions.toplevel = true;
|
|
1976
1976
|
}
|
|
1977
1977
|
try {
|
|
1978
1978
|
const minifiedOutput = await minify(
|
|
1979
1979
|
{ [info.path]: code },
|
|
1980
|
-
{ ...
|
|
1980
|
+
{ ...defaultOptions, ...terserOptions }
|
|
1981
1981
|
);
|
|
1982
1982
|
logger3.info("TERSER", "Minifying with Terser");
|
|
1983
1983
|
if (!minifiedOutput.code) {
|
|
@@ -2299,14 +2299,14 @@ ${diagnosticMessage}`
|
|
|
2299
2299
|
);
|
|
2300
2300
|
}
|
|
2301
2301
|
}
|
|
2302
|
-
async function rollupDtsFiles(options2, exports3,
|
|
2302
|
+
async function rollupDtsFiles(options2, exports3, format) {
|
|
2303
2303
|
if (!options2.experimentalDts || !_optionalChain([options2, "access", (_18) => _18.experimentalDts, "optionalAccess", (_19) => _19.entry])) {
|
|
2304
2304
|
return;
|
|
2305
2305
|
}
|
|
2306
2306
|
const declarationDir = _chunkTWFEYLU4js.ensureTempDeclarationDir.call(void 0, options2);
|
|
2307
2307
|
const outDir = options2.outDir || "dist";
|
|
2308
2308
|
const pkg = await _chunkVGC3FXLUjs.loadPkg.call(void 0, options2.workspaceConfig?.workspaceRoot || process.cwd());
|
|
2309
|
-
const dtsExtension = _chunkTWFEYLU4js.defaultOutExtension.call(void 0, { format
|
|
2309
|
+
const dtsExtension = _chunkTWFEYLU4js.defaultOutExtension.call(void 0, { format, pkgType: pkg.type }).dts;
|
|
2310
2310
|
const tsconfig = options2.tsconfig || "tsconfig.json";
|
|
2311
2311
|
let dtsInputFilePath = _path2.default.join(
|
|
2312
2312
|
declarationDir,
|
|
@@ -2351,8 +2351,8 @@ ${diagnosticMessage}`
|
|
|
2351
2351
|
throw new Error("Unexpected internal error: dts exports is not define");
|
|
2352
2352
|
}
|
|
2353
2353
|
await cleanDtsFiles(options2);
|
|
2354
|
-
for (const
|
|
2355
|
-
await rollupDtsFiles(options2, exports3,
|
|
2354
|
+
for (const format of options2.format) {
|
|
2355
|
+
await rollupDtsFiles(options2, exports3, format);
|
|
2356
2356
|
}
|
|
2357
2357
|
logger2.success("dts", `\u26A1\uFE0F Build success in ${getDuration()}`);
|
|
2358
2358
|
} catch (error) {
|
|
@@ -2380,10 +2380,10 @@ module.exports = exports.default;
|
|
|
2380
2380
|
var isTaskkillCmdProcessNotFoundError = (err) => {
|
|
2381
2381
|
return process.platform === "win32" && "cmd" in err && "code" in err && typeof err.cmd === "string" && err.cmd.startsWith("taskkill") && err.code === 128;
|
|
2382
2382
|
};
|
|
2383
|
-
var killProcess = ({ pid, signal }) => new Promise((
|
|
2383
|
+
var killProcess = ({ pid, signal }) => new Promise((resolve, reject) => {
|
|
2384
2384
|
_treekill2.default.call(void 0, pid, signal, (err) => {
|
|
2385
2385
|
if (err && !isTaskkillCmdProcessNotFoundError(err)) return reject(err);
|
|
2386
|
-
|
|
2386
|
+
resolve();
|
|
2387
2387
|
});
|
|
2388
2388
|
});
|
|
2389
2389
|
var normalizeOptions = async (logger3, optionsFromConfigFile, optionsOverride) => {
|
|
@@ -2494,7 +2494,7 @@ module.exports = exports.default;
|
|
|
2494
2494
|
}
|
|
2495
2495
|
await experimentalDtsTask();
|
|
2496
2496
|
if (options2.dts) {
|
|
2497
|
-
await new Promise((
|
|
2497
|
+
await new Promise((resolve, reject) => {
|
|
2498
2498
|
let workerPath = _path2.default.join(__dirname, "./rollup.cjs");
|
|
2499
2499
|
if (!_fs2.default.existsSync(workerPath)) {
|
|
2500
2500
|
workerPath = _path2.default.join(__dirname, "./rollup.js");
|
|
@@ -2526,7 +2526,7 @@ module.exports = exports.default;
|
|
|
2526
2526
|
reject(new Error("error occurred in dts build"));
|
|
2527
2527
|
} else if (data === "success") {
|
|
2528
2528
|
terminateWorker();
|
|
2529
|
-
|
|
2529
|
+
resolve();
|
|
2530
2530
|
} else {
|
|
2531
2531
|
const { type, text } = data;
|
|
2532
2532
|
if (type === "log") {
|
|
@@ -2579,7 +2579,7 @@ module.exports = exports.default;
|
|
|
2579
2579
|
}
|
|
2580
2580
|
const css = /* @__PURE__ */ new Map();
|
|
2581
2581
|
await Promise.all([
|
|
2582
|
-
...options2.format.map(async (
|
|
2582
|
+
...options2.format.map(async (format, index) => {
|
|
2583
2583
|
const pluginContainer = new PluginContainer([
|
|
2584
2584
|
shebang(),
|
|
2585
2585
|
...options2.plugins || [],
|
|
@@ -2594,7 +2594,7 @@ module.exports = exports.default;
|
|
|
2594
2594
|
sizeReporter(),
|
|
2595
2595
|
terserPlugin({
|
|
2596
2596
|
minifyOptions: options2.minify,
|
|
2597
|
-
format
|
|
2597
|
+
format,
|
|
2598
2598
|
terserOptions: options2.terserOptions,
|
|
2599
2599
|
globalName: options2.globalName,
|
|
2600
2600
|
logger: logger3
|
|
@@ -2602,7 +2602,7 @@ module.exports = exports.default;
|
|
|
2602
2602
|
]);
|
|
2603
2603
|
await runEsbuild(options2, {
|
|
2604
2604
|
pluginContainer,
|
|
2605
|
-
format
|
|
2605
|
+
format,
|
|
2606
2606
|
css: index === 0 || options2.injectStyle ? css : void 0,
|
|
2607
2607
|
logger: logger3,
|
|
2608
2608
|
buildDependencies
|
|
@@ -2650,7 +2650,7 @@ module.exports = exports.default;
|
|
|
2650
2650
|
const watcher = watch(await _tinyglobby.glob.call(void 0, watchPaths), {
|
|
2651
2651
|
ignoreInitial: true,
|
|
2652
2652
|
ignorePermissionErrors: true,
|
|
2653
|
-
ignored: (
|
|
2653
|
+
ignored: (p) => _tinyglobby.globSync.call(void 0, p, { ignore: ignored }).length === 0
|
|
2654
2654
|
});
|
|
2655
2655
|
watcher.on("all", async (type, file) => {
|
|
2656
2656
|
file = _chunkTWFEYLU4js.slash.call(void 0, file);
|
|
@@ -2702,13 +2702,38 @@ __export(index_exports, {
|
|
|
2702
2702
|
module.exports = __toCommonJS(index_exports);
|
|
2703
2703
|
init_cjs_shims();
|
|
2704
2704
|
|
|
2705
|
-
// ../config-tools/
|
|
2705
|
+
// ../config-tools/src/logger/console.ts
|
|
2706
2706
|
init_cjs_shims();
|
|
2707
|
+
var import_formatDistanceToNow = require("date-fns/formatDistanceToNow");
|
|
2707
2708
|
|
|
2708
|
-
// ../config-tools/
|
|
2709
|
+
// ../config-tools/src/types.ts
|
|
2709
2710
|
init_cjs_shims();
|
|
2711
|
+
var LogLevel = {
|
|
2712
|
+
SILENT: 0,
|
|
2713
|
+
FATAL: 10,
|
|
2714
|
+
ERROR: 20,
|
|
2715
|
+
WARN: 30,
|
|
2716
|
+
SUCCESS: 35,
|
|
2717
|
+
INFO: 40,
|
|
2718
|
+
PERFORMANCE: 50,
|
|
2719
|
+
DEBUG: 60,
|
|
2720
|
+
TRACE: 70,
|
|
2721
|
+
ALL: 100
|
|
2722
|
+
};
|
|
2723
|
+
var LogLevelLabel = {
|
|
2724
|
+
SILENT: "silent",
|
|
2725
|
+
FATAL: "fatal",
|
|
2726
|
+
ERROR: "error",
|
|
2727
|
+
WARN: "warn",
|
|
2728
|
+
SUCCESS: "success",
|
|
2729
|
+
INFO: "info",
|
|
2730
|
+
PERFORMANCE: "performance",
|
|
2731
|
+
DEBUG: "debug",
|
|
2732
|
+
TRACE: "trace",
|
|
2733
|
+
ALL: "all"
|
|
2734
|
+
};
|
|
2710
2735
|
|
|
2711
|
-
// ../config-tools/
|
|
2736
|
+
// ../config-tools/src/utilities/colors.ts
|
|
2712
2737
|
init_cjs_shims();
|
|
2713
2738
|
var DEFAULT_COLOR_CONFIG = {
|
|
2714
2739
|
light: {
|
|
@@ -2749,12 +2774,12 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
2749
2774
|
}
|
|
2750
2775
|
};
|
|
2751
2776
|
|
|
2752
|
-
// ../config-tools/
|
|
2777
|
+
// ../config-tools/src/logger/chalk.ts
|
|
2753
2778
|
init_cjs_shims();
|
|
2754
2779
|
var import_chalk = __toESM(require("chalk"), 1);
|
|
2755
2780
|
var chalkDefault = {
|
|
2756
|
-
hex: (
|
|
2757
|
-
bgHex: (
|
|
2781
|
+
hex: (_) => (message) => message,
|
|
2782
|
+
bgHex: (_) => ({
|
|
2758
2783
|
whiteBright: (message) => message,
|
|
2759
2784
|
white: (message) => message
|
|
2760
2785
|
}),
|
|
@@ -2762,8 +2787,8 @@ var chalkDefault = {
|
|
|
2762
2787
|
whiteBright: (message) => message,
|
|
2763
2788
|
gray: (message) => message,
|
|
2764
2789
|
bold: {
|
|
2765
|
-
hex: (
|
|
2766
|
-
bgHex: (
|
|
2790
|
+
hex: (_) => (message) => message,
|
|
2791
|
+
bgHex: (_) => ({
|
|
2767
2792
|
whiteBright: (message) => message,
|
|
2768
2793
|
white: (message) => message
|
|
2769
2794
|
}),
|
|
@@ -2771,7 +2796,7 @@ var chalkDefault = {
|
|
|
2771
2796
|
white: (message) => message
|
|
2772
2797
|
},
|
|
2773
2798
|
dim: {
|
|
2774
|
-
hex: (
|
|
2799
|
+
hex: (_) => (message) => message,
|
|
2775
2800
|
gray: (message) => message
|
|
2776
2801
|
}
|
|
2777
2802
|
};
|
|
@@ -2783,10 +2808,10 @@ var getChalk = () => {
|
|
|
2783
2808
|
return _chalk;
|
|
2784
2809
|
};
|
|
2785
2810
|
|
|
2786
|
-
// ../config-tools/
|
|
2811
|
+
// ../config-tools/src/logger/console-icons.ts
|
|
2787
2812
|
init_cjs_shims();
|
|
2788
2813
|
|
|
2789
|
-
// ../config-tools/
|
|
2814
|
+
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
2790
2815
|
init_cjs_shims();
|
|
2791
2816
|
function isUnicodeSupported() {
|
|
2792
2817
|
if (process.platform !== "win32") {
|
|
@@ -2798,35 +2823,8 @@ function isUnicodeSupported() {
|
|
|
2798
2823
|
process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
2799
2824
|
}
|
|
2800
2825
|
|
|
2801
|
-
// ../config-tools/
|
|
2802
|
-
|
|
2803
|
-
var LogLevel = {
|
|
2804
|
-
SILENT: 0,
|
|
2805
|
-
FATAL: 10,
|
|
2806
|
-
ERROR: 20,
|
|
2807
|
-
WARN: 30,
|
|
2808
|
-
SUCCESS: 35,
|
|
2809
|
-
INFO: 40,
|
|
2810
|
-
PERFORMANCE: 50,
|
|
2811
|
-
DEBUG: 60,
|
|
2812
|
-
TRACE: 70,
|
|
2813
|
-
ALL: 100
|
|
2814
|
-
};
|
|
2815
|
-
var LogLevelLabel = {
|
|
2816
|
-
SILENT: "silent",
|
|
2817
|
-
FATAL: "fatal",
|
|
2818
|
-
ERROR: "error",
|
|
2819
|
-
WARN: "warn",
|
|
2820
|
-
SUCCESS: "success",
|
|
2821
|
-
INFO: "info",
|
|
2822
|
-
PERFORMANCE: "performance",
|
|
2823
|
-
DEBUG: "debug",
|
|
2824
|
-
TRACE: "trace",
|
|
2825
|
-
ALL: "all"
|
|
2826
|
-
};
|
|
2827
|
-
|
|
2828
|
-
// ../config-tools/dist/chunk-ZFNAUMQS.js
|
|
2829
|
-
var useIcon = (c3, fallback) => isUnicodeSupported() ? c3 : fallback;
|
|
2826
|
+
// ../config-tools/src/logger/console-icons.ts
|
|
2827
|
+
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
2830
2828
|
var CONSOLE_ICONS = {
|
|
2831
2829
|
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
2832
2830
|
[LogLevelLabel.FATAL]: useIcon("\u{1F571}", "\xD7"),
|
|
@@ -2839,13 +2837,13 @@ var CONSOLE_ICONS = {
|
|
|
2839
2837
|
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
2840
2838
|
};
|
|
2841
2839
|
|
|
2842
|
-
// ../config-tools/
|
|
2840
|
+
// ../config-tools/src/logger/format-timestamp.ts
|
|
2843
2841
|
init_cjs_shims();
|
|
2844
2842
|
var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
|
|
2845
2843
|
return fullDateTime ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` : `${date.toLocaleTimeString()}`;
|
|
2846
2844
|
};
|
|
2847
2845
|
|
|
2848
|
-
// ../config-tools/
|
|
2846
|
+
// ../config-tools/src/logger/get-log-level.ts
|
|
2849
2847
|
init_cjs_shims();
|
|
2850
2848
|
var getLogLevel = (label) => {
|
|
2851
2849
|
switch (label) {
|
|
@@ -2902,691 +2900,7 @@ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
|
2902
2900
|
return LogLevelLabel.INFO;
|
|
2903
2901
|
};
|
|
2904
2902
|
|
|
2905
|
-
// ../config-tools/
|
|
2906
|
-
var daysInYear = 365.2425;
|
|
2907
|
-
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
|
|
2908
|
-
var minTime = -maxTime;
|
|
2909
|
-
var minutesInMonth = 43200;
|
|
2910
|
-
var minutesInDay = 1440;
|
|
2911
|
-
var secondsInHour = 3600;
|
|
2912
|
-
var secondsInDay = secondsInHour * 24;
|
|
2913
|
-
var secondsInWeek = secondsInDay * 7;
|
|
2914
|
-
var secondsInYear = secondsInDay * daysInYear;
|
|
2915
|
-
var secondsInMonth = secondsInYear / 12;
|
|
2916
|
-
var secondsInQuarter = secondsInMonth * 3;
|
|
2917
|
-
var constructFromSymbol = Symbol.for("constructDateFrom");
|
|
2918
|
-
function constructFrom(date, value) {
|
|
2919
|
-
if (typeof date === "function") return date(value);
|
|
2920
|
-
if (date && typeof date === "object" && constructFromSymbol in date)
|
|
2921
|
-
return date[constructFromSymbol](value);
|
|
2922
|
-
if (date instanceof Date) return new date.constructor(value);
|
|
2923
|
-
return new Date(value);
|
|
2924
|
-
}
|
|
2925
|
-
function constructNow(date) {
|
|
2926
|
-
return constructFrom(date, Date.now());
|
|
2927
|
-
}
|
|
2928
|
-
var formatDistanceLocale = {
|
|
2929
|
-
lessThanXSeconds: {
|
|
2930
|
-
one: "less than a second",
|
|
2931
|
-
other: "less than {{count}} seconds"
|
|
2932
|
-
},
|
|
2933
|
-
xSeconds: {
|
|
2934
|
-
one: "1 second",
|
|
2935
|
-
other: "{{count}} seconds"
|
|
2936
|
-
},
|
|
2937
|
-
halfAMinute: "half a minute",
|
|
2938
|
-
lessThanXMinutes: {
|
|
2939
|
-
one: "less than a minute",
|
|
2940
|
-
other: "less than {{count}} minutes"
|
|
2941
|
-
},
|
|
2942
|
-
xMinutes: {
|
|
2943
|
-
one: "1 minute",
|
|
2944
|
-
other: "{{count}} minutes"
|
|
2945
|
-
},
|
|
2946
|
-
aboutXHours: {
|
|
2947
|
-
one: "about 1 hour",
|
|
2948
|
-
other: "about {{count}} hours"
|
|
2949
|
-
},
|
|
2950
|
-
xHours: {
|
|
2951
|
-
one: "1 hour",
|
|
2952
|
-
other: "{{count}} hours"
|
|
2953
|
-
},
|
|
2954
|
-
xDays: {
|
|
2955
|
-
one: "1 day",
|
|
2956
|
-
other: "{{count}} days"
|
|
2957
|
-
},
|
|
2958
|
-
aboutXWeeks: {
|
|
2959
|
-
one: "about 1 week",
|
|
2960
|
-
other: "about {{count}} weeks"
|
|
2961
|
-
},
|
|
2962
|
-
xWeeks: {
|
|
2963
|
-
one: "1 week",
|
|
2964
|
-
other: "{{count}} weeks"
|
|
2965
|
-
},
|
|
2966
|
-
aboutXMonths: {
|
|
2967
|
-
one: "about 1 month",
|
|
2968
|
-
other: "about {{count}} months"
|
|
2969
|
-
},
|
|
2970
|
-
xMonths: {
|
|
2971
|
-
one: "1 month",
|
|
2972
|
-
other: "{{count}} months"
|
|
2973
|
-
},
|
|
2974
|
-
aboutXYears: {
|
|
2975
|
-
one: "about 1 year",
|
|
2976
|
-
other: "about {{count}} years"
|
|
2977
|
-
},
|
|
2978
|
-
xYears: {
|
|
2979
|
-
one: "1 year",
|
|
2980
|
-
other: "{{count}} years"
|
|
2981
|
-
},
|
|
2982
|
-
overXYears: {
|
|
2983
|
-
one: "over 1 year",
|
|
2984
|
-
other: "over {{count}} years"
|
|
2985
|
-
},
|
|
2986
|
-
almostXYears: {
|
|
2987
|
-
one: "almost 1 year",
|
|
2988
|
-
other: "almost {{count}} years"
|
|
2989
|
-
}
|
|
2990
|
-
};
|
|
2991
|
-
var formatDistance = (token, count, options2) => {
|
|
2992
|
-
let result;
|
|
2993
|
-
const tokenValue = formatDistanceLocale[token];
|
|
2994
|
-
if (typeof tokenValue === "string") {
|
|
2995
|
-
result = tokenValue;
|
|
2996
|
-
} else if (count === 1) {
|
|
2997
|
-
result = tokenValue.one;
|
|
2998
|
-
} else {
|
|
2999
|
-
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
3000
|
-
}
|
|
3001
|
-
if (options2?.addSuffix) {
|
|
3002
|
-
if (options2.comparison && options2.comparison > 0) {
|
|
3003
|
-
return "in " + result;
|
|
3004
|
-
} else {
|
|
3005
|
-
return result + " ago";
|
|
3006
|
-
}
|
|
3007
|
-
}
|
|
3008
|
-
return result;
|
|
3009
|
-
};
|
|
3010
|
-
function buildFormatLongFn(args) {
|
|
3011
|
-
return (options2 = {}) => {
|
|
3012
|
-
const width = options2.width ? String(options2.width) : args.defaultWidth;
|
|
3013
|
-
const format2 = args.formats[width] || args.formats[args.defaultWidth];
|
|
3014
|
-
return format2;
|
|
3015
|
-
};
|
|
3016
|
-
}
|
|
3017
|
-
var dateFormats = {
|
|
3018
|
-
full: "EEEE, MMMM do, y",
|
|
3019
|
-
long: "MMMM do, y",
|
|
3020
|
-
medium: "MMM d, y",
|
|
3021
|
-
short: "MM/dd/yyyy"
|
|
3022
|
-
};
|
|
3023
|
-
var timeFormats = {
|
|
3024
|
-
full: "h:mm:ss a zzzz",
|
|
3025
|
-
long: "h:mm:ss a z",
|
|
3026
|
-
medium: "h:mm:ss a",
|
|
3027
|
-
short: "h:mm a"
|
|
3028
|
-
};
|
|
3029
|
-
var dateTimeFormats = {
|
|
3030
|
-
full: "{{date}} 'at' {{time}}",
|
|
3031
|
-
long: "{{date}} 'at' {{time}}",
|
|
3032
|
-
medium: "{{date}}, {{time}}",
|
|
3033
|
-
short: "{{date}}, {{time}}"
|
|
3034
|
-
};
|
|
3035
|
-
var formatLong = {
|
|
3036
|
-
date: buildFormatLongFn({
|
|
3037
|
-
formats: dateFormats,
|
|
3038
|
-
defaultWidth: "full"
|
|
3039
|
-
}),
|
|
3040
|
-
time: buildFormatLongFn({
|
|
3041
|
-
formats: timeFormats,
|
|
3042
|
-
defaultWidth: "full"
|
|
3043
|
-
}),
|
|
3044
|
-
dateTime: buildFormatLongFn({
|
|
3045
|
-
formats: dateTimeFormats,
|
|
3046
|
-
defaultWidth: "full"
|
|
3047
|
-
})
|
|
3048
|
-
};
|
|
3049
|
-
var formatRelativeLocale = {
|
|
3050
|
-
lastWeek: "'last' eeee 'at' p",
|
|
3051
|
-
yesterday: "'yesterday at' p",
|
|
3052
|
-
today: "'today at' p",
|
|
3053
|
-
tomorrow: "'tomorrow at' p",
|
|
3054
|
-
nextWeek: "eeee 'at' p",
|
|
3055
|
-
other: "P"
|
|
3056
|
-
};
|
|
3057
|
-
var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
|
|
3058
|
-
function buildLocalizeFn(args) {
|
|
3059
|
-
return (value, options2) => {
|
|
3060
|
-
const context = options2?.context ? String(options2.context) : "standalone";
|
|
3061
|
-
let valuesArray;
|
|
3062
|
-
if (context === "formatting" && args.formattingValues) {
|
|
3063
|
-
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
3064
|
-
const width = options2?.width ? String(options2.width) : defaultWidth;
|
|
3065
|
-
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
3066
|
-
} else {
|
|
3067
|
-
const defaultWidth = args.defaultWidth;
|
|
3068
|
-
const width = options2?.width ? String(options2.width) : args.defaultWidth;
|
|
3069
|
-
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
3070
|
-
}
|
|
3071
|
-
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
3072
|
-
return valuesArray[index];
|
|
3073
|
-
};
|
|
3074
|
-
}
|
|
3075
|
-
var eraValues = {
|
|
3076
|
-
narrow: ["B", "A"],
|
|
3077
|
-
abbreviated: ["BC", "AD"],
|
|
3078
|
-
wide: ["Before Christ", "Anno Domini"]
|
|
3079
|
-
};
|
|
3080
|
-
var quarterValues = {
|
|
3081
|
-
narrow: ["1", "2", "3", "4"],
|
|
3082
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
3083
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
3084
|
-
};
|
|
3085
|
-
var monthValues = {
|
|
3086
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
3087
|
-
abbreviated: [
|
|
3088
|
-
"Jan",
|
|
3089
|
-
"Feb",
|
|
3090
|
-
"Mar",
|
|
3091
|
-
"Apr",
|
|
3092
|
-
"May",
|
|
3093
|
-
"Jun",
|
|
3094
|
-
"Jul",
|
|
3095
|
-
"Aug",
|
|
3096
|
-
"Sep",
|
|
3097
|
-
"Oct",
|
|
3098
|
-
"Nov",
|
|
3099
|
-
"Dec"
|
|
3100
|
-
],
|
|
3101
|
-
wide: [
|
|
3102
|
-
"January",
|
|
3103
|
-
"February",
|
|
3104
|
-
"March",
|
|
3105
|
-
"April",
|
|
3106
|
-
"May",
|
|
3107
|
-
"June",
|
|
3108
|
-
"July",
|
|
3109
|
-
"August",
|
|
3110
|
-
"September",
|
|
3111
|
-
"October",
|
|
3112
|
-
"November",
|
|
3113
|
-
"December"
|
|
3114
|
-
]
|
|
3115
|
-
};
|
|
3116
|
-
var dayValues = {
|
|
3117
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
3118
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
3119
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
3120
|
-
wide: [
|
|
3121
|
-
"Sunday",
|
|
3122
|
-
"Monday",
|
|
3123
|
-
"Tuesday",
|
|
3124
|
-
"Wednesday",
|
|
3125
|
-
"Thursday",
|
|
3126
|
-
"Friday",
|
|
3127
|
-
"Saturday"
|
|
3128
|
-
]
|
|
3129
|
-
};
|
|
3130
|
-
var dayPeriodValues = {
|
|
3131
|
-
narrow: {
|
|
3132
|
-
am: "a",
|
|
3133
|
-
pm: "p",
|
|
3134
|
-
midnight: "mi",
|
|
3135
|
-
noon: "n",
|
|
3136
|
-
morning: "morning",
|
|
3137
|
-
afternoon: "afternoon",
|
|
3138
|
-
evening: "evening",
|
|
3139
|
-
night: "night"
|
|
3140
|
-
},
|
|
3141
|
-
abbreviated: {
|
|
3142
|
-
am: "AM",
|
|
3143
|
-
pm: "PM",
|
|
3144
|
-
midnight: "midnight",
|
|
3145
|
-
noon: "noon",
|
|
3146
|
-
morning: "morning",
|
|
3147
|
-
afternoon: "afternoon",
|
|
3148
|
-
evening: "evening",
|
|
3149
|
-
night: "night"
|
|
3150
|
-
},
|
|
3151
|
-
wide: {
|
|
3152
|
-
am: "a.m.",
|
|
3153
|
-
pm: "p.m.",
|
|
3154
|
-
midnight: "midnight",
|
|
3155
|
-
noon: "noon",
|
|
3156
|
-
morning: "morning",
|
|
3157
|
-
afternoon: "afternoon",
|
|
3158
|
-
evening: "evening",
|
|
3159
|
-
night: "night"
|
|
3160
|
-
}
|
|
3161
|
-
};
|
|
3162
|
-
var formattingDayPeriodValues = {
|
|
3163
|
-
narrow: {
|
|
3164
|
-
am: "a",
|
|
3165
|
-
pm: "p",
|
|
3166
|
-
midnight: "mi",
|
|
3167
|
-
noon: "n",
|
|
3168
|
-
morning: "in the morning",
|
|
3169
|
-
afternoon: "in the afternoon",
|
|
3170
|
-
evening: "in the evening",
|
|
3171
|
-
night: "at night"
|
|
3172
|
-
},
|
|
3173
|
-
abbreviated: {
|
|
3174
|
-
am: "AM",
|
|
3175
|
-
pm: "PM",
|
|
3176
|
-
midnight: "midnight",
|
|
3177
|
-
noon: "noon",
|
|
3178
|
-
morning: "in the morning",
|
|
3179
|
-
afternoon: "in the afternoon",
|
|
3180
|
-
evening: "in the evening",
|
|
3181
|
-
night: "at night"
|
|
3182
|
-
},
|
|
3183
|
-
wide: {
|
|
3184
|
-
am: "a.m.",
|
|
3185
|
-
pm: "p.m.",
|
|
3186
|
-
midnight: "midnight",
|
|
3187
|
-
noon: "noon",
|
|
3188
|
-
morning: "in the morning",
|
|
3189
|
-
afternoon: "in the afternoon",
|
|
3190
|
-
evening: "in the evening",
|
|
3191
|
-
night: "at night"
|
|
3192
|
-
}
|
|
3193
|
-
};
|
|
3194
|
-
var ordinalNumber = (dirtyNumber, _options) => {
|
|
3195
|
-
const number = Number(dirtyNumber);
|
|
3196
|
-
const rem100 = number % 100;
|
|
3197
|
-
if (rem100 > 20 || rem100 < 10) {
|
|
3198
|
-
switch (rem100 % 10) {
|
|
3199
|
-
case 1:
|
|
3200
|
-
return number + "st";
|
|
3201
|
-
case 2:
|
|
3202
|
-
return number + "nd";
|
|
3203
|
-
case 3:
|
|
3204
|
-
return number + "rd";
|
|
3205
|
-
}
|
|
3206
|
-
}
|
|
3207
|
-
return number + "th";
|
|
3208
|
-
};
|
|
3209
|
-
var localize = {
|
|
3210
|
-
ordinalNumber,
|
|
3211
|
-
era: buildLocalizeFn({
|
|
3212
|
-
values: eraValues,
|
|
3213
|
-
defaultWidth: "wide"
|
|
3214
|
-
}),
|
|
3215
|
-
quarter: buildLocalizeFn({
|
|
3216
|
-
values: quarterValues,
|
|
3217
|
-
defaultWidth: "wide",
|
|
3218
|
-
argumentCallback: (quarter) => quarter - 1
|
|
3219
|
-
}),
|
|
3220
|
-
month: buildLocalizeFn({
|
|
3221
|
-
values: monthValues,
|
|
3222
|
-
defaultWidth: "wide"
|
|
3223
|
-
}),
|
|
3224
|
-
day: buildLocalizeFn({
|
|
3225
|
-
values: dayValues,
|
|
3226
|
-
defaultWidth: "wide"
|
|
3227
|
-
}),
|
|
3228
|
-
dayPeriod: buildLocalizeFn({
|
|
3229
|
-
values: dayPeriodValues,
|
|
3230
|
-
defaultWidth: "wide",
|
|
3231
|
-
formattingValues: formattingDayPeriodValues,
|
|
3232
|
-
defaultFormattingWidth: "wide"
|
|
3233
|
-
})
|
|
3234
|
-
};
|
|
3235
|
-
function buildMatchFn(args) {
|
|
3236
|
-
return (string3, options2 = {}) => {
|
|
3237
|
-
const width = options2.width;
|
|
3238
|
-
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
3239
|
-
const matchResult = string3.match(matchPattern);
|
|
3240
|
-
if (!matchResult) {
|
|
3241
|
-
return null;
|
|
3242
|
-
}
|
|
3243
|
-
const matchedString = matchResult[0];
|
|
3244
|
-
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
3245
|
-
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
|
3246
|
-
// [TODO] -- I challenge you to fix the type
|
|
3247
|
-
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
3248
|
-
);
|
|
3249
|
-
let value;
|
|
3250
|
-
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
3251
|
-
value = options2.valueCallback ? (
|
|
3252
|
-
// [TODO] -- I challenge you to fix the type
|
|
3253
|
-
options2.valueCallback(value)
|
|
3254
|
-
) : value;
|
|
3255
|
-
const rest = string3.slice(matchedString.length);
|
|
3256
|
-
return { value, rest };
|
|
3257
|
-
};
|
|
3258
|
-
}
|
|
3259
|
-
function findKey(object3, predicate) {
|
|
3260
|
-
for (const key in object3) {
|
|
3261
|
-
if (Object.prototype.hasOwnProperty.call(object3, key) && predicate(object3[key])) {
|
|
3262
|
-
return key;
|
|
3263
|
-
}
|
|
3264
|
-
}
|
|
3265
|
-
return void 0;
|
|
3266
|
-
}
|
|
3267
|
-
function findIndex(array3, predicate) {
|
|
3268
|
-
for (let key = 0; key < array3.length; key++) {
|
|
3269
|
-
if (predicate(array3[key])) {
|
|
3270
|
-
return key;
|
|
3271
|
-
}
|
|
3272
|
-
}
|
|
3273
|
-
return void 0;
|
|
3274
|
-
}
|
|
3275
|
-
function buildMatchPatternFn(args) {
|
|
3276
|
-
return (string3, options2 = {}) => {
|
|
3277
|
-
const matchResult = string3.match(args.matchPattern);
|
|
3278
|
-
if (!matchResult) return null;
|
|
3279
|
-
const matchedString = matchResult[0];
|
|
3280
|
-
const parseResult = string3.match(args.parsePattern);
|
|
3281
|
-
if (!parseResult) return null;
|
|
3282
|
-
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
3283
|
-
value = options2.valueCallback ? options2.valueCallback(value) : value;
|
|
3284
|
-
const rest = string3.slice(matchedString.length);
|
|
3285
|
-
return { value, rest };
|
|
3286
|
-
};
|
|
3287
|
-
}
|
|
3288
|
-
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
3289
|
-
var parseOrdinalNumberPattern = /\d+/i;
|
|
3290
|
-
var matchEraPatterns = {
|
|
3291
|
-
narrow: /^(b|a)/i,
|
|
3292
|
-
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
3293
|
-
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
3294
|
-
};
|
|
3295
|
-
var parseEraPatterns = {
|
|
3296
|
-
any: [/^b/i, /^(a|c)/i]
|
|
3297
|
-
};
|
|
3298
|
-
var matchQuarterPatterns = {
|
|
3299
|
-
narrow: /^[1234]/i,
|
|
3300
|
-
abbreviated: /^q[1234]/i,
|
|
3301
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
3302
|
-
};
|
|
3303
|
-
var parseQuarterPatterns = {
|
|
3304
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
3305
|
-
};
|
|
3306
|
-
var matchMonthPatterns = {
|
|
3307
|
-
narrow: /^[jfmasond]/i,
|
|
3308
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
3309
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
3310
|
-
};
|
|
3311
|
-
var parseMonthPatterns = {
|
|
3312
|
-
narrow: [
|
|
3313
|
-
/^j/i,
|
|
3314
|
-
/^f/i,
|
|
3315
|
-
/^m/i,
|
|
3316
|
-
/^a/i,
|
|
3317
|
-
/^m/i,
|
|
3318
|
-
/^j/i,
|
|
3319
|
-
/^j/i,
|
|
3320
|
-
/^a/i,
|
|
3321
|
-
/^s/i,
|
|
3322
|
-
/^o/i,
|
|
3323
|
-
/^n/i,
|
|
3324
|
-
/^d/i
|
|
3325
|
-
],
|
|
3326
|
-
any: [
|
|
3327
|
-
/^ja/i,
|
|
3328
|
-
/^f/i,
|
|
3329
|
-
/^mar/i,
|
|
3330
|
-
/^ap/i,
|
|
3331
|
-
/^may/i,
|
|
3332
|
-
/^jun/i,
|
|
3333
|
-
/^jul/i,
|
|
3334
|
-
/^au/i,
|
|
3335
|
-
/^s/i,
|
|
3336
|
-
/^o/i,
|
|
3337
|
-
/^n/i,
|
|
3338
|
-
/^d/i
|
|
3339
|
-
]
|
|
3340
|
-
};
|
|
3341
|
-
var matchDayPatterns = {
|
|
3342
|
-
narrow: /^[smtwf]/i,
|
|
3343
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
3344
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
3345
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
3346
|
-
};
|
|
3347
|
-
var parseDayPatterns = {
|
|
3348
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
3349
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
3350
|
-
};
|
|
3351
|
-
var matchDayPeriodPatterns = {
|
|
3352
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
3353
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
3354
|
-
};
|
|
3355
|
-
var parseDayPeriodPatterns = {
|
|
3356
|
-
any: {
|
|
3357
|
-
am: /^a/i,
|
|
3358
|
-
pm: /^p/i,
|
|
3359
|
-
midnight: /^mi/i,
|
|
3360
|
-
noon: /^no/i,
|
|
3361
|
-
morning: /morning/i,
|
|
3362
|
-
afternoon: /afternoon/i,
|
|
3363
|
-
evening: /evening/i,
|
|
3364
|
-
night: /night/i
|
|
3365
|
-
}
|
|
3366
|
-
};
|
|
3367
|
-
var match = {
|
|
3368
|
-
ordinalNumber: buildMatchPatternFn({
|
|
3369
|
-
matchPattern: matchOrdinalNumberPattern,
|
|
3370
|
-
parsePattern: parseOrdinalNumberPattern,
|
|
3371
|
-
valueCallback: (value) => parseInt(value, 10)
|
|
3372
|
-
}),
|
|
3373
|
-
era: buildMatchFn({
|
|
3374
|
-
matchPatterns: matchEraPatterns,
|
|
3375
|
-
defaultMatchWidth: "wide",
|
|
3376
|
-
parsePatterns: parseEraPatterns,
|
|
3377
|
-
defaultParseWidth: "any"
|
|
3378
|
-
}),
|
|
3379
|
-
quarter: buildMatchFn({
|
|
3380
|
-
matchPatterns: matchQuarterPatterns,
|
|
3381
|
-
defaultMatchWidth: "wide",
|
|
3382
|
-
parsePatterns: parseQuarterPatterns,
|
|
3383
|
-
defaultParseWidth: "any",
|
|
3384
|
-
valueCallback: (index) => index + 1
|
|
3385
|
-
}),
|
|
3386
|
-
month: buildMatchFn({
|
|
3387
|
-
matchPatterns: matchMonthPatterns,
|
|
3388
|
-
defaultMatchWidth: "wide",
|
|
3389
|
-
parsePatterns: parseMonthPatterns,
|
|
3390
|
-
defaultParseWidth: "any"
|
|
3391
|
-
}),
|
|
3392
|
-
day: buildMatchFn({
|
|
3393
|
-
matchPatterns: matchDayPatterns,
|
|
3394
|
-
defaultMatchWidth: "wide",
|
|
3395
|
-
parsePatterns: parseDayPatterns,
|
|
3396
|
-
defaultParseWidth: "any"
|
|
3397
|
-
}),
|
|
3398
|
-
dayPeriod: buildMatchFn({
|
|
3399
|
-
matchPatterns: matchDayPeriodPatterns,
|
|
3400
|
-
defaultMatchWidth: "any",
|
|
3401
|
-
parsePatterns: parseDayPeriodPatterns,
|
|
3402
|
-
defaultParseWidth: "any"
|
|
3403
|
-
})
|
|
3404
|
-
};
|
|
3405
|
-
var enUS = {
|
|
3406
|
-
code: "en-US",
|
|
3407
|
-
formatDistance,
|
|
3408
|
-
formatLong,
|
|
3409
|
-
formatRelative,
|
|
3410
|
-
localize,
|
|
3411
|
-
match,
|
|
3412
|
-
options: {
|
|
3413
|
-
weekStartsOn: 0,
|
|
3414
|
-
firstWeekContainsDate: 1
|
|
3415
|
-
}
|
|
3416
|
-
};
|
|
3417
|
-
var defaultOptions = {};
|
|
3418
|
-
function getDefaultOptions() {
|
|
3419
|
-
return defaultOptions;
|
|
3420
|
-
}
|
|
3421
|
-
function toDate(argument, context) {
|
|
3422
|
-
return constructFrom(context || argument, argument);
|
|
3423
|
-
}
|
|
3424
|
-
function getTimezoneOffsetInMilliseconds(date) {
|
|
3425
|
-
const _date = toDate(date);
|
|
3426
|
-
const utcDate = new Date(
|
|
3427
|
-
Date.UTC(
|
|
3428
|
-
_date.getFullYear(),
|
|
3429
|
-
_date.getMonth(),
|
|
3430
|
-
_date.getDate(),
|
|
3431
|
-
_date.getHours(),
|
|
3432
|
-
_date.getMinutes(),
|
|
3433
|
-
_date.getSeconds(),
|
|
3434
|
-
_date.getMilliseconds()
|
|
3435
|
-
)
|
|
3436
|
-
);
|
|
3437
|
-
utcDate.setUTCFullYear(_date.getFullYear());
|
|
3438
|
-
return +date - +utcDate;
|
|
3439
|
-
}
|
|
3440
|
-
function normalizeDates(context, ...dates) {
|
|
3441
|
-
const normalize = constructFrom.bind(
|
|
3442
|
-
null,
|
|
3443
|
-
context || dates.find((date) => typeof date === "object")
|
|
3444
|
-
);
|
|
3445
|
-
return dates.map(normalize);
|
|
3446
|
-
}
|
|
3447
|
-
function compareAsc(dateLeft, dateRight) {
|
|
3448
|
-
const diff = +toDate(dateLeft) - +toDate(dateRight);
|
|
3449
|
-
if (diff < 0) return -1;
|
|
3450
|
-
else if (diff > 0) return 1;
|
|
3451
|
-
return diff;
|
|
3452
|
-
}
|
|
3453
|
-
function differenceInCalendarMonths(laterDate, earlierDate, options2) {
|
|
3454
|
-
const [laterDate_, earlierDate_] = normalizeDates(
|
|
3455
|
-
options2?.in,
|
|
3456
|
-
laterDate,
|
|
3457
|
-
earlierDate
|
|
3458
|
-
);
|
|
3459
|
-
const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
|
|
3460
|
-
const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
|
|
3461
|
-
return yearsDiff * 12 + monthsDiff;
|
|
3462
|
-
}
|
|
3463
|
-
function endOfDay(date, options2) {
|
|
3464
|
-
const _date = toDate(date, options2?.in);
|
|
3465
|
-
_date.setHours(23, 59, 59, 999);
|
|
3466
|
-
return _date;
|
|
3467
|
-
}
|
|
3468
|
-
function endOfMonth(date, options2) {
|
|
3469
|
-
const _date = toDate(date, options2?.in);
|
|
3470
|
-
const month = _date.getMonth();
|
|
3471
|
-
_date.setFullYear(_date.getFullYear(), month + 1, 0);
|
|
3472
|
-
_date.setHours(23, 59, 59, 999);
|
|
3473
|
-
return _date;
|
|
3474
|
-
}
|
|
3475
|
-
function isLastDayOfMonth(date, options2) {
|
|
3476
|
-
const _date = toDate(date, options2?.in);
|
|
3477
|
-
return +endOfDay(_date, options2) === +endOfMonth(_date, options2);
|
|
3478
|
-
}
|
|
3479
|
-
function differenceInMonths(laterDate, earlierDate, options2) {
|
|
3480
|
-
const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(
|
|
3481
|
-
options2?.in,
|
|
3482
|
-
laterDate,
|
|
3483
|
-
laterDate,
|
|
3484
|
-
earlierDate
|
|
3485
|
-
);
|
|
3486
|
-
const sign = compareAsc(workingLaterDate, earlierDate_);
|
|
3487
|
-
const difference = Math.abs(
|
|
3488
|
-
differenceInCalendarMonths(workingLaterDate, earlierDate_)
|
|
3489
|
-
);
|
|
3490
|
-
if (difference < 1) return 0;
|
|
3491
|
-
if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)
|
|
3492
|
-
workingLaterDate.setDate(30);
|
|
3493
|
-
workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);
|
|
3494
|
-
let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;
|
|
3495
|
-
if (isLastDayOfMonth(laterDate_) && difference === 1 && compareAsc(laterDate_, earlierDate_) === 1) {
|
|
3496
|
-
isLastMonthNotFull = false;
|
|
3497
|
-
}
|
|
3498
|
-
const result = sign * (difference - +isLastMonthNotFull);
|
|
3499
|
-
return result === 0 ? 0 : result;
|
|
3500
|
-
}
|
|
3501
|
-
function getRoundingMethod(method) {
|
|
3502
|
-
return (number) => {
|
|
3503
|
-
const round = method ? Math[method] : Math.trunc;
|
|
3504
|
-
const result = round(number);
|
|
3505
|
-
return result === 0 ? 0 : result;
|
|
3506
|
-
};
|
|
3507
|
-
}
|
|
3508
|
-
function differenceInMilliseconds(laterDate, earlierDate) {
|
|
3509
|
-
return +toDate(laterDate) - +toDate(earlierDate);
|
|
3510
|
-
}
|
|
3511
|
-
function differenceInSeconds(laterDate, earlierDate, options2) {
|
|
3512
|
-
const diff = differenceInMilliseconds(laterDate, earlierDate) / 1e3;
|
|
3513
|
-
return getRoundingMethod(options2?.roundingMethod)(diff);
|
|
3514
|
-
}
|
|
3515
|
-
function formatDistance2(laterDate, earlierDate, options2) {
|
|
3516
|
-
const defaultOptions2 = getDefaultOptions();
|
|
3517
|
-
const locale = options2?.locale ?? defaultOptions2.locale ?? enUS;
|
|
3518
|
-
const minutesInAlmostTwoDays = 2520;
|
|
3519
|
-
const comparison = compareAsc(laterDate, earlierDate);
|
|
3520
|
-
if (isNaN(comparison)) throw new RangeError("Invalid time value");
|
|
3521
|
-
const localizeOptions = Object.assign({}, options2, {
|
|
3522
|
-
addSuffix: options2?.addSuffix,
|
|
3523
|
-
comparison
|
|
3524
|
-
});
|
|
3525
|
-
const [laterDate_, earlierDate_] = normalizeDates(
|
|
3526
|
-
options2?.in,
|
|
3527
|
-
...comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]
|
|
3528
|
-
);
|
|
3529
|
-
const seconds = differenceInSeconds(earlierDate_, laterDate_);
|
|
3530
|
-
const offsetInSeconds = (getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_)) / 1e3;
|
|
3531
|
-
const minutes = Math.round((seconds - offsetInSeconds) / 60);
|
|
3532
|
-
let months;
|
|
3533
|
-
if (minutes < 2) {
|
|
3534
|
-
if (options2?.includeSeconds) {
|
|
3535
|
-
if (seconds < 5) {
|
|
3536
|
-
return locale.formatDistance("lessThanXSeconds", 5, localizeOptions);
|
|
3537
|
-
} else if (seconds < 10) {
|
|
3538
|
-
return locale.formatDistance("lessThanXSeconds", 10, localizeOptions);
|
|
3539
|
-
} else if (seconds < 20) {
|
|
3540
|
-
return locale.formatDistance("lessThanXSeconds", 20, localizeOptions);
|
|
3541
|
-
} else if (seconds < 40) {
|
|
3542
|
-
return locale.formatDistance("halfAMinute", 0, localizeOptions);
|
|
3543
|
-
} else if (seconds < 60) {
|
|
3544
|
-
return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
|
|
3545
|
-
} else {
|
|
3546
|
-
return locale.formatDistance("xMinutes", 1, localizeOptions);
|
|
3547
|
-
}
|
|
3548
|
-
} else {
|
|
3549
|
-
if (minutes === 0) {
|
|
3550
|
-
return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
|
|
3551
|
-
} else {
|
|
3552
|
-
return locale.formatDistance("xMinutes", minutes, localizeOptions);
|
|
3553
|
-
}
|
|
3554
|
-
}
|
|
3555
|
-
} else if (minutes < 45) {
|
|
3556
|
-
return locale.formatDistance("xMinutes", minutes, localizeOptions);
|
|
3557
|
-
} else if (minutes < 90) {
|
|
3558
|
-
return locale.formatDistance("aboutXHours", 1, localizeOptions);
|
|
3559
|
-
} else if (minutes < minutesInDay) {
|
|
3560
|
-
const hours = Math.round(minutes / 60);
|
|
3561
|
-
return locale.formatDistance("aboutXHours", hours, localizeOptions);
|
|
3562
|
-
} else if (minutes < minutesInAlmostTwoDays) {
|
|
3563
|
-
return locale.formatDistance("xDays", 1, localizeOptions);
|
|
3564
|
-
} else if (minutes < minutesInMonth) {
|
|
3565
|
-
const days = Math.round(minutes / minutesInDay);
|
|
3566
|
-
return locale.formatDistance("xDays", days, localizeOptions);
|
|
3567
|
-
} else if (minutes < minutesInMonth * 2) {
|
|
3568
|
-
months = Math.round(minutes / minutesInMonth);
|
|
3569
|
-
return locale.formatDistance("aboutXMonths", months, localizeOptions);
|
|
3570
|
-
}
|
|
3571
|
-
months = differenceInMonths(earlierDate_, laterDate_);
|
|
3572
|
-
if (months < 12) {
|
|
3573
|
-
const nearestMonth = Math.round(minutes / minutesInMonth);
|
|
3574
|
-
return locale.formatDistance("xMonths", nearestMonth, localizeOptions);
|
|
3575
|
-
} else {
|
|
3576
|
-
const monthsSinceStartOfYear = months % 12;
|
|
3577
|
-
const years = Math.trunc(months / 12);
|
|
3578
|
-
if (monthsSinceStartOfYear < 3) {
|
|
3579
|
-
return locale.formatDistance("aboutXYears", years, localizeOptions);
|
|
3580
|
-
} else if (monthsSinceStartOfYear < 9) {
|
|
3581
|
-
return locale.formatDistance("overXYears", years, localizeOptions);
|
|
3582
|
-
} else {
|
|
3583
|
-
return locale.formatDistance("almostXYears", years + 1, localizeOptions);
|
|
3584
|
-
}
|
|
3585
|
-
}
|
|
3586
|
-
}
|
|
3587
|
-
function formatDistanceToNow(date, options2) {
|
|
3588
|
-
return formatDistance2(date, constructNow(date), options2);
|
|
3589
|
-
}
|
|
2903
|
+
// ../config-tools/src/logger/console.ts
|
|
3590
2904
|
var getLogFn = (logLevel = LogLevel.INFO, config = {}, options2 = {}) => {
|
|
3591
2905
|
const {
|
|
3592
2906
|
chalk: _chalk = getChalk(),
|
|
@@ -3596,7 +2910,7 @@ var getLogFn = (logLevel = LogLevel.INFO, config = {}, options2 = {}) => {
|
|
|
3596
2910
|
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
3597
2911
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
3598
2912
|
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
3599
|
-
return (
|
|
2913
|
+
return (_) => {
|
|
3600
2914
|
};
|
|
3601
2915
|
}
|
|
3602
2916
|
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
@@ -3705,7 +3019,7 @@ var getStopwatch = (name) => {
|
|
|
3705
3019
|
const start = /* @__PURE__ */ new Date();
|
|
3706
3020
|
return () => {
|
|
3707
3021
|
writePerformance(
|
|
3708
|
-
`The${name ? ` ${name}` : ""} process took ${formatDistanceToNow(start, {
|
|
3022
|
+
`The${name ? ` ${name}` : ""} process took ${(0, import_formatDistanceToNow.formatDistanceToNow)(start, {
|
|
3709
3023
|
includeSeconds: true
|
|
3710
3024
|
})} to complete`
|
|
3711
3025
|
);
|
|
@@ -3721,7 +3035,7 @@ var formatLogMessage = (message, options2 = {}, depth2 = 0) => {
|
|
|
3721
3035
|
const sort = options2.sort ?? true;
|
|
3722
3036
|
return typeof message === "undefined" || message === null ? "<empty>" : typeof message === "string" ? !message ? "<empty string>" : message : Array.isArray(message) ? `
|
|
3723
3037
|
${message.sort(
|
|
3724
|
-
sort ? (
|
|
3038
|
+
sort ? (a, b) => !a && !b ? 0 : !a ? 1 : !b ? -1 : String(a).localeCompare(String(b)) : void 0
|
|
3725
3039
|
).map(
|
|
3726
3040
|
(item, index) => ` ${prefix}> #${index} = ${formatLogMessage(
|
|
3727
3041
|
item,
|
|
@@ -3730,12 +3044,12 @@ ${message.sort(
|
|
|
3730
3044
|
)}`
|
|
3731
3045
|
).join("\n")}` : typeof message === "object" && message ? `
|
|
3732
3046
|
${Object.keys(message).filter(
|
|
3733
|
-
(key) => typeof key !== "string" || !skip.map((
|
|
3047
|
+
(key) => typeof key !== "string" || !skip.map((k) => k.toLowerCase().trim()).includes(key.toLowerCase().trim())
|
|
3734
3048
|
).sort(
|
|
3735
|
-
sort ? (
|
|
3049
|
+
sort ? (a, b) => !a && !b ? 0 : !a ? 1 : !b ? -1 : String(a).localeCompare(String(b)) : void 0
|
|
3736
3050
|
).map(
|
|
3737
3051
|
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" && message[key] ? Object.keys(message[key]).filter(
|
|
3738
|
-
(key2) => typeof key2 !== "string" || !skip.map((
|
|
3052
|
+
(key2) => typeof key2 !== "string" || !skip.map((k) => k.toLowerCase().trim()).includes(key2.toLowerCase().trim())
|
|
3739
3053
|
).length === 0 ? "{}" : formatLogMessage(
|
|
3740
3054
|
message[key],
|
|
3741
3055
|
{ prefix: `${prefix}--`, skip, sort },
|
|
@@ -3757,10 +3071,7 @@ var import_tsup = __toESM(require_dist(), 1);
|
|
|
3757
3071
|
// src/constants.ts
|
|
3758
3072
|
init_cjs_shims();
|
|
3759
3073
|
|
|
3760
|
-
// ../build-tools/
|
|
3761
|
-
init_cjs_shims();
|
|
3762
|
-
|
|
3763
|
-
// ../build-tools/dist/chunk-TJ6NHBO5.mjs
|
|
3074
|
+
// ../build-tools/src/config.ts
|
|
3764
3075
|
init_cjs_shims();
|
|
3765
3076
|
var DEFAULT_JS_BANNER = `
|
|
3766
3077
|
// ---------------------------------------
|
|
@@ -3820,114 +3131,345 @@ var DEFAULT_BUILD_OPTIONS = {
|
|
|
3820
3131
|
// src/options.ts
|
|
3821
3132
|
init_cjs_shims();
|
|
3822
3133
|
|
|
3823
|
-
// ../build-tools/
|
|
3134
|
+
// ../build-tools/src/index.ts
|
|
3824
3135
|
init_cjs_shims();
|
|
3825
3136
|
|
|
3826
|
-
// ../build-tools/
|
|
3137
|
+
// ../build-tools/src/plugins/index.ts
|
|
3827
3138
|
init_cjs_shims();
|
|
3828
3139
|
|
|
3829
|
-
// ../build-tools/
|
|
3140
|
+
// ../build-tools/src/plugins/analyze.ts
|
|
3830
3141
|
init_cjs_shims();
|
|
3831
3142
|
|
|
3832
|
-
// ../build-tools/
|
|
3143
|
+
// ../build-tools/src/plugins/swc.ts
|
|
3833
3144
|
init_cjs_shims();
|
|
3145
|
+
var import_core = require("@swc/core");
|
|
3834
3146
|
|
|
3835
|
-
// ../build-tools/
|
|
3147
|
+
// ../build-tools/src/plugins/ts-resolve.ts
|
|
3836
3148
|
init_cjs_shims();
|
|
3149
|
+
var import_node_fs = __toESM(require("fs"));
|
|
3150
|
+
var import_node_module = require("module");
|
|
3151
|
+
var import_node_path = __toESM(require("path"));
|
|
3152
|
+
var import_resolve = __toESM(require("resolve"));
|
|
3837
3153
|
|
|
3838
|
-
// ../build-tools/
|
|
3839
|
-
|
|
3840
|
-
var
|
|
3154
|
+
// ../build-tools/src/plugins/type-definitions.ts
|
|
3155
|
+
init_cjs_shims();
|
|
3156
|
+
var import_devkit = require("@nx/devkit");
|
|
3157
|
+
var import_path = require("path");
|
|
3841
3158
|
|
|
3842
|
-
// ../build-tools/
|
|
3159
|
+
// ../build-tools/src/types.ts
|
|
3843
3160
|
init_cjs_shims();
|
|
3844
|
-
var import_formatDistanceToNow = require("date-fns/formatDistanceToNow");
|
|
3845
|
-
var import_chalk2 = __toESM(require("chalk"), 1);
|
|
3846
|
-
var LogLevelLabel2 = {
|
|
3847
|
-
SILENT: "silent",
|
|
3848
|
-
FATAL: "fatal",
|
|
3849
|
-
ERROR: "error",
|
|
3850
|
-
WARN: "warn",
|
|
3851
|
-
SUCCESS: "success",
|
|
3852
|
-
INFO: "info",
|
|
3853
|
-
PERFORMANCE: "performance",
|
|
3854
|
-
DEBUG: "debug",
|
|
3855
|
-
TRACE: "trace",
|
|
3856
|
-
ALL: "all"
|
|
3857
|
-
};
|
|
3858
|
-
function isUnicodeSupported2() {
|
|
3859
|
-
if (process.platform !== "win32") {
|
|
3860
|
-
return process.env.TERM !== "linux";
|
|
3861
|
-
}
|
|
3862
|
-
return Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
3863
|
-
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
3864
|
-
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
3865
|
-
process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
3866
|
-
}
|
|
3867
|
-
var useIcon2 = (c3, fallback) => isUnicodeSupported2() ? c3 : fallback;
|
|
3868
|
-
var CONSOLE_ICONS2 = {
|
|
3869
|
-
[LogLevelLabel2.ERROR]: useIcon2("\u2718", "\xD7"),
|
|
3870
|
-
[LogLevelLabel2.FATAL]: useIcon2("\u{1F571}", "\xD7"),
|
|
3871
|
-
[LogLevelLabel2.WARN]: useIcon2("\u26A0", "\u203C"),
|
|
3872
|
-
[LogLevelLabel2.INFO]: useIcon2("\u2139", "i"),
|
|
3873
|
-
[LogLevelLabel2.PERFORMANCE]: useIcon2("\u23F1", "\u23F1"),
|
|
3874
|
-
[LogLevelLabel2.SUCCESS]: useIcon2("\u2714", "\u221A"),
|
|
3875
|
-
[LogLevelLabel2.DEBUG]: useIcon2("\u{1F6E0}", "D"),
|
|
3876
|
-
[LogLevelLabel2.TRACE]: useIcon2("\u2699", "T"),
|
|
3877
|
-
[LogLevelLabel2.ALL]: useIcon2("\u2709", "\u2192")
|
|
3878
|
-
};
|
|
3879
3161
|
|
|
3880
|
-
// ../build-tools/
|
|
3881
|
-
|
|
3882
|
-
var import_defu = __toESM(require("defu"), 1);
|
|
3883
|
-
var z = __toESM(require("zod/v4/mini"), 1);
|
|
3884
|
-
var import_node_fs2 = require("fs");
|
|
3885
|
-
var import_promises = require("fs/promises");
|
|
3886
|
-
var import_node_path2 = require("path");
|
|
3887
|
-
var import_defu2 = __toESM(require("defu"), 1);
|
|
3888
|
-
var import_node_fs3 = require("fs");
|
|
3889
|
-
var import_node_fs4 = require("fs");
|
|
3890
|
-
var import_promises2 = require("fs/promises");
|
|
3891
|
-
var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
|
|
3892
|
-
var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
|
|
3893
|
-
var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
|
|
3894
|
-
var STORM_DEFAULT_RELEASE_FOOTER = `
|
|
3895
|
-
Storm Software is an open source software development organization with the mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languages.
|
|
3162
|
+
// ../build-tools/src/utilities/index.ts
|
|
3163
|
+
init_cjs_shims();
|
|
3896
3164
|
|
|
3897
|
-
|
|
3165
|
+
// ../build-tools/src/utilities/copy-assets.ts
|
|
3166
|
+
init_cjs_shims();
|
|
3167
|
+
var import_internal = require("@nx/js/internal");
|
|
3898
3168
|
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
var
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
)
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
}
|
|
3929
|
-
|
|
3930
|
-
|
|
3169
|
+
// ../config-tools/src/utilities/correct-paths.ts
|
|
3170
|
+
init_cjs_shims();
|
|
3171
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
3172
|
+
function normalizeWindowsPath(input = "") {
|
|
3173
|
+
if (!input) {
|
|
3174
|
+
return input;
|
|
3175
|
+
}
|
|
3176
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
3177
|
+
}
|
|
3178
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
3179
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
3180
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
3181
|
+
var correctPaths = function(path2) {
|
|
3182
|
+
if (!path2 || path2.length === 0) {
|
|
3183
|
+
return ".";
|
|
3184
|
+
}
|
|
3185
|
+
path2 = normalizeWindowsPath(path2);
|
|
3186
|
+
const isUNCPath = path2?.match(_UNC_REGEX);
|
|
3187
|
+
const isPathAbsolute = isAbsolute(path2);
|
|
3188
|
+
const trailingSeparator = path2[path2.length - 1] === "/";
|
|
3189
|
+
path2 = normalizeString(path2, !isPathAbsolute);
|
|
3190
|
+
if (path2.length === 0) {
|
|
3191
|
+
if (isPathAbsolute) {
|
|
3192
|
+
return "/";
|
|
3193
|
+
}
|
|
3194
|
+
return trailingSeparator ? "./" : ".";
|
|
3195
|
+
}
|
|
3196
|
+
if (trailingSeparator) {
|
|
3197
|
+
path2 += "/";
|
|
3198
|
+
}
|
|
3199
|
+
if (_DRIVE_LETTER_RE.test(path2)) {
|
|
3200
|
+
path2 += "/";
|
|
3201
|
+
}
|
|
3202
|
+
if (isUNCPath) {
|
|
3203
|
+
if (!isPathAbsolute) {
|
|
3204
|
+
return `//./${path2}`;
|
|
3205
|
+
}
|
|
3206
|
+
return `//${path2}`;
|
|
3207
|
+
}
|
|
3208
|
+
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
3209
|
+
};
|
|
3210
|
+
var joinPaths = function(...segments) {
|
|
3211
|
+
let path2 = "";
|
|
3212
|
+
for (const seg of segments) {
|
|
3213
|
+
if (!seg) {
|
|
3214
|
+
continue;
|
|
3215
|
+
}
|
|
3216
|
+
if (path2.length > 0) {
|
|
3217
|
+
const pathTrailing = path2[path2.length - 1] === "/";
|
|
3218
|
+
const segLeading = seg[0] === "/";
|
|
3219
|
+
const both = pathTrailing && segLeading;
|
|
3220
|
+
if (both) {
|
|
3221
|
+
path2 += seg.slice(1);
|
|
3222
|
+
} else {
|
|
3223
|
+
path2 += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
3224
|
+
}
|
|
3225
|
+
} else {
|
|
3226
|
+
path2 += seg;
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
return correctPaths(path2);
|
|
3230
|
+
};
|
|
3231
|
+
function normalizeString(path2, allowAboveRoot) {
|
|
3232
|
+
let res = "";
|
|
3233
|
+
let lastSegmentLength = 0;
|
|
3234
|
+
let lastSlash = -1;
|
|
3235
|
+
let dots = 0;
|
|
3236
|
+
let char = null;
|
|
3237
|
+
for (let index = 0; index <= path2.length; ++index) {
|
|
3238
|
+
if (index < path2.length) {
|
|
3239
|
+
char = path2[index];
|
|
3240
|
+
} else if (char === "/") {
|
|
3241
|
+
break;
|
|
3242
|
+
} else {
|
|
3243
|
+
char = "/";
|
|
3244
|
+
}
|
|
3245
|
+
if (char === "/") {
|
|
3246
|
+
if (lastSlash === index - 1 || dots === 1) {
|
|
3247
|
+
} else if (dots === 2) {
|
|
3248
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
3249
|
+
if (res.length > 2) {
|
|
3250
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
3251
|
+
if (lastSlashIndex === -1) {
|
|
3252
|
+
res = "";
|
|
3253
|
+
lastSegmentLength = 0;
|
|
3254
|
+
} else {
|
|
3255
|
+
res = res.slice(0, lastSlashIndex);
|
|
3256
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
3257
|
+
}
|
|
3258
|
+
lastSlash = index;
|
|
3259
|
+
dots = 0;
|
|
3260
|
+
continue;
|
|
3261
|
+
} else if (res.length > 0) {
|
|
3262
|
+
res = "";
|
|
3263
|
+
lastSegmentLength = 0;
|
|
3264
|
+
lastSlash = index;
|
|
3265
|
+
dots = 0;
|
|
3266
|
+
continue;
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
if (allowAboveRoot) {
|
|
3270
|
+
res += res.length > 0 ? "/.." : "..";
|
|
3271
|
+
lastSegmentLength = 2;
|
|
3272
|
+
}
|
|
3273
|
+
} else {
|
|
3274
|
+
if (res.length > 0) {
|
|
3275
|
+
res += `/${path2.slice(lastSlash + 1, index)}`;
|
|
3276
|
+
} else {
|
|
3277
|
+
res = path2.slice(lastSlash + 1, index);
|
|
3278
|
+
}
|
|
3279
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
3280
|
+
}
|
|
3281
|
+
lastSlash = index;
|
|
3282
|
+
dots = 0;
|
|
3283
|
+
} else if (char === "." && dots !== -1) {
|
|
3284
|
+
++dots;
|
|
3285
|
+
} else {
|
|
3286
|
+
dots = -1;
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
return res;
|
|
3290
|
+
}
|
|
3291
|
+
var isAbsolute = function(p) {
|
|
3292
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
3293
|
+
};
|
|
3294
|
+
|
|
3295
|
+
// ../build-tools/src/utilities/copy-assets.ts
|
|
3296
|
+
var import_glob = require("glob");
|
|
3297
|
+
var import_promises = require("fs/promises");
|
|
3298
|
+
|
|
3299
|
+
// ../build-tools/src/utilities/generate-package-json.ts
|
|
3300
|
+
init_cjs_shims();
|
|
3301
|
+
var import_internal2 = require("@nx/js/internal");
|
|
3302
|
+
|
|
3303
|
+
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
3304
|
+
init_cjs_shims();
|
|
3305
|
+
|
|
3306
|
+
// ../config-tools/src/utilities/find-up.ts
|
|
3307
|
+
init_cjs_shims();
|
|
3308
|
+
var import_node_fs2 = require("fs");
|
|
3309
|
+
var import_node_path2 = require("path");
|
|
3310
|
+
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
3311
|
+
var depth = 0;
|
|
3312
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
3313
|
+
const _startPath = startPath ?? process.cwd();
|
|
3314
|
+
if (endDirectoryNames.some(
|
|
3315
|
+
(endDirName) => (0, import_node_fs2.existsSync)((0, import_node_path2.join)(_startPath, endDirName))
|
|
3316
|
+
)) {
|
|
3317
|
+
return _startPath;
|
|
3318
|
+
}
|
|
3319
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs2.existsSync)((0, import_node_path2.join)(_startPath, endFileName)))) {
|
|
3320
|
+
return _startPath;
|
|
3321
|
+
}
|
|
3322
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
3323
|
+
const parent = (0, import_node_path2.join)(_startPath, "..");
|
|
3324
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
3325
|
+
}
|
|
3326
|
+
return void 0;
|
|
3327
|
+
}
|
|
3328
|
+
|
|
3329
|
+
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
3330
|
+
var rootFiles = [
|
|
3331
|
+
"storm-workspace.json",
|
|
3332
|
+
"storm-workspace.yaml",
|
|
3333
|
+
"storm-workspace.yml",
|
|
3334
|
+
"storm-workspace.js",
|
|
3335
|
+
"storm-workspace.ts",
|
|
3336
|
+
".storm-workspace.json",
|
|
3337
|
+
".storm-workspace.yaml",
|
|
3338
|
+
".storm-workspace.yml",
|
|
3339
|
+
".storm-workspace.js",
|
|
3340
|
+
".storm-workspace.ts",
|
|
3341
|
+
"lerna.json",
|
|
3342
|
+
"nx.json",
|
|
3343
|
+
"turbo.json",
|
|
3344
|
+
"npm-workspace.json",
|
|
3345
|
+
"yarn-workspace.json",
|
|
3346
|
+
"pnpm-workspace.json",
|
|
3347
|
+
"npm-workspace.yaml",
|
|
3348
|
+
"yarn-workspace.yaml",
|
|
3349
|
+
"pnpm-workspace.yaml",
|
|
3350
|
+
"npm-workspace.yml",
|
|
3351
|
+
"yarn-workspace.yml",
|
|
3352
|
+
"pnpm-workspace.yml",
|
|
3353
|
+
"npm-lock.json",
|
|
3354
|
+
"yarn-lock.json",
|
|
3355
|
+
"pnpm-lock.json",
|
|
3356
|
+
"npm-lock.yaml",
|
|
3357
|
+
"yarn-lock.yaml",
|
|
3358
|
+
"pnpm-lock.yaml",
|
|
3359
|
+
"npm-lock.yml",
|
|
3360
|
+
"yarn-lock.yml",
|
|
3361
|
+
"pnpm-lock.yml",
|
|
3362
|
+
"bun.lockb"
|
|
3363
|
+
];
|
|
3364
|
+
var rootDirectories = [
|
|
3365
|
+
".storm-workspace",
|
|
3366
|
+
".nx",
|
|
3367
|
+
".git",
|
|
3368
|
+
".github",
|
|
3369
|
+
".vscode",
|
|
3370
|
+
".verdaccio"
|
|
3371
|
+
];
|
|
3372
|
+
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
3373
|
+
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
3374
|
+
return correctPaths(
|
|
3375
|
+
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
3376
|
+
);
|
|
3377
|
+
}
|
|
3378
|
+
return correctPaths(
|
|
3379
|
+
findFolderUp(
|
|
3380
|
+
pathInsideMonorepo ?? process.cwd(),
|
|
3381
|
+
rootFiles,
|
|
3382
|
+
rootDirectories
|
|
3383
|
+
)
|
|
3384
|
+
);
|
|
3385
|
+
}
|
|
3386
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
3387
|
+
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
3388
|
+
if (!result) {
|
|
3389
|
+
throw new Error(
|
|
3390
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
3391
|
+
${rootFiles.join(
|
|
3392
|
+
"\n"
|
|
3393
|
+
)}
|
|
3394
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
3395
|
+
);
|
|
3396
|
+
}
|
|
3397
|
+
return result;
|
|
3398
|
+
}
|
|
3399
|
+
|
|
3400
|
+
// ../build-tools/src/utilities/generate-package-json.ts
|
|
3401
|
+
var import_glob2 = require("glob");
|
|
3402
|
+
var import_node_fs3 = require("fs");
|
|
3403
|
+
var import_promises2 = require("fs/promises");
|
|
3404
|
+
var import_project_graph = require("nx/src/project-graph/project-graph");
|
|
3405
|
+
|
|
3406
|
+
// ../build-tools/src/utilities/get-entry-points.ts
|
|
3407
|
+
init_cjs_shims();
|
|
3408
|
+
|
|
3409
|
+
// ../config-tools/src/config-file/get-config-file.ts
|
|
3410
|
+
init_cjs_shims();
|
|
3411
|
+
var import_c12 = require("c12");
|
|
3412
|
+
var import_defu = __toESM(require("defu"), 1);
|
|
3413
|
+
|
|
3414
|
+
// ../config-tools/src/utilities/get-default-config.ts
|
|
3415
|
+
init_cjs_shims();
|
|
3416
|
+
|
|
3417
|
+
// ../config/src/index.ts
|
|
3418
|
+
init_cjs_shims();
|
|
3419
|
+
|
|
3420
|
+
// ../config/src/constants.ts
|
|
3421
|
+
init_cjs_shims();
|
|
3422
|
+
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
|
|
3423
|
+
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
3424
|
+
var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
|
|
3425
|
+
var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
|
|
3426
|
+
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
3427
|
+
var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
|
|
3428
|
+
var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
|
|
3429
|
+
var STORM_DEFAULT_RELEASE_FOOTER = `
|
|
3430
|
+
Storm Software is an open source software development organization with the mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languages.
|
|
3431
|
+
|
|
3432
|
+
Join us on [Discord](${STORM_DEFAULT_SOCIAL_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
|
|
3433
|
+
|
|
3434
|
+
If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our [website](${STORM_DEFAULT_CONTACT}) or join our [Slack](${STORM_DEFAULT_SOCIAL_SLACK}) channel!
|
|
3435
|
+
`;
|
|
3436
|
+
var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
|
|
3437
|
+
var STORM_DEFAULT_BANNER_ALT = "The workspace's banner image";
|
|
3438
|
+
|
|
3439
|
+
// ../config/src/define-config.ts
|
|
3440
|
+
init_cjs_shims();
|
|
3441
|
+
|
|
3442
|
+
// ../config/src/schema.ts
|
|
3443
|
+
init_cjs_shims();
|
|
3444
|
+
var z = __toESM(require("zod/v4/mini"), 1);
|
|
3445
|
+
var schemaRegistry = z.registry();
|
|
3446
|
+
var colorSchema = z.string().check(
|
|
3447
|
+
z.length(7),
|
|
3448
|
+
z.toLowerCase(),
|
|
3449
|
+
z.regex(/^#([0-9a-f]{3}){1,2}$/i),
|
|
3450
|
+
z.trim()
|
|
3451
|
+
);
|
|
3452
|
+
schemaRegistry.add(colorSchema, {
|
|
3453
|
+
description: "A base schema for describing the format of colors"
|
|
3454
|
+
});
|
|
3455
|
+
var darkColorSchema = z._default(colorSchema, "#1e2124");
|
|
3456
|
+
schemaRegistry.add(darkColorSchema, {
|
|
3457
|
+
description: "The dark background color of the workspace"
|
|
3458
|
+
});
|
|
3459
|
+
var lightColorSchema = z._default(colorSchema, "#cbd5e1");
|
|
3460
|
+
schemaRegistry.add(lightColorSchema, {
|
|
3461
|
+
description: "The light background color of the workspace"
|
|
3462
|
+
});
|
|
3463
|
+
var brandColorSchema = z._default(colorSchema, "#1fb2a6");
|
|
3464
|
+
schemaRegistry.add(brandColorSchema, {
|
|
3465
|
+
description: "The primary brand specific color of the workspace"
|
|
3466
|
+
});
|
|
3467
|
+
var alternateColorSchema = z.optional(colorSchema);
|
|
3468
|
+
schemaRegistry.add(alternateColorSchema, {
|
|
3469
|
+
description: "The alternate brand specific color of the workspace"
|
|
3470
|
+
});
|
|
3471
|
+
var accentColorSchema = z.optional(colorSchema);
|
|
3472
|
+
schemaRegistry.add(accentColorSchema, {
|
|
3931
3473
|
description: "The secondary brand specific color of the workspace"
|
|
3932
3474
|
});
|
|
3933
3475
|
var linkColorSchema = z._default(colorSchema, "#3fa6ff");
|
|
@@ -4464,343 +4006,143 @@ var workspaceConfigSchema = z.object({
|
|
|
4464
4006
|
extensions: extensionsSchema
|
|
4465
4007
|
});
|
|
4466
4008
|
schemaRegistry.add(extensionsSchema, {
|
|
4467
|
-
description: "Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo."
|
|
4468
|
-
});
|
|
4469
|
-
|
|
4470
|
-
// ../build-tools/dist/chunk-JCFRYUYP.mjs
|
|
4471
|
-
init_cjs_shims();
|
|
4472
|
-
var import_create_task_graph = require("nx/src/tasks-runner/create-task-graph");
|
|
4473
|
-
|
|
4474
|
-
// ../build-tools/dist/chunk-44MPIE3V.mjs
|
|
4475
|
-
init_cjs_shims();
|
|
4476
|
-
var import_internal = require("@nx/js/internal");
|
|
4477
|
-
var import_glob = require("glob");
|
|
4478
|
-
var import_promises3 = require("fs/promises");
|
|
4479
|
-
|
|
4480
|
-
// ../build-tools/dist/chunk-V3HXNKBB.mjs
|
|
4481
|
-
init_cjs_shims();
|
|
4482
|
-
var import_internal2 = require("@nx/js/internal");
|
|
4483
|
-
var import_glob2 = require("glob");
|
|
4484
|
-
var import_node_fs5 = require("fs");
|
|
4485
|
-
var import_promises4 = require("fs/promises");
|
|
4486
|
-
var import_project_graph = require("nx/src/project-graph/project-graph");
|
|
4487
|
-
|
|
4488
|
-
// ../build-tools/dist/chunk-UFGXOQSU.mjs
|
|
4489
|
-
init_cjs_shims();
|
|
4490
|
-
var import_glob3 = require("glob");
|
|
4491
|
-
|
|
4492
|
-
// ../build-tools/dist/chunk-FEQZSI32.mjs
|
|
4493
|
-
init_cjs_shims();
|
|
4494
|
-
var getEnv = (builder, options2) => {
|
|
4495
|
-
return {
|
|
4496
|
-
STORM_BUILD: builder,
|
|
4497
|
-
STORM_ORG: options2.orgName || DEFAULT_ORGANIZATION,
|
|
4498
|
-
STORM_NAME: options2.name,
|
|
4499
|
-
STORM_MODE: options2.mode || DEFAULT_ENVIRONMENT,
|
|
4500
|
-
STORM_PLATFORM: options2.platform,
|
|
4501
|
-
STORM_FORMAT: JSON.stringify(options2.format),
|
|
4502
|
-
STORM_TARGET: JSON.stringify(options2.target),
|
|
4503
|
-
...options2.env
|
|
4504
|
-
};
|
|
4505
|
-
};
|
|
4506
|
-
|
|
4507
|
-
// ../build-tools/dist/chunk-KUEYIH7W.mjs
|
|
4508
|
-
init_cjs_shims();
|
|
4509
|
-
|
|
4510
|
-
// ../build-tools/dist/chunk-3VZVP5XV.mjs
|
|
4511
|
-
init_cjs_shims();
|
|
4512
|
-
|
|
4513
|
-
// ../build-tools/dist/chunk-ODQKLK6L.mjs
|
|
4514
|
-
init_cjs_shims();
|
|
4515
|
-
|
|
4516
|
-
// ../build-tools/dist/chunk-WBQAMGXK.mjs
|
|
4517
|
-
init_cjs_shims();
|
|
4518
|
-
|
|
4519
|
-
// ../build-tools/dist/chunk-UN3B7LBV.mjs
|
|
4520
|
-
init_cjs_shims();
|
|
4521
|
-
|
|
4522
|
-
// ../build-tools/dist/chunk-NXOOAAV5.mjs
|
|
4523
|
-
init_cjs_shims();
|
|
4524
|
-
|
|
4525
|
-
// ../build-tools/dist/chunk-7YKXR5JJ.mjs
|
|
4526
|
-
init_cjs_shims();
|
|
4527
|
-
var import_core = require("@swc/core");
|
|
4528
|
-
|
|
4529
|
-
// ../build-tools/dist/chunk-W7UFCEAQ.mjs
|
|
4530
|
-
init_cjs_shims();
|
|
4531
|
-
var import_node_fs6 = __toESM(require("fs"), 1);
|
|
4532
|
-
var import_node_module = require("module");
|
|
4533
|
-
var import_node_path3 = __toESM(require("path"), 1);
|
|
4534
|
-
var import_resolve = __toESM(require("resolve"), 1);
|
|
4535
|
-
|
|
4536
|
-
// ../build-tools/dist/chunk-VGLIZ2H3.mjs
|
|
4537
|
-
init_cjs_shims();
|
|
4538
|
-
var import_devkit = require("@nx/devkit");
|
|
4539
|
-
var import_path = require("path");
|
|
4540
|
-
|
|
4541
|
-
// ../config-tools/dist/get-config.js
|
|
4542
|
-
init_cjs_shims();
|
|
4543
|
-
|
|
4544
|
-
// ../config-tools/dist/chunk-ZXR7SS2X.js
|
|
4545
|
-
init_cjs_shims();
|
|
4546
|
-
|
|
4547
|
-
// ../config-tools/dist/chunk-J777WNCU.js
|
|
4548
|
-
init_cjs_shims();
|
|
4549
|
-
|
|
4550
|
-
// ../config-tools/dist/chunk-IUVY5TOB.js
|
|
4551
|
-
init_cjs_shims();
|
|
4552
|
-
|
|
4553
|
-
// ../config-tools/dist/chunk-LF3SAK2O.js
|
|
4554
|
-
init_cjs_shims();
|
|
4009
|
+
description: "Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo."
|
|
4010
|
+
});
|
|
4555
4011
|
|
|
4556
|
-
// ../config
|
|
4012
|
+
// ../config/src/types.ts
|
|
4557
4013
|
init_cjs_shims();
|
|
4558
|
-
var
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
return void 0;
|
|
4577
|
-
}
|
|
4014
|
+
var COLOR_KEYS = [
|
|
4015
|
+
"dark",
|
|
4016
|
+
"light",
|
|
4017
|
+
"base",
|
|
4018
|
+
"brand",
|
|
4019
|
+
"alternate",
|
|
4020
|
+
"accent",
|
|
4021
|
+
"link",
|
|
4022
|
+
"success",
|
|
4023
|
+
"discovery",
|
|
4024
|
+
"info",
|
|
4025
|
+
"warning",
|
|
4026
|
+
"danger",
|
|
4027
|
+
"fatal",
|
|
4028
|
+
"performance",
|
|
4029
|
+
"positive",
|
|
4030
|
+
"negative"
|
|
4031
|
+
];
|
|
4578
4032
|
|
|
4579
|
-
// ../config-tools/
|
|
4580
|
-
|
|
4581
|
-
var
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
if (path2.length === 0) {
|
|
4601
|
-
if (isPathAbsolute) {
|
|
4602
|
-
return "/";
|
|
4603
|
-
}
|
|
4604
|
-
return trailingSeparator ? "./" : ".";
|
|
4605
|
-
}
|
|
4606
|
-
if (trailingSeparator) {
|
|
4607
|
-
path2 += "/";
|
|
4608
|
-
}
|
|
4609
|
-
if (_DRIVE_LETTER_RE.test(path2)) {
|
|
4610
|
-
path2 += "/";
|
|
4611
|
-
}
|
|
4612
|
-
if (isUNCPath) {
|
|
4613
|
-
if (!isPathAbsolute) {
|
|
4614
|
-
return `//./${path2}`;
|
|
4615
|
-
}
|
|
4616
|
-
return `//${path2}`;
|
|
4617
|
-
}
|
|
4618
|
-
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
4619
|
-
};
|
|
4620
|
-
var joinPaths2 = function(...segments) {
|
|
4621
|
-
let path2 = "";
|
|
4622
|
-
for (const seg of segments) {
|
|
4623
|
-
if (!seg) {
|
|
4624
|
-
continue;
|
|
4625
|
-
}
|
|
4626
|
-
if (path2.length > 0) {
|
|
4627
|
-
const pathTrailing = path2[path2.length - 1] === "/";
|
|
4628
|
-
const segLeading = seg[0] === "/";
|
|
4629
|
-
const both = pathTrailing && segLeading;
|
|
4630
|
-
if (both) {
|
|
4631
|
-
path2 += seg.slice(1);
|
|
4632
|
-
} else {
|
|
4633
|
-
path2 += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
4033
|
+
// ../config-tools/src/utilities/get-default-config.ts
|
|
4034
|
+
var import_node_fs4 = require("fs");
|
|
4035
|
+
var import_promises3 = require("fs/promises");
|
|
4036
|
+
var import_node_path3 = require("path");
|
|
4037
|
+
async function getPackageJsonConfig(root) {
|
|
4038
|
+
let license = STORM_DEFAULT_LICENSE;
|
|
4039
|
+
let homepage = void 0;
|
|
4040
|
+
let support = void 0;
|
|
4041
|
+
let name = void 0;
|
|
4042
|
+
let namespace = void 0;
|
|
4043
|
+
let repository = void 0;
|
|
4044
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
4045
|
+
if ((0, import_node_fs4.existsSync)((0, import_node_path3.join)(workspaceRoot, "package.json"))) {
|
|
4046
|
+
const file = await (0, import_promises3.readFile)(
|
|
4047
|
+
joinPaths(workspaceRoot, "package.json"),
|
|
4048
|
+
"utf8"
|
|
4049
|
+
);
|
|
4050
|
+
if (file) {
|
|
4051
|
+
const packageJson = JSON.parse(file);
|
|
4052
|
+
if (packageJson.name) {
|
|
4053
|
+
name = packageJson.name;
|
|
4634
4054
|
}
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
let lastSegmentLength = 0;
|
|
4644
|
-
let lastSlash = -1;
|
|
4645
|
-
let dots = 0;
|
|
4646
|
-
let char = null;
|
|
4647
|
-
for (let index = 0; index <= path2.length; ++index) {
|
|
4648
|
-
if (index < path2.length) {
|
|
4649
|
-
char = path2[index];
|
|
4650
|
-
} else if (char === "/") {
|
|
4651
|
-
break;
|
|
4652
|
-
} else {
|
|
4653
|
-
char = "/";
|
|
4654
|
-
}
|
|
4655
|
-
if (char === "/") {
|
|
4656
|
-
if (lastSlash === index - 1 || dots === 1) {
|
|
4657
|
-
} else if (dots === 2) {
|
|
4658
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
4659
|
-
if (res.length > 2) {
|
|
4660
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
4661
|
-
if (lastSlashIndex === -1) {
|
|
4662
|
-
res = "";
|
|
4663
|
-
lastSegmentLength = 0;
|
|
4664
|
-
} else {
|
|
4665
|
-
res = res.slice(0, lastSlashIndex);
|
|
4666
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
4667
|
-
}
|
|
4668
|
-
lastSlash = index;
|
|
4669
|
-
dots = 0;
|
|
4670
|
-
continue;
|
|
4671
|
-
} else if (res.length > 0) {
|
|
4672
|
-
res = "";
|
|
4673
|
-
lastSegmentLength = 0;
|
|
4674
|
-
lastSlash = index;
|
|
4675
|
-
dots = 0;
|
|
4676
|
-
continue;
|
|
4677
|
-
}
|
|
4678
|
-
}
|
|
4679
|
-
if (allowAboveRoot) {
|
|
4680
|
-
res += res.length > 0 ? "/.." : "..";
|
|
4681
|
-
lastSegmentLength = 2;
|
|
4055
|
+
if (packageJson.namespace) {
|
|
4056
|
+
namespace = packageJson.namespace;
|
|
4057
|
+
}
|
|
4058
|
+
if (packageJson.repository) {
|
|
4059
|
+
if (typeof packageJson.repository === "string") {
|
|
4060
|
+
repository = packageJson.repository;
|
|
4061
|
+
} else if (packageJson.repository.url) {
|
|
4062
|
+
repository = packageJson.repository.url;
|
|
4682
4063
|
}
|
|
4683
|
-
}
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4064
|
+
}
|
|
4065
|
+
if (packageJson.license) {
|
|
4066
|
+
license = packageJson.license;
|
|
4067
|
+
}
|
|
4068
|
+
if (packageJson.homepage) {
|
|
4069
|
+
homepage = packageJson.homepage;
|
|
4070
|
+
}
|
|
4071
|
+
if (packageJson.bugs) {
|
|
4072
|
+
if (typeof packageJson.bugs === "string") {
|
|
4073
|
+
support = packageJson.bugs;
|
|
4074
|
+
} else if (packageJson.bugs.url) {
|
|
4075
|
+
support = packageJson.bugs.url;
|
|
4688
4076
|
}
|
|
4689
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
4690
4077
|
}
|
|
4691
|
-
lastSlash = index;
|
|
4692
|
-
dots = 0;
|
|
4693
|
-
} else if (char === "." && dots !== -1) {
|
|
4694
|
-
++dots;
|
|
4695
|
-
} else {
|
|
4696
|
-
dots = -1;
|
|
4697
4078
|
}
|
|
4698
4079
|
}
|
|
4699
|
-
return
|
|
4080
|
+
return {
|
|
4081
|
+
workspaceRoot,
|
|
4082
|
+
name,
|
|
4083
|
+
namespace,
|
|
4084
|
+
repository,
|
|
4085
|
+
license,
|
|
4086
|
+
homepage,
|
|
4087
|
+
support
|
|
4088
|
+
};
|
|
4700
4089
|
}
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
// ../config-tools/dist/chunk-LF3SAK2O.js
|
|
4706
|
-
var rootFiles = [
|
|
4707
|
-
"storm-workspace.json",
|
|
4708
|
-
"storm-workspace.yaml",
|
|
4709
|
-
"storm-workspace.yml",
|
|
4710
|
-
"storm-workspace.js",
|
|
4711
|
-
"storm-workspace.ts",
|
|
4712
|
-
".storm-workspace.json",
|
|
4713
|
-
".storm-workspace.yaml",
|
|
4714
|
-
".storm-workspace.yml",
|
|
4715
|
-
".storm-workspace.js",
|
|
4716
|
-
".storm-workspace.ts",
|
|
4717
|
-
"lerna.json",
|
|
4718
|
-
"nx.json",
|
|
4719
|
-
"turbo.json",
|
|
4720
|
-
"npm-workspace.json",
|
|
4721
|
-
"yarn-workspace.json",
|
|
4722
|
-
"pnpm-workspace.json",
|
|
4723
|
-
"npm-workspace.yaml",
|
|
4724
|
-
"yarn-workspace.yaml",
|
|
4725
|
-
"pnpm-workspace.yaml",
|
|
4726
|
-
"npm-workspace.yml",
|
|
4727
|
-
"yarn-workspace.yml",
|
|
4728
|
-
"pnpm-workspace.yml",
|
|
4729
|
-
"npm-lock.json",
|
|
4730
|
-
"yarn-lock.json",
|
|
4731
|
-
"pnpm-lock.json",
|
|
4732
|
-
"npm-lock.yaml",
|
|
4733
|
-
"yarn-lock.yaml",
|
|
4734
|
-
"pnpm-lock.yaml",
|
|
4735
|
-
"npm-lock.yml",
|
|
4736
|
-
"yarn-lock.yml",
|
|
4737
|
-
"pnpm-lock.yml",
|
|
4738
|
-
"bun.lockb"
|
|
4739
|
-
];
|
|
4740
|
-
var rootDirectories = [
|
|
4741
|
-
".storm-workspace",
|
|
4742
|
-
".nx",
|
|
4743
|
-
".git",
|
|
4744
|
-
".github",
|
|
4745
|
-
".vscode",
|
|
4746
|
-
".verdaccio"
|
|
4747
|
-
];
|
|
4748
|
-
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
4749
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
4750
|
-
return correctPaths2(
|
|
4751
|
-
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
4752
|
-
);
|
|
4090
|
+
function applyDefaultConfig(config) {
|
|
4091
|
+
if (!config.support && config.contact) {
|
|
4092
|
+
config.support = config.contact;
|
|
4753
4093
|
}
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4094
|
+
if (!config.contact && config.support) {
|
|
4095
|
+
config.contact = config.support;
|
|
4096
|
+
}
|
|
4097
|
+
if (config.homepage) {
|
|
4098
|
+
if (!config.docs) {
|
|
4099
|
+
config.docs = `${config.homepage}/docs`;
|
|
4100
|
+
}
|
|
4101
|
+
if (!config.license) {
|
|
4102
|
+
config.license = `${config.homepage}/license`;
|
|
4103
|
+
}
|
|
4104
|
+
if (!config.support) {
|
|
4105
|
+
config.support = `${config.homepage}/support`;
|
|
4106
|
+
}
|
|
4107
|
+
if (!config.contact) {
|
|
4108
|
+
config.contact = `${config.homepage}/contact`;
|
|
4109
|
+
}
|
|
4110
|
+
if (!config.error?.codesFile || !config?.error?.url) {
|
|
4111
|
+
config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
4112
|
+
if (config.homepage) {
|
|
4113
|
+
config.error.url ??= `${config.homepage}/errors`;
|
|
4114
|
+
}
|
|
4115
|
+
}
|
|
4772
4116
|
}
|
|
4773
|
-
return
|
|
4117
|
+
return config;
|
|
4774
4118
|
}
|
|
4775
4119
|
|
|
4776
|
-
// ../config-tools/
|
|
4777
|
-
var import_c122 = require("c12");
|
|
4778
|
-
var import_defu3 = __toESM(require("defu"), 1);
|
|
4120
|
+
// ../config-tools/src/config-file/get-config-file.ts
|
|
4779
4121
|
var getConfigFileByName = async (fileName, filePath, options2 = {}) => {
|
|
4780
|
-
const workspacePath = filePath ||
|
|
4122
|
+
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
4781
4123
|
const configs = await Promise.all([
|
|
4782
|
-
(0,
|
|
4124
|
+
(0, import_c12.loadConfig)({
|
|
4783
4125
|
cwd: workspacePath,
|
|
4784
4126
|
packageJson: true,
|
|
4785
4127
|
name: fileName,
|
|
4786
4128
|
envName: fileName?.toUpperCase(),
|
|
4787
4129
|
jitiOptions: {
|
|
4788
4130
|
debug: false,
|
|
4789
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
4131
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
4790
4132
|
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
4791
4133
|
"jiti"
|
|
4792
4134
|
)
|
|
4793
4135
|
},
|
|
4794
4136
|
...options2
|
|
4795
4137
|
}),
|
|
4796
|
-
(0,
|
|
4138
|
+
(0, import_c12.loadConfig)({
|
|
4797
4139
|
cwd: workspacePath,
|
|
4798
4140
|
packageJson: true,
|
|
4799
4141
|
name: fileName,
|
|
4800
4142
|
envName: fileName?.toUpperCase(),
|
|
4801
4143
|
jitiOptions: {
|
|
4802
4144
|
debug: false,
|
|
4803
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
4145
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
4804
4146
|
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
4805
4147
|
"jiti"
|
|
4806
4148
|
)
|
|
@@ -4809,10 +4151,10 @@ var getConfigFileByName = async (fileName, filePath, options2 = {}) => {
|
|
|
4809
4151
|
...options2
|
|
4810
4152
|
})
|
|
4811
4153
|
]);
|
|
4812
|
-
return (0,
|
|
4154
|
+
return (0, import_defu.default)(configs[0] ?? {}, configs[1] ?? {});
|
|
4813
4155
|
};
|
|
4814
4156
|
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
4815
|
-
const workspacePath = filePath ? filePath :
|
|
4157
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
4816
4158
|
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
4817
4159
|
let config = result.config;
|
|
4818
4160
|
const configFile = result.configFile;
|
|
@@ -4840,7 +4182,7 @@ var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
|
4840
4182
|
}
|
|
4841
4183
|
);
|
|
4842
4184
|
}
|
|
4843
|
-
config = (0,
|
|
4185
|
+
config = (0, import_defu.default)(result2.config ?? {}, config ?? {});
|
|
4844
4186
|
}
|
|
4845
4187
|
}
|
|
4846
4188
|
}
|
|
@@ -4851,301 +4193,229 @@ var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
|
4851
4193
|
return config;
|
|
4852
4194
|
};
|
|
4853
4195
|
|
|
4854
|
-
// ../config-tools/
|
|
4855
|
-
init_cjs_shims();
|
|
4856
|
-
|
|
4857
|
-
// ../config/dist/index.js
|
|
4858
|
-
init_cjs_shims();
|
|
4859
|
-
|
|
4860
|
-
// ../config/dist/chunk-5QIMO5EY.js
|
|
4861
|
-
init_cjs_shims();
|
|
4862
|
-
|
|
4863
|
-
// ../config/dist/chunk-7LCFBY4J.js
|
|
4864
|
-
init_cjs_shims();
|
|
4865
|
-
|
|
4866
|
-
// ../config/dist/chunk-FYHIR57S.js
|
|
4196
|
+
// ../config-tools/src/create-storm-config.ts
|
|
4867
4197
|
init_cjs_shims();
|
|
4868
|
-
var
|
|
4869
|
-
var
|
|
4870
|
-
var t = "https://stormsoftware.com/contact";
|
|
4871
|
-
var a = "https://stormsoftware.com/license";
|
|
4872
|
-
var i = "Apache-2.0";
|
|
4873
|
-
var o = "https://discord.gg/MQ6YVzakM5";
|
|
4874
|
-
var e = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
|
|
4875
|
-
var E = `
|
|
4876
|
-
Storm Software is an open source software development organization with the mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languages.
|
|
4877
|
-
|
|
4878
|
-
Join us on [Discord](${o}) to chat with the team, receive release notifications, ask questions, and get involved.
|
|
4879
|
-
|
|
4880
|
-
If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our [website](${t}) or join our [Slack](${e}) channel!
|
|
4881
|
-
`;
|
|
4882
|
-
var S = "tools/errors/codes.json";
|
|
4883
|
-
var A = "The workspace's banner image";
|
|
4884
|
-
|
|
4885
|
-
// ../config/dist/chunk-7LCFBY4J.js
|
|
4886
|
-
var e2 = __toESM(require("zod/v4/mini"), 1);
|
|
4887
|
-
var o2 = e2.registry();
|
|
4888
|
-
var t2 = e2.string().check(e2.length(7), e2.toLowerCase(), e2.regex(/^#([0-9a-f]{3}){1,2}$/i), e2.trim());
|
|
4889
|
-
o2.add(t2, { description: "A base schema for describing the format of colors" });
|
|
4890
|
-
var a2 = e2._default(t2, "#1e2124");
|
|
4891
|
-
o2.add(a2, { description: "The dark background color of the workspace" });
|
|
4892
|
-
var c = e2._default(t2, "#cbd5e1");
|
|
4893
|
-
o2.add(c, { description: "The light background color of the workspace" });
|
|
4894
|
-
var i2 = e2._default(t2, "#1fb2a6");
|
|
4895
|
-
o2.add(i2, { description: "The primary brand specific color of the workspace" });
|
|
4896
|
-
var s2 = e2.optional(t2);
|
|
4897
|
-
o2.add(s2, { description: "The alternate brand specific color of the workspace" });
|
|
4898
|
-
var n = e2.optional(t2);
|
|
4899
|
-
o2.add(n, { description: "The secondary brand specific color of the workspace" });
|
|
4900
|
-
var d = e2._default(t2, "#3fa6ff");
|
|
4901
|
-
o2.add(d, { description: "The color used to display hyperlink text" });
|
|
4902
|
-
var p = e2._default(t2, "#818cf8");
|
|
4903
|
-
o2.add(p, { description: "The second brand specific color of the workspace" });
|
|
4904
|
-
var h = e2._default(t2, "#45b27e");
|
|
4905
|
-
o2.add(h, { description: "The success color of the workspace" });
|
|
4906
|
-
var l = e2._default(t2, "#38bdf8");
|
|
4907
|
-
o2.add(l, { description: "The informational color of the workspace" });
|
|
4908
|
-
var m = e2._default(t2, "#8afafc");
|
|
4909
|
-
o2.add(m, { description: "The debug color of the workspace" });
|
|
4910
|
-
var z2 = e2._default(t2, "#f3d371");
|
|
4911
|
-
o2.add(z2, { description: "The warning color of the workspace" });
|
|
4912
|
-
var g = e2._default(t2, "#d8314a");
|
|
4913
|
-
o2.add(g, { description: "The danger color of the workspace" });
|
|
4914
|
-
var f = e2.optional(t2);
|
|
4915
|
-
o2.add(f, { description: "The fatal color of the workspace" });
|
|
4916
|
-
var u = e2._default(t2, "#80fd74");
|
|
4917
|
-
o2.add(u, { description: "The performance color of the workspace" });
|
|
4918
|
-
var k = e2._default(t2, "#4ade80");
|
|
4919
|
-
o2.add(k, { description: "The positive number color of the workspace" });
|
|
4920
|
-
var w = e2._default(t2, "#ef4444");
|
|
4921
|
-
o2.add(w, { description: "The negative number color of the workspace" });
|
|
4922
|
-
var S2 = e2.optional(e2.array(t2));
|
|
4923
|
-
o2.add(S2, { description: "The color stops for the base gradient color pattern used in the workspace" });
|
|
4924
|
-
var Re = e2.object({ foreground: c, background: a2, brand: i2, alternate: s2, accent: n, link: d, discovery: p, success: h, info: l, debug: m, warning: z2, danger: g, fatal: f, performance: u, positive: k, negative: w, gradient: S2 });
|
|
4925
|
-
var Ue = e2.object({ foreground: a2, background: c, brand: i2, alternate: s2, accent: n, link: d, discovery: p, success: h, info: l, debug: m, warning: z2, danger: g, fatal: f, performance: u, positive: k, negative: w, gradient: S2 });
|
|
4926
|
-
var De = e2.object({ dark: Re, light: Ue });
|
|
4927
|
-
var Be = e2.object({ dark: a2, light: c, brand: i2, alternate: s2, accent: n, link: d, discovery: p, success: h, info: l, debug: m, warning: z2, danger: g, fatal: f, performance: u, positive: k, negative: w, gradient: S2 });
|
|
4928
|
-
var r2 = e2.optional(e2.url());
|
|
4929
|
-
o2.add(r2, { description: "A remote registry URL used to publish distributable packages" });
|
|
4930
|
-
var y = e2._default(e2.object({ github: r2, npm: r2, cargo: r2, cyclone: r2, container: r2 }), {});
|
|
4931
|
-
o2.add(y, { description: "A list of remote registry URLs used by Storm Software" });
|
|
4932
|
-
var b = e2.union([Be, De]);
|
|
4933
|
-
o2.add(b, { description: "Colors used for various workspace elements" });
|
|
4934
|
-
var C = e2.record(e2.union([e2.union([e2.literal("base"), e2.string()]), e2.string()]), b);
|
|
4935
|
-
o2.add(C, { description: "Storm theme config values used for styling various package elements" });
|
|
4936
|
-
var _ = e2.optional(e2.union([e2.string().check(e2.trim()), e2.array(e2.string().check(e2.trim()))]));
|
|
4937
|
-
o2.add(_, { description: "The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration." });
|
|
4938
|
-
var L = e2.string().check(e2.trim());
|
|
4939
|
-
o2.add(L, { description: "The workspace bot user's name (this is the bot that will be used to perform various tasks)" });
|
|
4940
|
-
var j = e2.string().check(e2.trim());
|
|
4941
|
-
o2.add(j, { description: "The email of the workspace bot" });
|
|
4942
|
-
var A2 = e2.object({ name: L, email: j });
|
|
4943
|
-
o2.add(A2, { description: "The workspace's bot user's config used to automated various operations tasks" });
|
|
4944
|
-
var R = e2.optional(e2.string().check(e2.trim(), e2.url()));
|
|
4945
|
-
o2.add(R, { description: "A URL to a banner image used to display the workspace's release" });
|
|
4946
|
-
var U = e2._default(e2.string().check(e2.trim()), A);
|
|
4947
|
-
o2.add(U, { description: "The alt text for the workspace's release banner image" });
|
|
4948
|
-
var D = e2.object({ url: R, alt: U });
|
|
4949
|
-
o2.add(D, { description: "The workspace's banner image used during the release process" });
|
|
4950
|
-
var B = e2.optional(e2.string().check(e2.trim()));
|
|
4951
|
-
o2.add(B, { description: "A header message appended to the start of the workspace's release notes" });
|
|
4952
|
-
var F = e2.optional(e2.string().check(e2.trim()));
|
|
4953
|
-
o2.add(F, { description: "A footer message appended to the end of the workspace's release notes" });
|
|
4954
|
-
var N = e2.object({ banner: e2.union([D, e2.string().check(e2.trim(), e2.url())]), header: B, footer: F });
|
|
4955
|
-
o2.add(N, { description: "The workspace's release config used during the release process" });
|
|
4956
|
-
var E2 = e2.optional(e2.string().check(e2.trim()));
|
|
4957
|
-
o2.add(E2, { description: "A Twitter/X account associated with the organization/project" });
|
|
4958
|
-
var M = e2.optional(e2.string().check(e2.trim()));
|
|
4959
|
-
o2.add(M, { description: "A Discord account associated with the organization/project" });
|
|
4960
|
-
var O = e2.optional(e2.string().check(e2.trim()));
|
|
4961
|
-
o2.add(O, { description: "A Telegram account associated with the organization/project" });
|
|
4962
|
-
var I = e2.optional(e2.string().check(e2.trim()));
|
|
4963
|
-
o2.add(I, { description: "A Slack account associated with the organization/project" });
|
|
4964
|
-
var G = e2.optional(e2.string().check(e2.trim()));
|
|
4965
|
-
o2.add(G, { description: "A Medium account associated with the organization/project" });
|
|
4966
|
-
var H = e2.optional(e2.string().check(e2.trim()));
|
|
4967
|
-
o2.add(H, { description: "A GitHub account associated with the organization/project" });
|
|
4968
|
-
var J = e2.object({ twitter: E2, discord: M, telegram: O, slack: I, medium: G, github: H });
|
|
4969
|
-
o2.add(J, { description: "The workspace's account config used to store various social media links" });
|
|
4970
|
-
var W = e2.optional(e2.string().check(e2.trim()));
|
|
4971
|
-
o2.add(W, { description: "The directory used to store the environment's cached file data" });
|
|
4972
|
-
var P = e2.optional(e2.string().check(e2.trim()));
|
|
4973
|
-
o2.add(P, { description: "The directory used to store the environment's data files" });
|
|
4974
|
-
var $ = e2.optional(e2.string().check(e2.trim()));
|
|
4975
|
-
o2.add($, { description: "The directory used to store the environment's configuration files" });
|
|
4976
|
-
var V = e2.optional(e2.string().check(e2.trim()));
|
|
4977
|
-
o2.add(V, { description: "The directory used to store the environment's temp files" });
|
|
4978
|
-
var X = e2.optional(e2.string().check(e2.trim()));
|
|
4979
|
-
o2.add(X, { description: "The directory used to store the environment's log files" });
|
|
4980
|
-
var Y = e2._default(e2.string().check(e2.trim()), "dist");
|
|
4981
|
-
o2.add(Y, { description: "The directory used to store the workspace's distributable files after a build (relative to the workspace root)" });
|
|
4982
|
-
var q = e2.object({ cache: W, data: P, config: $, temp: V, log: X, build: Y });
|
|
4983
|
-
o2.add(q, { description: "Various directories used by the workspace to store data, cache, and configuration files" });
|
|
4984
|
-
var K = e2._default(e2.enum(["minimal", "monorepo"]), "monorepo");
|
|
4985
|
-
o2.add(K, { description: "The variant of the workspace. This can be used to enable or disable certain features or configurations." });
|
|
4986
|
-
var Q = e2._default(e2.string().check(e2.trim()), S);
|
|
4987
|
-
o2.add(Q, { description: "The path to the workspace's error codes JSON file" });
|
|
4988
|
-
var Z = e2.optional(e2.url());
|
|
4989
|
-
o2.add(Z, { description: "A URL to a page that looks up the workspace's error messages given a specific error code" });
|
|
4990
|
-
var ee = e2.object({ codesFile: Q, url: Z });
|
|
4991
|
-
o2.add(ee, { description: "The workspace's error config used when creating error details during a system error" });
|
|
4992
|
-
var oe = e2.optional(e2.string().check(e2.trim(), e2.toLowerCase()));
|
|
4993
|
-
o2.add(oe, { description: "The name of the organization" });
|
|
4994
|
-
var te = e2.optional(e2.string().check(e2.trim()));
|
|
4995
|
-
o2.add(te, { description: "A description of the organization" });
|
|
4996
|
-
var re = e2.optional(e2.url());
|
|
4997
|
-
o2.add(re, { description: "A URL to the organization's logo image" });
|
|
4998
|
-
var ae = e2.optional(e2.url());
|
|
4999
|
-
o2.add(ae, { description: "A URL to the organization's icon image" });
|
|
5000
|
-
var ce = e2.optional(e2.url());
|
|
5001
|
-
o2.add(ce, { description: "A URL to a page that provides more information about the organization" });
|
|
5002
|
-
var ie = e2.object({ name: oe, description: te, logo: re, icon: ae, url: ce });
|
|
5003
|
-
o2.add(ie, { description: "The workspace's organization details" });
|
|
5004
|
-
var se = e2._default(e2.string().check(e2.trim(), e2.toLowerCase()), "https://public.storm-cdn.com/schemas/storm-workspace.schema.json");
|
|
5005
|
-
o2.add(se, { description: "The URL or file path to the JSON schema file that describes the Storm configuration file" });
|
|
5006
|
-
var ne = e2.string().check(e2.trim(), e2.toLowerCase());
|
|
5007
|
-
o2.add(ne, { description: "The name of the workspace/project/service/package/scope using this configuration" });
|
|
5008
|
-
var de = e2.string().check(e2.trim(), e2.toLowerCase());
|
|
5009
|
-
o2.add(de, { description: "The namespace of the workspace/project/service/package/scope using this configuration" });
|
|
5010
|
-
var pe = e2.union([ie, e2.string().check(e2.trim(), e2.toLowerCase())]);
|
|
5011
|
-
o2.add(pe, { description: "The organization of the workspace. This can be a string or an object containing the organization's details" });
|
|
5012
|
-
var he = e2.string().check(e2.trim(), e2.toLowerCase());
|
|
5013
|
-
o2.add(he, { description: "The repo URL of the workspace (i.e. the GitHub repository URL)" });
|
|
5014
|
-
var le = e2._default(e2.string().check(e2.trim()), "Apache-2.0");
|
|
5015
|
-
o2.add(le, { description: "The license type of the package" });
|
|
5016
|
-
var me = e2.optional(e2.url());
|
|
5017
|
-
o2.add(me, { description: "The homepage of the workspace" });
|
|
5018
|
-
var ze = e2.optional(e2.url());
|
|
5019
|
-
o2.add(ze, { description: "The documentation site for the workspace" });
|
|
5020
|
-
var ge = e2.optional(e2.url());
|
|
5021
|
-
o2.add(ge, { description: "The development portal site for the workspace" });
|
|
5022
|
-
var fe = e2.optional(e2.url());
|
|
5023
|
-
o2.add(fe, { description: "The licensing site for the workspace" });
|
|
5024
|
-
var ue = e2.optional(e2.url());
|
|
5025
|
-
o2.add(ue, { description: "The contact site for the workspace" });
|
|
5026
|
-
var ke = e2.optional(e2.url());
|
|
5027
|
-
o2.add(ke, { description: "The support site for the workspace. If not provided, this is defaulted to the `contact` config value" });
|
|
5028
|
-
var we = e2._default(e2.string().check(e2.trim(), e2.toLowerCase()), "main");
|
|
5029
|
-
o2.add(we, { description: "The branch of the workspace" });
|
|
5030
|
-
var Se = e2.optional(e2.string().check(e2.trim(), e2.toLowerCase()));
|
|
5031
|
-
o2.add(Se, { description: "A tag specifying the version pre-release identifier" });
|
|
5032
|
-
var be = e2.optional(e2.string().check(e2.trim(), e2.toLowerCase()));
|
|
5033
|
-
o2.add(be, { description: "The owner of the package" });
|
|
5034
|
-
var xe = e2._default(e2.enum(["development", "test", "production"]).check(e2.trim(), e2.toLowerCase()), "production");
|
|
5035
|
-
o2.add(xe, { description: "The current runtime environment mode for the package" });
|
|
5036
|
-
var Te = e2.string().check(e2.trim(), e2.toLowerCase());
|
|
5037
|
-
o2.add(Te, { description: "The root directory of the workspace" });
|
|
5038
|
-
var ve = e2._default(e2.boolean(), false);
|
|
5039
|
-
o2.add(ve, { description: "Should all known types of workspace caching be skipped?" });
|
|
5040
|
-
var ye = e2._default(e2.enum(["npm", "yarn", "pnpm", "bun"]), "npm");
|
|
5041
|
-
o2.add(ye, { description: "The JavaScript/TypeScript package manager used by the repository" });
|
|
5042
|
-
var Ce = e2._default(e2.string().check(e2.trim()), "America/New_York");
|
|
5043
|
-
o2.add(Ce, { description: "The default timezone of the workspace" });
|
|
5044
|
-
var _e = e2._default(e2.string().check(e2.trim()), "en-US");
|
|
5045
|
-
o2.add(_e, { description: "The default locale of the workspace" });
|
|
5046
|
-
var Le = e2._default(e2.enum(["silent", "fatal", "error", "warn", "success", "info", "performance", "debug", "trace", "all"]), "info");
|
|
5047
|
-
o2.add(Le, { description: "The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)." });
|
|
5048
|
-
var je = e2._default(e2.boolean(), true);
|
|
5049
|
-
o2.add(je, { description: "Should the logging of the current Storm Workspace configuration be skipped?" });
|
|
5050
|
-
var Ae = e2._default(e2.nullable(e2.string().check(e2.trim())), null);
|
|
5051
|
-
o2.add(Ae, { description: "The filepath of the Storm config. When this field is null, no config file was found in the current workspace." });
|
|
5052
|
-
var x = e2._default(e2.record(e2.string(), e2.any()), {});
|
|
5053
|
-
o2.add(x, { description: "Configuration of each used extension" });
|
|
5054
|
-
var Ne = e2.object({ $schema: se, extends: _, name: ne, variant: K, namespace: de, organization: pe, repository: he, license: le, homepage: me, docs: ze, portal: ge, licensing: fe, contact: ue, support: ke, branch: we, preid: Se, owner: be, bot: A2, release: N, socials: J, error: ee, mode: xe, workspaceRoot: Te, skipCache: ve, directories: q, packageManager: ye, timezone: Ce, locale: _e, logLevel: Le, skipConfigLogging: je, registry: y, configFile: Ae, colors: e2.union([b, C]), extensions: x });
|
|
5055
|
-
o2.add(x, { description: "Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo." });
|
|
4198
|
+
var import_defu2 = __toESM(require("defu"), 1);
|
|
4199
|
+
var import_node_fs5 = require("fs");
|
|
5056
4200
|
|
|
5057
|
-
// ../config/
|
|
4201
|
+
// ../config-tools/src/env/get-env.ts
|
|
5058
4202
|
init_cjs_shims();
|
|
5059
|
-
var
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
let homepage = void 0;
|
|
5068
|
-
let support = void 0;
|
|
5069
|
-
let name = void 0;
|
|
5070
|
-
let namespace = void 0;
|
|
5071
|
-
let repository = void 0;
|
|
5072
|
-
const workspaceRoot = findWorkspaceRoot2(root);
|
|
5073
|
-
if ((0, import_node_fs8.existsSync)((0, import_node_path5.join)(workspaceRoot, "package.json"))) {
|
|
5074
|
-
const file = await (0, import_promises5.readFile)(
|
|
5075
|
-
joinPaths2(workspaceRoot, "package.json"),
|
|
5076
|
-
"utf8"
|
|
5077
|
-
);
|
|
5078
|
-
if (file) {
|
|
5079
|
-
const packageJson = JSON.parse(file);
|
|
5080
|
-
if (packageJson.name) {
|
|
5081
|
-
name = packageJson.name;
|
|
5082
|
-
}
|
|
5083
|
-
if (packageJson.namespace) {
|
|
5084
|
-
namespace = packageJson.namespace;
|
|
5085
|
-
}
|
|
5086
|
-
if (packageJson.repository) {
|
|
5087
|
-
if (typeof packageJson.repository === "string") {
|
|
5088
|
-
repository = packageJson.repository;
|
|
5089
|
-
} else if (packageJson.repository.url) {
|
|
5090
|
-
repository = packageJson.repository.url;
|
|
5091
|
-
}
|
|
5092
|
-
}
|
|
5093
|
-
if (packageJson.license) {
|
|
5094
|
-
license = packageJson.license;
|
|
5095
|
-
}
|
|
5096
|
-
if (packageJson.homepage) {
|
|
5097
|
-
homepage = packageJson.homepage;
|
|
5098
|
-
}
|
|
5099
|
-
if (packageJson.bugs) {
|
|
5100
|
-
if (typeof packageJson.bugs === "string") {
|
|
5101
|
-
support = packageJson.bugs;
|
|
5102
|
-
} else if (packageJson.bugs.url) {
|
|
5103
|
-
support = packageJson.bugs.url;
|
|
5104
|
-
}
|
|
5105
|
-
}
|
|
4203
|
+
var getExtensionEnv = (extensionName) => {
|
|
4204
|
+
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
4205
|
+
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
4206
|
+
const name = key.replace(prefix, "").split("_").map(
|
|
4207
|
+
(i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
|
|
4208
|
+
).join("");
|
|
4209
|
+
if (name) {
|
|
4210
|
+
ret[name] = process.env[key];
|
|
5106
4211
|
}
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
4212
|
+
return ret;
|
|
4213
|
+
}, {});
|
|
4214
|
+
};
|
|
4215
|
+
var getConfigEnv = () => {
|
|
4216
|
+
const prefix = "STORM_";
|
|
4217
|
+
let config = {
|
|
4218
|
+
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
4219
|
+
name: process.env[`${prefix}NAME`] || void 0,
|
|
4220
|
+
variant: process.env[`${prefix}VARIANT`] || void 0,
|
|
4221
|
+
namespace: process.env[`${prefix}NAMESPACE`] || void 0,
|
|
4222
|
+
owner: process.env[`${prefix}OWNER`] || void 0,
|
|
4223
|
+
bot: {
|
|
4224
|
+
name: process.env[`${prefix}BOT_NAME`] || void 0,
|
|
4225
|
+
email: process.env[`${prefix}BOT_EMAIL`] || void 0
|
|
4226
|
+
},
|
|
4227
|
+
release: {
|
|
4228
|
+
banner: {
|
|
4229
|
+
url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
|
|
4230
|
+
alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
|
|
4231
|
+
},
|
|
4232
|
+
header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
|
|
4233
|
+
footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
|
|
4234
|
+
},
|
|
4235
|
+
error: {
|
|
4236
|
+
codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
|
|
4237
|
+
url: process.env[`${prefix}ERROR_URL`] || void 0
|
|
4238
|
+
},
|
|
4239
|
+
socials: {
|
|
4240
|
+
twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
|
|
4241
|
+
discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
|
|
4242
|
+
telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
|
|
4243
|
+
slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
|
|
4244
|
+
medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
|
|
4245
|
+
github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
|
|
4246
|
+
},
|
|
4247
|
+
organization: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] ? process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] ? {
|
|
4248
|
+
name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
|
|
4249
|
+
description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
|
|
4250
|
+
url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
|
|
4251
|
+
logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
|
|
4252
|
+
icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
|
|
4253
|
+
} : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
|
|
4254
|
+
packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
|
|
4255
|
+
license: process.env[`${prefix}LICENSE`] || void 0,
|
|
4256
|
+
homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
|
|
4257
|
+
docs: process.env[`${prefix}DOCS`] || void 0,
|
|
4258
|
+
portal: process.env[`${prefix}PORTAL`] || void 0,
|
|
4259
|
+
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
4260
|
+
contact: process.env[`${prefix}CONTACT`] || void 0,
|
|
4261
|
+
support: process.env[`${prefix}SUPPORT`] || void 0,
|
|
4262
|
+
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
4263
|
+
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
4264
|
+
configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
|
|
4265
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
4266
|
+
directories: {
|
|
4267
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
|
|
4268
|
+
data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
|
|
4269
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
|
|
4270
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
|
|
4271
|
+
log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
|
|
4272
|
+
build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
|
|
4273
|
+
},
|
|
4274
|
+
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
4275
|
+
mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
|
|
4276
|
+
// ci:
|
|
4277
|
+
// process.env[`${prefix}CI`] !== undefined
|
|
4278
|
+
// ? Boolean(
|
|
4279
|
+
// process.env[`${prefix}CI`] ??
|
|
4280
|
+
// process.env.CI ??
|
|
4281
|
+
// process.env.CONTINUOUS_INTEGRATION
|
|
4282
|
+
// )
|
|
4283
|
+
// : undefined,
|
|
4284
|
+
repository: process.env[`${prefix}REPOSITORY`] || void 0,
|
|
4285
|
+
branch: process.env[`${prefix}BRANCH`] || void 0,
|
|
4286
|
+
preid: process.env[`${prefix}PRE_ID`] || void 0,
|
|
4287
|
+
registry: {
|
|
4288
|
+
github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
|
|
4289
|
+
npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
|
|
4290
|
+
cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
|
|
4291
|
+
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
4292
|
+
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
4293
|
+
},
|
|
4294
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
4295
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
4296
|
+
) ? getLogLevelLabel(
|
|
4297
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
4298
|
+
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
4299
|
+
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
5116
4300
|
};
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
4301
|
+
const themeNames = Object.keys(process.env).filter(
|
|
4302
|
+
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
|
|
4303
|
+
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
4304
|
+
)
|
|
4305
|
+
);
|
|
4306
|
+
config.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
4307
|
+
(ret, themeName) => {
|
|
4308
|
+
ret[themeName] = getThemeColorsEnv(prefix, themeName);
|
|
4309
|
+
return ret;
|
|
4310
|
+
},
|
|
4311
|
+
{}
|
|
4312
|
+
) : getThemeColorsEnv(prefix);
|
|
4313
|
+
if (config.docs === STORM_DEFAULT_DOCS) {
|
|
4314
|
+
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
4315
|
+
config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
4316
|
+
} else {
|
|
5127
4317
|
config.docs = `${config.homepage}/docs`;
|
|
5128
4318
|
}
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
4319
|
+
}
|
|
4320
|
+
if (config.licensing === STORM_DEFAULT_LICENSING) {
|
|
4321
|
+
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
4322
|
+
config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
4323
|
+
} else {
|
|
4324
|
+
config.licensing = `${config.homepage}/docs`;
|
|
5134
4325
|
}
|
|
5135
|
-
|
|
5136
|
-
|
|
4326
|
+
}
|
|
4327
|
+
const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
|
|
4328
|
+
if (serializedConfig) {
|
|
4329
|
+
const parsed = JSON.parse(serializedConfig);
|
|
4330
|
+
config = {
|
|
4331
|
+
...config,
|
|
4332
|
+
...parsed,
|
|
4333
|
+
colors: { ...config.colors, ...parsed.colors },
|
|
4334
|
+
extensions: { ...config.extensions, ...parsed.extensions }
|
|
4335
|
+
};
|
|
4336
|
+
}
|
|
4337
|
+
return config;
|
|
4338
|
+
};
|
|
4339
|
+
var getThemeColorsEnv = (prefix, theme) => {
|
|
4340
|
+
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
4341
|
+
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
|
|
4342
|
+
};
|
|
4343
|
+
var getSingleThemeColorsEnv = (prefix) => {
|
|
4344
|
+
const gradient = [];
|
|
4345
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
4346
|
+
gradient.push(
|
|
4347
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
4348
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
4349
|
+
);
|
|
4350
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
4351
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
4352
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
4353
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
4354
|
+
index++;
|
|
5137
4355
|
}
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
4356
|
+
}
|
|
4357
|
+
return {
|
|
4358
|
+
dark: process.env[`${prefix}DARK`],
|
|
4359
|
+
light: process.env[`${prefix}LIGHT`],
|
|
4360
|
+
brand: process.env[`${prefix}BRAND`],
|
|
4361
|
+
alternate: process.env[`${prefix}ALTERNATE`],
|
|
4362
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
4363
|
+
link: process.env[`${prefix}LINK`],
|
|
4364
|
+
discovery: process.env[`${prefix}DISCOVERY`],
|
|
4365
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
4366
|
+
info: process.env[`${prefix}INFO`],
|
|
4367
|
+
debug: process.env[`${prefix}DEBUG`],
|
|
4368
|
+
warning: process.env[`${prefix}WARNING`],
|
|
4369
|
+
danger: process.env[`${prefix}DANGER`],
|
|
4370
|
+
fatal: process.env[`${prefix}FATAL`],
|
|
4371
|
+
performance: process.env[`${prefix}PERFORMANCE`],
|
|
4372
|
+
positive: process.env[`${prefix}POSITIVE`],
|
|
4373
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
4374
|
+
gradient
|
|
4375
|
+
};
|
|
4376
|
+
};
|
|
4377
|
+
var getMultiThemeColorsEnv = (prefix) => {
|
|
4378
|
+
return {
|
|
4379
|
+
light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
|
|
4380
|
+
dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
|
|
4381
|
+
};
|
|
4382
|
+
};
|
|
4383
|
+
var getBaseThemeColorsEnv = (prefix) => {
|
|
4384
|
+
const gradient = [];
|
|
4385
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
4386
|
+
gradient.push(
|
|
4387
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
4388
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
4389
|
+
);
|
|
4390
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
4391
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
4392
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
4393
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
4394
|
+
index++;
|
|
5143
4395
|
}
|
|
5144
4396
|
}
|
|
5145
|
-
return
|
|
5146
|
-
}
|
|
4397
|
+
return {
|
|
4398
|
+
foreground: process.env[`${prefix}FOREGROUND`],
|
|
4399
|
+
background: process.env[`${prefix}BACKGROUND`],
|
|
4400
|
+
brand: process.env[`${prefix}BRAND`],
|
|
4401
|
+
alternate: process.env[`${prefix}ALTERNATE`],
|
|
4402
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
4403
|
+
link: process.env[`${prefix}LINK`],
|
|
4404
|
+
discovery: process.env[`${prefix}DISCOVERY`],
|
|
4405
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
4406
|
+
info: process.env[`${prefix}INFO`],
|
|
4407
|
+
debug: process.env[`${prefix}DEBUG`],
|
|
4408
|
+
warning: process.env[`${prefix}WARNING`],
|
|
4409
|
+
danger: process.env[`${prefix}DANGER`],
|
|
4410
|
+
fatal: process.env[`${prefix}FATAL`],
|
|
4411
|
+
performance: process.env[`${prefix}PERFORMANCE`],
|
|
4412
|
+
positive: process.env[`${prefix}POSITIVE`],
|
|
4413
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
4414
|
+
gradient
|
|
4415
|
+
};
|
|
4416
|
+
};
|
|
5147
4417
|
|
|
5148
|
-
// ../config-tools/
|
|
4418
|
+
// ../config-tools/src/env/set-env.ts
|
|
5149
4419
|
init_cjs_shims();
|
|
5150
4420
|
var setExtensionEnv = (extensionName, extension) => {
|
|
5151
4421
|
for (const key of Object.keys(extension ?? {})) {
|
|
@@ -5153,7 +4423,7 @@ var setExtensionEnv = (extensionName, extension) => {
|
|
|
5153
4423
|
const result = key?.replace(
|
|
5154
4424
|
/([A-Z])+/g,
|
|
5155
4425
|
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
5156
|
-
).split(/(?=[A-Z])|[.\-\s_]/).map((
|
|
4426
|
+
).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
5157
4427
|
let extensionKey;
|
|
5158
4428
|
if (result.length === 0) {
|
|
5159
4429
|
return;
|
|
@@ -5294,42 +4564,42 @@ var setConfigEnv = (config) => {
|
|
|
5294
4564
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
5295
4565
|
}
|
|
5296
4566
|
if (config.configFile) {
|
|
5297
|
-
process.env[`${prefix}WORKSPACE_CONFIG_FILE`] =
|
|
4567
|
+
process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths(
|
|
5298
4568
|
config.configFile
|
|
5299
4569
|
);
|
|
5300
4570
|
}
|
|
5301
4571
|
if (config.workspaceRoot) {
|
|
5302
|
-
process.env[`${prefix}WORKSPACE_ROOT`] =
|
|
5303
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
5304
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
4572
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
|
|
4573
|
+
process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
|
|
4574
|
+
process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
|
|
5305
4575
|
}
|
|
5306
4576
|
if (config.directories) {
|
|
5307
4577
|
if (!config.skipCache && config.directories.cache) {
|
|
5308
|
-
process.env[`${prefix}CACHE_DIR`] =
|
|
4578
|
+
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
5309
4579
|
config.directories.cache
|
|
5310
4580
|
);
|
|
5311
4581
|
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
5312
4582
|
}
|
|
5313
4583
|
if (config.directories.data) {
|
|
5314
|
-
process.env[`${prefix}DATA_DIR`] =
|
|
4584
|
+
process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
|
|
5315
4585
|
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
5316
4586
|
}
|
|
5317
4587
|
if (config.directories.config) {
|
|
5318
|
-
process.env[`${prefix}CONFIG_DIR`] =
|
|
4588
|
+
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
5319
4589
|
config.directories.config
|
|
5320
4590
|
);
|
|
5321
4591
|
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
5322
4592
|
}
|
|
5323
4593
|
if (config.directories.temp) {
|
|
5324
|
-
process.env[`${prefix}TEMP_DIR`] =
|
|
4594
|
+
process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
|
|
5325
4595
|
process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
|
|
5326
4596
|
}
|
|
5327
4597
|
if (config.directories.log) {
|
|
5328
|
-
process.env[`${prefix}LOG_DIR`] =
|
|
4598
|
+
process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
|
|
5329
4599
|
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
5330
4600
|
}
|
|
5331
4601
|
if (config.directories.build) {
|
|
5332
|
-
process.env[`${prefix}BUILD_DIR`] =
|
|
4602
|
+
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
5333
4603
|
config.directories.build
|
|
5334
4604
|
);
|
|
5335
4605
|
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
@@ -5460,8 +4730,8 @@ var setSingleThemeColorsEnv = (prefix, config) => {
|
|
|
5460
4730
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
5461
4731
|
}
|
|
5462
4732
|
if (config.gradient) {
|
|
5463
|
-
for (let
|
|
5464
|
-
process.env[`${prefix}GRADIENT_${
|
|
4733
|
+
for (let i = 0; i < config.gradient.length; i++) {
|
|
4734
|
+
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
5465
4735
|
}
|
|
5466
4736
|
}
|
|
5467
4737
|
};
|
|
@@ -5521,235 +4791,13 @@ var setBaseThemeColorsEnv = (prefix, config) => {
|
|
|
5521
4791
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
5522
4792
|
}
|
|
5523
4793
|
if (config.gradient) {
|
|
5524
|
-
for (let
|
|
5525
|
-
process.env[`${prefix}GRADIENT_${
|
|
5526
|
-
}
|
|
5527
|
-
}
|
|
5528
|
-
};
|
|
5529
|
-
|
|
5530
|
-
// ../config-tools/dist/chunk-2RLMTBVZ.js
|
|
5531
|
-
init_cjs_shims();
|
|
5532
|
-
var getExtensionEnv = (extensionName) => {
|
|
5533
|
-
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
5534
|
-
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
5535
|
-
const name = key.replace(prefix, "").split("_").map(
|
|
5536
|
-
(i3) => i3.length > 0 ? i3.trim().charAt(0).toUpperCase() + i3.trim().slice(1) : ""
|
|
5537
|
-
).join("");
|
|
5538
|
-
if (name) {
|
|
5539
|
-
ret[name] = process.env[key];
|
|
5540
|
-
}
|
|
5541
|
-
return ret;
|
|
5542
|
-
}, {});
|
|
5543
|
-
};
|
|
5544
|
-
var getConfigEnv = () => {
|
|
5545
|
-
const prefix = "STORM_";
|
|
5546
|
-
let config = {
|
|
5547
|
-
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
5548
|
-
name: process.env[`${prefix}NAME`] || void 0,
|
|
5549
|
-
variant: process.env[`${prefix}VARIANT`] || void 0,
|
|
5550
|
-
namespace: process.env[`${prefix}NAMESPACE`] || void 0,
|
|
5551
|
-
owner: process.env[`${prefix}OWNER`] || void 0,
|
|
5552
|
-
bot: {
|
|
5553
|
-
name: process.env[`${prefix}BOT_NAME`] || void 0,
|
|
5554
|
-
email: process.env[`${prefix}BOT_EMAIL`] || void 0
|
|
5555
|
-
},
|
|
5556
|
-
release: {
|
|
5557
|
-
banner: {
|
|
5558
|
-
url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
|
|
5559
|
-
alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
|
|
5560
|
-
},
|
|
5561
|
-
header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
|
|
5562
|
-
footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
|
|
5563
|
-
},
|
|
5564
|
-
error: {
|
|
5565
|
-
codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
|
|
5566
|
-
url: process.env[`${prefix}ERROR_URL`] || void 0
|
|
5567
|
-
},
|
|
5568
|
-
socials: {
|
|
5569
|
-
twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
|
|
5570
|
-
discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
|
|
5571
|
-
telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
|
|
5572
|
-
slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
|
|
5573
|
-
medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
|
|
5574
|
-
github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
|
|
5575
|
-
},
|
|
5576
|
-
organization: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] ? process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] ? {
|
|
5577
|
-
name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
|
|
5578
|
-
description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
|
|
5579
|
-
url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
|
|
5580
|
-
logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
|
|
5581
|
-
icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
|
|
5582
|
-
} : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
|
|
5583
|
-
packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
|
|
5584
|
-
license: process.env[`${prefix}LICENSE`] || void 0,
|
|
5585
|
-
homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
|
|
5586
|
-
docs: process.env[`${prefix}DOCS`] || void 0,
|
|
5587
|
-
portal: process.env[`${prefix}PORTAL`] || void 0,
|
|
5588
|
-
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
5589
|
-
contact: process.env[`${prefix}CONTACT`] || void 0,
|
|
5590
|
-
support: process.env[`${prefix}SUPPORT`] || void 0,
|
|
5591
|
-
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
5592
|
-
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
5593
|
-
configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths2(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
|
|
5594
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths2(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
5595
|
-
directories: {
|
|
5596
|
-
cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths2(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths2(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
|
|
5597
|
-
data: process.env[`${prefix}DATA_DIR`] ? correctPaths2(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths2(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
|
|
5598
|
-
config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths2(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths2(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
|
|
5599
|
-
temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths2(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths2(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
|
|
5600
|
-
log: process.env[`${prefix}LOG_DIR`] ? correctPaths2(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths2(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
|
|
5601
|
-
build: process.env[`${prefix}BUILD_DIR`] ? correctPaths2(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths2(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
|
|
5602
|
-
},
|
|
5603
|
-
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
5604
|
-
mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
|
|
5605
|
-
// ci:
|
|
5606
|
-
// process.env[`${prefix}CI`] !== undefined
|
|
5607
|
-
// ? Boolean(
|
|
5608
|
-
// process.env[`${prefix}CI`] ??
|
|
5609
|
-
// process.env.CI ??
|
|
5610
|
-
// process.env.CONTINUOUS_INTEGRATION
|
|
5611
|
-
// )
|
|
5612
|
-
// : undefined,
|
|
5613
|
-
repository: process.env[`${prefix}REPOSITORY`] || void 0,
|
|
5614
|
-
branch: process.env[`${prefix}BRANCH`] || void 0,
|
|
5615
|
-
preid: process.env[`${prefix}PRE_ID`] || void 0,
|
|
5616
|
-
registry: {
|
|
5617
|
-
github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
|
|
5618
|
-
npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
|
|
5619
|
-
cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
|
|
5620
|
-
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
5621
|
-
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
5622
|
-
},
|
|
5623
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
5624
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
5625
|
-
) ? getLogLevelLabel(
|
|
5626
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
5627
|
-
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
5628
|
-
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
5629
|
-
};
|
|
5630
|
-
const themeNames = Object.keys(process.env).filter(
|
|
5631
|
-
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && e3.every(
|
|
5632
|
-
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
5633
|
-
)
|
|
5634
|
-
);
|
|
5635
|
-
config.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
5636
|
-
(ret, themeName) => {
|
|
5637
|
-
ret[themeName] = getThemeColorsEnv(prefix, themeName);
|
|
5638
|
-
return ret;
|
|
5639
|
-
},
|
|
5640
|
-
{}
|
|
5641
|
-
) : getThemeColorsEnv(prefix);
|
|
5642
|
-
if (config.docs === s) {
|
|
5643
|
-
if (config.homepage === r) {
|
|
5644
|
-
config.docs = `${r}/projects/${config.name}/docs`;
|
|
5645
|
-
} else {
|
|
5646
|
-
config.docs = `${config.homepage}/docs`;
|
|
5647
|
-
}
|
|
5648
|
-
}
|
|
5649
|
-
if (config.licensing === a) {
|
|
5650
|
-
if (config.homepage === r) {
|
|
5651
|
-
config.licensing = `${r}/projects/${config.name}/licensing`;
|
|
5652
|
-
} else {
|
|
5653
|
-
config.licensing = `${config.homepage}/docs`;
|
|
5654
|
-
}
|
|
5655
|
-
}
|
|
5656
|
-
const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
|
|
5657
|
-
if (serializedConfig) {
|
|
5658
|
-
const parsed = JSON.parse(serializedConfig);
|
|
5659
|
-
config = {
|
|
5660
|
-
...config,
|
|
5661
|
-
...parsed,
|
|
5662
|
-
colors: { ...config.colors, ...parsed.colors },
|
|
5663
|
-
extensions: { ...config.extensions, ...parsed.extensions }
|
|
5664
|
-
};
|
|
5665
|
-
}
|
|
5666
|
-
return config;
|
|
5667
|
-
};
|
|
5668
|
-
var getThemeColorsEnv = (prefix, theme) => {
|
|
5669
|
-
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
5670
|
-
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
|
|
5671
|
-
};
|
|
5672
|
-
var getSingleThemeColorsEnv = (prefix) => {
|
|
5673
|
-
const gradient = [];
|
|
5674
|
-
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
5675
|
-
gradient.push(
|
|
5676
|
-
process.env[`${prefix}GRADIENT_START`],
|
|
5677
|
-
process.env[`${prefix}GRADIENT_END`]
|
|
5678
|
-
);
|
|
5679
|
-
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
5680
|
-
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
5681
|
-
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
5682
|
-
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
5683
|
-
index++;
|
|
5684
|
-
}
|
|
5685
|
-
}
|
|
5686
|
-
return {
|
|
5687
|
-
dark: process.env[`${prefix}DARK`],
|
|
5688
|
-
light: process.env[`${prefix}LIGHT`],
|
|
5689
|
-
brand: process.env[`${prefix}BRAND`],
|
|
5690
|
-
alternate: process.env[`${prefix}ALTERNATE`],
|
|
5691
|
-
accent: process.env[`${prefix}ACCENT`],
|
|
5692
|
-
link: process.env[`${prefix}LINK`],
|
|
5693
|
-
discovery: process.env[`${prefix}DISCOVERY`],
|
|
5694
|
-
success: process.env[`${prefix}SUCCESS`],
|
|
5695
|
-
info: process.env[`${prefix}INFO`],
|
|
5696
|
-
debug: process.env[`${prefix}DEBUG`],
|
|
5697
|
-
warning: process.env[`${prefix}WARNING`],
|
|
5698
|
-
danger: process.env[`${prefix}DANGER`],
|
|
5699
|
-
fatal: process.env[`${prefix}FATAL`],
|
|
5700
|
-
performance: process.env[`${prefix}PERFORMANCE`],
|
|
5701
|
-
positive: process.env[`${prefix}POSITIVE`],
|
|
5702
|
-
negative: process.env[`${prefix}NEGATIVE`],
|
|
5703
|
-
gradient
|
|
5704
|
-
};
|
|
5705
|
-
};
|
|
5706
|
-
var getMultiThemeColorsEnv = (prefix) => {
|
|
5707
|
-
return {
|
|
5708
|
-
light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
|
|
5709
|
-
dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
|
|
5710
|
-
};
|
|
5711
|
-
};
|
|
5712
|
-
var getBaseThemeColorsEnv = (prefix) => {
|
|
5713
|
-
const gradient = [];
|
|
5714
|
-
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
5715
|
-
gradient.push(
|
|
5716
|
-
process.env[`${prefix}GRADIENT_START`],
|
|
5717
|
-
process.env[`${prefix}GRADIENT_END`]
|
|
5718
|
-
);
|
|
5719
|
-
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
5720
|
-
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
5721
|
-
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
5722
|
-
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
5723
|
-
index++;
|
|
4794
|
+
for (let i = 0; i < config.gradient.length; i++) {
|
|
4795
|
+
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
5724
4796
|
}
|
|
5725
4797
|
}
|
|
5726
|
-
return {
|
|
5727
|
-
foreground: process.env[`${prefix}FOREGROUND`],
|
|
5728
|
-
background: process.env[`${prefix}BACKGROUND`],
|
|
5729
|
-
brand: process.env[`${prefix}BRAND`],
|
|
5730
|
-
alternate: process.env[`${prefix}ALTERNATE`],
|
|
5731
|
-
accent: process.env[`${prefix}ACCENT`],
|
|
5732
|
-
link: process.env[`${prefix}LINK`],
|
|
5733
|
-
discovery: process.env[`${prefix}DISCOVERY`],
|
|
5734
|
-
success: process.env[`${prefix}SUCCESS`],
|
|
5735
|
-
info: process.env[`${prefix}INFO`],
|
|
5736
|
-
debug: process.env[`${prefix}DEBUG`],
|
|
5737
|
-
warning: process.env[`${prefix}WARNING`],
|
|
5738
|
-
danger: process.env[`${prefix}DANGER`],
|
|
5739
|
-
fatal: process.env[`${prefix}FATAL`],
|
|
5740
|
-
performance: process.env[`${prefix}PERFORMANCE`],
|
|
5741
|
-
positive: process.env[`${prefix}POSITIVE`],
|
|
5742
|
-
negative: process.env[`${prefix}NEGATIVE`],
|
|
5743
|
-
gradient
|
|
5744
|
-
};
|
|
5745
4798
|
};
|
|
5746
4799
|
|
|
5747
|
-
// ../config/
|
|
5748
|
-
init_cjs_shims();
|
|
5749
|
-
|
|
5750
|
-
// ../config-tools/dist/chunk-J777WNCU.js
|
|
5751
|
-
var import_defu4 = __toESM(require("defu"), 1);
|
|
5752
|
-
var import_node_fs9 = require("fs");
|
|
4800
|
+
// ../config-tools/src/create-storm-config.ts
|
|
5753
4801
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
5754
4802
|
var _static_cache = void 0;
|
|
5755
4803
|
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|
|
@@ -5757,7 +4805,7 @@ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, sk
|
|
|
5757
4805
|
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
5758
4806
|
let _workspaceRoot = workspaceRoot;
|
|
5759
4807
|
if (!_workspaceRoot) {
|
|
5760
|
-
_workspaceRoot =
|
|
4808
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
5761
4809
|
}
|
|
5762
4810
|
const configEnv = getConfigEnv();
|
|
5763
4811
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
@@ -5773,17 +4821,17 @@ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, sk
|
|
|
5773
4821
|
}
|
|
5774
4822
|
}
|
|
5775
4823
|
const defaultConfig = await getPackageJsonConfig(_workspaceRoot);
|
|
5776
|
-
const configInput = (0,
|
|
4824
|
+
const configInput = (0, import_defu2.default)(
|
|
5777
4825
|
configEnv,
|
|
5778
4826
|
configFile,
|
|
5779
4827
|
defaultConfig
|
|
5780
4828
|
);
|
|
5781
4829
|
if (!configInput.variant) {
|
|
5782
|
-
configInput.variant = (0,
|
|
4830
|
+
configInput.variant = (0, import_node_fs5.existsSync)(joinPaths(_workspaceRoot, "nx.json")) || (0, import_node_fs5.existsSync)(joinPaths(_workspaceRoot, ".nx")) || (0, import_node_fs5.existsSync)(joinPaths(_workspaceRoot, "lerna.json")) || (0, import_node_fs5.existsSync)(joinPaths(_workspaceRoot, "turbo.json")) ? "monorepo" : "minimal";
|
|
5783
4831
|
}
|
|
5784
4832
|
try {
|
|
5785
4833
|
const parseResult = await Promise.resolve(
|
|
5786
|
-
|
|
4834
|
+
workspaceConfigSchema._zod.parse(
|
|
5787
4835
|
{ value: configInput, issues: [] },
|
|
5788
4836
|
{ async: true }
|
|
5789
4837
|
)
|
|
@@ -5848,29 +4896,63 @@ ${formatLogMessage(config)}`,
|
|
|
5848
4896
|
return config;
|
|
5849
4897
|
};
|
|
5850
4898
|
|
|
5851
|
-
// ../config-tools/
|
|
4899
|
+
// ../config-tools/src/get-config.ts
|
|
4900
|
+
init_cjs_shims();
|
|
5852
4901
|
function getConfig(workspaceRoot, skipLogs = false) {
|
|
5853
4902
|
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
5854
4903
|
}
|
|
5855
4904
|
function getWorkspaceConfig(skipLogs = true, options2 = {}) {
|
|
5856
4905
|
let workspaceRoot = options2.workspaceRoot;
|
|
5857
4906
|
if (!workspaceRoot) {
|
|
5858
|
-
workspaceRoot =
|
|
4907
|
+
workspaceRoot = findWorkspaceRoot(options2.cwd);
|
|
5859
4908
|
}
|
|
5860
4909
|
return getConfig(workspaceRoot, skipLogs);
|
|
5861
4910
|
}
|
|
5862
4911
|
|
|
5863
|
-
// ../
|
|
4912
|
+
// ../build-tools/src/utilities/get-entry-points.ts
|
|
4913
|
+
var import_glob3 = require("glob");
|
|
4914
|
+
|
|
4915
|
+
// ../build-tools/src/utilities/get-env.ts
|
|
4916
|
+
init_cjs_shims();
|
|
4917
|
+
var getEnv = (builder, options2) => {
|
|
4918
|
+
return {
|
|
4919
|
+
STORM_BUILD: builder,
|
|
4920
|
+
STORM_ORG: options2.orgName || DEFAULT_ORGANIZATION,
|
|
4921
|
+
STORM_NAME: options2.name,
|
|
4922
|
+
STORM_MODE: options2.mode || DEFAULT_ENVIRONMENT,
|
|
4923
|
+
STORM_PLATFORM: options2.platform,
|
|
4924
|
+
STORM_FORMAT: JSON.stringify(options2.format),
|
|
4925
|
+
STORM_TARGET: JSON.stringify(options2.target),
|
|
4926
|
+
...options2.env
|
|
4927
|
+
};
|
|
4928
|
+
};
|
|
4929
|
+
|
|
4930
|
+
// ../build-tools/src/utilities/get-file-banner.ts
|
|
4931
|
+
init_cjs_shims();
|
|
4932
|
+
|
|
4933
|
+
// ../build-tools/src/utilities/get-out-extension.ts
|
|
4934
|
+
init_cjs_shims();
|
|
4935
|
+
|
|
4936
|
+
// ../build-tools/src/utilities/get-project-deps.ts
|
|
5864
4937
|
init_cjs_shims();
|
|
5865
4938
|
|
|
4939
|
+
// ../build-tools/src/utilities/read-nx-config.ts
|
|
4940
|
+
init_cjs_shims();
|
|
4941
|
+
var import_node_fs6 = require("fs");
|
|
4942
|
+
var import_promises4 = require("fs/promises");
|
|
4943
|
+
|
|
4944
|
+
// ../build-tools/src/utilities/task-graph.ts
|
|
4945
|
+
init_cjs_shims();
|
|
4946
|
+
var import_create_task_graph = require("nx/src/tasks-runner/create-task-graph");
|
|
4947
|
+
|
|
5866
4948
|
// src/options.ts
|
|
5867
|
-
var
|
|
5868
|
-
var
|
|
5869
|
-
var
|
|
5870
|
-
var
|
|
4949
|
+
var import_defu3 = __toESM(require("defu"), 1);
|
|
4950
|
+
var import_node_fs7 = require("fs");
|
|
4951
|
+
var import_promises5 = __toESM(require("fs/promises"), 1);
|
|
4952
|
+
var import_find_workspace_root5 = require("nx/src/utils/find-workspace-root");
|
|
5871
4953
|
async function resolveOptions(userOptions) {
|
|
5872
4954
|
const projectRoot = userOptions.projectRoot;
|
|
5873
|
-
const workspaceRoot = (0,
|
|
4955
|
+
const workspaceRoot = (0, import_find_workspace_root5.findWorkspaceRoot)(projectRoot);
|
|
5874
4956
|
if (!workspaceRoot) {
|
|
5875
4957
|
throw new Error("Cannot find Nx workspace root");
|
|
5876
4958
|
}
|
|
@@ -5881,36 +4963,36 @@ async function resolveOptions(userOptions) {
|
|
|
5881
4963
|
writeDebug(" \u2699\uFE0F Resolving build options", workspaceConfig);
|
|
5882
4964
|
}
|
|
5883
4965
|
const stopwatch = getStopwatch("Build options resolution");
|
|
5884
|
-
const projectJsonPath =
|
|
4966
|
+
const projectJsonPath = joinPaths(
|
|
5885
4967
|
workspaceRoot.dir,
|
|
5886
4968
|
projectRoot,
|
|
5887
4969
|
"project.json"
|
|
5888
4970
|
);
|
|
5889
|
-
if (!(0,
|
|
4971
|
+
if (!(0, import_node_fs7.existsSync)(projectJsonPath)) {
|
|
5890
4972
|
throw new Error("Cannot find project.json configuration");
|
|
5891
4973
|
}
|
|
5892
|
-
const projectJsonFile = await
|
|
4974
|
+
const projectJsonFile = await import_promises5.default.readFile(projectJsonPath, "utf8");
|
|
5893
4975
|
const projectJson = JSON.parse(projectJsonFile);
|
|
5894
4976
|
const projectName = projectJson.name || userOptions.name;
|
|
5895
|
-
const options2 = (0,
|
|
4977
|
+
const options2 = (0, import_defu3.default)(userOptions, DEFAULT_BUILD_OPTIONS);
|
|
5896
4978
|
options2.name ??= projectName;
|
|
5897
|
-
const packageJsonPath =
|
|
4979
|
+
const packageJsonPath = joinPaths(
|
|
5898
4980
|
workspaceRoot.dir,
|
|
5899
4981
|
options2.projectRoot,
|
|
5900
4982
|
"package.json"
|
|
5901
4983
|
);
|
|
5902
|
-
if (!(0,
|
|
4984
|
+
if (!(0, import_node_fs7.existsSync)(packageJsonPath)) {
|
|
5903
4985
|
throw new Error("Cannot find package.json configuration");
|
|
5904
4986
|
}
|
|
5905
4987
|
const env = getEnv("esbuild", options2);
|
|
5906
4988
|
const resolvedOptions = {
|
|
5907
4989
|
name: projectName,
|
|
5908
|
-
entry: [
|
|
4990
|
+
entry: [joinPaths(workspaceRoot.dir, projectRoot, "src/index.ts")],
|
|
5909
4991
|
clean: true,
|
|
5910
4992
|
workspaceConfig,
|
|
5911
4993
|
...options2,
|
|
5912
|
-
outDir: options2.outputPath ||
|
|
5913
|
-
tsconfig: userOptions.tsconfig === null ? void 0 : userOptions.tsconfig ? userOptions.tsconfig :
|
|
4994
|
+
outDir: options2.outputPath || joinPaths(workspaceConfig.workspaceRoot, "dist", options2.projectRoot),
|
|
4995
|
+
tsconfig: userOptions.tsconfig === null ? void 0 : userOptions.tsconfig ? userOptions.tsconfig : joinPaths(workspaceRoot.dir, projectRoot, "tsconfig.json"),
|
|
5914
4996
|
env: Object.keys(env).filter((key) => env[key] !== void 0).reduce((ret, key) => {
|
|
5915
4997
|
const value = JSON.stringify(env[key]);
|
|
5916
4998
|
const safeKey = key.replaceAll("(", "").replaceAll(")", "");
|