From d0b75e853cffd11ee2186b6f3f40b9da5346fe16 Mon Sep 17 00:00:00 2001 From: thecodrr Date: Tue, 26 Jul 2022 23:15:57 +0500 Subject: [PATCH] chore: upgrade react-scripts to 5.0.1 --- apps/web/package.json | 13 +++++++------ apps/web/patches/react-scripts+4.0.3.patch | 12 ------------ apps/web/patches/react-scripts+5.0.1.patch | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+), 18 deletions(-) delete mode 100644 apps/web/patches/react-scripts+4.0.3.patch create mode 100644 apps/web/patches/react-scripts+5.0.1.patch diff --git a/apps/web/package.json b/apps/web/package.json index 886f8f9f9..b7d46123d 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -16,9 +16,9 @@ "@notesnook/crypto": "^1.0.0", "@notesnook/desktop": "file:desktop", "@rebass/forms": "^4.0.6", - "@streetwriters/editor": "^1.1.3", - "@streetwriters/notesnook-core": "^7.3.1", - "@streetwriters/theme": "1.0.0", + "@streetwriters/editor": "^1.1.4", + "@streetwriters/notesnook-core": "^7.3.3", + "@streetwriters/theme": "^1.0.1", "allotment": "^1.12.1", "async-mutex": "^0.3.2", "axios": "^0.21.4", @@ -49,7 +49,7 @@ "react-loading-skeleton": "^3.1.0", "react-modal": "^3.12.1", "react-qrcode-logo": "^2.2.1", - "react-scripts": "^4.0.3", + "react-scripts": "^5.0.1", "react-scroll-sync": "^0.9.0", "react-toggle": "^4.1.2", "react-virtuoso": "^2.4.0", @@ -62,7 +62,7 @@ "zustand": "^3.3.1" }, "devDependencies": { - "@playwright/test": "^1.16.0", + "@playwright/test": "^1.24.1", "@types/file-saver": "^2.0.5", "@types/hookrouter": "^2.2.5", "@types/node-fetch": "^2.5.10", @@ -73,6 +73,7 @@ "@types/rebass__forms": "^4.0.6", "babel-eslint": "^10.1.0", "babel-plugin-transform-class-properties": "^6.24.1", + "buffer": "^6.0.3", "chalk": "^4.1.0", "dotenv": "^10.0.0", "env-cmd": "^10.1.0", @@ -98,7 +99,7 @@ "preinstall": "./scripts/build-deps.sh", "start": "env-cmd -e all,dev,web react-scripts start", "start:desktop": "env-cmd -e all,desktop react-scripts start", - "build": "env-cmd -e all,web react-scripts build", + "build": "env-cmd -e all,web react-scripts --max_old_space_size=8092 build", "build:beta": "env-cmd -e all,web,beta react-scripts build", "build:profile": "env-cmd -e all,web react-scripts build --profile", "build:desktop": "env-cmd -e all,desktop react-scripts build", diff --git a/apps/web/patches/react-scripts+4.0.3.patch b/apps/web/patches/react-scripts+4.0.3.patch deleted file mode 100644 index 31576c9e0..000000000 --- a/apps/web/patches/react-scripts+4.0.3.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js -index 26c2a65..9a8c3c0 100644 ---- a/node_modules/react-scripts/config/webpack.config.js -+++ b/node_modules/react-scripts/config/webpack.config.js -@@ -782,6 +782,7 @@ module.exports = function (webpackEnv) { - // Some libraries import Node modules but don't use them in the browser. - // Tell webpack to provide empty mocks for them so importing them works. - node: { -+ crypto: 'empty', - module: 'empty', - dgram: 'empty', - dns: 'mock', diff --git a/apps/web/patches/react-scripts+5.0.1.patch b/apps/web/patches/react-scripts+5.0.1.patch new file mode 100644 index 000000000..fe2b25385 --- /dev/null +++ b/apps/web/patches/react-scripts+5.0.1.patch @@ -0,0 +1,18 @@ +diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js +index e465d8e..35fcbd4 100644 +--- a/node_modules/react-scripts/config/webpack.config.js ++++ b/node_modules/react-scripts/config/webpack.config.js +@@ -304,6 +304,13 @@ module.exports = function (webpackEnv) { + }, + resolve: { + // This allows you to set a fallback for where webpack should look for modules. ++ fallback: { ++ crypto: false, ++ module: false, ++ dgram: false, ++ path: false, ++ url: false, ++ }, + // We placed these paths second because we want `node_modules` to "win" + // if there are any conflicts. This matches Node resolution mechanism. + // https://github.com/facebook/create-react-app/issues/253