Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vl 6359 dev to rc #122

Merged
merged 11 commits into from
Dec 25, 2023
33 changes: 33 additions & 0 deletions .github/workflows/react-native-sdk.tests.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: ReactNative-SDK

on:
pull_request:
branches:
- main
- rc
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
cancel-in-progress: true
env:
NODE_VERSION: '20'
RC_SUFFIX: 'rc'
jobs:
test-react-sdk:
runs-on: ubuntu-latest
steps:
# Git clone repository
- name: Git clone repository
uses: actions/checkout@v4
# Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
# Install dependencies
- name: Install dependencies
run: yarn
# Run test
- name: Run Test
run: yarn test
continue-on-error: true
66 changes: 66 additions & 0 deletions .github/workflows/react-native-sdk.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: ReactNative-SDK

on:
push:
branches:
- main
- rc
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
cancel-in-progress: true
env:
NODE_VERSION: '20'
RC_SUFFIX: 'rc'
jobs:
test-react-sdk:
runs-on: macos-13
steps:
# Git clone repository
- name: Git clone repository
uses: actions/checkout@v4
# Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
# Install dependencies
- name: Install dependencies
run: yarn
# Run test
- name: Run Test
run: yarn test
continue-on-error: true

build-react-native-sdk:
runs-on: macos-13
needs:
- test-react-sdk
steps:
- name: Git clone repository
uses: actions/checkout@v4
# Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
# Publish to npm
- name: Set NPM Packages Config
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
# Git Set Identity
- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Commit Version Locally for Github npm
- name: Commit Version Locally for Github npm
run: git add .npmrc && git commit -am "Prepare to release"
# Install dependencies
- name: Install dependencies
run: yarn
# Build and Publish SDK
- name: Build and Publish SDK
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' }}
run: npm publish --tag ${{ env.RELEASE_TAG }} --access public --userconfig ./.npmrc
env:
RELEASE_TAG: ${{ github.ref == 'refs/heads/main' && format('{0}', 'latest' ) || env.RC_SUFFIX }}
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ dependencies {

// VCL:
implementation "com.nimbusds:nimbus-jose-jwt:9.35"
implementation "io.velocitycareerlabs:vcl:1.21.5"
implementation "io.velocitycareerlabs:vcl:1.22.0"
}

if (isNewArchitectureEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ object Converter {
fun tokenToMap(token: VCLToken): ReadableMap {
val retVal = Arguments.createMap()
retVal.putString("value", token.value)
token.expiresIn?.toDouble()?.let {
retVal.putDouble("expiresIn", it)
}
return retVal
}

Expand Down
10 changes: 5 additions & 5 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,11 @@ PODS:
- React-logger (= 0.72.4)
- React-perflogger (= 0.72.4)
- SocketRocket (0.6.1)
- VCL (1.21.5)
- velocitycareerlabs-vcl-react-native (1.21.5):
- VCL (1.22.0)
- velocitycareerlabs-vcl-react-native (1.22.0):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- VCL (= 1.21.5)
- VCL (= 1.22.0)
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)
Expand Down Expand Up @@ -715,8 +715,8 @@ SPEC CHECKSUMS:
React-utils: b79f2411931f9d3ea5781404dcbb2fa8a837e13a
ReactCommon: 4b2bdcb50a3543e1c2b2849ad44533686610826d
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
VCL: 36b3f22c226a1aad9dadf05a859fc9bcadaf493e
velocitycareerlabs-vcl-react-native: 19857c11e181e38554928bc0b1b2296bf88c8ed1
VCL: 3a538f833b0e24840717875cffcc4b6685b81fbe
velocitycareerlabs-vcl-react-native: 32c8a17f748fa221cfb7e1572ba8fe24611e7bff
Yoga: 3efc43e0d48686ce2e8c60f99d4e6bd349aff981
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

Expand Down
7 changes: 6 additions & 1 deletion ios/Utils/Converter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ func dictionaryToToken(_ tokenDictionary: [String: Any]?) -> VCLToken {
}

func tokenToDictionary(_ token: VCLToken) -> [String: Any] {
return ["value": token.value]
var retVal = [String: Any]()
retVal["value"] = token.value
if let expiresIn = token.expiresIn {
retVal["expiresIn"] = expiresIn
}
return retVal
}

func dictionaryToIssuingType(
Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@velocitycareerlabs/vcl-react-native",
"version": "1.21.5",
"version": "1.22.0",
"description": "Velocity Career Labs React Native SDK",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -54,14 +54,16 @@
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@commitlint/config-conventional": "^18.4.3",
"@evilmartians/lefthook": "^1.5.5",
"@react-native-community/eslint-config": "^3.2.0",
"@release-it/conventional-changelog": "^8.0.1",
"@types/jest": "^29.5.11",
"@types/react": "~18.2.45",
"@types/react-native": "~0.72.8",
"@types/react-native": "~0.72.8",
"commitlint": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"del-cli": "^5.1.0",
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -70,13 +72,11 @@
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prefer-arrow-functions": "^3.2.4",
"eslint-plugin-prettier": "^5.1.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^3.0.0",
"husky": "^8.0.3",
"del-cli": "^5.1.0",
"eslint": "^8.56.0",
"eslint-plugin-prettier": "^5.1.0",
"jest": "^29.7.0",
"pod-install": "^0.1.39",
"prettier": "^3.1.1",
Expand All @@ -97,7 +97,7 @@
"engines": {
"node": ">= 16.0.0"
},
"packageManager": "^[email protected].15",
"packageManager": "[email protected].21",
"jest": {
"preset": "react-native",
"modulePathIgnorePatterns": [
Expand Down Expand Up @@ -170,5 +170,8 @@
}
]
]
},
"dependencies": {
"yarn": "1.22.21"
}
}
1 change: 1 addition & 0 deletions src/api/entities/VCLToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@

export interface VCLToken {
value: string;
expirationDate: BigInt
}
2 changes: 1 addition & 1 deletion velocitycareerlabs-vcl-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Pod::Spec.new do |s|
# https://github.com/CocoaPods/CocoaPods/issues/7234#issuecomment-346136322
# s.static_framework = true

s.dependency "VCL", "1.21.5"
s.dependency "VCL", "1.22.0"

# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9684,6 +9684,11 @@ yargs@^17.0.0, yargs@^17.3.1, yargs@^17.5.1, yargs@^17.6.2:
y18n "^5.0.5"
yargs-parser "^21.1.1"

[email protected]:
version "1.22.21"
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.21.tgz#1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
integrity sha512-ynXaJsADJ9JiZ84zU25XkPGOvVMmZ5b7tmTSpKURYwgELdjucAOydqIOrOfTxVYcNXe91xvLZwcRh68SR3liCg==

yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
Expand Down
Loading