Skip to content

Commit cf70800

Browse files
committed
feat: switch to vue-macros v3
1 parent f57f382 commit cf70800

File tree

8 files changed

+485
-394
lines changed

8 files changed

+485
-394
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"typescript": "^5.9.2",
6161
"unbuild": "^3.6.0",
6262
"unocss": "^66.4.1",
63-
"unplugin-vue-macros": "^2.14.5",
64-
"vitest": "^3.2.4"
63+
"vitest": "^3.2.4",
64+
"vue-macros": "^3.0.0-beta.21"
6565
}
6666
}

playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@vue-macros/volar": "^3.0.0-beta.20",
1616
"tsx": "^4.20.3",
1717
"typescript": "^5.9.2",
18-
"unplugin-vue-macros": "^2.14.5",
18+
"vue-macros": "^3.0.0-beta.21",
1919
"vite": "^7.0.6"
2020
}
2121
}

playground/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"resolveJsonModule": true,
1111
"types": [
1212
"node",
13-
"unplugin-vue-macros/macros-global"
13+
"vue-macros/macros-global"
1414
],
1515
"strict": true,
1616
"noUnusedLocals": true,

playground/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import VueJsx from '@vitejs/plugin-vue-jsx'
22
import Vue from '@vitejs/plugin-vue'
3-
import VueMacros from 'unplugin-vue-macros/vite'
3+
import VueMacros from 'vue-macros/vite'
44
import { defineConfig } from 'vite'
55

66
export default defineConfig({
@@ -23,4 +23,4 @@ export default defineConfig({
2323
},
2424
}),
2525
],
26-
})
26+
})

pnpm-lock.yaml

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

src/init/package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function rewritePackage(macros: VueMacros, target: string) {
2828
const deps = [
2929
'@vue-macros/volar',
3030
'@vitejs/plugin-vue',
31-
'unplugin-vue-macros',
31+
'vue-macros',
3232
'typescript',
3333
]
3434
if (macros.jsxDirective || macros.setupSFC)

src/init/tsconfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export async function rewriteTsConfig(selectedMacros: VueMacros, target: string)
4949

5050
tsconfig.compilerOptions ??= {}
5151
tsconfig.compilerOptions.types ??= []
52-
if (!tsconfig.compilerOptions.types.includes('unplugin-vue-macros/macros-global'))
53-
tsconfig.compilerOptions.types.push('unplugin-vue-macros/macros-global')
52+
if (!tsconfig.compilerOptions.types.includes('vue-macros/macros-global'))
53+
tsconfig.compilerOptions.types.push('vue-macros/macros-global')
5454

5555
await writeTSConfig(`${target}/tsconfig.json`, tsconfig)
5656
}

src/init/vite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function rewriteViteConfig(macros: VueMacros, target: string) {
2323
return findVitePluginCall(config, from)
2424
}
2525

26-
const vueMacros = getVitePlugin('unplugin-vue-macros/vite', 'VueMacros')
26+
const vueMacros = getVitePlugin('vue-macros/vite', 'VueMacros')
2727
if (!vueMacros)
2828
return
2929

@@ -38,7 +38,7 @@ export async function rewriteViteConfig(macros: VueMacros, target: string) {
3838

3939
const vueJsx: ProxifiedFunctionCall = vueMacrosOptions?.plugins?.vueJsx || getVitePlugin('@vitejs/plugin-vue-jsx', 'VueJsx')
4040

41-
updateVitePluginConfig(config, 'unplugin-vue-macros/vite', {
41+
updateVitePluginConfig(config, 'vue-macros/vite', {
4242
...macros,
4343
plugins: {
4444
...vue ? { vue } : {},

0 commit comments

Comments
 (0)