Skip to content

Commit e5cc3f2

Browse files
authored
refactor: switch to oxc (#748)
1 parent 371ea35 commit e5cc3f2

142 files changed

Lines changed: 2113 additions & 4070 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/renovate.json5‎

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["config:base", "schedule:weekly", "group:allNonMajor"],
4-
"labels": ["dependencies"],
5-
"rangeStrategy": "bump",
6-
"packageRules": [
2+
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
3+
extends: ['config:base', 'schedule:weekly', 'group:allNonMajor'],
4+
labels: ['dependencies'],
5+
rangeStrategy: 'bump',
6+
packageRules: [
77
{
8-
"groupName": "Eslint packages",
9-
"matchPackageNames": ["/eslint/"]
8+
depTypeList: ['peerDependencies'],
9+
enabled: false,
1010
},
1111
{
12-
"depTypeList": ["peerDependencies"],
13-
"enabled": false
12+
matchDepTypes: ['action'],
13+
matchPackageNames: ['!actions/{/,}**', '!github/{/,}**'],
14+
pinDigests: true,
1415
},
1516
{
16-
"matchDepTypes": ["action"],
17-
"matchPackageNames": ["!actions/{/,}**", "!github/{/,}**"],
18-
"pinDigests": true
17+
matchFileNames: ['samples/**'],
18+
enabled: false,
1919
},
20-
{
21-
"matchFileNames": ["samples/**"],
22-
"enabled": false
23-
}
24-
]
20+
],
2521
}

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- run: pnpm install --filter="vitest-vscode-*" --frozen-lockfile
2424
- run: pnpm build
2525
- run: pnpm typecheck
26-
- run: pnpm lint
26+
- run: pnpm fmt
2727

2828
test:
2929
runs-on: ${{ matrix.os }}

‎.oxfmtrc.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"ignorePatterns": [],
4+
"semi": false,
5+
"singleQuote": true
6+
}

‎.vscode/launch.json‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
"name": "Run Extension Basic Sample",
1010
"type": "extensionHost",
1111
"request": "launch",
12-
"args": [
13-
"--extensionDevelopmentPath=${workspaceFolder}",
14-
"${workspaceFolder}/samples/basic"
15-
],
12+
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "${workspaceFolder}/samples/basic"],
1613
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
1714
},
1815
{
@@ -51,10 +48,7 @@
5148
"name": "Run Extension Imba Sample",
5249
"type": "extensionHost",
5350
"request": "launch",
54-
"args": [
55-
"--extensionDevelopmentPath=${workspaceFolder}",
56-
"${workspaceFolder}/samples/imba"
57-
],
51+
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "${workspaceFolder}/samples/imba"],
5852
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
5953
},
6054
{
@@ -151,10 +145,7 @@
151145
"name": "Run Extension Vue Sample",
152146
"type": "extensionHost",
153147
"request": "launch",
154-
"args": [
155-
"--extensionDevelopmentPath=${workspaceFolder}",
156-
"${workspaceFolder}/samples/vue"
157-
],
148+
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "${workspaceFolder}/samples/vue"],
158149
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
159150
},
160151
{

‎.vscode/settings.json‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
// Enable the ESlint flat config support
4-
"eslint.experimental.useFlatConfig": true,
5-
6-
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
7-
"typescript.tsc.autoDetect": "off",
83
// Disable the default formatter, use eslint instead
94
"prettier.enable": false,
10-
"editor.formatOnSave": false,
5+
"editor.formatOnSave": true,
6+
7+
"editor.defaultFormatter": "oxc.oxc-vscode",
118

129
// Auto fix
1310
"editor.codeActionsOnSave": {
14-
"source.fixAll.eslint": "explicit",
11+
"source.fixAll.oxc": "always",
1512
"source.organizeImports": "never"
1613
},
1714

18-
"testing.openTesting": "neverOpen",
19-
2015
// Enable eslint for all supported languages
2116
"eslint.validate": [
2217
"javascript",
@@ -30,5 +25,8 @@
3025
"jsonc",
3126
"yaml"
3227
],
33-
"testing.automaticallyOpenTestResults": "neverOpen"
28+
"testing.automaticallyOpenTestResults": "neverOpen",
29+
"[typescript]": {
30+
"editor.defaultFormatter": "oxc.oxc-vscode"
31+
}
3432
}

