Skip to content

Commit 5d58559

Browse files
Merge branch 'main' into moo/moo-2034/fix-native-widgets-pipeline
2 parents 118cb76 + ab45f8c commit 5d58559

File tree

14 files changed

+164
-103
lines changed

14 files changed

+164
-103
lines changed

.github/workflows/NativePipeline.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ on:
6666
- video-player-native
6767
- web-view-native
6868

69-
# Run at 0:00 UTC (2:00 AM CET time during summer, 1:00 AM during winter)
70-
schedule:
71-
- cron: '0 0 * * *'
7269
# Trigger on PR
7370
pull_request:
7471

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Nightly Dispatcher
2+
3+
on:
4+
schedule:
5+
# Run main branch at midnight (0:00 UTC)
6+
- cron: '0 0 * * *'
7+
# Run version/mx/10 branch at 4:00 AM UTC
8+
- cron: '0 4 * * *'
9+
10+
jobs:
11+
dispatch-main:
12+
if: github.event.schedule == '0 0 * * *'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: "Trigger Native Pipeline on main"
16+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7
17+
with:
18+
script: |
19+
await github.rest.actions.createWorkflowDispatch({
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
workflow_id: 'NativePipeline.yml',
23+
ref: 'main',
24+
inputs: {
25+
run_name: 'Nightly Main Branch Pipeline',
26+
workspace: '*-native'
27+
}
28+
});
29+
30+
dispatch-version-mx-10:
31+
if: github.event.schedule == '0 4 * * *'
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: "Trigger Native Pipeline on version/mx/10"
35+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7
36+
with:
37+
script: |
38+
await github.rest.actions.createWorkflowDispatch({
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
workflow_id: 'NativePipeline.yml',
42+
ref: 'version/mx/10',
43+
inputs: {
44+
run_name: 'Nightly version/mx/10 Branch Pipeline',
45+
workspace: '*-native'
46+
}
47+
});

configs/e2e/native_dependencies.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
"react-native-camera": "3.40.0",
1414
"react-native-view-shot": "4.0.3",
1515
"react-native-blob-util": "0.21.2",
16-
"react-native-file-viewer": "2.1.5",
16+
"react-native-file-viewer-turbo": "0.6.0",
1717
"react-native-localize": "3.2.1",
1818
"react-native-image-picker": "7.2.3",
19-
"react-native-permissions": "4.1.5",
20-
"react-native-webview": "13.13.2"
19+
"react-native-permissions": "5.4.2",
20+
"react-native-webview": "13.13.2",
21+
"@sbaiahmed1/react-native-biometrics": "0.4.0"
2122
}

configs/jsactions/rollup-plugin-collect-dependencies.mjs

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import fg from "fast-glob";
44
import fsExtra from "fs-extra";
5-
import { existsSync, readFileSync, writeFileSync } from "fs";
5+
import { existsSync, readFileSync, writeFileSync, cpSync, lstatSync, realpathSync } from "fs";
66
import { dirname, join, parse } from "path";
7-
import copy from "recursive-copy";
87
import { promisify } from "util";
98
import resolve from "resolve";
109
import _ from "lodash";
@@ -172,15 +171,36 @@ export async function copyJsModule(moduleSourcePath, to) {
172171
if (existsSync(to)) {
173172
return;
174173
}
175-
return promisify(copy)(moduleSourcePath, to, {
176-
filter: [
177-
"**/*.*",
178-
LICENSE_GLOB,
179-
"!**/{android,ios,windows,mac,jest,github,gradle,__*__,docs,jest,example*}/**/*",
180-
"!**/*.{config,setup}.*",
181-
"!**/*.{podspec,flow}"
182-
],
183-
overwrite: true
174+
175+
// Check if the source is a symlink and resolve it to the actual path
176+
let actualSourcePath = moduleSourcePath;
177+
if (lstatSync(moduleSourcePath).isSymbolicLink()) {
178+
actualSourcePath = realpathSync(moduleSourcePath);
179+
}
180+
181+
cpSync(actualSourcePath, to, {
182+
recursive: true,
183+
dereference: true, // Follow symlinks and copy the actual files
184+
filter: (src, dest) => {
185+
const relativePath = src.replace(actualSourcePath, "").replace(/^[\\/]/, "");
186+
187+
// Skip certain directories
188+
if (relativePath.match(/[\\/](android|ios|windows|mac|jest|github|gradle|__.*__|docs|example.*)[\\/]/)) {
189+
return false;
190+
}
191+
192+
// Skip certain file types
193+
if (relativePath.match(/\.(config|setup)\.|\.podspec$|\.flow$/)) {
194+
return false;
195+
}
196+
197+
// Include LICENSE files
198+
if (relativePath.match(/license/i)) {
199+
return true;
200+
}
201+
202+
return true;
203+
}
184204
});
185205
}
186206

configs/jsactions/rollup.config.mjs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,6 @@ export default async args => {
9393
}
9494
);
9595

96-
// We dynamically import react-native-schedule-exact-alarm-permission as it works only on Android
97-
// so we need to copy it here as collectDependencies won't detect it.
98-
await copyJsModule(
99-
// require returns a path to commonjs index.js file
100-
join(
101-
dirname(require.resolve("react-native-schedule-exact-alarm-permission")),
102-
"../",
103-
"../"
104-
),
105-
join(outDir, "node_modules", "react-native-schedule-exact-alarm-permission")
106-
);
10796
} else if (args.configProject === "nanoflowcommons") {
10897
// `invariant` is being used silently by @react-native-community/geolocation; it is not listed as a dependency nor peerDependency.
10998
// https://github.dev/react-native-geolocation/react-native-geolocation/blob/1786929f2be581da91082ff857c2393da5e597b3/js/implementation.native.js#L13

packages/jsActions/mobile-resources-native/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
10+
- We updated react-native-permissions to 5.4.2.
11+
12+
- We removed react-native-schedule-exact-alarm-permission since it's no longer required.
13+
914
- Updated react-native from version 0.75.4 to 0.77.3.
15+
- We migrated from react-native-file-viewer to react-native-file-viewer-turbo for new architecture compatibility
16+
- File viewer now uses modal to display content
17+
- We migrated from react-native-biometrics to @sbaiahmed1/react-native-biometrics for new architecture compatibility
18+
1019

1120
## [10.0.0] Native Mobile Resources - 2025-3-31
1221

packages/jsActions/mobile-resources-native/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,16 @@
2929
"@notifee/react-native": "9.1.8",
3030
"@react-native-camera-roll/camera-roll": "7.4.0",
3131
"@react-native-firebase/messaging": "17.3.0",
32+
"@sbaiahmed1/react-native-biometrics": "0.4.0",
3233
"@swan-io/react-native-browser": "0.4.1",
3334
"fbjs": "3.0.4",
3435
"mime": "3.0.0",
35-
"react-native-biometrics": "3.0.1",
3636
"react-native-blob-util": "0.21.2",
3737
"react-native-device-info": "14.0.4",
38-
"react-native-file-viewer": "2.1.5",
38+
"react-native-file-viewer-turbo": "0.6.0",
3939
"react-native-image-picker": "7.2.3",
4040
"react-native-localize": "3.2.1",
41-
"react-native-permissions": "4.1.5",
42-
"react-native-schedule-exact-alarm-permission": "^0.1.3",
41+
"react-native-permissions": "5.4.2",
4342
"react-native-sound": "0.11.0",
4443
"url-parse": "^1.4.7"
4544
},

