@dasidev/dasi-ui 1.0.9 → 1.0.10
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/dasi-cli.cjs +25 -7
- package/package.json +1 -1
package/bin/dasi-cli.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const ora = require('ora');
|
|
|
9
9
|
program
|
|
10
10
|
.name('dasi-ui')
|
|
11
11
|
.description('DASI UI - Complete Admin Template Setup')
|
|
12
|
-
.version('1.0.
|
|
12
|
+
.version('1.0.10');
|
|
13
13
|
|
|
14
14
|
program
|
|
15
15
|
.command('create [project-name]')
|
|
@@ -92,6 +92,7 @@ program
|
|
|
92
92
|
|
|
93
93
|
try {
|
|
94
94
|
const projectPath = path.join(process.cwd(), projectName);
|
|
95
|
+
const templatePath = path.join(__dirname, '../');
|
|
95
96
|
|
|
96
97
|
if (fs.existsSync(projectPath)) {
|
|
97
98
|
spinner.fail('Project directory already exists');
|
|
@@ -100,19 +101,36 @@ program
|
|
|
100
101
|
|
|
101
102
|
spinner.text = '📁 Creating project directory...';
|
|
102
103
|
fs.mkdirSync(projectPath, { recursive: true });
|
|
104
|
+
console.log(chalk.green(`✅ Directory created: ${projectPath}`));
|
|
103
105
|
|
|
104
|
-
|
|
106
|
+
spinner.text = '📋 Copying template files...';
|
|
107
|
+
|
|
108
|
+
const templatePackageJson = path.join(templatePath, 'package.json');
|
|
109
|
+
console.log(chalk.white(` Template package.json exists: ${fs.existsSync(templatePackageJson)}`));
|
|
105
110
|
|
|
106
111
|
await fs.copy(templatePath, projectPath, {
|
|
107
112
|
filter: (src) => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
const shouldExclude = src.includes('node_modules') ||
|
|
114
|
+
src.includes('dist') ||
|
|
115
|
+
src.includes('.git') ||
|
|
116
|
+
src.includes('package-lock.json') ||
|
|
117
|
+
src.includes('yarn.lock') ||
|
|
118
|
+
src.includes('.DS_Store');
|
|
119
|
+
|
|
120
|
+
if (!shouldExclude) {
|
|
121
|
+
console.log(chalk.gray(` Copying: ${src}`));
|
|
122
|
+
}
|
|
123
|
+
return !shouldExclude;
|
|
113
124
|
}
|
|
114
125
|
});
|
|
115
126
|
|
|
127
|
+
const copiedPackageJson = path.join(projectPath, 'package.json');
|
|
128
|
+
console.log(chalk.white(` Copied package.json exists: ${fs.existsSync(copiedPackageJson)}`));
|
|
129
|
+
|
|
130
|
+
if (!fs.existsSync(copiedPackageJson)) {
|
|
131
|
+
throw new Error('Template copy failed - package.json not found');
|
|
132
|
+
}
|
|
133
|
+
|
|
116
134
|
spinner.text = '⚙️ Updating configuration...';
|
|
117
135
|
const packageJsonPath = path.join(projectPath, 'package.json');
|
|
118
136
|
let packageJson = await fs.readJson(packageJsonPath);
|