Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
flag-for-pinia: '--pinia'
flag-for-vitest: '--vitest'
flag-for-e2e: '--cypress'
flag-for-vue-devtools: 'vue-devtools'

- node-version: 18
os: macos-latest
Expand All @@ -77,6 +78,7 @@ jobs:
flag-for-pinia: '--pinia'
flag-for-vitest: '--vitest'
flag-for-e2e: '--cypress'
flag-for-vue-devtools: 'vue-devtools'

- node-version: 20
os: ubuntu-latest
Expand All @@ -86,6 +88,7 @@ jobs:
flag-for-pinia: '--pinia'
flag-for-vitest: '--vitest'
flag-for-e2e: '--cypress'
flag-for-vue-devtools: 'vue-devtools'

- node-version: 16
os: ubuntu-latest
Expand All @@ -95,6 +98,7 @@ jobs:
flag-for-pinia: '--pinia'
flag-for-vitest: '--vitest'
flag-for-e2e: '--cypress'
flag-for-vue-devtools: 'vue-devtools'
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.os == 'windows-latest' }}
env:
Expand Down
21 changes: 19 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ async function init() {
// --playwright
// --eslint
// --eslint-with-prettier (only support prettier through eslint for simplicity)
// --vue-devtools
// --force (for force overwriting)

const args = process.argv.slice(2)
Expand Down Expand Up @@ -116,7 +117,8 @@ async function init() {
argv.cypress ??
argv.nightwatch ??
argv.playwright ??
argv.eslint
argv.eslint ??
argv['vue-devtools']
) === 'boolean'

let targetDir = args[0]
Expand All @@ -138,6 +140,7 @@ async function init() {
needsE2eTesting?: false | 'cypress' | 'nightwatch' | 'playwright'
needsEslint?: boolean
needsPrettier?: boolean
needsVueDevtools?: boolean
} = {}

try {
Expand All @@ -154,6 +157,7 @@ async function init() {
// - Add Playwright for end-to-end testing?
// - Add ESLint for code quality?
// - Add Prettier for code formatting?
// - Add Vue DevTools extension for debugging? (experimental)
result = await prompts(
[
{
Expand Down Expand Up @@ -285,6 +289,14 @@ async function init() {
initial: false,
active: language.defaultToggleOptions.active,
inactive: language.defaultToggleOptions.inactive
},
{
name: 'needsVueDevtools',
type: () => (isFeatureFlagsUsed ? null : 'toggle'),
message: language.needsVueDevtools.message,
initial: false,
active: language.defaultToggleOptions.active,
inactive: language.defaultToggleOptions.inactive
}
],
{
Expand All @@ -310,7 +322,8 @@ async function init() {
needsPinia = argv.pinia,
needsVitest = argv.vitest || argv.tests,
needsEslint = argv.eslint || argv['eslint-with-prettier'],
needsPrettier = argv['eslint-with-prettier']
needsPrettier = argv['eslint-with-prettier'],
needsVueDevtools = argv['vue-devtools']
} = result

const { needsE2eTesting } = result
Expand Down Expand Up @@ -453,6 +466,10 @@ async function init() {
if (needsPrettier) {
render('config/prettier')
}

if (needsVueDevtools) {
render('config/vue-devtools')
}
// Render code template.
// prettier-ignore
const codeTemplate =
Expand Down
3 changes: 3 additions & 0 deletions locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"needsPrettier": {
"message": "Add Prettier for code formatting?"
},
"needsVueDevtools": {
"message": "Add Vue DevTools extension for debugging? (experimental)"
},
"errors": {
"operationCancelled": "Operation cancelled"
},
Expand Down
3 changes: 3 additions & 0 deletions locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"needsPrettier": {
"message": "Ajouter Prettier pour le formatage du code\u00a0?"
},
"needsVueDevtools": {
"message": "Ajouter l'extension Vue DevTools pour le débogage\u00a0? (expérimental)"
},
"errors": {
"operationCancelled": "Operation annulée"
},
Expand Down
3 changes: 3 additions & 0 deletions locales/tr-TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"needsPrettier": {
"message": "Kod formatlama için Prettier eklensin mi?"
},
"needsVueDevtools": {
"message": "Add Vue DevTools extension for debugging? (experimental)"
},
"errors": {
"operationCancelled": "İşlem iptal edildi"
},
Expand Down
3 changes: 3 additions & 0 deletions locales/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"needsPrettier": {
"message": "是否引入 Prettier 用于代码格式化?"
},
"needsVueDevtools": {
"message": "Add Vue DevTools extension for debugging? (experimental)"
},
"errors": {
"operationCancelled": "操作取消"
},
Expand Down
3 changes: 3 additions & 0 deletions locales/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
"needsPrettier": {
"message": "是否引入 Prettier 用於程式碼格式化?"
},
"needsVueDevtools": {
"message": "Add Vue DevTools extension for debugging? (experimental)"
},
"errors": {
"operationCancelled": "操作取消"
},
Expand Down
Loading