Skip to content

Commit 92d1b1c

Browse files
Addressed create-app .blits file extension review
Signed-off-by: Suresh Kumar Gangumalla <[email protected]>
1 parent 957fc6e commit 92d1b1c

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

packages/create-blits/src/helpers/create.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@ export const copyLightningFixtures = (config) => {
1717
exit(red(bold('The target directory ' + targetDir + ' already exists')))
1818
}
1919

20-
const projectMapping = {
21-
js: { projectType: 'js', flavourType: 'blits' },
22-
'ts-blits': { projectType: 'ts', flavourType: 'blits' },
23-
ts: { projectType: 'ts', flavourType: 'plain' },
24-
}
25-
26-
const { projectType = 'js', flavourType = 'blits' } = projectMapping[config.projectType] || {}
20+
const projectType = config.projectType
21+
const formatType = config.formatType
2722

2823
const boilerplate = 'default'
2924
const boilerplateDir = path.join(config.fixturesBase, boilerplate)
@@ -39,7 +34,7 @@ export const copyLightningFixtures = (config) => {
3934
})
4035

4136
// Copy project type source files
42-
fs.cpSync(path.join(boilerplateDir, projectType, flavourType), targetDir, {
37+
fs.cpSync(path.join(boilerplateDir, projectType, formatType), targetDir, {
4338
recursive: true,
4439
})
4540

packages/create-blits/src/index.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,30 @@ const questions = [
9999
name: 'projectType',
100100
message: 'What kind of project do you want to create?',
101101
choices: [
102-
{
103-
title: 'Javascript',
104-
description: 'Javascript project with .blits file extension',
105-
value: 'js-blits',
106-
},
107102
{
108103
title: 'Javascript',
109104
description: 'JS based project (with JSDoc for type checking and autocompletion)',
110105
value: 'js',
111106
},
107+
{ title: 'TypeScript', description: 'TS based project', value: 'ts' },
108+
],
109+
initial: 0,
110+
},
111+
{
112+
type: 'select',
113+
name: 'formatType',
114+
message: 'What type of file format do you want to use?',
115+
choices: [
112116
{
113-
title: 'TypeScript',
114-
description: 'TS based project with .blits file extension',
115-
value: 'ts-blits',
117+
title: 'blits',
118+
description: '.blits file extension (recommended)',
119+
value: 'blits',
120+
},
121+
{
122+
title: 'plain js/ts',
123+
description: '.js/.ts file extension',
124+
value: 'plain',
116125
},
117-
{ title: 'TypeScript', description: 'TS based project', value: 'ts' },
118126
],
119127
initial: 0,
120128
},

0 commit comments

Comments
 (0)