node-semvers 1.5.10 → 1.5.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-semvers",
3
- "version": "1.5.10",
3
+ "version": "1.5.12",
4
4
  "description": "Utilities for managing versions of node including looking up codenames",
5
5
  "keywords": [
6
6
  "node",
@@ -47,22 +47,22 @@
47
47
  "version": "tsds version"
48
48
  },
49
49
  "dependencies": {
50
- "exit": "*",
51
- "fetch-json-cache": "*",
52
- "getopts-compat": "*",
50
+ "exit": "^0.1.2",
51
+ "fetch-json-cache": "^1.3.11",
52
+ "getopts-compat": "^2.2.6",
53
53
  "semver": "^5.7.1"
54
54
  },
55
55
  "devDependencies": {
56
- "@types/mocha": "*",
57
- "@types/node": "*",
58
- "cr": "*",
59
- "cross-spawn-cb": "*",
60
- "node-version-use": "*",
61
- "pinkie-promise": "*",
62
- "rimraf2": "*",
63
- "rollup": "*",
64
- "ts-dev-stack": "*",
65
- "tsds-config": "*"
56
+ "@types/mocha": "^10.0.10",
57
+ "@types/node": "^24.10.2",
58
+ "cr": "^0.1.0",
59
+ "cross-spawn-cb": "^2.4.10",
60
+ "fs-remove-compat": "^0.2.1",
61
+ "node-version-use": "^1.9.9",
62
+ "pinkie-promise": "^2.0.1",
63
+ "rollup": "^4.53.3",
64
+ "ts-dev-stack": "^1.21.2",
65
+ "tsds-config": "^0.2.0"
66
66
  },
67
67
  "engines": {
68
68
  "node": ">=0.8"
@@ -1,18 +1,32 @@
1
1
  var Cache = require('fetch-json-cache');
2
2
  var constants = require('../assets/constants.cjs');
3
3
 
4
- function cache(callback) {
4
+ function fetchWithRetry(cache, url, retries, callback) {
5
+ cache.get(url, { force: true }, function (err) {
6
+ if (err && retries > 0) {
7
+ setTimeout(function () {
8
+ fetchWithRetry(cache, url, retries - 1, callback);
9
+ }, 1000);
10
+ } else {
11
+ callback(err);
12
+ }
13
+ });
14
+ }
15
+
16
+ function cacheWithRetry(callback) {
5
17
  var cache = new Cache(constants.CACHE_PATH);
6
- cache.get(constants.DISTS_URL, { force: true }, function (err) {
7
- err ? callback(err) : cache.get(constants.SCHEDULES_URL, { force: true }, callback);
18
+ fetchWithRetry(cache, constants.DISTS_URL, 3, function (err) {
19
+ if (err) return callback(err);
20
+ fetchWithRetry(cache, constants.SCHEDULES_URL, 3, callback);
8
21
  });
9
22
  }
10
23
 
11
24
  // run patch
12
- cache(function (err) {
25
+ cacheWithRetry(function (err) {
13
26
  if (err) {
14
- console.log('postinstall failed. Error: ' + err.message);
15
- process.exit(-1);
27
+ console.log('postinstall warning: ' + err.message);
28
+ console.log('Cache not updated after retries.');
29
+ process.exit(0);
16
30
  } else {
17
31
  console.log('postinstall succeeded');
18
32
  process.exit(0);