@powerlines/core 0.43.31 → 0.44.1
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/constants/index.cjs +5 -1
- package/dist/constants/index.d.cts +2 -1
- package/dist/constants/index.d.mts +2 -1
- package/dist/constants/index.mjs +3 -2
- package/dist/constants/log-level.cjs +43 -0
- package/dist/constants/log-level.d.cts +40 -0
- package/dist/constants/log-level.d.cts.map +1 -0
- package/dist/constants/log-level.d.mts +40 -0
- package/dist/constants/log-level.d.mts.map +1 -0
- package/dist/constants/log-level.mjs +41 -0
- package/dist/constants/log-level.mjs.map +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -2
- package/dist/lib/index.cjs +0 -6
- package/dist/lib/index.d.cts +1 -2
- package/dist/lib/index.d.mts +1 -2
- package/dist/lib/index.mjs +1 -2
- package/dist/lib/unplugin/plugin.cjs +9 -11
- package/dist/lib/unplugin/plugin.d.cts.map +1 -1
- package/dist/lib/unplugin/plugin.d.mts.map +1 -1
- package/dist/lib/unplugin/plugin.mjs +9 -11
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/lib/utilities/write-file.cjs +1 -2
- package/dist/lib/utilities/write-file.d.cts +1 -1
- package/dist/lib/utilities/write-file.d.cts.map +1 -1
- package/dist/lib/utilities/write-file.d.mts +1 -1
- package/dist/lib/utilities/write-file.d.mts.map +1 -1
- package/dist/lib/utilities/write-file.mjs +1 -2
- package/dist/lib/utilities/write-file.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +15 -1
- package/dist/plugin-utils/index.d.cts +2 -2
- package/dist/plugin-utils/index.d.mts +2 -2
- package/dist/plugin-utils/index.mjs +2 -2
- package/dist/plugin-utils/logging.cjs +375 -1
- package/dist/plugin-utils/logging.d.cts +85 -1
- package/dist/plugin-utils/logging.d.cts.map +1 -1
- package/dist/plugin-utils/logging.d.mts +85 -1
- package/dist/plugin-utils/logging.d.mts.map +1 -1
- package/dist/plugin-utils/logging.mjs +360 -1
- package/dist/plugin-utils/logging.mjs.map +1 -1
- package/dist/types/config.d.cts +33 -28
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +33 -28
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/context.d.cts +20 -34
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +20 -34
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.mjs +3 -0
- package/dist/types/logging.cjs +48 -0
- package/dist/types/logging.d.cts +174 -0
- package/dist/types/logging.d.cts.map +1 -0
- package/dist/types/logging.d.mts +174 -0
- package/dist/types/logging.d.mts.map +1 -0
- package/dist/types/logging.mjs +45 -0
- package/dist/types/logging.mjs.map +1 -0
- package/package.json +74 -442
- package/dist/lib/logger.cjs +0 -100
- package/dist/lib/logger.d.cts +0 -54
- package/dist/lib/logger.d.cts.map +0 -1
- package/dist/lib/logger.d.mts +0 -54
- package/dist/lib/logger.d.mts.map +0 -1
- package/dist/lib/logger.mjs +0 -94
- package/dist/lib/logger.mjs.map +0 -1
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import { LOG_LEVELS, LogCategories, LogLevels } from "../types/logging.mjs";
|
|
2
|
+
import { DEFAULT_ENVIRONMENT } from "../constants/environments.mjs";
|
|
3
|
+
import { DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL } from "../constants/log-level.mjs";
|
|
4
|
+
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
5
|
+
import { defu as defu$1 } from "defu";
|
|
6
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
1
7
|
import { isString } from "@stryke/type-checks/is-string";
|
|
8
|
+
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
9
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
10
|
+
import { getLogFn, getLogLevel } from "@storm-software/config-tools/logger";
|
|
11
|
+
import { getColor } from "@storm-software/config-tools/utilities/colors";
|
|
12
|
+
import { uuid } from "@stryke/unique-id/uuid";
|
|
13
|
+
import chalk from "chalk";
|
|
2
14
|
|
|
3
15
|
//#region src/plugin-utils/logging.ts
|
|
4
16
|
/**
|
|
@@ -11,7 +23,354 @@ function isVerbose(logLevelOrContext) {
|
|
|
11
23
|
const level = isString(logLevelOrContext) ? logLevelOrContext : logLevelOrContext.config.logLevel;
|
|
12
24
|
return level === "debug" || level === "trace";
|
|
13
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Resolves the log level configuration based on the provided log level and mode, returning a complete LogLevelResolvedConfig object that specifies the log level for each log category.
|
|
28
|
+
*
|
|
29
|
+
* @param logLevel - The user-provided log level configuration, which can be a string or an object specifying log levels for each category.
|
|
30
|
+
* @param mode - The current mode of the application (e.g., "development", "test", "production"), which determines the default log levels.
|
|
31
|
+
* @returns A LogLevelResolvedConfig object specifying the log level for each log category.
|
|
32
|
+
*/
|
|
33
|
+
function resolveLogLevel(logLevel, mode) {
|
|
34
|
+
if (logLevel === "trace") return {
|
|
35
|
+
general: "trace",
|
|
36
|
+
fs: "trace",
|
|
37
|
+
performance: "trace",
|
|
38
|
+
network: "trace",
|
|
39
|
+
plugins: "trace",
|
|
40
|
+
hooks: "trace",
|
|
41
|
+
env: "trace",
|
|
42
|
+
ipc: "trace",
|
|
43
|
+
config: "trace",
|
|
44
|
+
babel: "trace"
|
|
45
|
+
};
|
|
46
|
+
else if (logLevel === "silent") return {
|
|
47
|
+
general: "silent",
|
|
48
|
+
fs: "silent",
|
|
49
|
+
performance: "silent",
|
|
50
|
+
network: "silent",
|
|
51
|
+
plugins: "silent",
|
|
52
|
+
hooks: "silent",
|
|
53
|
+
env: "silent",
|
|
54
|
+
ipc: "silent",
|
|
55
|
+
config: "silent",
|
|
56
|
+
babel: "silent"
|
|
57
|
+
};
|
|
58
|
+
let defaultLogLevel;
|
|
59
|
+
if (mode === "development") defaultLogLevel = DEFAULT_DEVELOPMENT_LOG_LEVEL;
|
|
60
|
+
else if (mode === "test") defaultLogLevel = DEFAULT_TEST_LOG_LEVEL;
|
|
61
|
+
else defaultLogLevel = DEFAULT_PRODUCTION_LOG_LEVEL;
|
|
62
|
+
if (isSetString(logLevel)) return {
|
|
63
|
+
general: logLevel,
|
|
64
|
+
fs: defaultLogLevel.fs,
|
|
65
|
+
performance: logLevel,
|
|
66
|
+
network: defaultLogLevel.network,
|
|
67
|
+
plugins: logLevel,
|
|
68
|
+
hooks: logLevel,
|
|
69
|
+
env: defaultLogLevel.env,
|
|
70
|
+
ipc: defaultLogLevel.ipc,
|
|
71
|
+
config: defaultLogLevel.config,
|
|
72
|
+
babel: logLevel
|
|
73
|
+
};
|
|
74
|
+
else if (isSetObject(logLevel)) return defu$1(logLevel, defaultLogLevel);
|
|
75
|
+
return defaultLogLevel;
|
|
76
|
+
}
|
|
77
|
+
const BADGE_COLORS = [
|
|
78
|
+
"#00A0DD",
|
|
79
|
+
"#6FCE4E",
|
|
80
|
+
"#FBBF24",
|
|
81
|
+
"#F43F5E",
|
|
82
|
+
"#3B82F6",
|
|
83
|
+
"#A855F7",
|
|
84
|
+
"#469592",
|
|
85
|
+
"#288EDF",
|
|
86
|
+
"#D8B4FE",
|
|
87
|
+
"#10B981",
|
|
88
|
+
"#EF4444",
|
|
89
|
+
"#F0EC56",
|
|
90
|
+
"#F472B6",
|
|
91
|
+
"#22D3EE",
|
|
92
|
+
"#EAB308",
|
|
93
|
+
"#84CC16",
|
|
94
|
+
"#F87171",
|
|
95
|
+
"#0EA5E9",
|
|
96
|
+
"#D946EF",
|
|
97
|
+
"#FACC15",
|
|
98
|
+
"#34D399",
|
|
99
|
+
"#8B5CF6"
|
|
100
|
+
];
|
|
101
|
+
const BRAND_COLOR = getColor("brand");
|
|
102
|
+
/**
|
|
103
|
+
* Generate a consistent color based on the input text.
|
|
104
|
+
*
|
|
105
|
+
* @param text - The input text to generate the color from.
|
|
106
|
+
* @return A hexadecimal color string.
|
|
107
|
+
*/
|
|
108
|
+
const getTextColor = (text) => {
|
|
109
|
+
return BADGE_COLORS[text.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0];
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Generate a consistent color based on the input text.
|
|
113
|
+
*
|
|
114
|
+
* @param text - The input text to generate the color from.
|
|
115
|
+
* @return A hexadecimal color string.
|
|
116
|
+
*/
|
|
117
|
+
const colorText = (text) => {
|
|
118
|
+
const title = titleCase(text);
|
|
119
|
+
return chalk.hex(getTextColor(title))(title);
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Generate a consistent color based on the input text.
|
|
123
|
+
*
|
|
124
|
+
* @param text - The input text to generate the color from.
|
|
125
|
+
* @return A hexadecimal color string.
|
|
126
|
+
*/
|
|
127
|
+
const colorBackground = (text) => {
|
|
128
|
+
const title = titleCase(text);
|
|
129
|
+
return chalk.inverse.hex(getTextColor(title))(` ${title} `);
|
|
130
|
+
};
|
|
131
|
+
const consoleLog = (meta, ...args) => getLogFn(getLogLevel(meta.type), { logLevel: "trace" })(`${meta.name ? chalk.bold.hex(BRAND_COLOR)(kebabCase(meta.name)) : ""}${meta.command ? chalk.hex(BRAND_COLOR)(` (${meta.command})`) : ""}${meta.name ? chalk.grey(" > ") : ""}${(meta.source || meta.plugin) && (!meta.name || kebabCase(meta.source || meta.plugin) !== kebabCase(meta.name)) ? `${chalk.bold.hex(BRAND_COLOR)(kebabCase(meta.source || meta.plugin))}${chalk.grey(" > ")}` : ""}${meta.environment && kebabCase(meta.environment) !== "default" ? `${chalk.bold.hex(BRAND_COLOR)(kebabCase(meta.environment))}${chalk.grey(" > ")}` : ""}${meta.category && meta.category !== LogCategories.GENERAL ? ` ${colorBackground(kebabCase(meta.category))} ` : ""}${args.join(" ")} `.trim());
|
|
132
|
+
function isValidLogLevel(logLevel, type) {
|
|
133
|
+
if (logLevel === LogLevels.SILENT) return false;
|
|
134
|
+
return LOG_LEVELS.indexOf(logLevel) >= LOG_LEVELS.indexOf(type);
|
|
135
|
+
}
|
|
136
|
+
function isValidLogLevelConfig(type, logLevel, category = LogCategories.GENERAL) {
|
|
137
|
+
return isValidLogLevel(logLevel[category], type);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Create a logging function with a specific name and options.
|
|
141
|
+
*
|
|
142
|
+
* @param name - The name of the logging function.
|
|
143
|
+
* @param options - The options to configure the logging function, including the source, command, environment, plugin, log level, custom logger, and colors. These options can be used to customize the appearance and behavior of the log messages generated by the logging function.
|
|
144
|
+
* @returns A logging function.
|
|
145
|
+
*/
|
|
146
|
+
const createLogFn = (name, options) => {
|
|
147
|
+
const logLevel = resolveLogLevel(options.logLevel, options.mode);
|
|
148
|
+
return (meta, ...args) => {
|
|
149
|
+
const logMeta = isSetObject(meta) ? {
|
|
150
|
+
logId: uuid(),
|
|
151
|
+
timestamp: Date.now(),
|
|
152
|
+
category: LogCategories.GENERAL,
|
|
153
|
+
...options,
|
|
154
|
+
...meta,
|
|
155
|
+
name
|
|
156
|
+
} : {
|
|
157
|
+
logId: uuid(),
|
|
158
|
+
timestamp: Date.now(),
|
|
159
|
+
category: LogCategories.GENERAL,
|
|
160
|
+
...options,
|
|
161
|
+
type: meta,
|
|
162
|
+
name
|
|
163
|
+
};
|
|
164
|
+
if (isValidLogLevelConfig(logMeta.type, logLevel, logMeta.category ? logMeta.category : LogCategories.GENERAL)) consoleLog(logMeta, ...args);
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
const validateLogger = (type, name, options, callback) => {
|
|
168
|
+
const logLevel = resolveLogLevel(options.logLevel, options.mode);
|
|
169
|
+
return (message) => {
|
|
170
|
+
const params = isSetString(message) ? {
|
|
171
|
+
name,
|
|
172
|
+
plugin: options.plugin,
|
|
173
|
+
meta: {
|
|
174
|
+
type,
|
|
175
|
+
name,
|
|
176
|
+
category: LogCategories.GENERAL,
|
|
177
|
+
logId: uuid(),
|
|
178
|
+
timestamp: Date.now(),
|
|
179
|
+
...options
|
|
180
|
+
},
|
|
181
|
+
message
|
|
182
|
+
} : {
|
|
183
|
+
name,
|
|
184
|
+
plugin: options.plugin,
|
|
185
|
+
...message,
|
|
186
|
+
meta: {
|
|
187
|
+
type,
|
|
188
|
+
name,
|
|
189
|
+
category: LogCategories.GENERAL,
|
|
190
|
+
logId: uuid(),
|
|
191
|
+
timestamp: Date.now(),
|
|
192
|
+
plugin: message.plugin,
|
|
193
|
+
...options,
|
|
194
|
+
...message.meta
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
if (isValidLogLevelConfig(type, logLevel, params.meta.category)) callback(params);
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
const validateCustomLogger = (type, name, options, callback, customCallback) => {
|
|
201
|
+
const logLevel = resolveLogLevel(options.logLevel, options.mode);
|
|
202
|
+
return (message) => {
|
|
203
|
+
const params = isSetString(message) ? {
|
|
204
|
+
name,
|
|
205
|
+
plugin: options.plugin,
|
|
206
|
+
meta: {
|
|
207
|
+
type,
|
|
208
|
+
name,
|
|
209
|
+
category: LogCategories.GENERAL,
|
|
210
|
+
logId: uuid(),
|
|
211
|
+
timestamp: Date.now(),
|
|
212
|
+
...options
|
|
213
|
+
},
|
|
214
|
+
message
|
|
215
|
+
} : {
|
|
216
|
+
name,
|
|
217
|
+
plugin: options.plugin,
|
|
218
|
+
...message,
|
|
219
|
+
meta: {
|
|
220
|
+
type,
|
|
221
|
+
name,
|
|
222
|
+
category: LogCategories.GENERAL,
|
|
223
|
+
logId: uuid(),
|
|
224
|
+
timestamp: Date.now(),
|
|
225
|
+
plugin: message.plugin,
|
|
226
|
+
...options,
|
|
227
|
+
...message.meta
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
if (isValidLogLevelConfig(type, logLevel, params.meta.category)) {
|
|
231
|
+
callback?.(params);
|
|
232
|
+
customCallback?.(params);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* Create a logging function with a specific name and options.
|
|
238
|
+
*
|
|
239
|
+
* @param logger - The original logger to wrap with the custom logger.
|
|
240
|
+
* @param secondaryLogger - The custom logger to use for logging messages, which can be used to override the default logging behavior of the original logger.
|
|
241
|
+
* @returns A new logger that combines the original logger's options with the custom logger's methods, allowing for customized logging behavior while still maintaining the original logger's configuration.
|
|
242
|
+
*/
|
|
243
|
+
const withLogger = (logger, secondaryLogger) => {
|
|
244
|
+
const options = {
|
|
245
|
+
...secondaryLogger.options,
|
|
246
|
+
...logger.options
|
|
247
|
+
};
|
|
248
|
+
return {
|
|
249
|
+
options,
|
|
250
|
+
error: validateLogger("error", options.name, options, (message) => {
|
|
251
|
+
logger.error?.(message);
|
|
252
|
+
secondaryLogger.error?.(message);
|
|
253
|
+
}),
|
|
254
|
+
warn: validateLogger("warn", options.name, options, (message) => {
|
|
255
|
+
logger.warn?.(message);
|
|
256
|
+
secondaryLogger.warn?.(message);
|
|
257
|
+
}),
|
|
258
|
+
info: validateLogger("info", options.name, options, (message) => {
|
|
259
|
+
logger.info?.(message);
|
|
260
|
+
secondaryLogger.info?.(message);
|
|
261
|
+
}),
|
|
262
|
+
debug: validateLogger("debug", options.name, options, (message) => {
|
|
263
|
+
logger.debug?.(message);
|
|
264
|
+
secondaryLogger.debug?.(message);
|
|
265
|
+
}),
|
|
266
|
+
trace: validateLogger("trace", options.name, options, (message) => {
|
|
267
|
+
logger.trace?.(message);
|
|
268
|
+
secondaryLogger.trace?.(message);
|
|
269
|
+
})
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* Create a logging function with a specific name and options.
|
|
274
|
+
*
|
|
275
|
+
* @param logger - The original logger to wrap with the custom logger.
|
|
276
|
+
* @param customLogger - The custom logger to use for logging messages, which can be used to override the default logging behavior of the original logger.
|
|
277
|
+
* @returns A new logger that combines the original logger's options with the custom logger's methods, allowing for customized logging behavior while still maintaining the original logger's configuration.
|
|
278
|
+
*/
|
|
279
|
+
const withCustomLogger = (logger, customLogger) => {
|
|
280
|
+
return {
|
|
281
|
+
options: logger.options,
|
|
282
|
+
error: validateCustomLogger("error", logger.options.name, logger.options, logger.error.bind(logger), customLogger.error?.bind(customLogger)),
|
|
283
|
+
warn: validateCustomLogger("warn", logger.options.name, logger.options, logger.warn.bind(logger), customLogger.warn?.bind(customLogger)),
|
|
284
|
+
info: validateCustomLogger("info", logger.options.name, logger.options, logger.info.bind(logger), customLogger.info?.bind(customLogger)),
|
|
285
|
+
debug: validateCustomLogger("debug", logger.options.name, logger.options, logger.debug.bind(logger), customLogger.debug?.bind(customLogger)),
|
|
286
|
+
trace: validateCustomLogger("trace", logger.options.name, logger.options, logger.trace.bind(logger), customLogger.trace?.bind(customLogger))
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
const consoleLogger = (type, message) => consoleLog(isSetString(message) ? {
|
|
290
|
+
type,
|
|
291
|
+
category: LogCategories.GENERAL,
|
|
292
|
+
logId: uuid(),
|
|
293
|
+
timestamp: Date.now()
|
|
294
|
+
} : {
|
|
295
|
+
type,
|
|
296
|
+
category: LogCategories.GENERAL,
|
|
297
|
+
logId: uuid(),
|
|
298
|
+
timestamp: Date.now(),
|
|
299
|
+
...message
|
|
300
|
+
}, isSetString(message) ? message : message.message);
|
|
301
|
+
/**
|
|
302
|
+
* Create a logging function with a specific name and options.
|
|
303
|
+
*
|
|
304
|
+
* @param name - The name of the logging function.
|
|
305
|
+
* @param options - The options to configure the logging function, including the source, command, environment, plugin, log level, custom logger, and colors. These options can be used to customize the appearance and behavior of the log messages generated by the logging function.
|
|
306
|
+
* @returns A logging function.
|
|
307
|
+
*/
|
|
308
|
+
const createLogger = (name, options, callback = consoleLogger) => {
|
|
309
|
+
return {
|
|
310
|
+
options: {
|
|
311
|
+
...options,
|
|
312
|
+
name
|
|
313
|
+
},
|
|
314
|
+
error: validateLogger("error", name, {
|
|
315
|
+
...options,
|
|
316
|
+
name
|
|
317
|
+
}, (message) => callback("error", message)),
|
|
318
|
+
warn: validateLogger("warn", name, {
|
|
319
|
+
...options,
|
|
320
|
+
name
|
|
321
|
+
}, (message) => callback("warn", message)),
|
|
322
|
+
info: validateLogger("info", name, {
|
|
323
|
+
...options,
|
|
324
|
+
name
|
|
325
|
+
}, (message) => callback("info", message)),
|
|
326
|
+
debug: validateLogger("debug", name, {
|
|
327
|
+
...options,
|
|
328
|
+
name
|
|
329
|
+
}, (message) => callback("debug", message)),
|
|
330
|
+
trace: validateLogger("trace", name, {
|
|
331
|
+
...options,
|
|
332
|
+
name
|
|
333
|
+
}, (message) => callback("trace", message))
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
* Extend a logging function with a specific name, adding a colored badge to the log output.
|
|
338
|
+
*
|
|
339
|
+
* @param logFn - The original logging function to extend.
|
|
340
|
+
* @param options - The overlay metadata to use for the badge in the log output.
|
|
341
|
+
* @returns A new logging function that includes the badge in its output.
|
|
342
|
+
*/
|
|
343
|
+
const extendLogFn = (logFn, options) => {
|
|
344
|
+
return (meta, ...args) => options.source || options.category ? logFn(isSetObject(meta) ? {
|
|
345
|
+
...options,
|
|
346
|
+
...meta
|
|
347
|
+
} : {
|
|
348
|
+
...options,
|
|
349
|
+
type: meta
|
|
350
|
+
}, `${colorBackground(String(options.source || options.category))} ${args.filter(Boolean).map((arg) => String(arg).trim()).join(" ")} `) : logFn(meta, ...args);
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Extend a logger with a specific name and options, adding a colored badge to the log output for each log message generated by the logger.
|
|
354
|
+
*
|
|
355
|
+
* @param logger - The original logger to extend.
|
|
356
|
+
* @param options - The options to configure the logging function, including the source, command, environment, plugin, log level, custom logger, and colors. These options can be used to customize the appearance and behavior of the log messages generated by the extended logger.
|
|
357
|
+
* @returns A new logger that includes the badge in its output for each log message.
|
|
358
|
+
*/
|
|
359
|
+
const extendLogger = (logger, options) => {
|
|
360
|
+
const opts = {
|
|
361
|
+
...logger.options,
|
|
362
|
+
...options
|
|
363
|
+
};
|
|
364
|
+
return {
|
|
365
|
+
options: opts,
|
|
366
|
+
error: validateLogger("error", opts.name, opts, logger.error.bind(logger)),
|
|
367
|
+
warn: validateLogger("warn", opts.name, opts, logger.warn.bind(logger)),
|
|
368
|
+
info: validateLogger("info", opts.name, opts, logger.info.bind(logger)),
|
|
369
|
+
debug: validateLogger("debug", opts.name, opts, logger.debug.bind(logger)),
|
|
370
|
+
trace: validateLogger("trace", opts.name, opts, logger.trace.bind(logger))
|
|
371
|
+
};
|
|
372
|
+
};
|
|
14
373
|
|
|
15
374
|
//#endregion
|
|
16
|
-
export { isVerbose };
|
|
375
|
+
export { colorBackground, colorText, consoleLog, consoleLogger, createLogFn, createLogger, extendLogFn, extendLogger, getTextColor, isValidLogLevel, isValidLogLevelConfig, isVerbose, resolveLogLevel, withCustomLogger, withLogger };
|
|
17
376
|
//# sourceMappingURL=logging.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.mjs","names":[],"sources":["../../src/plugin-utils/logging.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { UnresolvedContext } from \"../types\";\n\n/**\n * Determines if the provided log level is considered verbose (debug or trace).\n *\n * @param logLevel - The log level to check, which can be a string or an UnresolvedContext containing the log level in its config.\n * @returns True if the log level is \"debug\" or \"trace\", false otherwise.\n */\nexport function isVerbose(logLevel: string): boolean;\n\n/**\n * Determines if the provided context is considered verbose (debug or trace).\n *\n * @param context - The context to check, which contains the log level in its config.\n * @returns True if the log level is \"debug\" or \"trace\", false otherwise.\n */\nexport function isVerbose(context: UnresolvedContext): boolean;\n\n/**\n * Determines if the provided log level is considered verbose (debug or trace).\n *\n * @param logLevelOrContext - The log level to check, which can be a string or an UnresolvedContext containing the log level in its config.\n * @returns True if the log level is \"debug\" or \"trace\", false otherwise.\n */\nexport function isVerbose(\n logLevelOrContext: string | UnresolvedContext\n): boolean {\n const level = isString(logLevelOrContext)\n ? logLevelOrContext\n : logLevelOrContext.config.logLevel;\n\n return level === \"debug\" || level === \"trace\";\n}\n"],"mappings":";;;;;;;;;AA2CA,SAAgB,UACd,mBACS;CACT,MAAM,QAAQ,SAAS,kBAAkB,GACrC,oBACA,kBAAkB,OAAO;AAE7B,QAAO,UAAU,WAAW,UAAU"}
|
|
1
|
+
{"version":3,"file":"logging.mjs","names":["defu"],"sources":["../../src/plugin-utils/logging.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getLogFn, getLogLevel } from \"@storm-software/config-tools/logger\";\nimport { getColor } from \"@storm-software/config-tools/utilities/colors\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { RequiredKeys } from \"@stryke/types/base\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport chalk from \"chalk\";\nimport { defu } from \"defu\";\nimport { DEFAULT_ENVIRONMENT } from \"../constants/environments\";\nimport {\n DEFAULT_DEVELOPMENT_LOG_LEVEL,\n DEFAULT_PRODUCTION_LOG_LEVEL,\n DEFAULT_TEST_LOG_LEVEL\n} from \"../constants/log-level\";\nimport { Mode } from \"../types/config\";\nimport { UnresolvedContext } from \"../types/context\";\nimport type {\n CustomLogger,\n CustomLoggerMessage,\n LogCategory,\n LogFn,\n LogFnMeta,\n LogFnOptions,\n LoggerMessage,\n LoggerOptions,\n LogLevel,\n LogLevelResolvedConfig,\n LogLevelUserConfig,\n LogMeta\n} from \"../types/logging\";\nimport { LOG_LEVELS, LogCategories, Logger, LogLevels } from \"../types/logging\";\n\n/**\n * Determines if the provided log level is considered verbose (debug or trace).\n *\n * @param logLevel - The log level to check, which can be a string or an UnresolvedContext containing the log level in its config.\n * @returns True if the log level is \"debug\" or \"trace\", false otherwise.\n */\nexport function isVerbose(logLevel: string): boolean;\n\n/**\n * Determines if the provided context is considered verbose (debug or trace).\n *\n * @param context - The context to check, which contains the log level in its config.\n * @returns True if the log level is \"debug\" or \"trace\", false otherwise.\n */\nexport function isVerbose(context: UnresolvedContext): boolean;\n\n/**\n * Determines if the provided log level is considered verbose (debug or trace).\n *\n * @param logLevelOrContext - The log level to check, which can be a string or an UnresolvedContext containing the log level in its config.\n * @returns True if the log level is \"debug\" or \"trace\", false otherwise.\n */\nexport function isVerbose(\n logLevelOrContext: string | UnresolvedContext\n): boolean {\n const level = isString(logLevelOrContext)\n ? logLevelOrContext\n : logLevelOrContext.config.logLevel;\n\n return level === \"debug\" || level === \"trace\";\n}\n\n/**\n * Resolves the log level configuration based on the provided log level and mode, returning a complete LogLevelResolvedConfig object that specifies the log level for each log category.\n *\n * @param logLevel - The user-provided log level configuration, which can be a string or an object specifying log levels for each category.\n * @param mode - The current mode of the application (e.g., \"development\", \"test\", \"production\"), which determines the default log levels.\n * @returns A LogLevelResolvedConfig object specifying the log level for each log category.\n */\nexport function resolveLogLevel(\n logLevel?: LogLevelUserConfig,\n mode?: Mode\n): LogLevelResolvedConfig {\n if (logLevel === \"trace\") {\n return {\n general: \"trace\",\n fs: \"trace\",\n performance: \"trace\",\n network: \"trace\",\n plugins: \"trace\",\n hooks: \"trace\",\n env: \"trace\",\n ipc: \"trace\",\n config: \"trace\",\n babel: \"trace\"\n };\n } else if (logLevel === \"silent\") {\n return {\n general: \"silent\",\n fs: \"silent\",\n performance: \"silent\",\n network: \"silent\",\n plugins: \"silent\",\n hooks: \"silent\",\n env: \"silent\",\n ipc: \"silent\",\n config: \"silent\",\n babel: \"silent\"\n };\n }\n\n let defaultLogLevel: LogLevelResolvedConfig;\n if (mode === \"development\") {\n defaultLogLevel = DEFAULT_DEVELOPMENT_LOG_LEVEL;\n } else if (mode === \"test\") {\n defaultLogLevel = DEFAULT_TEST_LOG_LEVEL;\n } else {\n defaultLogLevel = DEFAULT_PRODUCTION_LOG_LEVEL;\n }\n\n if (isSetString(logLevel)) {\n return {\n general: logLevel,\n fs: defaultLogLevel.fs,\n performance: logLevel,\n network: defaultLogLevel.network,\n plugins: logLevel,\n hooks: logLevel,\n env: defaultLogLevel.env,\n ipc: defaultLogLevel.ipc,\n config: defaultLogLevel.config,\n babel: logLevel\n };\n } else if (isSetObject(logLevel)) {\n return defu(logLevel, defaultLogLevel) as LogLevelResolvedConfig;\n }\n\n return defaultLogLevel;\n}\n\nconst BADGE_COLORS = [\n \"#00A0DD\",\n \"#6FCE4E\",\n \"#FBBF24\",\n \"#F43F5E\",\n \"#3B82F6\",\n \"#A855F7\",\n \"#469592\",\n \"#288EDF\",\n \"#D8B4FE\",\n \"#10B981\",\n \"#EF4444\",\n \"#F0EC56\",\n \"#F472B6\",\n \"#22D3EE\",\n \"#EAB308\",\n \"#84CC16\",\n \"#F87171\",\n \"#0EA5E9\",\n \"#D946EF\",\n \"#FACC15\",\n \"#34D399\",\n \"#8B5CF6\"\n] as const;\n\nconst BRAND_COLOR = getColor(\"brand\");\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const getTextColor = (text: string): string => {\n return (\n BADGE_COLORS[\n text\n .split(\"\")\n .map(char => char.charCodeAt(0))\n .reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length\n ] || BADGE_COLORS[0]\n );\n};\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const colorText = (text: string): string => {\n const title = titleCase(text);\n\n return chalk.hex(getTextColor(title))(title);\n};\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const colorBackground = (text: string): string => {\n const title = titleCase(text);\n\n return chalk.inverse.hex(getTextColor(title))(` ${title} `);\n};\n\nexport const consoleLog = (meta: LogMeta, ...args: string[]) =>\n getLogFn(getLogLevel(meta.type), {\n logLevel: \"trace\"\n })(\n `${meta.name ? chalk.bold.hex(BRAND_COLOR)(kebabCase(meta.name)) : \"\"}${\n meta.command ? chalk.hex(BRAND_COLOR)(` (${meta.command})`) : \"\"\n }${meta.name ? chalk.grey(\" > \") : \"\"}${\n (meta.source || meta.plugin) &&\n (!meta.name ||\n kebabCase(meta.source || meta.plugin) !== kebabCase(meta.name))\n ? `${chalk.bold.hex(BRAND_COLOR)(\n kebabCase(meta.source || meta.plugin)\n )}${chalk.grey(\" > \")}`\n : \"\"\n }${\n meta.environment && kebabCase(meta.environment) !== DEFAULT_ENVIRONMENT\n ? `${chalk.bold.hex(BRAND_COLOR)(\n kebabCase(meta.environment)\n )}${chalk.grey(\" > \")}`\n : \"\"\n }${\n meta.category && meta.category !== LogCategories.GENERAL\n ? ` ${colorBackground(kebabCase(meta.category))} `\n : \"\"\n }${args.join(\" \")} `.trim()\n );\n\nexport function isValidLogLevel(logLevel: LogLevel, type: LogLevel): boolean {\n if (logLevel === LogLevels.SILENT) {\n return false;\n }\n\n return LOG_LEVELS.indexOf(logLevel) >= LOG_LEVELS.indexOf(type);\n}\n\nexport function isValidLogLevelConfig(\n type: LogLevel,\n logLevel: LogLevelResolvedConfig,\n category: LogCategory = LogCategories.GENERAL\n): boolean {\n return isValidLogLevel(logLevel[category], type);\n}\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param name - The name of the logging function.\n * @param options - The options to configure the logging function, including the source, command, environment, plugin, log level, custom logger, and colors. These options can be used to customize the appearance and behavior of the log messages generated by the logging function.\n * @returns A logging function.\n */\nexport const createLogFn = (name: string, options: LogFnOptions): LogFn => {\n const logLevel = resolveLogLevel(options.logLevel, options.mode);\n\n return (meta: LogFnMeta | LogLevel, ...args: string[]) => {\n const logMeta = isSetObject(meta)\n ? {\n logId: uuid(),\n timestamp: Date.now(),\n category: LogCategories.GENERAL,\n ...options,\n ...meta,\n name\n }\n : {\n logId: uuid(),\n timestamp: Date.now(),\n category: LogCategories.GENERAL,\n ...options,\n type: meta,\n name\n };\n\n if (\n isValidLogLevelConfig(\n logMeta.type,\n logLevel,\n logMeta.category ? logMeta.category : LogCategories.GENERAL\n )\n ) {\n consoleLog(logMeta, ...args);\n }\n };\n};\n\nconst validateLogger = (\n type: LogLevel,\n name: string,\n options: LoggerOptions,\n callback: (message: string | LoggerMessage) => void\n) => {\n const logLevel = resolveLogLevel(options.logLevel, options.mode);\n\n return (message: string | LoggerMessage) => {\n const params = isSetString(message)\n ? {\n name,\n plugin: options.plugin,\n meta: {\n type,\n name,\n category: LogCategories.GENERAL,\n logId: uuid(),\n timestamp: Date.now(),\n ...options\n },\n message\n }\n : {\n name,\n plugin: options.plugin,\n ...message,\n meta: {\n type,\n name,\n category: LogCategories.GENERAL,\n logId: uuid(),\n timestamp: Date.now(),\n plugin: message.plugin,\n ...options,\n ...message.meta\n }\n };\n\n if (isValidLogLevelConfig(type, logLevel, params.meta.category)) {\n callback(params);\n }\n };\n};\n\nconst validateCustomLogger = (\n type: LogLevel,\n name: string,\n options: LoggerOptions,\n callback?: (message: string | LoggerMessage) => void,\n customCallback?: (message: CustomLoggerMessage) => void\n) => {\n const logLevel = resolveLogLevel(options.logLevel, options.mode);\n\n return (message: string | LoggerMessage) => {\n const params = isSetString(message)\n ? {\n name,\n plugin: options.plugin,\n meta: {\n type,\n name,\n category: LogCategories.GENERAL,\n logId: uuid(),\n timestamp: Date.now(),\n ...options\n },\n message\n }\n : {\n name,\n plugin: options.plugin,\n ...message,\n meta: {\n type,\n name,\n category: LogCategories.GENERAL,\n logId: uuid(),\n timestamp: Date.now(),\n plugin: message.plugin,\n ...options,\n ...message.meta\n }\n };\n\n if (isValidLogLevelConfig(type, logLevel, params.meta.category)) {\n callback?.(params);\n customCallback?.(params);\n }\n };\n};\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param logger - The original logger to wrap with the custom logger.\n * @param secondaryLogger - The custom logger to use for logging messages, which can be used to override the default logging behavior of the original logger.\n * @returns A new logger that combines the original logger's options with the custom logger's methods, allowing for customized logging behavior while still maintaining the original logger's configuration.\n */\nexport const withLogger = (logger: Logger, secondaryLogger: Logger): Logger => {\n const options = { ...secondaryLogger.options, ...logger.options };\n\n return {\n options,\n error: validateLogger(\n \"error\",\n options.name!,\n options,\n (message: string | LoggerMessage) => {\n logger.error?.(message);\n secondaryLogger.error?.(message);\n }\n ),\n warn: validateLogger(\n \"warn\",\n options.name!,\n options,\n (message: string | LoggerMessage) => {\n logger.warn?.(message);\n secondaryLogger.warn?.(message);\n }\n ),\n info: validateLogger(\n \"info\",\n options.name!,\n options,\n (message: string | LoggerMessage) => {\n logger.info?.(message);\n secondaryLogger.info?.(message);\n }\n ),\n debug: validateLogger(\n \"debug\",\n options.name!,\n options,\n (message: string | LoggerMessage) => {\n logger.debug?.(message);\n secondaryLogger.debug?.(message);\n }\n ),\n trace: validateLogger(\n \"trace\",\n options.name!,\n options,\n (message: string | LoggerMessage) => {\n logger.trace?.(message);\n secondaryLogger.trace?.(message);\n }\n )\n };\n};\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param logger - The original logger to wrap with the custom logger.\n * @param customLogger - The custom logger to use for logging messages, which can be used to override the default logging behavior of the original logger.\n * @returns A new logger that combines the original logger's options with the custom logger's methods, allowing for customized logging behavior while still maintaining the original logger's configuration.\n */\nexport const withCustomLogger = (\n logger: Logger,\n customLogger: CustomLogger\n): Logger => {\n return {\n options: logger.options,\n error: validateCustomLogger(\n \"error\",\n logger.options.name!,\n logger.options,\n logger.error.bind(logger),\n customLogger.error?.bind(customLogger)\n ),\n warn: validateCustomLogger(\n \"warn\",\n logger.options.name!,\n logger.options,\n logger.warn.bind(logger),\n customLogger.warn?.bind(customLogger)\n ),\n info: validateCustomLogger(\n \"info\",\n logger.options.name!,\n logger.options,\n logger.info.bind(logger),\n customLogger.info?.bind(customLogger)\n ),\n debug: validateCustomLogger(\n \"debug\",\n logger.options.name!,\n logger.options,\n logger.debug.bind(logger),\n customLogger.debug?.bind(customLogger)\n ),\n trace: validateCustomLogger(\n \"trace\",\n logger.options.name!,\n logger.options,\n logger.trace.bind(logger),\n customLogger.trace?.bind(customLogger)\n )\n };\n};\n\nexport const consoleLogger = (\n type: LogLevel,\n message: string | LoggerMessage\n) =>\n consoleLog(\n isSetString(message)\n ? {\n type,\n category: LogCategories.GENERAL,\n logId: uuid(),\n timestamp: Date.now()\n }\n : {\n type,\n category: LogCategories.GENERAL,\n logId: uuid(),\n timestamp: Date.now(),\n ...message\n },\n isSetString(message) ? message : message.message\n );\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param name - The name of the logging function.\n * @param options - The options to configure the logging function, including the source, command, environment, plugin, log level, custom logger, and colors. These options can be used to customize the appearance and behavior of the log messages generated by the logging function.\n * @returns A logging function.\n */\nexport const createLogger = (\n name: string,\n options: LoggerOptions,\n callback: (\n type: LogLevel,\n message: string | LoggerMessage\n ) => void = consoleLogger\n): Logger => {\n return {\n options: { ...options, name },\n error: validateLogger(\"error\", name, { ...options, name }, message =>\n callback(\"error\", message)\n ),\n warn: validateLogger(\"warn\", name, { ...options, name }, message =>\n callback(\"warn\", message)\n ),\n info: validateLogger(\"info\", name, { ...options, name }, message =>\n callback(\"info\", message)\n ),\n debug: validateLogger(\"debug\", name, { ...options, name }, message =>\n callback(\"debug\", message)\n ),\n trace: validateLogger(\"trace\", name, { ...options, name }, message =>\n callback(\"trace\", message)\n )\n };\n};\n\n/**\n * Extend a logging function with a specific name, adding a colored badge to the log output.\n *\n * @param logFn - The original logging function to extend.\n * @param options - The overlay metadata to use for the badge in the log output.\n * @returns A new logging function that includes the badge in its output.\n */\nexport const extendLogFn = (logFn: LogFn, options: LogFnOptions): LogFn => {\n return (meta, ...args) =>\n options.source || options.category\n ? logFn(\n isSetObject(meta)\n ? { ...options, ...meta }\n : { ...options, type: meta },\n `${colorBackground(String(options.source || options.category))} ${args\n .filter(Boolean)\n .map(arg => String(arg).trim())\n .join(\" \")} `\n )\n : logFn(meta, ...args);\n};\n\n/**\n * Extend a logger with a specific name and options, adding a colored badge to the log output for each log message generated by the logger.\n *\n * @param logger - The original logger to extend.\n * @param options - The options to configure the logging function, including the source, command, environment, plugin, log level, custom logger, and colors. These options can be used to customize the appearance and behavior of the log messages generated by the extended logger.\n * @returns A new logger that includes the badge in its output for each log message.\n */\nexport const extendLogger = (\n logger: Logger,\n options: LoggerOptions\n): Logger => {\n const opts = { ...logger.options, ...options } as RequiredKeys<\n LoggerOptions,\n \"name\"\n >;\n\n return {\n options: opts,\n error: validateLogger(\"error\", opts.name, opts, logger.error.bind(logger)),\n warn: validateLogger(\"warn\", opts.name, opts, logger.warn.bind(logger)),\n info: validateLogger(\"info\", opts.name, opts, logger.info.bind(logger)),\n debug: validateLogger(\"debug\", opts.name, opts, logger.debug.bind(logger)),\n trace: validateLogger(\"trace\", opts.name, opts, logger.trace.bind(logger))\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E,SAAQ,MAAM,GAAG,SACf,QAAQ,UAAU,QAAQ,WACtB,MACE,YAAY,KAAK,GACb;EAAE,GAAG;EAAS,GAAG;EAAM,GACvB;EAAE,GAAG;EAAS,MAAM;EAAM,EAC9B,GAAG,gBAAgB,OAAO,QAAQ,UAAU,QAAQ,SAAS,CAAC,CAAC,GAAG,KAC/D,OAAO,QAAQ,CACf,KAAI,QAAO,OAAO,IAAI,CAAC,MAAM,CAAC,CAC9B,KAAK,IAAI,CAAC,GACd,GACD,MAAM,MAAM,GAAG,KAAK;;;;;;;;;AAU5B,MAAa,gBACX,QACA,YACW;CACX,MAAM,OAAO;EAAE,GAAG,OAAO;EAAS,GAAG;EAAS;AAK9C,QAAO;EACL,SAAS;EACT,OAAO,eAAe,SAAS,KAAK,MAAM,MAAM,OAAO,MAAM,KAAK,OAAO,CAAC;EAC1E,MAAM,eAAe,QAAQ,KAAK,MAAM,MAAM,OAAO,KAAK,KAAK,OAAO,CAAC;EACvE,MAAM,eAAe,QAAQ,KAAK,MAAM,MAAM,OAAO,KAAK,KAAK,OAAO,CAAC;EACvE,OAAO,eAAe,SAAS,KAAK,MAAM,MAAM,OAAO,MAAM,KAAK,OAAO,CAAC;EAC1E,OAAO,eAAe,SAAS,KAAK,MAAM,MAAM,OAAO,MAAM,KAAK,OAAO,CAAC;EAC3E"}
|
package/dist/types/config.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StoragePort, StoragePreset } from "./fs.cjs";
|
|
2
2
|
import { Plugin } from "./plugin.cjs";
|
|
3
|
+
import { CustomLogger, LogLevelResolvedConfig, LogLevelUserConfig } from "./logging.cjs";
|
|
3
4
|
import { TSConfig } from "./tsconfig.cjs";
|
|
4
5
|
import { PluginContext } from "./context.cjs";
|
|
5
6
|
import { Format } from "@storm-software/build-tools/types";
|
|
6
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
7
7
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
8
8
|
import { DeepPartial, MaybePromise, NonUndefined, PartialKeys } from "@stryke/types/base";
|
|
9
9
|
import { TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
@@ -13,13 +13,6 @@ import { CompatibilityDateSpec, CompatibilityDates } from "compatx";
|
|
|
13
13
|
import { PreviewOptions, ResolvedPreviewOptions } from "vite";
|
|
14
14
|
|
|
15
15
|
//#region src/types/config.d.ts
|
|
16
|
-
type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
|
|
17
|
-
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
18
|
-
type LogLevelConfig = Record<LogLevel, boolean>;
|
|
19
|
-
interface Logger {
|
|
20
|
-
log: LogFn;
|
|
21
|
-
level: LogLevelLabel;
|
|
22
|
-
}
|
|
23
16
|
/**
|
|
24
17
|
* The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
|
|
25
18
|
*/
|
|
@@ -46,6 +39,7 @@ type PluginConfig<TContext extends PluginContext = PluginContext> = string | Plu
|
|
|
46
39
|
type PartialPlugin<TContext extends PluginContext = PluginContext> = DeepPartial<Plugin<TContext>>;
|
|
47
40
|
type PartialPluginFactory<in out TContext extends PluginContext = PluginContext, TOptions = any> = (options: TOptions) => MaybePromise<PartialPlugin<TContext> | PartialPlugin<TContext>[]>;
|
|
48
41
|
type ProjectType = "application" | "library";
|
|
42
|
+
type Mode = "development" | "test" | "production";
|
|
49
43
|
/**
|
|
50
44
|
* The configuration options for resolving modules in a Powerlines project.
|
|
51
45
|
*/
|
|
@@ -240,6 +234,10 @@ interface OutputConfig {
|
|
|
240
234
|
storage?: StoragePort | StoragePreset;
|
|
241
235
|
}
|
|
242
236
|
interface EngineOptions {
|
|
237
|
+
/**
|
|
238
|
+
* The name of the project
|
|
239
|
+
*/
|
|
240
|
+
name?: string;
|
|
243
241
|
/**
|
|
244
242
|
* The root directory of the project
|
|
245
243
|
*/
|
|
@@ -256,7 +254,11 @@ interface EngineOptions {
|
|
|
256
254
|
*
|
|
257
255
|
* @defaultValue "production"
|
|
258
256
|
*/
|
|
259
|
-
mode?:
|
|
257
|
+
mode?: Mode;
|
|
258
|
+
/**
|
|
259
|
+
* The log level to use for logging messages during the build process. This can be a string indicating the log level or a more detailed configuration object that allows for specifying different log levels for different categories of logs.
|
|
260
|
+
*/
|
|
261
|
+
logLevel?: LogLevelUserConfig;
|
|
260
262
|
/**
|
|
261
263
|
* A string identifier that allows a child framework or tool to identify itself when using Powerlines.
|
|
262
264
|
*
|
|
@@ -278,19 +280,18 @@ interface EngineOptions {
|
|
|
278
280
|
*/
|
|
279
281
|
configFile?: string;
|
|
280
282
|
}
|
|
281
|
-
type ResolvedEngineOptions = PartialKeys<Required<EngineOptions>, "organization" | "configFile">;
|
|
283
|
+
type ResolvedEngineOptions = PartialKeys<Required<EngineOptions>, "organization" | "configFile" | "name">;
|
|
282
284
|
interface ExecutionOptions extends EngineOptions {
|
|
285
|
+
/**
|
|
286
|
+
* A unique identifier for the current execution instance, which can be used for logging and other purposes to distinguish between different executions in the same process.
|
|
287
|
+
*/
|
|
288
|
+
executionId: string;
|
|
283
289
|
/**
|
|
284
290
|
* The index of the current execution instance among all configured instances in the Powerlines process
|
|
285
291
|
*/
|
|
286
292
|
executionIndex: number;
|
|
287
293
|
}
|
|
288
|
-
type ResolvedExecutionOptions = Pick<ExecutionOptions, "executionIndex"> & ResolvedEngineOptions
|
|
289
|
-
/**
|
|
290
|
-
* A unique identifier for the current execution instance, which can be used for logging and other purposes to distinguish between different executions in the same process.
|
|
291
|
-
*/
|
|
292
|
-
executionId: string;
|
|
293
|
-
};
|
|
294
|
+
type ResolvedExecutionOptions = Pick<ExecutionOptions, "executionIndex" | "executionId"> & ResolvedEngineOptions;
|
|
294
295
|
interface Config {
|
|
295
296
|
/**
|
|
296
297
|
* Defines entries and location(s) of entry modules for the bundle. Relative paths are resolved based on the `root` option.
|
|
@@ -423,15 +424,21 @@ interface UserConfig extends Config, ExecutionOptions {
|
|
|
423
424
|
*/
|
|
424
425
|
compatibilityDate?: CompatibilityDateSpec;
|
|
425
426
|
/**
|
|
426
|
-
* The log level
|
|
427
|
+
* The log level label indicating the severity of the log message, or a more detailed log level configuration object that allows for specifying different log levels for different categories of logs.
|
|
428
|
+
*
|
|
429
|
+
* @remarks
|
|
430
|
+
* The log level determines the minimum severity of messages that will be logged. For example, if the log level is set to `LogLevel.INFO`, then messages with a severity of `INFO`, `WARN`, and `ERROR` will be logged, while messages with a severity of `DEBUG` and `TRACE` will be ignored. Setting the log level to `LogLevel.SILENT` will disable all logging. Alternatively, you can provide a more detailed configuration object that allows you to specify different log levels for different categories of logs, providing granular control over the logging behavior for different aspects of the system.
|
|
427
431
|
*
|
|
428
432
|
* @defaultValue "info"
|
|
429
433
|
*/
|
|
430
|
-
logLevel?:
|
|
434
|
+
logLevel?: LogLevelUserConfig;
|
|
431
435
|
/**
|
|
432
|
-
* A custom logger
|
|
436
|
+
* A custom logger instance that implements the {@link CustomLogger} interface, which can be used for logging messages during the build process instead of the default Powerlines logger.
|
|
437
|
+
*
|
|
438
|
+
* @remarks
|
|
439
|
+
* Providing a custom logger allows you to integrate Powerlines logging with your own logging system or to customize the logging behavior, such as formatting log messages differently or sending logs to an external service. If a custom logger is not provided, Powerlines will use its default logger implementation.
|
|
433
440
|
*/
|
|
434
|
-
customLogger?:
|
|
441
|
+
customLogger?: CustomLogger;
|
|
435
442
|
/**
|
|
436
443
|
* The type of project being built
|
|
437
444
|
*
|
|
@@ -665,16 +672,13 @@ type ResolvedConfig$1<TUserConfig extends UserConfig = UserConfig> = Omit<TUserC
|
|
|
665
672
|
*/
|
|
666
673
|
command: NonUndefined<InlineConfig<TUserConfig>["command"]>;
|
|
667
674
|
/**
|
|
668
|
-
* The log level
|
|
675
|
+
* The log level label indicating the severity of the log message, or a more detailed log level configuration object that allows for specifying different log levels for different categories of logs.
|
|
669
676
|
*
|
|
670
|
-
* @
|
|
677
|
+
* @remarks
|
|
678
|
+
* The log level determines the minimum severity of messages that will be logged. For example, if the log level is set to `LogLevel.INFO`, then messages with a severity of `INFO`, `WARN`, and `ERROR` will be logged, while messages with a severity of `DEBUG` and `TRACE` will be ignored. Setting the log level to `LogLevel.SILENT` will disable all logging. Alternatively, you can provide a more detailed configuration object that allows you to specify different log levels for different categories of logs, providing granular control over the logging behavior for different aspects of the system.
|
|
671
679
|
*/
|
|
672
|
-
logLevel:
|
|
680
|
+
logLevel: LogLevelResolvedConfig;
|
|
673
681
|
};
|
|
674
|
-
declare type __ΩLogLevel = any[];
|
|
675
|
-
declare type __ΩLogFn = any[];
|
|
676
|
-
declare type __ΩLogLevelConfig = any[];
|
|
677
|
-
declare type __ΩLogger = any[];
|
|
678
682
|
declare type __ΩWorkspaceConfig = any[];
|
|
679
683
|
declare type __ΩPluginFactory = any[];
|
|
680
684
|
declare type __ΩPluginConfigTuple = any[];
|
|
@@ -683,6 +687,7 @@ declare type __ΩPluginConfig = any[];
|
|
|
683
687
|
declare type __ΩPartialPlugin = any[];
|
|
684
688
|
declare type __ΩPartialPluginFactory = any[];
|
|
685
689
|
declare type __ΩProjectType = any[];
|
|
690
|
+
declare type __ΩMode = any[];
|
|
686
691
|
declare type __ΩResolveConfig = any[];
|
|
687
692
|
declare type __ΩCopyConfig = any[];
|
|
688
693
|
declare type __ΩOutputConfig = any[];
|
|
@@ -716,5 +721,5 @@ declare type __ΩCopyResolvedConfig = any[];
|
|
|
716
721
|
declare type __ΩOutputResolvedConfig = any[];
|
|
717
722
|
declare type __ΩResolvedConfig = any[];
|
|
718
723
|
//#endregion
|
|
719
|
-
export { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EngineOptions, EnvironmentConfig, EnvironmentResolvedConfig, ExecutionOptions, InlineConfig, LintInlineConfig,
|
|
724
|
+
export { AnyOutputUserConfig, AnyUserConfig, BuildInlineConfig, CleanInlineConfig, Config, CopyConfig, CopyResolvedConfig, DeployInlineConfig, DocsInlineConfig, EngineOptions, EnvironmentConfig, EnvironmentResolvedConfig, ExecutionOptions, InlineConfig, LintInlineConfig, Mode, NewInlineConfig, OutputConfig, OutputResolvedConfig, ParsedUserConfig, PartialPlugin, PartialPluginFactory, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig$1 as ResolvedConfig, ResolvedEngineOptions, ResolvedEntryTypeDefinition, ResolvedExecutionOptions, TestInlineConfig, TypesInlineConfig, UserConfig, UserConfigFn, WorkspaceConfig, __ΩAnyOutputUserConfig, __ΩAnyUserConfig, __ΩBuildInlineConfig, __ΩCleanInlineConfig, __ΩConfig, __ΩCopyConfig, __ΩCopyResolvedConfig, __ΩDeployInlineConfig, __ΩDocsInlineConfig, __ΩEngineOptions, __ΩEnvironmentConfig, __ΩEnvironmentResolvedConfig, __ΩExecutionOptions, __ΩInlineConfig, __ΩLintInlineConfig, __ΩMode, __ΩNewInlineConfig, __ΩOutputConfig, __ΩOutputResolvedConfig, __ΩParsedUserConfig, __ΩPartialPlugin, __ΩPartialPluginFactory, __ΩPluginConfig, __ΩPluginConfigObject, __ΩPluginConfigTuple, __ΩPluginFactory, __ΩPowerlinesCommand, __ΩPrepareInlineConfig, __ΩProjectType, __ΩResolveConfig, __ΩResolveResolvedConfig, __ΩResolvedAssetGlob, __ΩResolvedConfig, __ΩResolvedEngineOptions, __ΩResolvedEntryTypeDefinition, __ΩResolvedExecutionOptions, __ΩTestInlineConfig, __ΩTypesInlineConfig, __ΩUserConfig, __ΩUserConfigFn, __ΩWorkspaceConfig };
|
|
720
725
|
//# sourceMappingURL=config.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/types/config.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/types/config.ts"],"mappings":";;;;;;;;;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