From ab07b71888b3a7215a8ca0273aa1ea88dacf6497 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Wed, 2 Jul 2025 17:03:01 +0900 Subject: [PATCH] fix: fix bundle size + remove eval warning --- package.json | 3 +- patches/file-type@16.5.4.patch | 63 ++++++++++++++++++++++++++++++++++ pnpm-lock.yaml | 7 ++-- 3 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 patches/file-type@16.5.4.patch diff --git a/package.json b/package.json index 86408dfc..b7d5be96 100644 --- a/package.json +++ b/package.json @@ -233,7 +233,8 @@ "patchedDependencies": { "vudio@2.1.1": "patches/vudio@2.1.1.patch", "@malept/flatpak-bundler@0.4.0": "patches/@malept__flatpak-bundler@0.4.0.patch", - "kuromoji@0.1.2": "patches/kuromoji@0.1.2.patch" + "kuromoji@0.1.2": "patches/kuromoji@0.1.2.patch", + "file-type@16.5.4": "patches/file-type@16.5.4.patch" }, "neverBuiltDependencies": [] }, diff --git a/patches/file-type@16.5.4.patch b/patches/file-type@16.5.4.patch new file mode 100644 index 00000000..88e4d3bf --- /dev/null +++ b/patches/file-type@16.5.4.patch @@ -0,0 +1,63 @@ +diff --git a/.idea/.gitignore b/.idea/.gitignore +new file mode 100644 +index 0000000000000000000000000000000000000000..c3f502a199e7b13cdb5ce0471aa23adcd218f4a8 +--- /dev/null ++++ b/.idea/.gitignore +@@ -0,0 +1,8 @@ ++# 디폴트 무시된 파일 ++/shelf/ ++/workspace.xml ++# 에디터 기반 HTTP 클라이언트 요청 ++/httpRequests/ ++# Datasource local storage ignored files ++/dataSources/ ++/dataSources.local.xml +diff --git a/.idea/discord.xml b/.idea/discord.xml +new file mode 100644 +index 0000000000000000000000000000000000000000..9b28b4a45a383d25057c32221f854bc4fb89d0e5 +--- /dev/null ++++ b/.idea/discord.xml +@@ -0,0 +1,12 @@ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/.idea/workspace.xml b/.idea/workspace.xml +new file mode 100644 +index 0000000000000000000000000000000000000000..8744590a49ab577e0ec11e1cf8baa9c658ba2719 +--- /dev/null ++++ b/.idea/workspace.xml +@@ -0,0 +1,9 @@ ++ ++ ++ ++ ++ {} ++ +\ No newline at end of file +diff --git a/core.js b/core.js +index d653e66a4056c27cca777d4e25222acae3b2ec85..a91741d67df85fd9627889a6c7197ac4e6a3a813 100644 +--- a/core.js ++++ b/core.js +@@ -1415,8 +1415,7 @@ async function _fromTokenizer(tokenizer) { + } + + const stream = readableStream => new Promise((resolve, reject) => { +- // Using `eval` to work around issues when bundling with Webpack +- const stream = eval('require')('stream'); // eslint-disable-line no-eval ++ const stream = require('node:stream'); // eslint-disable-line no-eval + + readableStream.on('error', reject); + readableStream.once('readable', async () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a06ab9dd..ad15e8d7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ patchedDependencies: '@malept/flatpak-bundler@0.4.0': hash: c787371eeb2af011ea934e8818a0dad6d7dcb2df31bbb1686babc7231af0183c path: patches/@malept__flatpak-bundler@0.4.0.patch + file-type@16.5.4: + hash: e74fa068cbc125d0e5e149e4bb541974e3df88f023bbf105f1efe2028740e67c + path: patches/file-type@16.5.4.patch kuromoji@0.1.2: hash: 4a948f1ea45c61779fa371feb020253ccf7a24e1f7c6b2e250b3ce53d86216d4 path: patches/kuromoji@0.1.2.patch @@ -5402,7 +5405,7 @@ snapshots: '@jimp/utils': 1.6.0 await-to-js: 3.0.0 exif-parser: 0.1.12 - file-type: 16.5.4 + file-type: 16.5.4(patch_hash=e74fa068cbc125d0e5e149e4bb541974e3df88f023bbf105f1efe2028740e67c) mime: 3.0.0 '@jimp/diff@1.6.0': @@ -7476,7 +7479,7 @@ snapshots: dependencies: flat-cache: 4.0.1 - file-type@16.5.4: + file-type@16.5.4(patch_hash=e74fa068cbc125d0e5e149e4bb541974e3df88f023bbf105f1efe2028740e67c): dependencies: readable-web-to-node-stream: 3.0.4 strtok3: 6.3.0