- Notifications
You must be signed in to change notification settings - Fork35
Add package scripts and cli library, enable integration testing#536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
7e1bce9c693a46240b6490e58a31872b7e801c2d808ddbf269b74df4adec211d9b543aa7afdd63097d8fa2d2bc832dfda412b01243ee92feFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -279,7 +279,10 @@ | ||
| "lint": "eslint . --ext ts,md", | ||
| "lint:fix": "yarn lint --fix", | ||
| "test": "vitest ./src", | ||
| "test:ci": "CI=true yarn test", | ||
| "test:integration": "vscode-test", | ||
| "pretest": "yarn run compile-tests && yarn run build && yarn run lint", | ||
| "compile-tests": "tsc -p . --outDir out" | ||
jaggederest marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| }, | ||
| "devDependencies": { | ||
| "@types/eventsource": "^3.0.0", | ||
| @@ -326,7 +329,7 @@ | ||
| "semver": "^7.7.1", | ||
| "ua-parser-js": "1.0.40", | ||
| "ws": "^8.18.2", | ||
| "zod": "^3.25.65" | ||
| }, | ||
| "resolutions": { | ||
| "semver": "7.7.1", | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -6,7 +6,9 @@ import * as fs from "fs/promises"; | ||
| import * as jsonc from "jsonc-parser"; | ||
| import * as os from "os"; | ||
| import * as path from "path"; | ||
| // Dynamic import for ESM module | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| let prettyBytes: any; | ||
jaggederest marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| import * as semver from "semver"; | ||
| import * as vscode from "vscode"; | ||
| import { | ||
| @@ -841,7 +843,7 @@ export class Remote { | ||
| `${sshPid}.json`, | ||
| ); | ||
| const updateStatus =async(network: { | ||
jaggederest marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| p2p: boolean; | ||
| latency: number; | ||
| preferred_derp: string; | ||
| @@ -850,6 +852,10 @@ export class Remote { | ||
| download_bytes_sec: number; | ||
| using_coder_connect: boolean; | ||
| }) => { | ||
| // Load ESM module if not already loaded | ||
| if (!prettyBytes) { | ||
| prettyBytes = (await import("pretty-bytes")).default; | ||
jaggederest marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| } | ||
| let statusText = "$(globe) "; | ||
| // Coder Connect doesn't populate any other stats | ||
| @@ -910,9 +916,9 @@ export class Remote { | ||
| .then((content) => { | ||
| return JSON.parse(content); | ||
| }) | ||
| .then(async(parsed) => { | ||
| try { | ||
| awaitupdateStatus(parsed); | ||
jaggederest marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| } catch (ex) { | ||
| // Ignore | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3,7 +3,9 @@ import { createWriteStream } from "fs"; | ||
| import fs from "fs/promises"; | ||
| import { IncomingMessage } from "http"; | ||
| import path from "path"; | ||
| // Dynamic import for ESM module | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
jaggederest marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| let prettyBytes: any; | ||
| import * as vscode from "vscode"; | ||
| import { errToStr } from "./api-helper"; | ||
| import * as cli from "./cliManager"; | ||
| @@ -122,6 +124,10 @@ export class Storage { | ||
| * downloads being disabled. | ||
| */ | ||
| public async fetchBinary(restClient: Api, label: string): Promise<string> { | ||
| // Load ESM module if not already loaded | ||
| if (!prettyBytes) { | ||
| prettyBytes = (await import("pretty-bytes")).default; | ||
| } | ||
jaggederest marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| const baseUrl = restClient.getAxiosInstance().defaults.baseURL; | ||
| // Settings can be undefined when set to their defaults (true in this case), | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,12 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "module": "Node16", | ||
| "target": "ES2022", | ||
jaggederest marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| "outDir": "out", | ||
| // "dom" is required for importing the API from coder/coder. | ||
| "lib": ["ES2022", "dom"], | ||
| "sourceMap": true, | ||
| "strict": true, | ||
| "skipLibCheck": true | ||
| } | ||
| } | ||