[create-inula]<fix>明确node版本 & 项目名优化

This commit is contained in:
HoikanChen 2023-12-01 15:16:49 +08:00
parent a582641879
commit eda41a98a6
4 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,4 @@
# openinula + vite
该模板提供了 `openinula` 工作在 `vite`的基础配置。
> 请注意由于Vite插件有node版本限制请使用`node -v`命令确认node版本大于等于node v18。

View File

@ -0,0 +1,4 @@
# openinula + vite
该模板提供了 `openinula` 工作在 `vite`的基础配置。
> 请注意由于Vite插件有node版本限制请使用`node -v`命令确认node版本大于等于node v18。

View File

@ -62,7 +62,17 @@ const run = async config => {
} }
process.emit('message', { type: 'prompt' }); process.emit('message', { type: 'prompt' });
let { type } = config; let { type, name } = config;
if (!name) {
const answers = await inquirer.prompt([
{
name: 'projectName',
message: 'Project name',
type: 'input'
},
]);
config.name = answers.projectName;
}
if (!type) { if (!type) {
const answers = await inquirer.prompt([ const answers = await inquirer.prompt([
{ {

View File

@ -6,6 +6,9 @@
"bin": { "bin": {
"create-inula": "bin/cli.js" "create-inula": "bin/cli.js"
}, },
"engines": {
"node": ">= 18.0.0"
},
"files": [ "files": [
"bin", "bin",
"lib", "lib",