@zenithbuild/core 0.6.2 → 1.0.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/README.md +20 -19
- package/cli/commands/add.ts +2 -2
- package/cli/commands/build.ts +2 -3
- package/cli/commands/dev.ts +182 -103
- package/cli/commands/index.ts +1 -1
- package/cli/commands/preview.ts +1 -1
- package/cli/commands/remove.ts +2 -2
- package/cli/index.ts +1 -1
- package/cli/main.ts +1 -1
- package/cli/utils/logger.ts +1 -1
- package/cli/utils/plugin-manager.ts +1 -1
- package/cli/utils/project.ts +4 -4
- package/core/components/ErrorPage.zen +218 -0
- package/core/components/index.ts +15 -0
- package/core/config.ts +1 -0
- package/core/index.ts +29 -0
- package/dist/compiler-native-frej59m4.node +0 -0
- package/dist/core/compiler-native-frej59m4.node +0 -0
- package/dist/core/index.js +6293 -0
- package/dist/runtime/lifecycle/index.js +1 -0
- package/dist/runtime/reactivity/index.js +1 -0
- package/dist/zen-build.js +7465 -19128
- package/dist/zen-dev.js +7465 -19128
- package/dist/zen-preview.js +7465 -19128
- package/dist/zenith.js +7465 -19128
- package/package.json +21 -22
- package/cli/utils/content.ts +0 -112
- package/compiler/README.md +0 -380
- package/compiler/build-analyzer.ts +0 -122
- package/compiler/css/index.ts +0 -317
- package/compiler/discovery/componentDiscovery.ts +0 -178
- package/compiler/discovery/layouts.ts +0 -70
- package/compiler/errors/compilerError.ts +0 -56
- package/compiler/finalize/finalizeOutput.ts +0 -192
- package/compiler/finalize/generateFinalBundle.ts +0 -82
- package/compiler/index.ts +0 -83
- package/compiler/ir/types.ts +0 -174
- package/compiler/output/types.ts +0 -34
- package/compiler/parse/detectMapExpressions.ts +0 -102
- package/compiler/parse/importTypes.ts +0 -78
- package/compiler/parse/parseImports.ts +0 -309
- package/compiler/parse/parseScript.ts +0 -46
- package/compiler/parse/parseTemplate.ts +0 -599
- package/compiler/parse/parseZenFile.ts +0 -66
- package/compiler/parse/scriptAnalysis.ts +0 -91
- package/compiler/parse/trackLoopContext.ts +0 -82
- package/compiler/runtime/dataExposure.ts +0 -317
- package/compiler/runtime/generateDOM.ts +0 -246
- package/compiler/runtime/generateHydrationBundle.ts +0 -407
- package/compiler/runtime/hydration.ts +0 -309
- package/compiler/runtime/navigation.ts +0 -432
- package/compiler/runtime/thinRuntime.ts +0 -160
- package/compiler/runtime/transformIR.ts +0 -370
- package/compiler/runtime/wrapExpression.ts +0 -95
- package/compiler/runtime/wrapExpressionWithLoop.ts +0 -83
- package/compiler/spa-build.ts +0 -917
- package/compiler/ssg-build.ts +0 -422
- package/compiler/test/validate-test.ts +0 -104
- package/compiler/transform/classifyExpression.ts +0 -444
- package/compiler/transform/componentResolver.ts +0 -312
- package/compiler/transform/componentScriptTransformer.ts +0 -303
- package/compiler/transform/expressionTransformer.ts +0 -385
- package/compiler/transform/fragmentLowering.ts +0 -634
- package/compiler/transform/generateBindings.ts +0 -47
- package/compiler/transform/generateHTML.ts +0 -28
- package/compiler/transform/layoutProcessor.ts +0 -132
- package/compiler/transform/slotResolver.ts +0 -292
- package/compiler/transform/transformNode.ts +0 -126
- package/compiler/transform/transformTemplate.ts +0 -38
- package/compiler/validate/invariants.ts +0 -292
- package/compiler/validate/validateExpressions.ts +0 -168
- package/core/config/index.ts +0 -16
- package/core/config/loader.ts +0 -69
- package/core/config/types.ts +0 -89
- package/core/plugins/index.ts +0 -7
- package/core/plugins/registry.ts +0 -81
- package/dist/cli.js +0 -11665
- package/router/manifest.ts +0 -314
- package/router/navigation/ZenLink.zen +0 -231
- package/router/navigation/index.ts +0 -78
- package/router/navigation/zen-link.ts +0 -584
- package/router/runtime.ts +0 -458
- package/router/types.ts +0 -168
- package/runtime/build.ts +0 -17
- package/runtime/bundle-generator.ts +0 -1247
- package/runtime/client-runtime.ts +0 -549
- package/runtime/serve.ts +0 -93
package/core/plugins/registry.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zenith Plugin Registry
|
|
3
|
-
*
|
|
4
|
-
* Manages plugin registration and initialization
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { ZenithPlugin, PluginContext, ContentItem } from '../config/types';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Plugin registry for managing Zenith plugins
|
|
11
|
-
*/
|
|
12
|
-
export class PluginRegistry {
|
|
13
|
-
private plugins = new Map<string, ZenithPlugin>();
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Register a plugin
|
|
17
|
-
*/
|
|
18
|
-
register(plugin: ZenithPlugin): void {
|
|
19
|
-
if (this.plugins.has(plugin.name)) {
|
|
20
|
-
console.warn(`[Zenith] Plugin "${plugin.name}" is already registered. Overwriting.`);
|
|
21
|
-
}
|
|
22
|
-
this.plugins.set(plugin.name, plugin);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Get a plugin by name
|
|
27
|
-
*/
|
|
28
|
-
get(name: string): ZenithPlugin | undefined {
|
|
29
|
-
return this.plugins.get(name);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Check if a plugin is registered
|
|
34
|
-
*/
|
|
35
|
-
has(name: string): boolean {
|
|
36
|
-
return this.plugins.has(name);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Get all registered plugins
|
|
41
|
-
*/
|
|
42
|
-
all(): ZenithPlugin[] {
|
|
43
|
-
return Array.from(this.plugins.values());
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Initialize all plugins with the provided context
|
|
48
|
-
*/
|
|
49
|
-
async initAll(ctx: PluginContext): Promise<void> {
|
|
50
|
-
for (const plugin of this.plugins.values()) {
|
|
51
|
-
try {
|
|
52
|
-
await plugin.setup(ctx);
|
|
53
|
-
console.log(`[Zenith] Plugin "${plugin.name}" initialized`);
|
|
54
|
-
} catch (error: unknown) {
|
|
55
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
56
|
-
console.error(`[Zenith] Failed to initialize plugin "${plugin.name}":`, message);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Clear all registered plugins
|
|
63
|
-
*/
|
|
64
|
-
clear(): void {
|
|
65
|
-
this.plugins.clear();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Create a plugin context for initialization
|
|
71
|
-
*/
|
|
72
|
-
export function createPluginContext(
|
|
73
|
-
projectRoot: string,
|
|
74
|
-
contentSetter: (data: Record<string, ContentItem[]>) => void
|
|
75
|
-
): PluginContext {
|
|
76
|
-
return {
|
|
77
|
-
projectRoot,
|
|
78
|
-
setContentData: contentSetter,
|
|
79
|
-
options: {}
|
|
80
|
-
};
|
|
81
|
-
}
|