Skip to content

Commit 41fe1ad

Browse files
committed
refactor: mark async storage and sovran as peer dependencies
Context: segmentio/sovran-react-native#44 In the README, the installation instructions point to install `@segment/sovran-react-native` & `@react-native-async-storage/async-storage`. In that case it doesn't make sense to include those as direct dependencies.
1 parent c0a5895 commit 41fe1ad

File tree

4 files changed

+24
-41
lines changed

4 files changed

+24
-41
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,19 @@ The hassle-free way to add Segment analytics to your React-Native app.
5050

5151
## Installation
5252

53-
Install `@segment/analytics-react-native`, [`@segment/sovran-react-native`](https://github.com/segmentio/sovran-react-native) and [`react-native-async-storage/async-storage`](https://github.com/react-native-async-storage/async-storage):
53+
Install `@segment/analytics-react-native`, [`@segment/sovran-react-native`](https://github.com/segmentio/sovran-react-native):
5454

5555
```sh
56-
yarn add @segment/analytics-react-native @segment/sovran-react-native @react-native-async-storage/async-storage
56+
yarn add @segment/analytics-react-native @segment/sovran-react-native
5757
# or
58-
npm install --save @segment/analytics-react-native @segment/sovran-react-native @react-native-async-storage/async-storage
58+
npm install --save @segment/analytics-react-native @segment/sovran-react-native
59+
```
60+
61+
If using default persistor for the Segment Analytics client, install [`react-native-async-storage/async-storage`](https://github.com/react-native-async-storage/async-storage) (for more context, check <a href="#client-options">Client Options's `storePersistor`</a>):
62+
```sh
63+
yarn add @react-native-async-storage/async-storage
64+
# or
65+
npm install --save @react-native-async-storage/async-storage
5966
```
6067

6168
For iOS, install native modules with:

packages/core/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,22 @@
4646
},
4747
"homepage": "https://github.com/segmentio/analytics-react-native#readme",
4848
"dependencies": {
49-
"@react-native-async-storage/async-storage": "^1.15.17",
50-
"@segment/sovran-react-native": "^0.4.5",
5149
"deepmerge": "^4.2.2",
5250
"js-base64": "^3.7.2",
5351
"promise.allsettled": "^1.0.5",
5452
"react-native-uuid": "^2.0.1"
5553
},
5654
"peerDependencies": {
55+
"@react-native-async-storage/async-storage": "*",
56+
"@segment/sovran-react-native": "*",
5757
"react": "*",
5858
"react-native": "*"
5959
},
60+
"peerDependenciesMeta": {
61+
"@react-native-async-storage/async-storage": {
62+
"optional": true
63+
}
64+
},
6065
"devDependencies": {
6166
"@babel/core": "^7.12.9",
6267
"@babel/runtime": "^7.12.5",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export default from '@react-native-async-storage/async-storage/jest/async-storage-mock';
1+
export default '@react-native-async-storage/async-storage/jest/async-storage-mock';

yarn.lock

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,13 +2256,6 @@
22562256
dependencies:
22572257
"@octokit/openapi-types" "^12.10.0"
22582258

2259-
"@react-native-async-storage/async-storage@^1.15.15", "@react-native-async-storage/async-storage@^1.15.17":
2260-
version "1.17.7"
2261-
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.17.7.tgz#f9213e8cc6202a8c29df5a4da1db588f3b0fa8a9"
2262-
integrity sha512-mDtWhCcpxzrZhA95f6zi0pnBsjBEZW1LKZWfxVXG0UfaWpPxDBCKowNk2xjRTytckZeVhjmPJPtBU+8QNQcR0A==
2263-
dependencies:
2264-
merge-options "^3.0.4"
2265-
22662259
"@react-native-community/cli-debugger-ui@^6.0.0-rc.0":
22672260
version "6.0.0"
22682261
resolved "https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-6.0.0.tgz#ef9eb1268d85c1bd3caf2c4d36dc350bb080f254"
@@ -2453,16 +2446,6 @@
24532446
resolved "https://registry.yarnpkg.com/@react-native/polyfills/-/polyfills-2.0.0.tgz#4c40b74655c83982c8cf47530ee7dc13d957b6aa"
24542447
integrity sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ==
24552448

2456-
"@segment/sovran-react-native@^0.4.5":
2457-
version "0.4.5"
2458-
resolved "https://registry.yarnpkg.com/@segment/sovran-react-native/-/sovran-react-native-0.4.5.tgz#2ae057790623cfbd84eb15e4a3bb9835d108f815"
2459-
integrity sha512-/dvud4hkszRNgTHdb7p822U+NXTuPxifqQzhcrfdjmFoXMafnzOUAi1KxeGV6Qdb73VAIxcnr/8hkTqdjZ3YLw==
2460-
dependencies:
2461-
"@react-native-async-storage/async-storage" "^1.15.15"
2462-
ansi-regex "5.0.1"
2463-
deepmerge "^4.2.2"
2464-
shell-quote "1.7.3"
2465-
24662449
"@segment/tsub@^0":
24672450
version "0.2.0"
24682451
resolved "https://registry.yarnpkg.com/@segment/tsub/-/tsub-0.2.0.tgz#456345ad04bca81f6c3fefacac722fd9eb4923ce"
@@ -3931,16 +3914,16 @@ ansi-fragments@^0.2.1:
39313914
slice-ansi "^2.0.0"
39323915
strip-ansi "^5.0.0"
39333916

3934-
[email protected], ansi-regex@^5.0.0, ansi-regex@^5.0.1:
3935-
version "5.0.1"
3936-
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
3937-
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
3938-
39393917
ansi-regex@^4.1.0:
39403918
version "4.1.1"
39413919
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed"
39423920
integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==
39433921

3922+
ansi-regex@^5.0.0, ansi-regex@^5.0.1:
3923+
version "5.0.1"
3924+
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
3925+
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
3926+
39443927
ansi-styles@^3.2.0, ansi-styles@^3.2.1:
39453928
version "3.2.1"
39463929
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
@@ -7427,11 +7410,6 @@ is-plain-obj@^1.1.0:
74277410
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
74287411
integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==
74297412

7430-
is-plain-obj@^2.1.0:
7431-
version "2.1.0"
7432-
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287"
7433-
integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==
7434-
74357413
is-plain-object@^2.0.3, is-plain-object@^2.0.4:
74367414
version "2.0.4"
74377415
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
@@ -8875,13 +8853,6 @@ meow@^8.0.0:
88758853
type-fest "^0.18.0"
88768854
yargs-parser "^20.2.3"
88778855

8878-
merge-options@^3.0.4:
8879-
version "3.0.4"
8880-
resolved "https://registry.yarnpkg.com/merge-options/-/merge-options-3.0.4.tgz#84709c2aa2a4b24c1981f66c179fe5565cc6dbb7"
8881-
integrity sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==
8882-
dependencies:
8883-
is-plain-obj "^2.1.0"
8884-
88858856
merge-stream@^2.0.0:
88868857
version "2.0.0"
88878858
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
@@ -11414,7 +11385,7 @@ shebang-regex@^3.0.0:
1141411385
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
1141511386
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
1141611387

11417-
shell-quote@1.7.3, shell-quote@^1.6.1, shell-quote@^1.7.3:
11388+
shell-quote@^1.6.1, shell-quote@^1.7.3:
1141811389
version "1.7.3"
1141911390
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.3.tgz#aa40edac170445b9a431e17bb62c0b881b9c4123"
1142011391
integrity sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==

0 commit comments

Comments
 (0)