Skip to content

Commit c903029

Browse files
authored
Improvements to VSCode configs for easier use (#307)
1 parent d6ff9ab commit c903029

File tree

7 files changed

+78
-59
lines changed

7 files changed

+78
-59
lines changed

.vscode/extensions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"recommendations": [
3-
"dbaeumer.vscode-eslint",
4-
"amodio.tsl-problem-matcher"
3+
"dbaeumer.vscode-eslint"
54
]
65
}

.vscode/launch.json

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"skipFiles": [
1616
"<node_internals>/**"
1717
],
18-
"type": "node"
18+
"type": "node",
19+
"preLaunchTask": "Build+Watch+CJS: vscode-processutils"
1920
},
2021
{
2122
"name": "Container client integration tests",
@@ -30,12 +31,13 @@
3031
"<node_internals>/**"
3132
],
3233
"env": {
33-
"CONTAINER_CLIENT_TYPE": "docker", // Set to 'docker' or 'podman'
34+
"CONTAINER_CLIENT_TYPE": "${input:containerRuntime}", // Set to 'docker' or 'podman'
3435
"RUN_IN_WSL": "0", // Set to 1 if running in WSL
35-
"DOCKER_HUB_USERNAME": "", // Replace, but never commit!
36-
"DOCKER_HUB_PAT": "" // Replace, but never commit!
36+
"DOCKER_HUB_USERNAME": "${input:dockerHubUsername}",
37+
"DOCKER_HUB_PAT": "${input:dockerHubPAT}"
3738
},
38-
"type": "node"
39+
"type": "node",
40+
"preLaunchTask": "Build+Watch+CJS: vscode-processutils"
3941
},
4042
{
4143
"name": "Process utils unit tests",
@@ -77,5 +79,30 @@
7779
],
7880
"type": "node"
7981
}
82+
],
83+
"inputs": [
84+
{
85+
"id": "containerRuntime",
86+
"type": "pickString",
87+
"description": "Select the container runtime to use for integration tests",
88+
"options": [
89+
"docker",
90+
"podman"
91+
],
92+
"default": "docker"
93+
},
94+
{
95+
"id": "dockerHubUsername",
96+
"type": "promptString",
97+
"description": "Enter your Docker Hub username (or leave blank to skip the login test)",
98+
"default": ""
99+
},
100+
{
101+
"id": "dockerHubPAT",
102+
"type": "promptString",
103+
"description": "Enter your Docker Hub Personal Access Token (or leave blank to skip the login test)",
104+
"default": "",
105+
"password": true
106+
}
80107
]
81108
}

.vscode/tasks.json

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,64 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "tsc-watch: vscode-container-client",
6-
"type": "typescript",
7-
"tsconfig": "packages/vscode-container-client/tsconfig.json",
8-
"option": "watch",
9-
"problemMatcher": [
10-
"$tsc-watch"
11-
],
5+
"label": "Build+Watch: vscode-processutils",
6+
"type": "npm",
7+
"script": "build:esm -- --watch",
8+
"path": "packages/vscode-processutils",
129
"group": {
13-
"kind": "build",
14-
"isDefault": true
10+
"kind": "build"
1511
},
12+
"isBackground": true,
1613
"presentation": {
17-
"reveal": "never"
14+
"revealProblems": "onProblem"
1815
},
19-
"isBackground": true
16+
"problemMatcher": "$tsc-watch",
2017
},
2118
{
22-
"label": "tsc-watch: vscode-processutils",
23-
"type": "typescript",
24-
"tsconfig": "packages/vscode-processutils/tsconfig.json",
25-
"option": "watch",
26-
"problemMatcher": [
27-
"$tsc-watch"
28-
],
19+
"label": "Build+Watch+CJS: vscode-processutils",
20+
"type": "npm",
21+
"script": "build:cjs -- --watch",
22+
"path": "packages/vscode-processutils",
2923
"group": {
3024
"kind": "build"
3125
},
26+
"isBackground": true,
27+
"presentation": {
28+
"revealProblems": "onProblem"
29+
},
30+
"problemMatcher": "$tsc-watch",
31+
},
32+
{
33+
"label": "Build+Watch: vscode-container-client",
34+
"type": "npm",
35+
"script": "build:esm -- --watch",
36+
"path": "packages/vscode-container-client",
37+
"group": {
38+
"kind": "build",
39+
"isDefault": true
40+
},
41+
"isBackground": true,
3242
"presentation": {
33-
"reveal": "never"
43+
"revealProblems": "onProblem"
3444
},
35-
"isBackground": true
45+
"problemMatcher": "$tsc-watch",
46+
"dependsOn": [
47+
"Build+Watch: vscode-processutils",
48+
]
3649
},
3750
{
38-
"label": "tsc-watch: vscode-docker-registries",
39-
"type": "typescript",
40-
"tsconfig": "packages/vscode-docker-registries/tsconfig.json",
41-
"option": "watch",
42-
"problemMatcher": [
43-
"$tsc-watch"
44-
],
51+
"label": "Build+Watch: vscode-docker-registries",
52+
"type": "npm",
53+
"script": "build:esm -- --watch",
54+
"path": "packages/vscode-docker-registries",
4555
"group": {
4656
"kind": "build"
4757
},
58+
"isBackground": true,
4859
"presentation": {
49-
"reveal": "never"
60+
"revealProblems": "onProblem"
5061
},
51-
"isBackground": true
62+
"problemMatcher": "$tsc-watch",
5263
},
5364
]
5465
}

