Skip to content

Commit f49adcf

Browse files
authored
chore: prepare for TS 6 and upgrade @peculiar/x509 to v2 (#858)
- Upgrade @peculiar/x509 from v1 to v2 with @abraham/reflection polyfill. - Add electron to dependabot ignore list (pinned to VS Code engine version). - Replace baseUrl with rootDir and explicit path prefixes in test tsconfig - Switch integration tests from CommonJS/Node10 to Node16/Node16 - Add CSS module declaration for TS 6's new TS2882 error - Add missing afterEach import in coderApi test (latent bug caught by TS 6) - Add explicit types for node/mocha in test tsconfig
1 parent da01d0c commit f49adcf

File tree

9 files changed

+52
-36
lines changed

9 files changed

+52
-36
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ updates:
1616
ignore:
1717
# Pinned to engines.vscode minimum; bump manually with engine updates.
1818
- dependency-name: "@types/vscode"
19+
- dependency-name: "electron"
1920
# These versions must match the versions specified in coder/coder exactly.
2021
- dependency-name: "@types/ua-parser-js"
2122
- dependency-name: "ua-parser-js"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,8 @@
508508
"word-wrap": "1.2.5"
509509
},
510510
"dependencies": {
511-
"@peculiar/x509": "^1.14.3",
511+
"@abraham/reflection": "^0.13.0",
512+
"@peculiar/x509": "^2.0.0",
512513
"@repo/shared": "workspace:*",
513514
"axios": "1.13.6",
514515
"date-fns": "catalog:",

packages/tasks/src/css.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module "*.css";

pnpm-lock.yaml

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

src/error/serverCertificateError.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import "@abraham/reflection";
12
import {
2-
X509Certificate,
3-
KeyUsagesExtension,
43
KeyUsageFlags,
4+
KeyUsagesExtension,
5+
X509Certificate,
56
} from "@peculiar/x509";
67
import { isAxiosError } from "axios";
78
import * as tls from "node:tls";

test/integration/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"module": "CommonJS",
5-
"moduleResolution": "Node10"
4+
"module": "Node16",
5+
"moduleResolution": "Node16"
66
}
77
}

test/tsconfig.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"baseUrl": "..",
4+
"rootDir": "..",
5+
"types": ["node", "mocha"],
56
"jsx": "react-jsx",
67
// Both mappings needed: exact match for root, wildcard for subpaths
78
"paths": {
8-
"@/*": ["src/*"],
9-
"@repo/shared": ["packages/shared/src/index.ts"],
10-
"@repo/shared/*": ["packages/shared/src/*"],
11-
"@repo/webview-shared": ["packages/webview-shared/src/index.ts"],
12-
"@repo/webview-shared/*": ["packages/webview-shared/src/*"],
13-
"@repo/tasks/*": ["packages/tasks/src/*"]
9+
"@/*": ["../src/*"],
10+
"@repo/shared": ["../packages/shared/src/index.ts"],
11+
"@repo/shared/*": ["../packages/shared/src/*"],
12+
"@repo/webview-shared": ["../packages/webview-shared/src/index.ts"],
13+
"@repo/webview-shared/*": ["../packages/webview-shared/src/*"],
14+
"@repo/tasks/*": ["../packages/tasks/src/*"]
1415
}
1516
},
1617
"include": [".", "../src"]

test/unit/api/coderApi.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ import axios, {
77
import { type ProvisionerJobLog } from "coder/site/src/api/typesGenerated";
88
import { EventSource } from "eventsource";
99
import { ProxyAgent } from "proxy-agent";
10-
import { describe, it, expect, vi, beforeEach, type Mock } from "vitest";
10+
import {
11+
afterEach,
12+
beforeEach,
13+
describe,
14+
expect,
15+
it,
16+
type Mock,
17+
vi,
18+
} from "vitest";
1119
import Ws from "ws";
1220

1321
import {

test/unit/error/serverCertificateError.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import "@abraham/reflection";
12
import {
23
KeyUsagesExtension,
34
X509Certificate as X509CertificatePeculiar,

0 commit comments

Comments
 (0)