From 23f2861c89d44339ee1babffd67e2af15a4eb4df Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:59:32 +0000 Subject: [PATCH 1/3] Update dependency libarchive.js to v2 --- package-lock.json | 32 +++++++++++++++++++++++++------- package.json | 2 +- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 32eef6358a..de9a2e18aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "jellyfin-apiclient": "1.11.0", "jquery": "3.7.1", "jstree": "3.3.16", - "libarchive.js": "1.3.0", + "libarchive.js": "2.0.2", "lodash-es": "4.17.21", "markdown-it": "14.1.0", "material-design-icons-iconfont": "6.7.0", @@ -8805,6 +8805,12 @@ "node": ">= 0.8" } }, + "node_modules/comlink": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/comlink/-/comlink-4.4.1.tgz", + "integrity": "sha512-+1dlx0aY5Jo1vHy/tSsIGpSkN4tS9rZSW8FIhG0JH/crs9wwweswIo/POr451r7bZww3hFbPAKnTpimzL/mm4Q==", + "license": "Apache-2.0" + }, "node_modules/commander": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", @@ -14969,9 +14975,13 @@ } }, "node_modules/libarchive.js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/libarchive.js/-/libarchive.js-1.3.0.tgz", - "integrity": "sha512-EkQfRXt9DhWwj6BnEA2TNpOf4jTnzSTUPGgE+iFxcdNqjktY8GitbDeHnx8qZA0/IukNyyBUR3oQKRdYkO+HFg==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/libarchive.js/-/libarchive.js-2.0.2.tgz", + "integrity": "sha512-JHb+P4suNSjvz/dMdRgOe7JAxluXJeialzSFkKHU5y0ZK+m175drPOaIYW6I9WXSDcPcQ13eCUgMnpgY0ggmoQ==", + "license": "MIT", + "dependencies": { + "comlink": "^4.4.1" + } }, "node_modules/lie": { "version": "3.1.1", @@ -32075,6 +32085,11 @@ "delayed-stream": "~1.0.0" } }, + "comlink": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/comlink/-/comlink-4.4.1.tgz", + "integrity": "sha512-+1dlx0aY5Jo1vHy/tSsIGpSkN4tS9rZSW8FIhG0JH/crs9wwweswIo/POr451r7bZww3hFbPAKnTpimzL/mm4Q==" + }, "commander": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", @@ -36527,9 +36542,12 @@ } }, "libarchive.js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/libarchive.js/-/libarchive.js-1.3.0.tgz", - "integrity": "sha512-EkQfRXt9DhWwj6BnEA2TNpOf4jTnzSTUPGgE+iFxcdNqjktY8GitbDeHnx8qZA0/IukNyyBUR3oQKRdYkO+HFg==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/libarchive.js/-/libarchive.js-2.0.2.tgz", + "integrity": "sha512-JHb+P4suNSjvz/dMdRgOe7JAxluXJeialzSFkKHU5y0ZK+m175drPOaIYW6I9WXSDcPcQ13eCUgMnpgY0ggmoQ==", + "requires": { + "comlink": "^4.4.1" + } }, "lie": { "version": "3.1.1", diff --git a/package.json b/package.json index 93991f9d55..268ba5a6a3 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "jellyfin-apiclient": "1.11.0", "jquery": "3.7.1", "jstree": "3.3.16", - "libarchive.js": "1.3.0", + "libarchive.js": "2.0.2", "lodash-es": "4.17.21", "markdown-it": "14.1.0", "material-design-icons-iconfont": "6.7.0", From a014f2775e77624ae00e12ed34f6f09b7904d61a Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Mon, 9 Sep 2024 14:03:17 -0400 Subject: [PATCH 2/3] Fix wasm paths --- webpack.common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index 734343813d..651440dac1 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -18,8 +18,8 @@ const Assets = [ ]; const LibarchiveWasm = [ - 'libarchive.js/dist/wasm-gen/libarchive.js', - 'libarchive.js/dist/wasm-gen/libarchive.wasm' + 'libarchive.js/dist/libarchive.js', + 'libarchive.js/dist/libarchive.wasm' ]; const DEV_MODE = process.env.NODE_ENV !== 'production'; From bec74d29497f253c50c5605f46017d2b71dcfaab Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 11 Sep 2024 10:07:18 -0400 Subject: [PATCH 3/3] Fix libarchive bundling --- .escheckrc | 1 - src/plugins/comicsPlayer/plugin.js | 1 - webpack.common.js | 20 +++++++------------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.escheckrc b/.escheckrc index 195d28b9fc..37003a295a 100644 --- a/.escheckrc +++ b/.escheckrc @@ -5,7 +5,6 @@ "not": [ "./dist/libraries/pdf.worker.js", "./dist/libraries/worker-bundle.js", - "./dist/libraries/wasm-gen/libarchive.js", "./dist/serviceworker.js" ] } diff --git a/src/plugins/comicsPlayer/plugin.js b/src/plugins/comicsPlayer/plugin.js index dd0f77da60..172355e2f0 100644 --- a/src/plugins/comicsPlayer/plugin.js +++ b/src/plugins/comicsPlayer/plugin.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/named, import/namespace import { Archive } from 'libarchive.js'; import loading from '../../components/loading/loading'; import dialogHelper from '../../components/dialogHelper/dialogHelper'; diff --git a/webpack.common.js b/webpack.common.js index 651440dac1..b58058f53f 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -4,12 +4,13 @@ const CopyPlugin = require('copy-webpack-plugin'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const { DefinePlugin } = require('webpack'); +const { DefinePlugin, IgnorePlugin } = require('webpack'); const packageJson = require('./package.json'); const Assets = [ 'native-promise-only/npo.js', 'libarchive.js/dist/worker-bundle.js', + 'libarchive.js/dist/libarchive.wasm', '@jellyfin/libass-wasm/dist/js/default.woff2', '@jellyfin/libass-wasm/dist/js/subtitles-octopus-worker.js', '@jellyfin/libass-wasm/dist/js/subtitles-octopus-worker.wasm', @@ -17,11 +18,6 @@ const Assets = [ 'pdfjs-dist/build/pdf.worker.js' ]; -const LibarchiveWasm = [ - 'libarchive.js/dist/libarchive.js', - 'libarchive.js/dist/libarchive.wasm' -]; - const DEV_MODE = process.env.NODE_ENV !== 'production'; let COMMIT_SHA = ''; try { @@ -103,13 +99,11 @@ const config = { }; }) }), - new CopyPlugin({ - patterns: LibarchiveWasm.map(asset => { - return { - from: path.resolve(__dirname, `./node_modules/${asset}`), - to: path.resolve(__dirname, './dist/libraries/wasm-gen') - }; - }) + // The libarchive.js worker-bundle is copied manually. + // If it is automatically bundled, escheck will fail since it uses import.meta.url. + new IgnorePlugin({ + resourceRegExp: /worker-bundle\.js$/, + contextRegExp: /libarchive.js/ }), new ForkTsCheckerWebpackPlugin({ typescript: {