Skip to content

Commit 514bc82

Browse files
authored
chore: update dependencies (#141)
1 parent 22fded5 commit 514bc82

File tree

7 files changed

+1440
-1010
lines changed

7 files changed

+1440
-1010
lines changed

package.json

+21-16
Original file line numberDiff line numberDiff line change
@@ -241,29 +241,29 @@
241241
"@types/vscode": "^1.73.0",
242242
"@types/which": "^2.0.1",
243243
"@types/ws": "^8.5.3",
244-
"@typescript-eslint/eslint-plugin": "^5.47.1",
245-
"@typescript-eslint/parser": "^4.14.1",
244+
"@typescript-eslint/eslint-plugin": "^6.7.4",
245+
"@typescript-eslint/parser": "^6.7.4",
246246
"@vscode/test-electron": "^1.6.2",
247-
"@vscode/vsce": "^2.16.0",
247+
"@vscode/vsce": "^2.21.1",
248248
"bufferutil": "^4.0.7",
249249
"coder": "https://github.com/coder/coder#main",
250250
"dayjs": "^1.11.7",
251-
"eslint": "^7.19.0",
252-
"eslint-config-prettier": "^8.3.0",
253-
"eslint-plugin-import": "^2.24.2",
251+
"eslint": "^8.50.0",
252+
"eslint-config-prettier": "^9.0.0",
253+
"eslint-plugin-import": "^2.28.1",
254254
"eslint-plugin-md": "^1.0.19",
255-
"eslint-plugin-prettier": "^4.0.0",
255+
"eslint-plugin-prettier": "^5.0.0",
256256
"glob": "^7.1.6",
257257
"nyc": "^15.1.0",
258-
"prettier": "^2.2.1",
259-
"ts-loader": "^8.0.14",
260-
"tsc-watch": "^4.5.0",
261-
"typescript": "^4.1.3",
258+
"prettier": "^3.0.3",
259+
"ts-loader": "^9.4.4",
260+
"tsc-watch": "^6.0.4",
261+
"typescript": "^5.2.2",
262262
"utf-8-validate": "^5.0.10",
263-
"vitest": "^0.28.3",
263+
"vitest": "^0.34.6",
264264
"vscode-test": "^1.5.0",
265-
"webpack": "^5.19.0",
266-
"webpack-cli": "^5.0.1"
265+
"webpack": "^5.88.2",
266+
"webpack-cli": "^5.1.4"
267267
},
268268
"dependencies": {
269269
"@types/node-forge": "^1.3.4",
@@ -278,12 +278,17 @@
278278
"ndjson": "^2.0.0",
279279
"node-forge": "^1.3.1",
280280
"pretty-bytes": "^6.0.0",
281-
"semver": "^7.3.8",
281+
"semver": "^7.5.4",
282282
"tar-fs": "^2.1.1",
283283
"ua-parser-js": "^1.0.35",
284284
"which": "^2.0.2",
285285
"ws": "^8.11.0",
286286
"yaml": "^1.10.0",
287-
"zod": "^3.21.4"
287+
"zod": "^3.22.3"
288+
},
289+
"resolutions": {
290+
"semver": "7.5.4",
291+
"trim": "0.0.3",
292+
"word-wrap": "1.2.5"
288293
}
289294
}

src/commands.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { Storage } from "./storage"
99
import { OpenableTreeItem } from "./workspacesProvider"
1010

