diff --git a/package.json b/package.json index 4bc944f..bf63fb7 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,6 @@ "@solidjs/meta": "^0.29.4", "@solidjs/router": "^0.15.4", "codemirror": "^6.0.2", - "native-file-system-adapter": "^3.0.1", "solid-js": "^1.9.11" }, "packageManager": "pnpm@10.17.1+sha512.17c560fca4867ae9473a3899ad84a88334914f379be46d455cbf92e5cf4b39d34985d452d2583baf19967fa76cb5c17bc9e245529d0b98745721aa7200ecaf7a" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 064e459..c0bd7fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -98,9 +98,6 @@ importers: codemirror: specifier: ^6.0.2 version: 6.0.2 - native-file-system-adapter: - specifier: ^3.0.1 - version: 3.0.1 solid-js: specifier: ^1.9.11 version: 1.9.11 @@ -1122,10 +1119,6 @@ packages: picomatch: optional: true - fetch-blob@3.2.0: - resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} - engines: {node: ^12.20 || >= 14.13} - fflate@0.8.2: resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==} @@ -1278,15 +1271,6 @@ packages: engines: {node: ^18 || >=20} hasBin: true - native-file-system-adapter@3.0.1: - resolution: {integrity: sha512-ocuhsYk2SY0906LPc3QIMW+rCV3MdhqGiy7wV5Bf0e8/5TsMjDdyIwhNiVPiKxzTJLDrLT6h8BoV9ERfJscKhw==} - engines: {node: '>=14.8.0'} - - node-domexception@1.0.0: - resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} - engines: {node: '>=10.5.0'} - deprecated: Use your platform's native DOMException instead - node-gyp-build@4.8.4: resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} hasBin: true @@ -1537,10 +1521,6 @@ packages: w3c-keyname@2.2.8: resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==} - web-streams-polyfill@3.3.3: - resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} - engines: {node: '>= 8'} - yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} @@ -2511,12 +2491,6 @@ snapshots: optionalDependencies: picomatch: 4.0.3 - fetch-blob@3.2.0: - dependencies: - node-domexception: 1.0.0 - web-streams-polyfill: 3.3.3 - optional: true - fflate@0.8.2: {} fsevents@2.3.3: @@ -2625,13 +2599,6 @@ snapshots: nanoid@5.1.6: {} - native-file-system-adapter@3.0.1: - optionalDependencies: - fetch-blob: 3.2.0 - - node-domexception@1.0.0: - optional: true - node-gyp-build@4.8.4: {} node-releases@2.0.27: {} @@ -2817,9 +2784,6 @@ snapshots: w3c-keyname@2.2.8: {} - web-streams-polyfill@3.3.3: - optional: true - yallist@3.1.1: {} yocto-queue@1.2.2: {} diff --git a/src/views/car/unpack.tsx b/src/views/car/unpack.tsx index 2b0cf22..97a14fd 100644 --- a/src/views/car/unpack.tsx +++ b/src/views/car/unpack.tsx @@ -1,7 +1,6 @@ import { fromStream } from "@atcute/repo"; import { zip, type ZipEntry } from "@mary/zip"; import { Title } from "@solidjs/meta"; -import { FileSystemWritableFileStream, showSaveFilePicker } from "native-file-system-adapter"; import { createSignal, onCleanup } from "solid-js"; import { createDropHandler, createFileChangeHandler, handleDragOver } from "./file-handlers.js"; import { createLogger, LoggerView } from "./logger.jsx"; @@ -114,25 +113,26 @@ export const UnpackToolView = () => { const waiting = logger.progress(`Waiting for user...`); try { - const fd = await showSaveFilePicker({ - suggestedName: `${file.name.replace(/\.car$/, "")}.zip`, - // @ts-expect-error: ponyfill doesn't have full typings - id: "car-unpack", - startIn: "downloads", - types: [ - { - description: "ZIP archive", - accept: { "application/zip": [".zip"] }, - }, - ], - }).catch((err) => { - if (err instanceof DOMException && err.name === "AbortError") { - logger.warn(`File picker was cancelled`); - } else { - logger.warn(`Something went wrong when opening the file picker`); - } - return undefined; - }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fd = await (window as any).showSaveFilePicker({ + suggestedName: `${file.name.replace(/\.car$/, "")}.zip`, + id: "car-unpack", + startIn: "downloads", + types: [ + { + description: "ZIP archive", + accept: { "application/zip": [".zip"] }, + }, + ], + }) + .catch((err: unknown) => { + if (err instanceof DOMException && err.name === "AbortError") { + logger.warn(`File picker was cancelled`); + } else { + logger.warn(`Something went wrong when opening the file picker`); + } + return undefined; + }); if (!fd) { logger.warn(`No file handle obtained`); @@ -182,9 +182,9 @@ export const UnpackToolView = () => { writeCount++; // Await every 100th write to apply backpressure if (writeCount % 100 === 0) { - await writable.write(chunk); + await writable.write(chunk as BufferSource); } else { - writable.write(chunk); // Fire and forget + writable.write(chunk as BufferSource); } }