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

Commit c2b51fe

Browse files
authored
version 1.0.1 - update package names (#3)
1 parent d9313ac commit c2b51fe

File tree

9 files changed

+70
-61
lines changed

9 files changed

+70
-61
lines changed

.babelrc

Lines changed: 0 additions & 16 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to the LaunchDarkly Node.js SDK Consul integration will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
## [1.0.1] - 2019-05-14
6+
### Changed:
7+
- Corresponding to the SDK package name change from `ldclient-node` to `launchdarkly-node-server-sdk`, this package is now called `launchdarkly-node-server-sdk-consul`. The functionality of the package, including the namespaces and class names, has not changed.
8+
59
## [1.0.0] - 2019-01-14
610

711
Initial release.

README.md

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
LaunchDarkly SDK for Node.js - Consul integration
2-
=================================================
1+
# LaunchDarkly Server-Side SDK for Node.js - Consul integration
2+
33
[![CircleCI](https://circleci.com/gh/launchdarkly/node-server-sdk-consul.svg?style=svg)](https://circleci.com/gh/launchdarkly/node-server-sdk-consul)
44

5-
This library provides a Consul-backed persistence mechanism (feature store) for the [LaunchDarkly Node.js SDK](https://github.com/launchdarkly/node-client), replacing the default in-memory feature store. It uses the [consul](https://www.npmjs.com/package/consul) package.
5+
This library provides a Consul-backed persistence mechanism (feature store) for the [LaunchDarkly server-side Node.js SDK](https://github.com/launchdarkly/node-server-sdk), replacing the default in-memory feature store. It uses the [consul](https://www.npmjs.com/package/consul) package.
66

7-
The minimum version of the LaunchDarkly Node.js SDK for use with this library is 5.7.0.
7+
The minimum version of the LaunchDarkly Node.js SDK for use with this library is 5.8.1.
88

99
For more information, see also: [Using a persistent feature store](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store).
1010

11-
Quick setup
12-
-----------
11+
## Quick setup
1312

1413
This assumes that you have already installed the LaunchDarkly Node.js SDK.
1514

1615
1. Install this package with `npm`:
1716

18-
npm install ldclient-node-consul-store --save
17+
npm install launchdarkly-node-server-sdk-consul --save
1918

2019
2. Require the package:
2120

22-
var ConsulFeatureStore = require('ldclient-node-consul-store');
21+
var ConsulFeatureStore = require('launchdarkly-node-server-sdk-consul');
2322

2423
3. When configuring your SDK client, add the Consul feature store:
2524

@@ -36,36 +35,23 @@ This assumes that you have already installed the LaunchDarkly Node.js SDK.
3635

3736
var store = ConsulFeatureStore({ consulOptions: { host: 'your-consul-host' }, prefix: 'env1' });
3837

39-
Caching behavior
40-
----------------
38+
## Caching behavior
4139

4240
To reduce traffic to Consul, there is an optional in-memory cache that retains the last known data for a configurable amount of time. This is on by default; to turn it off (and guarantee that the latest feature flag data will always be retrieved from Consul for every flag evaluation), configure the store as follows:
4341

4442
var store = ConsulFeatureStore('YOUR TABLE NAME', { cacheTTL: 0 });
4543

46-
About LaunchDarkly
47-
------------------
44+
## About LaunchDarkly
4845

4946
* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
5047
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
5148
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
5249
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
5350
* Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
54-
* LaunchDarkly provides feature flag SDKs for
55-
* [Java](http://docs.launchdarkly.com/docs/java-sdk-reference "Java SDK")
56-
* [JavaScript](http://docs.launchdarkly.com/docs/js-sdk-reference "LaunchDarkly JavaScript SDK")
57-
* [PHP](http://docs.launchdarkly.com/docs/php-sdk-reference "LaunchDarkly PHP SDK")
58-
* [Python](http://docs.launchdarkly.com/docs/python-sdk-reference "LaunchDarkly Python SDK")
59-
* [Go](http://docs.launchdarkly.com/docs/go-sdk-reference "LaunchDarkly Go SDK")
60-
* [Node.JS](http://docs.launchdarkly.com/docs/node-sdk-reference "LaunchDarkly Node SDK")
61-
* [Electron](http://docs.launchdarkly.com/docs/electron-sdk-reference "LaunchDarkly Electron SDK")
62-
* [.NET](http://docs.launchdarkly.com/docs/dotnet-sdk-reference "LaunchDarkly .Net SDK")
63-
* [Ruby](http://docs.launchdarkly.com/docs/ruby-sdk-reference "LaunchDarkly Ruby SDK")
64-
* [iOS](http://docs.launchdarkly.com/docs/ios-sdk-reference "LaunchDarkly iOS SDK")
65-
* [Android](http://docs.launchdarkly.com/docs/android-sdk-reference "LaunchDarkly Android SDK")
51+
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/docs) for a complete list.
6652
* Explore LaunchDarkly
67-
* [launchdarkly.com](http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
68-
* [docs.launchdarkly.com](http://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDKs
69-
* [apidocs.launchdarkly.com](http://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
70-
* [blog.launchdarkly.com](http://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
53+
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
54+
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
55+
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
56+
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
7157
* [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies

babel.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
// We must use babel.config.js instead of .babelrc because we also want to transpile the test code
3+
// that we import from the main SDK package (see jest.config.js), and .babelrc settings never apply
4+
// to code from other modules.
5+
6+
module.exports = {
7+
env: {
8+
test: {
9+
presets: [
10+
[
11+
'@babel/preset-env',
12+
{
13+
targets: {
14+
node: '6'
15+
}
16+
}
17+
]
18+
]
19+
}
20+
}
21+
};

consul_feature_store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var consul = require('consul');
22
var winston = require('winston');
33

4-
var CachingStoreWrapper = require('ldclient-node/caching_store_wrapper');
4+
var CachingStoreWrapper = require('launchdarkly-node-server-sdk/caching_store_wrapper');
55

66
var defaultCacheTTLSeconds = 15;
77
var defaultPrefix = 'launchdarkly';

index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Type definitions for ldclient-node-consul-store
1+
// Type definitions for launchdarkly-node-server-sdk-consul
22

33
/**
44
* Interface for the Consul feature store component to be used with the LaunchDarkly SDK.
55
*
66
* See: https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store
77
*/
88

9-
declare module 'ldclient-node-consul-store' {
10-
import { LDFeatureStore, LDLogger } from 'ldclient-node';
9+
declare module 'launchdarkly-node-server-sdk-consul' {
10+
import { LDFeatureStore, LDLogger } from 'launchdarkly-node-server-sdk';
1111
// note that the node-consul package does not have TypeScript definitions
1212

1313
/**

jest.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
module.exports = {
3+
automock: false,
4+
resetModules: true,
5+
testMatch: ['**/tests/**/*-test.js'],
6+
transform: {
7+
'^.+\\.js$': 'babel-jest',
8+
},
9+
transformIgnorePatterns: [
10+
'<rootDir>/[^/]*\\.js',
11+
'<rootDir>/node_modules/(?!(launchdarkly-node-server-sdk/test)/)',
12+
// The line above is necessary because the Node SDK shared test code uses syntax that isn't Node 6 compatible,
13+
// so we want to make sure it gets transpiled, which Babel won't do for imported modules by default.
14+
],
15+
};

package.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "ldclient-node-consul-store",
3-
"version": "1.0.0",
2+
"name": "launchdarkly-node-server-sdk-consul",
3+
"version": "1.0.1",
44
"description": "Consul-backed feature store for the LaunchDarkly Node.js SDK",
55
"main": "consul_feature_store.js",
66
"license": "Apache-2.0",
@@ -11,15 +11,14 @@
1111
},
1212
"types": "./index.d.ts",
1313
"devDependencies": {
14-
"babel-core": "6.26.0",
15-
"babel-jest": "22.4.3",
16-
"babel-preset-env": "1.6.1",
14+
"@babel/core": "7.4.3",
15+
"@babel/preset-env": "7.4.3",
16+
"babel-jest": "24.7.1",
1717
"eslint": "5.8.0",
1818
"eslint-formatter-pretty": "1.3.0",
19-
"jest": "23.6.0",
20-
"jest-junit": "5.2.0",
21-
"ldclient-node": ">= 5.7.1",
22-
"node-cache": "^3.2.1",
19+
"jest": "24.7.1",
20+
"jest-junit": "6.3.0",
21+
"launchdarkly-node-server-sdk": ">= 5.8.1",
2322
"typescript": "3.0.1"
2423
},
2524
"jest": {
@@ -37,13 +36,13 @@
3736
"winston": "2.4.1"
3837
},
3938
"peerDependencies": {
40-
"ldclient-node": ">= 5.7.0"
39+
"launchdarkly-node-server-sdk": ">= 5.8.1"
4140
},
4241
"engines": {
4342
"node": ">= 0.8.x"
4443
},
4544
"bugs": {
46-
"url": "https://github.com/launchdarkly/node-consul-store/issues"
45+
"url": "https://github.com/launchdarkly/node-server-sdk-consul/issues"
4746
},
48-
"homepage": "https://github.com/launchdarkly/node-consul-store"
47+
"homepage": "https://github.com/launchdarkly/node-server-sdk-consul"
4948
}

tests/consul_feature_store-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var ConsulFeatureStore = require('../consul_feature_store');
2-
var testBase = require('ldclient-node/test/feature_store_test_base');
2+
var testBase = require('launchdarkly-node-server-sdk/test/feature_store_test_base');
33
var consul = require('consul');
44

55
describe('ConsulFeatureStore', function() {

0 commit comments

Comments
 (0)