1111
export class Commands {
12-
public constructor(private readonly vscodeProposed: typeof vscode, private readonly storage: Storage) {}
12+
public constructor(
13+
private readonly vscodeProposed: typeof vscode,
14+
private readonly storage: Storage,
15+
) {}
1316

1417
public async login(...args: string[]): Promise<void> {
1518
let url: string | undefined = args.length >= 1 ? args[0] : undefined

src/error.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import axios from "axios"
1+
import { isAxiosError } from "axios"
22
import * as forge from "node-forge"
33
import * as tls from "tls"
44
import * as vscode from "vscode"
@@ -34,14 +34,17 @@ export class CertificateError extends Error {
3434
public static InsecureMessage =
3535
'The Coder extension will no longer verify TLS on HTTPS requests. You can change this at any time with the "coder.insecure" property in your VS Code settings.'
3636

37-
private constructor(message: string, public readonly x509Err?: X509_ERR) {
37+
private constructor(
38+
message: string,
39+
public readonly x509Err?: X509_ERR,
40+
) {
3841
super("Secure connection to your Coder deployment failed: " + message)
3942
}
4043

4144
// maybeWrap returns a CertificateError if the code is a certificate error
4245
// otherwise it returns the original error.
4346
static async maybeWrap<T>(err: T, address: string, logger: Logger): Promise<CertificateError | T> {
44-
if (axios.isAxiosError(err)) {
47+
if (isAxiosError(err)) {
4548
switch (err.code) {
4649
case X509_ERR_CODE.UNABLE_TO_VERIFY_LEAF_SIGNATURE:
4750
// "Unable to verify" can mean different things so we will attempt to

src/remote.ts

+19-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import axios from "axios"
1+
import { isAxiosError } from "axios"
22
import {
33
getBuildInfo,
44
getTemplate,
@@ -80,7 +80,7 @@ export class Remote {
8080
try {
8181
this.storage.workspace = await getWorkspaceByOwnerAndName(parts[0], parts[1])
8282
} catch (error) {
83-
if (!axios.isAxiosError(error)) {
83+
if (!isAxiosError(error)) {
8484
throw error
8585
}
8686
switch (error.response?.status) {
@@ -461,7 +461,7 @@ export class Remote {
461461
const deploymentConfig = await getDeploymentSSHConfig()
462462
deploymentSSHConfig = deploymentConfig.ssh_config_options
463463
} catch (error) {
464-
if (!axios.isAxiosError(error)) {
464+
if (!isAxiosError(error)) {
465465
throw error
466466
}
467467
switch (error.response?.status) {
@@ -483,21 +483,24 @@ export class Remote {
483483
// Now override with the user's config.
484484
const userConfigSSH = vscode.workspace.getConfiguration("coder").get<string[]>("sshConfig") || []
485485
// Parse the user's config into a Record<string, string>.
486-
const userConfig = userConfigSSH.reduce((acc, line) => {
487-
let i = line.indexOf("=")
488-
if (i === -1) {
489-
i = line.indexOf(" ")
486+
const userConfig = userConfigSSH.reduce(
487+
(acc, line) => {
488+
let i = line.indexOf("=")
490489
if (i === -1) {
491-
// This line is malformed. The setting is incorrect, and does not match
492-
// the pattern regex in the settings schema.
493-
return acc
490+
i = line.indexOf(" ")
491+
if (i === -1) {
492+
// This line is malformed. The setting is incorrect, and does not match
493+
// the pattern regex in the settings schema.
494+
return acc
495+
}
494496
}
495-
}
496-
const key = line.slice(0, i)
497-
const value = line.slice(i + 1)
498-
acc[key] = value
499-
return acc
500-
}, {} as Record<string, string>)
497+
const key = line.slice(0, i)
498+
const value = line.slice(i + 1)
499+
acc[key] = value
500+
return acc
501+
},
502+
{} as Record<string, string>,
503+
)
501504
const sshConfigOverrides = mergeSSHConfigValues(deploymentSSHConfig, userConfig)
502505

503506
let sshConfigFile = vscode.workspace.getConfiguration().get<string>("remote.SSH.configFile")

src/workspaceAction.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import axios from "axios"
1+
import { isAxiosError } from "axios"
22
import { getWorkspaces } from "coder/site/src/api/api"
33
import { Workspace, WorkspacesResponse, WorkspaceBuild } from "coder/site/src/api/typesGenerated"
44
import { formatDistanceToNowStrict } from "date-fns"
@@ -48,7 +48,7 @@ export class WorkspaceAction {
4848
ownedWorkspacesResponse = await getWorkspaces({ q: "owner:me" })
4949
} catch (error) {
5050
let status
51-
if (axios.isAxiosError(error)) {
51+
if (isAxiosError(error)) {
5252
status = error.response?.status
5353
}
5454
if (status !== 401) {
@@ -116,7 +116,7 @@ export class WorkspaceAction {
116116
errorCount++
117117

118118
let status
119-
if (axios.isAxiosError(error)) {
119+
if (isAxiosError(error)) {
120120
status = error.response?.status
121121
}
122122
if (status !== 401) {

src/workspacesProvider.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export class WorkspaceProvider implements vscode.TreeDataProvider<vscode.TreeIte
1515
private workspaces: WorkspaceTreeItem[] = []
1616
private agentWatchers: Record<WorkspaceAgent["id"], { dispose: () => void; metadata?: AgentMetadataEvent[] }> = {}
1717

18-
constructor(private readonly getWorkspacesQuery: WorkspaceQuery, private readonly storage: Storage) {
18+
constructor(
19+
private readonly getWorkspacesQuery: WorkspaceQuery,
20+
private readonly storage: Storage,
21+
) {
1922
this.fetchAndRefresh()
2023
}
2124

0 commit comments

Comments
 (0)