node-semvers 1.5.13 → 1.5.14
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/dist/cjs/scripts/postinstall.d.cts +1 -0
- package/dist/cjs/scripts/postinstall.d.ts +1 -0
- package/dist/cjs/scripts/postinstall.js +44 -0
- package/dist/cjs/scripts/postinstall.js.map +1 -0
- package/dist/esm/scripts/postinstall.d.ts +1 -0
- package/dist/esm/scripts/postinstall.js +34 -0
- package/dist/esm/scripts/postinstall.js.map +1 -0
- package/package.json +4 -4
- package/scripts/postinstall.cjs +8 -33
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
var _exitcompat = /*#__PURE__*/ _interop_require_default(require("exit-compat"));
|
|
6
|
+
var _fetchjsoncache = /*#__PURE__*/ _interop_require_default(require("fetch-json-cache"));
|
|
7
|
+
var _constantsts = require("../constants.js");
|
|
8
|
+
function _interop_require_default(obj) {
|
|
9
|
+
return obj && obj.__esModule ? obj : {
|
|
10
|
+
default: obj
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function fetchWithRetry(cache, url, retries, callback) {
|
|
14
|
+
cache.get(url, {
|
|
15
|
+
force: true
|
|
16
|
+
}, function(err) {
|
|
17
|
+
if (err && retries > 0) {
|
|
18
|
+
setTimeout(function() {
|
|
19
|
+
fetchWithRetry(cache, url, retries - 1, callback);
|
|
20
|
+
}, 1000);
|
|
21
|
+
} else {
|
|
22
|
+
callback(err);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function cacheWithRetry(callback) {
|
|
27
|
+
var cache = new _fetchjsoncache.default(_constantsts.CACHE_PATH);
|
|
28
|
+
fetchWithRetry(cache, _constantsts.DISTS_URL, 3, function(err) {
|
|
29
|
+
if (err) return callback(err);
|
|
30
|
+
fetchWithRetry(cache, _constantsts.SCHEDULES_URL, 3, callback);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
// run patch
|
|
34
|
+
cacheWithRetry(function(err) {
|
|
35
|
+
if (err) {
|
|
36
|
+
console.log("postinstall warning: ".concat(err.message));
|
|
37
|
+
console.log('Cache not updated after retries.');
|
|
38
|
+
(0, _exitcompat.default)(0);
|
|
39
|
+
} else {
|
|
40
|
+
console.log('postinstall succeeded');
|
|
41
|
+
(0, _exitcompat.default)(0);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/scripts/postinstall.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport Cache from 'fetch-json-cache';\nimport { CACHE_PATH, DISTS_URL, SCHEDULES_URL } from '../constants.ts';\n\ntype Callback = (err: Error | null) => void;\n\nfunction fetchWithRetry(cache: Cache, url: string, retries: number, callback: Callback): void {\n cache.get(url, { force: true }, (err: Error | null) => {\n if (err && retries > 0) {\n setTimeout(() => {\n fetchWithRetry(cache, url, retries - 1, callback);\n }, 1000);\n } else {\n callback(err);\n }\n });\n}\n\nfunction cacheWithRetry(callback: Callback): void {\n const cache = new Cache(CACHE_PATH);\n fetchWithRetry(cache, DISTS_URL, 3, (err) => {\n if (err) return callback(err);\n fetchWithRetry(cache, SCHEDULES_URL, 3, callback);\n });\n}\n\n// run patch\ncacheWithRetry((err) => {\n if (err) {\n console.log(`postinstall warning: ${err.message}`);\n console.log('Cache not updated after retries.');\n exit(0);\n } else {\n console.log('postinstall succeeded');\n exit(0);\n }\n});\n"],"names":["fetchWithRetry","cache","url","retries","callback","get","force","err","setTimeout","cacheWithRetry","Cache","CACHE_PATH","DISTS_URL","SCHEDULES_URL","console","log","message","exit"],"mappings":";;;;iEAAiB;qEACC;2BACmC;;;;;;AAIrD,SAASA,eAAeC,KAAY,EAAEC,GAAW,EAAEC,OAAe,EAAEC,QAAkB;IACpFH,MAAMI,GAAG,CAACH,KAAK;QAAEI,OAAO;IAAK,GAAG,SAACC;QAC/B,IAAIA,OAAOJ,UAAU,GAAG;YACtBK,WAAW;gBACTR,eAAeC,OAAOC,KAAKC,UAAU,GAAGC;YAC1C,GAAG;QACL,OAAO;YACLA,SAASG;QACX;IACF;AACF;AAEA,SAASE,eAAeL,QAAkB;IACxC,IAAMH,QAAQ,IAAIS,uBAAK,CAACC,uBAAU;IAClCX,eAAeC,OAAOW,sBAAS,EAAE,GAAG,SAACL;QACnC,IAAIA,KAAK,OAAOH,SAASG;QACzBP,eAAeC,OAAOY,0BAAa,EAAE,GAAGT;IAC1C;AACF;AAEA,YAAY;AACZK,eAAe,SAACF;IACd,IAAIA,KAAK;QACPO,QAAQC,GAAG,CAAC,AAAC,wBAAmC,OAAZR,IAAIS,OAAO;QAC/CF,QAAQC,GAAG,CAAC;QACZE,IAAAA,mBAAI,EAAC;IACP,OAAO;QACLH,QAAQC,GAAG,CAAC;QACZE,IAAAA,mBAAI,EAAC;IACP;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import exit from 'exit-compat';
|
|
2
|
+
import Cache from 'fetch-json-cache';
|
|
3
|
+
import { CACHE_PATH, DISTS_URL, SCHEDULES_URL } from '../constants.js';
|
|
4
|
+
function fetchWithRetry(cache, url, retries, callback) {
|
|
5
|
+
cache.get(url, {
|
|
6
|
+
force: true
|
|
7
|
+
}, (err)=>{
|
|
8
|
+
if (err && retries > 0) {
|
|
9
|
+
setTimeout(()=>{
|
|
10
|
+
fetchWithRetry(cache, url, retries - 1, callback);
|
|
11
|
+
}, 1000);
|
|
12
|
+
} else {
|
|
13
|
+
callback(err);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function cacheWithRetry(callback) {
|
|
18
|
+
const cache = new Cache(CACHE_PATH);
|
|
19
|
+
fetchWithRetry(cache, DISTS_URL, 3, (err)=>{
|
|
20
|
+
if (err) return callback(err);
|
|
21
|
+
fetchWithRetry(cache, SCHEDULES_URL, 3, callback);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
// run patch
|
|
25
|
+
cacheWithRetry((err)=>{
|
|
26
|
+
if (err) {
|
|
27
|
+
console.log(`postinstall warning: ${err.message}`);
|
|
28
|
+
console.log('Cache not updated after retries.');
|
|
29
|
+
exit(0);
|
|
30
|
+
} else {
|
|
31
|
+
console.log('postinstall succeeded');
|
|
32
|
+
exit(0);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/scripts/postinstall.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport Cache from 'fetch-json-cache';\nimport { CACHE_PATH, DISTS_URL, SCHEDULES_URL } from '../constants.ts';\n\ntype Callback = (err: Error | null) => void;\n\nfunction fetchWithRetry(cache: Cache, url: string, retries: number, callback: Callback): void {\n cache.get(url, { force: true }, (err: Error | null) => {\n if (err && retries > 0) {\n setTimeout(() => {\n fetchWithRetry(cache, url, retries - 1, callback);\n }, 1000);\n } else {\n callback(err);\n }\n });\n}\n\nfunction cacheWithRetry(callback: Callback): void {\n const cache = new Cache(CACHE_PATH);\n fetchWithRetry(cache, DISTS_URL, 3, (err) => {\n if (err) return callback(err);\n fetchWithRetry(cache, SCHEDULES_URL, 3, callback);\n });\n}\n\n// run patch\ncacheWithRetry((err) => {\n if (err) {\n console.log(`postinstall warning: ${err.message}`);\n console.log('Cache not updated after retries.');\n exit(0);\n } else {\n console.log('postinstall succeeded');\n exit(0);\n }\n});\n"],"names":["exit","Cache","CACHE_PATH","DISTS_URL","SCHEDULES_URL","fetchWithRetry","cache","url","retries","callback","get","force","err","setTimeout","cacheWithRetry","console","log","message"],"mappings":"AAAA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,WAAW,mBAAmB;AACrC,SAASC,UAAU,EAAEC,SAAS,EAAEC,aAAa,QAAQ,kBAAkB;AAIvE,SAASC,eAAeC,KAAY,EAAEC,GAAW,EAAEC,OAAe,EAAEC,QAAkB;IACpFH,MAAMI,GAAG,CAACH,KAAK;QAAEI,OAAO;IAAK,GAAG,CAACC;QAC/B,IAAIA,OAAOJ,UAAU,GAAG;YACtBK,WAAW;gBACTR,eAAeC,OAAOC,KAAKC,UAAU,GAAGC;YAC1C,GAAG;QACL,OAAO;YACLA,SAASG;QACX;IACF;AACF;AAEA,SAASE,eAAeL,QAAkB;IACxC,MAAMH,QAAQ,IAAIL,MAAMC;IACxBG,eAAeC,OAAOH,WAAW,GAAG,CAACS;QACnC,IAAIA,KAAK,OAAOH,SAASG;QACzBP,eAAeC,OAAOF,eAAe,GAAGK;IAC1C;AACF;AAEA,YAAY;AACZK,eAAe,CAACF;IACd,IAAIA,KAAK;QACPG,QAAQC,GAAG,CAAC,CAAC,qBAAqB,EAAEJ,IAAIK,OAAO,EAAE;QACjDF,QAAQC,GAAG,CAAC;QACZhB,KAAK;IACP,OAAO;QACLe,QAAQC,GAAG,CAAC;QACZhB,KAAK;IACP;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-semvers",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.14",
|
|
4
4
|
"description": "Utilities for managing versions of node including looking up codenames",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/mocha": "^10.0.10",
|
|
57
|
-
"@types/node": "^25.0.
|
|
57
|
+
"@types/node": "^25.0.1",
|
|
58
58
|
"cr": "^0.1.0",
|
|
59
59
|
"cross-spawn-cb": "^2.4.10",
|
|
60
60
|
"fs-remove-compat": "^0.2.1",
|
|
61
|
-
"node-version-use": "^2.1.
|
|
61
|
+
"node-version-use": "^2.1.3",
|
|
62
62
|
"pinkie-promise": "^2.0.1",
|
|
63
63
|
"rollup": "^4.53.3",
|
|
64
|
-
"ts-dev-stack": "^1.21.
|
|
64
|
+
"ts-dev-stack": "^1.21.3",
|
|
65
65
|
"tsds-config": "^0.2.0"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -1,34 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, 1000);
|
|
10
|
-
} else {
|
|
11
|
-
callback(err);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var fs = require('fs');
|
|
3
|
+
var path = require('path');
|
|
4
|
+
var compiled = path.join(__dirname, '..', 'dist', 'cjs', 'scripts', 'postinstall.js');
|
|
5
|
+
if (fs.existsSync(compiled)) {
|
|
6
|
+
require(compiled);
|
|
7
|
+
} else {
|
|
8
|
+
console.log('postinstall: Skipping (dist/ not built yet - run npm run build)');
|
|
14
9
|
}
|
|
15
|
-
|
|
16
|
-
function cacheWithRetry(callback) {
|
|
17
|
-
var cache = new Cache(constants.CACHE_PATH);
|
|
18
|
-
fetchWithRetry(cache, constants.DISTS_URL, 3, function (err) {
|
|
19
|
-
if (err) return callback(err);
|
|
20
|
-
fetchWithRetry(cache, constants.SCHEDULES_URL, 3, callback);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// run patch
|
|
25
|
-
cacheWithRetry(function (err) {
|
|
26
|
-
if (err) {
|
|
27
|
-
console.log('postinstall warning: ' + err.message);
|
|
28
|
-
console.log('Cache not updated after retries.');
|
|
29
|
-
process.exit(0);
|
|
30
|
-
} else {
|
|
31
|
-
console.log('postinstall succeeded');
|
|
32
|
-
process.exit(0);
|
|
33
|
-
}
|
|
34
|
-
});
|