@ariestools/toolchain 8.7.25 → 8.7.27
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/dist/actions/deplint/checkPackage/getUnsatisfiedPeerDependencies.d.ts +10 -5
- package/dist/actions/deplint/checkPackage/getUnsatisfiedPeerDependencies.d.ts.map +1 -1
- package/dist/actions/deplint/engine.d.ts.map +1 -1
- package/dist/actions/deplint/findFiles.d.ts +25 -1
- package/dist/actions/deplint/findFiles.d.ts.map +1 -1
- package/dist/actions/deplint/getExternalImportsFromFiles.d.ts +8 -3
- package/dist/actions/deplint/getExternalImportsFromFiles.d.ts.map +1 -1
- package/dist/actions/deplint/isTerminalPackage.d.ts +72 -14
- package/dist/actions/deplint/isTerminalPackage.d.ts.map +1 -1
- package/dist/actions/deplint/rules.d.ts.map +1 -1
- package/dist/actions/deplint/snapshot.d.ts +9 -0
- package/dist/actions/deplint/snapshot.d.ts.map +1 -1
- package/dist/actions/deplint/types.d.ts +20 -2
- package/dist/actions/deplint/types.d.ts.map +1 -1
- package/dist/actions/package/compile/XyConfig.d.ts +23 -11
- package/dist/actions/package/compile/XyConfig.d.ts.map +1 -1
- package/dist/actions/skills/defaults.d.ts +18 -1
- package/dist/actions/skills/defaults.d.ts.map +1 -1
- package/dist/actions/skills/detectProfile.d.ts +8 -0
- package/dist/actions/skills/detectProfile.d.ts.map +1 -1
- package/dist/actions/skills/lint.d.ts.map +1 -1
- package/dist/actions/skills/skillRules.d.ts +12 -1
- package/dist/actions/skills/skillRules.d.ts.map +1 -1
- package/dist/bin/package/build.mjs +915 -2503
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/clean.mjs +368 -2056
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +717 -2401
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/copy-assets-cjs.mjs +159 -86
- package/dist/bin/package/copy-assets-cjs.mjs.map +1 -1
- package/dist/bin/package/copy-assets-esm.mjs +159 -86
- package/dist/bin/package/copy-assets-esm.mjs.map +1 -1
- package/dist/bin/package/fix.mjs +259 -148
- package/dist/bin/package/fix.mjs.map +1 -1
- package/dist/bin/package/lint-verbose.mjs +259 -148
- package/dist/bin/package/lint-verbose.mjs.map +1 -1
- package/dist/bin/package/lint.mjs +259 -148
- package/dist/bin/package/lint.mjs.map +1 -1
- package/dist/bin/package/publint.mjs +393 -2027
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +719 -2403
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/package/relint.mjs +259 -148
- package/dist/bin/package/relint.mjs.map +1 -1
- package/dist/bin/package/sync-layout.mjs +232 -1961
- package/dist/bin/package/sync-layout.mjs.map +1 -1
- package/dist/bin/run-or-exec.mjs +157 -84
- package/dist/bin/run-or-exec.mjs.map +1 -1
- package/dist/bin/skills.mjs +4375 -670
- package/dist/bin/skills.mjs.map +1 -1
- package/dist/bin/xy.mjs +1205 -2347
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/xy/common/skills/index.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/bin/run-or-exec.mjs
CHANGED
|
@@ -22,17 +22,47 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
22
22
|
}
|
|
23
23
|
return to;
|
|
24
24
|
};
|
|
25
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
26
26
|
value: mod,
|
|
27
27
|
enumerable: true
|
|
28
28
|
}) : target, mod));
|
|
29
29
|
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../../node_modules/.pnpm/chalk@
|
|
31
|
+
//#region ../../node_modules/.pnpm/chalk@6.0.0/node_modules/chalk/source/utilities.js
|
|
32
|
+
function stringReplaceAll(string, substring, postfix) {
|
|
33
|
+
let index = string.indexOf(substring);
|
|
34
|
+
if (index === -1) return string;
|
|
35
|
+
const substringLength = substring.length;
|
|
36
|
+
let endIndex = 0;
|
|
37
|
+
let returnValue = "";
|
|
38
|
+
do {
|
|
39
|
+
returnValue += string.slice(endIndex, index) + substring + postfix;
|
|
40
|
+
endIndex = index + substringLength;
|
|
41
|
+
index = string.indexOf(substring, endIndex);
|
|
42
|
+
} while (index !== -1);
|
|
43
|
+
returnValue += string.slice(endIndex);
|
|
44
|
+
return returnValue;
|
|
45
|
+
}
|
|
46
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
47
|
+
let endIndex = 0;
|
|
48
|
+
let returnValue = "";
|
|
49
|
+
do {
|
|
50
|
+
const isGotCR = string[index - 1] === "\r";
|
|
51
|
+
returnValue += string.slice(endIndex, isGotCR ? index - 1 : index) + prefix + (isGotCR ? "\r\n" : "\n") + postfix;
|
|
52
|
+
endIndex = index + 1;
|
|
53
|
+
index = string.indexOf("\n", endIndex);
|
|
54
|
+
} while (index !== -1);
|
|
55
|
+
returnValue += string.slice(endIndex);
|
|
56
|
+
return returnValue;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region ../../node_modules/.pnpm/chalk@6.0.0/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
32
60
|
const ANSI_BACKGROUND_OFFSET = 10;
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
61
|
+
const ANSI_UNDERLINE_OFFSET = 20;
|
|
62
|
+
const wrapAnsi16 = (offset = 0) => (code) => `\u{1B}[${code + offset}m`;
|
|
63
|
+
const wrapAnsi256 = (offset = 0) => (code) => `\u{1B}[${38 + offset};5;${code}m`;
|
|
64
|
+
const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u{1B}[${38 + offset};2;${red};${green};${blue}m`;
|
|
65
|
+
const wrapUnderlineAnsi = (code) => `\u{1B}[58;5;${code < 90 ? code - 30 : code - 90 + 8}m`;
|
|
36
66
|
const styles$1 = {
|
|
37
67
|
modifier: {
|
|
38
68
|
reset: [0, 0],
|
|
@@ -40,6 +70,10 @@ const styles$1 = {
|
|
|
40
70
|
dim: [2, 22],
|
|
41
71
|
italic: [3, 23],
|
|
42
72
|
underline: [4, 24],
|
|
73
|
+
underlineDouble: ["4:2", 24],
|
|
74
|
+
underlineCurly: ["4:3", 24],
|
|
75
|
+
underlineDotted: ["4:4", 24],
|
|
76
|
+
underlineDashed: ["4:5", 24],
|
|
43
77
|
overline: [53, 55],
|
|
44
78
|
inverse: [7, 27],
|
|
45
79
|
hidden: [8, 28],
|
|
@@ -84,22 +118,43 @@ const styles$1 = {
|
|
|
84
118
|
bgMagentaBright: [105, 49],
|
|
85
119
|
bgCyanBright: [106, 49],
|
|
86
120
|
bgWhiteBright: [107, 49]
|
|
121
|
+
},
|
|
122
|
+
underlineColor: {
|
|
123
|
+
underlineBlack: ["58;5;0", 59],
|
|
124
|
+
underlineRed: ["58;5;1", 59],
|
|
125
|
+
underlineGreen: ["58;5;2", 59],
|
|
126
|
+
underlineYellow: ["58;5;3", 59],
|
|
127
|
+
underlineBlue: ["58;5;4", 59],
|
|
128
|
+
underlineMagenta: ["58;5;5", 59],
|
|
129
|
+
underlineCyan: ["58;5;6", 59],
|
|
130
|
+
underlineWhite: ["58;5;7", 59],
|
|
131
|
+
underlineBlackBright: ["58;5;8", 59],
|
|
132
|
+
underlineGray: ["58;5;8", 59],
|
|
133
|
+
underlineGrey: ["58;5;8", 59],
|
|
134
|
+
underlineRedBright: ["58;5;9", 59],
|
|
135
|
+
underlineGreenBright: ["58;5;10", 59],
|
|
136
|
+
underlineYellowBright: ["58;5;11", 59],
|
|
137
|
+
underlineBlueBright: ["58;5;12", 59],
|
|
138
|
+
underlineMagentaBright: ["58;5;13", 59],
|
|
139
|
+
underlineCyanBright: ["58;5;14", 59],
|
|
140
|
+
underlineWhiteBright: ["58;5;15", 59]
|
|
87
141
|
}
|
|
88
142
|
};
|
|
89
143
|
Object.keys(styles$1.modifier);
|
|
90
144
|
const foregroundColorNames = Object.keys(styles$1.color);
|
|
91
145
|
const backgroundColorNames = Object.keys(styles$1.bgColor);
|
|
146
|
+
Object.keys(styles$1.underlineColor);
|
|
92
147
|
[...foregroundColorNames, ...backgroundColorNames];
|
|
93
148
|
function assembleStyles() {
|
|
94
149
|
const codes = /* @__PURE__ */ new Map();
|
|
95
150
|
for (const [groupName, group] of Object.entries(styles$1)) {
|
|
96
151
|
for (const [styleName, style] of Object.entries(group)) {
|
|
97
152
|
styles$1[styleName] = {
|
|
98
|
-
open: `\
|
|
99
|
-
close: `\
|
|
153
|
+
open: `\u{1B}[${style[0]}m`,
|
|
154
|
+
close: `\u{1B}[${style[1]}m`
|
|
100
155
|
};
|
|
101
156
|
group[styleName] = styles$1[styleName];
|
|
102
|
-
codes.set(style[0], style[1]);
|
|
157
|
+
codes.set(Number.parseInt(style[0], 10), style[1]);
|
|
103
158
|
}
|
|
104
159
|
Object.defineProperty(styles$1, groupName, {
|
|
105
160
|
value: group,
|
|
@@ -112,12 +167,16 @@ function assembleStyles() {
|
|
|
112
167
|
});
|
|
113
168
|
styles$1.color.close = "\x1B[39m";
|
|
114
169
|
styles$1.bgColor.close = "\x1B[49m";
|
|
170
|
+
styles$1.underlineColor.close = "\x1B[59m";
|
|
115
171
|
styles$1.color.ansi = wrapAnsi16();
|
|
116
172
|
styles$1.color.ansi256 = wrapAnsi256();
|
|
117
173
|
styles$1.color.ansi16m = wrapAnsi16m();
|
|
118
174
|
styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
119
175
|
styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
120
176
|
styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
177
|
+
styles$1.underlineColor.ansi = wrapUnderlineAnsi;
|
|
178
|
+
styles$1.underlineColor.ansi256 = wrapAnsi256(ANSI_UNDERLINE_OFFSET);
|
|
179
|
+
styles$1.underlineColor.ansi16m = wrapAnsi16m(ANSI_UNDERLINE_OFFSET);
|
|
121
180
|
Object.defineProperties(styles$1, {
|
|
122
181
|
rgbToAnsi256: {
|
|
123
182
|
value(red, green, blue) {
|
|
@@ -132,7 +191,7 @@ function assembleStyles() {
|
|
|
132
191
|
},
|
|
133
192
|
hexToRgb: {
|
|
134
193
|
value(hex) {
|
|
135
|
-
const matches = /[
|
|
194
|
+
const matches = /[\da-f]{6}|[\da-f]{3}/i.exec(hex.toString(16));
|
|
136
195
|
if (!matches) return [
|
|
137
196
|
0,
|
|
138
197
|
0,
|
|
@@ -192,7 +251,7 @@ function assembleStyles() {
|
|
|
192
251
|
}
|
|
193
252
|
const ansiStyles = assembleStyles();
|
|
194
253
|
//#endregion
|
|
195
|
-
//#region ../../node_modules/.pnpm/chalk@
|
|
254
|
+
//#region ../../node_modules/.pnpm/chalk@6.0.0/node_modules/chalk/source/vendor/supports-color/index.js
|
|
196
255
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
|
|
197
256
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
198
257
|
const position = argv.indexOf(prefix + flag);
|
|
@@ -203,12 +262,15 @@ const { env } = process$1;
|
|
|
203
262
|
let flagForceColor;
|
|
204
263
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
205
264
|
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
265
|
+
function hasNumericForceColor() {
|
|
266
|
+
return /^\d+$/.test(env.FORCE_COLOR);
|
|
267
|
+
}
|
|
206
268
|
function envForceColor() {
|
|
207
|
-
if ("FORCE_COLOR" in env)
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
269
|
+
if (!("FORCE_COLOR" in env)) return;
|
|
270
|
+
if (env.FORCE_COLOR === "false") return 0;
|
|
271
|
+
if (env.FORCE_COLOR === "true" || env.FORCE_COLOR.length === 0) return 1;
|
|
272
|
+
if (!hasNumericForceColor()) return;
|
|
273
|
+
return Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
212
274
|
}
|
|
213
275
|
function translateLevel(level) {
|
|
214
276
|
if (level === 0) return false;
|
|
@@ -228,6 +290,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
228
290
|
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
|
|
229
291
|
if (hasFlag("color=256")) return 2;
|
|
230
292
|
}
|
|
293
|
+
if (forceColor !== void 0 && hasNumericForceColor()) return forceColor;
|
|
231
294
|
if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
|
|
232
295
|
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
233
296
|
const min = forceColor || 0;
|
|
@@ -252,19 +315,19 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
252
315
|
].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
|
|
253
316
|
return min;
|
|
254
317
|
}
|
|
255
|
-
if ("TEAMCITY_VERSION" in env) return /^(9\.
|
|
318
|
+
if ("TEAMCITY_VERSION" in env) return /^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
256
319
|
if (env.COLORTERM === "truecolor") return 3;
|
|
257
320
|
if (env.TERM === "xterm-kitty") return 3;
|
|
258
321
|
if (env.TERM === "xterm-ghostty") return 3;
|
|
259
322
|
if (env.TERM === "wezterm") return 3;
|
|
260
323
|
if ("TERM_PROGRAM" in env) {
|
|
261
|
-
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
324
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".", 1)[0], 10);
|
|
262
325
|
switch (env.TERM_PROGRAM) {
|
|
263
326
|
case "iTerm.app": return version >= 3 ? 3 : 2;
|
|
264
327
|
case "Apple_Terminal": return 2;
|
|
265
328
|
}
|
|
266
329
|
}
|
|
267
|
-
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
330
|
+
if (/-256(?:color)?$/i.test(env.TERM)) return 2;
|
|
268
331
|
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
269
332
|
if ("COLORTERM" in env) return 1;
|
|
270
333
|
return min;
|
|
@@ -275,55 +338,34 @@ function createSupportsColor(stream, options = {}) {
|
|
|
275
338
|
...options
|
|
276
339
|
}));
|
|
277
340
|
}
|
|
278
|
-
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region ../../node_modules/.pnpm/chalk@6.0.0/node_modules/chalk/source/index.js
|
|
343
|
+
const { stdout: stdoutColor, stderr: stderrColor } = {
|
|
279
344
|
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
280
345
|
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
281
346
|
};
|
|
282
|
-
//#endregion
|
|
283
|
-
//#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js
|
|
284
|
-
function stringReplaceAll(string, substring, replacer) {
|
|
285
|
-
let index = string.indexOf(substring);
|
|
286
|
-
if (index === -1) return string;
|
|
287
|
-
const substringLength = substring.length;
|
|
288
|
-
let endIndex = 0;
|
|
289
|
-
let returnValue = "";
|
|
290
|
-
do {
|
|
291
|
-
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
292
|
-
endIndex = index + substringLength;
|
|
293
|
-
index = string.indexOf(substring, endIndex);
|
|
294
|
-
} while (index !== -1);
|
|
295
|
-
returnValue += string.slice(endIndex);
|
|
296
|
-
return returnValue;
|
|
297
|
-
}
|
|
298
|
-
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
299
|
-
let endIndex = 0;
|
|
300
|
-
let returnValue = "";
|
|
301
|
-
do {
|
|
302
|
-
const gotCR = string[index - 1] === "\r";
|
|
303
|
-
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
304
|
-
endIndex = index + 1;
|
|
305
|
-
index = string.indexOf("\n", endIndex);
|
|
306
|
-
} while (index !== -1);
|
|
307
|
-
returnValue += string.slice(endIndex);
|
|
308
|
-
return returnValue;
|
|
309
|
-
}
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
|
|
312
|
-
const { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
|
|
313
347
|
const GENERATOR = Symbol("GENERATOR");
|
|
314
348
|
const STYLER = Symbol("STYLER");
|
|
315
349
|
const IS_EMPTY = Symbol("IS_EMPTY");
|
|
316
|
-
const
|
|
317
|
-
"ansi",
|
|
318
|
-
"ansi",
|
|
319
|
-
"ansi256",
|
|
320
|
-
"ansi16m"
|
|
321
|
-
];
|
|
350
|
+
const LEVEL = Symbol("LEVEL");
|
|
322
351
|
const styles = Object.create(null);
|
|
352
|
+
const assertValidLevel = (level) => {
|
|
353
|
+
if (!Number.isSafeInteger(level) || level < 0 || level > 3) throw new Error("The `level` should be an integer from 0 to 3");
|
|
354
|
+
};
|
|
355
|
+
const levelDescriptor = {
|
|
356
|
+
enumerable: true,
|
|
357
|
+
get() {
|
|
358
|
+
return this[LEVEL];
|
|
359
|
+
},
|
|
360
|
+
set(level) {
|
|
361
|
+
assertValidLevel(level);
|
|
362
|
+
this[LEVEL] = level;
|
|
363
|
+
}
|
|
364
|
+
};
|
|
323
365
|
const applyOptions = (object, options = {}) => {
|
|
324
|
-
if (options.level
|
|
366
|
+
if (options.level !== void 0) assertValidLevel(options.level);
|
|
325
367
|
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
326
|
-
object
|
|
368
|
+
object[LEVEL] = options.level === void 0 ? colorLevel : options.level;
|
|
327
369
|
};
|
|
328
370
|
const chalkFactory = (options) => {
|
|
329
371
|
const chalk = (...strings) => strings.join(" ");
|
|
@@ -345,35 +387,58 @@ styles.visible = { get() {
|
|
|
345
387
|
Object.defineProperty(this, "visible", { value: builder });
|
|
346
388
|
return builder;
|
|
347
389
|
} };
|
|
348
|
-
const
|
|
390
|
+
const createModelConverters = (model, type) => {
|
|
391
|
+
const style = ansiStyles[type];
|
|
349
392
|
if (model === "rgb") {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
return
|
|
393
|
+
const ansi = (red, green, blue) => style.ansi(ansiStyles.rgbToAnsi(red, green, blue));
|
|
394
|
+
const ansi256 = (red, green, blue) => style.ansi256(ansiStyles.rgbToAnsi256(red, green, blue));
|
|
395
|
+
return [
|
|
396
|
+
ansi,
|
|
397
|
+
ansi,
|
|
398
|
+
ansi256,
|
|
399
|
+
style.ansi16m
|
|
400
|
+
];
|
|
353
401
|
}
|
|
354
|
-
if (model === "hex")
|
|
355
|
-
|
|
402
|
+
if (model === "hex") {
|
|
403
|
+
const ansi = (hex) => style.ansi(ansiStyles.hexToAnsi(hex));
|
|
404
|
+
const ansi256 = (hex) => style.ansi256(ansiStyles.hexToAnsi256(hex));
|
|
405
|
+
return [
|
|
406
|
+
ansi,
|
|
407
|
+
ansi,
|
|
408
|
+
ansi256,
|
|
409
|
+
(hex) => style.ansi16m(...ansiStyles.hexToRgb(hex))
|
|
410
|
+
];
|
|
411
|
+
}
|
|
412
|
+
const ansi = (code) => style.ansi(ansiStyles.ansi256ToAnsi(code));
|
|
413
|
+
return [
|
|
414
|
+
ansi,
|
|
415
|
+
ansi,
|
|
416
|
+
style.ansi256,
|
|
417
|
+
style.ansi256
|
|
418
|
+
];
|
|
356
419
|
};
|
|
357
420
|
for (const model of [
|
|
358
421
|
"rgb",
|
|
359
422
|
"hex",
|
|
360
423
|
"ansi256"
|
|
361
424
|
]) {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
425
|
+
const capitalizedModel = model[0].toUpperCase() + model.slice(1);
|
|
426
|
+
for (const [styleName, type] of [
|
|
427
|
+
[model, "color"],
|
|
428
|
+
["bg" + capitalizedModel, "bgColor"],
|
|
429
|
+
["underline" + capitalizedModel, "underlineColor"]
|
|
430
|
+
]) {
|
|
431
|
+
const { close } = ansiStyles[type];
|
|
432
|
+
const converters = createModelConverters(model, type);
|
|
433
|
+
styles[styleName] = { get() {
|
|
434
|
+
const styleFunction = function(first, second, third) {
|
|
435
|
+
const open = converters[this.level](first, second, third);
|
|
436
|
+
return createBuilder(this, createStyler(open, close, this[STYLER]), this[IS_EMPTY]);
|
|
437
|
+
};
|
|
438
|
+
Object.defineProperty(this, styleName, { value: styleFunction });
|
|
439
|
+
return styleFunction;
|
|
440
|
+
} };
|
|
441
|
+
}
|
|
377
442
|
}
|
|
378
443
|
const proto = Object.defineProperties(() => {}, {
|
|
379
444
|
...styles,
|
|
@@ -406,15 +471,19 @@ const createStyler = (open, close, parent) => {
|
|
|
406
471
|
};
|
|
407
472
|
};
|
|
408
473
|
const createBuilder = (self, _styler, _isEmpty) => {
|
|
409
|
-
const builder = (...arguments_) =>
|
|
474
|
+
const builder = (...arguments_) => {
|
|
475
|
+
if (arguments_.length === 1) return applyStyle(builder, "" + arguments_[0]);
|
|
476
|
+
if (arguments_.length === 2) return applyStyle(builder, arguments_[0] + " " + arguments_[1]);
|
|
477
|
+
return applyStyle(builder, arguments_.join(" "));
|
|
478
|
+
};
|
|
410
479
|
Object.setPrototypeOf(builder, proto);
|
|
411
|
-
builder[GENERATOR] = self;
|
|
480
|
+
builder[GENERATOR] = self[GENERATOR] ?? self;
|
|
412
481
|
builder[STYLER] = _styler;
|
|
413
482
|
builder[IS_EMPTY] = _isEmpty;
|
|
414
483
|
return builder;
|
|
415
484
|
};
|
|
416
485
|
const applyStyle = (self, string) => {
|
|
417
|
-
if (self
|
|
486
|
+
if (self[GENERATOR][LEVEL] <= 0 || !string) return self[IS_EMPTY] ? "" : string;
|
|
418
487
|
let styler = self[STYLER];
|
|
419
488
|
if (styler === void 0) return string;
|
|
420
489
|
const { openAll, closeAll } = styler;
|
|
@@ -426,7 +495,10 @@ const applyStyle = (self, string) => {
|
|
|
426
495
|
if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
427
496
|
return openAll + string + closeAll;
|
|
428
497
|
};
|
|
429
|
-
Object.defineProperties(createChalk.prototype,
|
|
498
|
+
Object.defineProperties(createChalk.prototype, {
|
|
499
|
+
...styles,
|
|
500
|
+
level: levelDescriptor
|
|
501
|
+
});
|
|
430
502
|
const chalk = createChalk();
|
|
431
503
|
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
432
504
|
//#endregion
|
|
@@ -541,7 +613,8 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
541
613
|
const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
542
614
|
const getPathInfo = (cmd, opt) => {
|
|
543
615
|
const colon = opt.colon || COLON;
|
|
544
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [...isWindows ? [process.cwd()] : [], ...(opt.path || process.env.PATH ||
|
|
616
|
+
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [...isWindows ? [process.cwd()] : [], ...(opt.path || process.env.PATH ||
|
|
617
|
+
/* istanbul ignore next: very unusual */ "").split(colon)];
|
|
545
618
|
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
546
619
|
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
547
620
|
if (isWindows) {
|