packages/jsActions/mobile-resources-native/src/authentication/BiometricAuthentication.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// - the code between BEGIN USER CODE and END USER CODE
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
8-
import ReactNativeBiometrics from "react-native-biometrics";
8+
import { simplePrompt } from "@sbaiahmed1/react-native-biometrics";
99

1010
// BEGIN EXTRA CODE
1111
// END EXTRA CODE
@@ -16,13 +16,10 @@ import ReactNativeBiometrics from "react-native-biometrics";
1616
*/
1717
export async function BiometricAuthentication(reason?: string): Promise<boolean> {
1818
// BEGIN USER CODE
19-
// Documentation https://github.com/smallcase/react-native-simple-biometrics
19+
// Documentation https://github.com/sbaiahmed1/react-native-biometrics
2020

21-
const rnBiometrics = new ReactNativeBiometrics();
22-
23-
return rnBiometrics
24-
.simplePrompt({ promptMessage: reason ?? "" })
25-
.then(() => true)
21+
return simplePrompt(reason ?? "")
22+
.then(result => result.success)
2623
.catch(() => false);
2724

2825
// END USER CODE

packages/jsActions/mobile-resources-native/src/authentication/IsBiometricAuthenticationSupported.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// - the code between BEGIN USER CODE and END USER CODE
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
8-
import ReactNativeBiometrics from "react-native-biometrics";
8+
import { isSensorAvailable } from "@sbaiahmed1/react-native-biometrics";
99

1010
// BEGIN EXTRA CODE
1111
// END EXTRA CODE
@@ -15,12 +15,9 @@ import ReactNativeBiometrics from "react-native-biometrics";
1515
*/
1616
export async function IsBiometricAuthenticationSupported(): Promise<boolean> {
1717
// BEGIN USER CODE
18-
// Documentation https://github.com/smallcase/react-native-simple-biometrics
18+
// Documentation https://github.com/sbaiahmed1/react-native-biometrics
1919

20-
const rnBiometrics = new ReactNativeBiometrics();
21-
22-
return rnBiometrics
23-
.isSensorAvailable()
20+
return isSensorAvailable()
2421
.then(result => result.available)
2522
.catch(() => false);
2623

packages/jsActions/mobile-resources-native/src/file-download/DownloadFile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// Other code you write will be lost the next time you deploy the project.
88
import { Platform } from "react-native";
99
import RNBlobUtil from "react-native-blob-util";
10-
import FileViewer from "react-native-file-viewer";
10+
import { open } from "react-native-file-viewer-turbo";
1111
import mimeTypes from "mime";
1212

1313
// BEGIN EXTRA CODE
@@ -91,7 +91,7 @@ export async function DownloadFile(file: mendix.lib.MxObject, openWithOS: boolea
9191
}
9292
}
9393
if (openWithOS) {
94-
await FileViewer.open(accessiblePath, {
94+
await open(accessiblePath, {
9595
showOpenWithDialog: true,
9696
showAppsSuggestions: true
9797
});

0 commit comments

Comments
 (0)