diff --git a/package.json b/package.json index 9ca49c73260..b969df1646e 100644 --- a/package.json +++ b/package.json @@ -203,8 +203,12 @@ "@types/react": "17.0.39", "@types/jsdom": "link:./typings/void", "@types/webpack": "^5.28.0", + "browserify-sign": "^4.2.2", "jsdom": "24.0.0", "react": "17.0.2", + "crypto-js": "^4.2.0", + "ip": "^2.0.1", + "postcss": "^8.4.35", "react-dom": "17.0.2", "semver": "7.5.4", "typescript": "4.7.4", diff --git a/packages/api-mailer/package.json b/packages/api-mailer/package.json index 68db1a2fa99..7ae4a24e999 100644 --- a/packages/api-mailer/package.json +++ b/packages/api-mailer/package.json @@ -21,9 +21,9 @@ "@webiny/handler-graphql": "0.0.0", "@webiny/plugins": "0.0.0", "@webiny/pubsub": "0.0.0", - "crypto-js": "4.2.0", + "crypto-js": "^4.2.0", "lodash": "4.17.21", - "nodemailer": "^6.9.9", + "nodemailer": "^6.9.12", "zod": "^3.22.4" }, "devDependencies": { diff --git a/packages/api-page-builder-import-export/package.json b/packages/api-page-builder-import-export/package.json index 39780b4d687..f9664b4a8a1 100644 --- a/packages/api-page-builder-import-export/package.json +++ b/packages/api-page-builder-import-export/package.json @@ -29,7 +29,7 @@ "@webiny/pubsub": "0.0.0", "@webiny/utils": "0.0.0", "@webiny/validation": "0.0.0", - "archiver": "^5.3.0", + "archiver": "^7.0.1", "commodo-fields-object": "^1.0.6", "dot-prop-immutable": "^2.1.0", "fs-extra": "^9.1.0", diff --git a/packages/api-page-builder/package.json b/packages/api-page-builder/package.json index 84e9903877c..c3a036b5ac4 100644 --- a/packages/api-page-builder/package.json +++ b/packages/api-page-builder/package.json @@ -30,6 +30,7 @@ "@webiny/plugins": "0.0.0", "@webiny/pubsub": "0.0.0", "@webiny/utils": "0.0.0", + "archiver": "^7.0.1", "dataloader": "^2.0.0", "extract-zip": "^1.6.7", "fs-extra": "^9.1.0", @@ -40,7 +41,6 @@ "rimraf": "^5.0.5", "stream": "^0.0.2", "uniqid": "^5.2.0", - "zip-local": "^0.3.5", "zod": "^3.22.4" }, "devDependencies": { diff --git a/packages/api-page-builder/src/installation/createInstallationZip.ts b/packages/api-page-builder/src/installation/createInstallationZip.ts index 8c8bb20ce03..c2d278071fb 100644 --- a/packages/api-page-builder/src/installation/createInstallationZip.ts +++ b/packages/api-page-builder/src/installation/createInstallationZip.ts @@ -1,12 +1,8 @@ import path from "path"; -/** - * Package zip-local does not have types. - */ -// @ts-expect-error -import zipper from "zip-local"; import fs from "fs"; +import { create as createArchiver } from "archiver"; -export default (destination = "./pageBuilderInstallation.zip") => { +export default async (destination = "./pageBuilderInstallation.zip"): Promise => { if (fs.existsSync(destination)) { return; } @@ -16,5 +12,21 @@ export default (destination = "./pageBuilderInstallation.zip") => { fs.mkdirSync(dir, { recursive: true }); } - return zipper.sync.zip(path.join(__dirname, "files")).compress().save(destination); + const source = path.join(__dirname, "files"); + const archive = createArchiver("zip", { + zlib: { + level: 9 + } + }); + const stream = fs.createWriteStream(destination); + + return new Promise((resolve, reject) => { + archive + .directory(source, false) + .on("error", err => reject(err)) + .pipe(stream); + + stream.on("close", () => resolve()); + archive.finalize(); + }); }; diff --git a/packages/project-utils/bundling/app/config/webpack.config.js b/packages/project-utils/bundling/app/config/webpack.config.js index 5edd3a7d7a7..4a750fd3568 100644 --- a/packages/project-utils/bundling/app/config/webpack.config.js +++ b/packages/project-utils/bundling/app/config/webpack.config.js @@ -229,7 +229,8 @@ module.exports = function (webpackEnv, { paths, options }) { assert: require.resolve("assert-browserify"), buffer: require.resolve("buffer/"), crypto: require.resolve("crypto-browserify"), - path: require.resolve("path-browserify") + path: require.resolve("path-browserify"), + vm: require.resolve("vm-browserify") } }, @@ -416,6 +417,9 @@ module.exports = function (webpackEnv, { paths, options }) { new webpack.ProvidePlugin({ Buffer: ["buffer", "Buffer"] }), + new webpack.ProvidePlugin({ + process: "process/browser" + }), // Generates an `index.html` file with the