odac 1.0.0 → 1.0.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ### šŸ› ļø Fixes & Improvements
2
+
3
+ - Simplify project initialization by removing directory emptiness validation and extraneous comments.
4
+
5
+
6
+
7
+ ---
8
+
9
+ Powered by [⚔ ODAC](https://odac.run)
10
+
1
11
  ### Framework
2
12
 
3
13
  - HTML Email
package/bin/odac.js CHANGED
@@ -20,31 +20,14 @@ async function run() {
20
20
  const projectName = args[0] || '.'
21
21
  const targetDir = path.resolve(process.cwd(), projectName)
22
22
 
23
- // 1. Validate Target Directory
24
- if (fs.existsSync(targetDir)) {
25
- const files = fs.readdirSync(targetDir)
26
- const isNotEmpty = files.some(file =>
27
- !['.git', '.DS_Store', '.gitignore', '.idea', '.vscode'].includes(file)
28
- )
29
-
30
- if (isNotEmpty) {
31
- console.error(`āŒ Error: Directory "${projectName === '.' ? 'Current directory' : projectName}" is not empty.`)
32
- console.error(' Please run in an empty directory or specify a new project name.')
33
- process.exit(1)
34
- }
35
- } else {
36
- fs.mkdirSync(targetDir, { recursive: true })
37
- }
23
+ if (!fs.existsSync(targetDir)) fs.mkdirSync(targetDir, { recursive: true })
38
24
 
39
- // 4. Copy Template
40
25
  console.log(`šŸš€ Initializing new Odac project in: ${targetDir}`)
41
26
  const templateDir = path.resolve(__dirname, '../template')
42
27
 
43
28
  try {
44
- // Recursive copy
45
29
  fs.cpSync(templateDir, targetDir, { recursive: true })
46
30
 
47
- // Update package.json
48
31
  const pkgPath = path.join(targetDir, 'package.json')
49
32
  const frameworkPkg = require('../package.json')
50
33
 
@@ -52,7 +35,6 @@ async function run() {
52
35
  pkg.name = projectName === '.' ? path.basename(targetDir) : projectName
53
36
  pkg.version = '0.0.1'
54
37
 
55
- // Inject framework dependency
56
38
  if (!pkg.dependencies) pkg.dependencies = {}
57
39
  pkg.dependencies[frameworkPkg.name] = `^${frameworkPkg.version}`
58
40
 
@@ -78,7 +60,6 @@ async function run() {
78
60
  cwd: targetDir
79
61
  })
80
62
  } catch (err) {
81
- // User probably cancelled with Ctrl+C
82
63
  console.log('\nšŸ‘‹ Server stopped.')
83
64
  }
84
65
 
@@ -87,7 +68,6 @@ async function run() {
87
68
  }
88
69
 
89
70
  } else if (command === 'dev') {
90
- // Start the framework
91
71
  require('../index.js')
92
72
  } else {
93
73
  console.log('Usage:')
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "email": "mail@emre.red",
8
8
  "url": "https://emre.red"
9
9
  },
10
- "version": "1.0.0",
10
+ "version": "1.0.1",
11
11
  "license": "MIT",
12
12
  "engines": {
13
13
  "node": ">=18.0.0"