create-aziz-app 3.0.3 → 3.0.4

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.3",
3
+ "version": "3.0.4",
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,6 +25,9 @@
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
+ "postversion": "git push && git push --tags",
28
31
  "dev": "cd template && node scripts/dev-server.js"
29
32
  }
30
33
  }
@@ -180,11 +180,9 @@ export const router = {
180
180
 
181
181
  async loadRoutes() {
182
182
  try {
183
- // Dev server exposes the route manifest
184
183
  const res = await fetch('/_framework/routes.json');
185
184
  const manifest = await res.json();
186
185
 
187
- // Dynamically import each page and layout
188
186
  for (const { pathname, filePath, type } of manifest) {
189
187
  try {
190
188
  const mod = await import(filePath + '?t=' + Date.now());
@@ -194,11 +192,11 @@ export const router = {
194
192
  this.registerLayout(pathname, mod);
195
193
  }
196
194
  } catch (err) {
197
- console.error(`Failed to load ${filePath}:`, err);
195
+ console.error(`❌ Failed to load ${filePath}:`, err);
198
196
  }
199
197
  }
200
198
 
201
- console.log(`📄 Loaded ${Object.keys(routes).length} routes`);
199
+ console.log(`📄 Loaded routes: ${Object.keys(routes).join(', ')}`);
202
200
  } catch (err) {
203
201
  console.error('Failed to load routes:', err);
204
202
  }
@@ -211,6 +209,9 @@ export const router = {
211
209
  // Find matching route
212
210
  const match = resolveRoute(pathname);
213
211
 
212
+ // Find matching route
213
+ const match = resolveRoute(pathname);
214
+
214
215
  if (!match) {
215
216
  root.innerHTML = '';
216
217
  const notFound = h('div', { style: { padding: '40px', textAlign: 'center' } },
@@ -1,6 +1,5 @@
1
1
  /** @jsx h */
2
2
  import { h } from '/_framework/runtime.js';
3
- import { navigate } from '/_framework/router.js';
4
3
 
5
4
  // About page — route: /about
6
5
  export default function Page() {
@@ -2,7 +2,6 @@
2
2
  import { h } from '/_framework/runtime.js';
3
3
  import Navbar from '/components/Navbar.js';
4
4
  import Footer from '/components/Footer.js';
5
-
6
5
  // Root layout — wraps every page (like Next.js app/layout.js)
7
6
  export default function Layout({ children }) {
8
7
  return (
@@ -1,6 +1,5 @@
1
1
  /** @jsx h */
2
2
  import { h } from '/_framework/runtime.js';
3
- import { navigate } from '/_framework/router.js';
4
3
 
5
4
  // Home page — route: /
6
5
  export default function Page() {
@@ -1,16 +1,15 @@
1
1
  /** @jsx h */
2
2
  import { h } from '/_framework/runtime.js';
3
- import { navigate, useRouter } from '/_framework/router.js';
4
3
 
4
+ // navigate and useRouter are globals set by boot.js
5
5
  export default function Navbar() {
6
6
  const { pathname } = useRouter();
7
7
 
8
8
  const links = [
9
- { href: '/', label: 'Home' },
10
- { href: '/about', label: 'About' },
11
- { href: '/test', label: 'Test' },
12
- { href: '/api-demo', label: 'API Demo' },
13
- { href: '/contact', label: 'Contact' },
9
+ { href: '/', label: 'Home' },
10
+ { href: '/about', label: 'About' },
11
+ { href: '/test', label: 'Test' },
12
+ { href: '/contact', label: 'Contact' },
14
13
  ];
15
14
 
16
15
  return (