@kubb/core 2.0.0-beta.12 → 2.0.0-beta.14
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/chunk-35FDNG5F.cjs +71 -0
- package/dist/chunk-35FDNG5F.cjs.map +1 -0
- package/dist/chunk-7CNPSL5M.js +85 -0
- package/dist/chunk-7CNPSL5M.js.map +1 -0
- package/dist/chunk-DKYWBKNH.js +18 -0
- package/dist/chunk-DKYWBKNH.js.map +1 -0
- package/dist/chunk-EZSRGYAY.js +128 -0
- package/dist/chunk-EZSRGYAY.js.map +1 -0
- package/dist/chunk-GBX7KRCX.cjs +162 -0
- package/dist/chunk-GBX7KRCX.cjs.map +1 -0
- package/dist/chunk-ICRPOCV4.cjs +2290 -0
- package/dist/chunk-ICRPOCV4.cjs.map +1 -0
- package/dist/chunk-LAS7UYTK.cjs +129 -0
- package/dist/chunk-LAS7UYTK.cjs.map +1 -0
- package/dist/chunk-LJHT3DNH.js +67 -0
- package/dist/chunk-LJHT3DNH.js.map +1 -0
- package/dist/chunk-MM42A6GN.cjs +91 -0
- package/dist/chunk-MM42A6GN.cjs.map +1 -0
- package/dist/chunk-SRGTC4FJ.js +129 -0
- package/dist/chunk-SRGTC4FJ.js.map +1 -0
- package/dist/chunk-ST7GHHSU.cjs +104 -0
- package/dist/chunk-ST7GHHSU.cjs.map +1 -0
- package/dist/chunk-U4C2WTCI.cjs +131 -0
- package/dist/chunk-U4C2WTCI.cjs.map +1 -0
- package/dist/chunk-UIQUKFF4.js +155 -0
- package/dist/chunk-UIQUKFF4.js.map +1 -0
- package/dist/chunk-WTSDXEWD.js +71 -0
- package/dist/chunk-WTSDXEWD.js.map +1 -0
- package/dist/fs.cjs +20 -2372
- package/dist/fs.cjs.map +1 -1
- package/dist/fs.d.cts +1 -1
- package/dist/fs.d.ts +1 -1
- package/dist/fs.js +4 -2373
- package/dist/fs.js.map +1 -1
- package/dist/index.cjs +930 -3261
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -15
- package/dist/index.d.ts +17 -15
- package/dist/index.js +208 -3490
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +19 -141
- package/dist/logger.cjs.map +1 -1
- package/dist/logger.d.cts +1 -0
- package/dist/logger.d.ts +1 -0
- package/dist/logger.js +3 -135
- package/dist/logger.js.map +1 -1
- package/dist/transformers.cjs +40 -208
- package/dist/transformers.cjs.map +1 -1
- package/dist/transformers.js +15 -201
- package/dist/transformers.js.map +1 -1
- package/dist/utils.cjs +22 -524
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +0 -1
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +11 -517
- package/dist/utils.js.map +1 -1
- package/dist/{write-46ytbnu9.d.cts → write-A6VgHkYA.d.cts} +4 -1
- package/dist/{write-46ytbnu9.d.ts → write-A6VgHkYA.d.ts} +4 -1
- package/package.json +9 -8
- package/src/BarrelManager.ts +3 -3
- package/src/FileManager.ts +66 -62
- package/src/PluginManager.ts +11 -18
- package/src/build.ts +57 -32
- package/src/fs/clean.ts +2 -2
- package/src/fs/read.ts +1 -0
- package/src/fs/write.ts +40 -24
- package/src/logger.ts +10 -0
- package/src/utils/FunctionParams.ts +2 -2
- package/src/utils/URLPath.ts +5 -5
- package/src/utils/index.ts +0 -2
- package/dist/Queue-2-6pMcCx.d.cts +0 -32
- package/dist/Queue-2-6pMcCx.d.ts +0 -32
- package/src/utils/Queue.ts +0 -110
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
import { init_esm_shims } from './chunk-WTSDXEWD.js';
|
|
3
|
+
|
|
4
|
+
createRequire(import.meta.url);
|
|
5
|
+
|
|
6
|
+
// src/transformers/searchAndReplace.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
function searchAndReplace(options) {
|
|
9
|
+
const { text, replaceBy, prefix = "", key } = options;
|
|
10
|
+
const searchValues = options.searchValues?.(prefix, key) || [
|
|
11
|
+
`${prefix}["${key}"]`,
|
|
12
|
+
`${prefix}['${key}']`,
|
|
13
|
+
`${prefix}[\`${key}\`]`,
|
|
14
|
+
`${prefix}"${key}"`,
|
|
15
|
+
`${prefix}'${key}'`,
|
|
16
|
+
`${prefix}\`${key}\``,
|
|
17
|
+
new RegExp(`${prefix}${key}`, "g")
|
|
18
|
+
];
|
|
19
|
+
return searchValues.reduce((prev, searchValue) => {
|
|
20
|
+
return prev.toString().replaceAll(searchValue, replaceBy);
|
|
21
|
+
}, text);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/transformers/trim.ts
|
|
25
|
+
init_esm_shims();
|
|
26
|
+
function trim(text) {
|
|
27
|
+
return text.replaceAll(/\n/g, "").trim();
|
|
28
|
+
}
|
|
29
|
+
function trimExtName(text) {
|
|
30
|
+
return text.replace(/\.[^/.]+$/, "");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// src/transformers/transformReservedWord.ts
|
|
34
|
+
init_esm_shims();
|
|
35
|
+
var reservedWords = [
|
|
36
|
+
"abstract",
|
|
37
|
+
"arguments",
|
|
38
|
+
"boolean",
|
|
39
|
+
"break",
|
|
40
|
+
"byte",
|
|
41
|
+
"case",
|
|
42
|
+
"catch",
|
|
43
|
+
"char",
|
|
44
|
+
"class",
|
|
45
|
+
"const",
|
|
46
|
+
"continue",
|
|
47
|
+
"debugger",
|
|
48
|
+
"default",
|
|
49
|
+
"delete",
|
|
50
|
+
"do",
|
|
51
|
+
"double",
|
|
52
|
+
"else",
|
|
53
|
+
"enum",
|
|
54
|
+
"eval",
|
|
55
|
+
"export",
|
|
56
|
+
"extends",
|
|
57
|
+
"false",
|
|
58
|
+
"final",
|
|
59
|
+
"finally",
|
|
60
|
+
"float",
|
|
61
|
+
"for",
|
|
62
|
+
"function",
|
|
63
|
+
"goto",
|
|
64
|
+
"if",
|
|
65
|
+
"implements",
|
|
66
|
+
"import",
|
|
67
|
+
"in",
|
|
68
|
+
"instanceof",
|
|
69
|
+
"int",
|
|
70
|
+
"interface",
|
|
71
|
+
"let",
|
|
72
|
+
"long",
|
|
73
|
+
"native",
|
|
74
|
+
"new",
|
|
75
|
+
"null",
|
|
76
|
+
"package",
|
|
77
|
+
"private",
|
|
78
|
+
"protected",
|
|
79
|
+
"public",
|
|
80
|
+
"return",
|
|
81
|
+
"short",
|
|
82
|
+
"static",
|
|
83
|
+
"super",
|
|
84
|
+
"switch",
|
|
85
|
+
"synchronized",
|
|
86
|
+
"this",
|
|
87
|
+
"throw",
|
|
88
|
+
"throws",
|
|
89
|
+
"transient",
|
|
90
|
+
"true",
|
|
91
|
+
"try",
|
|
92
|
+
"typeof",
|
|
93
|
+
"var",
|
|
94
|
+
"void",
|
|
95
|
+
"volatile",
|
|
96
|
+
"while",
|
|
97
|
+
"with",
|
|
98
|
+
"yield",
|
|
99
|
+
"Array",
|
|
100
|
+
"Date",
|
|
101
|
+
"eval",
|
|
102
|
+
"function",
|
|
103
|
+
"hasOwnProperty",
|
|
104
|
+
"Infinity",
|
|
105
|
+
"isFinite",
|
|
106
|
+
"isNaN",
|
|
107
|
+
"isPrototypeOf",
|
|
108
|
+
"length",
|
|
109
|
+
"Math",
|
|
110
|
+
"name",
|
|
111
|
+
"NaN",
|
|
112
|
+
"Number",
|
|
113
|
+
"Object",
|
|
114
|
+
"prototype",
|
|
115
|
+
"String",
|
|
116
|
+
"toString",
|
|
117
|
+
"undefined",
|
|
118
|
+
"valueOf"
|
|
119
|
+
];
|
|
120
|
+
function transformReservedWord(word) {
|
|
121
|
+
if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
|
|
122
|
+
return `_${word}`;
|
|
123
|
+
}
|
|
124
|
+
return word;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export { searchAndReplace, transformReservedWord, trim, trimExtName };
|
|
128
|
+
//# sourceMappingURL=out.js.map
|
|
129
|
+
//# sourceMappingURL=chunk-SRGTC4FJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/transformers/searchAndReplace.ts","../src/transformers/trim.ts","../src/transformers/transformReservedWord.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AAQO,SAAS,iBAAiB,SAA0B;AACzD,QAAM,EAAE,MAAM,WAAW,SAAS,IAAI,IAAI,IAAI;AAE9C,QAAM,eAAe,QAAQ,eAAe,QAAQ,GAAG,KAAK;AAAA,IAC1D,GAAG,MAAM,KAAK,GAAG;AAAA,IACjB,GAAG,MAAM,KAAK,GAAG;AAAA,IACjB,GAAG,MAAM,MAAM,GAAG;AAAA,IAClB,GAAG,MAAM,IAAI,GAAG;AAAA,IAChB,GAAG,MAAM,IAAI,GAAG;AAAA,IAChB,GAAG,MAAM,KAAK,GAAG;AAAA,IACjB,IAAI,OAAO,GAAG,MAAM,GAAG,GAAG,IAAI,GAAG;AAAA,EACnC;AAEA,SAAO,aAAa,OAAO,CAAC,MAAM,gBAAgB;AAChD,WAAO,KAAK,SAAS,EAAE,WAAW,aAAa,SAAS;AAAA,EAC1D,GAAG,IAAI;AACT;;;ACxBA;AAAO,SAAS,KAAK,MAAsB;AACzC,SAAO,KAAK,WAAW,OAAO,EAAE,EAAE,KAAK;AACzC;AAEO,SAAS,YAAY,MAAsB;AAChD,SAAO,KAAK,QAAQ,aAAa,EAAE;AACrC;;;ACNA;AAGA,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAAS,sBAAsB,MAAsB;AAC1D,MAAK,QAAQ,cAAc,SAAS,IAAI,KAAM,MAAM,MAAM,KAAK,GAAG;AAChE,WAAO,IAAI,IAAI;AAAA,EACjB;AAEA,SAAO;AACT","sourcesContent":["type Options = {\n text: string\n replaceBy: string\n prefix?: string\n key: string\n searchValues?: (prefix: string, key: string) => Array<RegExp | string>\n}\n\nexport function searchAndReplace(options: Options): string {\n const { text, replaceBy, prefix = '', key } = options\n\n const searchValues = options.searchValues?.(prefix, key) || [\n `${prefix}[\"${key}\"]`,\n `${prefix}['${key}']`,\n `${prefix}[\\`${key}\\`]`,\n `${prefix}\"${key}\"`,\n `${prefix}'${key}'`,\n `${prefix}\\`${key}\\``,\n new RegExp(`${prefix}${key}`, 'g'),\n ]\n\n return searchValues.reduce((prev, searchValue) => {\n return prev.toString().replaceAll(searchValue, replaceBy)\n }, text) as string\n}\n","export function trim(text: string): string {\n return text.replaceAll(/\\n/g, '').trim()\n}\n\nexport function trimExtName(text: string): string {\n return text.replace(/\\.[^/.]+$/, '')\n}\n","/**\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = [\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n\n 'Array',\n 'Date',\n 'eval',\n 'function',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n]\n\nexport function transformReservedWord(word: string): string {\n if ((word && reservedWords.includes(word)) || word?.match(/^\\d/)) {\n return `_${word}`\n }\n\n return word\n}\n"]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkMM42A6GN_cjs = require('./chunk-MM42A6GN.cjs');
|
|
4
|
+
|
|
5
|
+
// src/transformers/casing.ts
|
|
6
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
7
|
+
|
|
8
|
+
// ../../node_modules/.pnpm/change-case@5.3.0/node_modules/change-case/dist/index.js
|
|
9
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
10
|
+
var SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
11
|
+
var SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
12
|
+
var SPLIT_NUMBER_LOWER_RE = /(\d)(\p{Ll})/gu;
|
|
13
|
+
var SPLIT_LETTER_NUMBER_RE = /(\p{L})(\d)/gu;
|
|
14
|
+
var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
15
|
+
var SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
16
|
+
var DEFAULT_PREFIX_SUFFIX_CHARACTERS = "";
|
|
17
|
+
function split(value, options) {
|
|
18
|
+
let result = value.trim();
|
|
19
|
+
result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
20
|
+
if (options?.separateNumbers) {
|
|
21
|
+
result = result.replace(SPLIT_NUMBER_LOWER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_LETTER_NUMBER_RE, SPLIT_REPLACE_VALUE);
|
|
22
|
+
}
|
|
23
|
+
result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
24
|
+
let start = 0;
|
|
25
|
+
let end = result.length;
|
|
26
|
+
while (result.charAt(start) === "\0")
|
|
27
|
+
start++;
|
|
28
|
+
if (start === end)
|
|
29
|
+
return [];
|
|
30
|
+
while (result.charAt(end - 1) === "\0")
|
|
31
|
+
end--;
|
|
32
|
+
return result.slice(start, end).split(/\0/g);
|
|
33
|
+
}
|
|
34
|
+
function camelCase(input, options) {
|
|
35
|
+
const [prefix, value, suffix] = splitPrefixSuffix(input, options);
|
|
36
|
+
const lower = lowerFactory(options?.locale);
|
|
37
|
+
const upper = upperFactory(options?.locale);
|
|
38
|
+
const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
|
|
39
|
+
return prefix + split(value, options).map((word, index) => {
|
|
40
|
+
if (index === 0)
|
|
41
|
+
return lower(word);
|
|
42
|
+
return transform(word, index);
|
|
43
|
+
}).join(options?.delimiter ?? "") + suffix;
|
|
44
|
+
}
|
|
45
|
+
function pascalCase(input, options) {
|
|
46
|
+
const [prefix, value, suffix] = splitPrefixSuffix(input, options);
|
|
47
|
+
const lower = lowerFactory(options?.locale);
|
|
48
|
+
const upper = upperFactory(options?.locale);
|
|
49
|
+
const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
|
|
50
|
+
return prefix + split(value, options).map(transform).join(options?.delimiter ?? "") + suffix;
|
|
51
|
+
}
|
|
52
|
+
function lowerFactory(locale) {
|
|
53
|
+
return locale === false ? (input) => input.toLowerCase() : (input) => input.toLocaleLowerCase(locale);
|
|
54
|
+
}
|
|
55
|
+
function upperFactory(locale) {
|
|
56
|
+
return locale === false ? (input) => input.toUpperCase() : (input) => input.toLocaleUpperCase(locale);
|
|
57
|
+
}
|
|
58
|
+
function capitalCaseTransformFactory(lower, upper) {
|
|
59
|
+
return (word) => `${upper(word[0])}${lower(word.slice(1))}`;
|
|
60
|
+
}
|
|
61
|
+
function pascalCaseTransformFactory(lower, upper) {
|
|
62
|
+
return (word, index) => {
|
|
63
|
+
const char0 = word[0];
|
|
64
|
+
const initial = index > 0 && char0 >= "0" && char0 <= "9" ? "_" + char0 : upper(char0);
|
|
65
|
+
return initial + lower(word.slice(1));
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function splitPrefixSuffix(input, options) {
|
|
69
|
+
const prefixCharacters = options?.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
|
|
70
|
+
const suffixCharacters = options?.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
|
|
71
|
+
let prefixIndex = 0;
|
|
72
|
+
let suffixIndex = input.length;
|
|
73
|
+
while (prefixIndex < input.length) {
|
|
74
|
+
const char = input.charAt(prefixIndex);
|
|
75
|
+
if (!prefixCharacters.includes(char))
|
|
76
|
+
break;
|
|
77
|
+
prefixIndex++;
|
|
78
|
+
}
|
|
79
|
+
while (suffixIndex > prefixIndex) {
|
|
80
|
+
const index = suffixIndex - 1;
|
|
81
|
+
const char = input.charAt(index);
|
|
82
|
+
if (!suffixCharacters.includes(char))
|
|
83
|
+
break;
|
|
84
|
+
suffixIndex = index;
|
|
85
|
+
}
|
|
86
|
+
return [
|
|
87
|
+
input.slice(0, prefixIndex),
|
|
88
|
+
input.slice(prefixIndex, suffixIndex),
|
|
89
|
+
input.slice(suffixIndex)
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// src/transformers/casing.ts
|
|
94
|
+
function camelCase2(text) {
|
|
95
|
+
return camelCase(text, { delimiter: "", mergeAmbiguousCharacters: true });
|
|
96
|
+
}
|
|
97
|
+
function pascalCase2(text) {
|
|
98
|
+
return pascalCase(text, { delimiter: "", mergeAmbiguousCharacters: true });
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
exports.camelCase = camelCase2;
|
|
102
|
+
exports.pascalCase = pascalCase2;
|
|
103
|
+
//# sourceMappingURL=out.js.map
|
|
104
|
+
//# sourceMappingURL=chunk-ST7GHHSU.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/transformers/casing.ts","../../../node_modules/.pnpm/change-case@5.3.0/node_modules/change-case/src/index.ts"],"names":["camelCase","pascalCase"],"mappings":"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","sourcesContent":["import { camelCase as changeCaseCamel, pascalCase as changePascalCase } from 'change-case'\n\nexport function camelCase(text: string): string {\n return changeCaseCamel(text, { delimiter: '', mergeAmbiguousCharacters: true })\n}\n\nexport function pascalCase(text: string): string {\n return changePascalCase(text, { delimiter: '', mergeAmbiguousCharacters: true })\n}\n","// Regexps involved with splitting words in various case formats.\nconst SPLIT_LOWER_UPPER_RE = /([\\p{Ll}\\d])(\\p{Lu})/gu;\nconst SPLIT_UPPER_UPPER_RE = /(\\p{Lu})([\\p{Lu}][\\p{Ll}])/gu;\nconst SPLIT_NUMBER_LOWER_RE = /(\\d)(\\p{Ll})/gu;\nconst SPLIT_LETTER_NUMBER_RE = /(\\p{L})(\\d)/gu;\n\n// Regexp involved with stripping non-word characters from the result.\nconst DEFAULT_STRIP_REGEXP = /[^\\p{L}\\d]+/giu;\n\n// The replacement value for splits.\nconst SPLIT_REPLACE_VALUE = \"$1\\0$2\";\n\n// The default characters to keep after transforming case.\nconst DEFAULT_PREFIX_SUFFIX_CHARACTERS = \"\";\n\n/**\n * Supported locale values. Use `false` to ignore locale.\n * Defaults to `undefined`, which uses the host environment.\n */\nexport type Locale = string[] | string | false | undefined;\n\n/**\n * Options used for converting strings to pascal/camel case.\n */\nexport interface PascalCaseOptions extends Options {\n mergeAmbiguousCharacters?: boolean;\n}\n\n/**\n * Options used for converting strings to any case.\n */\nexport interface Options extends SplitOptions {\n locale?: Locale;\n delimiter?: string;\n prefixCharacters?: string;\n suffixCharacters?: string;\n}\n\n/**\n * Options used for splitting strings into word segments.\n */\nexport interface SplitOptions {\n separateNumbers?: boolean;\n}\n\n/**\n * Split any cased input strings into an array of words.\n */\nexport function split(value: string, options?: SplitOptions) {\n let result = value.trim();\n\n result = result\n .replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE)\n .replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);\n\n if (options?.separateNumbers) {\n result = result\n .replace(SPLIT_NUMBER_LOWER_RE, SPLIT_REPLACE_VALUE)\n .replace(SPLIT_LETTER_NUMBER_RE, SPLIT_REPLACE_VALUE);\n }\n\n result = result.replace(DEFAULT_STRIP_REGEXP, \"\\0\");\n\n let start = 0;\n let end = result.length;\n\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\") start++;\n if (start === end) return [];\n while (result.charAt(end - 1) === \"\\0\") end--;\n\n return result.slice(start, end).split(/\\0/g);\n}\n\n/**\n * Convert a string to space separated lower case (`foo bar`).\n */\nexport function noCase(input: string, options?: Options) {\n const [prefix, value, suffix] = splitPrefixSuffix(input, options);\n return (\n prefix +\n split(value, options)\n .map(lowerFactory(options?.locale))\n .join(options?.delimiter ?? \" \") +\n suffix\n );\n}\n\n/**\n * Convert a string to camel case (`fooBar`).\n */\nexport function camelCase(input: string, options?: PascalCaseOptions) {\n const [prefix, value, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return (\n prefix +\n split(value, options)\n .map((word, index) => {\n if (index === 0) return lower(word);\n return transform(word, index);\n })\n .join(options?.delimiter ?? \"\") +\n suffix\n );\n}\n\n/**\n * Convert a string to pascal case (`FooBar`).\n */\nexport function pascalCase(input: string, options?: PascalCaseOptions) {\n const [prefix, value, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return (\n prefix +\n split(value, options)\n .map(transform)\n .join(options?.delimiter ?? \"\") +\n suffix\n );\n}\n\n/**\n * Convert a string to pascal snake case (`Foo_Bar`).\n */\nexport function pascalSnakeCase(input: string, options?: Options) {\n return capitalCase(input, { delimiter: \"_\", ...options });\n}\n\n/**\n * Convert a string to capital case (`Foo Bar`).\n */\nexport function capitalCase(input: string, options?: Options) {\n const [prefix, value, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n return (\n prefix +\n split(value, options)\n .map(capitalCaseTransformFactory(lower, upper))\n .join(options?.delimiter ?? \" \") +\n suffix\n );\n}\n\n/**\n * Convert a string to constant case (`FOO_BAR`).\n */\nexport function constantCase(input: string, options?: Options) {\n const [prefix, value, suffix] = splitPrefixSuffix(input, options);\n return (\n prefix +\n split(value, options)\n .map(upperFactory(options?.locale))\n .join(options?.delimiter ?? \"_\") +\n suffix\n );\n}\n\n/**\n * Convert a string to dot case (`foo.bar`).\n */\nexport function dotCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \".\", ...options });\n}\n\n/**\n * Convert a string to kebab case (`foo-bar`).\n */\nexport function kebabCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \"-\", ...options });\n}\n\n/**\n * Convert a string to path case (`foo/bar`).\n */\nexport function pathCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \"/\", ...options });\n}\n\n/**\n * Convert a string to path case (`Foo bar`).\n */\nexport function sentenceCase(input: string, options?: Options) {\n const [prefix, value, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = capitalCaseTransformFactory(lower, upper);\n return (\n prefix +\n split(value, options)\n .map((word, index) => {\n if (index === 0) return transform(word);\n return lower(word);\n })\n .join(options?.delimiter ?? \" \") +\n suffix\n );\n}\n\n/**\n * Convert a string to snake case (`foo_bar`).\n */\nexport function snakeCase(input: string, options?: Options) {\n return noCase(input, { delimiter: \"_\", ...options });\n}\n\n/**\n * Convert a string to header case (`Foo-Bar`).\n */\nexport function trainCase(input: string, options?: Options) {\n return capitalCase(input, { delimiter: \"-\", ...options });\n}\n\nfunction lowerFactory(locale: Locale): (input: string) => string {\n return locale === false\n ? (input: string) => input.toLowerCase()\n : (input: string) => input.toLocaleLowerCase(locale);\n}\n\nfunction upperFactory(locale: Locale): (input: string) => string {\n return locale === false\n ? (input: string) => input.toUpperCase()\n : (input: string) => input.toLocaleUpperCase(locale);\n}\n\nfunction capitalCaseTransformFactory(\n lower: (input: string) => string,\n upper: (input: string) => string,\n) {\n return (word: string) => `${upper(word[0])}${lower(word.slice(1))}`;\n}\n\nfunction pascalCaseTransformFactory(\n lower: (input: string) => string,\n upper: (input: string) => string,\n) {\n return (word: string, index: number) => {\n const char0 = word[0];\n const initial =\n index > 0 && char0 >= \"0\" && char0 <= \"9\" ? \"_\" + char0 : upper(char0);\n return initial + lower(word.slice(1));\n };\n}\n\nfunction splitPrefixSuffix(\n input: string,\n options: Options | undefined,\n): [string, string, string] {\n const prefixCharacters =\n options?.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n const suffixCharacters =\n options?.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n let prefixIndex = 0;\n let suffixIndex = input.length;\n\n while (prefixIndex < input.length) {\n const char = input.charAt(prefixIndex);\n if (!prefixCharacters.includes(char)) break;\n prefixIndex++;\n }\n\n while (suffixIndex > prefixIndex) {\n const index = suffixIndex - 1;\n const char = input.charAt(index);\n if (!suffixCharacters.includes(char)) break;\n suffixIndex = index;\n }\n\n return [\n input.slice(0, prefixIndex),\n input.slice(prefixIndex, suffixIndex),\n input.slice(suffixIndex),\n ];\n}\n"]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkMM42A6GN_cjs = require('./chunk-MM42A6GN.cjs');
|
|
4
|
+
|
|
5
|
+
// src/transformers/searchAndReplace.ts
|
|
6
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
7
|
+
function searchAndReplace(options) {
|
|
8
|
+
const { text, replaceBy, prefix = "", key } = options;
|
|
9
|
+
const searchValues = options.searchValues?.(prefix, key) || [
|
|
10
|
+
`${prefix}["${key}"]`,
|
|
11
|
+
`${prefix}['${key}']`,
|
|
12
|
+
`${prefix}[\`${key}\`]`,
|
|
13
|
+
`${prefix}"${key}"`,
|
|
14
|
+
`${prefix}'${key}'`,
|
|
15
|
+
`${prefix}\`${key}\``,
|
|
16
|
+
new RegExp(`${prefix}${key}`, "g")
|
|
17
|
+
];
|
|
18
|
+
return searchValues.reduce((prev, searchValue) => {
|
|
19
|
+
return prev.toString().replaceAll(searchValue, replaceBy);
|
|
20
|
+
}, text);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// src/transformers/trim.ts
|
|
24
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
25
|
+
function trim(text) {
|
|
26
|
+
return text.replaceAll(/\n/g, "").trim();
|
|
27
|
+
}
|
|
28
|
+
function trimExtName(text) {
|
|
29
|
+
return text.replace(/\.[^/.]+$/, "");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// src/transformers/transformReservedWord.ts
|
|
33
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
34
|
+
var reservedWords = [
|
|
35
|
+
"abstract",
|
|
36
|
+
"arguments",
|
|
37
|
+
"boolean",
|
|
38
|
+
"break",
|
|
39
|
+
"byte",
|
|
40
|
+
"case",
|
|
41
|
+
"catch",
|
|
42
|
+
"char",
|
|
43
|
+
"class",
|
|
44
|
+
"const",
|
|
45
|
+
"continue",
|
|
46
|
+
"debugger",
|
|
47
|
+
"default",
|
|
48
|
+
"delete",
|
|
49
|
+
"do",
|
|
50
|
+
"double",
|
|
51
|
+
"else",
|
|
52
|
+
"enum",
|
|
53
|
+
"eval",
|
|
54
|
+
"export",
|
|
55
|
+
"extends",
|
|
56
|
+
"false",
|
|
57
|
+
"final",
|
|
58
|
+
"finally",
|
|
59
|
+
"float",
|
|
60
|
+
"for",
|
|
61
|
+
"function",
|
|
62
|
+
"goto",
|
|
63
|
+
"if",
|
|
64
|
+
"implements",
|
|
65
|
+
"import",
|
|
66
|
+
"in",
|
|
67
|
+
"instanceof",
|
|
68
|
+
"int",
|
|
69
|
+
"interface",
|
|
70
|
+
"let",
|
|
71
|
+
"long",
|
|
72
|
+
"native",
|
|
73
|
+
"new",
|
|
74
|
+
"null",
|
|
75
|
+
"package",
|
|
76
|
+
"private",
|
|
77
|
+
"protected",
|
|
78
|
+
"public",
|
|
79
|
+
"return",
|
|
80
|
+
"short",
|
|
81
|
+
"static",
|
|
82
|
+
"super",
|
|
83
|
+
"switch",
|
|
84
|
+
"synchronized",
|
|
85
|
+
"this",
|
|
86
|
+
"throw",
|
|
87
|
+
"throws",
|
|
88
|
+
"transient",
|
|
89
|
+
"true",
|
|
90
|
+
"try",
|
|
91
|
+
"typeof",
|
|
92
|
+
"var",
|
|
93
|
+
"void",
|
|
94
|
+
"volatile",
|
|
95
|
+
"while",
|
|
96
|
+
"with",
|
|
97
|
+
"yield",
|
|
98
|
+
"Array",
|
|
99
|
+
"Date",
|
|
100
|
+
"eval",
|
|
101
|
+
"function",
|
|
102
|
+
"hasOwnProperty",
|
|
103
|
+
"Infinity",
|
|
104
|
+
"isFinite",
|
|
105
|
+
"isNaN",
|
|
106
|
+
"isPrototypeOf",
|
|
107
|
+
"length",
|
|
108
|
+
"Math",
|
|
109
|
+
"name",
|
|
110
|
+
"NaN",
|
|
111
|
+
"Number",
|
|
112
|
+
"Object",
|
|
113
|
+
"prototype",
|
|
114
|
+
"String",
|
|
115
|
+
"toString",
|
|
116
|
+
"undefined",
|
|
117
|
+
"valueOf"
|
|
118
|
+
];
|
|
119
|
+
function transformReservedWord(word) {
|
|
120
|
+
if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
|
|
121
|
+
return `_${word}`;
|
|
122
|
+
}
|
|
123
|
+
return word;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
exports.searchAndReplace = searchAndReplace;
|
|
127
|
+
exports.transformReservedWord = transformReservedWord;
|
|
128
|
+
exports.trim = trim;
|
|
129
|
+
exports.trimExtName = trimExtName;
|
|
130
|
+
//# sourceMappingURL=out.js.map
|
|
131
|
+
//# sourceMappingURL=chunk-U4C2WTCI.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/transformers/searchAndReplace.ts","../src/transformers/trim.ts","../src/transformers/transformReservedWord.ts"],"names":[],"mappings":";;;;;AAAA;AAQO,SAAS,iBAAiB,SAA0B;AACzD,QAAM,EAAE,MAAM,WAAW,SAAS,IAAI,IAAI,IAAI;AAE9C,QAAM,eAAe,QAAQ,eAAe,QAAQ,GAAG,KAAK;AAAA,IAC1D,GAAG,MAAM,KAAK,GAAG;AAAA,IACjB,GAAG,MAAM,KAAK,GAAG;AAAA,IACjB,GAAG,MAAM,MAAM,GAAG;AAAA,IAClB,GAAG,MAAM,IAAI,GAAG;AAAA,IAChB,GAAG,MAAM,IAAI,GAAG;AAAA,IAChB,GAAG,MAAM,KAAK,GAAG;AAAA,IACjB,IAAI,OAAO,GAAG,MAAM,GAAG,GAAG,IAAI,GAAG;AAAA,EACnC;AAEA,SAAO,aAAa,OAAO,CAAC,MAAM,gBAAgB;AAChD,WAAO,KAAK,SAAS,EAAE,WAAW,aAAa,SAAS;AAAA,EAC1D,GAAG,IAAI;AACT;;;ACxBA;AAAO,SAAS,KAAK,MAAsB;AACzC,SAAO,KAAK,WAAW,OAAO,EAAE,EAAE,KAAK;AACzC;AAEO,SAAS,YAAY,MAAsB;AAChD,SAAO,KAAK,QAAQ,aAAa,EAAE;AACrC;;;ACNA;AAGA,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAAS,sBAAsB,MAAsB;AAC1D,MAAK,QAAQ,cAAc,SAAS,IAAI,KAAM,MAAM,MAAM,KAAK,GAAG;AAChE,WAAO,IAAI,IAAI;AAAA,EACjB;AAEA,SAAO;AACT","sourcesContent":["type Options = {\n text: string\n replaceBy: string\n prefix?: string\n key: string\n searchValues?: (prefix: string, key: string) => Array<RegExp | string>\n}\n\nexport function searchAndReplace(options: Options): string {\n const { text, replaceBy, prefix = '', key } = options\n\n const searchValues = options.searchValues?.(prefix, key) || [\n `${prefix}[\"${key}\"]`,\n `${prefix}['${key}']`,\n `${prefix}[\\`${key}\\`]`,\n `${prefix}\"${key}\"`,\n `${prefix}'${key}'`,\n `${prefix}\\`${key}\\``,\n new RegExp(`${prefix}${key}`, 'g'),\n ]\n\n return searchValues.reduce((prev, searchValue) => {\n return prev.toString().replaceAll(searchValue, replaceBy)\n }, text) as string\n}\n","export function trim(text: string): string {\n return text.replaceAll(/\\n/g, '').trim()\n}\n\nexport function trimExtName(text: string): string {\n return text.replace(/\\.[^/.]+$/, '')\n}\n","/**\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = [\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n\n 'Array',\n 'Date',\n 'eval',\n 'function',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n]\n\nexport function transformReservedWord(word: string): string {\n if ((word && reservedWords.includes(word)) || word?.match(/^\\d/)) {\n return `_${word}`\n }\n\n return word\n}\n"]}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
import { writeLog } from './chunk-7CNPSL5M.js';
|
|
3
|
+
import { init_esm_shims } from './chunk-WTSDXEWD.js';
|
|
4
|
+
import seedrandom from 'seedrandom';
|
|
5
|
+
import { isatty } from 'tty';
|
|
6
|
+
|
|
7
|
+
createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// src/logger.ts
|
|
10
|
+
init_esm_shims();
|
|
11
|
+
|
|
12
|
+
// ../../node_modules/.pnpm/tinyrainbow@1.1.1/node_modules/tinyrainbow/dist/node.js
|
|
13
|
+
init_esm_shims();
|
|
14
|
+
|
|
15
|
+
// ../../node_modules/.pnpm/tinyrainbow@1.1.1/node_modules/tinyrainbow/dist/chunk-5WCZOS7T.js
|
|
16
|
+
init_esm_shims();
|
|
17
|
+
var b = {
|
|
18
|
+
reset: [0, 0],
|
|
19
|
+
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
20
|
+
dim: [2, 22, "\x1B[22m\x1B[2m"],
|
|
21
|
+
italic: [3, 23],
|
|
22
|
+
underline: [4, 24],
|
|
23
|
+
inverse: [7, 27],
|
|
24
|
+
hidden: [8, 28],
|
|
25
|
+
strikethrough: [9, 29],
|
|
26
|
+
black: [30, 39],
|
|
27
|
+
red: [31, 39],
|
|
28
|
+
green: [32, 39],
|
|
29
|
+
yellow: [33, 39],
|
|
30
|
+
blue: [34, 39],
|
|
31
|
+
magenta: [35, 39],
|
|
32
|
+
cyan: [36, 39],
|
|
33
|
+
white: [37, 39],
|
|
34
|
+
gray: [90, 39],
|
|
35
|
+
bgBlack: [40, 49],
|
|
36
|
+
bgRed: [41, 49],
|
|
37
|
+
bgGreen: [42, 49],
|
|
38
|
+
bgYellow: [43, 49],
|
|
39
|
+
bgBlue: [44, 49],
|
|
40
|
+
bgMagenta: [45, 49],
|
|
41
|
+
bgCyan: [46, 49],
|
|
42
|
+
bgWhite: [47, 49]
|
|
43
|
+
};
|
|
44
|
+
var C = Object.entries(b);
|
|
45
|
+
function d(r2) {
|
|
46
|
+
return String(r2);
|
|
47
|
+
}
|
|
48
|
+
d.open = "";
|
|
49
|
+
d.close = "";
|
|
50
|
+
function p(r2 = false) {
|
|
51
|
+
let n = typeof process != "undefined" ? process : void 0, t = (n == null ? void 0 : n.env) || {}, a = (n == null ? void 0 : n.argv) || [];
|
|
52
|
+
return !("NO_COLOR" in t || a.includes("--no-color")) && !("GITHUB_ACTIONS" in t) && ("FORCE_COLOR" in t || a.includes("--color") || (n == null ? void 0 : n.platform) === "win32" || r2 && t.TERM !== "dumb" || "CI" in t) || typeof window != "undefined" && !!window.chrome;
|
|
53
|
+
}
|
|
54
|
+
function w(r2 = false) {
|
|
55
|
+
let n = p(r2), t = (e, o, c, i) => {
|
|
56
|
+
let u = e.substring(0, i) + c, s = e.substring(i + o.length), l = s.indexOf(o);
|
|
57
|
+
return ~l ? u + t(s, o, c, l) : u + s;
|
|
58
|
+
}, a = (e, o, c = e) => {
|
|
59
|
+
let i = (u) => {
|
|
60
|
+
let s = String(u), l = s.indexOf(o, e.length);
|
|
61
|
+
return ~l ? e + t(s, o, c, l) + o : e + s + o;
|
|
62
|
+
};
|
|
63
|
+
return i.open = e, i.close = o, i;
|
|
64
|
+
}, g = {
|
|
65
|
+
isColorSupported: n
|
|
66
|
+
}, f = (e) => `\x1B[${e}m`;
|
|
67
|
+
for (let [e, o] of C)
|
|
68
|
+
g[e] = n ? a(
|
|
69
|
+
f(o[0]),
|
|
70
|
+
f(o[1]),
|
|
71
|
+
o[2]
|
|
72
|
+
) : d;
|
|
73
|
+
return g;
|
|
74
|
+
}
|
|
75
|
+
var p2 = w(isatty(1));
|
|
76
|
+
|
|
77
|
+
// src/logger.ts
|
|
78
|
+
var LogLevel = {
|
|
79
|
+
silent: "silent",
|
|
80
|
+
info: "info",
|
|
81
|
+
debug: "debug"
|
|
82
|
+
};
|
|
83
|
+
function createLogger({ logLevel, name, spinner }) {
|
|
84
|
+
const logs = [];
|
|
85
|
+
const log = (message) => {
|
|
86
|
+
if (message && spinner) {
|
|
87
|
+
spinner.text = message;
|
|
88
|
+
logs.push(message);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const error = (message) => {
|
|
92
|
+
if (message) {
|
|
93
|
+
throw new Error(message || "Something went wrong");
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const warn = (message) => {
|
|
97
|
+
if (message && spinner) {
|
|
98
|
+
spinner.warn(p2.yellow(message));
|
|
99
|
+
logs.push(message);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const info = (message) => {
|
|
103
|
+
if (message && spinner && logLevel !== LogLevel.silent) {
|
|
104
|
+
spinner.info(message);
|
|
105
|
+
logs.push(message);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const debug = async (message) => {
|
|
109
|
+
if (message) {
|
|
110
|
+
await writeLog(message);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const logger = {
|
|
114
|
+
name,
|
|
115
|
+
logLevel,
|
|
116
|
+
log,
|
|
117
|
+
error,
|
|
118
|
+
warn,
|
|
119
|
+
info,
|
|
120
|
+
debug,
|
|
121
|
+
spinner,
|
|
122
|
+
logs
|
|
123
|
+
};
|
|
124
|
+
return logger;
|
|
125
|
+
}
|
|
126
|
+
var defaultColours = ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"];
|
|
127
|
+
function randomColour(text, colours = defaultColours) {
|
|
128
|
+
if (!text) {
|
|
129
|
+
return "white";
|
|
130
|
+
}
|
|
131
|
+
const random = seedrandom(text);
|
|
132
|
+
const colour = colours.at(Math.floor(random() * colours.length)) || "white";
|
|
133
|
+
return colour;
|
|
134
|
+
}
|
|
135
|
+
function randomCliColour(text, colors = defaultColours) {
|
|
136
|
+
const colours = w(true);
|
|
137
|
+
if (!text) {
|
|
138
|
+
return colours.white(text);
|
|
139
|
+
}
|
|
140
|
+
const colour = randomColour(text, colors);
|
|
141
|
+
const isDark = colour.includes("dark");
|
|
142
|
+
const key = colour.replace("dark", "").toLowerCase();
|
|
143
|
+
const formatter = colours[key];
|
|
144
|
+
if (isDark) {
|
|
145
|
+
return p2.bold(formatter(text));
|
|
146
|
+
}
|
|
147
|
+
if (typeof formatter !== "function") {
|
|
148
|
+
throw new Error("Formatter for picoColor is not of type function/Formatter");
|
|
149
|
+
}
|
|
150
|
+
return formatter(text);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export { LogLevel, createLogger, p2 as p, randomCliColour, randomColour };
|
|
154
|
+
//# sourceMappingURL=out.js.map
|
|
155
|
+
//# sourceMappingURL=chunk-UIQUKFF4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/logger.ts","../../../node_modules/.pnpm/tinyrainbow@1.1.1/node_modules/tinyrainbow/dist/node.js","../../../node_modules/.pnpm/tinyrainbow@1.1.1/node_modules/tinyrainbow/dist/chunk-5WCZOS7T.js"],"names":["r","p"],"mappings":"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","sourcesContent":["import seedrandom from 'seedrandom'\nimport c, { createColors } from 'tinyrainbow'\n\nimport { writeLog } from './fs/write.ts'\n\nimport type { Ora } from 'ora'\nimport type { Formatter } from 'tinyrainbow'\n\nexport const LogLevel = {\n silent: 'silent',\n info: 'info',\n debug: 'debug',\n} as const\n\nexport type LogLevel = keyof typeof LogLevel\n\nexport type Logger = {\n /**\n * Optional config name to show in CLI output\n */\n name?: string\n logLevel: LogLevel\n log: (message: string | null) => void\n error: (message: string | null) => void\n info: (message: string | null) => void\n warn: (message: string | null) => void\n debug: (message: string | null) => Promise<void>\n spinner?: Ora\n logs: string[]\n}\n\ntype Props = {\n name?: string\n logLevel: LogLevel\n spinner?: Ora\n}\n\nexport function createLogger({ logLevel, name, spinner }: Props): Logger {\n const logs: string[] = []\n const log: Logger['log'] = (message) => {\n if (message && spinner) {\n spinner.text = message\n logs.push(message)\n }\n }\n\n const error: Logger['error'] = (message) => {\n if (message) {\n throw new Error(message || 'Something went wrong')\n }\n }\n\n const warn: Logger['warn'] = (message) => {\n if (message && spinner) {\n spinner.warn(c.yellow(message))\n logs.push(message)\n }\n }\n\n const info: Logger['warn'] = (message) => {\n if (message && spinner && logLevel !== LogLevel.silent) {\n spinner.info(message)\n logs.push(message)\n }\n }\n\n const debug: Logger['debug'] = async (message) => {\n if (message) {\n await writeLog(message)\n }\n }\n\n const logger: Logger = {\n name,\n logLevel,\n log,\n error,\n warn,\n info,\n debug,\n spinner,\n logs,\n }\n\n return logger\n}\n\nconst defaultColours = ['black', 'blue', 'darkBlue', 'cyan', 'gray', 'green', 'darkGreen', 'magenta', 'red', 'darkRed', 'yellow', 'darkYellow'] as const\n\nexport function randomColour(text?: string, colours = defaultColours): string {\n if (!text) {\n return 'white'\n }\n\n const random = seedrandom(text)\n const colour = colours.at(Math.floor(random() * colours.length)) || 'white'\n\n return colour\n}\n\nexport function randomCliColour(text?: string, colors = defaultColours): string {\n const colours = createColors(true)\n\n if (!text) {\n return colours.white(text)\n }\n\n const colour = randomColour(text, colors)\n const isDark = colour.includes('dark')\n const key = colour.replace('dark', '').toLowerCase() as keyof typeof colours\n const formatter: Formatter = colours[key] as Formatter\n\n if (isDark) {\n return c.bold(formatter(text))\n }\n\n if (typeof formatter !== 'function') {\n throw new Error('Formatter for picoColor is not of type function/Formatter')\n }\n return formatter(text)\n}\n","import {\n a as t,\n b as e,\n c as o\n} from \"./chunk-5WCZOS7T.js\";\n\n// src/node.ts\nimport { isatty as r } from \"tty\";\nvar p = o(r(1));\nexport {\n o as createColors,\n p as default,\n t as getDefaultColors,\n e as isSupported\n};\n","// src/index.ts\nvar b = {\n reset: [0, 0],\n bold: [1, 22, \"\\x1B[22m\\x1B[1m\"],\n dim: [2, 22, \"\\x1B[22m\\x1B[2m\"],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29],\n black: [30, 39],\n red: [31, 39],\n green: [32, 39],\n yellow: [33, 39],\n blue: [34, 39],\n magenta: [35, 39],\n cyan: [36, 39],\n white: [37, 39],\n gray: [90, 39],\n bgBlack: [40, 49],\n bgRed: [41, 49],\n bgGreen: [42, 49],\n bgYellow: [43, 49],\n bgBlue: [44, 49],\n bgMagenta: [45, 49],\n bgCyan: [46, 49],\n bgWhite: [47, 49]\n}, C = Object.entries(b);\nfunction d(r) {\n return String(r);\n}\nd.open = \"\";\nd.close = \"\";\nvar m = /* @__PURE__ */ C.reduce(\n (r, [n]) => (r[n] = d, r),\n { isColorSupported: !1 }\n);\nfunction x() {\n return { ...m };\n}\nfunction p(r = !1) {\n let n = typeof process != \"undefined\" ? process : void 0, t = (n == null ? void 0 : n.env) || {}, a = (n == null ? void 0 : n.argv) || [];\n return !(\"NO_COLOR\" in t || a.includes(\"--no-color\")) && !(\"GITHUB_ACTIONS\" in t) && (\"FORCE_COLOR\" in t || a.includes(\"--color\") || (n == null ? void 0 : n.platform) === \"win32\" || r && t.TERM !== \"dumb\" || \"CI\" in t) || typeof window != \"undefined\" && !!window.chrome;\n}\nfunction w(r = !1) {\n let n = p(r), t = (e, o, c, i) => {\n let u = e.substring(0, i) + c, s = e.substring(i + o.length), l = s.indexOf(o);\n return ~l ? u + t(s, o, c, l) : u + s;\n }, a = (e, o, c = e) => {\n let i = (u) => {\n let s = String(u), l = s.indexOf(o, e.length);\n return ~l ? e + t(s, o, c, l) + o : e + s + o;\n };\n return i.open = e, i.close = o, i;\n }, g = {\n isColorSupported: n\n }, f = (e) => `\\x1B[${e}m`;\n for (let [e, o] of C)\n g[e] = n ? a(\n f(o[0]),\n f(o[1]),\n o[2]\n ) : d;\n return g;\n}\n\nexport {\n x as a,\n p as b,\n w as c\n};\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
|
|
5
|
+
var __create = Object.create;
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
12
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
13
|
+
}) : x)(function(x) {
|
|
14
|
+
if (typeof require !== "undefined")
|
|
15
|
+
return require.apply(this, arguments);
|
|
16
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
17
|
+
});
|
|
18
|
+
var __esm = (fn, res) => function __init() {
|
|
19
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
20
|
+
};
|
|
21
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
22
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
23
|
+
};
|
|
24
|
+
var __copyProps = (to, from, except, desc) => {
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
+
for (let key of __getOwnPropNames(from))
|
|
27
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
29
|
+
}
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
33
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
34
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
35
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
36
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
37
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
38
|
+
mod
|
|
39
|
+
));
|
|
40
|
+
var __accessCheck = (obj, member, msg) => {
|
|
41
|
+
if (!member.has(obj))
|
|
42
|
+
throw TypeError("Cannot " + msg);
|
|
43
|
+
};
|
|
44
|
+
var __privateGet = (obj, member, getter) => {
|
|
45
|
+
__accessCheck(obj, member, "read from private field");
|
|
46
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
47
|
+
};
|
|
48
|
+
var __privateAdd = (obj, member, value) => {
|
|
49
|
+
if (member.has(obj))
|
|
50
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
51
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
52
|
+
};
|
|
53
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
54
|
+
__accessCheck(obj, member, "write to private field");
|
|
55
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
56
|
+
return value;
|
|
57
|
+
};
|
|
58
|
+
var __privateMethod = (obj, member, method) => {
|
|
59
|
+
__accessCheck(obj, member, "access private method");
|
|
60
|
+
return method;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// ../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.4_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/esm_shims.js
|
|
64
|
+
var init_esm_shims = __esm({
|
|
65
|
+
"../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.4_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/esm_shims.js"() {
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export { __commonJS, __privateAdd, __privateGet, __privateMethod, __privateSet, __require, __toESM, init_esm_shims };
|
|
70
|
+
//# sourceMappingURL=out.js.map
|
|
71
|
+
//# sourceMappingURL=chunk-WTSDXEWD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.4_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/esm_shims.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n"]}
|