Skip to content

Commit 32dfda4

Browse files
committed
Update configurations and remove pointless Promise.all
1 parent a2d2bc8 commit 32dfda4

File tree

5 files changed

+264
-99
lines changed

5 files changed

+264
-99
lines changed

.eslintrc.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@
2222
"rules": {
2323
"@typescript-eslint/require-await": "off"
2424
}
25+
},
26+
{
27+
"files": ["*.json"],
28+
"parser": "jsonc-eslint-parser",
29+
"rules": {
30+
"@typescript-eslint/require-await": "off"
31+
}
32+
},
33+
{
34+
"extends": ["plugin:package-json/legacy-recommended"],
35+
"files": ["package.json"],
36+
"parser": "jsonc-eslint-parser",
37+
"rules": {
38+
"@typescript-eslint/require-await": "off"
39+
}
2540
}
2641
],
2742
"rules": {
@@ -60,7 +75,7 @@
6075
}
6176
],
6277
"require-await": "off",
63-
"@typescript-eslint/require-await": "error"
78+
"@typescript-eslint/require-await": "error"
6479
},
6580
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
6681
}

package.json

Lines changed: 69 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
11
{
22
"name": "coder-remote",
3-
"publisher": "coder",
43
"displayName": "Coder",
5-
"description": "Open any workspace with a single click.",
6-
"repository": "https://github.com/coder/vscode-coder",
74
"version": "1.9.1",
8-
"engines": {
9-
"vscode": "^1.73.0"
10-
},
11-
"license": "MIT",
5+
"description": "Open any workspace with a single click.",
6+
"categories": [
7+
"Other"
8+
],
129
"bugs": {
1310
"url": "https://github.com/coder/vscode-coder/issues"
1411
},
15-
"icon": "media/logo.png",
16-
"extensionKind": [
17-
"ui"
18-
],
19-
"capabilities": {
20-
"untrustedWorkspaces": {
21-
"supported": true
22-
}
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/coder/vscode-coder"
2315
},
24-
"categories": [
25-
"Other"
26-
],
27-
"extensionPack": [
28-
"ms-vscode-remote.remote-ssh"
29-
],
30-
"activationEvents": [
31-
"onResolveRemoteAuthority:ssh-remote",
32-
"onCommand:coder.connect",
33-
"onUri"
34-
],
16+
"license": "MIT",
17+
"publisher": "coder",
18+
"type": "commonjs",
3519
"main": "./dist/extension.js",
20+
"scripts": {
21+
"build": "webpack",
22+
"compile-tests": "tsc -p . --outDir out",
23+
"fmt": "prettier --write .",
24+
"lint": "eslint . --ext ts,md,json",
25+
"lint:fix": "yarn lint --fix",
26+
"package": "webpack --mode production --devtool hidden-source-map",
27+
"package:prerelease": "npx vsce package --pre-release",
28+
"pretest": "yarn run compile-tests && yarn run build && yarn run lint",
29+
"test": "vitest",
30+
"test:ci": "CI=true yarn test",
31+
"test:integration": "vscode-test",
32+
"vscode:prepublish": "yarn package",
33+
"watch": "webpack --watch"
34+
},
3635
"contributes": {
3736
"configuration": {
3837
"title": "Coder",
@@ -45,8 +44,7 @@
4544
"type": "string",
4645
"pattern": "^[a-zA-Z0-9-]+[=\\s].*$"
4746
},
48-
"scope": "machine",
49-
"default": []
47+
"scope": "machine"
5048
},
5149
"coder.insecure": {
5250
"markdownDescription": "If true, the extension will not verify the authenticity of the remote host. This is useful for self-signed certificates.",
@@ -269,20 +267,30 @@
269267
]
270268
}
271269
},
272-
"scripts": {
273-
"vscode:prepublish": "yarn package",
274-
"build": "webpack",
275-
"watch": "webpack --watch",
276-
"fmt": "prettier --write .",
277-
"package": "webpack --mode production --devtool hidden-source-map",
278-
"package:prerelease": "npx vsce package --pre-release",
279-
"lint": "eslint . --ext ts,md",
280-
"lint:fix": "yarn lint --fix",
281-
"test": "vitest",
282-
"test:ci": "CI=true yarn test",
283-
"test:integration": "vscode-test",
284-
"pretest": "yarn run compile-tests && yarn run build && yarn run lint",
285-
"compile-tests": "tsc -p . --outDir out"
270+
"activationEvents": [
271+
"onResolveRemoteAuthority:ssh-remote",
272+
"onCommand:coder.connect",
273+
"onUri"
274+
],
275+
"resolutions": {
276+
"semver": "7.7.1",
277+
"trim": "0.0.3",
278+
"word-wrap": "1.2.5"
279+
},
280+
"dependencies": {
281+
"axios": "1.8.4",
282+
"date-fns": "^3.6.0",
283+
"eventsource": "^3.0.6",
284+
"find-process": "https://github.com/coder/find-process#fix/sequoia-compat",
285+
"jsonc-parser": "^3.3.1",
286+
"memfs": "^4.17.1",
287+
"node-forge": "^1.3.1",
288+
"pretty-bytes": "^6.1.1",
289+
"proxy-agent": "^6.4.0",
290+
"semver": "^7.7.1",
291+
"ua-parser-js": "1.0.40",
292+
"ws": "^8.18.2",
293+
"zod": "^3.25.65"
286294
},
287295
"devDependencies": {
288296
"@types/eventsource": "^3.0.0",
@@ -294,6 +302,7 @@
294302
"@types/ws": "^8.18.1",
295303
"@typescript-eslint/eslint-plugin": "^7.0.0",
296304
"@typescript-eslint/parser": "^6.21.0",
305+
"@vscode/test-cli": "^0.0.10",
297306
"@vscode/test-electron": "^2.5.2",
298307
"@vscode/vsce": "^2.21.1",
299308
"bufferutil": "^4.0.9",
@@ -303,8 +312,10 @@
303312
"eslint-config-prettier": "^9.1.0",
304313
"eslint-plugin-import": "^2.31.0",
305314
"eslint-plugin-md": "^1.0.19",
315+
"eslint-plugin-package-json": "^0.40.1",
306316
"eslint-plugin-prettier": "^5.4.1",
307317
"glob": "^10.4.2",
318+
"jsonc-eslint-parser": "^2.4.0",
308319
"nyc": "^17.1.0",
309320
"prettier": "^3.5.3",
310321
"ts-loader": "^9.5.1",
@@ -314,28 +325,22 @@
314325
"vitest": "^0.34.6",
315326
"vscode-test": "^1.5.0",
316327
"webpack": "^5.99.6",
317-
"webpack-cli": "^5.1.4",
318-
"@vscode/test-cli": "^0.0.10"
328+
"webpack-cli": "^5.1.4"
319329
},
320-
"dependencies": {
321-
"axios": "1.8.4",
322-
"date-fns": "^3.6.0",
323-
"eventsource": "^3.0.6",
324-
"find-process": "https://github.com/coder/find-process#fix/sequoia-compat",
325-
"jsonc-parser": "^3.3.1",
326-
"memfs": "^4.17.1",
327-
"node-forge": "^1.3.1",
328-
"pretty-bytes": "^6.1.1",
329-
"proxy-agent": "^6.4.0",
330-
"semver": "^7.7.1",
331-
"ua-parser-js": "1.0.40",
332-
"ws": "^8.18.2",
333-
"zod": "^3.25.65"
334-
},
335-
"resolutions": {
336-
"semver": "7.7.1",
337-
"trim": "0.0.3",
338-
"word-wrap": "1.2.5"
330+
"extensionPack": [
331+
"ms-vscode-remote.remote-ssh"
332+
],
333+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
334+
"engines": {
335+
"vscode": "^1.73.0"
339336
},
340-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
337+
"icon": "media/logo.png",
338+
"extensionKind": [
339+
"ui"
340+
],
341+
"capabilities": {
342+
"untrustedWorkspaces": {
343+
"supported": true
344+
}
345+
}
341346
}

src/workspacesProvider.ts

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -155,35 +155,31 @@ export class WorkspaceProvider
155155
});
156156

