@quentinhsu/biome-config 0.3.5 → 0.4.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/dist/131.mjs +358 -0
- package/dist/build.mjs +108 -360
- package/dist/index.jsonc +1 -1
- package/dist/index.mjs +1 -358
- package/dist/next.jsonc +1 -1
- package/dist/nuxt.jsonc +1 -1
- package/dist/react.jsonc +1 -1
- package/dist/rslib-runtime.mjs +38 -0
- package/dist/types/scripts/tag-release.d.ts +1 -0
- package/dist/types/scripts/validate-config-properties.d.ts +1 -0
- package/dist/types/src/constants/biome.d.ts +1 -1
- package/dist/types/src/generated/biome/index.d.ts +12 -10
- package/dist/types/src/generated/biome/{no-label-var-options.d.ts → no-comment-text-options.d.ts} +217 -532
- package/dist/types/src/generated/biome/no-global-object-calls-options.d.ts +74 -75
- package/dist/types/src/generated/biome/{use-qwik-classlist-configuration.d.ts → no-sync-scripts-configuration.d.ts} +56 -112
- package/dist/types/src/generated/biome/{use-focusable-interactive-configuration.d.ts → no-useless-constructor-configuration.d.ts} +33 -51
- package/dist/types/src/generated/biome/nursery.d.ts +822 -0
- package/dist/types/src/generated/biome/pattern-options.d.ts +1075 -0
- package/dist/types/src/generated/biome/rule-with-no-access-key-options.d.ts +555 -0
- package/dist/types/src/generated/biome/rule-with-no-blank-target-options.d.ts +530 -0
- package/dist/types/src/generated/biome/rule-with-no-fallthrough-switch-clause-options.d.ts +469 -0
- package/dist/types/src/generated/biome/rule-with-no-unknown-unit-options.d.ts +564 -0
- package/dist/types/src/generated/biome/schema.d.ts +24 -6
- package/dist/types/src/generated/biome/style.d.ts +614 -0
- package/dist/types/src/generated/biome/use-for-of-configuration.d.ts +144 -0
- package/dist/types/src/generated/biome/{no-magic-numbers-options.d.ts → use-unique-variable-names-options.d.ts} +127 -105
- package/dist/vue.jsonc +1 -1
- package/package.json +11 -7
- package/dist/types/src/generated/biome/linter-configuration.d.ts +0 -181
- package/dist/types/src/generated/biome/rule-with-no-confusing-labels-options.d.ts +0 -1236
- package/dist/types/src/generated/biome/rule-with-no-excessive-nested-test-suites-options.d.ts +0 -1440
- package/dist/types/src/generated/biome/rule-with-no-unused-expressions-options.d.ts +0 -1337
- package/dist/types/src/generated/biome/use-consistent-object-definitions-configuration.d.ts +0 -1304
- package/dist/types/src/generated/biome/use-shorthand-assign-configuration.d.ts +0 -571
package/dist/build.mjs
CHANGED
|
@@ -1,363 +1,78 @@
|
|
|
1
|
+
import { __webpack_require__ } from "./rslib-runtime.mjs";
|
|
1
2
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
3
|
import { dirname, join } from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
import { allPresets } from "./131.mjs";
|
|
6
|
+
__webpack_require__.add({
|
|
7
|
+
"./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
8
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
9
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
10
|
+
let formatter = (open, close, replace = open)=>(input)=>{
|
|
11
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
12
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
13
|
+
};
|
|
14
|
+
let replaceClose = (string, close, replace, index)=>{
|
|
15
|
+
let result = "", cursor = 0;
|
|
16
|
+
do {
|
|
17
|
+
result += string.substring(cursor, index) + replace;
|
|
18
|
+
cursor = index + close.length;
|
|
19
|
+
index = string.indexOf(close, cursor);
|
|
20
|
+
}while (~index);
|
|
21
|
+
return result + string.substring(cursor);
|
|
22
|
+
};
|
|
23
|
+
let createColors = (enabled = isColorSupported)=>{
|
|
24
|
+
let f = enabled ? formatter : ()=>String;
|
|
25
|
+
return {
|
|
26
|
+
isColorSupported: enabled,
|
|
27
|
+
reset: f("\x1b[0m", "\x1b[0m"),
|
|
28
|
+
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
29
|
+
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
30
|
+
italic: f("\x1b[3m", "\x1b[23m"),
|
|
31
|
+
underline: f("\x1b[4m", "\x1b[24m"),
|
|
32
|
+
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
33
|
+
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
34
|
+
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
35
|
+
black: f("\x1b[30m", "\x1b[39m"),
|
|
36
|
+
red: f("\x1b[31m", "\x1b[39m"),
|
|
37
|
+
green: f("\x1b[32m", "\x1b[39m"),
|
|
38
|
+
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
39
|
+
blue: f("\x1b[34m", "\x1b[39m"),
|
|
40
|
+
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
41
|
+
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
42
|
+
white: f("\x1b[37m", "\x1b[39m"),
|
|
43
|
+
gray: f("\x1b[90m", "\x1b[39m"),
|
|
44
|
+
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
45
|
+
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
46
|
+
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
47
|
+
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
48
|
+
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
49
|
+
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
50
|
+
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
51
|
+
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
52
|
+
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
53
|
+
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
54
|
+
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
55
|
+
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
56
|
+
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
57
|
+
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
58
|
+
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
59
|
+
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
60
|
+
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
61
|
+
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
62
|
+
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
63
|
+
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
64
|
+
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
65
|
+
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
66
|
+
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
67
|
+
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
module.exports = createColors();
|
|
71
|
+
module.exports.createColors = createColors;
|
|
19
72
|
}
|
|
20
|
-
return false;
|
|
21
|
-
};
|
|
22
|
-
const deepMerge = (target, source)=>{
|
|
23
|
-
for (const [key, value] of Object.entries(source)){
|
|
24
|
-
const current = target[key];
|
|
25
|
-
if (Array.isArray(value)) {
|
|
26
|
-
if (Array.isArray(current)) target[key] = mergeArrays(current, value);
|
|
27
|
-
else target[key] = [
|
|
28
|
-
...value
|
|
29
|
-
];
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (isPlainObject(value)) {
|
|
33
|
-
const nextTarget = isPlainObject(current) ? {
|
|
34
|
-
...current
|
|
35
|
-
} : {};
|
|
36
|
-
target[key] = deepMerge(nextTarget, value);
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
target[key] = value;
|
|
40
|
-
}
|
|
41
|
-
return target;
|
|
42
|
-
};
|
|
43
|
-
const mergeConfigs = (...configs)=>{
|
|
44
|
-
const merged = configs.reduce((accumulator, config)=>deepMerge(accumulator, config), {});
|
|
45
|
-
return merged;
|
|
46
|
-
};
|
|
47
|
-
const BIOME_SCHEMA_URL = 'https://biomejs.dev/schemas/2.3.5/schema.json';
|
|
48
|
-
const indexConfig = {
|
|
49
|
-
$schema: BIOME_SCHEMA_URL,
|
|
50
|
-
assist: {
|
|
51
|
-
actions: {
|
|
52
|
-
source: {
|
|
53
|
-
organizeImports: {
|
|
54
|
-
level: 'on',
|
|
55
|
-
options: {
|
|
56
|
-
groups: [
|
|
57
|
-
[
|
|
58
|
-
':NODE:',
|
|
59
|
-
':BUN:',
|
|
60
|
-
':PACKAGE_WITH_PROTOCOL:',
|
|
61
|
-
':PACKAGE:'
|
|
62
|
-
],
|
|
63
|
-
':BLANK_LINE:',
|
|
64
|
-
':ALIAS:',
|
|
65
|
-
':BLANK_LINE:',
|
|
66
|
-
':PATH:'
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
useSortedAttributes: {
|
|
71
|
-
level: 'on',
|
|
72
|
-
options: {
|
|
73
|
-
sortOrder: 'natural'
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
useSortedKeys: 'on'
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
files: {
|
|
81
|
-
ignoreUnknown: true,
|
|
82
|
-
includes: [
|
|
83
|
-
'**',
|
|
84
|
-
'!**/build',
|
|
85
|
-
'!**/dist',
|
|
86
|
-
'!**/.next'
|
|
87
|
-
]
|
|
88
|
-
},
|
|
89
|
-
formatter: {
|
|
90
|
-
enabled: true,
|
|
91
|
-
formatWithErrors: true,
|
|
92
|
-
indentStyle: 'space',
|
|
93
|
-
lineWidth: 140
|
|
94
|
-
},
|
|
95
|
-
javascript: {
|
|
96
|
-
formatter: {
|
|
97
|
-
arrowParentheses: 'asNeeded',
|
|
98
|
-
jsxQuoteStyle: 'single',
|
|
99
|
-
quoteStyle: 'single',
|
|
100
|
-
trailingCommas: 'all'
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
linter: {
|
|
104
|
-
enabled: true,
|
|
105
|
-
rules: {
|
|
106
|
-
complexity: {
|
|
107
|
-
noUselessStringConcat: 'error',
|
|
108
|
-
noUselessUndefinedInitialization: 'error',
|
|
109
|
-
noVoid: 'error',
|
|
110
|
-
useDateNow: 'error'
|
|
111
|
-
},
|
|
112
|
-
correctness: {
|
|
113
|
-
noConstantMathMinMaxClamp: 'error',
|
|
114
|
-
noUndeclaredVariables: 'error',
|
|
115
|
-
noUnusedFunctionParameters: 'error',
|
|
116
|
-
noUnusedImports: 'error',
|
|
117
|
-
noUnusedPrivateClassMembers: 'error',
|
|
118
|
-
noUnusedVariables: 'error',
|
|
119
|
-
useExhaustiveDependencies: {
|
|
120
|
-
level: 'error',
|
|
121
|
-
options: {
|
|
122
|
-
reportUnnecessaryDependencies: false
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
nursery: {
|
|
127
|
-
useSortedClasses: {
|
|
128
|
-
fix: 'safe',
|
|
129
|
-
level: 'error',
|
|
130
|
-
options: {
|
|
131
|
-
functions: [
|
|
132
|
-
'clsx',
|
|
133
|
-
'cn'
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
recommended: true,
|
|
139
|
-
style: {
|
|
140
|
-
noParameterProperties: 'error',
|
|
141
|
-
noYodaExpression: 'error',
|
|
142
|
-
useArrayLiterals: 'error',
|
|
143
|
-
useConsistentBuiltinInstantiation: 'error',
|
|
144
|
-
useFragmentSyntax: 'error',
|
|
145
|
-
useImportType: {
|
|
146
|
-
fix: 'safe',
|
|
147
|
-
level: 'error',
|
|
148
|
-
options: {
|
|
149
|
-
style: 'separatedType'
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
useSelfClosingElements: {
|
|
153
|
-
fix: 'safe',
|
|
154
|
-
level: 'error',
|
|
155
|
-
options: {}
|
|
156
|
-
},
|
|
157
|
-
useShorthandAssign: 'error'
|
|
158
|
-
},
|
|
159
|
-
suspicious: {
|
|
160
|
-
noEvolvingTypes: 'error',
|
|
161
|
-
useAwait: 'error'
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
overrides: [
|
|
166
|
-
{
|
|
167
|
-
includes: [
|
|
168
|
-
'**/*.jsx',
|
|
169
|
-
'**/*.tsx'
|
|
170
|
-
],
|
|
171
|
-
linter: {
|
|
172
|
-
rules: {
|
|
173
|
-
style: {
|
|
174
|
-
noParameterAssign: 'error'
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
includes: [
|
|
181
|
-
'**/*.ts',
|
|
182
|
-
'**/*.tsx'
|
|
183
|
-
],
|
|
184
|
-
linter: {
|
|
185
|
-
rules: {
|
|
186
|
-
correctness: {
|
|
187
|
-
noUnusedVariables: 'off'
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
],
|
|
193
|
-
root: true,
|
|
194
|
-
vcs: {
|
|
195
|
-
clientKind: 'git',
|
|
196
|
-
defaultBranch: 'main',
|
|
197
|
-
enabled: true,
|
|
198
|
-
useIgnoreFile: true
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
const reactOverlay = {
|
|
202
|
-
files: {
|
|
203
|
-
includes: [
|
|
204
|
-
'!**/.storybook'
|
|
205
|
-
]
|
|
206
|
-
},
|
|
207
|
-
javascript: {
|
|
208
|
-
jsxRuntime: 'reactClassic'
|
|
209
|
-
},
|
|
210
|
-
linter: {
|
|
211
|
-
rules: {
|
|
212
|
-
style: {
|
|
213
|
-
useFragmentSyntax: 'error'
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
overrides: [
|
|
218
|
-
{
|
|
219
|
-
includes: [
|
|
220
|
-
'**/__tests__/**',
|
|
221
|
-
'**/*.{test,spec}.{ts,tsx,js,jsx}'
|
|
222
|
-
],
|
|
223
|
-
linter: {
|
|
224
|
-
rules: {
|
|
225
|
-
correctness: {
|
|
226
|
-
noUnusedVariables: 'off'
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
]
|
|
232
|
-
};
|
|
233
|
-
const reactConfig = mergeConfigs(indexConfig, reactOverlay);
|
|
234
|
-
const nextOverlay = {
|
|
235
|
-
files: {
|
|
236
|
-
includes: [
|
|
237
|
-
'!**/.next',
|
|
238
|
-
'!**/.vercel',
|
|
239
|
-
'!**/out'
|
|
240
|
-
]
|
|
241
|
-
},
|
|
242
|
-
javascript: {
|
|
243
|
-
jsxRuntime: 'transparent'
|
|
244
|
-
},
|
|
245
|
-
linter: {
|
|
246
|
-
rules: {
|
|
247
|
-
correctness: {
|
|
248
|
-
useExhaustiveDependencies: {
|
|
249
|
-
level: 'error',
|
|
250
|
-
options: {
|
|
251
|
-
reportUnnecessaryDependencies: true
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
const nextConfig = mergeConfigs(reactConfig, nextOverlay);
|
|
259
|
-
const vueOverlay = {
|
|
260
|
-
files: {
|
|
261
|
-
includes: [
|
|
262
|
-
'!**/.vitepress',
|
|
263
|
-
'!**/.output'
|
|
264
|
-
]
|
|
265
|
-
},
|
|
266
|
-
javascript: {
|
|
267
|
-
parser: {
|
|
268
|
-
jsxEverywhere: false
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
html: {
|
|
272
|
-
formatter: {
|
|
273
|
-
indentScriptAndStyle: true,
|
|
274
|
-
selfCloseVoidElements: 'always'
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
overrides: [
|
|
278
|
-
{
|
|
279
|
-
includes: [
|
|
280
|
-
'**/*.vue'
|
|
281
|
-
],
|
|
282
|
-
formatter: {
|
|
283
|
-
lineWidth: 120
|
|
284
|
-
},
|
|
285
|
-
javascript: {
|
|
286
|
-
formatter: {
|
|
287
|
-
quoteStyle: 'single'
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
]
|
|
292
|
-
};
|
|
293
|
-
const vueConfig = mergeConfigs(indexConfig, vueOverlay);
|
|
294
|
-
const nuxtOverlay = {
|
|
295
|
-
files: {
|
|
296
|
-
includes: [
|
|
297
|
-
'!**/.nuxt',
|
|
298
|
-
'!**/.nitro',
|
|
299
|
-
'!**/.output'
|
|
300
|
-
]
|
|
301
|
-
},
|
|
302
|
-
javascript: {
|
|
303
|
-
globals: [
|
|
304
|
-
'defineNuxtConfig',
|
|
305
|
-
'defineAppConfig',
|
|
306
|
-
'defineNuxtPlugin',
|
|
307
|
-
'defineNuxtRouteMiddleware',
|
|
308
|
-
'defineNuxtServerPlugin',
|
|
309
|
-
'defineNitroPlugin',
|
|
310
|
-
'defineEventHandler',
|
|
311
|
-
'defineLazyEventHandler',
|
|
312
|
-
'definePayloadPlugin',
|
|
313
|
-
'defineRouteRules',
|
|
314
|
-
'definePageMeta',
|
|
315
|
-
'useRuntimeConfig',
|
|
316
|
-
'useNuxtApp',
|
|
317
|
-
'useAsyncData',
|
|
318
|
-
'useLazyAsyncData',
|
|
319
|
-
'useFetch',
|
|
320
|
-
'useLazyFetch',
|
|
321
|
-
'useState',
|
|
322
|
-
'useCookie',
|
|
323
|
-
'useHead',
|
|
324
|
-
'useSeoMeta',
|
|
325
|
-
'useError',
|
|
326
|
-
'clearError',
|
|
327
|
-
'showError',
|
|
328
|
-
'navigateTo',
|
|
329
|
-
'abortNavigation',
|
|
330
|
-
'refreshNuxtData',
|
|
331
|
-
'onNuxtReady',
|
|
332
|
-
'useRouter',
|
|
333
|
-
'useRoute',
|
|
334
|
-
'useRequestEvent',
|
|
335
|
-
'useRequestHeaders'
|
|
336
|
-
]
|
|
337
|
-
},
|
|
338
|
-
overrides: [
|
|
339
|
-
{
|
|
340
|
-
includes: [
|
|
341
|
-
'**/*.ts'
|
|
342
|
-
],
|
|
343
|
-
linter: {
|
|
344
|
-
rules: {
|
|
345
|
-
correctness: {
|
|
346
|
-
noUndeclaredVariables: 'error'
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
]
|
|
352
|
-
};
|
|
353
|
-
const nuxtConfig = mergeConfigs(vueConfig, nuxtOverlay);
|
|
354
|
-
const allPresets = Object.freeze({
|
|
355
|
-
index: indexConfig,
|
|
356
|
-
next: nextConfig,
|
|
357
|
-
nuxt: nuxtConfig,
|
|
358
|
-
react: reactConfig,
|
|
359
|
-
vue: vueConfig
|
|
360
73
|
});
|
|
74
|
+
const picocolors = __webpack_require__("./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
75
|
+
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
361
76
|
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
362
77
|
const outputDir = currentDir;
|
|
363
78
|
const serialize = (config)=>`${JSON.stringify(config, null, 2)}\n`;
|
|
@@ -368,19 +83,52 @@ async function ensureDir(path) {
|
|
|
368
83
|
}
|
|
369
84
|
async function buildJsonPresets() {
|
|
370
85
|
await ensureDir(outputDir);
|
|
86
|
+
const startTime = performance.now();
|
|
87
|
+
console.log(picocolors_default().blue(`
|
|
88
|
+
██████╗ ██╗ ██████╗ ███╗ ███╗███████╗ ██████╗ ██████╗ ███╗ ██╗███████╗██╗ ██████╗
|
|
89
|
+
██╔══██╗██║██╔═══██╗████╗ ████║██╔════╝ ██╔════╝██╔═══██╗████╗ ██║██╔════╝██║██╔════╝
|
|
90
|
+
██████╔╝██║██║ ██║██╔████╔██║█████╗ ██║ ██║ ██║██╔██╗ ██║█████╗ ██║██║ ███╗
|
|
91
|
+
██╔══██╗██║██║ ██║██║╚██╔╝██║██╔══╝ ██║ ██║ ██║██║╚██╗██║██╔══╝ ██║██║ ██║
|
|
92
|
+
██████╔╝██║╚██████╔╝██║ ╚═╝ ██║███████╗ ╚██████╗╚██████╔╝██║ ╚████║██║ ██║╚██████╔╝
|
|
93
|
+
╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═════╝
|
|
94
|
+
`));
|
|
95
|
+
console.log(`${picocolors_default().magenta('config')} ${Object.keys(allPresets).length} presets loaded`);
|
|
96
|
+
console.log(`${picocolors_default().cyan('info')} build started...`);
|
|
371
97
|
const tasks = Object.entries(allPresets).map(async ([name, config])=>{
|
|
372
|
-
const
|
|
98
|
+
const fileName = `${name}.jsonc`;
|
|
99
|
+
const filePath = join(outputDir, fileName);
|
|
373
100
|
const data = serialize(config);
|
|
374
101
|
await writeFile(filePath, data, 'utf8');
|
|
375
|
-
|
|
102
|
+
const size = Buffer.byteLength(data, 'utf8');
|
|
103
|
+
return {
|
|
104
|
+
fileName,
|
|
105
|
+
size
|
|
106
|
+
};
|
|
376
107
|
});
|
|
377
|
-
const
|
|
378
|
-
|
|
108
|
+
const results = await Promise.all(tasks);
|
|
109
|
+
const endTime = performance.now();
|
|
110
|
+
const duration = (endTime - startTime).toFixed(2);
|
|
111
|
+
console.log(`${picocolors_default().green('ready')} built in ${duration} ms`);
|
|
112
|
+
return results;
|
|
379
113
|
}
|
|
380
114
|
(async ()=>{
|
|
381
115
|
try {
|
|
382
116
|
const files = await buildJsonPresets();
|
|
383
|
-
console.log(
|
|
117
|
+
console.log('');
|
|
118
|
+
const PADDING = 25;
|
|
119
|
+
console.log(`${picocolors_default().gray('File'.padEnd(PADDING))} ${picocolors_default().gray('Size')}`);
|
|
120
|
+
let totalSize = 0;
|
|
121
|
+
for (const file of files){
|
|
122
|
+
const sizeKB = (file.size / 1024).toFixed(1);
|
|
123
|
+
totalSize += file.size;
|
|
124
|
+
const filePath = `dist/${file.fileName}`;
|
|
125
|
+
const paddedPath = filePath.padEnd(PADDING);
|
|
126
|
+
console.log(`${picocolors_default().cyan(paddedPath)} ${picocolors_default().bold(sizeKB + ' kB')}`);
|
|
127
|
+
}
|
|
128
|
+
console.log('');
|
|
129
|
+
const totalKB = (totalSize / 1024).toFixed(1);
|
|
130
|
+
console.log(`${picocolors_default().magenta('Total:'.padEnd(PADDING))} ${totalKB} kB`);
|
|
131
|
+
console.log('');
|
|
384
132
|
} catch (error) {
|
|
385
133
|
console.error('Failed to generate Biome presets', error);
|
|
386
134
|
process.exitCode = 1;
|
package/dist/index.jsonc
CHANGED