packages/vscode-container-client/package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
"zod": "^3.25.56"
3535
},
3636
"mocha": {
37-
"extension": [
38-
"ts"
39-
],
4037
"require": [
4138
"./src/test/tsconfig-paths-bootstrap.mjs"
4239
],
@@ -48,9 +45,6 @@
4845
],
4946
"grep": [
5047
"(unit)"
51-
],
52-
"watch-files": [
53-
"src/**/*.ts"
5448
]
5549
}
5650
}

packages/vscode-container-client/src/test/ContainersClientE2E.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@ import { wslifyPath } from '../utils/wslifyPath';
2222
* WARNING: This test suite will prune unused images, containers, networks, and volumes.
2323
*/
2424

25-
// Modify the below options to configure the tests
25+
// Modify the below options to configure the tests, or pick at F5 time
2626
const clientTypeToTest: ClientType = (process.env.CONTAINER_CLIENT_TYPE || 'docker') as ClientType;
2727
const runInWsl: boolean = (process.env.RUN_IN_WSL === '1' || process.env.RUN_IN_WSL === 'true') || false; // Set to true if running in WSL
2828

29-
// Supply to run the login/logout tests
30-
const dockerHubUsername = process.env.DOCKER_HUB_USERNAME || ''; // Set your Docker Hub username in an environment variable or here
31-
const dockerHubPAT = process.env.DOCKER_HUB_PAT || ''; // Never commit this value!!
32-
3329
// No need to modify below this
3430

3531
export type ClientType = 'docker' | 'podman';
@@ -807,6 +803,10 @@ describe('(integration) ContainersClientE2E', function () {
807803
// #region Login/Logout
808804

809805
describe('Login/Logout', function () {
806+
// Supply at F5 to run the login/logout tests
807+
const dockerHubUsername = process.env.DOCKER_HUB_USERNAME;
808+
const dockerHubPAT = process.env.DOCKER_HUB_PAT;
809+
810810
it('LoginCommand', async function () {
811811
if (!dockerHubUsername || !dockerHubPAT) {
812812
this.skip();

packages/vscode-docker-registries/package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,11 @@
3434
"dayjs": "^1.11.7"
3535
},
3636
"mocha": {
37-
"extension": [
38-
"ts"
39-
],
4037
"node-option": [
4138
"import=tsx"
4239
],
4340
"spec": [
4441
"src/test/**/*.test.ts"
45-
],
46-
"watch-files": [
47-
"src/**/*.ts"
4842
]
4943
}
5044
}

packages/vscode-processutils/package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
"vscode-jsonrpc": "^8.0.1"
3737
},
3838
"mocha": {
39-
"extension": [
40-
"ts"
41-
],
4239
"require": [
4340
"./src/test/tsconfig-paths-bootstrap.mjs"
4441
],
@@ -50,9 +47,6 @@
5047
],
5148
"grep": [
5249
"(unit)"
53-
],
54-
"watch-files": [
55-
"src/**/*.ts"
5650
]
5751
}
5852
}

0 commit comments

Comments
 (0)