@pinwheel/react-native-pinwheel 2.3.9 → 2.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -19
- package/lib/constants.d.ts +6 -0
- package/lib/constants.js +6 -0
- package/lib/index.js +2 -4
- package/package.json +8 -3
- package/CHANGELOG.md +0 -33
package/README.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
# react-native-pinwheel
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Pinwheel SDK for React Native
|
|
4
|
+
|
|
5
|
+
## Running The Example App Locally
|
|
6
|
+
|
|
7
|
+
You may want to run the example app locally to get started.
|
|
8
|
+
|
|
9
|
+
#### Dependencies
|
|
10
|
+
|
|
11
|
+
- Node 16.7.0 (check with `node -v` and upgrade versions using `nvm`)
|
|
12
|
+
- iPhone 14 simulator (open your Simulator app and check the available versions)
|
|
13
|
+
- iOS 16 running on the simulator (open your Simulator app and check the available versions)
|
|
14
|
+
- `pod` version 1.11.3 (check with `pod --version`)
|
|
15
|
+
|
|
16
|
+
#### Directions
|
|
17
|
+
|
|
18
|
+
- `npm run dev`
|
|
19
|
+
|
|
4
20
|
|
|
5
21
|
## Installation
|
|
6
22
|
|
|
@@ -93,21 +109,3 @@ Callback for all significant events that happen during the modal flow. See all p
|
|
|
93
109
|
| Type | Required |
|
|
94
110
|
| -------- | -------- |
|
|
95
111
|
| function | No |
|
|
96
|
-
|
|
97
|
-
# Releasing
|
|
98
|
-
|
|
99
|
-
- Bump the version number in `package.json`: `"version": "2.1.0",`
|
|
100
|
-
- Bump the version number in `src/index.tsx`: `const version = '2.1.0';`
|
|
101
|
-
- `npm run build`
|
|
102
|
-
- `npm pack`
|
|
103
|
-
- Update the version of the tgz file in `example/package.json`: `"@pinwheel/react-native-pinwheel": "../pinwheel-react-native-pinwheel-2.1.0.tgz"`
|
|
104
|
-
- Update version number in `example/package.json`: `"version": "2.1.0"`
|
|
105
|
-
- `npm install example`
|
|
106
|
-
- `npx react-native start --reset-cache`
|
|
107
|
-
- `cd ios` `pod install`
|
|
108
|
-
- Add production sandbox key for testing purposes only to `example/App.js`: `const API_SECRET = "";`
|
|
109
|
-
- `npm run ios`
|
|
110
|
-
- Remove production sandbox key when finished with testing
|
|
111
|
-
- `git tag -a 2.1.0 -m "Message about new version"`
|
|
112
|
-
- `git push origin 2.1.0`
|
|
113
|
-
- `npm publish` (you will need to have set up your NPM credentials for this to work)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importing package.json here causes a problem with the folder structure when we npm pack and publish.
|
|
3
|
+
*/
|
|
4
|
+
export declare const VERSION = "2.3.12";
|
|
5
|
+
export declare const LINK_PAGE_URL = "https://cdn.getpinwheel.com/link-v2.3.0.html";
|
|
6
|
+
export declare const PINWHEEL_DOMAIN = "getpinwheel.com";
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importing package.json here causes a problem with the folder structure when we npm pack and publish.
|
|
3
|
+
*/
|
|
4
|
+
export const VERSION = '2.3.12';
|
|
5
|
+
export const LINK_PAGE_URL = 'https://cdn.getpinwheel.com/link-v2.3.0.html';
|
|
6
|
+
export const PINWHEEL_DOMAIN = 'getpinwheel.com';
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WebView } from 'react-native-webview';
|
|
3
3
|
import { Linking, Platform, SafeAreaView, StyleSheet } from 'react-native';
|
|
4
|
-
|
|
4
|
+
import { LINK_PAGE_URL, PINWHEEL_DOMAIN, VERSION } from './constants';
|
|
5
5
|
const styles = StyleSheet.create({
|
|
6
6
|
container: {
|
|
7
7
|
flex: 1,
|
|
@@ -14,8 +14,6 @@ export const PINWHEEL_MESSAGE_TYPES = {
|
|
|
14
14
|
PINWHEEL_SUCCESS: 'PINWHEEL_SUCCESS',
|
|
15
15
|
PINWHEEL_EVENT: 'PINWHEEL_EVENT',
|
|
16
16
|
};
|
|
17
|
-
const LINK_PAGE_URL = 'https://cdn.getpinwheel.com/link-v2.3.0.html';
|
|
18
|
-
const PINWHEEL_DOMAIN = 'getpinwheel.com';
|
|
19
17
|
export default ({ linkToken, onLogin, onLoginAttempt, onSuccess, onError, onExit, onEvent }) => {
|
|
20
18
|
const handleEvent = (event) => {
|
|
21
19
|
if (!event) {
|
|
@@ -58,7 +56,7 @@ export default ({ linkToken, onLogin, onLoginAttempt, onSuccess, onError, onExit
|
|
|
58
56
|
}
|
|
59
57
|
};
|
|
60
58
|
const now = Date.now();
|
|
61
|
-
const [major, minor, patch] =
|
|
59
|
+
const [major, minor, patch] = VERSION.split('.').map(x => Number(x));
|
|
62
60
|
const runFirst = `
|
|
63
61
|
const uuidKey = 'pinwheel-uuid';
|
|
64
62
|
const localStorage = window.localStorage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinwheel/react-native-pinwheel",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pinwheel React Native SDK",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc",
|
|
13
|
-
"
|
|
13
|
+
"bump-pkg-version": "./scripts/bump-pkg-version.sh",
|
|
14
|
+
"dev": "./scripts/dev.sh"
|
|
14
15
|
},
|
|
15
16
|
"author": "Pinwheel",
|
|
16
17
|
"license": "MIT",
|
|
@@ -21,7 +22,11 @@
|
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@types/react-native": "^0.63.29",
|
|
24
|
-
"react-native-webview": "^
|
|
25
|
+
"react-native-webview": "^11.0.0",
|
|
25
26
|
"typescript": "^4.0.3"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"hermes-engine": "^0.11.0",
|
|
30
|
+
"shell-quote": "^1.7.4"
|
|
26
31
|
}
|
|
27
32
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## 2.3.x Releases
|
|
6
|
-
|
|
7
|
-
- `2.3.x` Releases - [2.3.4](#234) [2.3.5](#235) [2.3.6](#236)
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
### [2.3.6](https://github.com/underdog-tech/react-native-pinwheel/releases/tag/2.3.6)
|
|
12
|
-
|
|
13
|
-
N/A
|
|
14
|
-
|
|
15
|
-
### [2.3.5](https://github.com/underdog-tech/react-native-pinwheel/releases/tag/2.3.5)
|
|
16
|
-
|
|
17
|
-
N/A
|
|
18
|
-
|
|
19
|
-
### [2.3.4](https://github.com/underdog-tech/react-native-pinwheel/releases/tag/2.3.4)
|
|
20
|
-
|
|
21
|
-
#### Added
|
|
22
|
-
|
|
23
|
-
- Export `EventPayload` type.
|
|
24
|
-
- Export `PinwheelError` type.
|
|
25
|
-
- Export `PinwheelErrorType` type.
|
|
26
|
-
- Export `EmptyPayloadObject` type as `Record<string, never>`.
|
|
27
|
-
|
|
28
|
-
##### Updated
|
|
29
|
-
|
|
30
|
-
- `EventPayload` is no longer a union containing `{}`. It now contains `Record<string, never>` instead due to [this behavior](https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-all-types-assignable-to-empty-interfaces).
|
|
31
|
-
- Mark exported `Error` type as **@deprecated** because it collides with the built-in javascript `Error` object. Replaced with `PinwheelError`.
|
|
32
|
-
- Mark exported `ErrorType` type as **@deprecated** because the new naming convention is prefixing with "`PinwheelError`". Replaced with `PinwheelErrorType`.
|
|
33
|
-
- Update `onExit` type to be `(error: PinwheelError | Record<string, never>)` to be accurate with current functionality.
|