wyt-cli 1.0.19 → 1.0.20
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/commands/create.js +10 -3
- package/package.json +1 -1
package/bin/commands/create.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// commands/create.js
|
|
2
2
|
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import { log_error,
|
|
4
|
+
import { log_error, getInquirerOperationText } from '../lib/logger.js';
|
|
5
5
|
|
|
6
6
|
// 外部依赖
|
|
7
7
|
import { Command } from 'commander';
|
|
@@ -10,6 +10,7 @@ import { glob } from 'glob';
|
|
|
10
10
|
import fs from 'fs-extra';
|
|
11
11
|
// import ora from 'ora';
|
|
12
12
|
import inquirer from 'inquirer';
|
|
13
|
+
import chalk from 'chalk';
|
|
13
14
|
import ejs from 'ejs';
|
|
14
15
|
import { checkTargetDir, getModuleMenuConfig, getProjectConfig } from '../lib/dir.js';
|
|
15
16
|
|
|
@@ -66,8 +67,14 @@ async function createProjectAction(projectName, options) {
|
|
|
66
67
|
|
|
67
68
|
// 创建项目模版
|
|
68
69
|
await createProject(projectName, options);
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
console.log(
|
|
71
|
+
`\n\n✅ ${chalk.bgGreen.black(' 项目创建成功 ')} ${chalk.greenBright(projectName)}\n\n` +
|
|
72
|
+
`${chalk.cyan.bold('━━━━ 运行步骤 ━━━━')}\n` +
|
|
73
|
+
`${chalk.blue('1. 安装依赖')} ${chalk.yellow('pnpm install')}\n` +
|
|
74
|
+
`${chalk.blue('2. 启动开发服务器')} ${chalk.yellow('wyt-cli run')}\n\n` +
|
|
75
|
+
`${chalk.hex('#FFA500').bold('💡 注意事项:')}\n` +
|
|
76
|
+
`• 确保本地 ${chalk.yellow('Node.js >= 16.0 && pnpm 7.x+')} 版本\n` +
|
|
77
|
+
`• 建议使用 ${chalk.yellow('wyt-cli')} 命令行工具\n`
|
|
71
78
|
);
|
|
72
79
|
} catch (error) {
|
|
73
80
|
log_error(error.message);
|