Skip to content

Commit 8134dc1

Browse files
authored
chore(vue): Cleanup vue related code (#225)
1 parent 297826b commit 8134dc1

File tree

15 files changed

+1710
-2320
lines changed

15 files changed

+1710
-2320
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@ jobs:
1212
timeout-minutes: 30
1313
steps:
1414
- uses: actions/checkout@v2
15-
- run: npx prettier --check "{src,typescript}/**/*.ts" --ignore-path .gitignore
16-
- name: Cache pnpm modules
17-
uses: actions/cache@v2
15+
- uses: actions/setup-node@v3
1816
with:
19-
path: ~/.pnpm-store
20-
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
21-
restore-keys: |
22-
${{ runner.os }}-
23-
- uses: pnpm/[email protected]
17+
node-version: '22.x'
18+
registry-url: 'https://registry.npmjs.org'
19+
- run: npx prettier --check "{src,typescript}/**/*.ts" --ignore-path .gitignore
20+
- uses: pnpm/action-setup@v4
2421
with:
25-
version: latest
2622
run_install: |
2723
args: [--frozen-lockfile, --strict-peer-dependencies]
2824
- run: pnpm lint
@@ -35,7 +31,7 @@ jobs:
3531
if: ${{ runner.os == 'Windows' }}
3632
- run: cd out && npx @vscode/vsce package --out ../extension.vsix
3733
- name: Archive production artifacts
38-
uses: actions/upload-artifact@v3
34+
uses: actions/upload-artifact@v4
3935
with:
4036
name: extension
4137
path: |

.github/workflows/release.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,15 @@ jobs:
1010
timeout-minutes: 30
1111
# needs: test
1212
steps:
13-
- name: Setup Node.js
14-
uses: actions/setup-node@v3
13+
- uses: actions/setup-node@v3
1514
with:
16-
node-version: 20
15+
node-version: '22.x'
16+
registry-url: 'https://registry.npmjs.org'
1717
- run: npm -v
1818
- run: node -v
1919
- uses: actions/checkout@v2
20-
- name: Cache pnpm modules
21-
uses: actions/cache@v2
20+
- uses: pnpm/action-setup@v4
2221
with:
23-
path: ~/.pnpm-store
24-
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
25-
restore-keys: |
26-
${{ runner.os }}-
27-
- uses: pnpm/[email protected]
28-
with:
29-
version: latest
3022
run_install: |
3123
args: [--frozen-lockfile, --strict-peer-dependencies]
3224
- run: pnpx zardoy-release vscode-extension

.vscode/launch.json

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,6 @@
3434
"${workspaceFolder}/out/**/*.js"
3535
],
3636
},
37-
{
38-
"name": "Attach to Vue Semantic Server",
39-
"type": "node",
40-
"request": "attach",
41-
"restart": true,
42-
"port": 6009,
43-
"sourceMaps": true,
44-
"outFiles": [
45-
"${workspaceFolder}/out/**/*.js"
46-
],
47-
}
4837
],
4938
"compounds": [
5039
{
@@ -54,12 +43,5 @@
5443
"Attach to TS Server"
5544
]
5645
},
57-
{
58-
"name": "Extension + Volar",
59-
"configurations": [
60-
"Launch Extension",
61-
"Attach to Vue Semantic Server"
62-
]
63-
},
6446
]
65-
}
47+
}

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
],
1515
"tsEssentialPlugins.suggestions.ignoreAutoImports": [
1616
"typescript-full",
17-
"@volar/language-service/*"
1817
],
1918
"githubPullRequests.ignoredPullRequestBranches": [
2019
"develop"
@@ -29,4 +28,4 @@
2928
"vitest.include": [
3029
"typescript/test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"
3130
],
32-
}
31+
}

CONTRIBUTING.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To start the VS Code plugin extension locally for developing:
2525

2626
- `src/*` - VS Code extension code, that is specific to VS Code extension API only. Most probably you don't need to change it. (For now there is a limitation from vscode-framework so folder name cannot be changed to something like `extension` or `vscode`.)
2727
- `src/configurationType.ts` - Extension configuration live here. Add / change settings here. It is used to generate `out/package.json`'s `contributes.configuration`.
28-
- `typescript/*` - TypeScript plugin code, that integrates into TypeScript language service. After you change code in it, you need run to `> TypeScript: Restart TS server` to see changes (or `> Volar: Restart Vue server` for Vue files). Thats why it is useful to bind it to a shortcut.
28+
- `typescript/*` - TypeScript plugin code, that integrates into TypeScript language service. After you change code in it, you need run to `> TypeScript: Restart TS server` to see changes. Thats why it is useful to bind it to a shortcut.
2929

3030
### Running Tests
3131

