Skip to content

Commit

Permalink
feat: πŸ€– update react-native-jose and react-native (#54)
Browse files Browse the repository at this point in the history
* chore: πŸ€– upgraded RN

in order to use the upcoming new features in react-native-jose

* refactor: πŸ’‘ use update version of react-native-jose sign func

* chore: πŸ€– disable native tests since we don't run them

and it breaks the app build having them enabled

* fix: travis deliver stage should run on push to master

* docs: update debugging docs with cache clear instructions

* chore: update package.json

use [email protected]

* test: πŸ’ mock for react-native-jose 0.5.0

Co-authored-by: Andreas Lundqvist <[email protected]>
  • Loading branch information
raduachim and momentiris authored Jan 15, 2020
1 parent 9e24baa commit d1ae17f
Show file tree
Hide file tree
Showing 11 changed files with 1,120 additions and 836 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:

stages:
- name: deliver
if: branch = master AND type = pull_request
if: branch = master AND type != pull_request
- name: fastlane_ios
if: branch = master AND type != pull_request
- name: fastlane_android
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ If the app doesn't open automatically go into apps and find Egendata

React debug menu available on ios with ⌘d and on android with ⌘m / ctrl+m

### Debugging
If the app complains about not getting the right methods exported from `react-native-jose`, try clearing all your react-native cache:

```bash
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache

watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean --force && npm install && npm start -- --reset-cache
```

## Releasing Betas

**At the time of writing, both iOS and Android builds are integrated in the continuous deployment pipeline. Paired with a semantic release plugin, [Fastlane](https://github.com/fastlane/fastlane) builds and deploys both Android and iOS (not differentiated atm) from changes to the master branch that are relevant to the [semantic release commit message format](https://github.com/semantic-release/semantic-release#commit-message-format).**
Expand Down
11 changes: 4 additions & 7 deletions __e2e__/src/native/react-native-jose.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import * as jwt from 'jwt-lite'

const Jose = {
sign: (payload, keys, header) => jwt.sign(payload, keys.jwk, header),
verify: (token, jwk) => jwt.verify(token, jwk),
decode: (token, options) => jwt.decode(token, options),
}

export default Jose
export const sign = (payload, keys, header) =>
jwt.sign(payload, keys.jwk, header)
export const verify = (token, jwk) => jwt.verify(token, jwk)
export const decode = (token, options) => jwt.decode(token, options)
22 changes: 4 additions & 18 deletions ios/Egendata.xcodeproj/xcshareddata/xcschemes/Egendata.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForTesting = "NO"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
Expand All @@ -55,18 +55,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "EgendataTests.xctest"
BlueprintName = "EgendataTests"
ReferencedContainer = "container:Egendata.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -76,8 +64,8 @@
ReferencedContainer = "container:Egendata.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -99,8 +87,6 @@
ReferencedContainer = "container:Egendata.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
16 changes: 12 additions & 4 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ require_relative '../node_modules/@react-native-community/cli-platform-ios/nativ

target 'Egendata' do
# Pods for Egendata
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
Expand All @@ -15,18 +20,21 @@ target 'Egendata' do
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
# Add new pods below this line

pod 'react-native-config', :path => '../node_modules/react-native-config'
pod 'RNSVG', :path => '../node_modules/react-native-svg'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
pod 'react-native-jose', :path => '../node_modules/@egendata/react-native-jose'

Expand Down
Loading

0 comments on commit d1ae17f

Please sign in to comment.