‎CHANGELOG.md‎

Lines changed: 71 additions & 116 deletions
Large diffs are not rendered by default.

‎CLAUDE.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,38 @@ The project uses a monorepo structure with multiple packages that work together:
1919
### Key Components
2020

2121
- **Extension Host** (packages/extension): Manages VSCode integration, test discovery, debugging, coverage
22-
- **Worker Processes** (packages/worker*): Execute Vitest in isolated processes, handle test running and reporting
22+
- **Worker Processes** (packages/worker\*): Execute Vitest in isolated processes, handle test running and reporting
2323
- **RPC Communication** (packages/shared): Bidirectional communication between extension and workers using birpc
2424
- **API Abstraction**: Supports both child_process and terminal shell types for running Vitest
2525

2626
## Development Commands
2727

2828
### Building
29+
2930
```bash
3031
pnpm build # Build for production (minified)
3132
pnpm dev # Build in development mode with watch and sourcemap
3233
pnpm vscode:prepublish # Prepare for publishing (runs build)
3334
```
3435

3536
### Testing
37+
3638
```bash
3739
pnpm test # Run unit tests (Mocha-based VSCode tests)
3840
pnpm test:watch # Run unit tests in watch mode
3941
pnpm test-e2e # Run end-to-end tests (Vitest-based)
4042
```
4143

4244
### Code Quality
45+
4346
```bash
4447
pnpm typecheck # TypeScript type checking
4548
pnpm lint # Run ESLint
4649
pnpm lint:fix # Run ESLint with auto-fix
4750
```
4851

4952
### Packaging
53+
5054
```bash
5155
pnpm package # Create .vsix package for distribution
5256
```
@@ -72,6 +76,7 @@ Uses **pnpm** with workspaces. The project requires pnpm@10.11.1 as specified in
7276
## Worker Architecture
7377

7478
The extension uses a multi-process architecture:
79+
7580
- Extension runs in VSCode extension host
7681
- Worker processes execute Vitest in isolation
7782
- Communication via RPC (birpc)

‎README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Vitest uses vscode's `TestController` API to provide a unified testing experienc
3131

3232
### In the Testing View
3333

34-
![Testing view](./img/vitest-extension.png "Testing view")
34+
![Testing view](./img/vitest-extension.png 'Testing view')
3535

3636
You can access the extension from the Testing view in the Visual Studio Code sidebar.
3737