README.MD

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ We make completions more informative. Definitions, references (and sometimes eve
1515
- [Top Features](#top-features)
1616
- [Minor Useful Features](#minor-useful-features)
1717
- [Method Snippets](#method-snippets)
18-
- [Volar (Vue) Support](#vue-support)
1918
- [Auto Imports](#auto-imports)
2019
- [Type Driven Completions](#type-driven-completions)
2120
- [Special Commands List](#special-commands-list)
2221
- [Contributed Code Actions](#contributed-code-actions)
2322
- [Rename Features](#rename-features)
23+
- [Vue Support](#vue-support)
2424
- [Even Even More](#even-even-more)
2525

2626
> *Note*: You can disable all optional features with `> Disable All Optional Features` command just after installing.
@@ -122,18 +122,6 @@ Removes import statements from references when symbol has usages in the same fil
122122

123123
You can quickly disable this plugin functionality by setting this setting to false. Useful for debugging a problem for example.
124124

125-
> Note: this setting doesn't disable Vue support.
126-
127-
### Vue Support
128-
129-
`.vue` SFC files support is disabled, but can be enabled with setting and when [Vue Language Features (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) is installed.
130-
131-
Enable now: `"tsEssentialPlugins.enableVueSupport": true` (if you're not using local `./volar.config.js`)
132-
133-
For the first time, it will configure `volar.vueserver.configFilePath` setting.
134-
135-
This also makes plugin work in Volar's takeover mode!
136-
137125
### Web Support
138126

139127
> Note: when you open TS/JS file in the web for the first time you currently need to switch between editors to make plugin work.
@@ -459,6 +447,10 @@ You can add this to `keybindings.json` to disable previewing before renaming:
459447

460448
> Note: VS Code has builtin setting to disable introducing aliases (e.g. for imports & object properties): `typescript.preferences.useAliasesForRenames`
461449
450+
## Vue Support
451+
452+
Vue is only supported if the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar) is above version 3.0.2.
453+
462454
## Special Commands List
463455

464456
### Go to / Select Nodes by Kind

buildTsPlugin.mjs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
11
//@ts-check
22
import buildTsPlugin from '@zardoy/vscode-utils/build/buildTypescriptPlugin.js'
3-
import { build, analyzeMetafile } from 'esbuild'
43
import fs from 'fs'
54

65
const enableWatch = process.argv.includes('--watch')
7-
await build({
8-
bundle: true,
9-
external: ['typescript-essential-plugins'],
10-
// minify: !watch,
11-
watch: enableWatch,
12-
entryPoints: ['./typescript/src/volarConfig.ts'],
13-
outfile: './out/volarConfig.js',
14-
format: 'cjs',
15-
logLevel: 'info',
16-
platform: 'node',
17-
// banner: {
18-
// js: 'let ts, tsFull;',
19-
// },
20-
// treeShaking: true,
21-
})
226

237
const result = await buildTsPlugin('typescript', undefined, undefined, {
248
minify: !enableWatch,
@@ -28,7 +12,6 @@ const result = await buildTsPlugin('typescript', undefined, undefined, {
2812
},
2913
banner: {
3014
js: 'let ts, tsFull;',
31-
// js: 'const log = (...args) => console.log(...args.map(a => JSON.stringify(a)))',
3215
},
3316
external: ['perf_hooks'],
3417
plugins: [
@@ -48,6 +31,3 @@ const result = await buildTsPlugin('typescript', undefined, undefined, {
4831
},
4932
],
5033
})
51-
52-
// @ts-ignore
53-
// console.log(await analyzeMetafile(result.metafile))

package.json

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
"build-plugin": "node buildTsPlugin.mjs && node buildTsPlugin.mjs --browser",
135135
"build-plugin:npm": "tsc -p typescript/tsconfig.npm.json",
136136
"lint": "eslint {src/**,typescript/src/**}",
137+
"format": "prettier --write '{src,typescript}/**/*.ts' --ignore-path .gitignore",
137138
"test": "pnpm test-plugin --run && pnpm integration-test",
138139
"test-plugin": "vitest --globals --dir typescript/test/ --environment ts-plugin",
139140
"integration-test": "node integration/prerun.mjs && tsc -p tsconfig.test.json && node testsOut/runTests.js",
@@ -148,10 +149,13 @@
148149
"@types/vscode": "1.72.0",
149150
"@vitest/ui": "^0.34.6",
150151
"@zardoy/tsconfig": "^1.3.1",
152+
"chokidar": "^3.5.3",
153+
"chokidar-cli": "^3.0.0",
151154
"esbuild": "^0.16.16",
152155
"fs-extra": "^10.1.0",
153156
"got": "^12.5.3",
154157
"got-cjs": "npm:got@^11.x",
158+
"npm-run-all": "^4.1.5",
155159
"prettier": "3.1.0",
156160
"tsm": "^2.3.0",
157161
"type-fest": "^2.13.1",
@@ -160,15 +164,21 @@
160164
"vite": "^4.1.1",
161165
"vitest": "^0.34.6",
162166
"vitest-environment-ts-plugin": "./vitest-environment-ts-plugin",
163-
"vscode-manifest": "^0.0.4",
164-
"chokidar": "^3.5.3",
165-
"chokidar-cli": "^3.0.0",
166-
"npm-run-all": "^4.1.5"
167+
"vscode-manifest": "^0.0.4"
167168
},
168169
"pnpm": {
169170
"overrides": {
170171
"esbuild": "^0.15.15"
171-
}
172+
},
173+
"ignoredBuiltDependencies": [
174+
"playwright"
175+
],
176+
"onlyBuiltDependencies": [
177+
"esbuild",
178+
"typed-vscode",
179+
"unleashed-typescript",
180+
"vscode-framework"
181+
]
172182
},
173183
"dependencies": {
174184
"@types/chai": "^4.3.3",
@@ -178,9 +188,6 @@
178188
"@types/pluralize": "^0.0.29",
179189
"@vscode/emmet-helper": "^2.8.4",
180190
"@vscode/test-electron": "^2.1.5",
181-
"@vue/language-core": "latest",
182-
"@vue/language-server": "latest",
183-
"@vue/language-service": "latest",
184191
"@zardoy/utils": "^0.0.9",
185192
"@zardoy/vscode-utils": "^0.0.52",
186193
"chai": "^4.3.6",
@@ -223,5 +230,6 @@
223230
"preset": {
224231
"runTest": false
225232
}
226-
}
227-
}
233+
},
234+
"packageManager": "[email protected]+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac"
235+
}

0 commit comments

Comments
 (0)