create-aziz-app 3.0.5 → 3.0.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-aziz-app",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "description": "Create Aziz.js apps — lightweight Next.js clone with file-based routing, React hooks, and API routes",
5
5
  "keywords": [
6
6
  "aziz.js",
@@ -25,8 +25,6 @@
25
25
  "create-aziz-app": "bin/create-aziz-app.js"
26
26
  },
27
27
  "scripts": {
28
- "preversion": "git add -A && (git diff --cached --quiet || git commit -m \"chore: pre-release changes\")",
29
- "version": "git add -A",
30
28
  "postversion": "git push && git push --tags",
31
29
  "dev": "cd template && node scripts/dev-server.js"
32
30
  }
@@ -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,9 +212,7 @@ export const router = {
208
212
 
209
213
  // Find matching route
210
214
  const match = resolveRoute(pathname);
211
-
212
- // Find matching route
213
- const match = resolveRoute(pathname);
215
+ console.log(`🔍 resolveRoute('${pathname}'):`, match);
214
216
 
215
217
  if (!match) {
216
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
- // Dynamic route: [slug] → :slug
66
- const segment = entry.name.startsWith('[') && entry.name.endsWith(']')
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
- manifest.push({
72
- type: 'page',
73
- pathname: routeBase || '/',
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
- manifest.push({
78
- type: 'layout',
79
- pathname: routeBase || '/',
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
  }