core-maugli 1.0.5 → 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.
package/bin/init.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { execSync } from 'child_process';
4
- import { cpSync, existsSync } from 'fs';
4
+ import { cpSync, existsSync, writeFileSync } from 'fs';
5
5
  import path from 'path';
6
6
  import { fileURLToPath } from 'url';
7
7
 
@@ -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
  }
@@ -36,12 +42,49 @@ export default function init(targetName) {
36
42
  'typograf-batch.js',
37
43
  'resize-all.cjs',
38
44
  'README.md',
39
- 'LICENSE',
40
- '.gitignore',
41
- '.prettierrc'
45
+ 'LICENSE'
42
46
  ];
43
47
  items.forEach(copyItem);
44
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
+
45
88
  execSync('npm install', { cwd: targetDir, stdio: 'inherit' });
46
89
  }
47
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.5",
5
+ "version": "1.0.6",
6
6
  "license": "GPL-3.0-or-later OR Commercial",
7
7
  "repository": {
8
8
  "type": "git",
@@ -69,9 +69,7 @@
69
69
  "tsconfig.json",
70
70
  "vite.config.js",
71
71
  "LICENSE",
72
- "README.md",
73
- ".gitignore",
74
- ".prettierrc"
72
+ "README.md"
75
73
  ],
76
74
  "main": "bin/index.js",
77
75
  "bin": {
package/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- # build output
2
- dist/
3
- # generated types
4
- .astro/
5
-
6
- # dependencies
7
- node_modules/
8
-
9
- # logs
10
- npm-debug.log*
11
- yarn-debug.log*
12
- yarn-error.log*
13
- pnpm-debug.log*
14
-
15
-
16
- # environment variables
17
- .env
18
- .env.production
19
-
20
- # macOS-specific files
21
- .DS_Store
package/.prettierrc DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "printWidth": 160,
3
- "singleQuote": true,
4
- "trailingComma": "none",
5
- "tabWidth": 4,
6
- "overrides": [
7
- {
8
- "files": ["*.md", "*.mdx", "*.yaml"],
9
- "options": {
10
- "tabWidth": 2
11
- }
12
- }
13
- ]
14
- }