Skip to content

Commit

Permalink
dep: update to wabac.js 2.20 (#704)
Browse files Browse the repository at this point in the history
Update imports for new TS-based wabac.js
  • Loading branch information
ikreymer authored Oct 17, 2024
1 parent a45b85d commit 0d39ea3
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 37 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@novnc/novnc": "^1.4.0",
"@webrecorder/wabac": "^2.19.8",
"@webrecorder/wabac": "^2.20.0-beta.4",
"browsertrix-behaviors": "^0.6.4",
"client-zip": "^2.4.5",
"fetch-socks": "^1.3.0",
Expand Down Expand Up @@ -58,7 +58,7 @@
"jest": "^29.7.0",
"md5": "^2.3.0",
"prettier": "3.0.3",
"typescript": "^5.2.2"
"typescript": "^5.5.4"
},
"jest": {
"transform": {},
Expand Down
9 changes: 3 additions & 6 deletions src/replaycrawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import { PageInfoRecord, PageInfoValue, Recorder } from "./util/recorder.js";
import fsp from "fs/promises";
import path from "path";

// @ts-expect-error wabac.js
import { ZipRangeReader } from "@webrecorder/wabac/src/wacz/ziprangereader.js";
// @ts-expect-error wabac.js
import { createLoader } from "@webrecorder/wabac/src/blockloaders.js";
import { ZipRangeReader, createLoader } from "@webrecorder/wabac";

import { AsyncIterReader } from "warcio";
import { parseArgs } from "./util/argParser.js";
Expand Down Expand Up @@ -783,7 +780,7 @@ export class ReplayCrawler extends Crawler {

class WACZLoader {
url: string;
zipreader: ZipRangeReader;
zipreader: ZipRangeReader | null;

constructor(url: string) {
this.url = url;
Expand All @@ -802,7 +799,7 @@ class WACZLoader {
}

async loadFile(fileInZip: string) {
const { reader } = await this.zipreader.loadFile(fileInZip);
const { reader } = await this.zipreader!.loadFile(fileInZip);

if (!reader) {
return null;
Expand Down
8 changes: 1 addition & 7 deletions src/util/recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ import {

import { fetch, getGlobalDispatcher, Response } from "undici";

// @ts-expect-error TODO fill in why error is expected
import { getCustomRewriter } from "@webrecorder/wabac/src/rewrite/index.js";
import {
rewriteDASH,
rewriteHLS,
// @ts-expect-error TODO fill in why error is expected
} from "@webrecorder/wabac/src/rewrite/rewriteVideo.js";
import { getCustomRewriter, rewriteDASH, rewriteHLS } from "@webrecorder/wabac";

import { WARCRecord } from "warcio";
import { TempFileBuffer, WARCSerializer } from "warcio/node";
Expand Down
5 changes: 1 addition & 4 deletions src/util/reqresp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// @ts-expect-error TODO fill in why error is expected
import { getStatusText } from "@webrecorder/wabac/src/utils.js";
// @ts-expect-error TODO fill in why error is expected
import { getCustomRewriter } from "@webrecorder/wabac/src/rewrite/index.js";
import { getCustomRewriter, getStatusText } from "@webrecorder/wabac";

import { Protocol } from "puppeteer-core";
import { postToGetUrl } from "warcio";
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */

/* Modules */
"module": "NodeNext" /* Specify what module code is generated. */,
"module": "esnext" /* Specify what module code is generated. */,
"rootDir": "./src" /* Specify the root folder within your source files. */,
"moduleResolution": "NodeNext" /* Specify how TypeScript looks up a file from a given module specifier. */,
"moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
//"baseUrl": "./src", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
Expand Down
33 changes: 17 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1312,15 +1312,16 @@
resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406"
integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==

"@webrecorder/wabac@^2.19.8":
version "2.19.8"
resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.19.8.tgz#302ade200953a1c76f0b355983ae4081428fb933"
integrity sha512-WjyfsGK8JWKeeDsGrOIT8ZLjMcOOAN93OMnRLO214jSV18SHEOY4JRvXzFOLF+OWYC5kJIMjl05gurTLq18jOA==
"@webrecorder/wabac@^2.20.0-beta.4":
version "2.20.0-beta.4"
resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.20.0-beta.4.tgz#c60fcd00f449cca52ce1a0bef305a06922c9e3e8"
integrity sha512-enHYcZoqs7cOu2tdTqVeB/zB27uL4wmCMzvF55bJqdB8d5zgPpY+/fpRA3eLxGrPc0nFYAjsI/aNaa62FH7WKQ==
dependencies:
"@peculiar/asn1-ecc" "^2.3.4"
"@peculiar/asn1-schema" "^2.3.3"
"@peculiar/x509" "^1.9.2"
"@webrecorder/wombat" "^3.8.0"
"@types/js-levenshtein" "^1.1.3"
"@webrecorder/wombat" "^3.8.2"
acorn "^8.10.0"
auto-js-ipfs "^2.1.1"
base64-js "^1.5.1"
Expand All @@ -1339,14 +1340,14 @@
path-parser "^6.1.0"
process "^0.11.10"
stream-browserify "^3.0.0"
warcio "^2.3.0"
warcio "^2.3.1"

"@webrecorder/wombat@^3.8.0":
version "3.8.0"
resolved "https://registry.yarnpkg.com/@webrecorder/wombat/-/wombat-3.8.0.tgz#63ed3df199f11223b23c9ce66202590b8511ae2a"
integrity sha512-MpzNu9+ClCHjOER9XCrsEIsJk15L6qGO+PxeBPiOtaFJmNUiz0auMT5AQwiPqJgKEAniZTlPx1O4kNCVJu9f2Q==
"@webrecorder/wombat@^3.8.2":
version "3.8.2"
resolved "https://registry.yarnpkg.com/@webrecorder/wombat/-/wombat-3.8.2.tgz#e46e18719834d633175eec52ce753a4dc4e48e27"
integrity sha512-uUZr9V4UYpVOpM64Tm27ND/hMjDbT37+/qyNaNV6loqDuVzBVQh5w7SfTEy0Bbjj1MYyNZP244mOtWtotTpUEA==
dependencies:
warcio "^2.3.0"
warcio "^2.3.1"

"@zxing/[email protected]":
version "0.9.0"
Expand Down Expand Up @@ -5154,10 +5155,10 @@ typed-query-selector@^2.12.0:
resolved "https://registry.yarnpkg.com/typed-query-selector/-/typed-query-selector-2.12.0.tgz#92b65dbc0a42655fccf4aeb1a08b1dddce8af5f2"
integrity sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==

typescript@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==
typescript@^5.5.4:
version "5.5.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba"
integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==

unbox-primitive@^1.0.0, unbox-primitive@^1.0.1:
version "1.0.1"
Expand Down Expand Up @@ -5282,7 +5283,7 @@ walker@^1.0.8:
dependencies:
makeerror "1.0.12"

warcio@^2.3.0, warcio@^2.3.1:
warcio@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/warcio/-/warcio-2.3.1.tgz#8ac9de897de1a556161168f2a3938b60929908ca"
integrity sha512-PjcWqzXfs6HdWfHi1V/i8MoMmV5M0Csg3rOa2mqCJ1dmCJXswVfQ0VXbEVumwavNIW2oFFj6LJoCHHeL4Ls/zw==
Expand Down

0 comments on commit 0d39ea3

Please sign in to comment.