From 667a6f1e36e529a87c3ec5e99b34a1f75a5038c9 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 7 Sep 2024 10:09:48 +0200 Subject: [PATCH 1/4] canary --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01079af..86a6d01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ jobs: - name: Install deno uses: denoland/setup-deno@v1 + version: canary - uses: dprint/check@v2.1 if: runner.os == 'Linux' From 14eeed081828ded188684064fefa54e3c5774449 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 7 Sep 2024 10:17:17 +0200 Subject: [PATCH 2/4] fix --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86a6d01..b5a1633 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,8 @@ jobs: - name: Install deno uses: denoland/setup-deno@v1 - version: canary + with: + deno-version: canary - uses: dprint/check@v2.1 if: runner.os == 'Linux' From 604d5c78fc487f457e9afc5ca9c9559f247d8637 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 7 Sep 2024 10:23:46 +0200 Subject: [PATCH 3/4] update --- src/command.ts | 10 +++++----- src/request.ts | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/command.ts b/src/command.ts index e043f0a..fda851b 100644 --- a/src/command.ts +++ b/src/command.ts @@ -57,7 +57,7 @@ class Deferred { interface ShellPipeWriterKindWithOptions { kind: ShellPipeWriterKind; - options?: PipeOptions; + options?: StreamPipeOptions; } interface CommandBuilderStateCommand { @@ -348,8 +348,8 @@ export class CommandBuilder implements PromiseLike { /** Set the stdout kind. */ stdout(kind: ShellPipeWriterKind): CommandBuilder; - stdout(kind: WritableStream, options?: PipeOptions): CommandBuilder; - stdout(kind: ShellPipeWriterKind, options?: PipeOptions): CommandBuilder { + stdout(kind: WritableStream, options?: StreamPipeOptions): CommandBuilder; + stdout(kind: ShellPipeWriterKind, options?: StreamPipeOptions): CommandBuilder { return this.#newWithState((state) => { if (state.combinedStdoutStderr && kind !== "piped" && kind !== "inheritPiped") { throw new Error( @@ -369,8 +369,8 @@ export class CommandBuilder implements PromiseLike { /** Set the stderr kind. */ stderr(kind: ShellPipeWriterKind): CommandBuilder; - stderr(kind: WritableStream, options?: PipeOptions): CommandBuilder; - stderr(kind: ShellPipeWriterKind, options?: PipeOptions): CommandBuilder { + stderr(kind: WritableStream, options?: StreamPipeOptions): CommandBuilder; + stderr(kind: ShellPipeWriterKind, options?: StreamPipeOptions): CommandBuilder { return this.#newWithState((state) => { if (state.combinedStdoutStderr && kind !== "piped" && kind !== "inheritPiped") { throw new Error( diff --git a/src/request.ts b/src/request.ts index b8a7f86..9431b9c 100644 --- a/src/request.ts +++ b/src/request.ts @@ -329,7 +329,7 @@ export class RequestBuilder implements PromiseLike { } /** Pipes the response body to the provided writable stream. */ - async pipeTo(dest: WritableStream, options?: PipeOptions): Promise { + async pipeTo(dest: WritableStream, options?: StreamPipeOptions): Promise { const response = await this.fetch(); return await response.pipeTo(dest, options); } @@ -582,7 +582,7 @@ export class RequestResponse { } /** Pipes the response body to the provided writable stream. */ - pipeTo(dest: WritableStream, options?: PipeOptions): Promise { + pipeTo(dest: WritableStream, options?: StreamPipeOptions): Promise { return this.#withReturnHandling(() => this.readable.pipeTo(dest, options)); } From fe639639f763a5cc262c529ef24206aba4fe270c Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 7 Sep 2024 10:25:52 +0200 Subject: [PATCH 4/4] update --- deno.json | 2 +- src/console/utils.ts | 6 ++---- src/request.test.ts | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/deno.json b/deno.json index 0134e1d..0052e6d 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@david/dax", - "nodeModulesDir": false, + "nodeModulesDir": "none", "tasks": { "test": "deno test -A", "wasmbuild": "deno run -A https://deno.land/x/wasmbuild@0.15.6/main.ts --sync --out ./src/lib" diff --git a/src/console/utils.ts b/src/console/utils.ts index a4700b3..8a7b105 100644 --- a/src/console/utils.ts +++ b/src/console/utils.ts @@ -79,11 +79,9 @@ function isTerminal(pipe: { isTerminal?(): boolean; rid?: number }) { return pipe.isTerminal(); } else if ( pipe.rid != null && - // deno-lint-ignore no-deprecated-deno-api - typeof Deno.isatty === "function" + typeof (Deno as any).isatty === "function" ) { - // deno-lint-ignore no-deprecated-deno-api - return Deno.isatty(pipe.rid); + return (Deno as any).isatty(pipe.rid); } else { throw new Error("Unsupported pipe."); } diff --git a/src/request.test.ts b/src/request.test.ts index 03f908f..3480f78 100644 --- a/src/request.test.ts +++ b/src/request.test.ts @@ -298,7 +298,7 @@ Deno.test("$.request", (t) => { let caughtErr: TimeoutError | undefined; try { await response.text(); - } catch (err) { + } catch (err: any) { caughtErr = err; } if (isNode) {