core-maugli 1.0.4 → 1.0.6

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.
Files changed (3) hide show
  1. package/README.md +5 -2
  2. package/bin/init.js +51 -3
  3. package/package.json +4 -2
package/README.md CHANGED
@@ -24,10 +24,13 @@ netlify deploy --prod
24
24
  To start a new project in an empty folder run:
25
25
 
26
26
  ```bash
27
- npx maugli-blog init my-blog
28
- cd my-blog
27
+ npx core-maugli init my-blog
28
+ cd my-blog
29
+ npm run dev
29
30
  ```
30
31
 
32
+ Your blog will be available at `http://localhost:4321/`
33
+
31
34
  1. **Install dependencies**
32
35
 
33
36
  If you created your project using the provided `init` script, the
package/bin/init.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { cpSync, existsSync } from 'fs';
3
+ import { execSync } from 'child_process';
4
+ import { cpSync, existsSync, writeFileSync } from 'fs';
4
5
  import path from 'path';
5
6
  import { fileURLToPath } from 'url';
6
- import { execSync } from 'child_process';
7
7
 
8
8
  const __filename = fileURLToPath(import.meta.url);
9
9
  const __dirname = path.dirname(__filename);
@@ -15,6 +15,12 @@ export default function init(targetName) {
15
15
  function copyItem(item) {
16
16
  const src = path.join(templateRoot, item);
17
17
  const dest = path.join(targetDir, item);
18
+
19
+ if (!existsSync(src)) {
20
+ console.log(`Skipped ${item} (not found)`);
21
+ return;
22
+ }
23
+
18
24
  cpSync(src, dest, { recursive: true });
19
25
  console.log(`Copied ${item}`);
20
26
  }
@@ -29,14 +35,56 @@ export default function init(targetName) {
29
35
  const items = [
30
36
  'astro.config.mjs',
31
37
  'tsconfig.json',
38
+ 'vite.config.js',
32
39
  'public',
33
40
  'src',
34
41
  'scripts',
35
42
  'typograf-batch.js',
36
- 'resize-all.cjs'
43
+ 'resize-all.cjs',
44
+ 'README.md',
45
+ 'LICENSE'
37
46
  ];
38
47
  items.forEach(copyItem);
39
48
 
49
+ // Create essential config files
50
+ const gitignoreContent = `
51
+ # Dependencies
52
+ node_modules/
53
+ .pnpm-debug.log*
54
+
55
+ # Environment
56
+ .env
57
+ .env.local
58
+ .env.production
59
+
60
+ # Build outputs
61
+ dist/
62
+ .astro/
63
+
64
+ # Generated files
65
+ .DS_Store
66
+ .vscode/settings.json
67
+
68
+ # Cache
69
+ .typograf-cache.json
70
+ `;
71
+
72
+ const prettierrcContent = `{
73
+ "semi": true,
74
+ "singleQuote": true,
75
+ "tabWidth": 2,
76
+ "trailingComma": "es5",
77
+ "printWidth": 100,
78
+ "plugins": ["prettier-plugin-tailwindcss"]
79
+ }
80
+ `;
81
+
82
+ writeFileSync(path.join(targetDir, '.gitignore'), gitignoreContent.trim());
83
+ console.log('Created .gitignore');
84
+
85
+ writeFileSync(path.join(targetDir, '.prettierrc'), prettierrcContent);
86
+ console.log('Created .prettierrc');
87
+
40
88
  execSync('npm install', { cwd: targetDir, stdio: 'inherit' });
41
89
  }
42
90
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "core-maugli",
3
3
  "description": "Astro & Tailwind CSS blog theme for Maugli.",
4
4
  "type": "module",
5
- "version": "1.0.4",
5
+ "version": "1.0.6",
6
6
  "license": "GPL-3.0-or-later OR Commercial",
7
7
  "repository": {
8
8
  "type": "git",
@@ -67,7 +67,9 @@
67
67
  "bin",
68
68
  "astro.config.mjs",
69
69
  "tsconfig.json",
70
- "vite.config.js"
70
+ "vite.config.js",
71
+ "LICENSE",
72
+ "README.md"
71
73
  ],
72
74
  "main": "bin/index.js",
73
75
  "bin": {