Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
prepare 5.0.0 release (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaunchDarklyReleaseBot authored Aug 20, 2021
1 parent c2ecace commit 9b38765
Show file tree
Hide file tree
Showing 17 changed files with 961 additions and 887 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

19 changes: 16 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,30 @@ jobs:

common:
docker:
- image: circleci/node:11.10.1
- image: cimg/node:current
steps:
- checkout

- run: npm install
- run: mkdir -p reports/jest
- run:
command: npm run test:junit
environment:
JEST_JUNIT_OUTPUT_DIR: "./reports/jest"

- run: npm run check-typescript

- store_test_results:
path: reports

workflows:
version: 2
android-ios:
jobs:
- android
- ios
- common
- android:
requires:
- common
- ios:
requires:
- common
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ All notable changes to the LaunchDarkly React Native SDK will be documented in t
### Fixed:
- Correct usages of undeclared variables when registering or un-registering connection mode or all flags listeners. ([#82](https://github.com/launchdarkly/react-native-client-sdk/issues/82))


## [4.0.4] - 2021-06-02
### Fixed:
- iOS: Fixed an issue where an exception was thrown when calling `LDClient.configure` with an optional `timeout` ([#80](https://github.com/launchdarkly/react-native-client-sdk/issues/80)).
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
LaunchDarkly Client-Side SDK for React Native
===========================

[![CircleCI](https://circleci.com/gh/launchdarkly/react-native-client-sdk.svg?style=svg)](https://circleci.com/gh/launchdarkly/react-native-client-sdk)
[![NPM](https://img.shields.io/npm/v/launchdarkly-react-native-client-sdk.svg)](https://www.npmjs.com/package/launchdarkly-react-native-client-sdk)
[![CircleCI](https://circleci.com/gh/launchdarkly/react-native-client-sdk.svg?style=shield)](https://circleci.com/gh/launchdarkly/react-native-client-sdk)
[![Documentation](https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8)](https://launchdarkly.github.io/react-native-client-sdk)

LaunchDarkly overview
-------------------------
Expand All @@ -23,12 +25,12 @@ This SDK is currently compatible with React Native 0.64.x and Xcode 12 and is te
Getting started
---------------

Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/client-side/react-native#getting-started) for instructions on getting started with using the SDK.
Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/client-side/react/react-native#getting-started) for instructions on getting started with using the SDK.

Learn more
-----------

Check out our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/client-side/react-native).
Check out our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/client-side/react/react-native).

Testing
-------
Expand Down
84 changes: 84 additions & 0 deletions __mocks__/native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
const mockNativeModule = {
FLAG_PREFIX: "test-flag-prefix",
ALL_FLAGS_PREFIX: "test-all-flags-prefix",
CONNECTION_MODE_PREFIX: "test-connection-mode-prefix",

configure: jest.fn(),
configureWithTimeout: jest.fn(),

boolVariation: jest.fn(),
boolVariationDefaultValue: jest.fn(),
numberVariation: jest.fn(),
numberVariationDefaultValue: jest.fn(),
stringVariation: jest.fn(),
stringVariationDefaultValue: jest.fn(),
jsonVariationNone: jest.fn(),
jsonVariationNumber: jest.fn(),
jsonVariationBool: jest.fn(),
jsonVariationString: jest.fn(),
jsonVariationArray: jest.fn(),
jsonVariationObject: jest.fn(),

boolVariationDetail: jest.fn(),
boolVariationDetailDefaultValue: jest.fn(),
numberVariationDetail: jest.fn(),
numberVariationDetailDefaultValue: jest.fn(),
stringVariationDetail: jest.fn(),
stringVariationDetailDefaultValue: jest.fn(),
jsonVariationDetailNone: jest.fn(),
jsonVariationDetailNumber: jest.fn(),
jsonVariationDetailBool: jest.fn(),
jsonVariationDetailString: jest.fn(),
jsonVariationDetailArray: jest.fn(),
jsonVariationDetailObject: jest.fn(),

allFlags: jest.fn(),

trackNumber: jest.fn(),
trackBool: jest.fn(),
trackString: jest.fn(),
trackArray: jest.fn(),
trackObject: jest.fn(),
track: jest.fn(),

trackNumberMetricValue: jest.fn(),
trackBoolMetricValue: jest.fn(),
trackStringMetricValue: jest.fn(),
trackArrayMetricValue: jest.fn(),
trackObjectMetricValue: jest.fn(),
trackMetricValue: jest.fn(),

setOffline: jest.fn(),
isOffline: jest.fn(),
setOnline: jest.fn(),
isInitialized: jest.fn(),
flush: jest.fn(),
close: jest.fn(),
identify: jest.fn(),
alias: jest.fn(),
getConnectionMode: jest.fn(),
getLastSuccessfulConnection: jest.fn(),
getLastFailedConnection: jest.fn(),
getLastFailure: jest.fn(),

registerFeatureFlagListener: jest.fn(),
unregisterFeatureFlagListener: jest.fn(),
registerCurrentConnectionModeListener: jest.fn(),
unregisterCurrentConnectionModeListener: jest.fn(),
registerAllFlagsListener: jest.fn(),
unregisterAllFlagsListener: jest.fn()
};

jest.mock('react-native',
() => {
return {
NativeModules: {
LaunchdarklyReactNativeClient: mockNativeModule
},
NativeEventEmitter: jest.fn().mockImplementation(() => {
return { addListener: jest.fn() };
})
}
},
{ virtual: true }
);
19 changes: 11 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

buildscript {
ext {
buildToolsVersion = "28.0.2"
minSdkVersion = 16
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
Expand All @@ -13,7 +12,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:4.1.3'
}
}

Expand All @@ -24,14 +23,18 @@ android {
buildToolsVersion "28.0.3"

defaultConfig {
minSdkVersion 16
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

allprojects {
Expand All @@ -48,9 +51,9 @@ allprojects {
}

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'com.launchdarkly:launchdarkly-android-client-sdk:2.14.1'
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation "com.google.code.gson:gson:2.8.5"
implementation("com.facebook.react:react-native:+")
implementation("com.launchdarkly:launchdarkly-android-client-sdk:3.1.0")
implementation("com.jakewharton.timber:timber:4.7.1")
implementation("com.google.code.gson:gson:2.8.6")
}

1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
android.useAndroidX=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
Loading

0 comments on commit 9b38765

Please sign in to comment.