From bfece1af692f2b79e0b6dec510cebf61c7a199da Mon Sep 17 00:00:00 2001 From: Ahmed Elsayed Date: Tue, 2 Jul 2024 14:34:51 +0200 Subject: [PATCH] chore: rename react navigation in rollup --- configs/jsactions/rollup.config.js | 2 +- package.json | 2 +- .../mobile-resources-native/CHANGELOG.md | 1 + ...endix+pluggable-widgets-tools+9.24.0.patch | 24 +++++++++++++------ yarn.lock | 2 +- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/configs/jsactions/rollup.config.js b/configs/jsactions/rollup.config.js index 9435b7d3d..673a16bb8 100644 --- a/configs/jsactions/rollup.config.js +++ b/configs/jsactions/rollup.config.js @@ -162,6 +162,6 @@ const nativeExternal = [ /^react-native-reanimated(\/|$)/, /^react-native-svg(\/|$)/, /^react-native-vector-icons(\/|$)/, - /^react-navigation(\/|$)/, + /^@?react-navigation($|\/)/, /^react-native-device-info(\/|$)/ ]; diff --git a/package.json b/package.json index a4ff1d38b..f77fc1d7b 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "node": ">=16" }, "resolutions": { - "@mendix/pluggable-widgets-tools": "^9.24.0", + "@mendix/pluggable-widgets-tools": "9.24.0", "@types/react": "^18", "@types/react-native": "0.72.7", "react": "18.2.0", diff --git a/packages/jsActions/mobile-resources-native/CHANGELOG.md b/packages/jsActions/mobile-resources-native/CHANGELOG.md index 798659b7e..85ae7cdda 100644 --- a/packages/jsActions/mobile-resources-native/CHANGELOG.md +++ b/packages/jsActions/mobile-resources-native/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] - We have fixed an issue with checking blocked permissions on iOS +- We have fixed an issue with `useNavigation` support in widgets. ## [6.1.0] Native Mobile Resources - 2024-05-28 diff --git a/patches/@mendix+pluggable-widgets-tools+9.24.0.patch b/patches/@mendix+pluggable-widgets-tools+9.24.0.patch index 126490fd9..fdaff0b1c 100644 --- a/patches/@mendix+pluggable-widgets-tools+9.24.0.patch +++ b/patches/@mendix+pluggable-widgets-tools+9.24.0.patch @@ -1,7 +1,5 @@ diff --git a/node_modules/@mendix/pluggable-widgets-tools/bin/mx-scripts.js b/node_modules/@mendix/pluggable-widgets-tools/bin/mx-scripts.js -old mode 100755 -new mode 100644 -index ec507d5..f5bf176 +index ec507d5..f5bf176 100755 --- a/node_modules/@mendix/pluggable-widgets-tools/bin/mx-scripts.js +++ b/node_modules/@mendix/pluggable-widgets-tools/bin/mx-scripts.js @@ -1,6 +1,6 @@ @@ -14,7 +12,7 @@ index ec507d5..f5bf176 const { red } = require("ansi-colors"); @@ -14,9 +14,10 @@ checkNodeVersion(); } - + const [, currentScriptPath, cmd, ...args] = process.argv; - const toolsRoot = currentScriptPath.endsWith("pluggable-widgets-tools") + const isSymlink = lstatSync(currentScriptPath).isSymbolicLink(); @@ -22,9 +20,21 @@ index ec507d5..f5bf176 ? join(dirname(currentScriptPath), "../@mendix/pluggable-widgets-tools") - : join(dirname(currentScriptPath), ".."); + : isSymlink ? join(__dirname, "../") : join(dirname(currentScriptPath), ".."); - + if (args.indexOf("--subprojectPath") > -1) { args.splice(args.indexOf("--subprojectPath"), 2); +diff --git a/node_modules/@mendix/pluggable-widgets-tools/configs/rollup.config.native.js b/node_modules/@mendix/pluggable-widgets-tools/configs/rollup.config.native.js +index 85165f8..aabe7af 100644 +--- a/node_modules/@mendix/pluggable-widgets-tools/configs/rollup.config.native.js ++++ b/node_modules/@mendix/pluggable-widgets-tools/configs/rollup.config.native.js +@@ -277,6 +277,6 @@ const nativeExternal = [ + /^react-native-fast-image($|\/)/, + /^react-native-svg($|\/)/, + /^react-native-vector-icons($|\/)/, +- /^react-navigation($|\/)/, ++ /^@?react-navigation($|\/)/, + /^react-native-safe-area-context($|\/)/ + ]; diff --git a/node_modules/@mendix/pluggable-widgets-tools/test-config/jest.native.config.js b/node_modules/@mendix/pluggable-widgets-tools/test-config/jest.native.config.js index 7e604c2..62afe21 100644 --- a/node_modules/@mendix/pluggable-widgets-tools/test-config/jest.native.config.js @@ -38,13 +48,13 @@ index 7e604c2..62afe21 100644 } ], diff --git a/node_modules/@mendix/pluggable-widgets-tools/test-config/test-index-native.js b/node_modules/@mendix/pluggable-widgets-tools/test-config/test-index-native.js -index ac385ec..bb5affb 100644 +index ac385ec..63b3871 100644 --- a/node_modules/@mendix/pluggable-widgets-tools/test-config/test-index-native.js +++ b/node_modules/@mendix/pluggable-widgets-tools/test-config/test-index-native.js @@ -5,6 +5,8 @@ const enableHooks = require("jest-react-hooks-shallow").default; configureEnzyme({ adapter: new Adapter() }); enableHooks(jest); - + +global.setImmediate = global.setTimeout; + const origConsole = console.error; diff --git a/yarn.lock b/yarn.lock index e41bc4db0..021b1cc96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3073,7 +3073,7 @@ __metadata: languageName: unknown linkType: soft -"@mendix/pluggable-widgets-tools@npm:^9.24.0": +"@mendix/pluggable-widgets-tools@npm:9.24.0": version: 9.24.0 resolution: "@mendix/pluggable-widgets-tools@npm:9.24.0" dependencies: