8000 Add package scripts and cli library, enable integration testing by jaggederest · Pull Request #536 · coder/vscode-coder · GitHub
[go: up one dir, main page]

Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: update tsconfig.json and convert pretty-bytes imports to standar…
…d ES6

- Updated tsconfig.json to use CommonJS module system with proper ES module interop
- Converted dynamic imports of pretty-bytes to standard ES6 imports in remote.ts and storage.ts
- Added integration test command to CLAUDE.md documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
  • Loading branch information
jaggederest and claude committed Jun 17, 2025
commit d9b543ad443a3357b5a79c952bfd04ebfc9692bc
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Run all tests: `yarn test`
- Run specific test: `vitest ./src/filename.test.ts`
- CI test mode: `yarn test:ci`
- Integration tests: `yarn test:integration`

## Code Style Guidelines

Expand Down
8 changes: 1 addition & 7 deletions src/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ 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;
import prettyBytes from "pretty-bytes";
import * as semver from "semver";
import * as vscode from "vscode";
import {
Expand Down Expand Up @@ -852,10 +850,6 @@ 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;
}
let statusText = "$(globe) ";

// Coder Connect doesn't populate any other stats
Expand Down
8 changes: 1 addition & 7 deletions src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ 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
let prettyBytes: any;
import prettyBytes from "pretty-bytes";
import * as vscode from "vscode";
import { errToStr } from "./api-helper";
import * as cli from "./cliManager";
Expand Down Expand Up @@ -124,10 +122,6 @@ 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;
}
const baseUrl = restClient.getAxiosInstance().defaults.baseURL;

// Settings can be undefined when set to their defaults (true in this case),
Expand Down
10 changes: 7 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"compilerOptions": {
"module": "Node16",
"module": "commonjs",
"target": "ES2022",
"moduleResolution": "node",
"outDir": "out",
// "dom" is required for importing the API from coder/coder.
"lib": ["ES2022", "dom"],
"sourceMap": true,
"strict": true,
"skipLibCheck": true
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"exclude": ["vitest.config.ts"]
"exclude": ["node_modules", "vitest.config.ts"],
"include": ["src/**/*"]
}
Loading
0