Skip to content

Commit dd7dcf7

Browse files
committed
chore: remove babel-helper-vue-transform-on
1 parent 06f7e36 commit dd7dcf7

File tree

9 files changed

+10
-24
lines changed

9 files changed

+10
-24
lines changed

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
// Auto fix
1212
"editor.codeActionsOnSave": {
13-
"source.fixAll.eslint": true,
14-
"source.organizeImports": false
13+
"source.fixAll.eslint": "explicit",
14+
"source.organizeImports": "never"
1515
},
1616

1717
// Silent the stylistic rules in you IDE, but still auto fix them

playground/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"@vitejs/plugin-vue": "^4.5.0",
1313
"@vitejs/plugin-vue-jsx": "^3.1.0",
1414
"@vue-macros/volar": "^0.17.4",
15-
"@vue/babel-helper-vue-transform-on": "1.2.0-alpha.0",
1615
"tsx": "^4.6.1",
1716
"typescript": "^5.3.2",
1817
"unplugin-vue-macros": "^2.7.0",

playground/pnpm-lock.yaml

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playground/vite.config.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ export default defineConfig({
1919
},
2020
}),
2121

22-
vueJsx: VueJsx({
23-
transformOn: true,
24-
}),
22+
vueJsx: VueJsx(),
2523
},
2624
}),
2725
],
28-
})
26+
})

src/common/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const officialMacros = [
22
{ name: 'define-options', value: 'defineOptions', volar: true, status: 'official' },
33
{ name: 'define-slots', value: 'defineSlots', volar: true, status: 'official' },
4-
{ name: 'define-emits', value: 'defineEmits', volar: true, status: 'official' },
4+
{ name: 'short-emits', value: 'shortEmits', volar: false, status: 'official' },
55
] as const
66

77
export const stableMacros = [

src/init/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { checkbox, select } from '@inquirer/prompts'
22
import { chalk } from 'zx'
33
import type { VueMacros } from '../common'
4-
import { experimentalMacros, stableMacros } from '../common'
4+
import { experimentalMacros, officialMacros, stableMacros } from '../common'
55
import { rewriteNuxtConfig } from './nuxt'
66
import { rewriteTsConfig } from './tsconfig'
77
import { rewriteViteConfig } from './vite'
@@ -12,9 +12,10 @@ export async function init(target: string) {
1212
message: chalk.green(`Which vue macros do you want to use?`),
1313
choices: [
1414
...stableMacros.slice(-2),
15+
...officialMacros.slice(-1),
1516
...experimentalMacros,
1617
],
17-
pageSize: 13,
18+
pageSize: 14,
1819
})).reduce((result, macro) => {
1920
result[macro] = true
2021
return result

src/init/package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export async function rewritePackage(macros: VueMacros, target: string) {
3232
'typescript',
3333
]
3434
if (macros.jsxDirective || macros.setupSFC)
35-
deps.push('@vitejs/plugin-vue-jsx', '@vue/babel-helper-vue-transform-on')
35+
deps.push('@vitejs/plugin-vue-jsx')
3636

3737
await installDeps(deps)
3838
}

src/init/tsconfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function rewriteTsConfig(selectedMacros: VueMacros, target: string)
2828
const vueCompilerOptions = tsconfig.vueCompilerOptions ??= {}
2929
const plugins = vueCompilerOptions.plugins ??= []
3030
for (const [macro, options] of Object.entries(macros)) {
31-
if (macro === 'short-vmodel') {
31+
if (macro === 'short-vmodel' && options !== true) {
3232
const vueMacros = vueCompilerOptions.vueMacros ??= {}
3333
vueMacros.shortVmodel = options
3434
}

src/init/vite.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ export async function rewriteViteConfig(macros: VueMacros, target: string) {
3737
}
3838

3939
const vueJsx: ProxifiedFunctionCall = vueMacrosOptions?.plugins?.vueJsx || getVitePlugin('@vitejs/plugin-vue-jsx', 'VueJsx')
40-
if (vueJsx && (macros.jsxDirective || macros.setupSFC)) {
41-
vueJsx.$args[0] ?? vueJsx.$args.push({})
42-
const arg = vueJsx.$args[0] as any
43-
arg.transformOn = true
44-
}
4540

4641
updateVitePluginConfig(config, 'unplugin-vue-macros/vite', {
4742
...macros,

0 commit comments

Comments
 (0)