Skip to content
This repository was archived by the owner on Sep 8, 2023. It is now read-only.

Commit 87af525

Browse files
authored
feat: update dependencies [CAT-1533] (#31)
* feat: allowed wider range of hapi/hoek versions: v9, v10, v11 * feat: updated dot-prop version to v6 * chore: updated outdated packages * feat: replaced deprecated ESLint plugins for Hapi with hapi/eslint-plugin * chore: cosmetic changes, typos fix * chore: configured Dependabot to ignore major updates for dot-prop and semantic-release
1 parent 7fbe3ef commit 87af525

8 files changed

+1662
-1623
lines changed

.eslintrc

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
{
2-
"extends": ["eslint-config-hapi"],
2+
"extends": ["plugin:@hapi/recommended"],
33
"parserOptions": {
4-
"ecmaVersion": 2018,
5-
"sourceType": "module"
4+
"ecmaVersion": 2018
65
},
76
"env": {
87
"browser": false,
98
"node": true
109
},
1110
"rules": {
12-
"strict": [0],
13-
"no-cond-assign": [0],
14-
"no-console": [0],
15-
"hapi/hapi-scope-start": [0],
16-
"no-shadow": [0],
17-
"no-trailing-spaces": [0]
11+
"@hapi/scope-start": "off"
1812
}
1913
}

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@ updates:
1313
reviewers:
1414
- "@ExpediaGroup/catalyst-committers"
1515
open-pull-requests-limit: 10
16+
ignore:
17+
# Ignore Dot Prop major updates
18+
- dependency-name: "dot-prop"
19+
update-types: ["version-update:semver-major"]
20+
# Ignore Semantic Release major updates
21+
- dependency-name: "semantic-release"
22+
update-types: ["version-update:semver-major"]

README.md

+17-11
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ const Determination = require('@vrbo/determination');
1717
**Determination.create(options)**
1818

1919
- `options` (_Object_) - an options object containing:
20-
- `config` (_String_ | _Object_) - required, either a path to a JSON configuration file or an object.
21-
- `basedir` (_String_) - optional path used for resolving relative imports within configs. If config is a file, it defaults to the config file's directory. If config is an object, it defaults to `process.cwd()`.
22-
- `criteria` (_Object_) - optional resolution criteria. See [confidence](https://github.com/hapijs/confidence). Minimally will always contain `process.env` under the key `env`.
23-
- `protocols` (_Object_) - optional mapping of protocols for [shortstop](https://github.com/krakenjs/shortstop). Protocols are bound with context `config`, where `config` is the configuration being resolved. Obviously this doesn't work with arrow functions.
24-
- `defaults` (_Object_ | _String_) - optional default pre-resolved configuration values.
25-
- `overrides` (_Object_ | _String_) - optional override pre-resolved configuration values.
20+
- `config` (_String_ | _Object_) - required, either a path to a JSON configuration file or an object.
21+
- `basedir` (_String_) - optional path used for resolving relative imports within configs. If config is a file, it defaults to the config file's directory. If config is an object, it defaults to `process.cwd()`.
22+
- `criteria` (_Object_) - optional resolution criteria. See [confidence](https://github.com/hapijs/confidence). Minimally will always contain `process.env` under the key `env`.
23+
- `protocols` (_Object_) - optional mapping of protocols for [shortstop](https://github.com/krakenjs/shortstop). Protocols are bound with context `config`, where `config` is the configuration being resolved. Obviously this doesn't work with arrow functions.
24+
- `defaults` (_Object_ | _String_) - optional default pre-resolved configuration values.
25+
- `overrides` (_Object_ | _String_) - optional override pre-resolved configuration values.
2626
- returns - a resolver.
2727

2828
**resolver.resolve([callback])**
@@ -45,8 +45,8 @@ const resolver = Determination.create({
4545
});
4646

4747
resolver.resolve((error, config) => {
48-
//config.get
49-
//config.set
48+
// config.get
49+
// config.set
5050
});
5151
```
5252

@@ -60,8 +60,14 @@ resolver.resolve((error, config) => {
6060

6161
```javascript
6262
config.set('some.key.name', 'value');
63-
config.merge({ some: { key: other: 'another value' }});
64-
config.get('some.key.other'); //'another value'
63+
config.merge({
64+
some: {
65+
key: {
66+
other: 'another value',
67+
},
68+
},
69+
});
70+
config.get('some.key.other'); // 'another value'
6571
```
6672

6773
### Shortstop Protocol Handlers
@@ -97,7 +103,7 @@ const protocols = {
97103
};
98104

99105
Determination.create({ config: Path.join(__dirname, './config.json'), protocols }).resolve((error, config) => {
100-
config.get('things'); //"one and two"
106+
config.get('things'); // "one and two"
101107
});
102108
```
103109

lib/index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
* MIT License
44
*
55
* Copyright (c) 2019 Expedia, Inc
6-
*
6+
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
99
* in the Software without restriction, including without limitation the rights
1010
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1111
* copies of the Software, and to permit persons to whom the Software is
1212
* furnished to do so, subject to the following conditions:
13-
*
13+
*
1414
* The above copyright notice and this permission notice shall be included in all
1515
* copies or substantial portions of the Software.
16-
*
16+
*
1717
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1818
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1919
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2020
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2121
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2222
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
* SOFTWARE.
24-
*
24+
*
2525
**/
2626
'use strict';
2727

@@ -53,6 +53,7 @@ const create = function (options) {
5353
});
5454
});
5555
}
56+
5657
Resolver(validation.value).then((resolved) => callback(null, new Store(resolved))).catch(callback);
5758
}
5859
};

