aztomiq 1.0.0 → 1.0.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.
package/README.md CHANGED
@@ -61,7 +61,7 @@ AZtomiq isn't just another static site generator. It's an **Ecosystem** designed
61
61
  **Option A: Scaffolding a new project (Recommended)**
62
62
 
63
63
  ```bash
64
- npx create-aztomiq my-awesome-app
64
+ npx aztomiq init my-awesome-app
65
65
  cd my-awesome-app
66
66
  npm install
67
67
  ```
package/bin/aztomiq.js CHANGED
@@ -270,6 +270,79 @@ meta:
270
270
 
271
271
  console.log(`āœ… Tool "${name}" created successfully!`);
272
272
  console.log(`šŸ‘‰ Edit it at: src/features/${name}`);
273
+ },
274
+ init: async () => {
275
+ const name = args[1] || 'my-aztomiq-site';
276
+ const projectPath = path.resolve(PROJECT_ROOT, name);
277
+
278
+ if (await fs.pathExists(projectPath)) {
279
+ console.error(`āŒ Directory "${name}" already exists.`);
280
+ return;
281
+ }
282
+
283
+ console.log(`šŸš€ Initializing new AZtomiq project: ${name}...`);
284
+
285
+ // 1. Create structure
286
+ const templateDirs = [
287
+ 'src/assets/css',
288
+ 'src/assets/js',
289
+ 'src/assets/images',
290
+ 'src/data',
291
+ 'src/features/hello-world/locales',
292
+ 'src/includes',
293
+ 'src/locales/en',
294
+ 'src/locales/vi',
295
+ 'src/pages',
296
+ 'src/templates'
297
+ ];
298
+
299
+ for (const dir of templateDirs) {
300
+ await fs.ensureDir(path.join(projectPath, dir));
301
+ }
302
+
303
+ // 2. Create package.json
304
+ const packageJson = {
305
+ name: name,
306
+ version: '1.0.0',
307
+ scripts: {
308
+ "dev": "aztomiq dev",
309
+ "build": "aztomiq build",
310
+ "status": "aztomiq status"
311
+ },
312
+ dependencies: {
313
+ "aztomiq": "latest"
314
+ }
315
+ };
316
+ await fs.writeJson(path.join(projectPath, 'package.json'), packageJson, { spaces: 2 });
317
+
318
+ // 3. Create global.yaml
319
+ const globalYaml = `site:
320
+ title: "${name}"
321
+ description: "Built with AZtomiq"
322
+ build:
323
+ locales: ["en", "vi"]
324
+ default_locale: "en"
325
+ `;
326
+ await fs.writeFile(path.join(projectPath, 'src/data/global.yaml'), globalYaml);
327
+
328
+ // 4. Create sample tool
329
+ const toolYaml = `id: hello-world
330
+ category: general
331
+ icon: smile
332
+ status: active
333
+ `;
334
+ await fs.writeFile(path.join(projectPath, 'src/features/hello-world/tool.yaml'), toolYaml);
335
+
336
+ const toolEjs = `<h1>Hello World</h1>
337
+ <p>Welcome to your new AZtomiq site!</p>
338
+ `;
339
+ await fs.writeFile(path.join(projectPath, 'src/features/hello-world/index.ejs'), toolEjs);
340
+
341
+ console.log(`\nāœ… Project "${name}" initialized successfully!`);
342
+ console.log(`šŸ‘‰ Next steps:`);
343
+ console.log(` cd ${name}`);
344
+ console.log(` npm install`);
345
+ console.log(` npm run dev`);
273
346
  }
274
347
  };
275
348
 
@@ -284,6 +357,7 @@ Commands:
284
357
  aztomiq dev Start development server (Watcher + Node)
285
358
  aztomiq build Build for production (--force, --obfuscate)
286
359
  aztomiq deploy Deploy to public distribution repository
360
+ aztomiq init <name> Initialize a new AZtomiq project
287
361
  aztomiq status Scan ecosystem health (Locales, Tests, Config)
288
362
  aztomiq analyze Analyze tool payloads and ecosystem size
289
363
  aztomiq cleanup Remove build artifacts (--drafts to delete draft tools)
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "aztomiq",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "AZtomiq - A comprehensive A-Z multi-tool framework with atomic architecture",
5
5
  "main": "scripts/build.js",
6
6
  "bin": {
7
- "aztomiq": "bin/aztomiq.js",
8
- "create-aztomiq": "bin/create-aztomiq.js"
7
+ "aztomiq": "bin/aztomiq.js"
9
8
  },
10
9
  "files": [
11
10
  "bin",
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs-extra');
4
- const path = require('path');
5
- const { execSync } = require('child_process');
6
-
7
- const projectName = process.argv[2] || 'my-aztomiq-site';
8
- const projectPath = path.resolve(process.cwd(), projectName);
9
-
10
- if (fs.existsSync(projectPath)) {
11
- console.error(`āŒ Directory "${projectName}" already exists.`);
12
- process.exit(1);
13
- }
14
-
15
- console.log(`šŸš€ Creating a new AZtomiq project: ${projectName}...`);
16
-
17
- // 1. Create project folder
18
- fs.ensureDirSync(projectPath);
19
-
20
- // 2. Define Template Structure (Minimal)
21
- const templateDirs = [
22
- 'src/assets/css',
23
- 'src/assets/js',
24
- 'src/assets/images',
25
- 'src/data',
26
- 'src/features/hello-world/locales',
27
- 'src/includes',
28
- 'src/locales/en',
29
- 'src/locales/vi',
30
- 'src/pages',
31
- 'src/templates'
32
- ];
33
-
34
- templateDirs.forEach(dir => fs.ensureDirSync(path.join(projectPath, dir)));
35
-
36
- // 3. Create Basic Files
37
- const packageJson = {
38
- name: projectName,
39
- version: '1.0.0',
40
- scripts: {
41
- "dev": "aztomiq dev",
42
- "build": "aztomiq build",
43
- "status": "aztomiq status"
44
- },
45
- dependencies: {
46
- "@aztomiq/core": "latest"
47
- }
48
- };
49
- fs.writeJsonSync(path.join(projectPath, 'package.json'), packageJson, { spaces: 2 });
50
-
51
- const globalYaml = `site:
52
- title: "${projectName}"
53
- description: "Built with AZtomiq"
54
- build:
55
- locales: ["en", "vi"]
56
- default_locale: "en"
57
- `;
58
- fs.writeFileSync(path.join(projectPath, 'src/data/global.yaml'), globalYaml);
59
-
60
- // 4. Create a Sample Tool
61
- const toolYaml = `id: hello-world
62
- category: general
63
- icon: smile
64
- status: active
65
- `;
66
- fs.writeFileSync(path.join(projectPath, 'src/features/hello-world/tool.yaml'), toolYaml);
67
-
68
- const toolEjs = `<h1>Hello World</h1>
69
- <p>Welcome to your new AZtomiq site!</p>
70
- `;
71
- fs.writeFileSync(path.join(projectPath, 'src/features/hello-world/index.ejs'), toolEjs);
72
-
73
- console.log(`\nāœ… Project "${projectName}" initialized successfully!`);
74
- console.log(`šŸ‘‰ Next steps:`);
75
- console.log(` cd ${projectName}`);
76
- console.log(` npm install`);
77
- console.log(` npm run dev`);