Skip to content

Commit 7290e46

Browse files
committed
Remove some unused internal config options
1 parent 5fcec54 commit 7290e46

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ async function togglePromptIf(condition: boolean, message: string, initial = fal
5959
type Config = {
6060
scopedPackageName: string
6161
unscopedPackageName: string
62-
shortUnscopedPackageName: string
63-
projectName: string
6462
globalVariableName: string
6563
targetDirName: string
6664
targetDirPath: string
@@ -173,8 +171,6 @@ async function init() {
173171
}
174172

175173
const unscopedPackageName = scopedPackageName.replace(/.*\//, '')
176-
const shortUnscopedPackageName = unscopedPackageName.replace(/^vue-/, '')
177-
const projectName = unscopedPackageName.replace(/-+/g, ' ').trim().split(' ').map(s => s[0].toUpperCase() + s.slice(1)).join(' ')
178174

179175
const targetDirName = await textPrompt('Target directory', unscopedPackageName)
180176

@@ -203,7 +199,14 @@ async function init() {
203199
process.exit(1)
204200
}
205201

206-
const globalVariableName = await textPromptIf(extended, 'Global variable name', projectName.replace(/ /g, ''))
202+
const defaultGlobalVariableName = unscopedPackageName
203+
.replace(/\W+/g, ' ')
204+
.trim()
205+
.split(' ')
206+
.map(s => s[0].toUpperCase() + s.slice(1))
207+
.join('')
208+
209+
const globalVariableName = await textPromptIf(extended, 'Global variable name', defaultGlobalVariableName)
207210

208211
if (!/^[a-zA-Z$_][\w$]*$/.test(globalVariableName)) {
209212
console.log('Invalid variable name: ' + globalVariableName)
@@ -237,8 +240,6 @@ async function init() {
237240
const config: Config = {
238241
scopedPackageName,
239242
unscopedPackageName,
240-
shortUnscopedPackageName,
241-
projectName,
242243
globalVariableName,
243244
targetDirName,
244245
targetDirPath,

0 commit comments

Comments
 (0)