157157
// Create tree items for each workspace
158-
const workspaceTreeItems = await Promise.all(
159-
resp.workspaces.map((workspace) => {
160-
const workspaceTreeItem = new WorkspaceTreeItem(
161-
workspace,
162-
this.getWorkspacesQuery === WorkspaceQuery.All,
163-
showMetadata,
164-
);
158+
const workspaceTreeItems = resp.workspaces.map((workspace: Workspace) => {
159+
const workspaceTreeItem = new WorkspaceTreeItem(
160+
workspace,
161+
this.getWorkspacesQuery === WorkspaceQuery.All,
162+
showMetadata,
163+
);
165164

166-
// Get app status from the workspace agents
167-
const agents = extractAgents(workspace);
168-
agents.forEach((agent) => {
169-
// Check if agent has apps property with status reporting
170-
if (agent.apps && Array.isArray(agent.apps)) {
171-
workspaceTreeItem.appStatus = agent.apps.map(
172-
(app: WorkspaceApp) => ({
173-
name: app.display_name,
174-
url: app.url,
175-
agent_id: agent.id,
176-
agent_name: agent.name,
177-
command: app.command,
178-
workspace_name: workspace.name,
179-
}),
180-
);
181-
}
182-
});
165+
// Get app status from the workspace agents
166+
const agents = extractAgents(workspace);
167+
agents.forEach((agent) => {
168+
// Check if agent has apps property with status reporting
169+
if (agent.apps && Array.isArray(agent.apps)) {
170+
workspaceTreeItem.appStatus = agent.apps.map((app: WorkspaceApp) => ({
171+
name: app.display_name,
172+
url: app.url,
173+
agent_id: agent.id,
174+
agent_name: agent.name,
175+
command: app.command,
176+
workspace_name: workspace.name,
177+
}));
178+
}
179+
});
183180

184-
return workspaceTreeItem;
185-
}),
186-
);
181+
return workspaceTreeItem;
182+
});
187183

188184
return workspaceTreeItems;
189185
}

tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"compilerOptions": {
33
"module": "commonjs",
4-
"target": "ES2022",
4+
"target": "ES2021",
55
"moduleResolution": "node",
66
"outDir": "out",
77
// "dom" is required for importing the API from coder/coder.
8-
"lib": ["ES2022", "dom"],
8+
"lib": ["ES2021", "dom"],
99
"sourceMap": true,
1010
"strict": true,
1111
"esModuleInterop": true,
1212
"skipLibCheck": true,
1313
"forceConsistentCasingInFileNames": true
1414
},
15-
"exclude": ["node_modules", "vitest.config.ts"],
15+
"exclude": ["node_modules"],
1616
"include": ["src/**/*"]
1717
}

0 commit comments

Comments
 (0)