From eda41a98a67049a7775610fabdaebd51fb557c00 Mon Sep 17 00:00:00 2001 From: HoikanChen Date: Fri, 1 Dec 2023 15:16:49 +0800 Subject: [PATCH] =?UTF-8?q?[create-inula]=E6=98=8E=E7=A1=AEnode?= =?UTF-8?q?=E7=89=88=E6=9C=AC=20&=20=E9=A1=B9=E7=9B=AE=E5=90=8D=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../generators/Simple-app/templates/vite/README.md | 4 ++++ .../Simple-reactive-app/templates/vite/README.md | 4 ++++ packages/create-inula/lib/run.js | 12 +++++++++++- packages/create-inula/package.json | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 packages/create-inula/lib/generators/Simple-app/templates/vite/README.md create mode 100644 packages/create-inula/lib/generators/Simple-reactive-app/templates/vite/README.md diff --git a/packages/create-inula/lib/generators/Simple-app/templates/vite/README.md b/packages/create-inula/lib/generators/Simple-app/templates/vite/README.md new file mode 100644 index 00000000..542c363a --- /dev/null +++ b/packages/create-inula/lib/generators/Simple-app/templates/vite/README.md @@ -0,0 +1,4 @@ +# openinula + vite + +该模板提供了 `openinula` 工作在 `vite`的基础配置。 +> 请注意由于Vite插件有node版本限制,请使用`node -v`命令确认node版本大于等于node v18。 \ No newline at end of file diff --git a/packages/create-inula/lib/generators/Simple-reactive-app/templates/vite/README.md b/packages/create-inula/lib/generators/Simple-reactive-app/templates/vite/README.md new file mode 100644 index 00000000..542c363a --- /dev/null +++ b/packages/create-inula/lib/generators/Simple-reactive-app/templates/vite/README.md @@ -0,0 +1,4 @@ +# openinula + vite + +该模板提供了 `openinula` 工作在 `vite`的基础配置。 +> 请注意由于Vite插件有node版本限制,请使用`node -v`命令确认node版本大于等于node v18。 \ No newline at end of file diff --git a/packages/create-inula/lib/run.js b/packages/create-inula/lib/run.js index 15099589..268022ed 100644 --- a/packages/create-inula/lib/run.js +++ b/packages/create-inula/lib/run.js @@ -62,7 +62,17 @@ const run = async config => { } 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) { const answers = await inquirer.prompt([ { diff --git a/packages/create-inula/package.json b/packages/create-inula/package.json index c10c8de8..88eac59c 100644 --- a/packages/create-inula/package.json +++ b/packages/create-inula/package.json @@ -6,6 +6,9 @@ "bin": { "create-inula": "bin/cli.js" }, + "engines": { + "node": ">= 18.0.0" + }, "files": [ "bin", "lib",