launchdarkly-node-client-sdk 2.0.4 → 2.2.0

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.
@@ -16,23 +16,14 @@ workflows:
16
16
  docker-image: cimg/node:current
17
17
  run-lint: true
18
18
  - build-test-linux:
19
- name: Node 17.9
20
- docker-image: cimg/node:17.9
19
+ name: Node 18.10
20
+ docker-image: cimg/node:18.10
21
21
  - build-test-linux:
22
22
  name: Node 16.14
23
- docker-image: cimg/node:16.14
24
- - build-test-linux:
25
- name: Node 15.14
26
- docker-image: cimg/node:15.14
23
+ docker-image: cimg/node:16.17
27
24
  - build-test-linux:
28
25
  name: Node 14.19
29
- docker-image: cimg/node:14.19
30
- - build-test-linux:
31
- name: Node 13.14
32
- docker-image: cimg/node:13.14
33
- - build-test-linux:
34
- name: Node 12.22
35
- docker-image: cimg/node:12.22
26
+ docker-image: cimg/node:14.20
36
27
  - build-test-windows:
37
28
  name: Windows
38
29
 
package/.eslintrc.yaml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- parser: babel-eslint
2
+ parser: "@babel/eslint-parser"
3
3
  root: true
4
4
  extends:
5
5
  - prettier
@@ -10,7 +10,7 @@ publications:
10
10
 
11
11
  jobs:
12
12
  - docker:
13
- image: node:12-buster
13
+ image: node:14-buster
14
14
  template:
15
15
  name: npm
16
16
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to the LaunchDarkly Client-Side SDK for Node.js will be documented in this file.
4
4
 
5
+ ## [2.1.0] - 2022-10-06
6
+ ### Changed:
7
+ - Updated `js-sdk-common` version which removed event de-duplication functionality which was made redundant by support of summary events. This will improve the default event behavior when using experimentation.
8
+
9
+ - Updated development dependencies to recent versions.
10
+
11
+ - Updated CI builds to current node LTS versions and dropped build support for node 12.
12
+
13
+ ## [2.0.4] - 2022-04-27
14
+ ### Changed:
15
+ - CI builds now include a cross-platform test suite implemented in https://github.com/launchdarkly/sdk-test-harness. This covers many test cases that are also implemented in unit tests, but may be extended in the future to ensure consistent behavior across SDKs in other areas.
16
+
17
+ ### Fixed:
18
+ - The `baseUrl`, `streamUrl`, and `eventsUrl` properties now work properly regardless of whether the URL string has a trailing slash. Previously, a trailing slash would cause request URL paths to have double slashes.
19
+
5
20
  ## [2.0.3] - 2022-03-14
6
21
  ### Fixed:
