Skip to content

Commit

Permalink
feat: enable devtools v7 integration by default (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang authored Nov 6, 2024
1 parent 1f061a2 commit 1950a1c
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 66 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ jobs:
flag-for-vitest: '--vitest'
flag-for-e2e: '--cypress'
flag-for-eslint: '--eslint'
flag-for-devtools: '--devtools'

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

- node-version: 20
os: ubuntu-latest
Expand All @@ -89,7 +87,6 @@ jobs:
flag-for-vitest: '--vitest'
flag-for-e2e: '--cypress'
flag-for-eslint: '--eslint'
flag-for-devtools: '--devtools'

- node-version: 22
os: ubuntu-latest
Expand All @@ -100,11 +97,10 @@ jobs:
flag-for-vitest: '--vitest'
flag-for-e2e: '--cypress'
flag-for-eslint: '--eslint'
flag-for-devtools: '--devtools'
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.os == 'windows-latest' }}
env:
FEATURE_FLAGS: ${{ matrix.flag-for-ts }} ${{ matrix.flag-for-jsx }} ${{ matrix.flag-for-router }} ${{ matrix.flag-for-pinia }} ${{ matrix.flag-for-vitest }} ${{ matrix.flag-for-e2e }} ${{matrix.flag-for-eslint}} ${{matrix.flag-for-devtools}}
FEATURE_FLAGS: ${{ matrix.flag-for-ts }} ${{ matrix.flag-for-jsx }} ${{ matrix.flag-for-router }} ${{ matrix.flag-for-pinia }} ${{ matrix.flag-for-vitest }} ${{ matrix.flag-for-e2e }} ${{matrix.flag-for-eslint}}
# Sometimes the Linux runner can't verify Cypress in 30s
CYPRESS_VERIFY_TIMEOUT: 60000
steps:
Expand Down
20 changes: 1 addition & 19 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ async function init() {
// --playwright
// --eslint
// --eslint-with-prettier (only support prettier through eslint for simplicity)
// --vue-devtools / --devtools
// --force (for force overwriting)

const args = process.argv.slice(2)
Expand All @@ -96,8 +95,6 @@ async function init() {
tests: { type: 'boolean' },
'vue-router': { type: 'boolean' },
router: { type: 'boolean' },
'vue-devtools': { type: 'boolean' },
devtools: { type: 'boolean' },
} as const

const { values: argv, positionals } = parseArgs({
Expand All @@ -120,8 +117,7 @@ async function init() {
argv.nightwatch ??
argv.playwright ??
argv.eslint ??
argv['eslint-with-prettier'] ??
(argv.devtools || argv['vue-devtools'])
argv['eslint-with-prettier']
) === 'boolean'

let targetDir = positionals[0]
Expand All @@ -144,7 +140,6 @@ async function init() {
needsEslint?: false | 'eslintOnly' | 'speedUpWithOxlint'
needsOxlint?: boolean
needsPrettier?: boolean
needsDevTools?: boolean
} = {}

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

const needsEslint = Boolean(argv.eslint || argv['eslint-with-prettier'] || result.needsEslint)
Expand Down Expand Up @@ -488,9 +473,6 @@ async function init() {
render('config/prettier')
}

if (needsDevTools) {
render('config/devtools')
}
// Render code template.
// prettier-ignore
const codeTemplate =
Expand Down
3 changes: 0 additions & 3 deletions locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
"needsPrettier": {
"message": "Add Prettier for code formatting?"
},
"needsDevTools": {
"message": "Add Vue DevTools 7 extension for debugging? (experimental)"
},
"errors": {
"operationCancelled": "Operation cancelled"
},
Expand Down
3 changes: 0 additions & 3 deletions locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
"needsPrettier": {
"message": "Ajouter Prettier pour le formatage du code\u00a0?"
},
"needsDevTools": {
"message": "Ajouter l'extension Vue DevTools 7 pour le débogage\u00a0? (expérimental)"
},
"errors": {
"operationCancelled": "Operation annulée"
},
Expand Down
3 changes: 0 additions & 3 deletions locales/tr-TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
"needsPrettier": {
"message": "Kod formatlama için Prettier eklensin mi?"
},
"needsDevTools": {
"message": "Hata ayıklama için Vue DevTools 7 eklentisi eklensin mi? (deneysel)"
},
"errors": {
"operationCancelled": "İşlem iptal edildi"
},
Expand Down
3 changes: 0 additions & 3 deletions locales/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
"needsPrettier": {
"message": "是否引入 Prettier 用于代码格式化?"
},
"needsDevTools": {
"message": "是否引入 Vue DevTools 7 扩展用于调试? (试验阶段)"
},
"errors": {
"operationCancelled": "操作取消"
},
Expand Down
3 changes: 0 additions & 3 deletions locales/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@
"needsPrettier": {
"message": "是否引入 Prettier 用於程式碼格式化?"
},
"needsDevTools": {
"message": "是否引入 Vue DevTools 7 擴充元件以協助偵錯?(試驗性功能)"
},
"errors": {
"operationCancelled": "操作取消"
},
Expand Down
11 changes: 4 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/snapshot.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function fullCombination(arr) {
let flagCombinations = fullCombination(featureFlags)
flagCombinations.push(
['default'],
['devtools', 'router', 'pinia'],
['router', 'pinia'],
['eslint'],
['eslint-with-prettier'],
)
Expand Down
3 changes: 2 additions & 1 deletion template/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.1.4",
"vite": "^5.4.10"
"vite": "^5.4.10",
"vite-plugin-vue-devtools": "^7.5.4"
}
}
6 changes: 6 additions & 0 deletions template/base/vite.config.js.data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ export default function getData() {
importer: "import vue from '@vitejs/plugin-vue'",
initializer: 'vue()',
},

{
id: 'vite-plugin-vue-devtools',
importer: "import vueDevTools from 'vite-plugin-vue-devtools'",
initializer: 'vueDevTools()',
}
],
}
}
5 changes: 0 additions & 5 deletions template/config/devtools/package.json

This file was deleted.

12 changes: 0 additions & 12 deletions template/config/devtools/vite.config.js.data.mjs

This file was deleted.

1 change: 0 additions & 1 deletion utils/getLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ interface Language {
needsE2eTesting: LanguageItem
needsEslint: LanguageItem
needsPrettier: LanguageItem
needsDevTools: LanguageItem
errors: {
operationCancelled: string
}
Expand Down

0 comments on commit 1950a1c

Please sign in to comment.