@zenithbuild/core 0.6.2 → 0.6.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/compiler/runtime/transformIR.ts +3 -3
- package/dist/cli.js +2 -0
- package/dist/zen-build.js +539 -269
- package/dist/zen-dev.js +539 -269
- package/dist/zen-preview.js +539 -269
- package/dist/zenith.js +539 -269
- package/package.json +2 -2
- package/runtime/bundle-generator.ts +26 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenithbuild/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Core library for the Zenith framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -69,4 +69,4 @@
|
|
|
69
69
|
"parse5": "^8.0.0",
|
|
70
70
|
"picocolors": "^1.1.1"
|
|
71
71
|
}
|
|
72
|
-
}
|
|
72
|
+
}
|
|
@@ -880,9 +880,7 @@ export function generateBundleJS(): string {
|
|
|
880
880
|
// SPA Router Runtime
|
|
881
881
|
// ============================================
|
|
882
882
|
|
|
883
|
-
|
|
884
|
-
'use strict';
|
|
885
|
-
|
|
883
|
+
// Router state
|
|
886
884
|
// Current route state
|
|
887
885
|
var currentRoute = {
|
|
888
886
|
path: '/',
|
|
@@ -1096,6 +1094,18 @@ export function generateBundleJS(): string {
|
|
|
1096
1094
|
return;
|
|
1097
1095
|
}
|
|
1098
1096
|
|
|
1097
|
+
// Dev mode: If no route manifest is loaded, use browser navigation
|
|
1098
|
+
// This allows ZenLink to work in dev server where pages are served fresh
|
|
1099
|
+
if (routeManifest.length === 0) {
|
|
1100
|
+
var url = normalizedPath + (Object.keys(query).length ? '?' + new URLSearchParams(query) : '');
|
|
1101
|
+
if (options.replace) {
|
|
1102
|
+
location.replace(url);
|
|
1103
|
+
} else {
|
|
1104
|
+
location.href = url;
|
|
1105
|
+
}
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1099
1109
|
resolveAndRender(path, query, true, options.replace || false);
|
|
1100
1110
|
}
|
|
1101
1111
|
|
|
@@ -1166,19 +1176,19 @@ export function generateBundleJS(): string {
|
|
|
1166
1176
|
);
|
|
1167
1177
|
}
|
|
1168
1178
|
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1179
|
+
// Expose router API globally
|
|
1180
|
+
global.__zenith_router = {
|
|
1181
|
+
navigate: navigate,
|
|
1182
|
+
getRoute: getRoute,
|
|
1183
|
+
onRouteChange: onRouteChange,
|
|
1184
|
+
isActive: isActive,
|
|
1185
|
+
prefetch: prefetch,
|
|
1186
|
+
initRouter: initRouter
|
|
1187
|
+
};
|
|
1188
|
+
|
|
1189
|
+
// Also expose navigate directly for convenience
|
|
1190
|
+
global.navigate = navigate;
|
|
1191
|
+
|
|
1182
1192
|
|
|
1183
1193
|
// ============================================
|
|
1184
1194
|
// HMR Client (Development Only)
|