@storm-software/tsup 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/dist/chunk-7BI4SQSF.js +55 -0
- package/dist/chunk-B45SNTGS.js +6 -0
- package/dist/chunk-HXQ4DP27.js +772 -0
- package/dist/chunk-LLANCUPW.js +1712 -0
- package/dist/constants.cjs +732 -0
- package/dist/constants.d.cts +8 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.js +7 -0
- package/dist/index.cjs +2318 -138
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +52 -362
- package/dist/options.cjs +2389 -0
- package/dist/options.d.cts +14 -0
- package/dist/options.d.ts +14 -0
- package/dist/options.js +8 -0
- package/dist/types.cjs +18 -0
- package/dist/types.d.cts +12 -0
- package/dist/types.d.ts +12 -0
- package/dist/types.js +2 -0
- package/package.json +42 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Options } from 'tsup';
|
|
2
|
-
export {
|
|
2
|
+
export { DEFAULT_BUILD_OPTIONS } from './constants.cjs';
|
|
3
|
+
export { resolveOptions } from './options.cjs';
|
|
4
|
+
export { BuildOptions, ResolvedBuildOptions } from './types.cjs';
|
|
5
|
+
import '@storm-software/build-tools';
|
|
6
|
+
import 'esbuild';
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* Execute tsup with all the configurations we pass
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Options } from 'tsup';
|
|
2
|
-
export {
|
|
2
|
+
export { DEFAULT_BUILD_OPTIONS } from './constants.js';
|
|
3
|
+
export { resolveOptions } from './options.js';
|
|
4
|
+
export { BuildOptions, ResolvedBuildOptions } from './types.js';
|
|
5
|
+
import '@storm-software/build-tools';
|
|
6
|
+
import 'esbuild';
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* Execute tsup with all the configurations we pass
|
package/dist/index.js
CHANGED
|
@@ -1,50 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
28
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
33
|
-
mod
|
|
34
|
-
));
|
|
35
|
-
|
|
36
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__27cd8c2707e42da8a6ff3e707ec47ae0/node_modules/tsup/assets/esm_shims.js
|
|
37
|
-
import { fileURLToPath } from "url";
|
|
38
|
-
import path from "path";
|
|
39
|
-
var getFilename, getDirname, __dirname;
|
|
40
|
-
var init_esm_shims = __esm({
|
|
41
|
-
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__27cd8c2707e42da8a6ff3e707ec47ae0/node_modules/tsup/assets/esm_shims.js"() {
|
|
42
|
-
"use strict";
|
|
43
|
-
getFilename = () => fileURLToPath(import.meta.url);
|
|
44
|
-
getDirname = () => path.dirname(getFilename());
|
|
45
|
-
__dirname = /* @__PURE__ */ getDirname();
|
|
46
|
-
}
|
|
47
|
-
});
|
|
1
|
+
import {
|
|
2
|
+
getStopwatch,
|
|
3
|
+
resolveOptions,
|
|
4
|
+
writeDebug
|
|
5
|
+
} from "./chunk-LLANCUPW.js";
|
|
6
|
+
import {
|
|
7
|
+
DEFAULT_BUILD_OPTIONS
|
|
8
|
+
} from "./chunk-HXQ4DP27.js";
|
|
9
|
+
import "./chunk-B45SNTGS.js";
|
|
10
|
+
import {
|
|
11
|
+
__commonJS,
|
|
12
|
+
__dirname,
|
|
13
|
+
__require,
|
|
14
|
+
__toESM,
|
|
15
|
+
init_esm_shims
|
|
16
|
+
} from "./chunk-7BI4SQSF.js";
|
|
48
17
|
|
|
49
18
|
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__27cd8c2707e42da8a6ff3e707ec47ae0/node_modules/tsup/dist/chunk-BYH4XDRH.js
|
|
50
19
|
var require_chunk_BYH4XDRH = __commonJS({
|
|
@@ -91,12 +60,12 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
91
60
|
}
|
|
92
61
|
return value;
|
|
93
62
|
}
|
|
94
|
-
var
|
|
95
|
-
var
|
|
96
|
-
var
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
-
var
|
|
63
|
+
var __create = Object.create;
|
|
64
|
+
var __defProp = Object.defineProperty;
|
|
65
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
66
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
67
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
68
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
100
69
|
var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
101
70
|
get: (a, b) => (typeof __require !== "undefined" ? __require : a)[b]
|
|
102
71
|
}) : x)(function(x) {
|
|
@@ -104,22 +73,22 @@ var require_chunk_TWFEYLU4 = __commonJS({
|
|
|
104
73
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
105
74
|
});
|
|
106
75
|
var __commonJS2 = (cb, mod) => function __require22() {
|
|
107
|
-
return mod || (0, cb[
|
|
76
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
108
77
|
};
|
|
109
|
-
var
|
|
78
|
+
var __copyProps = (to, from, except, desc) => {
|
|
110
79
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
111
|
-
for (let key of
|
|
112
|
-
if (!
|
|
113
|
-
|
|
80
|
+
for (let key of __getOwnPropNames(from))
|
|
81
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
82
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
114
83
|
}
|
|
115
84
|
return to;
|
|
116
85
|
};
|
|
117
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ?
|
|
86
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
118
87
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
119
88
|
// file that has been converted to a CommonJS file using a Babel-
|
|
120
89
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
121
90
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
122
|
-
isNodeMode || !mod || !mod.__esModule ?
|
|
91
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
123
92
|
mod
|
|
124
93
|
));
|
|
125
94
|
var _fs = __import_fs;
|
|
@@ -737,23 +706,23 @@ var require_commonjs_plugin = __commonJS({
|
|
|
737
706
|
"../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__27cd8c2707e42da8a6ff3e707ec47ae0/node_modules/tsup/dist/commonjs-plugin.js"(exports, module) {
|
|
738
707
|
"use strict";
|
|
739
708
|
init_esm_shims();
|
|
740
|
-
var
|
|
741
|
-
var
|
|
742
|
-
var
|
|
743
|
-
var
|
|
709
|
+
var __defProp = Object.defineProperty;
|
|
710
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
711
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
712
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
744
713
|
var __export = (target, all) => {
|
|
745
714
|
for (var name in all)
|
|
746
|
-
|
|
715
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
747
716
|
};
|
|
748
|
-
var
|
|
717
|
+
var __copyProps = (to, from, except, desc) => {
|
|
749
718
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
750
|
-
for (let key of
|
|
751
|
-
if (!
|
|
752
|
-
|
|
719
|
+
for (let key of __getOwnPropNames(from))
|
|
720
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
721
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
753
722
|
}
|
|
754
723
|
return to;
|
|
755
724
|
};
|
|
756
|
-
var __toCommonJS = (mod) =>
|
|
725
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
757
726
|
var index_exports = {};
|
|
758
727
|
__export(index_exports, {
|
|
759
728
|
commonjs: () => commonjs,
|
|
@@ -928,7 +897,7 @@ var require_commonjs_plugin = __commonJS({
|
|
|
928
897
|
} = {}) {
|
|
929
898
|
const init_cjs_module_lexer = transform ? import("cjs-module-lexer") : void 0;
|
|
930
899
|
const use_default_export = typeof requireReturnsDefault === "function" ? requireReturnsDefault : (_path) => requireReturnsDefault;
|
|
931
|
-
const is_ignored = typeof ignore === "function" ? ignore : Array.isArray(ignore) ? (
|
|
900
|
+
const is_ignored = typeof ignore === "function" ? ignore : Array.isArray(ignore) ? (path) => ignore.includes(path) : () => false;
|
|
932
901
|
return {
|
|
933
902
|
name: "commonjs",
|
|
934
903
|
setup({ onLoad, esbuild }) {
|
|
@@ -1007,8 +976,8 @@ var require_commonjs_plugin = __commonJS({
|
|
|
1007
976
|
}
|
|
1008
977
|
contents = transformed.join("\n") + (sourcemap ? "\n" + sourcemap : "");
|
|
1009
978
|
}
|
|
1010
|
-
function makeName(
|
|
1011
|
-
let name = `__import_${makeLegalIdentifier(
|
|
979
|
+
function makeName(path) {
|
|
980
|
+
let name = `__import_${makeLegalIdentifier(path)}`;
|
|
1012
981
|
if (contents.includes(name)) {
|
|
1013
982
|
let suffix = 2;
|
|
1014
983
|
while (contents.includes(`${name}${suffix}`)) suffix++;
|
|
@@ -1031,15 +1000,15 @@ var require_commonjs_plugin = __commonJS({
|
|
|
1031
1000
|
if (location === null) continue;
|
|
1032
1001
|
const { line, lineText, column, length } = location;
|
|
1033
1002
|
const leftBrace = column + length + 1;
|
|
1034
|
-
const
|
|
1035
|
-
if (
|
|
1036
|
-
const rightBrace = lineText.indexOf(")", leftBrace + 2 +
|
|
1037
|
-
let name = makeName(
|
|
1003
|
+
const path = lexer.readString(lineText, leftBrace);
|
|
1004
|
+
if (path === null || is_ignored(path)) continue;
|
|
1005
|
+
const rightBrace = lineText.indexOf(")", leftBrace + 2 + path.length) + 1;
|
|
1006
|
+
let name = makeName(path);
|
|
1038
1007
|
let import_statement;
|
|
1039
|
-
if (use_default_export(
|
|
1040
|
-
import_statement = `import ${name} from ${JSON.stringify(
|
|
1008
|
+
if (use_default_export(path)) {
|
|
1009
|
+
import_statement = `import ${name} from ${JSON.stringify(path)};`;
|
|
1041
1010
|
} else {
|
|
1042
|
-
import_statement = `import * as ${name} from ${JSON.stringify(
|
|
1011
|
+
import_statement = `import * as ${name} from ${JSON.stringify(path)};`;
|
|
1043
1012
|
}
|
|
1044
1013
|
let offset2 = getOffset(line - 1);
|
|
1045
1014
|
edits.push([offset2 + column, offset2 + rightBrace, name]);
|
|
@@ -2735,287 +2704,6 @@ module.exports = exports.default;
|
|
|
2735
2704
|
|
|
2736
2705
|
// src/index.ts
|
|
2737
2706
|
init_esm_shims();
|
|
2738
|
-
|
|
2739
|
-
// ../config-tools/dist/logger/console.js
|
|
2740
|
-
init_esm_shims();
|
|
2741
|
-
|
|
2742
|
-
// ../config-tools/dist/chunk-7L77OWOV.js
|
|
2743
|
-
init_esm_shims();
|
|
2744
|
-
|
|
2745
|
-
// ../config-tools/dist/chunk-LA3S35UI.js
|
|
2746
|
-
init_esm_shims();
|
|
2747
|
-
var DEFAULT_COLOR_CONFIG = {
|
|
2748
|
-
light: {
|
|
2749
|
-
background: "#fafafa",
|
|
2750
|
-
foreground: "#1d1e22",
|
|
2751
|
-
brand: "#1fb2a6",
|
|
2752
|
-
alternate: "#db2777",
|
|
2753
|
-
help: "#5C4EE5",
|
|
2754
|
-
success: "#087f5b",
|
|
2755
|
-
info: "#0550ae",
|
|
2756
|
-
warning: "#e3b341",
|
|
2757
|
-
danger: "#D8314A",
|
|
2758
|
-
fatal: "#51070f",
|
|
2759
|
-
link: "#3fa6ff",
|
|
2760
|
-
positive: "#22c55e",
|
|
2761
|
-
negative: "#dc2626",
|
|
2762
|
-
gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
|
|
2763
|
-
},
|
|
2764
|
-
dark: {
|
|
2765
|
-
background: "#1d1e22",
|
|
2766
|
-
foreground: "#cbd5e1",
|
|
2767
|
-
brand: "#2dd4bf",
|
|
2768
|
-
alternate: "#db2777",
|
|
2769
|
-
help: "#818cf8",
|
|
2770
|
-
success: "#10b981",
|
|
2771
|
-
info: "#58a6ff",
|
|
2772
|
-
warning: "#f3d371",
|
|
2773
|
-
danger: "#D8314A",
|
|
2774
|
-
fatal: "#a40e26",
|
|
2775
|
-
link: "#3fa6ff",
|
|
2776
|
-
positive: "#22c55e",
|
|
2777
|
-
negative: "#dc2626",
|
|
2778
|
-
gradient: ["#1fb2a6", "#db2777", "#818cf8"]
|
|
2779
|
-
}
|
|
2780
|
-
};
|
|
2781
|
-
|
|
2782
|
-
// ../config-tools/dist/chunk-HVVJHTFS.js
|
|
2783
|
-
init_esm_shims();
|
|
2784
|
-
import chalk from "chalk";
|
|
2785
|
-
var chalkDefault = {
|
|
2786
|
-
hex: (_) => (message) => message,
|
|
2787
|
-
bgHex: (_) => ({
|
|
2788
|
-
whiteBright: (message) => message,
|
|
2789
|
-
white: (message) => message
|
|
2790
|
-
}),
|
|
2791
|
-
white: (message) => message,
|
|
2792
|
-
whiteBright: (message) => message,
|
|
2793
|
-
gray: (message) => message,
|
|
2794
|
-
bold: {
|
|
2795
|
-
hex: (_) => (message) => message,
|
|
2796
|
-
bgHex: (_) => ({
|
|
2797
|
-
whiteBright: (message) => message,
|
|
2798
|
-
white: (message) => message
|
|
2799
|
-
}),
|
|
2800
|
-
whiteBright: (message) => message,
|
|
2801
|
-
white: (message) => message
|
|
2802
|
-
},
|
|
2803
|
-
dim: {
|
|
2804
|
-
hex: (_) => (message) => message,
|
|
2805
|
-
gray: (message) => message
|
|
2806
|
-
}
|
|
2807
|
-
};
|
|
2808
|
-
var getChalk = () => {
|
|
2809
|
-
let _chalk = chalk;
|
|
2810
|
-
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
|
|
2811
|
-
_chalk = chalkDefault;
|
|
2812
|
-
}
|
|
2813
|
-
return _chalk;
|
|
2814
|
-
};
|
|
2815
|
-
|
|
2816
|
-
// ../config-tools/dist/chunk-LM2UMGYA.js
|
|
2817
|
-
init_esm_shims();
|
|
2818
|
-
|
|
2819
|
-
// ../config-tools/dist/chunk-G2MK47WL.js
|
|
2820
|
-
init_esm_shims();
|
|
2821
|
-
function isUnicodeSupported() {
|
|
2822
|
-
if (process.platform !== "win32") {
|
|
2823
|
-
return process.env.TERM !== "linux";
|
|
2824
|
-
}
|
|
2825
|
-
return Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
2826
|
-
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
2827
|
-
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
2828
|
-
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";
|
|
2829
|
-
}
|
|
2830
|
-
|
|
2831
|
-
// ../config-tools/dist/chunk-POXTJ6GF.js
|
|
2832
|
-
init_esm_shims();
|
|
2833
|
-
var LogLevel = {
|
|
2834
|
-
SILENT: 0,
|
|
2835
|
-
FATAL: 10,
|
|
2836
|
-
ERROR: 20,
|
|
2837
|
-
WARN: 30,
|
|
2838
|
-
SUCCESS: 35,
|
|
2839
|
-
INFO: 40,
|
|
2840
|
-
DEBUG: 60,
|
|
2841
|
-
TRACE: 70,
|
|
2842
|
-
ALL: 100
|
|
2843
|
-
};
|
|
2844
|
-
var LogLevelLabel = {
|
|
2845
|
-
SILENT: "silent",
|
|
2846
|
-
FATAL: "fatal",
|
|
2847
|
-
ERROR: "error",
|
|
2848
|
-
WARN: "warn",
|
|
2849
|
-
SUCCESS: "success",
|
|
2850
|
-
INFO: "info",
|
|
2851
|
-
DEBUG: "debug",
|
|
2852
|
-
TRACE: "trace",
|
|
2853
|
-
ALL: "all"
|
|
2854
|
-
};
|
|
2855
|
-
|
|
2856
|
-
// ../config-tools/dist/chunk-LM2UMGYA.js
|
|
2857
|
-
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
2858
|
-
var CONSOLE_ICONS = {
|
|
2859
|
-
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
2860
|
-
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
2861
|
-
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
2862
|
-
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
2863
|
-
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
2864
|
-
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
2865
|
-
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
2866
|
-
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
2867
|
-
};
|
|
2868
|
-
|
|
2869
|
-
// ../config-tools/dist/chunk-CZ4IE2QN.js
|
|
2870
|
-
init_esm_shims();
|
|
2871
|
-
var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
|
|
2872
|
-
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
2873
|
-
};
|
|
2874
|
-
|
|
2875
|
-
// ../config-tools/dist/chunk-K4CDYUQR.js
|
|
2876
|
-
init_esm_shims();
|
|
2877
|
-
var getLogLevel = (label) => {
|
|
2878
|
-
switch (label) {
|
|
2879
|
-
case "all":
|
|
2880
|
-
return LogLevel.ALL;
|
|
2881
|
-
case "trace":
|
|
2882
|
-
return LogLevel.TRACE;
|
|
2883
|
-
case "debug":
|
|
2884
|
-
return LogLevel.DEBUG;
|
|
2885
|
-
case "info":
|
|
2886
|
-
return LogLevel.INFO;
|
|
2887
|
-
case "warn":
|
|
2888
|
-
return LogLevel.WARN;
|
|
2889
|
-
case "error":
|
|
2890
|
-
return LogLevel.ERROR;
|
|
2891
|
-
case "fatal":
|
|
2892
|
-
return LogLevel.FATAL;
|
|
2893
|
-
case "silent":
|
|
2894
|
-
return LogLevel.SILENT;
|
|
2895
|
-
default:
|
|
2896
|
-
return LogLevel.INFO;
|
|
2897
|
-
}
|
|
2898
|
-
};
|
|
2899
|
-
|
|
2900
|
-
// ../config-tools/dist/chunk-7L77OWOV.js
|
|
2901
|
-
var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
2902
|
-
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;
|
|
2903
|
-
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
2904
|
-
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
2905
|
-
return (_) => {
|
|
2906
|
-
};
|
|
2907
|
-
}
|
|
2908
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
2909
|
-
return (message) => {
|
|
2910
|
-
console.error(
|
|
2911
|
-
`
|
|
2912
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2913
|
-
`
|
|
2914
|
-
);
|
|
2915
|
-
};
|
|
2916
|
-
}
|
|
2917
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
2918
|
-
return (message) => {
|
|
2919
|
-
console.error(
|
|
2920
|
-
`
|
|
2921
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2922
|
-
`
|
|
2923
|
-
);
|
|
2924
|
-
};
|
|
2925
|
-
}
|
|
2926
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
2927
|
-
return (message) => {
|
|
2928
|
-
console.warn(
|
|
2929
|
-
`
|
|
2930
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2931
|
-
`
|
|
2932
|
-
);
|
|
2933
|
-
};
|
|
2934
|
-
}
|
|
2935
|
-
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
2936
|
-
return (message) => {
|
|
2937
|
-
console.info(
|
|
2938
|
-
`
|
|
2939
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2940
|
-
`
|
|
2941
|
-
);
|
|
2942
|
-
};
|
|
2943
|
-
}
|
|
2944
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
2945
|
-
return (message) => {
|
|
2946
|
-
console.info(
|
|
2947
|
-
`
|
|
2948
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2949
|
-
`
|
|
2950
|
-
);
|
|
2951
|
-
};
|
|
2952
|
-
}
|
|
2953
|
-
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
2954
|
-
return (message) => {
|
|
2955
|
-
console.debug(
|
|
2956
|
-
`
|
|
2957
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2958
|
-
`
|
|
2959
|
-
);
|
|
2960
|
-
};
|
|
2961
|
-
}
|
|
2962
|
-
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
2963
|
-
return (message) => {
|
|
2964
|
-
console.debug(
|
|
2965
|
-
`
|
|
2966
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2967
|
-
`
|
|
2968
|
-
);
|
|
2969
|
-
};
|
|
2970
|
-
}
|
|
2971
|
-
return (message) => {
|
|
2972
|
-
console.log(
|
|
2973
|
-
`
|
|
2974
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2975
|
-
`
|
|
2976
|
-
);
|
|
2977
|
-
};
|
|
2978
|
-
};
|
|
2979
|
-
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
2980
|
-
var getStopwatch = (name) => {
|
|
2981
|
-
const start = process.hrtime();
|
|
2982
|
-
return () => {
|
|
2983
|
-
const end = process.hrtime(start);
|
|
2984
|
-
console.info(
|
|
2985
|
-
`
|
|
2986
|
-
> \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
2987
|
-
end[0] * 1e3 + end[1] / 1e6
|
|
2988
|
-
)}ms to complete
|
|
2989
|
-
`
|
|
2990
|
-
);
|
|
2991
|
-
};
|
|
2992
|
-
};
|
|
2993
|
-
var MAX_DEPTH = 4;
|
|
2994
|
-
var formatLogMessage = (message, options2 = {}, depth = 0) => {
|
|
2995
|
-
if (depth > MAX_DEPTH) {
|
|
2996
|
-
return "<max depth>";
|
|
2997
|
-
}
|
|
2998
|
-
const prefix = options2.prefix ?? "-";
|
|
2999
|
-
const skip = options2.skip ?? [];
|
|
3000
|
-
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
3001
|
-
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
3002
|
-
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
3003
|
-
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
3004
|
-
message[key],
|
|
3005
|
-
{ prefix: `${prefix}-`, skip },
|
|
3006
|
-
depth + 1
|
|
3007
|
-
) : message[key]}`
|
|
3008
|
-
).join("\n")}` : message;
|
|
3009
|
-
};
|
|
3010
|
-
var _isFunction = (value) => {
|
|
3011
|
-
try {
|
|
3012
|
-
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
3013
|
-
} catch {
|
|
3014
|
-
return false;
|
|
3015
|
-
}
|
|
3016
|
-
};
|
|
3017
|
-
|
|
3018
|
-
// src/index.ts
|
|
3019
2707
|
var import_tsup = __toESM(require_dist(), 1);
|
|
3020
2708
|
async function build(options2) {
|
|
3021
2709
|
writeDebug(
|
|
@@ -3027,5 +2715,7 @@ async function build(options2) {
|
|
|
3027
2715
|
stopwatch();
|
|
3028
2716
|
}
|
|
3029
2717
|
export {
|
|
3030
|
-
|
|
2718
|
+
DEFAULT_BUILD_OPTIONS,
|
|
2719
|
+
build,
|
|
2720
|
+
resolveOptions
|
|
3031
2721
|
};
|