bun_plugins 1.2.6 → 1.2.7
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/LICENSE +9 -0
- package/README.md +127 -3
- package/dist/examples/action-registry-declarative.d.ts +14 -0
- package/dist/examples/action-registry-declarative.d.ts.map +1 -0
- package/dist/examples/action-registry-declarative.js +130 -0
- package/dist/examples/action-registry-declarative.js.map +1 -0
- package/dist/examples/action-registry-example.d.ts +31 -0
- package/dist/examples/action-registry-example.d.ts.map +1 -0
- package/dist/examples/action-registry-example.js +84 -0
- package/dist/examples/action-registry-example.js.map +1 -0
- package/dist/examples/index-declarative.d.ts +32 -0
- package/dist/examples/index-declarative.d.ts.map +1 -0
- package/dist/examples/index-declarative.js +206 -0
- package/dist/examples/index-declarative.js.map +1 -0
- package/dist/examples/logger-declarative.d.ts +109 -0
- package/dist/examples/logger-declarative.d.ts.map +1 -0
- package/dist/examples/logger-declarative.js +330 -0
- package/dist/examples/logger-declarative.js.map +1 -0
- package/dist/examples/logger-simple.d.ts +8 -0
- package/dist/examples/logger-simple.d.ts.map +1 -0
- package/dist/examples/logger-simple.js +165 -0
- package/dist/examples/logger-simple.js.map +1 -0
- package/dist/examples/server-declarative.d.ts +46 -0
- package/dist/examples/server-declarative.d.ts.map +1 -0
- package/dist/examples/server-declarative.js +205 -0
- package/dist/examples/server-declarative.js.map +1 -0
- package/dist/examples/shared/action-registry.d.ts +45 -0
- package/dist/examples/shared/action-registry.d.ts.map +1 -0
- package/dist/examples/shared/action-registry.js +65 -0
- package/dist/examples/shared/action-registry.js.map +1 -0
- package/dist/examples/shared/plugin-builder.d.ts +41 -0
- package/dist/examples/shared/plugin-builder.d.ts.map +1 -0
- package/dist/examples/shared/plugin-builder.js +85 -0
- package/dist/examples/shared/plugin-builder.js.map +1 -0
- package/dist/examples/storage-declarative.d.ts +13 -0
- package/dist/examples/storage-declarative.d.ts.map +1 -0
- package/dist/examples/storage-declarative.js +203 -0
- package/dist/examples/storage-declarative.js.map +1 -0
- package/dist/plugins/ActionRegistryPlugin.d.ts +14 -0
- package/dist/plugins/ActionRegistryPlugin.d.ts.map +1 -0
- package/dist/plugins/ActionRegistryPlugin.js +52 -0
- package/dist/plugins/ActionRegistryPlugin.js.map +1 -0
- package/dist/plugins/DynamicJSActionsPlugin.d.ts +21 -0
- package/dist/plugins/DynamicJSActionsPlugin.d.ts.map +1 -0
- package/dist/plugins/DynamicJSActionsPlugin.js +57 -0
- package/dist/plugins/DynamicJSActionsPlugin.js.map +1 -0
- package/dist/plugins/DynamicMathActionsPlugin.d.ts +22 -0
- package/dist/plugins/DynamicMathActionsPlugin.d.ts.map +1 -0
- package/dist/plugins/DynamicMathActionsPlugin.js +64 -0
- package/dist/plugins/DynamicMathActionsPlugin.js.map +1 -0
- package/dist/plugins/DynamicTextActionsPlugin.d.ts +22 -0
- package/dist/plugins/DynamicTextActionsPlugin.d.ts.map +1 -0
- package/dist/plugins/DynamicTextActionsPlugin.js +58 -0
- package/dist/plugins/DynamicTextActionsPlugin.js.map +1 -0
- package/dist/plugins/DynamicUtilityActionsPlugin.d.ts +22 -0
- package/dist/plugins/DynamicUtilityActionsPlugin.d.ts.map +1 -0
- package/dist/plugins/DynamicUtilityActionsPlugin.js +75 -0
- package/dist/plugins/DynamicUtilityActionsPlugin.js.map +1 -0
- package/dist/plugins/ExamplePlugin.d.ts +3 -0
- package/dist/plugins/ExamplePlugin.d.ts.map +1 -0
- package/dist/plugins/ExamplePlugin.js +24 -0
- package/dist/plugins/ExamplePlugin.js.map +1 -0
- package/dist/plugins/LifecycleDemoPlugin.d.ts +20 -0
- package/dist/plugins/LifecycleDemoPlugin.d.ts.map +1 -0
- package/dist/plugins/LifecycleDemoPlugin.js +34 -0
- package/dist/plugins/LifecycleDemoPlugin.js.map +1 -0
- package/dist/plugins/MathPlugin.d.ts +16 -0
- package/dist/plugins/MathPlugin.d.ts.map +1 -0
- package/dist/plugins/MathPlugin.js +30 -0
- package/dist/plugins/MathPlugin.js.map +1 -0
- package/dist/plugins/MyJSPlugin.d.ts +7 -0
- package/dist/plugins/MyJSPlugin.d.ts.map +1 -0
- package/dist/plugins/MyJSPlugin.js +12 -0
- package/dist/plugins/MyJSPlugin.js.map +1 -0
- package/dist/plugins/TypedExamplePlugin.d.ts +10 -0
- package/dist/plugins/TypedExamplePlugin.d.ts.map +1 -0
- package/dist/plugins/TypedExamplePlugin.js +61 -0
- package/dist/plugins/TypedExamplePlugin.js.map +1 -0
- package/dist/plugins/arktype/index.d.ts +8 -0
- package/dist/plugins/arktype/index.d.ts.map +1 -0
- package/dist/plugins/arktype/index.js +25 -0
- package/dist/plugins/arktype/index.js.map +1 -0
- package/dist/src/Plugin.d.ts +28 -0
- package/dist/src/Plugin.d.ts.map +1 -0
- package/dist/src/Plugin.js +36 -0
- package/dist/src/Plugin.js.map +1 -0
- package/dist/{PluginManager.d.ts → src/PluginManager.d.ts} +33 -10
- package/dist/src/PluginManager.d.ts.map +1 -0
- package/dist/{PluginManager.js → src/PluginManager.js} +245 -193
- package/dist/src/PluginManager.js.map +1 -0
- package/dist/{index.d.ts → src/index.d.ts} +2 -1
- package/dist/src/index.d.ts.map +1 -0
- package/dist/{index.js → src/index.js} +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/logger/LoggerAdapter.d.ts +77 -0
- package/dist/src/logger/LoggerAdapter.d.ts.map +1 -0
- package/dist/src/logger/LoggerAdapter.js +242 -0
- package/dist/src/logger/LoggerAdapter.js.map +1 -0
- package/dist/src/logger/LoggerFactory.d.ts +73 -0
- package/dist/src/logger/LoggerFactory.d.ts.map +1 -0
- package/dist/src/logger/LoggerFactory.js +99 -0
- package/dist/src/logger/LoggerFactory.js.map +1 -0
- package/dist/src/logger/index.d.ts +3 -0
- package/dist/src/logger/index.d.ts.map +1 -0
- package/dist/src/logger/index.js +3 -0
- package/dist/src/logger/index.js.map +1 -0
- package/dist/{managers → src/managers}/ContextFactory.d.ts +1 -1
- package/dist/src/managers/ContextFactory.d.ts.map +1 -0
- package/dist/{managers → src/managers}/ContextFactory.js +51 -26
- package/dist/src/managers/ContextFactory.js.map +1 -0
- package/dist/src/managers/DependencyManager.d.ts.map +1 -0
- package/dist/{managers → src/managers}/DependencyManager.js +7 -5
- package/dist/src/managers/DependencyManager.js.map +1 -0
- package/dist/{managers → src/managers}/HooksManager.d.ts +4 -1
- package/dist/src/managers/HooksManager.d.ts.map +1 -0
- package/dist/{managers → src/managers}/HooksManager.js +36 -8
- package/dist/src/managers/HooksManager.js.map +1 -0
- package/dist/src/managers/ResourceManager.d.ts.map +1 -0
- package/dist/{managers → src/managers}/ResourceManager.js +3 -3
- package/dist/src/managers/ResourceManager.js.map +1 -0
- package/dist/src/storage/JsonPluginStorage.d.ts +75 -0
- package/dist/src/storage/JsonPluginStorage.d.ts.map +1 -0
- package/dist/src/storage/JsonPluginStorage.js +240 -0
- package/dist/src/storage/JsonPluginStorage.js.map +1 -0
- package/dist/src/types/plugin-registry-base.d.ts +80 -0
- package/dist/src/types/plugin-registry-base.d.ts.map +1 -0
- package/dist/src/types/plugin-registry-base.js +6 -0
- package/dist/src/types/plugin-registry-base.js.map +1 -0
- package/dist/{types.d.ts → src/types.d.ts} +60 -19
- package/dist/src/types.d.ts.map +1 -0
- package/dist/{types.js → src/types.js} +6 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/errorParser.d.ts.map +1 -0
- package/dist/{utils → src/utils}/errorParser.js +2 -5
- package/dist/src/utils/errorParser.js.map +1 -0
- package/dist/src/utils/pluginValidator.d.ts +17 -0
- package/dist/src/utils/pluginValidator.d.ts.map +1 -0
- package/dist/{utils → src/utils}/pluginValidator.js +11 -14
- package/dist/src/utils/pluginValidator.js.map +1 -0
- package/dist/src/utils/security.d.ts.map +1 -0
- package/dist/src/utils/security.js.map +1 -0
- package/dist/src/worker/WorkerRunner.d.ts.map +1 -0
- package/dist/{worker → src/worker}/WorkerRunner.js +38 -13
- package/dist/src/worker/WorkerRunner.js.map +1 -0
- package/package.json +9 -6
- package/dist/PluginManager.d.ts.map +0 -1
- package/dist/PluginManager.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/managers/ContextFactory.d.ts.map +0 -1
- package/dist/managers/ContextFactory.js.map +0 -1
- package/dist/managers/DependencyManager.d.ts.map +0 -1
- package/dist/managers/DependencyManager.js.map +0 -1
- package/dist/managers/HooksManager.d.ts.map +0 -1
- package/dist/managers/HooksManager.js.map +0 -1
- package/dist/managers/ResourceManager.d.ts.map +0 -1
- package/dist/managers/ResourceManager.js.map +0 -1
- package/dist/storage/JsonPluginStorage.d.ts +0 -14
- package/dist/storage/JsonPluginStorage.d.ts.map +0 -1
- package/dist/storage/JsonPluginStorage.js +0 -63
- package/dist/storage/JsonPluginStorage.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/errorParser.d.ts.map +0 -1
- package/dist/utils/errorParser.js.map +0 -1
- package/dist/utils/pluginValidator.d.ts +0 -93
- package/dist/utils/pluginValidator.d.ts.map +0 -1
- package/dist/utils/pluginValidator.js.map +0 -1
- package/dist/utils/security.d.ts.map +0 -1
- package/dist/utils/security.js.map +0 -1
- package/dist/worker/WorkerRunner.d.ts.map +0 -1
- package/dist/worker/WorkerRunner.js.map +0 -1
- /package/dist/{managers → src/managers}/DependencyManager.d.ts +0 -0
- /package/dist/{managers → src/managers}/ResourceManager.d.ts +0 -0
- /package/dist/{utils → src/utils}/errorParser.d.ts +0 -0
- /package/dist/{utils → src/utils}/security.d.ts +0 -0
- /package/dist/{utils → src/utils}/security.js +0 -0
- /package/dist/{worker → src/worker}/WorkerRunner.d.ts +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative Examples Index
|
|
3
|
+
*
|
|
4
|
+
* This file serves as the main entry point for all declarative examples,
|
|
5
|
+
* providing a clean overview and easy access to different use cases.
|
|
6
|
+
*/
|
|
7
|
+
import { runDemo } from "./shared/plugin-builder";
|
|
8
|
+
// Import all declarative examples
|
|
9
|
+
import { demonstrateDeclarativeActionRegistry } from "./action-registry-declarative";
|
|
10
|
+
import { demonstrateDeclarativeStorage } from "./storage-declarative";
|
|
11
|
+
import { demonstrateDeclarativeLogging } from "./logger-declarative";
|
|
12
|
+
import { demonstrateDeclarativeServer } from "./server-declarative";
|
|
13
|
+
// Example catalog with descriptions
|
|
14
|
+
const exampleCatalog = [
|
|
15
|
+
{
|
|
16
|
+
id: 'action-registry',
|
|
17
|
+
name: 'Action Registry',
|
|
18
|
+
description: 'Declarative plugin system with action registration and execution',
|
|
19
|
+
file: 'action-registry-declarative.ts',
|
|
20
|
+
demo: demonstrateDeclarativeActionRegistry,
|
|
21
|
+
features: [
|
|
22
|
+
'Declarative action definitions',
|
|
23
|
+
'Plugin-based architecture',
|
|
24
|
+
'Dynamic action registration',
|
|
25
|
+
'Error handling',
|
|
26
|
+
'Plugin discovery'
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'storage',
|
|
31
|
+
name: 'Storage System',
|
|
32
|
+
description: 'Clean storage operations with declarative configuration',
|
|
33
|
+
file: 'storage-declarative.ts',
|
|
34
|
+
demo: demonstrateDeclarativeStorage,
|
|
35
|
+
features: [
|
|
36
|
+
'Declarative storage operations',
|
|
37
|
+
'CRUD operations',
|
|
38
|
+
'Configuration management',
|
|
39
|
+
'Data validation',
|
|
40
|
+
'Plugin isolation support'
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'logging',
|
|
45
|
+
name: 'Logging System',
|
|
46
|
+
description: 'Flexible logging with multiple adapters and configurations',
|
|
47
|
+
file: 'logger-declarative.ts',
|
|
48
|
+
demo: demonstrateDeclarativeLogging,
|
|
49
|
+
features: [
|
|
50
|
+
'Multiple logger adapters',
|
|
51
|
+
'Hierarchical logging',
|
|
52
|
+
'Structured logging',
|
|
53
|
+
'Performance monitoring',
|
|
54
|
+
'Plugin-specific loggers'
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'server',
|
|
59
|
+
name: 'HTTP Server',
|
|
60
|
+
description: 'Plugin-powered HTTP server with declarative routing',
|
|
61
|
+
file: 'server-declarative.ts',
|
|
62
|
+
demo: demonstrateDeclarativeServer,
|
|
63
|
+
features: [
|
|
64
|
+
'Declarative route definitions',
|
|
65
|
+
'Plugin-based handlers',
|
|
66
|
+
'Error handling',
|
|
67
|
+
'JSON API',
|
|
68
|
+
'Action execution'
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
// Main menu system
|
|
73
|
+
const showMainMenu = () => {
|
|
74
|
+
console.log("\n🎯 Declarative Plugin System Examples");
|
|
75
|
+
console.log("=====================================\n");
|
|
76
|
+
exampleCatalog.forEach((example, index) => {
|
|
77
|
+
console.log(`${index + 1}. ${example.name}`);
|
|
78
|
+
console.log(` ${example.description}`);
|
|
79
|
+
console.log(` File: ${example.file}`);
|
|
80
|
+
console.log(` Features: ${example.features.join(', ')}`);
|
|
81
|
+
console.log();
|
|
82
|
+
});
|
|
83
|
+
console.log("0. Run all examples");
|
|
84
|
+
console.log("q. Quit");
|
|
85
|
+
console.log();
|
|
86
|
+
};
|
|
87
|
+
// Run specific example
|
|
88
|
+
const runExample = async (index) => {
|
|
89
|
+
const example = exampleCatalog[index];
|
|
90
|
+
if (!example) {
|
|
91
|
+
console.log("❌ Invalid example number");
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
// Wrap server demo to return void
|
|
95
|
+
const wrappedDemo = async () => {
|
|
96
|
+
if (example.id === 'server') {
|
|
97
|
+
await example.demo();
|
|
98
|
+
console.log("\n🌐 Server is running. Press Ctrl+C to stop.");
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
await example.demo();
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
await runDemo(`${example.name} Example`, wrappedDemo);
|
|
105
|
+
};
|
|
106
|
+
// Run all examples (excluding server which blocks)
|
|
107
|
+
const runAllExamples = async () => {
|
|
108
|
+
console.log("\n🚀 Running all declarative examples...\n");
|
|
109
|
+
for (const example of exampleCatalog) {
|
|
110
|
+
if (example.id === 'server') {
|
|
111
|
+
console.log(`⏭️ Skipping ${example.name} (server blocks execution)`);
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
// Wrap demo to ensure it returns void
|
|
115
|
+
const wrappedDemo = async () => {
|
|
116
|
+
await example.demo();
|
|
117
|
+
};
|
|
118
|
+
await runDemo(example.name, wrappedDemo);
|
|
119
|
+
}
|
|
120
|
+
console.log("\n✅ All examples completed!");
|
|
121
|
+
};
|
|
122
|
+
// Interactive menu
|
|
123
|
+
const interactiveMenu = async () => {
|
|
124
|
+
const readline = await import('readline');
|
|
125
|
+
const rl = readline.createInterface({
|
|
126
|
+
input: process.stdin,
|
|
127
|
+
output: process.stdout
|
|
128
|
+
});
|
|
129
|
+
const askQuestion = (question) => {
|
|
130
|
+
return new Promise(resolve => {
|
|
131
|
+
rl.question(question, resolve);
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
while (true) {
|
|
135
|
+
showMainMenu();
|
|
136
|
+
const answer = await askQuestion("Select an example (number) or 'q' to quit: ");
|
|
137
|
+
if (answer.toLowerCase() === 'q') {
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
if (answer === '0') {
|
|
141
|
+
await runAllExamples();
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
const index = parseInt(answer) - 1;
|
|
145
|
+
if (!isNaN(index)) {
|
|
146
|
+
await runExample(index);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
console.log("❌ Invalid input");
|
|
150
|
+
}
|
|
151
|
+
const continueAnswer = await askQuestion("\nPress Enter to continue or 'q' to quit: ");
|
|
152
|
+
if (continueAnswer.toLowerCase() === 'q') {
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
rl.close();
|
|
157
|
+
};
|
|
158
|
+
// Quick run function
|
|
159
|
+
const quickRun = async (exampleId) => {
|
|
160
|
+
const example = exampleCatalog.find(e => e.id === exampleId);
|
|
161
|
+
if (!example) {
|
|
162
|
+
console.log(`❌ Example '${exampleId}' not found`);
|
|
163
|
+
console.log("Available examples:", exampleCatalog.map(e => e.id).join(', '));
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
// Wrap server demo to return void
|
|
167
|
+
const wrappedDemo = async () => {
|
|
168
|
+
if (example.id === 'server') {
|
|
169
|
+
await example.demo();
|
|
170
|
+
console.log("\n🌐 Server is running. Press Ctrl+C to stop.");
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
await example.demo();
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
await runDemo(example.name, wrappedDemo);
|
|
177
|
+
};
|
|
178
|
+
// Export everything
|
|
179
|
+
export { exampleCatalog, showMainMenu, runExample, runAllExamples, interactiveMenu, quickRun,
|
|
180
|
+
// Individual demos
|
|
181
|
+
demonstrateDeclarativeActionRegistry, demonstrateDeclarativeStorage, demonstrateDeclarativeLogging, demonstrateDeclarativeServer };
|
|
182
|
+
// Run if called directly
|
|
183
|
+
if (import.meta.main) {
|
|
184
|
+
const args = process.argv.slice(2);
|
|
185
|
+
if (args.length === 0) {
|
|
186
|
+
// Interactive mode
|
|
187
|
+
interactiveMenu().catch(console.error);
|
|
188
|
+
}
|
|
189
|
+
else if (args[0] === '--all') {
|
|
190
|
+
// Run all examples
|
|
191
|
+
runAllExamples().catch(console.error);
|
|
192
|
+
}
|
|
193
|
+
else if (args[0] === '--example' && args[1]) {
|
|
194
|
+
// Run specific example
|
|
195
|
+
quickRun(args[1]).catch(console.error);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
console.log("\n🎯 Declarative Plugin System Examples");
|
|
199
|
+
console.log("Usage:");
|
|
200
|
+
console.log(" bun run examples/index-declarative.ts # Interactive menu");
|
|
201
|
+
console.log(" bun run examples/index-declarative.ts --all # Run all examples");
|
|
202
|
+
console.log(" bun run examples/index-declarative.ts --example <id> # Run specific example");
|
|
203
|
+
console.log("\nAvailable examples:", exampleCatalog.map(e => e.id).join(', '));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=index-declarative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-declarative.js","sourceRoot":"","sources":["../../examples/index-declarative.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,kCAAkC;AAClC,OAAO,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpE,oCAAoC;AACpC,MAAM,cAAc,GAAG;IACrB;QACE,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,kEAAkE;QAC/E,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,oCAAoC;QAC1C,QAAQ,EAAE;YACR,gCAAgC;YAChC,2BAA2B;YAC3B,6BAA6B;YAC7B,gBAAgB;YAChB,kBAAkB;SACnB;KACF;IACD;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,yDAAyD;QACtE,IAAI,EAAE,wBAAwB;QAC9B,IAAI,EAAE,6BAA6B;QACnC,QAAQ,EAAE;YACR,gCAAgC;YAChC,iBAAiB;YACjB,0BAA0B;YAC1B,iBAAiB;YACjB,0BAA0B;SAC3B;KACF;IACD;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,4DAA4D;QACzE,IAAI,EAAE,u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,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QAC/B,mBAAmB;QACnB,cAAc,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;SAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,uBAAuB;QACvB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;QACnF,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;QACnF,OAAO,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;QAC9F,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative Logger Example
|
|
3
|
+
*
|
|
4
|
+
* This example demonstrates a clean, declarative approach to configuring
|
|
5
|
+
* and using different logging adapters.
|
|
6
|
+
*/
|
|
7
|
+
interface LoggerConfig {
|
|
8
|
+
type: 'console' | 'colorful' | 'pino' | 'noop';
|
|
9
|
+
context?: string;
|
|
10
|
+
level?: string;
|
|
11
|
+
format?: 'simple' | 'json' | 'colored';
|
|
12
|
+
useColors?: boolean;
|
|
13
|
+
timestampFormat?: 'none' | 'iso' | 'time';
|
|
14
|
+
showEmoji?: boolean;
|
|
15
|
+
levelColors?: Record<string, string>;
|
|
16
|
+
contextColor?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const createLogger: (config: LoggerConfig) => import("bun_plugins").Logger;
|
|
19
|
+
declare const loggerScenarios: ({
|
|
20
|
+
name: string;
|
|
21
|
+
config: {
|
|
22
|
+
type: "console";
|
|
23
|
+
context: string;
|
|
24
|
+
timestampFormat?: undefined;
|
|
25
|
+
showEmoji?: undefined;
|
|
26
|
+
levelColors?: undefined;
|
|
27
|
+
contextColor?: undefined;
|
|
28
|
+
};
|
|
29
|
+
demo: (log: any) => void;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
config: {
|
|
33
|
+
type: "colorful";
|
|
34
|
+
context: string;
|
|
35
|
+
timestampFormat: "time";
|
|
36
|
+
showEmoji: boolean;
|
|
37
|
+
levelColors?: undefined;
|
|
38
|
+
contextColor?: undefined;
|
|
39
|
+
};
|
|
40
|
+
demo: (log: any) => void;
|
|
41
|
+
} | {
|
|
42
|
+
name: string;
|
|
43
|
+
config: {
|
|
44
|
+
type: "colorful";
|
|
45
|
+
levelColors: {
|
|
46
|
+
info: string;
|
|
47
|
+
warn: string;
|
|
48
|
+
error: string;
|
|
49
|
+
debug: string;
|
|
50
|
+
};
|
|
51
|
+
contextColor: string;
|
|
52
|
+
showEmoji: boolean;
|
|
53
|
+
context?: undefined;
|
|
54
|
+
timestampFormat?: undefined;
|
|
55
|
+
};
|
|
56
|
+
demo: (log: any) => void;
|
|
57
|
+
} | {
|
|
58
|
+
name: string;
|
|
59
|
+
config: {
|
|
60
|
+
type: "pino";
|
|
61
|
+
context?: undefined;
|
|
62
|
+
timestampFormat?: undefined;
|
|
63
|
+
showEmoji?: undefined;
|
|
64
|
+
levelColors?: undefined;
|
|
65
|
+
contextColor?: undefined;
|
|
66
|
+
};
|
|
67
|
+
demo: (log: any) => void;
|
|
68
|
+
} | {
|
|
69
|
+
name: string;
|
|
70
|
+
config: {
|
|
71
|
+
type: "noop";
|
|
72
|
+
context?: undefined;
|
|
73
|
+
timestampFormat?: undefined;
|
|
74
|
+
showEmoji?: undefined;
|
|
75
|
+
levelColors?: undefined;
|
|
76
|
+
contextColor?: undefined;
|
|
77
|
+
};
|
|
78
|
+
demo: (log: any) => void;
|
|
79
|
+
})[];
|
|
80
|
+
declare const pluginLoggerConfigs: {
|
|
81
|
+
'database-plugin': {
|
|
82
|
+
type: "colorful";
|
|
83
|
+
context: string;
|
|
84
|
+
timestampFormat: "time";
|
|
85
|
+
showEmoji: boolean;
|
|
86
|
+
levelColors: {
|
|
87
|
+
info: string;
|
|
88
|
+
warn: string;
|
|
89
|
+
error: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
'api-plugin': {
|
|
93
|
+
type: "colorful";
|
|
94
|
+
context: string;
|
|
95
|
+
showEmoji: boolean;
|
|
96
|
+
};
|
|
97
|
+
'cache-plugin': {
|
|
98
|
+
type: "noop";
|
|
99
|
+
};
|
|
100
|
+
'auth-plugin': {
|
|
101
|
+
type: "colorful";
|
|
102
|
+
context: string;
|
|
103
|
+
contextColor: string;
|
|
104
|
+
showEmoji: boolean;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
declare const demonstrateDeclarativeLogging: () => Promise<void>;
|
|
108
|
+
export { createLogger, loggerScenarios, pluginLoggerConfigs, demonstrateDeclarativeLogging };
|
|
109
|
+
//# sourceMappingURL=logger-declarative.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger-declarative.d.ts","sourceRoot":"","sources":["../../examples/logger-declarative.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,UAAU,YAAY;IACpB,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,QAAA,MAAM,YAAY,GAAI,QAAQ,YAAY,iCAiDzC,CAAC;AAGF,QAAA,MAAM,eAAe;;;;;;;;;;gBAIL,GAAG;;;;;;;;;;;gBAcH,GAAG;;;;;;;;;;;;;;;;gBAoBH,GAAG;;;;;;;;;;;gBASH,GAAG;;;;;;;;;;;gBASH,GAAG;IAMlB,CAAC;AAGF,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBxB,CAAC;AA8KF,QAAA,MAAM,6BAA6B,qBAsClC,CAAC;AAGF,OAAO,EACL,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,6BAA6B,EAC9B,CAAC"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative Logger Example
|
|
3
|
+
*
|
|
4
|
+
* This example demonstrates a clean, declarative approach to configuring
|
|
5
|
+
* and using different logging adapters.
|
|
6
|
+
*/
|
|
7
|
+
import { logger, ConsoleLogger, NoopLogger, SimpleLoggerAdapter, ColorfulConsoleLogger } from "../src";
|
|
8
|
+
// Declarative logger factory
|
|
9
|
+
const createLogger = (config) => {
|
|
10
|
+
switch (config.type) {
|
|
11
|
+
case 'console':
|
|
12
|
+
const consoleLogger = new ConsoleLogger({
|
|
13
|
+
useColors: config.useColors ?? false,
|
|
14
|
+
timestampFormat: config.timestampFormat ?? 'none'
|
|
15
|
+
});
|
|
16
|
+
if (config.context) {
|
|
17
|
+
return new SimpleLoggerAdapter(consoleLogger, config.context);
|
|
18
|
+
}
|
|
19
|
+
return consoleLogger;
|
|
20
|
+
case 'colorful':
|
|
21
|
+
const colorfulLogger = new ColorfulConsoleLogger({
|
|
22
|
+
useColors: config.useColors ?? true,
|
|
23
|
+
timestampFormat: config.timestampFormat ?? 'none',
|
|
24
|
+
levelColors: config.levelColors,
|
|
25
|
+
contextColor: config.contextColor,
|
|
26
|
+
showEmoji: config.showEmoji ?? true
|
|
27
|
+
});
|
|
28
|
+
if (config.context) {
|
|
29
|
+
return colorfulLogger.child(config.context);
|
|
30
|
+
}
|
|
31
|
+
return colorfulLogger;
|
|
32
|
+
case 'pino':
|
|
33
|
+
// Simulated Pino logger for demonstration
|
|
34
|
+
const pinoLogger = {
|
|
35
|
+
info: (msg, ...args) => {
|
|
36
|
+
console.log(`[PINO] INFO: ${msg}`, ...args);
|
|
37
|
+
},
|
|
38
|
+
warn: (msg, ...args) => {
|
|
39
|
+
console.log(`[PINO] WARN: ${msg}`, ...args);
|
|
40
|
+
},
|
|
41
|
+
error: (msg, ...args) => {
|
|
42
|
+
console.log(`[PINO] ERROR: ${msg}`, ...args);
|
|
43
|
+
},
|
|
44
|
+
child: (context) => pinoLogger
|
|
45
|
+
};
|
|
46
|
+
return config.context ?
|
|
47
|
+
new SimpleLoggerAdapter(pinoLogger, config.context) :
|
|
48
|
+
pinoLogger;
|
|
49
|
+
case 'noop':
|
|
50
|
+
return new NoopLogger();
|
|
51
|
+
default:
|
|
52
|
+
throw new Error(`Unknown logger type: ${config.type}`);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
// Logger scenarios
|
|
56
|
+
const loggerScenarios = [
|
|
57
|
+
{
|
|
58
|
+
name: "Basic Console Logger",
|
|
59
|
+
config: { type: 'console', context: 'MyApp' },
|
|
60
|
+
demo: (log) => {
|
|
61
|
+
log.info("Application started");
|
|
62
|
+
log.warn("Low memory warning");
|
|
63
|
+
log.error("Connection failed");
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "Colorful Console Logger",
|
|
68
|
+
config: {
|
|
69
|
+
type: 'colorful',
|
|
70
|
+
context: 'ColorfulApp',
|
|
71
|
+
timestampFormat: 'time',
|
|
72
|
+
showEmoji: true
|
|
73
|
+
},
|
|
74
|
+
demo: (log) => {
|
|
75
|
+
log.info("System initialized with colors");
|
|
76
|
+
log.warn("Performance degradation detected");
|
|
77
|
+
log.error("Critical system failure");
|
|
78
|
+
log.debug("Debug information available");
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "Custom Color Theme Logger",
|
|
83
|
+
config: {
|
|
84
|
+
type: 'colorful',
|
|
85
|
+
levelColors: {
|
|
86
|
+
info: '#00FF00', // Bright green
|
|
87
|
+
warn: '#FFA500', // Orange
|
|
88
|
+
error: '#FF1493', // Deep pink
|
|
89
|
+
debug: '#00CED1' // Dark turquoise
|
|
90
|
+
},
|
|
91
|
+
contextColor: '#FFD700', // Gold
|
|
92
|
+
showEmoji: true
|
|
93
|
+
},
|
|
94
|
+
demo: (log) => {
|
|
95
|
+
log.info("Custom themed info message");
|
|
96
|
+
log.warn("Custom themed warning");
|
|
97
|
+
log.error("Custom themed error");
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "Pino-style Logger",
|
|
102
|
+
config: { type: 'pino' },
|
|
103
|
+
demo: (log) => {
|
|
104
|
+
log.info({ userId: 123 }, "User logged in");
|
|
105
|
+
log.warn({ memory: '85%' }, "High memory usage");
|
|
106
|
+
log.error({ error: 'ECONNREFUSED' }, "Database connection failed");
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "No-op Logger (disabled)",
|
|
111
|
+
config: { type: 'noop' },
|
|
112
|
+
demo: (log) => {
|
|
113
|
+
log.info("This won't be shown");
|
|
114
|
+
log.error("Neither will this");
|
|
115
|
+
console.log("But this console.log will still appear");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
];
|
|
119
|
+
// Plugin-specific logger configuration
|
|
120
|
+
const pluginLoggerConfigs = {
|
|
121
|
+
'database-plugin': {
|
|
122
|
+
type: 'colorful',
|
|
123
|
+
context: 'Database',
|
|
124
|
+
timestampFormat: 'time',
|
|
125
|
+
showEmoji: true,
|
|
126
|
+
levelColors: {
|
|
127
|
+
info: '#4ECDC4',
|
|
128
|
+
warn: '#FFA07A',
|
|
129
|
+
error: '#FF6B6B'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
'api-plugin': {
|
|
133
|
+
type: 'colorful',
|
|
134
|
+
context: 'API',
|
|
135
|
+
showEmoji: true
|
|
136
|
+
},
|
|
137
|
+
'cache-plugin': { type: 'noop' }, // Disable cache logging
|
|
138
|
+
'auth-plugin': {
|
|
139
|
+
type: 'colorful',
|
|
140
|
+
context: 'Auth',
|
|
141
|
+
contextColor: '#FF69B4',
|
|
142
|
+
showEmoji: true
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
// Declarative plugin logger setup
|
|
146
|
+
const setupPluginLoggers = () => {
|
|
147
|
+
Object.entries(pluginLoggerConfigs).forEach(([pluginName, config]) => {
|
|
148
|
+
const log = createLogger(config);
|
|
149
|
+
logger.setPluginLogger(pluginName, log);
|
|
150
|
+
console.log(`✅ Configured logger for ${pluginName}`);
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
// Hierarchical logger demonstration
|
|
154
|
+
const demonstrateHierarchicalLoggers = () => {
|
|
155
|
+
console.log("\n🏗️ Hierarchical Loggers:");
|
|
156
|
+
// Parent logger
|
|
157
|
+
const parentLogger = createLogger({ type: 'console', context: 'Parent' });
|
|
158
|
+
logger.setDefaultLogger(parentLogger);
|
|
159
|
+
parentLogger.info("Message from parent logger");
|
|
160
|
+
// Child logger (using factory method)
|
|
161
|
+
const childLogger = logger.createLogger('Child');
|
|
162
|
+
childLogger.info("Message from child logger");
|
|
163
|
+
// Grandchild logger
|
|
164
|
+
const grandchildLogger = childLogger.child?.('Grandchild') || childLogger;
|
|
165
|
+
grandchildLogger.info("Message from grandchild logger");
|
|
166
|
+
};
|
|
167
|
+
// Color palette demonstration
|
|
168
|
+
const demonstrateColorPalette = () => {
|
|
169
|
+
console.log("\n🎨 Bun.color Palette Demo:");
|
|
170
|
+
const colors = [
|
|
171
|
+
{ name: 'CSS Colors', colors: ['red', 'green', 'blue', 'yellow', 'magenta', 'cyan'] },
|
|
172
|
+
{ name: 'Hex Colors', colors: ['#FF6B6B', '#4ECDC4', '#45B7D1', '#FFA07A', '#98D8C8'] },
|
|
173
|
+
{ name: 'RGB/HSL', colors: ['rgb(255, 99, 71)', 'hsl(120, 50%, 50%)'] }
|
|
174
|
+
];
|
|
175
|
+
colors.forEach(category => {
|
|
176
|
+
console.log(`\n${category.name}:`);
|
|
177
|
+
category.colors.forEach(color => {
|
|
178
|
+
const ansiColor = Bun.color(color, 'ansi');
|
|
179
|
+
if (ansiColor) {
|
|
180
|
+
console.log(`${ansiColor}This text is ${color}${Bun.color('reset', 'ansi')}`);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
// Structured logging demonstration
|
|
186
|
+
const demonstrateStructuredLogging = () => {
|
|
187
|
+
console.log("\n📊 Structured Logging:");
|
|
188
|
+
const structuredLogger = createLogger({
|
|
189
|
+
type: 'colorful',
|
|
190
|
+
context: 'Structured',
|
|
191
|
+
timestampFormat: 'iso',
|
|
192
|
+
showEmoji: true
|
|
193
|
+
});
|
|
194
|
+
// Log with metadata
|
|
195
|
+
structuredLogger.info("User completed purchase", {
|
|
196
|
+
event: 'user_action',
|
|
197
|
+
userId: 456,
|
|
198
|
+
action: 'purchase',
|
|
199
|
+
amount: 99.99,
|
|
200
|
+
timestamp: new Date().toISOString()
|
|
201
|
+
});
|
|
202
|
+
// Log with error context
|
|
203
|
+
structuredLogger.error("Input validation failed", {
|
|
204
|
+
error: 'ValidationError',
|
|
205
|
+
field: 'email',
|
|
206
|
+
value: 'invalid-email',
|
|
207
|
+
userId: 789
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
// Performance logging demonstration
|
|
211
|
+
const demonstratePerformanceLogging = () => {
|
|
212
|
+
console.log("\n⚡ Performance Logging:");
|
|
213
|
+
const perfLogger = createLogger({
|
|
214
|
+
type: 'colorful',
|
|
215
|
+
context: 'Performance',
|
|
216
|
+
timestampFormat: 'time',
|
|
217
|
+
showEmoji: true,
|
|
218
|
+
levelColors: {
|
|
219
|
+
info: '#00FF7F', // Spring green
|
|
220
|
+
warn: '#FFD700', // Gold
|
|
221
|
+
error: '#FF4500' // Orange red
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
// Simulate some operations with timing
|
|
225
|
+
const operations = [
|
|
226
|
+
{ name: 'database_query', duration: 150 },
|
|
227
|
+
{ name: 'api_call', duration: 300 },
|
|
228
|
+
{ name: 'file_processing', duration: 75 }
|
|
229
|
+
];
|
|
230
|
+
operations.forEach(op => {
|
|
231
|
+
perfLogger.info(`Operation ${op.name} completed`, {
|
|
232
|
+
operation: op.name,
|
|
233
|
+
duration: op.duration,
|
|
234
|
+
status: op.duration < 200 ? 'fast' : 'slow',
|
|
235
|
+
timestamp: new Date().toISOString()
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
// Advanced color configuration demonstration
|
|
240
|
+
const demonstrateAdvancedColors = () => {
|
|
241
|
+
console.log("\n🔬 Advanced Color Configuration:");
|
|
242
|
+
// Create loggers with different color schemes
|
|
243
|
+
const neonLogger = createLogger({
|
|
244
|
+
type: 'colorful',
|
|
245
|
+
context: 'Neon',
|
|
246
|
+
levelColors: {
|
|
247
|
+
info: '#00FFFF', // Cyan
|
|
248
|
+
warn: '#FF00FF', // Magenta
|
|
249
|
+
error: '#FFFF00', // Yellow
|
|
250
|
+
debug: '#00FF00' // Lime
|
|
251
|
+
},
|
|
252
|
+
contextColor: '#FF1493', // Deep pink
|
|
253
|
+
showEmoji: true
|
|
254
|
+
});
|
|
255
|
+
const pastelLogger = createLogger({
|
|
256
|
+
type: 'colorful',
|
|
257
|
+
context: 'Pastel',
|
|
258
|
+
levelColors: {
|
|
259
|
+
info: '#B19CD9', // Light purple
|
|
260
|
+
warn: '#FFB6C1', // Light pink
|
|
261
|
+
error: '#FFA07A', // Light salmon
|
|
262
|
+
debug: '#87CEEB' // Sky blue
|
|
263
|
+
},
|
|
264
|
+
contextColor: '#DDA0DD', // Plum
|
|
265
|
+
showEmoji: false
|
|
266
|
+
});
|
|
267
|
+
const darkThemeLogger = createLogger({
|
|
268
|
+
type: 'colorful',
|
|
269
|
+
context: 'DarkTheme',
|
|
270
|
+
levelColors: {
|
|
271
|
+
info: '#00FF00', // Green
|
|
272
|
+
warn: '#FFA500', // Orange
|
|
273
|
+
error: '#FF0000', // Red
|
|
274
|
+
debug: '#808080' // Gray
|
|
275
|
+
},
|
|
276
|
+
contextColor: '#FFFFFF', // White
|
|
277
|
+
showEmoji: true
|
|
278
|
+
});
|
|
279
|
+
// Test each themed logger
|
|
280
|
+
const loggers = [
|
|
281
|
+
{ name: 'Neon Theme', logger: neonLogger },
|
|
282
|
+
{ name: 'Pastel Theme', logger: pastelLogger },
|
|
283
|
+
{ name: 'Dark Theme', logger: darkThemeLogger }
|
|
284
|
+
];
|
|
285
|
+
loggers.forEach(({ name, logger: log }) => {
|
|
286
|
+
console.log(`\n${name}:`);
|
|
287
|
+
log.info("Information message");
|
|
288
|
+
log.warn("Warning message");
|
|
289
|
+
log.error("Error message");
|
|
290
|
+
log.debug?.("Debug message");
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
// Main demonstration
|
|
294
|
+
const demonstrateDeclarativeLogging = async () => {
|
|
295
|
+
console.log("🚀 Enhanced Declarative Logger Demo\n");
|
|
296
|
+
// Scenario 1: Different logger types
|
|
297
|
+
console.log("=== Logger Types ===");
|
|
298
|
+
for (const scenario of loggerScenarios) {
|
|
299
|
+
console.log(`\n${scenario.name}:`);
|
|
300
|
+
const log = createLogger(scenario.config);
|
|
301
|
+
scenario.demo(log);
|
|
302
|
+
}
|
|
303
|
+
// Scenario 2: Plugin-specific loggers
|
|
304
|
+
console.log("\n=== Plugin-specific Loggers ===");
|
|
305
|
+
setupPluginLoggers();
|
|
306
|
+
// Test plugin loggers
|
|
307
|
+
const plugins = ['database-plugin', 'api-plugin', 'cache-plugin', 'auth-plugin'];
|
|
308
|
+
plugins.forEach(pluginName => {
|
|
309
|
+
const log = logger.getLogger(pluginName);
|
|
310
|
+
log.info(`Test message from ${pluginName}`);
|
|
311
|
+
});
|
|
312
|
+
// Scenario 3: Hierarchical loggers
|
|
313
|
+
demonstrateHierarchicalLoggers();
|
|
314
|
+
// Scenario 4: Color palette
|
|
315
|
+
demonstrateColorPalette();
|
|
316
|
+
// Scenario 5: Structured logging
|
|
317
|
+
demonstrateStructuredLogging();
|
|
318
|
+
// Scenario 6: Performance logging
|
|
319
|
+
demonstratePerformanceLogging();
|
|
320
|
+
// Scenario 7: Advanced colors
|
|
321
|
+
demonstrateAdvancedColors();
|
|
322
|
+
console.log("\n✅ Enhanced declarative logger demo completed!");
|
|
323
|
+
};
|
|
324
|
+
// Export for use
|
|
325
|
+
export { createLogger, loggerScenarios, pluginLoggerConfigs, demonstrateDeclarativeLogging };
|
|
326
|
+
// Run if called directly
|
|
327
|
+
if (import.meta.main) {
|
|
328
|
+
demonstrateDeclarativeLogging().catch(console.error);
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=logger-declarative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger-declarative.js","sourceRoot":"","sources":["../../examples/logger-declarative.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,QAAQ,CAAC;AAehB,6BAA6B;AAC7B,MAAM,YAAY,GAAG,CAAC,MAAoB,EAAE,EAAE;IAC5C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC;gBACtC,SAAS,EAAE,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