Navigation Menu

Skip to content

Commit

Permalink
refactor: move vue-language-tools to packages (#2367)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Feb 8, 2023
1 parent 454ceeb commit 8ae964b
Show file tree
Hide file tree
Showing 248 changed files with 89 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -18,6 +18,6 @@ jobs:
- run: npm i -g pnpm ovsx
- run: pnpm install --frozen-lockfile --no-optional
- run: pnpm run prepack:node && pnpm ovsx publish
working-directory: vue-language-tools/vscode-vue
working-directory: packages/vscode-vue
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
4 changes: 2 additions & 2 deletions .gitignore
Expand Up @@ -4,5 +4,5 @@ node_modules
*.tsbuildinfo
*.vsix
.vscode-test-web
vue-language-tools/vscode-vue/meta.json
vue-language-tools/vscode-vue/stats.html
packages/vscode-vue/meta.json
packages/vscode-vue/stats.html
6 changes: 3 additions & 3 deletions .vscode/launch.json
Expand Up @@ -9,7 +9,7 @@
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceRoot}/vue-language-tools/vscode-vue"
"--extensionDevelopmentPath=${workspaceRoot}/packages/vscode-vue"
],
"outFiles": [
"${workspaceRoot}/*/*/out/**/*.js"
Expand All @@ -26,7 +26,7 @@
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceRoot}/vue-language-tools/vscode-typescript-vue-plugin"
"--extensionDevelopmentPath=${workspaceRoot}/packages/vscode-typescript-vue-plugin"
],
"outFiles": [
"${workspaceRoot}/*/*/out/**/*.js"
Expand All @@ -43,7 +43,7 @@
"request": "launch",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}/vue-language-tools/vscode-vue",
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-vue",
"--extensionDevelopmentKind=web"
],
"outFiles": [
Expand Down
28 changes: 14 additions & 14 deletions README.md
Expand Up @@ -4,13 +4,13 @@
### Vue.js

- [Vue Language Features](https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vscode-vue) \
- [Vue Language Features](https://github.com/johnsoncodehk/volar/tree/master/packages/vscode-vue) \
*Vue, Vitepress, petite-vue language support extension for VSCode*
- [TypeScript Vue Plugin](https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vscode-typescript-vue-plugin) \
- [TypeScript Vue Plugin](https://github.com/johnsoncodehk/volar/tree/master/packages/vscode-typescript-vue-plugin) \
*VSCode extension to support Vue in TS server*
- [vue-tsc](https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vue-tsc) \
- [vue-tsc](https://github.com/johnsoncodehk/volar/tree/master/packages/vue-tsc) \
*Type-check and dts build command line tool*
- [vue-component-meta](https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vue-component-meta) \
- [vue-component-meta](https://github.com/johnsoncodehk/volar/tree/master/packages/vue-component-meta) \
*Component props, events, slots types information extract tool*
- [vite-plugin-vue-component-preview](https://github.com/johnsoncodehk/vite-plugin-vue-component-preview) \
*Vite plugin for support Vue component preview view with `Vue Language Features`*
Expand Down Expand Up @@ -122,8 +122,8 @@ flowchart LR
VSC_VUE[vscode-vue]
VSC_TSVP[vscode-typescript-vue-plugin]
click VSC_VUE "https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vscode-vue"
click VSC_TSVP "https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vscode-typescript-vue-plugin"
click VSC_VUE "https://github.com/johnsoncodehk/volar/tree/master/packages/vscode-vue"
click VSC_TSVP "https://github.com/johnsoncodehk/volar/tree/master/packages/vscode-typescript-vue-plugin"
%% Volar - Packages
VOLAR_VUE_SERVER["@volar/vue-language-server"]
Expand All @@ -138,13 +138,13 @@ flowchart LR
VUE_COMPONENT_META[vue-component-meta]
TS_VUE_PLUGIN[typescript-vue-plugin]
click VOLAR_VUE_SERVER "https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vue-language-server"
click VOLAR_VUE_TS "https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vue-typescript"
click VOLAR_VUE_CORE "https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vue-language-core"
click VOLAR_VUE_SERVICE "https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vue-language-service"
click VUE_TSC "https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vue-tsc"
click VUE_COMPONENT_META "https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vue-component-meta"
click TS_VUE_PLUGIN "https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/typescript-vue-plugin"
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_SERVICE "https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-service"
click VUE_TSC "https://github.com/johnsoncodehk/volar/tree/master/packages/vue-tsc"
click VUE_COMPONENT_META "https://github.com/johnsoncodehk/volar/tree/master/packages/vue-component-meta"
click TS_VUE_PLUGIN "https://github.com/johnsoncodehk/volar/tree/master/packages/typescript-vue-plugin"
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"
click VOLAR_TS_FASTER "https://github.com/johnsoncodehk/volar/tree/master/packages/typescript-faster"
Expand All @@ -165,7 +165,7 @@ flowchart LR
click CSS_SERVICE "https://github.com/microsoft/vscode-css-languageservice"
click JSON_SERVICE "https://github.com/microsoft/vscode-json-languageservice"
click TS "https://github.com/microsoft/TypeScript"
click VSC_TS "https://github.com/microsoft/vscode/tree/main/vue-language-tools/typescript-language-features"
click VSC_TS "https://github.com/microsoft/vscode/tree/main/packages/typescript-language-features"
click VUE_REPL "https://github.com/vuejs/repl"
click MONACO_VOLAR "https://github.com/Kingwl/monaco-volar"
%% click VITE_PLUGIN_CHECKER "https://github.com/fi3ework/vite-plugin-checker"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/lerna-lite/lerna-lite/main/packages/cli/schemas/lerna-schema.json",
"npmClient": "pnpm",
"packages": [
"vue-language-tools/*"
"packages/*"
],
"version": "1.0.24"
}
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -5,16 +5,16 @@
"build-ci": "tsc -b tsconfig.build-ci.json",
"watch": "npm run build && (npm run watch:base & npm run watch:vue & npm run watch:typescript-vue-plugin)",
"watch:base": "tsc -b tsconfig.build.json -w",
"watch:vue": "cd ./vue-language-tools/vscode-vue && npm run watch",
"watch:typescript-vue-plugin": "cd ./vue-language-tools/vscode-typescript-vue-plugin && npm run watch",
"watch:vue": "cd ./packages/vscode-vue && npm run watch",
"watch:typescript-vue-plugin": "cd ./packages/vscode-typescript-vue-plugin && npm run watch",
"prerelease": "npm run build && npm run test",
"version:test": "lerna version --exact --force-publish --yes --sync-workspace-lock --no-push --no-git-tag-version",
"release": "npm run release:base && npm run release:vue && npm run release:pug && npm run release:typescript-vue-plugin",
"release:base": "lerna publish --exact --force-publish --yes --sync-workspace-lock",
"release:vue": "cd ./vue-language-tools/vscode-vue && npm run release",
"release:typescript-vue-plugin": "cd ./vue-language-tools/vscode-typescript-vue-plugin && npm run release",
"release:vue": "cd ./packages/vscode-vue && npm run release",
"release:typescript-vue-plugin": "cd ./packages/vscode-typescript-vue-plugin && npm run release",
"test": "vitest run",
"chrome": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=./vue-language-tools/vscode-vue ../volar-starter"
"chrome": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=./packages/vscode-vue ../volar-starter"
},
"devDependencies": {
"@types/node": "latest",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -10,7 +10,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/typescript-vue-plugin"
"directory": "packages/typescript-vue-plugin"
},
"dependencies": {
"@volar/typescript-faster": "1.2.0-alpha.9",
Expand Down
File renamed without changes.
Expand Up @@ -5,7 +5,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/vscode-typescript-vue-plugin"
"directory": "packages/vscode-typescript-vue-plugin"
},
"sponsor": {
"url": "https://github.com/sponsors/johnsoncodehk"
Expand Down
@@ -0,0 +1,4 @@
let modulePath = '../../dist';
try { modulePath = require.resolve('../../../../../packages/vscode-typescript-vue-plugin/node_modules/typescript-vue-plugin'); } catch { } // pnpm
try { modulePath = require.resolve('../typescript-vue-plugin'); } catch { }
module.exports = require(modulePath);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Expand Up @@ -5,7 +5,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/vscode-vue"
"directory": "packages/vscode-vue"
},
"categories": [
"Programming Languages"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -41,7 +41,7 @@ export async function register(context: vscode.ExtensionContext, client: BaseLan
}

content += '---\n\n';
content += `> Have any questions about the report message? You can see how it is composed by inspecting the [source code](https://github.com/johnsoncodehk/volar/blob/master/vue-language-tools/vscode-vue/src/features/doctor.ts).\n\n`;
content += `> Have any questions about the report message? You can see how it is composed by inspecting the [source code](https://github.com/johnsoncodehk/volar/blob/master/packages/vscode-vue/src/features/doctor.ts).\n\n`;

return content.trim();
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -40,7 +40,7 @@ const componentPath = path.join(__dirname, 'path-to-component');
const meta = checker.getComponentMeta(componentPath);
```

This meta contains really useful stuff like component props, slots, events and more. You can refer to its [type definition](https://github.com/johnsoncodehk/volar/blob/master/vue-language-tools/vue-component-meta/src/types.ts) for more details.
This meta contains really useful stuff like component props, slots, events and more. You can refer to its [type definition](https://github.com/johnsoncodehk/volar/blob/master/packages/vue-component-meta/src/types.ts) for more details.

### Extracting prop meta

Expand Down Expand Up @@ -166,7 +166,7 @@ You need to add `as const` to variable definition:

## Reference 📚

- [tests](https://github.com/johnsoncodehk/volar/blob/master/vue-language-tools/vue-component-meta/tests/index.spec.ts)
- [tests](https://github.com/johnsoncodehk/volar/blob/master/packages/vue-component-meta/tests/index.spec.ts)
- [Anu's components' API automation](https://github.com/jd-solanki/anu/blob/main/scripts/gen-component-meta.ts)
- [Discord chat for dynamic usage](https://discord.com/channels/793943652350427136/1027819645677350912)

Expand Down
Expand Up @@ -10,7 +10,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/vue-component-meta"
"directory": "packages/vue-component-meta"
},
"dependencies": {
"@volar/language-core": "1.2.0-alpha.9",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -10,7 +10,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/vue-language-core"
"directory": "packages/vue-language-core"
},
"dependencies": {
"@volar/language-core": "1.2.0-alpha.9",
Expand Down
Expand Up @@ -20,7 +20,7 @@
"extensions": {
"type": "array",
"default": [ ".vue" ],
"markdownDescription": "Valid file extensions that should be considered as regular Vue SFC, please note that you should not use this option separately for additional file extensions IDE support, see https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vscode-vue/README.md#custom-file-extensions."
"markdownDescription": "Valid file extensions that should be considered as regular Vue SFC, please note that you should not use this option separately for additional file extensions IDE support, see https://github.com/johnsoncodehk/volar/tree/master/packages/vscode-vue/README.md#custom-file-extensions."
},
"jsxTemplates": {
"type": "boolean",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -10,7 +10,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/vue-language-plugin-pug"
"directory": "packages/vue-language-plugin-pug"
},
"devDependencies": {
"@volar/vue-language-core": "1.0.24"
Expand Down
File renamed without changes.
Expand Up @@ -13,7 +13,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/vue-language-server"
"directory": "packages/vue-language-server"
},
"dependencies": {
"@volar/language-core": "1.2.0-alpha.9",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -10,7 +10,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/vue-language-service"
"directory": "packages/vue-language-service"
},
"dependencies": {
"@volar-plugins/css": "2.0.0-alpha.2",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -11,7 +11,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/vue-tsc-eslint"
"directory": "packages/vue-tsc-eslint"
},
"devDependencies": {
"@types/eslint": "latest",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -11,7 +11,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/vue-tsc"
"directory": "packages/vue-tsc"
},
"bin": {
"vue-tsc": "./bin/vue-tsc.js"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -10,7 +10,7 @@
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "vue-language-tools/vue-typescript"
"directory": "packages/vue-typescript"
},
"dependencies": {
"@volar/typescript": "1.2.0-alpha.9",
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 8ae964b

Please sign in to comment.