7
22
  - The `original` dependency (and therefore its transitive dependency `url-parse`) had accidentally been included twice, once as a dependency of `js-eventsource` and then again directly in the SDK's `package.json`. This has been removed so there is no longer any reference to the vulnerable `url-parse` that was meant to be removed in [2.0.2](https://github.com/launchdarkly/node-client-sdk/releases/tag/2.0.2). (Thanks, [AlexHladin](https://github.com/launchdarkly/node-client-sdk/pull/26)!)
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ presets: [
3
+ [
4
+ '@babel/preset-env',
5
+ {
6
+ targets: {
7
+ node: '14',
8
+ },
9
+ },
10
+ ],
11
+ ],
12
+ };
@@ -77,10 +77,13 @@ async function newSdkClientEntity(options) {
77
77
  options.configuration.startWaitTimeMs !== null && options.configuration.startWaitTimeMs !== undefined
78
78
  ? options.configuration.startWaitTimeMs
79
79
  : 5000;
80
+ const sdkConfig = makeSdkConfig(options.configuration, options.tag);
81
+ const initialUser = (options.configuration.clientSide && options.configuration.clientSide.initialUser)
82
+ || makeDefaultInitialUser();
80
83
  const client = ld.initialize(
81
84
  options.configuration.credential || 'unknown-env-id',
82
- (options.clientSide && options.clientSide.initialUser) || makeDefaultInitialUser(),
83
- makeSdkConfig(options.configuration, options.tag)
85
+ initialUser,
86
+ sdkConfig
84
87
  );
85
88
  let failed = false;
86
89
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "launchdarkly-node-client-sdk",
3
- "version": "2.0.4",
3
+ "version": "2.2.0",
4
4
  "description": "LaunchDarkly Client-Side SDK for Node.js",
5
5
  "author": "LaunchDarkly <team@launchdarkly.com>",
6
6
  "license": "Apache-2.0",
@@ -24,27 +24,23 @@
24
24
  "node": ">= 12.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@babel/core": "^7.9.6",
28
- "@babel/preset-env": "^7.9.6",
27
+ "@babel/core": "^7.19.3",
28
+ "@babel/preset-env": "^7.19.3",
29
29
  "@types/node": "^12.12.6",
30
- "babel-eslint": "^10.1.0",
31
- "babel-jest": "^25.5.1",
32
- "chai": "^4.1.2",
33
- "cross-env": "^7.0.2",
34
- "eslint": "^6.8.0",
35
- "eslint-config-prettier": "^6.11.0",
36
- "eslint-config-xo": "^0.29.1",
37
- "eslint-formatter-pretty": "^3.0.1",
38
- "eslint-plugin-babel": "^5.3.0",
39
- "eslint-plugin-prettier": "^3.1.3",
40
- "jest": "^27.4.7",
41
- "jest-junit": "^13.0.0",
30
+ "@babel/eslint-parser": "7.19.1",
31
+ "babel-jest": "^29.1.0",
32
+ "cross-env": "^7.0.3",
33
+ "eslint": "^8.24.0",
34
+ "eslint-config-prettier": "^8.5.0",
35
+ "eslint-config-xo": "^0.42.0",
36
+ "eslint-formatter-pretty": "^4.1.0",
37
+ "eslint-plugin-babel": "^5.3.1",
38
+ "eslint-plugin-prettier": "^4.2.1",
39
+ "jest": "^29.1.1",
40
+ "jest-junit": "^14.0.1",
42
41
  "launchdarkly-js-test-helpers": "1.2.1",
43
- "prettier": "^2.0.5",
44
- "readline-sync": "^1.4.9",
45
- "semver": "^5.5.0",
46
- "semver-compare": "^1.0.0",
47
- "typescript": "^3.8.3"
42
+ "prettier": "2.7.1",
43
+ "typescript": "^4.8.4"
48
44
  },
49
45
  "jest": {
50
46
  "rootDir": "src",
@@ -52,7 +48,15 @@
52
48
  "testMatch": [
53
49
  "<rootDir>/**/*-test.js"
54
50
  ],
55
- "testResultsProcessor": "jest-junit"
51
+ "testResultsProcessor": "jest-junit",
52
+ "transform": {
53
+ "^.+\\.js$": [
54
+ "babel-jest",
55
+ {
56
+ "rootMode": "upward"
57
+ }
58
+ ]
59
+ }
56
60
  },
57
61
  "jest-junit": {
58
62
  "outputDirectory": "./reports/junit",
@@ -60,7 +64,7 @@
60
64
  },
61
65
  "dependencies": {
62
66
  "launchdarkly-eventsource": "1.4.3",
63
- "launchdarkly-js-sdk-common": "4.1.0",
67
+ "launchdarkly-js-sdk-common": "4.3.1",
64
68
  "node-localstorage": "^1.3.1"
65
69
  },
66
70
  "repository": {
package/.babelrc DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "env": {
3
- "test": {
4
- "presets": [
5
- [
6
- "@babel/preset-env",
7
- {
8
- "targets": {
9
- "node": "6"
10
- }
11
- }
12
- ]
13
- ]
14
- }
15
- }
16
- }