Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generate single .tsx file for vue script #1686

Merged
merged 9 commits into from Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -127,7 +127,6 @@ flowchart LR
VOLAR_VUE_SERVER["@volar/vue-language-server"]
VOLAR_VUE_TS["@volar/vue-typescript"]
VOLAR_VUE_CORE["@volar/vue-language-core"]
VOLAR_VUE_CG["@volar/vue-code-gen"]
VOLAR_VUE_SERVICE["@volar/vue-language-service"]
VOLAR_PUG_SERVICE["@volar/pug-language-service"]
VOLAR_TS_SERVICE["@volar/typescript-language-service"]
Expand All @@ -140,7 +139,6 @@ flowchart LR
click VOLAR_VUE_SERVER "https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-server"
click VOLAR_VUE_TS "https://github.com/johnsoncodehk/volar/tree/master/packages/vue-typescript"
click VOLAR_VUE_CORE "https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-core"
click VOLAR_VUE_CG "https://github.com/johnsoncodehk/volar/tree/master/packages/vue-code-gen"
click VOLAR_VUE_SERVICE "https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-service"
click VOLAR_PUG_SERVICE "https://github.com/johnsoncodehk/volar/tree/master/packages/pug-language-service"
click VOLAR_TS_SERVICE "https://github.com/johnsoncodehk/volar/tree/master/packages/typescript-language-service"
Expand Down Expand Up @@ -239,8 +237,6 @@ flowchart LR
VOLAR_VUE_SERVICE --> HTML_SERVICE
VOLAR_VUE_SERVICE --> CSS_SERVICE
VOLAR_VUE_SERVICE --> JSON_SERVICE

VOLAR_VUE_CORE --> VOLAR_VUE_CG
```

## Sponsors
Expand Down
2 changes: 1 addition & 1 deletion packages/alpine-language-core/src/index.ts
Expand Up @@ -4,5 +4,5 @@ import useHtmlFilePlugin from './plugins/file-html';
export type LanguageServiceHost = vue.LanguageServiceHost;

export function createLanguageContext(host: vue.LanguageServiceHost): vue.LanguageContext {
return vue.createLanguageContext(host, [useHtmlFilePlugin()], ['.html']);
return vue.createLanguageContext(host, [useHtmlFilePlugin], ['.html']);
}
12 changes: 6 additions & 6 deletions packages/alpine-language-core/src/plugins/file-html.ts
@@ -1,13 +1,12 @@
import { VueLanguagePlugin } from '@volar/vue-language-core';
import useVueHtmlFilePlugin from '@volar/vue-language-core/out/plugins/file-html';

export default function (): VueLanguagePlugin {
const plugin: VueLanguagePlugin = (ctx) => {

const vueHtmlFilePlugin = useVueHtmlFilePlugin();
const vueHtmlFilePlugin = useVueHtmlFilePlugin(ctx);

return {

parseSfc(fileName, content) {
parseSFC(fileName, content) {

if (fileName.endsWith('.html')) {

Expand All @@ -29,8 +28,9 @@ export default function (): VueLanguagePlugin {
}
}

return vueHtmlFilePlugin.parseSfc?.(fileName, newContent);
return vueHtmlFilePlugin.parseSFC?.(fileName, newContent);
};
}
};
}
};
export default plugin;
4 changes: 2 additions & 2 deletions packages/typescript-vue-plugin/src/index.ts
Expand Up @@ -124,11 +124,11 @@ function createProxyHost(ts: typeof import('typescript/lib/tsserverlibrary'), in
? info.serverHost.watchFile(projectName, () => {
onConfigUpdated();
onProjectUpdated();
parsedCommandLine = vue.tsShared.createParsedCommandLine(ts, ts.sys, projectName);
parsedCommandLine = vue.createParsedCommandLine(ts, ts.sys, projectName);
})
: undefined;
let parsedCommandLine = tsconfigWatcher // reuse fileExists result
? vue.tsShared.createParsedCommandLine(ts, ts.sys, projectName)
? vue.createParsedCommandLine(ts, ts.sys, projectName)
: undefined;

return {
Expand Down
21 changes: 0 additions & 21 deletions packages/vue-code-gen/LICENSE

This file was deleted.

25 changes: 0 additions & 25 deletions packages/vue-code-gen/package.json

This file was deleted.