Skip to content

Commit 25d3be0

Browse files
committed
Restructure project files
1 parent 52df12c commit 25d3be0

Some content is hidden

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

51 files changed

+2053
-327
lines changed

.eslintrc.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"sourceType": "module",
77
"project": "./tsconfig.json"
88
},
9-
"plugins": ["@typescript-eslint", "prettier"],
9+
"plugins": ["@typescript-eslint", "prettier", "import"],
1010
"extends": [
1111
"eslint:recommended",
1212
"plugin:@typescript-eslint/recommended",
@@ -69,5 +69,10 @@
6969
}
7070
]
7171
},
72-
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
72+
"ignorePatterns": ["out", "dist", "**/*.d.ts"],
73+
"settings": {
74+
"import/resolver": {
75+
"typescript": {}
76+
}
77+
}
7378
}

.vscode-test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "@vscode/test-cli";
22

33
export default defineConfig({
4-
files: "out/test/**/*.test.js",
4+
files: "out/test/integration/**/*.test.js",
55
extensionDevelopmentPath: ".",
66
extensionTestsPath: "./out/test",
77
launchArgs: ["--enable-proposed-api", "coder.coder-remote"],

.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ node_modules/**
1313
**/*.map
1414
**/*.ts
1515
*.gif
16-
fixtures/**
16+
test/**

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,12 @@
330330
"@types/glob": "^7.1.3",
331331
"@types/node": "^22.14.1",
332332
"@types/node-forge": "^1.3.11",
333+
"@types/semver": "^7.7.1",
333334
"@types/ua-parser-js": "0.7.36",
334335
"@types/vscode": "^1.73.0",
335336
"@types/ws": "^8.18.1",
336-
"@typescript-eslint/eslint-plugin": "^7.0.0",
337-
"@typescript-eslint/parser": "^6.21.0",
337+
"@typescript-eslint/eslint-plugin": "^8.44.0",
338+
"@typescript-eslint/parser": "^8.44.0",
338339
"@vitest/coverage-v8": "^3.2.4",
339340
"@vscode/test-cli": "^0.0.11",
340341
"@vscode/test-electron": "^2.5.2",
@@ -344,7 +345,8 @@
344345
"dayjs": "^1.11.13",
345346
"eslint": "^8.57.1",
346347
"eslint-config-prettier": "^9.1.0",
347-
"eslint-plugin-import": "^2.31.0",
348+
"eslint-import-resolver-typescript": "^4.4.4",
349+
"eslint-plugin-import": "^2.32.0",
348350
"eslint-plugin-md": "^1.0.19",
349351
"eslint-plugin-package-json": "^0.40.1",
350352
"eslint-plugin-prettier": "^5.4.1",

src/cliUtils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import * as cli from "@/cliUtils";
12
import fs from "fs/promises";
23
import os from "os";
34
import path from "path";
45
import { beforeAll, describe, expect, it } from "vitest";
5-
import * as cli from "./cliUtils";
66

77
describe("cliUtils", () => {
88
const tmp = path.join(os.tmpdir(), "vscode-coder-tests");

src/core/cliManager.test.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,17 @@ import * as os from "os";
88
import * as path from "path";
99
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
1010
import * as vscode from "vscode";
11-
import {
12-
MockConfigurationProvider,
13-
MockProgressReporter,
14-
MockUserInteraction,
15-
} from "../__mocks__/testHelpers";
16-
import * as cli from "../cliUtils";
17-
import { Logger } from "../logging/logger";
18-
import * as pgp from "../pgp";
19-
import { CliManager } from "./cliManager";
20-
import { PathResolver } from "./pathResolver";
11+
import * as cli from "@/cliManager";
12+
import { CliManager } from "@/core/cliManager";
13+
import { PathResolver } from "@/core/pathResolver";
14+
import { Logger } from "@/logging/logger";
15+
import * as pgp from "@/pgp";
2116

2217
vi.mock("os");
2318
vi.mock("axios");
2419
vi.mock("../pgp");
20+
vi.mock("@/cliManager");
21+
vi.mock("@/pgp");
2522

2623
vi.mock("fs", async () => {
2724
const memfs: { fs: typeof fs } = await vi.importActual("memfs");

src/core/secretsManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class SecretsManager {
2020
public async getSessionToken(): Promise<string | undefined> {
2121
try {
2222
return await this.secrets.get("sessionToken");
23-
} catch (ex) {
23+
} catch {
2424
// The VS Code session store has become corrupt before, and
2525
// will fail to get the session token...
2626
return undefined;

src/remote.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export class Remote {
281281
// This is useful for debugging with a custom bin!
282282
binaryPath = path.join(os.tmpdir(), "coder");
283283
await fs.stat(binaryPath);
284-
} catch (ex) {
284+
} catch {
285285
binaryPath = await this.cliManager.fetchBinary(
286286
workspaceClient,
287287
parts.label,
@@ -442,7 +442,7 @@ export class Remote {
442442
this.pathResolver.getUserSettingsPath(),
443443
"utf8",
444444
);
445-
} catch (ex) {
445+
} catch {
446446
// Ignore! It's probably because the file doesn't exist.
447447
}
448448

@@ -932,7 +932,7 @@ export class Remote {
932932
.then((parsed) => {
933933
try {
934934
updateStatus(parsed);
935-
} catch (ex) {
935+
} catch {
936936
// Ignore
937937
}
938938
})

src/sshConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class SSHConfig {
107107
async load() {
108108
try {
109109
this.raw = await this.fileSystem.readFile(this.filePath, "utf-8");
110-
} catch (ex) {
110+
} catch {
111111
// Probably just doesn't exist!
112112
this.raw = "";
113113
}

src/sshSupport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function sshSupportsSetEnv(): boolean {
66
const spawned = childProcess.spawnSync("ssh", ["-V"]);
77
// The version string outputs to stderr.
88
return sshVersionSupportsSetEnv(spawned.stderr.toString().trim());
9-
} catch (error) {
9+
} catch {
1010
return false;
1111
}
1212
}

0 commit comments

Comments
 (0)