@velocitycareerlabs/vcl-react-native 2.10.0-rc.1 → 2.10.0-rc.2

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 CHANGED
@@ -45,6 +45,21 @@ yarn add @velocitycareerlabs/vcl-react-native
45
45
  npm install @velocitycareerlabs/vcl-react-native --save
46
46
  ```
47
47
 
48
+ ### Native SDK versions
49
+ By default, the package pins native iOS and Android SDK versions through
50
+ `vclNativeSdkVersions` in its `package.json`, falling back to the React Native
51
+ package version if no native pin is present.
52
+
53
+ ```json
54
+ {
55
+ "version": "2.10.0",
56
+ "vclNativeSdkVersions": {
57
+ "ios": "2.10.0-rc",
58
+ "android": "2.10.0-rc"
59
+ }
60
+ }
61
+ ```
62
+
48
63
  ### Usage
49
64
  To start using the VCL SDK, you’ll need to create its object and initialize it in Velocity Network™:
50
65
  ```js
@@ -2,6 +2,13 @@ require "json"
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
+ def first_present_value(*values)
6
+ values.find { |value| !value.nil? && !value.to_s.strip.empty? }
7
+ end
8
+
9
+ vcl_native_sdk_versions = package["vclNativeSdkVersions"] || {}
10
+ vcl_ios_sdk_version = first_present_value(vcl_native_sdk_versions["ios"], package["version"])
11
+
5
12
  Pod::Spec.new do |s|
6
13
  s.name = "VclReactNative"
7
14
  s.version = package["version"]
@@ -18,7 +25,7 @@ Pod::Spec.new do |s|
18
25
 
19
26
  s.swift_version = "5.0"
20
27
 
21
- s.dependency "VCL", package["version"]
28
+ s.dependency "VCL", vcl_ios_sdk_version
22
29
 
23
30
  install_modules_dependencies(s)
24
31
  end
@@ -22,7 +22,14 @@ apply plugin: "kotlin-android"
22
22
  apply plugin: "com.facebook.react"
23
23
 
24
24
  def packageJson = new groovy.json.JsonSlurper().parse(file("$projectDir/../package.json"))
25
- def vclSdkVersion = packageJson.version
25
+ def vclNativeSdkVersions = packageJson.vclNativeSdkVersions instanceof Map ? packageJson.vclNativeSdkVersions : [:]
26
+ def firstPresentValue = { values ->
27
+ return values.find { value -> value != null && value.toString().trim() }
28
+ }
29
+ def vclSdkVersion = firstPresentValue([
30
+ vclNativeSdkVersions.android,
31
+ packageJson.version,
32
+ ])
26
33
 
27
34
  def getExtOrIntegerDefault(name) {
28
35
  return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["VclReactNative_" + name]).toInteger()
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "@velocitycareerlabs/vcl-react-native",
3
- "version": "2.10.0-rc.1",
3
+ "version": "2.10.0-rc.2",
4
+ "vclNativeSdkVersions": {
5
+ "ios": "2.10.0-rc",
6
+ "android": "2.10.0-rc"
7
+ },
4
8
  "description": "Velocity Career Labs React Native SDK",
5
9
  "license": "Apache-2.0",
6
10
  "publishConfig": {