@@ -53,7 +53,7 @@ Icons next to each test indicate their status—passed (checkmark), failed (cros
5353

5454
### In the Test File
5555

56-
![Vitest test file](./img/vitest-test-file.png "Vitest test file")
56+
![Vitest test file](./img/vitest-test-file.png 'Vitest test file')
5757

5858
When viewing a test file, you'll notice test icons in the gutter next to each test case:
5959

@@ -113,19 +113,19 @@ These options are resolved relative to the [workspace file](https://code.visuals
113113

114114
You can reveal the current test file in the test explorer view by selecting the "Reveal in Test Explorer" option (the last option on the screenshot) in the file context:
115115

116-
![Reveal test in explorer](./img/reveal-in-explorer.png "Reveal test in explorer")
116+
![Reveal test in explorer](./img/reveal-in-explorer.png 'Reveal test in explorer')
117117

118118
You can also type the same command in the quick picker while the file is open.
119119

120-
![Reveal test in explorer](./img/reveal-in-picker.png "Reveal test in explorer")
120+
![Reveal test in explorer](./img/reveal-in-picker.png 'Reveal test in explorer')
121121

122122
### Import Breakdown
123123

124124
If you use Vitest 4.0.15 or higher, during continuous runs the extension will show how long it took to load the module on the same line where the import is defined. This number includes transform time and evaluation time, including static imports.
125125

126126
If you hover over it, you can get a more detailed diagnostic.
127127

128-
![Import breakdown example](./img/import-breakdown.png "Import breakdown example")
128+
![Import breakdown example](./img/import-breakdown.png 'Import breakdown example')
129129

130130
You can disable this feature by turning off `vitest.showImportsDuration`.
131131

@@ -141,11 +141,11 @@ By default, the extension doens't rerun tests when files change.
141141

142142
Click on the "eye" icon next to the test, file or a directory to enable "continuous run" for a related item. Whenever that test, file or any file in the directory changes, Vitest will rerun that test. Note that Vitest will also rerun tests if an imported module of the file is changed.
143143

144-
![Turn on continuous run button for a test](./img/eye-item-icon.png "Turn on continuous run button for a test")
144+
![Turn on continuous run button for a test](./img/eye-item-icon.png 'Turn on continuous run button for a test')
145145

146146
To enabled continuous run globally, click on the "eye" icon in the "Test Explorer" row.
147147

148-
![Start continuous run button](./img/eye-global-icon.png "Start continuous run button")
148+
![Start continuous run button](./img/eye-global-icon.png 'Start continuous run button')
149149

150150
### How to hide Test Results view when running tests
151151

@@ -154,7 +154,7 @@ You can change the behaviour of testing view by modifying `testing.automatically
154154
- `neverOpen` will never open the testing view
155155
- `openOnTestStart` (default) opens the test results view when test starts running
156156
- `openOnTestFailure` opens the test results view if at least one of test fails
157-
- `openExplorerOnTestStart` will open the test tree view when tests starts
157+
- `openExplorerOnTestStart` will open the test tree view when tests starts
158158

159159
This is a vscode's built-in option and will control every plugin.
160160

‎debug-shims.d.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ declare module '@vscode/js-debug' {
1515
* try to modify options in a additive way. For example prefer appending
1616
* to rather than reading and overwriting `options.env.PATH`.
1717
*/
18-
provideTerminalOptions(options: vscode.TerminalOptions): vscode.ProviderResult<vscode.TerminalOptions>
18+
provideTerminalOptions(
19+
options: vscode.TerminalOptions,
20+
): vscode.ProviderResult<vscode.TerminalOptions>
1921
}
2022

2123
/**

‎eslint.config.mjs‎

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@ export default antfu(
55
// Disable tests rules because we need to test with various setup
66
test: false,
77
// This replaces the old `.gitignore`
8-
ignores: [
9-
'**/coverage',
10-
'**/*.snap',
11-
'**/bench.json',
12-
'**/fixtures',
13-
'**/samples',
14-
'test',
15-
],
8+
ignores: ['**/coverage', '**/*.snap', '**/bench.json', '**/fixtures', '**/samples', 'test'],
169
},
1710
{
1811
rules: {
@@ -22,7 +15,7 @@ export default antfu(
2215
'no-empty-pattern': 'off',
2316
'antfu/indent-binary-ops': 'off',
2417
'unused-imports/no-unused-imports': 'error',
25-
'curly': 'off',
18+
curly: 'off',
2619
'e18e/prefer-static-regex': 'off',
2720
'pnpm/yaml-no-duplicate-catalog-item': 'off',
2821
'style/member-delimiter-style': [
@@ -67,9 +60,7 @@ export default antfu(
6760
},
6861
},
6962
{
70-
files: [
71-
`docs/${GLOB_SRC}`,
72-
],
63+
files: [`docs/${GLOB_SRC}`],
7364
rules: {
7465
'style/max-statements-per-line': 'off',
7566
'import/newline-after-import': 'off',
@@ -78,11 +69,7 @@ export default antfu(
7869
},
7970
},
8071
{
81-
files: [
82-
`docs/${GLOB_SRC}`,
83-
`packages/web-worker/${GLOB_SRC}`,
84-
`test/web-worker/${GLOB_SRC}`,
85-
],
72+
files: [`docs/${GLOB_SRC}`, `packages/web-worker/${GLOB_SRC}`, `test/web-worker/${GLOB_SRC}`],
8673
rules: {
8774
'no-restricted-globals': 'off',
8875
},

0 commit comments

Comments
 (0)