@zenithbuild/core 1.2.2 → 1.2.3
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 +93 -73
- 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 +1 -20118
- package/dist/zen-dev.js +1 -20118
- package/dist/zen-preview.js +1 -20118
- package/dist/zenith.js +1 -20118
- package/package.json +11 -20
- 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 -242
- 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 -48
- 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 -628
- 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 -332
- package/compiler/runtime/generateDOM.ts +0 -255
- 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 -406
- package/compiler/runtime/wrapExpression.ts +0 -114
- package/compiler/runtime/wrapExpressionWithLoop.ts +0 -97
- package/compiler/spa-build.ts +0 -917
- package/compiler/ssg-build.ts +0 -486
- package/compiler/test/component-stacking.test.ts +0 -365
- package/compiler/test/map-lowering.test.ts +0 -130
- package/compiler/test/validate-test.ts +0 -104
- package/compiler/transform/classifyExpression.ts +0 -444
- package/compiler/transform/componentResolver.ts +0 -350
- package/compiler/transform/componentScriptTransformer.ts +0 -303
- package/compiler/transform/expressionTransformer.ts +0 -385
- package/compiler/transform/fragmentLowering.ts +0 -819
- package/compiler/transform/generateBindings.ts +0 -68
- 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 -314
- 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 -18
- package/core/config/loader.ts +0 -69
- package/core/config/types.ts +0 -119
- package/core/plugins/bridge.ts +0 -193
- package/core/plugins/index.ts +0 -7
- package/core/plugins/registry.ts +0 -126
- package/dist/cli.js +0 -11675
- package/runtime/build.ts +0 -17
- package/runtime/bundle-generator.ts +0 -1266
- package/runtime/client-runtime.ts +0 -891
- package/runtime/serve.ts +0 -93
package/runtime/serve.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zenith Development Server
|
|
3
|
-
*
|
|
4
|
-
* SPA-compatible server that:
|
|
5
|
-
* - Serves static assets directly (js, css, ico, images)
|
|
6
|
-
* - Serves index.html for all other routes (SPA fallback)
|
|
7
|
-
*
|
|
8
|
-
* This enables client-side routing to work on:
|
|
9
|
-
* - Direct URL entry
|
|
10
|
-
* - Hard refresh
|
|
11
|
-
* - Back/forward navigation
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { serve } from "bun"
|
|
15
|
-
import path from "path"
|
|
16
|
-
|
|
17
|
-
const distDir = path.resolve(import.meta.dir, "..", "app", "dist")
|
|
18
|
-
|
|
19
|
-
// File extensions that should be served as static assets
|
|
20
|
-
const STATIC_EXTENSIONS = new Set([
|
|
21
|
-
".js",
|
|
22
|
-
".css",
|
|
23
|
-
".ico",
|
|
24
|
-
".png",
|
|
25
|
-
".jpg",
|
|
26
|
-
".jpeg",
|
|
27
|
-
".gif",
|
|
28
|
-
".svg",
|
|
29
|
-
".webp",
|
|
30
|
-
".woff",
|
|
31
|
-
".woff2",
|
|
32
|
-
".ttf",
|
|
33
|
-
".eot",
|
|
34
|
-
".json",
|
|
35
|
-
".map"
|
|
36
|
-
])
|
|
37
|
-
|
|
38
|
-
serve({
|
|
39
|
-
port: 3000,
|
|
40
|
-
|
|
41
|
-
async fetch(req) {
|
|
42
|
-
const url = new URL(req.url)
|
|
43
|
-
const pathname = url.pathname
|
|
44
|
-
|
|
45
|
-
// Get file extension
|
|
46
|
-
const ext = path.extname(pathname).toLowerCase()
|
|
47
|
-
|
|
48
|
-
// Check if this is a static asset request
|
|
49
|
-
if (STATIC_EXTENSIONS.has(ext)) {
|
|
50
|
-
const filePath = path.join(distDir, pathname)
|
|
51
|
-
const file = Bun.file(filePath)
|
|
52
|
-
|
|
53
|
-
// Check if file exists
|
|
54
|
-
if (await file.exists()) {
|
|
55
|
-
return new Response(file)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Static file not found
|
|
59
|
-
return new Response("Not found", { status: 404 })
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// For all other routes, serve index.html (SPA fallback)
|
|
63
|
-
const indexPath = path.join(distDir, "index.html")
|
|
64
|
-
const indexFile = Bun.file(indexPath)
|
|
65
|
-
|
|
66
|
-
if (await indexFile.exists()) {
|
|
67
|
-
return new Response(indexFile, {
|
|
68
|
-
headers: {
|
|
69
|
-
"Content-Type": "text/html; charset=utf-8"
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// No index.html found - likely need to run build first
|
|
75
|
-
return new Response(
|
|
76
|
-
`<html>
|
|
77
|
-
<head><title>Zenith - Build Required</title></head>
|
|
78
|
-
<body style="font-family: system-ui; padding: 2rem; text-align: center;">
|
|
79
|
-
<h1>Build Required</h1>
|
|
80
|
-
<p>Run <code>bun runtime/build.ts</code> first to compile the pages.</p>
|
|
81
|
-
</body>
|
|
82
|
-
</html>`,
|
|
83
|
-
{
|
|
84
|
-
status: 500,
|
|
85
|
-
headers: { "Content-Type": "text/html; charset=utf-8" }
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
console.log("🚀 Zenith dev server running at http://localhost:3000")
|
|
92
|
-
console.log(" SPA mode: All routes serve index.html")
|
|
93
|
-
|