Skip to content

Commit

Permalink
prepare 2.18.0 release (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaunchDarklyCI authored Feb 20, 2020
1 parent 91d0211 commit 1857143
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 24 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "launchdarkly-react-client-sdk",
"version": "2.17.1",
"version": "2.16.1",
"description": "LaunchDarkly SDK for React",
"author": "LaunchDarkly <[email protected]>",
"license": "Apache-2.0",
Expand All @@ -17,7 +17,7 @@
"scripts": {
"test": "jest",
"test:junit": "jest --ci --reporters=default --reporters=jest-junit",
"build": "rimraf lib/* && tsc && rm -rf lib/*.test.*",
"build": "rimraf lib/* && tsc && mv lib/src/* lib && rimraf lib/package.json lib/src lib/*.test.*",
"lint": "tslint -p tsconfig.json 'src/**/*.ts*'",
"lint:all": "npm run lint",
"check-typescript": "tsc",
Expand Down Expand Up @@ -56,7 +56,7 @@
"typescript": "^3.6.2"
},
"dependencies": {
"launchdarkly-js-client-sdk": "2.16.3",
"launchdarkly-js-client-sdk": "2.17.0",
"lodash.camelcase": "^4.3.0",
"uuid": "^3.3.2"
},
Expand Down
7 changes: 5 additions & 2 deletions src/initLDClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jest.mock('launchdarkly-js-client-sdk', () => {
initialize: jest.fn(),
};
});
jest.mock('../package.json', () => ({ version: 'mock.version' }));

import { initialize, LDClient, LDOptions, LDUser } from 'launchdarkly-js-client-sdk';
import { defaultReactOptions, LDReactOptions } from './types';
Expand All @@ -16,6 +17,8 @@ const ldClientInitialize = initialize as jest.Mock;
const clientSideID = 'deadbeef';
const defaultUser: LDUser = { key: 'abcdef' };
const options: LDOptions = { bootstrap: 'localStorage' };
const extraOptionsAddedBySdk: LDOptions = { wrapperName: 'react-client-sdk', wrapperVersion: 'mock.version' };
const expectedOptions: LDOptions = { ...options, ...extraOptionsAddedBySdk };
const flags = { 'test-flag': false, 'another-test-flag': true };

describe('initLDClient', () => {
Expand All @@ -41,15 +44,15 @@ describe('initLDClient', () => {
const anonUser: LDUser = { anonymous: true };
await initLDClient(clientSideID);

expect(ldClientInitialize.mock.calls[0]).toEqual([clientSideID, anonUser, {}]);
expect(ldClientInitialize.mock.calls[0]).toEqual([clientSideID, anonUser, extraOptionsAddedBySdk]);
expect(mockLDClient.variation).toHaveBeenCalledTimes(0);
});

test('initialise with custom user and options', async () => {
const customUser = { key: '[email protected]' };
await initLDClient(clientSideID, customUser, defaultReactOptions, options);

expect(ldClientInitialize.mock.calls[0]).toEqual([clientSideID, customUser, options]);
expect(ldClientInitialize.mock.calls[0]).toEqual([clientSideID, customUser, expectedOptions]);
expect(mockLDClient.variation).toHaveBeenCalledTimes(0);
});

Expand Down
3 changes: 2 additions & 1 deletion src/initLDClient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { initialize as ldClientInitialize, LDClient, LDFlagSet, LDOptions, LDUser } from 'launchdarkly-js-client-sdk';
import { AllFlagsLDClient, defaultReactOptions, LDReactOptions } from './types';
import { camelCaseKeys } from './utils';
import { version } from '../package.json';

/**
* Internal function to initialize the `LDClient`.
Expand All @@ -20,7 +21,7 @@ const initLDClient = async (
options?: LDOptions,
targetFlags?: LDFlagSet,
): Promise<AllFlagsLDClient> => {
const allOptions = { ...options };
const allOptions = { wrapperName: 'react-client-sdk', wrapperVersion: version, ...options };
const ldClient = ldClientInitialize(clientSideID, user, allOptions);

return new Promise<AllFlagsLDClient>(resolve => {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"noImplicitAny": true,
"strictNullChecks": true,
"jsx": "react",
"esModuleInterop": true
"esModuleInterop": true,
"resolveJsonModule": true
},
"files": [
"./node_modules/@testing-library/jest-dom/extend-expect.d.ts"
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2599,18 +2599,18 @@ kleur@^3.0.3:
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==

launchdarkly-js-client-sdk@2.15.1:
version "2.15.1"
resolved "https://registry.yarnpkg.com/launchdarkly-js-client-sdk/-/launchdarkly-js-client-sdk-2.15.1.tgz#7f691e44b1a82baae994929fa9f385f40fc7e893"
integrity sha512-XJ+F51bHNFKJU3IWQnTfTyUT3LElAld5UddM+t/B0nSWJkdEEAAxDWtMIoSmw6q+NwyUYYWHvJogYPXQQJBiPw==
launchdarkly-js-client-sdk@2.16.0:
version "2.16.0"
resolved "https://registry.yarnpkg.com/launchdarkly-js-client-sdk/-/launchdarkly-js-client-sdk-2.16.0.tgz#aac4273a5499a69006a95ec0097fdd4d4c8023fd"
integrity sha512-nr8UAmWDw1UmhfC4u8TyRg/kjsuN/mja8iH5gQpNXbO9ot7AlZIfsd8bPRoMhAgNHMFeE6PnqpOhZuURE7OgdA==
dependencies:
escape-string-regexp "1.0.5"
launchdarkly-js-sdk-common "2.14.1"
launchdarkly-js-sdk-common "3.1.0"

launchdarkly-js-sdk-common@2.14.1:
version "2.14.1"
resolved "https://registry.yarnpkg.com/launchdarkly-js-sdk-common/-/launchdarkly-js-sdk-common-2.14.1.tgz#d8fd9c28e346795096f0a2d2788113b907962ba0"
integrity sha512-uzecXPbmbwmed2LcTrnUu+dhQSCLdAU6+Fz7V136PKXR71TbfaxWsTcUTD0ZXTFXGYLFjXTtsEDUykJA/oGP5Q==
launchdarkly-js-sdk-common@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/launchdarkly-js-sdk-common/-/launchdarkly-js-sdk-common-3.1.0.tgz#565e0fbe9af214d1b74f5a55011e2d47d407e277"
integrity sha512-htP7QkOnsXmcWlsJxLvrAjxYCSU0XjKBBbjvpHH/SBD+mmfInjN/P7S3Y89HAen/o8O+FHz3/FbBhqoZ+W4uyQ==
dependencies:
"@babel/polyfill" "7.6.0"
base64-js "1.3.0"
Expand Down

0 comments on commit 1857143

Please sign in to comment.