Skip to content

Commit ea858fa

Browse files
committed
style: format code
1 parent 7fb0863 commit ea858fa

File tree

3 files changed

+21
-26
lines changed

3 files changed

+21
-26
lines changed

index.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,25 @@ async function init() {
5252
// --with-tests / --tests / --cypress
5353
const argv = minimist(process.argv.slice(2), {
5454
alias: {
55-
'typescript': ['ts'],
55+
typescript: ['ts'],
5656
'with-tests': ['tests', 'cypress'],
57-
'router': ['vue-router']
57+
router: ['vue-router']
5858
},
5959
// all arguments are treated as booleans
6060
boolean: true
6161
})
6262

6363
// if any of the feature flags is set, we would skip the feature prompts
64-
// use `??` instead of `||` once we drop Node.js 12 support
65-
const isFeatureFlagsUsed = typeof (argv.default || argv.ts || argv.jsx || argv.router || argv.vuex || argv.tests) === 'boolean'
64+
// use `??` instead of `||` once we drop Node.js 12 support
65+
const isFeatureFlagsUsed =
66+
typeof (
67+
argv.default ||
68+
argv.ts ||
69+
argv.jsx ||
70+
argv.router ||
71+
argv.vuex ||
72+
argv.tests
73+
) === 'boolean'
6674

6775
let targetDir = argv._[0]
6876
const defaultProjectName = !targetDir ? 'vue-project' : targetDir
@@ -137,17 +145,15 @@ async function init() {
137145
{
138146
name: 'needsRouter',
139147
type: () => (isFeatureFlagsUsed ? null : 'toggle'),
140-
message:
141-
'Add Vue Router for Single Page Application development?',
148+
message: 'Add Vue Router for Single Page Application development?',
142149
initial: false,
143150
active: 'Yes',
144151
inactive: 'No'
145152
},
146153
{
147154
name: 'needsVuex',
148155
type: () => (isFeatureFlagsUsed ? null : 'toggle'),
149-
message:
150-
'Add Vuex for state management?',
156+
message: 'Add Vuex for state management?',
151157
initial: false,
152158
active: 'Yes',
153159
inactive: 'No'

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@
3535
"kolorist": "^1.5.0",
3636
"minimist": "^1.2.5",
3737
"prompts": "^2.4.1"
38+
},
39+
"devDependencies": {
40+
"prettier": "^2.3.2"
3841
}
3942
}

snapshot.js

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,12 @@ const playgroundDir = new URL('./playground/', import.meta.url).pathname
66
function createProjectWithFeatureFlags(flags) {
77
const projectName = flags.join('-')
88
console.log(`Creating project ${projectName}`)
9-
spawnSync(
10-
'node',
11-
[
12-
bin,
13-
projectName,
14-
...flags.map(flag => `--${flag}`)
15-
],
16-
{
17-
cwd: playgroundDir
18-
}
19-
)
9+
spawnSync('node', [bin, projectName, ...flags.map((flag) => `--${flag}`)], {
10+
cwd: playgroundDir
11+
})
2012
}
2113

22-
const featureFlags = [
23-
'typescript',
24-
'jsx',
25-
'router',
26-
'vuex',
27-
'with-tests'
28-
]
14+
const featureFlags = ['typescript', 'jsx', 'router', 'vuex', 'with-tests']
2915

3016
function getCombinations(arr) {
3117
const combinations = []

0 commit comments

Comments
 (0)