Compare commits

...

3 Commits

Author SHA1 Message Date
Calin-Teodor
a441279b23 feat(react-native-sdk): set react-native default to 0.0.0 2024-12-16 17:43:03 +02:00
Calin-Teodor
3782136f58 dep(@react-native-clipboard/clipboard): update to 1.14.3 2024-12-16 17:10:48 +02:00
Saúl Ibarra Corretgé
ac388d5588 fix(rnsdk) specify the RN version we support
Our SDK is only really tested with a single RN version, make sure to put
that in peerDependencies.

In addition, drop the peer dependency on @react-native/metro-config
since our project doesn't use it directly.
2024-12-16 10:48:18 +01:00
5 changed files with 39 additions and 22 deletions

View File

@@ -1726,7 +1726,7 @@ PODS:
- React
- RNCAsyncStorage (1.23.1):
- React-Core
- RNCClipboard (1.14.1):
- RNCClipboard (1.14.3):
- React-Core
- RNDefaultPreference (1.4.4):
- React-Core
@@ -2197,7 +2197,7 @@ SPEC CHECKSUMS:
ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad
RNCalendarEvents: 7e65eb4a94f53c1744d1e275f7fafcfaa619f7a3
RNCAsyncStorage: 826b603ae9c0f88b5ac4e956801f755109fa4d5c
RNCClipboard: 0a720adef5ec193aa0e3de24c3977222c7e52a37
RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb
RNDefaultPreference: 08bdb06cfa9188d5da97d4642dac745218d7fb31
RNDeviceInfo: 02ea8b23e2280fa18e00a06d7e62804d74028579
RNGestureHandler: 939f21fabf5d45a725c0bf175eb819dd25cf2e70

30
package-lock.json generated
View File

@@ -26,7 +26,7 @@
"@microsoft/microsoft-graph-client": "3.0.1",
"@mui/material": "5.12.1",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-clipboard/clipboard": "1.14.1",
"@react-native-clipboard/clipboard": "1.14.3",
"@react-native-community/netinfo": "11.1.0",
"@react-native-community/slider": "4.4.3",
"@react-native-google-signin/google-signin": "10.1.0",
@@ -4782,18 +4782,26 @@
}
},
"node_modules/@react-native-clipboard/clipboard": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/@react-native-clipboard/clipboard/-/clipboard-1.14.1.tgz",
"integrity": "sha512-SM3el0A28SwoeJljVNhF217o0nI4E7RfalLmuRQcT1/7tGcxUjgFa3jyrEndYUct8/uxxK5EUNGUu1YEDqzxqw==",
"version": "1.14.3",
"resolved": "https://registry.npmjs.org/@react-native-clipboard/clipboard/-/clipboard-1.14.3.tgz",
"integrity": "sha512-EVWxJfCSyBN2SH5b3JrA/w1qlYu3vihQOfdD7fs/BYp63xL6qy93CvbFDHzF8ooFpGM6f67hkAN+gxl1RfOKuw==",
"license": "MIT",
"workspaces": [
"example"
],
"peerDependencies": {
"react": "16.9.0 || 16.11.0 || 16.13.1 || 17.0.1 || 17.0.2 || 18.0.0 || 18.1.0 || 18.2.0",
"react-native": "^0.61.5 || ^0.62.3 || ^0.63.2 || ^0.64.2 || ^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.69.0 || ^0.70.0 || ^0.71.0 || ^0.72.0 || ^0.73.0",
"react-native-macos": "^0.61.0 || ^0.62.0 || ^0.63.0 || ^0.64.0 || ^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.69.0 || ^0.70.0 || ^0.71.0 || ^0.72.0 || ^0.73.0",
"react-native-windows": "^0.61.0 || ^0.62.0 || ^0.63.0 || ^0.64.0 || ^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.69.0 || ^0.70.0 || ^0.71.0 || ^0.72.0 || ^0.73.0"
"react": ">= 16.9.0",
"react-native": ">= 0.61.5",
"react-native-macos": ">= 0.61.0",
"react-native-windows": ">= 0.61.0"
},
"peerDependenciesMeta": {
"react-native-macos": {
"optional": true
},
"react-native-windows": {
"optional": true
}
}
},
"node_modules/@react-native-community/cli": {
@@ -27781,9 +27789,9 @@
}
},
"@react-native-clipboard/clipboard": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/@react-native-clipboard/clipboard/-/clipboard-1.14.1.tgz",
"integrity": "sha512-SM3el0A28SwoeJljVNhF217o0nI4E7RfalLmuRQcT1/7tGcxUjgFa3jyrEndYUct8/uxxK5EUNGUu1YEDqzxqw=="
"version": "1.14.3",
"resolved": "https://registry.npmjs.org/@react-native-clipboard/clipboard/-/clipboard-1.14.3.tgz",
"integrity": "sha512-EVWxJfCSyBN2SH5b3JrA/w1qlYu3vihQOfdD7fs/BYp63xL6qy93CvbFDHzF8ooFpGM6f67hkAN+gxl1RfOKuw=="
},
"@react-native-community/cli": {
"version": "14.1.0",

View File

@@ -32,7 +32,7 @@
"@microsoft/microsoft-graph-client": "3.0.1",
"@mui/material": "5.12.1",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-clipboard/clipboard": "1.14.1",
"@react-native-clipboard/clipboard": "1.14.3",
"@react-native-community/netinfo": "11.1.0",
"@react-native-community/slider": "4.4.3",
"@react-native-google-signin/google-signin": "10.1.0",

View File

@@ -58,13 +58,12 @@
"peerDependencies": {
"@amplitude/react-native": "0.0.0",
"@giphy/react-native-sdk": "0.0.0",
"@react-native/metro-config": "*",
"@react-native-async-storage/async-storage": "0.0.0",
"@react-native-clipboard/clipboard": "0.0.0",
"@react-native-community/netinfo": "0.0.0",
"@react-native-community/slider": "0.0.0",
"@react-native-google-signin/google-signin": "0.0.0",
"react-native": "*",
"react-native": "0.0.0",
"react": "*",
"react-native-background-timer": "0.0.0",
"react-native-calendar-events": "0.0.0",

View File

@@ -1,9 +1,13 @@
const fs = require('fs');
const semver = require('semver');
const packageJSON = require('../package.json');
const SDKPackageJSON = require('./package.json');
// Skip checking these.
const skipDeps = [ 'react', 'react-native' ];
/**
* Merges the dependency versions from the root package.json with the dependencies of the SDK package.json.
*/
@@ -18,15 +22,21 @@ function mergeDependencyVersions() {
// Updates SDK peer dependencies.
for (const key in packageJSON.dependencies) {
if (SDKPackageJSON.peerDependencies.hasOwnProperty(key)) {
// Updates all peer dependencies except react and react-native.
if (key !== 'react' && key !== 'react-native') {
SDKPackageJSON.peerDependencies[key] = packageJSON.dependencies[key];
}
if (SDKPackageJSON.peerDependencies.hasOwnProperty(key) && !skipDeps.includes(key)) {
SDKPackageJSON.peerDependencies[key] = packageJSON.dependencies[key];
}
}
// Set RN peer dependency.
const rnVersion = semver.parse(packageJSON.dependencies['react-native']);
if (!rnVersion) {
throw new Error('failed to parse React Native version');
}
// In RN the "major" version is the Semver minor.
SDKPackageJSON.peerDependencies['react-native'] = `~0.${rnVersion.minor}.0`;
// Updates SDK overrides dependencies.
for (const key in packageJSON.overrides) {
if (SDKPackageJSON.overrides.hasOwnProperty(key)) {