Skip to content

Commit

Permalink
chore: bump volar version
Browse files Browse the repository at this point in the history
  • Loading branch information
hunyan-io committed May 1, 2023
1 parent 84c23c5 commit 76db8c1
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"devDependencies": {
"@vitejs/plugin-vue": "^4.1.0",
"@vitest/coverage-c8": "^0.29.7",
"@volar/vue-language-core": "^1.6.1",
"@volar/vue-language-core": "^1.6.3",
"changelogen": "^0.5.1",
"eslint": "^8.36.0",
"eslint-config-unjs": "^0.1.0",
Expand Down
74 changes: 66 additions & 8 deletions pnpm-lock.yaml

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

9 changes: 4 additions & 5 deletions tooling/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ const plugin: VueLanguagePlugin = (ctx) => {
/^\.(js|ts|jsx|tsx)$/.test(embeddedFile.fileName.replace(fileName, ""))
) {
const componentBlocks = sfc.customBlocks.filter(
(b) =>
b.type === "component" && typeof (b as any).attrs.name === "string"
(b) => b.type === "component" && typeof b.attrs.name === "string"
);
if (componentBlocks.length === 0) {
return;
Expand All @@ -123,7 +122,7 @@ const plugin: VueLanguagePlugin = (ctx) => {
...componentBlocks.map(
(b) =>
`\nimport ${pascalCase(
(b as any).attrs.name
b.attrs.name as string
)} from ${JSON.stringify(
`${fileName}__VLS_NSFC_${b.name.slice(
"customBlock_".length
Expand All @@ -140,7 +139,7 @@ const plugin: VueLanguagePlugin = (ctx) => {
"setup() {",
"return {",
...componentBlocks.map(
(b) => `${pascalCase((b as any).attrs.name)},\n`
(b) => `${pascalCase(b.attrs.name as string)},\n`
)
);
} else {
Expand All @@ -149,7 +148,7 @@ const plugin: VueLanguagePlugin = (ctx) => {
/const __VLS_componentsOption = {/,
"const __VLS_componentsOption = {\n",
...componentBlocks.map(
(b) => `${pascalCase((b as any).attrs.name)},\n`
(b) => `${pascalCase(b.attrs.name as string)},\n`
)
);
}
Expand Down

0 comments on commit 76db8c1

Please sign in to comment.