diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e884a6..de1d419 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,12 +13,15 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] + timeout-minutes: 10 steps: - uses: actions/checkout@master - uses: denoland/setup-deno@main with: - deno-version: "1.24.0" + deno-version: "1.39.3" - uses: browser-actions/setup-chrome@latest + with: + chrome-version: 113 - name: Run linter if: matrix.os == 'ubuntu-latest' run: | @@ -35,6 +38,7 @@ jobs: - name: Show chrome version run: chrome --version - name: Run tests + env: + CAROL_DEBUG: 1 run: | deno task test - diff --git a/color.ts b/color.ts index 55cec6c..a32cad4 100644 --- a/color.ts +++ b/color.ts @@ -108,7 +108,7 @@ export class Color { ) { return null; } - const hasAlpha = (values[3] !== undefined); + const hasAlpha = values[3] !== undefined; if (match[1]) { // rgb/rgba const rgba = [ diff --git a/deps.ts b/deps.ts index a5e80f3..4fcabb5 100644 --- a/deps.ts +++ b/deps.ts @@ -1,37 +1,35 @@ -export { exists } from "https://deno.land/std@0.149.0/fs/exists.ts"; -export { - dirname, - fromFileUrl, - join, - resolve, -} from "https://deno.land/std@0.149.0/path/mod.ts"; -export { BufReader } from "https://deno.land/std@0.149.0/io/bufio.ts"; -export { concat } from "https://deno.land/std@0.149.0/bytes/mod.ts"; +export { exists } from "https://deno.land/std@0.212.0/fs/exists.ts"; +export { dirname } from "https://deno.land/std@0.212.0/path/dirname.ts"; +export { fromFileUrl } from "https://deno.land/std@0.212.0/path/from_file_url.ts"; +export { join } from "https://deno.land/std@0.212.0/path/join.ts"; +export { resolve } from "https://deno.land/std@0.212.0/path/resolve.ts"; +export { BufReader } from "https://deno.land/std@0.212.0/io/buf_reader.ts"; +export { concat } from "https://deno.land/std@0.212.0/bytes/mod.ts"; // TODO: Remove this import statement. export { decode, encode } from "https://deno.land/std@0.84.0/encoding/utf8.ts"; export { - decode as decodeFromBase64, - encode as encodeToBase64, -} from "https://deno.land/std@0.149.0/encoding/base64.ts"; + decodeBase64 as decodeFromBase64, + encodeBase64 as encodeToBase64, +} from "https://deno.land/std@0.212.0/encoding/base64.ts"; export { deferred } from "https://deno.land/std@0.149.0/async/deferred.ts"; export type { Deferred } from "https://deno.land/std@0.149.0/async/deferred.ts"; -export { readAll, writeAll } from "https://deno.land/std@0.149.0/io/util.ts"; - -export { - assert, - assertEquals, - assertRejects, - assertStrictEquals, - assertStringIncludes, - fail, -} from "https://deno.land/std@0.149.0/testing/asserts.ts"; +export { readAll } from "https://deno.land/std@0.212.0/streams/read_all.ts"; +export { writeAll } from "https://deno.land/std@0.212.0/streams/write_all.ts"; -export { default as puppeteer } from "https://unpkg.com/puppeteer@13.3.2/lib/esm/puppeteer/web.js"; -export { EventEmitter } from "https://unpkg.com/puppeteer@13.3.2/lib/esm/puppeteer/common/EventEmitter.js"; -export { BrowserWebSocketTransport } from "https://unpkg.com/puppeteer@13.3.2/lib/esm/puppeteer/common/BrowserWebSocketTransport.js"; +export { assert } from "https://deno.land/std@0.212.0/assert/assert.ts"; +export { assertEquals } from "https://deno.land/std@0.212.0/assert/assert_equals.ts"; +export { assertRejects } from "https://deno.land/std@0.212.0/assert/assert_rejects.ts"; +export { assertStrictEquals } from "https://deno.land/std@0.212.0/assert/assert_strict_equals.ts"; +export { assertStringIncludes } from "https://deno.land/std@0.212.0/assert/assert_string_includes.ts"; +export { fail } from "https://deno.land/std@0.212.0/assert/fail.ts"; -export type { Browser } from "https://unpkg.com/puppeteer@13.3.2/lib/esm/puppeteer/common/Browser.js"; -export type { Target } from "https://unpkg.com/puppeteer@13.3.2/lib/esm/puppeteer/common/Target.js"; -export type { CDPSession } from "https://unpkg.com/puppeteer@13.3.2/lib/esm/puppeteer/common/Connection.js"; -export type { Page } from "https://unpkg.com/puppeteer@13.3.2/lib/esm/puppeteer/common/Page.js"; +export { + type Browser, + BrowserWebSocketTransport, + type CDPSession, + default as puppeteer, + EventEmitter, + type Page, + type Target, +} from "npm:puppeteer-core@20.1.0"; // "https://esm.sh/puppeteer-core@20.1.0/lib/esm/puppeteer/puppeteer-core.js?pin=v135"; diff --git a/http_request.ts b/http_request.ts index a01694e..4e3e272 100644 --- a/http_request.ts +++ b/http_request.ts @@ -189,7 +189,7 @@ export class HttpRequest implements types.HttpRequest { text += CRLF; let responseBuffer = encode(text); if (body) { - responseBuffer = concat(responseBuffer, body); + responseBuffer = concat([responseBuffer, body]); } return this.resolve_({ diff --git a/import_map.test.json b/import_map.test.json index 148c1af..daa0475 100644 --- a/import_map.test.json +++ b/import_map.test.json @@ -1,6 +1,6 @@ { "imports": { "https://deno.land/x/carol/mod.ts": "./mod.ts", - "https://deno.land/std/path/mod.ts": "https://deno.land/std@0.107.0/path/mod.ts" + "https://deno.land/std/path/mod.ts": "https://deno.land/std@0.211.0/path/mod.ts" } } diff --git a/locate.ts b/locate.ts index ee13658..191de9d 100644 --- a/locate.ts +++ b/locate.ts @@ -27,10 +27,8 @@ import { exists } from "./deps.ts"; -type OS = "darwin" | "linux" | "windows"; - export async function locateChrome( - os: OS = Deno.build.os, + os: typeof Deno.build.os = Deno.build.os, env = Deno.env, ): Promise { let paths!: string[]; diff --git a/puppeteer.ts b/puppeteer.ts index c8c883c..801a18b 100644 --- a/puppeteer.ts +++ b/puppeteer.ts @@ -53,6 +53,7 @@ export async function launch( options: AppOptions, ): Promise { const chromeArgs = prepareChromeArgs(executablePath, headless, options); + // deno-lint-ignore no-deprecated-deno-api const chromeProcess = Deno.run({ cmd: chromeArgs, stderr: "piped", diff --git a/tools/generate_rpc_client.ts b/tools/generate_rpc_client.ts index 8488233..3ce8fa0 100644 --- a/tools/generate_rpc_client.ts +++ b/tools/generate_rpc_client.ts @@ -41,6 +41,7 @@ function validateOutput(output: string): void { } async function formatSource(source: string): Promise { + // deno-lint-ignore no-deprecated-deno-api const deno = Deno.run({ cmd: [Deno.execPath(), "fmt", "-"], stdin: "piped",