create-aziz-app 3.0.6 → 3.0.8
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/package.json
CHANGED
|
@@ -183,13 +183,17 @@ export const router = {
|
|
|
183
183
|
const res = await fetch('/_framework/routes.json');
|
|
184
184
|
const manifest = await res.json();
|
|
185
185
|
|
|
186
|
+
console.log('📋 Route manifest:', manifest);
|
|
187
|
+
|
|
186
188
|
for (const { pathname, filePath, type } of manifest) {
|
|
187
189
|
try {
|
|
188
190
|
const mod = await import(filePath + '?t=' + Date.now());
|
|
189
191
|
if (type === 'page') {
|
|
190
192
|
this.register(pathname, mod);
|
|
193
|
+
console.log(`✅ Registered page: ${pathname} → ${filePath}`);
|
|
191
194
|
} else if (type === 'layout') {
|
|
192
195
|
this.registerLayout(pathname, mod);
|
|
196
|
+
console.log(`✅ Registered layout: ${pathname} → ${filePath}`);
|
|
193
197
|
}
|
|
194
198
|
} catch (err) {
|
|
195
199
|
console.error(`❌ Failed to load ${filePath}:`, err);
|
|
@@ -208,6 +212,7 @@ export const router = {
|
|
|
208
212
|
|
|
209
213
|
// Find matching route
|
|
210
214
|
const match = resolveRoute(pathname);
|
|
215
|
+
console.log(`🔍 resolveRoute('${pathname}'):`, match);
|
|
211
216
|
|
|
212
217
|
if (!match) {
|
|
213
218
|
root.innerHTML = '';
|
|
@@ -62,23 +62,17 @@ function buildRouteManifest() {
|
|
|
62
62
|
const fullPath = path.join(dir, entry.name);
|
|
63
63
|
|
|
64
64
|
if (entry.isDirectory()) {
|
|
65
|
-
//
|
|
66
|
-
const segment = entry.name
|
|
67
|
-
? ':' + entry.name.slice(1, -1)
|
|
68
|
-
: entry.name;
|
|
65
|
+
// Keep [slug] as-is — router.js matchRoute expects square bracket syntax
|
|
66
|
+
const segment = entry.name;
|
|
69
67
|
scan(fullPath, routeBase === '/' ? '/' + segment : routeBase + '/' + segment);
|
|
70
68
|
} else if (entry.name === 'page.js' || entry.name === 'page.jsx') {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
filePath: '/app' + (routeBase === '/' ? '' : routeBase) + '/' + entry.name
|
|
75
|
-
});
|
|
69
|
+
const pathname = routeBase || '/';
|
|
70
|
+
const filePath = '/app' + (pathname === '/' ? '' : pathname) + '/' + entry.name;
|
|
71
|
+
manifest.push({ type: 'page', pathname, filePath });
|
|
76
72
|
} else if (entry.name === 'layout.js' || entry.name === 'layout.jsx') {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
filePath: '/app' + (routeBase === '/' ? '' : routeBase) + '/' + entry.name
|
|
81
|
-
});
|
|
73
|
+
const pathname = routeBase || '/';
|
|
74
|
+
const filePath = '/app' + (pathname === '/' ? '' : pathname) + '/' + entry.name;
|
|
75
|
+
manifest.push({ type: 'layout', pathname, filePath });
|
|
82
76
|
}
|
|
83
77
|
}
|
|
84
78
|
}
|