create-coralite 1.0.0-rc.2 → 1.0.0-rc.3
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/index.js +1 -1
- package/lib/utils.js +6 -2
- package/package.json +3 -2
- package/templates/css/package.json +2 -1
- package/templates/scss/package.json +2 -1
package/bin/index.js
CHANGED
|
@@ -89,7 +89,7 @@ async function createProject () {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// handle directory if exist and not empty
|
|
92
|
-
if (existsSync(target) && isEmpty(target)) {
|
|
92
|
+
if (existsSync(target) && !isEmpty(target)) {
|
|
93
93
|
let message = `Target directory "${target}"`
|
|
94
94
|
|
|
95
95
|
if (target === '.') {
|
package/lib/utils.js
CHANGED
|
@@ -86,8 +86,12 @@ export function copyDir (srcDir, destDir) {
|
|
|
86
86
|
* @returns {boolean} True if the directory is empty or contains only a .git directory
|
|
87
87
|
*/
|
|
88
88
|
export function isEmpty (path) {
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
try {
|
|
90
|
+
const files = readdirSync(path)
|
|
91
|
+
return files.length === 0 || (files.length === 1 && files[0] === '.git')
|
|
92
|
+
} catch {
|
|
93
|
+
return true
|
|
94
|
+
}
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-coralite",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
4
|
"description": "Coralite scaffolding script",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-coralite": "bin/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"license": "MPL-2.0",
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": ">=
|
|
37
|
+
"node": ">=22.22.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@clack/prompts": "^0.11.0",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@playwright/test": "^1.61.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
|
+
"test:unit": "node --test tests/unit/**/*.spec.js",
|
|
48
49
|
"test:e2e": "playwright test"
|
|
49
50
|
}
|
|
50
51
|
}
|