Skip to content

Commit 4253977

Browse files
authored
Merge pull request #77 from zotoio/fix/upgrade-deps
fix(security): update all dependencies and related fixes
2 parents cd9eaa7 + 7ac0537 commit 4253977

File tree

11 files changed

+9367
-12785
lines changed

11 files changed

+9367
-12785
lines changed

.babelrc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
{
2-
"presets": [
3-
"es2015",
4-
"stage-0"
5-
],
2+
"presets": ["@babel/preset-env"],
63
"plugins": [
7-
"transform-async-to-generator",
8-
"transform-class-properties",
9-
"transform-runtime"
4+
"@babel/transform-async-to-generator",
5+
"@babel/proposal-class-properties",
6+
"@babel/transform-runtime"
107
],
118
"env": {
129
"test": {

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ cache:
55
notifications:
66
email: false
77
node_js:
8-
- '8'
9-
before_install: npm install -g greenkeeper-lockfile@1
8+
- '12'
9+
before_install: npm install -g greenkeeper-lockfile@1 yarn
1010
before_script:
1111
- greenkeeper-lockfile-update
1212
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
1313
- chmod +x ./cc-test-reporter
1414
- ./cc-test-reporter before-build
15-
install: npm install
15+
install: yarn
1616
after_script:
1717
- greenkeeper-lockfile-upload
1818
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
1919
after_success:
20-
- npm run semantic-release
20+
- yarn semantic-release
2121
branches:
2222
except:
2323
- /^v\d+\.\d+\.\d+$/

API.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Feature flag specific api functions attached as 'LaunchDarklyUtils.flags'
9797

9898
<a name="LaunchDarklyUtilsFlags+API_GROUP"></a>
9999

100-
### launchDarklyUtilsFlags.API_GROUP ⇒ <code>string</code>
100+
### launchDarklyUtilsFlags.API\_GROUP ⇒ <code>string</code>
101101
Api group object key in LD api
102102

103103
**Kind**: instance property of [<code>LaunchDarklyUtilsFlags</code>](#LaunchDarklyUtilsFlags)
@@ -289,7 +289,7 @@ Team member specific api functions attached as 'LaunchDarklyUtils.members'
289289

290290
<a name="LaunchDarklyUtilsMembers+API_GROUP"></a>
291291

292-
### launchDarklyUtilsMembers.API_GROUP ⇒ <code>string</code>
292+
### launchDarklyUtilsMembers.API\_GROUP ⇒ <code>string</code>
293293
Api group object key in LD api
294294

295295
**Kind**: instance property of [<code>LaunchDarklyUtilsMembers</code>](#LaunchDarklyUtilsMembers)
@@ -402,7 +402,7 @@ Custom role specific api functions attached as 'LaunchDarklyUtils.roles'
402402

403403
<a name="LaunchDarklyUtilsRoles+API_GROUP"></a>
404404

405-
### launchDarklyUtilsRoles.API_GROUP ⇒ <code>string</code>
405+
### launchDarklyUtilsRoles.API\_GROUP ⇒ <code>string</code>
406406
Api group object key in LD api
407407

408408
**Kind**: instance property of [<code>LaunchDarklyUtilsRoles</code>](#LaunchDarklyUtilsRoles)

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,14 @@ await ldUtils.toggleFeatureFlag('myProject', 'feature-def', 'dev', true);
179179

180180
Here is a summary. For more detail see [Contributing](CONTRIBUTING.md).
181181
1. Fork this repo and work on your enhancements. See note on Commitizen below.
182-
2. Ensure that you include unit tests and jsdoc annotations.
183-
3. Ensure that `npm test` passes.
184-
4. Raise a pull request.
182+
1. Ensure that you include unit tests and jsdoc annotations.
183+
1. Ensure that `yarn test` passes.
184+
1. Use `yarn commit` for conventional commits.
185+
1. Raise a pull request.
185186

186187
### Commitizen
187188
This project uses commitizen for conventional commit messages via `git cz` instead of `git commit`.
188189
The reason for this is that it attaches meaning to each commit that is useful to others, and that is used to automatically version new releases based on http://semver.org
189190

190-
> Just use `npm run commit` instead of git commit and follow instructions.
191+
> Just use `yarn commit` instead of git commit and follow instructions.
192+

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./dist/src/LaunchDarklyUtils.js');
1+
module.exports = require('./dist/src/LaunchDarklyUtils.js');

ldutils

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@ let log = console;
1515
if (process.env.LAUNCHDARKLY_API_LOGLEVEL === 'debug') log = undefined;
1616

1717
process.on('unhandledRejection', (reason, p) => {
18-
console.error(json.plain({"error": reason}));
18+
console.error(json.plain({ error: reason }));
1919
process.exit(1);
2020
});
2121

2222
new LaunchDarklyUtils().create(process.env.LAUNCHDARKLY_API_TOKEN, log).then(function(ldUtils) {
23-
24-
program
25-
.version('1.0.0')
26-
.description('Manage LaunchDarkly flags and other assets from the command line.');
23+
program.version('1.0.0').description('Manage LaunchDarkly flags and other assets from the command line.');
2724

2825
program
2926
.command('getFeatureFlags <projectKey>')
@@ -57,36 +54,44 @@ new LaunchDarklyUtils().create(process.env.LAUNCHDARKLY_API_TOKEN, log).then(fun
5754
.description('set boolean flag state')
5855
.action(function(projectKey, featureFlagKey, environmentKeyQuery, value) {
5956
let enabled = value === 'true';
60-
ldUtils.flags.toggleFeatureFlag(projectKey, featureFlagKey, environmentKeyQuery, enabled).then(function(response) {
61-
console.log(json.plain(response));
62-
});
57+
ldUtils.flags
58+
.toggleFeatureFlag(projectKey, featureFlagKey, environmentKeyQuery, enabled)
59+
.then(function(response) {
60+
console.log(json.plain(response));
61+
});
6362
});
6463

6564
program
6665
.command(`migrateFeatureFlag <projectKey> <featureFlagKey> <fromEnv> <toEnv> (includeState)`)
6766
.description('migrate flag settings from one environment to another')
6867
.action(function(projectKey, featureFlagKey, fromEnv, toEnv, includeState) {
69-
ldUtils.flags.migrateFeatureFlag(projectKey, featureFlagKey, fromEnv, toEnv, includeState).then(function(response) {
70-
console.log(json.plain(response));
71-
});
68+
ldUtils.flags
69+
.migrateFeatureFlag(projectKey, featureFlagKey, fromEnv, toEnv, includeState)
70+
.then(function(response) {
71+
console.log(json.plain(response));
72+
});
7273
});
7374

7475
program
7576
.command(`bulkMigrateFeatureFlags <projectKey> <featureFlagKeys> <fromEnv> <toEnv> (includeState)`)
7677
.description('migrate multiple flag settings from one environment to another')
7778
.action(function(projectKey, featureFlagKeys, fromEnv, toEnv, includeState) {
78-
ldUtils.flags.bulkMigrateFeatureFlags(projectKey, featureFlagKeys, fromEnv, toEnv, includeState).then(function(response) {
79-
console.log(json.plain(response));
80-
});
79+
ldUtils.flags
80+
.bulkMigrateFeatureFlags(projectKey, featureFlagKeys, fromEnv, toEnv, includeState)
81+
.then(function(response) {
82+
console.log(json.plain(response));
83+
});
8184
});
8285

8386
program
8487
.command(`restoreFeatureFlags <projectKey> <featureFlagKeys> <targetEnv> <backupJsonFile> (includeState)`)
8588
.description('restore environment flag settings from a backup file - backup from getFeatureFlags')
8689
.action(function(projectKey, featureFlagKeys, targetEnv, backupJsonFile, includeState) {
87-
ldUtils.flags.restoreFeatureFlags(projectKey, featureFlagKeys, targetEnv, backupJsonFile, includeState).then(function(response) {
88-
console.log(json.plain(response));
89-
});
90+
ldUtils.flags
91+
.restoreFeatureFlags(projectKey, featureFlagKeys, targetEnv, backupJsonFile, includeState)
92+
.then(function(response) {
93+
console.log(json.plain(response));
94+
});
9095
});
9196

9297
program
@@ -121,29 +126,35 @@ new LaunchDarklyUtils().create(process.env.LAUNCHDARKLY_API_TOKEN, log).then(fun
121126
.description('create custom role')
122127
.action(function(customRoleKey, customRoleName, customRolePolicyArray, customRoleDescription) {
123128
customRolePolicyArray = JSON.parse(customRolePolicyArray);
124-
ldUtils.roles.createCustomRole(customRoleKey, customRoleName, customRolePolicyArray, customRoleDescription).then(function(response) {
125-
console.log(json.plain(response));
126-
});
129+
ldUtils.roles
130+
.createCustomRole(customRoleKey, customRoleName, customRolePolicyArray, customRoleDescription)
131+
.then(function(response) {
132+
console.log(json.plain(response));
133+
});
127134
});
128135

129136
program
130137
.command(`updateCustomRole <customRoleKey> <customRoleName> <customRolePolicyArray> [customRoleDescription]`)
131138
.description('update custom role')
132139
.action(function(customRoleKey, customRoleName, customRolePolicyArray, customRoleDescription) {
133140
customRolePolicyArray = JSON.parse(customRolePolicyArray);
134-
ldUtils.roles.updateCustomRole(customRoleKey, customRoleName, customRolePolicyArray, customRoleDescription).then(function(response) {
135-
console.log(json.plain(response));
136-
});
141+
ldUtils.roles
142+
.updateCustomRole(customRoleKey, customRoleName, customRolePolicyArray, customRoleDescription)
143+
.then(function(response) {
144+
console.log(json.plain(response));
145+
});
137146
});
138147

139148
program
140149
.command(`upsertCustomRole <customRoleKey> <customRoleName> <customRolePolicyArray> [customRoleDescription]`)
141150
.description('create or update custom role')
142151
.action(function(customRoleKey, customRoleName, customRolePolicyArray, customRoleDescription) {
143152
customRolePolicyArray = JSON.parse(customRolePolicyArray);
144-
ldUtils.roles.upsertCustomRole(customRoleKey, customRoleName, customRolePolicyArray, customRoleDescription).then(function(response) {
145-
console.log(json.plain(response));
146-
});
153+
ldUtils.roles
154+
.upsertCustomRole(customRoleKey, customRoleName, customRolePolicyArray, customRoleDescription)
155+
.then(function(response) {
156+
console.log(json.plain(response));
157+
});
147158
});
148159

149160
program
@@ -218,8 +229,5 @@ new LaunchDarklyUtils().create(process.env.LAUNCHDARKLY_API_TOKEN, log).then(fun
218229
process.exit(1);
219230
}
220231

221-
program
222-
.parse(process.argv);
223-
232+
program.parse(process.argv);
224233
});
225-

0 commit comments

Comments
 (0)