Skip to content

Commit 9e11639

Browse files
sxzzzhiyuanzmj
andauthored
feat: unify bundler & volar config (#750)
Co-authored-by: gaokefei <260480378@qq.com>
1 parent d7ce1e9 commit 9e11639

File tree

132 files changed

+1244
-915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+1244
-915
lines changed

.changeset/early-onions-shave.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@vue-macros/better-define": minor
3+
"@vue-macros/eslint-config": minor
4+
"@vue-macros/export-expose": minor
5+
"@vue-macros/define-emit": minor
6+
"@vue-macros/define-prop": minor
7+
"@vue-macros/test-utils": minor
8+
"@vue-macros/common": minor
9+
"@vue-macros/config": minor
10+
"unplugin-vue-macros": minor
11+
"@vue-macros/astro": minor
12+
"@vue-macros/volar": minor
13+
"@vue-macros/nuxt": minor
14+
---
15+
16+
Support config file (e.g `vue-macros.config.ts`)
17+

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"exportall.config.semis": false,
2626
"exportall.config.folderListener": [
2727
"/packages/api/src/vue",
28-
"/packages/api/src/ts"
28+
"/packages/api/src/ts",
29+
"/packages/config/src"
2930
]
3031
}

docs/.vitepress/config.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import { createRequire } from 'node:module'
21
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
2+
import VueMacrosPlugin from '@vue-macros/volar'
33
import ts from 'typescript'
44
import { defineConfig } from 'vitepress'
55
import { docsLink } from '../../macros'
66
import { getLocaleConfig } from './locale'
77

8-
const require = createRequire(import.meta.url)
9-
const vueMacrosPlugin = require('@vue-macros/volar')
10-
118
export default defineConfig({
129
lastUpdated: true,
1310
locales: {
@@ -53,17 +50,7 @@ export default defineConfig({
5350
types: ['unplugin-vue-macros/macros-global', 'vue/jsx'],
5451
},
5552
vueCompilerOptions: {
56-
plugins: [vueMacrosPlugin],
57-
// @ts-ignore
58-
vueMacros: {
59-
scriptLang: true,
60-
setupSFC: true,
61-
booleanProp: true,
62-
defineEmit: true,
63-
defineProp: true,
64-
templateRef: true,
65-
defineGeneric: true,
66-
},
53+
plugins: [VueMacrosPlugin],
6754
},
6855
},
6956
}),

docs/.vitepress/i18n/locales.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const zhCN = {
99
'Explore more macros and syntax sugar to Vue.':
1010
'探索更多宏和语法糖到 Vue 中。',
1111

12-
'Getting Started': '入门',
13-
'Bundler Integration': '打包器集成',
12+
'Getting Started': '入门指南',
13+
'Bundler Integration': '构建工具集成',
1414
'Nuxt Integration': 'Nuxt 集成',
1515
'Astro Integration': 'Astro 集成',
1616
Configurations: '配置',

docs/.vitepress/locale.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ export function getLocaleConfig(lang: string) {
251251
text: 'setupJsdoc',
252252
link: `${urlPrefix}/volar/setup-jsdoc`,
253253
},
254+
{
255+
text: 'defineGeneric',
256+
link: `${urlPrefix}/volar/define-generic`,
257+
},
254258
],
255259
},
256260
{
@@ -260,10 +264,6 @@ export function getLocaleConfig(lang: string) {
260264
text: 'templateRef',
261265
link: `${urlPrefix}/volar/template-ref`,
262266
},
263-
{
264-
text: 'defineGeneric',
265-
link: `${urlPrefix}/volar/define-generic`,
266-
},
267267
],
268268
},
269269
],

docs/features/boolean-prop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ defineProps<{
6565
// tsconfig.json
6666
{
6767
"vueCompilerOptions": {
68-
"plugins": ["@vue-macros/volar"],
68+
"plugins": ["unplugin-vue-macros/volar"],
6969
"vueMacros": {
7070
"booleanProp": true,
7171
},

docs/features/export-expose.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export default a
221221
// tsconfig.json
222222
{
223223
"vueCompilerOptions": {
224-
"plugins": ["@vue-macros/volar"],
224+
"plugins": ["unplugin-vue-macros/volar"],
225225
"vueMacros": {
226226
"exportExpose": true,
227227
},

docs/features/export-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const bar: number = 1 // with default value
2828
// tsconfig.json
2929
{
3030
"vueCompilerOptions": {
31-
"plugins": ["@vue-macros/volar"],
31+
"plugins": ["unplugin-vue-macros/volar"],
3232
"vueMacros": {
3333
"exportProps": true,
3434
},

docs/features/export-render.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ export default () => <div>ok</div>
3131

3232
## Volar Configuration
3333

34-
```jsonc {4}
34+
```jsonc {4,8}
3535
// tsconfig.json
3636
{
3737
"vueCompilerOptions": {
38-
"plugins": ["@vue-macros/volar"],
38+
"plugins": ["unplugin-vue-macros/volar"],
39+
"vueMacros": {
40+
"exportRender": true,
41+
},
3942
},
4043
}
4144
```

docs/features/jsx-directive.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Modifiers are special postfixes denoted by a `_`, which indicate that a directiv
217217
// tsconfig.json
218218
{
219219
"vueCompilerOptions": {
220-
"plugins": ["@vue-macros/volar"],
220+
"plugins": ["unplugin-vue-macros/volar"],
221221
},
222222
}
223223
```

0 commit comments

Comments
 (0)