Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit ec431e8

Browse files
authored
feat: prompt for git (#596)
1 parent 1cc5e50 commit ec431e8

File tree

4 files changed

+221
-1
lines changed

4 files changed

+221
-1
lines changed

packages/create-nuxt-app/lib/prompts.js

+10
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,15 @@ module.exports = [
112112
{ name: 'Semantic Pull Requests', value: 'semantic-pull-requests' }
113113
],
114114
default: []
115+
},
116+
{
117+
name: 'vcs',
118+
message: 'Version control system:',
119+
type: 'list',
120+
choices: [
121+
{ name: 'Git', value: 'git' },
122+
{ name: 'None', value: 'none' }
123+
],
124+
default: 'git'
115125
}
116126
]

packages/create-nuxt-app/lib/saofile.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ module.exports = {
125125
return actions
126126
},
127127
async completed () {
128-
this.gitInit()
128+
if (this.answers.vcs === 'git') {
129+
this.gitInit()
130+
}
129131

130132
await this.npmInstall({ npmClient: this.answers.pm })
131133

packages/create-nuxt-app/test/snapshots/index.test.js.md

+208
Original file line numberDiff line numberDiff line change
@@ -4202,3 +4202,211 @@ Generated by [AVA](https://avajs.dev).
42024202
}␊
42034203
}␊
42044204
`
4205+
4206+
## verify vcs: Git
4207+
4208+
> Generated files
4209+
4210+
[
4211+
'.editorconfig',
4212+
'.gitignore',
4213+
'README.md',
4214+
'assets/README.md',
4215+
'components/Logo.vue',
4216+
'components/README.md',
4217+
'layouts/README.md',
4218+
'layouts/default.vue',
4219+
'middleware/README.md',
4220+
'nuxt.config.js',
4221+
'package.json',
4222+
'pages/README.md',
4223+
'pages/index.vue',
4224+
'plugins/README.md',
4225+
'static/README.md',
4226+
'static/favicon.ico',
4227+
'store/README.md',
4228+
]
4229+
4230+
> package.json
4231+
4232+
{
4233+
dependencies: {
4234+
nuxt: '^2.14.0',
4235+
},
4236+
devDependencies: {},
4237+
private: true,
4238+
scripts: {
4239+
build: 'nuxt build',
4240+
dev: 'nuxt',
4241+
generate: 'nuxt generate',
4242+
start: 'nuxt start',
4243+
},
4244+
}
4245+
4246+
> Generated nuxt.config.js
4247+
4248+
`␊
4249+
export default {␊
4250+
/*␊
4251+
** Nuxt rendering mode␊
4252+
** See https://nuxtjs.org/api/configuration-mode␊
4253+
*/␊
4254+
mode: 'universal',␊
4255+
/*␊
4256+
** Nuxt target␊
4257+
** See https://nuxtjs.org/api/configuration-target␊
4258+
*/␊
4259+
target: 'server',␊
4260+
/*␊
4261+
** Headers of the page␊
4262+
** See https://nuxtjs.org/api/configuration-head␊
4263+
*/␊
4264+
head: {␊
4265+
title: process.env.npm_package_name || '',␊
4266+
meta: [␊
4267+
{ charset: 'utf-8' },␊
4268+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },␊
4269+
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '' }␊
4270+
],␊
4271+
link: [␊
4272+
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }␊
4273+
]␊
4274+
},␊
4275+
/*␊
4276+
** Global CSS␊
4277+
*/␊
4278+
css: [␊
4279+
],␊
4280+
/*␊
4281+
** Plugins to load before mounting the App␊
4282+
** https://nuxtjs.org/guide/plugins␊
4283+
*/␊
4284+
plugins: [␊
4285+
],␊
4286+
/*␊
4287+
** Auto import components␊
4288+
** See https://nuxtjs.org/api/configuration-components␊
4289+
*/␊
4290+
components: true,␊
4291+
/*␊
4292+
** Nuxt.js dev-modules␊
4293+
*/␊
4294+
buildModules: [␊
4295+
],␊
4296+
/*␊
4297+
** Nuxt.js modules␊
4298+
*/␊
4299+
modules: [␊
4300+
],␊
4301+
/*␊
4302+
** Build configuration␊
4303+
** See https://nuxtjs.org/api/configuration-build/␊
4304+
*/␊
4305+
build: {␊
4306+
}␊
4307+
}␊
4308+
`
4309+
4310+
## verify vcs: None
4311+
4312+
> Generated files
4313+
4314+
[
4315+
'.editorconfig',
4316+
'.gitignore',
4317+
'README.md',
4318+
'assets/README.md',
4319+
'components/Logo.vue',
4320+
'components/README.md',
4321+
'layouts/README.md',
4322+
'layouts/default.vue',
4323+
'middleware/README.md',
4324+
'nuxt.config.js',
4325+
'package.json',
4326+
'pages/README.md',
4327+
'pages/index.vue',
4328+
'plugins/README.md',
4329+
'static/README.md',
4330+
'static/favicon.ico',
4331+
'store/README.md',
4332+
]
4333+
4334+
> package.json
4335+
4336+
{
4337+
dependencies: {
4338+
nuxt: '^2.14.0',
4339+
},
4340+
devDependencies: {},
4341+
private: true,
4342+
scripts: {
4343+
build: 'nuxt build',
4344+
dev: 'nuxt',
4345+
generate: 'nuxt generate',
4346+
start: 'nuxt start',
4347+
},
4348+
}
4349+
4350+
> Generated nuxt.config.js
4351+
4352+
`␊
4353+
export default {␊
4354+
/*␊
4355+
** Nuxt rendering mode␊
4356+
** See https://nuxtjs.org/api/configuration-mode␊
4357+
*/␊
4358+
mode: 'universal',␊
4359+
/*␊
4360+
** Nuxt target␊
4361+
** See https://nuxtjs.org/api/configuration-target␊
4362+
*/␊
4363+
target: 'server',␊
4364+
/*␊
4365+
** Headers of the page␊
4366+
** See https://nuxtjs.org/api/configuration-head␊
4367+
*/␊
4368+
head: {␊
4369+
title: process.env.npm_package_name || '',␊
4370+
meta: [␊
4371+
{ charset: 'utf-8' },␊
4372+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },␊
4373+
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '' }␊
4374+
],␊
4375+
link: [␊
4376+
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }␊
4377+
]␊
4378+
},␊
4379+
/*␊
4380+
** Global CSS␊
4381+
*/␊
4382+
css: [␊
4383+
],␊
4384+
/*␊
4385+
** Plugins to load before mounting the App␊
4386+
** https://nuxtjs.org/guide/plugins␊
4387+
*/␊
4388+
plugins: [␊
4389+
],␊
4390+
/*␊
4391+
** Auto import components␊
4392+
** See https://nuxtjs.org/api/configuration-components␊
4393+
*/␊
4394+
components: true,␊
4395+
/*␊
4396+
** Nuxt.js dev-modules␊
4397+
*/␊
4398+
buildModules: [␊
4399+
],␊
4400+
/*␊
4401+
** Nuxt.js modules␊
4402+
*/␊
4403+
modules: [␊
4404+
],␊
4405+
/*␊
4406+
** Build configuration␊
4407+
** See https://nuxtjs.org/api/configuration-build/␊
4408+
*/␊
4409+
build: {␊
4410+
}␊
4411+
}␊
4412+
`
Binary file not shown.

0 commit comments

Comments
 (0)