@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.
Files changed (87) hide show
  1. package/README.md +20 -19
  2. package/cli/commands/add.ts +2 -2
  3. package/cli/commands/build.ts +2 -3
  4. package/cli/commands/dev.ts +182 -103
  5. package/cli/commands/index.ts +1 -1
  6. package/cli/commands/preview.ts +1 -1
  7. package/cli/commands/remove.ts +2 -2
  8. package/cli/index.ts +1 -1
  9. package/cli/main.ts +1 -1
  10. package/cli/utils/logger.ts +1 -1
  11. package/cli/utils/plugin-manager.ts +1 -1
  12. package/cli/utils/project.ts +4 -4
  13. package/core/components/ErrorPage.zen +218 -0
  14. package/core/components/index.ts +15 -0
  15. package/core/config.ts +1 -0
  16. package/core/index.ts +29 -0
  17. package/dist/compiler-native-frej59m4.node +0 -0
  18. package/dist/core/compiler-native-frej59m4.node +0 -0
  19. package/dist/core/index.js +6293 -0
  20. package/dist/runtime/lifecycle/index.js +1 -0
  21. package/dist/runtime/reactivity/index.js +1 -0
  22. package/dist/zen-build.js +7465 -19128
  23. package/dist/zen-dev.js +7465 -19128
  24. package/dist/zen-preview.js +7465 -19128
  25. package/dist/zenith.js +7465 -19128
  26. package/package.json +21 -22
  27. package/cli/utils/content.ts +0 -112
  28. package/compiler/README.md +0 -380
  29. package/compiler/build-analyzer.ts +0 -122
  30. package/compiler/css/index.ts +0 -317
  31. package/compiler/discovery/componentDiscovery.ts +0 -178
  32. package/compiler/discovery/layouts.ts +0 -70
  33. package/compiler/errors/compilerError.ts +0 -56
  34. package/compiler/finalize/finalizeOutput.ts +0 -192
  35. package/compiler/finalize/generateFinalBundle.ts +0 -82
  36. package/compiler/index.ts +0 -83
  37. package/compiler/ir/types.ts +0 -174
  38. package/compiler/output/types.ts +0 -34
  39. package/compiler/parse/detectMapExpressions.ts +0 -102
  40. package/compiler/parse/importTypes.ts +0 -78
  41. package/compiler/parse/parseImports.ts +0 -309
  42. package/compiler/parse/parseScript.ts +0 -46
  43. package/compiler/parse/parseTemplate.ts +0 -599
  44. package/compiler/parse/parseZenFile.ts +0 -66
  45. package/compiler/parse/scriptAnalysis.ts +0 -91
  46. package/compiler/parse/trackLoopContext.ts +0 -82
  47. package/compiler/runtime/dataExposure.ts +0 -317
  48. package/compiler/runtime/generateDOM.ts +0 -246
  49. package/compiler/runtime/generateHydrationBundle.ts +0 -407
  50. package/compiler/runtime/hydration.ts +0 -309
  51. package/compiler/runtime/navigation.ts +0 -432
  52. package/compiler/runtime/thinRuntime.ts +0 -160
  53. package/compiler/runtime/transformIR.ts +0 -370
  54. package/compiler/runtime/wrapExpression.ts +0 -95
  55. package/compiler/runtime/wrapExpressionWithLoop.ts +0 -83
  56. package/compiler/spa-build.ts +0 -917
  57. package/compiler/ssg-build.ts +0 -422
  58. package/compiler/test/validate-test.ts +0 -104
  59. package/compiler/transform/classifyExpression.ts +0 -444
  60. package/compiler/transform/componentResolver.ts +0 -312
  61. package/compiler/transform/componentScriptTransformer.ts +0 -303
  62. package/compiler/transform/expressionTransformer.ts +0 -385
  63. package/compiler/transform/fragmentLowering.ts +0 -634
  64. package/compiler/transform/generateBindings.ts +0 -47
  65. package/compiler/transform/generateHTML.ts +0 -28
  66. package/compiler/transform/layoutProcessor.ts +0 -132
  67. package/compiler/transform/slotResolver.ts +0 -292
  68. package/compiler/transform/transformNode.ts +0 -126
  69. package/compiler/transform/transformTemplate.ts +0 -38
  70. package/compiler/validate/invariants.ts +0 -292
  71. package/compiler/validate/validateExpressions.ts +0 -168
  72. package/core/config/index.ts +0 -16
  73. package/core/config/loader.ts +0 -69
  74. package/core/config/types.ts +0 -89
  75. package/core/plugins/index.ts +0 -7
  76. package/core/plugins/registry.ts +0 -81
  77. package/dist/cli.js +0 -11665
  78. package/router/manifest.ts +0 -314
  79. package/router/navigation/ZenLink.zen +0 -231
  80. package/router/navigation/index.ts +0 -78
  81. package/router/navigation/zen-link.ts +0 -584
  82. package/router/runtime.ts +0 -458
  83. package/router/types.ts +0 -168
  84. package/runtime/build.ts +0 -17
  85. package/runtime/bundle-generator.ts +0 -1247
  86. package/runtime/client-runtime.ts +0 -549
  87. package/runtime/serve.ts +0 -93
@@ -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
- }