Skip to content

Commit 99013f7

Browse files
committed
bundle the extension
1 parent b4bf225 commit 99013f7

File tree

4 files changed

+60
-39
lines changed

4 files changed

+60
-39
lines changed

packages/vscode/README.md

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,36 @@
1-
# Rstest VS Code Extension
1+
# Rstest VS Code extension
22

3-
A VS Code extension that discovers and runs tests for your project.
3+
Rstest is a VS Code extension that discovers, displays, and runs tests in your workspace. It builds a rich Test Explorer tree from your test files and keeps it up to date as files change.
44

5-
## Configuration
6-
7-
The extension reads settings with the following priority:
5+
## Features
86

9-
1. Workspace Folder
10-
2. Workspace
11-
3. User
12-
4. Default
7+
- Discovers test files via configurable glob patterns
8+
- Parses test structure to build a nested tree (describe/suite/test)
9+
- Runs individual tests, suites, or entire files
10+
- Watches the filesystem and updates the tree on create/change/delete
1311

14-
| Setting | Type | Scope | Default | Description |
15-
| ---------------------------- | ------------------ | -------- | -------------------------------- | ------------------------------------------------------------- |
16-
| `rstest.testFileGlobPattern` | string[] | Resource | `["**/*.test.*", "**/*.spec.*"]` | Glob pattern(s) used to discover test files in the workspace. |
12+
## Activation
1713

18-
Notes
14+
The extension activates automatically when your workspace contains Rstest configuration files (e.g., `rstest.config.*`, `rstest.workspace.*`, `rstest.projects.*`). On activation, it eagerly scans the workspace and populates the Test Explorer.
1915

20-
- Must be an array of strings.
21-
- Applied per workspace folder when set at the folder level.
22-
23-
### Examples
16+
## Configuration
2417

25-
settings.json (User/Workspace):
18+
| Setting | Type | Scope | Default | Description |
19+
| ---------------------------- | -------- | -------- | -------------------------------- | ------------------------------------------------------------- |
20+
| `rstest.testFileGlobPattern` | string[] | Resource | `["**/*.test.*", "**/*.spec.*"]` | Glob pattern(s) used to discover test files in the workspace. |
2621

27-
```json
28-
{
29-
"rstest.testFileGlobPattern": ["**/*.test.ts", "**/*.spec.tsx"]
30-
}
31-
```
22+
## How it Works
3223

33-
Per-folder override (settings.json in a specific folder):
24+
- On activation, the extension scans for test files using `rstest.testFileGlobPattern` and creates a Test Explorer tree.
25+
- File system watchers keep the tree synchronized as files are created, modified, or deleted.
26+
- Test content is parsed to identify nested suites and tests so you can run them granularly.
3427

35-
```json
36-
{
37-
"rstest.testFileGlobPattern": ["apps/web/**/*.test.ts"]
38-
}
39-
```
28+
## Development
4029

41-
## How it works
30+
Common commands (run from this package):
4231

43-
- On activation, the extension eagerly scans for test files using `rstest.testFileGlobPattern` and populates the Test Explorer tree.
44-
- File system watchers keep the tree in sync as files are created/changed/deleted.
45-
- Tests are parsed to build a nested tree using the file contents.
32+
- `npm run build` — Build with rslib
33+
- `npm run watch` — Rebuild on change
34+
- `npm run typecheck` — TypeScript noEmit check
35+
- `npm run test:unit` — Unit tests via Rstest
36+
- `npm run test:e2e` — VS Code Extension Host E2E tests

packages/vscode/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,13 @@
5353
"@rslib/core": "0.12.2",
5454
"@rstest/core": "workspace:*",
5555
"@swc/core": "^1.13.5",
56+
"@types/glob": "^7.1.1",
5657
"@types/mocha": "^10.0.10",
5758
"@types/node": "^22.13.8",
58-
"@types/glob": "^7.1.1",
5959
"@types/vscode": "^1.100.0",
6060
"@types/ws": "^8.18.1",
6161
"@vscode/test-cli": "^0.0.11",
6262
"@vscode/test-electron": "^2.5.2",
63-
"birpc": "2.5.0",
6463
"get-port": "^7.1.0",
6564
"glob": "^7.1.4",
6665
"mocha": "^11.7.2",

packages/vscode/rslib.config.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,41 @@ export default defineConfig({
44
lib: [
55
{
66
syntax: ['node 20'],
7-
bundle: false,
7+
// bundle: false,
8+
source: {
9+
entry: {
10+
extension: './src/extension.ts',
11+
},
12+
},
13+
format: 'cjs',
14+
output: {
15+
externals: {
16+
vscode: 'commonjs vscode',
17+
'@swc/wasm': 'commonjs @swc/wasm',
18+
},
19+
sourceMap: process.env.SOURCEMAP === 'true',
20+
},
21+
tools: {
22+
rspack: {
23+
output: {
24+
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
25+
},
26+
},
27+
},
28+
},
29+
{
30+
syntax: ['node 20'],
31+
// bundle: false,
832
format: 'cjs',
33+
source: {
34+
entry: {
35+
worker: './src/worker/index.ts',
36+
},
37+
},
938
output: {
39+
externals: {
40+
vscode: 'commonjs vscode',
41+
},
1042
sourceMap: process.env.SOURCEMAP === 'true',
1143
},
1244
tools: {

pnpm-lock.yaml

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)