@adobe/helix-shared-config 1.7.13 → 1.7.16
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.
- package/CHANGELOG.md +33 -0
- package/package.json +10 -10
- package/src/BaseConfig.js +12 -2
- package/src/fetchconfig/cache.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.7.16](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config@1.7.15...@adobe/helix-shared-config@1.7.16) (2022-02-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** update external fixes ([cdddbc5](https://github.com/adobe/helix-shared/commit/cdddbc590c52d6ebf336e7943387d8fb393c6524))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.7.15](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config@1.7.14...@adobe/helix-shared-config@1.7.15) (2022-02-23)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **deps:** update dependency object-hash to v3 ([d79b768](https://github.com/adobe/helix-shared/commit/d79b768d7bc0ba5df1e97606bb6ed870804434ad))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [1.7.14](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config@1.7.13...@adobe/helix-shared-config@1.7.14) (2022-02-14)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **deps:** update dependency lru-cache to v7 ([#647](https://github.com/adobe/helix-shared/issues/647)) ([4feaa27](https://github.com/adobe/helix-shared/commit/4feaa27a92f7734a5277231dcfcf2ae8e935eb77))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## [1.7.13](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config@1.7.12...@adobe/helix-shared-config@1.7.13) (2022-02-10)
|
|
7
40
|
|
|
8
41
|
**Note:** Version bump only for package @adobe/helix-shared-config
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-shared-config",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.16",
|
|
4
4
|
"description": "Shared modules of the Helix Project - config",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -24,27 +24,27 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@adobe/helix-fetch": "^3.0.3",
|
|
27
|
-
"@adobe/helix-shared-git": "^1.1.
|
|
28
|
-
"@adobe/helix-shared-prune": "^1.0.
|
|
29
|
-
"@adobe/helix-shared-utils": "^2.0.
|
|
27
|
+
"@adobe/helix-shared-git": "^1.1.3",
|
|
28
|
+
"@adobe/helix-shared-prune": "^1.0.3",
|
|
29
|
+
"@adobe/helix-shared-utils": "^2.0.3",
|
|
30
30
|
"ajv": "8.10.0",
|
|
31
31
|
"ajv-formats": "2.1.1",
|
|
32
32
|
"cookie": "0.4.2",
|
|
33
|
-
"fs-extra": "10.0.
|
|
33
|
+
"fs-extra": "10.0.1",
|
|
34
34
|
"ignore": "5.2.0",
|
|
35
|
-
"lru-cache": "
|
|
36
|
-
"object-hash": "
|
|
35
|
+
"lru-cache": "7.4.0",
|
|
36
|
+
"object-hash": "3.0.0",
|
|
37
37
|
"uri-js": "4.4.1",
|
|
38
38
|
"yaml": "1.10.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@adobe/helix-shared-wrap": "^1.0.
|
|
41
|
+
"@adobe/helix-shared-wrap": "^1.0.3",
|
|
42
42
|
"@adobe/helix-testutils": "0.4.12",
|
|
43
43
|
"@pollyjs/adapter-node-http": "6.0.4",
|
|
44
44
|
"@pollyjs/core": "6.0.4",
|
|
45
45
|
"@pollyjs/persister-fs": "6.0.4",
|
|
46
|
-
"mocha": "9.2.
|
|
46
|
+
"mocha": "9.2.1",
|
|
47
47
|
"nock": "13.2.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "7b7b5c96dba5b26f323fc791603f807319d19a48"
|
|
50
50
|
}
|
package/src/BaseConfig.js
CHANGED
|
@@ -52,10 +52,20 @@ class BaseConfig {
|
|
|
52
52
|
/**
|
|
53
53
|
* Reset the cache with a new cache size
|
|
54
54
|
* @param {object} options cache options
|
|
55
|
-
* @param {number} options.
|
|
55
|
+
* @param {number} options.max
|
|
56
56
|
*/
|
|
57
57
|
withCache(options) {
|
|
58
|
-
|
|
58
|
+
// be backward compatible
|
|
59
|
+
if (!options.max && options.maxSize) {
|
|
60
|
+
const opts = {
|
|
61
|
+
...options,
|
|
62
|
+
max: options.maxSize,
|
|
63
|
+
};
|
|
64
|
+
delete opts.maxSize;
|
|
65
|
+
cache.options(opts);
|
|
66
|
+
} else {
|
|
67
|
+
cache.options(options);
|
|
68
|
+
}
|
|
59
69
|
return this;
|
|
60
70
|
}
|
|
61
71
|
|
package/src/fetchconfig/cache.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
const LRU = require('lru-cache');
|
|
14
14
|
|
|
15
|
-
let lru = new LRU({
|
|
15
|
+
let lru = new LRU({ max: 1000, maxAge: 60 * 1000 });
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Returns a memoized version of the function `fn`.
|
|
@@ -71,7 +71,7 @@ function cache(fn, opts = {}) {
|
|
|
71
71
|
* Resets the QuickLRU cache with new options. Existing cache entries
|
|
72
72
|
* will be cleared.
|
|
73
73
|
* @param {object} opts options
|
|
74
|
-
* @param {number} opts.
|
|
74
|
+
* @param {number} opts.max maximum size of the cache
|
|
75
75
|
*/
|
|
76
76
|
cache.options = (opts) => {
|
|
77
77
|
lru = new LRU(opts);
|