lib/resolver.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
* MIT License
44
*
55
* Copyright (c) 2019 Expedia, Inc
6-
*
6+
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
99
* in the Software without restriction, including without limitation the rights
1010
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1111
* copies of the Software, and to permit persons to whom the Software is
1212
* furnished to do so, subject to the following conditions:
13-
*
13+
*
1414
* The above copyright notice and this permission notice shall be included in all
1515
* copies or substantial portions of the Software.
16-
*
16+
*
1717
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1818
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1919
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2020
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2121
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2222
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
* SOFTWARE.
24-
*
24+
*
2525
**/
2626

2727
'use strict';
@@ -72,7 +72,7 @@ const loadAndParseJson = function (file) {
7272
const resolver = async function ({ config, basedir, criteria, protocols, defaults, overrides }) {
7373

7474
let configobject = config;
75-
75+
7676
if (typeof config === 'string') {
7777
configobject = loadAndParseJson(config);
7878
basedir = Path.dirname(config);
@@ -81,6 +81,7 @@ const resolver = async function ({ config, basedir, criteria, protocols, default
8181
if (typeof defaults === 'string') {
8282
defaults = loadAndParseJson(defaults);
8383
}
84+
8485
if (typeof overrides === 'string') {
8586
overrides = loadAndParseJson(overrides);
8687
}
@@ -99,6 +100,7 @@ const resolver = async function ({ config, basedir, criteria, protocols, default
99100
console.log('@vrbo/determination: No basedir set, defaulting to "process.cwd()" for resolving relative json imports.');
100101
basedir = process.cwd();
101102
}
103+
102104
return resolveCriteria(loadAndParseJson(Path.resolve(Path.join(basedir, key))), criteria);
103105
}
104106
});

lib/store.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
* MIT License
44
*
55
* Copyright (c) 2019 Expedia, Inc
6-
*
6+
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
99
* in the Software without restriction, including without limitation the rights
1010
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1111
* copies of the Software, and to permit persons to whom the Software is
1212
* furnished to do so, subject to the following conditions:
13-
*
13+
*
1414
* The above copyright notice and this permission notice shall be included in all
1515
* copies or substantial portions of the Software.
16-
*
16+
*
1717
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1818
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1919
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2020
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2121
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2222
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
* SOFTWARE.
24-
*
24+
*
2525
**/
2626

2727
'use strict';

0 commit comments

Comments
 (0)