Skip to content

Commit

Permalink
refactor: reorganize packages (#3685)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk authored Oct 23, 2023
1 parent c5f0a7f commit ce5623e
Show file tree
Hide file tree
Showing 211 changed files with 177 additions and 265 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- run: npm i -g pnpm ovsx
- run: pnpm install --frozen-lockfile --no-optional
- run: pnpm run build:minify && pnpm ovsx publish
working-directory: packages/vscode-vue
working-directory: extensions/vscode
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
- run: pnpm ovsx publish
working-directory: packages/vscode-typescript-vue-plugin
working-directory: extensions/vscode-typescript-plugin
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
4 changes: 2 additions & 2 deletions .github/workflows/update-html-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:

# update data
- name: Update HTML Data
run: cd packages/vue-language-service && npm run update-html-data
run: cd packages/language-service && npm run update-html-data

# commit
- name: Commit
uses: EndBug/add-and-commit@v9
with:
message: "ci(language-service): update html data"
add: "packages/vue-language-service/data"
add: "packages/language-service/data"
default_author: github_actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ node_modules
*.tsbuildinfo
*.vsix
.vscode-test-web
packages/vscode-vue/meta.json
packages/vscode-vue/stats.html
extensions/*/meta.json
extensions/*/stats.html
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"runtimeExecutable": "${execPath}",
"args": [
// "--disable-extensions",
"--extensionDevelopmentPath=${workspaceRoot}/packages/vscode-vue"
"--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode"
],
"outFiles": [
"${workspaceRoot}/*/*/out/**/*.js"
Expand All @@ -26,7 +26,7 @@
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceRoot}/packages/vscode-typescript-vue-plugin"
"--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode-typescript-plugin"
],
"outFiles": [
"${workspaceRoot}/*/*/out/**/*.js"
Expand All @@ -43,7 +43,7 @@
"request": "launch",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-vue",
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode",
"--extensionDevelopmentKind=web"
],
"outFiles": [
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"vue.server.path": "./packages/vscode-vue/server.js",
"vue.server.path": "./extensions/vscode/server.js",
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ do not force config `compatConfig: { Mode: 2 }` to template compiler with `"expe

## 0.28.6 (2021/10/16)

- feat: support for emit SFC dts by vue-tsc (See https://github.com/vuejs/language-tools/tree/master/packages/vue-tsc#using)
- feat: support for emit SFC dts by vue-tsc (See https://github.com/vuejs/language-tools/tree/master/packages/tsc#using)

## 0.28.5 (2021/10/16)

Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Discord: https://discord.gg/5bnSSSSBbK

## Packages

- [Vue Language Features](https://github.com/vuejs/language-tools/tree/master/packages/vscode-vue) \
- [Vue Language Features](https://github.com/vuejs/language-tools/tree/master/extensions/vscode) \
*Vue, Vitepress, petite-vue language support extension for VSCode*
- [TypeScript Vue Plugin](https://github.com/vuejs/language-tools/tree/master/packages/vscode-typescript-vue-plugin) \
- [TypeScript Vue Plugin](https://github.com/vuejs/language-tools/tree/master/extensions/vscode-typescript-plugin) \
*VSCode extension to support Vue in TS server*
- [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/vue-tsc) \
- [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/tsc) \
*Type-check and dts build command line tool*
- [vue-component-meta](https://github.com/vuejs/language-tools/tree/master/packages/vue-component-meta) \
- [vue-component-meta](https://github.com/vuejs/language-tools/tree/master/packages/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 @@ -117,8 +117,8 @@ flowchart LR
VSC_VUE[vscode-vue]
VSC_TSVP[vscode-typescript-vue-plugin]
click VSC_VUE "https://github.com/vuejs/language-tools/tree/master/packages/vscode-vue"
click VSC_TSVP "https://github.com/vuejs/language-tools/tree/master/packages/vscode-typescript-vue-plugin"
click VSC_VUE "https://github.com/vuejs/language-tools/tree/master/extensions/vscode"
click VSC_TSVP "https://github.com/vuejs/language-tools/tree/master/extensions/vscode-typescript-plugin"
%% Volar - Packages
VOLAR_VUE_SERVER["@vue/language-server"]
Expand All @@ -131,13 +131,13 @@ flowchart LR
VUE_COMPONENT_META[vue-component-meta]
TS_VUE_PLUGIN[typescript-vue-plugin]
click VOLAR_VUE_SERVER "https://github.com/vuejs/language-tools/tree/master/packages/vue-language-server"
click VOLAR_VUE_TS "https://github.com/vuejs/language-tools/tree/master/packages/vue-typescript"
click VOLAR_VUE_CORE "https://github.com/vuejs/language-tools/tree/master/packages/vue-language-core"
click VOLAR_VUE_SERVICE "https://github.com/vuejs/language-tools/tree/master/packages/vue-language-service"
click VUE_TSC "https://github.com/vuejs/language-tools/tree/master/packages/vue-tsc"
click VUE_COMPONENT_META "https://github.com/vuejs/language-tools/tree/master/packages/vue-component-meta"
click TS_VUE_PLUGIN "https://github.com/vuejs/language-tools/tree/master/packages/typescript-vue-plugin"
click VOLAR_VUE_SERVER "https://github.com/vuejs/language-tools/tree/master/packages/language-server"
click VOLAR_VUE_TS "https://github.com/vuejs/language-tools/tree/master/packages/typescript"
click VOLAR_VUE_CORE "https://github.com/vuejs/language-tools/tree/master/packages/language-core"
click VOLAR_VUE_SERVICE "https://github.com/vuejs/language-tools/tree/master/packages/language-service"
click VUE_TSC "https://github.com/vuejs/language-tools/tree/master/packages/tsc"
click VUE_COMPONENT_META "https://github.com/vuejs/language-tools/tree/master/packages/component-meta"
click TS_VUE_PLUGIN "https://github.com/vuejs/language-tools/tree/master/packages/typescript-plugin"
click VOLAR_PUG_SERVICE "https://github.com/vuejs/language-tools/tree/master/packages/pug-language-service"
click VOLAR_TS_SERVICE "https://github.com/vuejs/language-tools/tree/master/packages/typescript-language-service"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vscode-typescript-vue-plugin"
"directory": "extensions/vscode-typescript-plugin"
},
"sponsor": {
"url": "https://github.com/sponsors/johnsoncodehk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
},
"include": [ "src" ],
"references": [
{ "path": "../typescript-vue-plugin/tsconfig.json" },
{ "path": "../../packages/typescript-plugin/tsconfig.json" },
]
}
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vscode-vue"
"directory": "packages/vscode"
},
"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.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,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/vuejs/language-tools/blob/master/packages/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/vuejs/language-tools/blob/master/extensions/vscode/src/features/doctor.ts).\n\n`;

return content.trim();
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions extensions/vscode/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "out",
"rootDir": "src",
},
"include": [ "src" ],
"references": [
{ "path": "../../packages/language-server/tsconfig.json" },
],
}
File renamed without changes.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
"scripts": {
"build": "tsc -b",
"build-ci": "tsc -b tsconfig.ci.json",
"watch": "npm run build && (npm run watch:base & npm run watch:vue & npm run watch:typescript-vue-plugin)",
"watch": "npm run build && (npm run watch:base & npm run watch:vue & npm run watch:ts-plugin)",
"watch:base": "tsc -b -w",
"watch:vue": "cd ./packages/vscode-vue && npm run watch",
"watch:typescript-vue-plugin": "cd ./packages/vscode-typescript-vue-plugin && npm run watch",
"watch:vue": "cd ./extensions/vscode && npm run watch",
"watch:ts-plugin": "cd ./extensions/vscode-typescript-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:typescript-vue-plugin",
"release": "npm run release:base && npm run release:vue && npm run release:ts-plugin",
"release:base": "lerna publish --exact --force-publish --yes --sync-workspace-lock --no-push",
"release:vue": "cd ./packages/vscode-vue && npm run release",
"release:typescript-vue-plugin": "cd ./packages/vscode-typescript-vue-plugin && npm run release",
"release:next": "npm run release:next-base && npm run release:next-vue && npm run release:next-typescript-vue-plugin",
"release:vue": "cd ./extensions/vscode && npm run release",
"release:ts-plugin": "cd ./extensions/vscode-typescript-plugin && npm run release",
"release:next": "npm run release:next-base && npm run release:next-vue && npm run release:next-ts-plugin",
"release:next-base": "npm run release:base -- --dist-tag next",
"release:next-vue": "cd ./packages/vscode-vue && npm run release:next",
"release:next-typescript-vue-plugin": "cd ./packages/vscode-typescript-vue-plugin && npm run release:next",
"release:next-vue": "cd ./extensions/vscode && npm run release:next",
"release:next-ts-plugin": "cd ./extensions/vscode-typescript-plugin && npm run release:next",
"test": "vitest run",
"chrome": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=./packages/vscode-vue ../volar-starter"
"chrome": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=./extensions/vscode ../volar-starter"
},
"devDependencies": {
"@types/node": "latest",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
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/vuejs/language-tools/blob/master/packages/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/vuejs/language-tools/blob/master/packages/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/vuejs/language-tools/blob/master/packages/vue-component-meta/tests/index.spec.ts)
- [tests](https://github.com/vuejs/language-tools/blob/master/packages/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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vue-component-meta"
"directory": "packages/component-meta"
},
"dependencies": {
"@volar/typescript": "~1.10.4",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
},
"include": [ "src" ],
"references": [
{ "path": "../vue-language-core/tsconfig.json" },
{ "path": "../language-core/tsconfig.json" },
],
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vue-component-type-helpers"
"directory": "packages/component-type-helpers"
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vue-language-core"
"directory": "packages/language-core"
},
"dependencies": {
"@volar/language-core": "~1.10.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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/vuejs/language-tools/tree/master/packages/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/vuejs/language-tools/tree/master/extensions/vscode/README.md#custom-file-extensions."
},
"lib": {
"default": "",
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.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vue-language-plugin-pug"
"directory": "packages/language-plugin-pug"
},
"devDependencies": {
"@vue/language-core": "1.8.20"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
},
"include": [ "src" ],
"references": [
{ "path": "../vue-language-core/tsconfig.json" },
{ "path": "../language-core/tsconfig.json" },
],
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vue-language-server"
"directory": "packages/language-server"
},
"dependencies": {
"@volar/language-core": "~1.10.4",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
},
"include": [ "src" ],
"references": [
{ "path": "../vue-language-core/tsconfig.json" },
{ "path": "../vue-typescript/tsconfig.json" },
{ "path": "../language-core/tsconfig.json" },
{ "path": "../language-service/tsconfig.json" },
{ "path": "../component-meta/tsconfig.json" },
],
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vue-language-service"
"directory": "packages/language-service"
},
"scripts": {
"update-html-data": "node ./scripts/update-html-data.js"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
},
"include": [ "src" ],
"references": [
{ "path": "../vue-language-server/tsconfig.json" },
{ "path": "../language-core/tsconfig.json" },
],
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vue-tsc-eslint"
"directory": "packages/tsc-eslint"
},
"devDependencies": {
"@types/eslint": "latest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export = async function (
useEslintrc: false,
});
const fileNames = program.__vue.languageHost.getScriptFileNames();
const mapper = program.__vue.languageService.__internal__.context.virtualFiles;
const mapper = program.__vue.langaugeContext.virtualFiles;
const formatter = await eslint.loadFormatter();

for (const fileName of fileNames) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
},
"include": [ "src" ],
"references": [
{ "path": "../vue-tsc/tsconfig.json" },
{ "path": "../tsc/tsconfig.json" },
],
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/vue-tsc/package.json → packages/tsc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
"directory": "packages/vue-tsc"
"directory": "packages/tsc"
},
"bin": {
"vue-tsc": "./bin/vue-tsc.js"
},
"dependencies": {
"@volar/typescript": "~1.10.4",
"@vue/language-core": "1.8.20",
"@vue/typescript": "1.8.20",
"semver": "^7.5.4"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit ce5623e

Please sign in to comment.