create-aziz-app 3.1.0 β†’ 3.1.2

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.
@@ -12,8 +12,6 @@
12
12
  // -y, --yes Accept all defaults (no prompts)
13
13
  // --port <n> Dev-server port (default 3000)
14
14
  // --css <name> none | bootstrap | tailwind
15
- // --no-examples Skip the example Test page
16
- // --no-api Skip example API routes
17
15
  // --no-docs Skip the docs/ folder
18
16
  // -h, --help Show help
19
17
  // ============================================================
@@ -34,8 +32,6 @@ function parseArgs(argv) {
34
32
  yes: false,
35
33
  port: null,
36
34
  css: null,
37
- examples: null,
38
- api: null,
39
35
  docs: null,
40
36
  help: false,
41
37
  };
@@ -49,8 +45,6 @@ function parseArgs(argv) {
49
45
  case '--yes': opts.yes = true; break;
50
46
  case '--port': opts.port = argv[++i]; break;
51
47
  case '--css': opts.css = argv[++i]; break;
52
- case '--no-examples': opts.examples = false; break;
53
- case '--no-api': opts.api = false; break;
54
48
  case '--no-docs': opts.docs = false; break;
55
49
  default:
56
50
  if (!arg.startsWith('-') && !opts.projectName) opts.projectName = arg;
@@ -70,8 +64,6 @@ Options:
70
64
  -y, --yes Accept all defaults (skip prompts)
71
65
  --port <n> Dev-server port (default 3000)
72
66
  --css <name> none | bootstrap | tailwind
73
- --no-examples Skip the example Test page
74
- --no-api Skip example API routes
75
67
  --no-docs Skip the docs/ folder
76
68
  -h, --help Show this help
77
69
 
@@ -94,7 +86,6 @@ function copyDir(src, dest, features) {
94
86
  for (const entry of fs.readdirSync(src)) {
95
87
  const srcPath = path.join(src, entry);
96
88
  const destPath = path.join(dest, entry);
97
- const rel = dest; // not needed; handled below
98
89
 
99
90
  if (shouldSkip(entry)) continue;
100
91
 
@@ -111,17 +102,6 @@ function copyDir(src, dest, features) {
111
102
  }
112
103
  }
113
104
 
114
- function removeDirIfExists(dir) {
115
- if (fs.existsSync(dir)) fs.rmSync(dir, { recursive: true, force: true });
116
- }
117
-
118
- function emptyDirContents(dir) {
119
- if (!fs.existsSync(dir)) return;
120
- for (const entry of fs.readdirSync(dir)) {
121
- fs.rmSync(path.join(dir, entry), { recursive: true, force: true });
122
- }
123
- }
124
-
125
105
  function updatePackageJson(targetDir, projectName) {
126
106
  const pkgPath = path.join(targetDir, 'package.json');
127
107
  if (!fs.existsSync(pkgPath)) return;
@@ -198,7 +178,7 @@ async function main() {
198
178
  }
199
179
 
200
180
  console.log(`\n⚑ Welcome to Aziz.js!\n`);
201
- console.log(`🎨 A lightweight Next.js clone β€” file-based routing, React hooks, API routes\n`);
181
+ console.log(`🎨 A lightweight Next.js clone β€” file-based routing, React hooks, live reload\n`);
202
182
 
203
183
  let projectName = opts.projectName;
204
184
  if (!projectName) {
@@ -236,26 +216,12 @@ async function main() {
236
216
  }
237
217
 
238
218
  // ── Features
239
- let examples = opts.examples;
240
- let apiExamples = opts.api;
241
219
  let docs = opts.docs;
242
220
 
243
- if (!opts.yes) {
244
- if (examples === null) {
245
- const a = await question(' Include example pages? (Y/n): ');
246
- examples = !['n', 'no'].includes(a.trim().toLowerCase());
247
- }
248
- if (apiExamples === null) {
249
- const a = await question(' Include example API routes? (Y/n): ');
250
- apiExamples = !['n', 'no'].includes(a.trim().toLowerCase());
251
- }
252
- if (docs === null) {
253
- const a = await question(' Include documentation? (Y/n): ');
254
- docs = !['n', 'no'].includes(a.trim().toLowerCase());
255
- }
221
+ if (!opts.yes && docs === null) {
222
+ const a = await question(' Include documentation? (Y/n): ');
223
+ docs = !['n', 'no'].includes(a.trim().toLowerCase());
256
224
  }
257
- if (examples === null) examples = true;
258
- if (apiExamples === null) apiExamples = true;
259
225
  if (docs === null) docs = true;
260
226
 
261
227
  // ── CSS framework
@@ -270,7 +236,7 @@ async function main() {
270
236
  }
271
237
  if (!['none', 'bootstrap', 'tailwind'].includes(css)) css = 'none';
272
238
 
273
- const features = { examples, api: apiExamples, docs, css };
239
+ const features = { docs, css };
274
240
 
275
241
  console.log(`\n⚑ Creating "${projectName}"...\n`);
276
242
 
@@ -284,22 +250,13 @@ async function main() {
284
250
  // 1. Copy the template (excluding node_modules)
285
251
  copyDir(templateDir, targetDir, features);
286
252
 
287
- // 2. Optional features
288
- if (!features.examples) {
289
- removeDirIfExists(path.join(targetDir, 'app', 'test'));
290
- }
291
- if (!features.api) {
292
- emptyDirContents(path.join(targetDir, 'api'));
293
- fs.mkdirSync(path.join(targetDir, 'api'), { recursive: true });
294
- }
295
-
296
- // 3. Personalize
253
+ // 2. Personalize
297
254
  updatePackageJson(targetDir, projectName);
298
255
  updateDevServerPort(targetDir, port);
299
256
  updateTitle(targetDir, projectName);
300
257
  setupCSSFramework(targetDir, features.css);
301
258
 
302
- // 4. .gitignore
259
+ // 3. .gitignore
303
260
  fs.writeFileSync(path.join(targetDir, '.gitignore'), [
304
261
  'node_modules/',
305
262
  '.DS_Store',
@@ -320,11 +277,8 @@ async function main() {
320
277
  console.log(` app/ ← pages + layouts (file-based routing)`);
321
278
  console.log(` layout.js ← root layout`);
322
279
  console.log(` page.js ← route: /`);
323
- console.log(` not-found.js ← custom 404`);
324
- console.log(` api/ ← server-side API route handlers`);
325
- console.log(` components/ ← shared UI components`);
326
- console.log(` lib/ models/ ← helpers + data models`);
327
- console.log(` _framework/ ← runtime, hooks, router, api client`);
280
+ console.log(` styles/ ← global CSS`);
281
+ console.log(` _framework/ ← runtime, hooks, router`);
328
282
  console.log(` scripts/ ← dev server + live reload`);
329
283
  if (features.docs) console.log(` docs/ ← full documentation`);
330
284
  console.log(`\n✨ Highlights:\n`);
@@ -332,12 +286,9 @@ async function main() {
332
286
  console.log(` β€’ Dynamic routes app/blog/[slug]/page.js β†’ /blog/:slug`);
333
287
  console.log(` β€’ Nested layouts app/**/layout.js`);
334
288
  console.log(` β€’ React hooks useState, useEffect, useMemo, context…`);
335
- console.log(` β€’ API route handlers api/*.js and app/api/**/route.js`);
336
- console.log(` β€’ API client api.get('/api/users') β€” retries + timeouts`);
337
289
  console.log(` β€’ Live reload instant browser refresh on save`);
338
290
  console.log(`\nπŸ’‘ Tips:\n`);
339
291
  console.log(` β€’ Create app/MyPage/page.js β†’ route /MyPage`);
340
- console.log(` β€’ Create api/todos.js β†’ route /api/todos`);
341
292
  if (features.docs) console.log(` β€’ Read docs/README.md for the full guide`);
342
293
  console.log(`\nπŸš€ Happy building!\n`);
343
294
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-aziz-app",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
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",