From d69256aa2d539deb35a3b4fcf40c36815322b7b0 Mon Sep 17 00:00:00 2001 From: Muffin Date: Sun, 19 May 2024 21:58:36 -0500 Subject: [PATCH] Replace jszip with @turbowarp/jszip --- package-lock.json | 45 +------------------- package.json | 2 +- src/serialization/deserialize-assets.js | 2 +- src/virtual-machine.js | 2 +- test/integration/tw_save_project_sb3.js | 2 +- test/integration/tw_serialize_asset_order.js | 2 +- test/unit/tw_asset_util.js | 2 +- webpack.config.js | 1 - 8 files changed, 7 insertions(+), 51 deletions(-) diff --git a/package-lock.json b/package-lock.json index a8f2cfcd91a..fb08394a736 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MPL-2.0", "dependencies": { "@turbowarp/json": "^0.1.2", + "@turbowarp/jszip": "^3.11.0", "@turbowarp/nanolog": "^0.2.0", "@vernier/godirect": "1.5.0", "arraybuffer-loader": "^1.0.6", @@ -21,7 +22,6 @@ "format-message": "6.2.1", "htmlparser2": "3.10.0", "immutable": "3.8.2", - "jszip": "^3.1.5", "scratch-parser": "github:TurboWarp/scratch-parser#master", "scratch-sb1-converter": "0.2.7", "scratch-translate-extension-languages": "0.0.20191118205314", @@ -10239,49 +10239,6 @@ "node": ">=4.0" } }, - "node_modules/jszip": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", - "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", - "dependencies": { - "lie": "~3.3.0", - "pako": "~1.0.2", - "readable-stream": "~2.3.6", - "setimmediate": "^1.0.5" - } - }, - "node_modules/jszip/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" - }, - "node_modules/jszip/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/jszip/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/jszip/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", diff --git a/package.json b/package.json index 46c8c11599d..b5286ec8a74 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ }, "dependencies": { "@turbowarp/json": "^0.1.2", + "@turbowarp/jszip": "^3.11.0", "@turbowarp/nanolog": "^0.2.0", "@vernier/godirect": "1.5.0", "arraybuffer-loader": "^1.0.6", @@ -46,7 +47,6 @@ "format-message": "6.2.1", "htmlparser2": "3.10.0", "immutable": "3.8.2", - "jszip": "^3.1.5", "scratch-parser": "github:TurboWarp/scratch-parser#master", "scratch-sb1-converter": "0.2.7", "scratch-translate-extension-languages": "0.0.20191118205314", diff --git a/src/serialization/deserialize-assets.js b/src/serialization/deserialize-assets.js index 568614c3dc3..12812ac3614 100644 --- a/src/serialization/deserialize-assets.js +++ b/src/serialization/deserialize-assets.js @@ -1,4 +1,4 @@ -const JSZip = require('jszip'); +const JSZip = require('@turbowarp/jszip'); const log = require('../util/log'); /** diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 46d26c05a90..09e9593353d 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -5,7 +5,7 @@ if (typeof TextEncoder === 'undefined') { _TextEncoder = TextEncoder; } const EventEmitter = require('events'); -const JSZip = require('jszip'); +const JSZip = require('@turbowarp/jszip'); const Buffer = require('buffer').Buffer; const centralDispatch = require('./dispatch/central-dispatch'); diff --git a/test/integration/tw_save_project_sb3.js b/test/integration/tw_save_project_sb3.js index d540002e107..60306e334d7 100644 --- a/test/integration/tw_save_project_sb3.js +++ b/test/integration/tw_save_project_sb3.js @@ -4,7 +4,7 @@ const fs = require('fs'); const pathUtil = require('path'); const VirtualMachine = require('../../src/virtual-machine'); const makeTestStorage = require('../fixtures/make-test-storage'); -const JSZip = require('jszip'); +const JSZip = require('@turbowarp/jszip'); const fixture = fs.readFileSync(pathUtil.join(__dirname, '..', 'fixtures', 'tw-save-project-sb3.sb3')); diff --git a/test/integration/tw_serialize_asset_order.js b/test/integration/tw_serialize_asset_order.js index 0ecbe1e22bb..8d296ac2a85 100644 --- a/test/integration/tw_serialize_asset_order.js +++ b/test/integration/tw_serialize_asset_order.js @@ -1,7 +1,7 @@ const fs = require('fs'); const path = require('path'); const {test} = require('tap'); -const JSZip = require('jszip'); +const JSZip = require('@turbowarp/jszip'); const VM = require('../../src/virtual-machine'); const makeTestStorage = require('../fixtures/make-test-storage'); diff --git a/test/unit/tw_asset_util.js b/test/unit/tw_asset_util.js index c5c26e5625e..a3449570c07 100644 --- a/test/unit/tw_asset_util.js +++ b/test/unit/tw_asset_util.js @@ -1,5 +1,5 @@ const {test} = require('tap'); -const JSZip = require('jszip'); +const JSZip = require('@turbowarp/jszip'); const makeTestStorage = require('../fixtures/make-test-storage'); const AssetUtil = require('../../src/util/tw-asset-util'); const Runtime = require('../../src/engine/runtime'); diff --git a/webpack.config.js b/webpack.config.js index 52166ca10c7..8686f7a7d91 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -70,7 +70,6 @@ module.exports = [ 'format-message': true, 'htmlparser2': true, 'immutable': true, - 'jszip': true, 'scratch-parser': true, 'socket.io-client': true, 'text-encoding': true