node-semvers 1.5.14 → 1.5.15

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.
@@ -1,7 +1,16 @@
1
+ 'use strict';
1
2
  var path = require('path');
2
-
3
3
  module.exports = {
4
4
  CACHE_PATH: path.join(__dirname, '..', '.cache'),
5
5
  DISTS_URL: 'https://nodejs.org/dist/index.json',
6
6
  SCHEDULES_URL: 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json',
7
7
  };
8
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) {
9
+ try {
10
+ Object.defineProperty(exports.default, '__esModule', { value: true });
11
+ for (var key in exports) {
12
+ exports.default[key] = exports[key];
13
+ }
14
+ } catch (_) {}
15
+ module.exports = exports.default;
16
+ }
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+ var exit = require('exit-compat');
3
+ var Cache = require('fetch-json-cache');
4
+ var _require = require('./constants.cjs');
5
+ var CACHE_PATH = _require.CACHE_PATH;
6
+ var DISTS_URL = _require.DISTS_URL;
7
+ var SCHEDULES_URL = _require.SCHEDULES_URL;
8
+ function fetchWithRetry(cache, url, retries, callback) {
9
+ cache.get(
10
+ url,
11
+ {
12
+ force: true,
13
+ },
14
+ function (err) {
15
+ if (err && retries > 0) {
16
+ setTimeout(function () {
17
+ fetchWithRetry(cache, url, retries - 1, callback);
18
+ }, 1000);
19
+ } else {
20
+ callback(err);
21
+ }
22
+ }
23
+ );
24
+ }
25
+ function cacheWithRetry(callback) {
26
+ var cache = new Cache(CACHE_PATH);
27
+ fetchWithRetry(cache, DISTS_URL, 3, function (err) {
28
+ if (err) return callback(err);
29
+ fetchWithRetry(cache, SCHEDULES_URL, 3, callback);
30
+ });
31
+ }
32
+ // run patch
33
+ cacheWithRetry(function (err) {
34
+ if (err) {
35
+ console.log('postinstall warning: '.concat(err.message));
36
+ console.log('Cache not updated after retries.');
37
+ exit(0);
38
+ } else {
39
+ console.log('postinstall succeeded');
40
+ exit(0);
41
+ }
42
+ });
43
+ /* CJS INTEROP */ if (exports.__esModule && exports.default) {
44
+ try {
45
+ Object.defineProperty(exports.default, '__esModule', { value: true });
46
+ for (var key in exports) {
47
+ exports.default[key] = exports[key];
48
+ }
49
+ } catch (_) {}
50
+ module.exports = exports.default;
51
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var path = require('path');
3
+ module.exports = {
4
+ CACHE_PATH: path.join(__dirname, '..', '.cache'),
5
+ DISTS_URL: 'https://nodejs.org/dist/index.json',
6
+ SCHEDULES_URL: 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json'
7
+ };
8
+ /* 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/assets/constants.cts"],"sourcesContent":["const path = require('path');\n\nmodule.exports = {\n CACHE_PATH: path.join(__dirname, '..', '.cache'),\n DISTS_URL: 'https://nodejs.org/dist/index.json',\n SCHEDULES_URL: 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json',\n};\n"],"names":["path","require","module","exports","CACHE_PATH","join","__dirname","DISTS_URL","SCHEDULES_URL"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AAErBC,OAAOC,OAAO,GAAG;IACfC,YAAYJ,KAAKK,IAAI,CAACC,WAAW,MAAM;IACvCC,WAAW;IACXC,eAAe;AACjB"}
@@ -1,15 +1,7 @@
1
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
- }
2
+ var exit = require('exit-compat');
3
+ var Cache = require('fetch-json-cache');
4
+ var _require = require('./constants.cjs'), CACHE_PATH = _require.CACHE_PATH, DISTS_URL = _require.DISTS_URL, SCHEDULES_URL = _require.SCHEDULES_URL;
13
5
  function fetchWithRetry(cache, url, retries, callback) {
14
6
  cache.get(url, {
15
7
  force: true
@@ -24,10 +16,10 @@ function fetchWithRetry(cache, url, retries, callback) {
24
16
  });
25
17
  }
26
18
  function cacheWithRetry(callback) {
27
- var cache = new _fetchjsoncache.default(_constantsts.CACHE_PATH);
28
- fetchWithRetry(cache, _constantsts.DISTS_URL, 3, function(err) {
19
+ var cache = new Cache(CACHE_PATH);
20
+ fetchWithRetry(cache, DISTS_URL, 3, function(err) {
29
21
  if (err) return callback(err);
30
- fetchWithRetry(cache, _constantsts.SCHEDULES_URL, 3, callback);
22
+ fetchWithRetry(cache, SCHEDULES_URL, 3, callback);
31
23
  });
32
24
  }
33
25
  // run patch
@@ -35,10 +27,10 @@ cacheWithRetry(function(err) {
35
27
  if (err) {
36
28
  console.log("postinstall warning: ".concat(err.message));
37
29
  console.log('Cache not updated after retries.');
38
- (0, _exitcompat.default)(0);
30
+ exit(0);
39
31
  } else {
40
32
  console.log('postinstall succeeded');
41
- (0, _exitcompat.default)(0);
33
+ exit(0);
42
34
  }
43
35
  });
44
36
  /* 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/assets/postinstall.cts"],"sourcesContent":["const exit = require('exit-compat');\nconst Cache = require('fetch-json-cache');\nconst { CACHE_PATH, DISTS_URL, SCHEDULES_URL } = require('./constants.cts');\n\ntype Callback = (err: Error | null) => void;\n\nfunction fetchWithRetry(cache: typeof Cache.prototype, 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","require","Cache","CACHE_PATH","DISTS_URL","SCHEDULES_URL","fetchWithRetry","cache","url","retries","callback","get","force","err","setTimeout","cacheWithRetry","console","log","message"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,QAAQD,QAAQ;AACtB,IAAiDA,WAAAA,QAAQ,oBAAjDE,aAAyCF,SAAzCE,YAAYC,YAA6BH,SAA7BG,WAAWC,gBAAkBJ,SAAlBI;AAI/B,SAASC,eAAeC,KAA6B,EAAEC,GAAW,EAAEC,OAAe,EAAEC,QAAkB;IACrGH,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,IAAIL,MAAMC;IACxBG,eAAeC,OAAOH,WAAW,GAAG,SAACS;QACnC,IAAIA,KAAK,OAAOH,SAASG;QACzBP,eAAeC,OAAOF,eAAe,GAAGK;IAC1C;AACF;AAEA,YAAY;AACZK,eAAe,SAACF;IACd,IAAIA,KAAK;QACPG,QAAQC,GAAG,CAAC,AAAC,wBAAmC,OAAZJ,IAAIK,OAAO;QAC/CF,QAAQC,GAAG,CAAC;QACZjB,KAAK;IACP,OAAO;QACLgB,QAAQC,GAAG,CAAC;QACZjB,KAAK;IACP;AACF"}
@@ -0,0 +1,6 @@
1
+ const path = require('path');
2
+ module.exports = {
3
+ CACHE_PATH: path.join(__dirname, '..', '.cache'),
4
+ DISTS_URL: 'https://nodejs.org/dist/index.json',
5
+ SCHEDULES_URL: 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json'
6
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/assets/constants.cts"],"sourcesContent":["const path = require('path');\n\nmodule.exports = {\n CACHE_PATH: path.join(__dirname, '..', '.cache'),\n DISTS_URL: 'https://nodejs.org/dist/index.json',\n SCHEDULES_URL: 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json',\n};\n"],"names":["path","require","module","exports","CACHE_PATH","join","__dirname","DISTS_URL","SCHEDULES_URL"],"mappings":"AAAA,MAAMA,OAAOC,QAAQ;AAErBC,OAAOC,OAAO,GAAG;IACfC,YAAYJ,KAAKK,IAAI,CAACC,WAAW,MAAM;IACvCC,WAAW;IACXC,eAAe;AACjB"}
@@ -1,6 +1,6 @@
1
- import exit from 'exit-compat';
2
- import Cache from 'fetch-json-cache';
3
- import { CACHE_PATH, DISTS_URL, SCHEDULES_URL } from '../constants.js';
1
+ const exit = require('exit-compat');
2
+ const Cache = require('fetch-json-cache');
3
+ const { CACHE_PATH, DISTS_URL, SCHEDULES_URL } = require('./constants.cts');
4
4
  function fetchWithRetry(cache, url, retries, callback) {
5
5
  cache.get(url, {
6
6
  force: true
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/assets/postinstall.cts"],"sourcesContent":["const exit = require('exit-compat');\nconst Cache = require('fetch-json-cache');\nconst { CACHE_PATH, DISTS_URL, SCHEDULES_URL } = require('./constants.cts');\n\ntype Callback = (err: Error | null) => void;\n\nfunction fetchWithRetry(cache: typeof Cache.prototype, 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","require","Cache","CACHE_PATH","DISTS_URL","SCHEDULES_URL","fetchWithRetry","cache","url","retries","callback","get","force","err","setTimeout","cacheWithRetry","console","log","message"],"mappings":"AAAA,MAAMA,OAAOC,QAAQ;AACrB,MAAMC,QAAQD,QAAQ;AACtB,MAAM,EAAEE,UAAU,EAAEC,SAAS,EAAEC,aAAa,EAAE,GAAGJ,QAAQ;AAIzD,SAASK,eAAeC,KAA6B,EAAEC,GAAW,EAAEC,OAAe,EAAEC,QAAkB;IACrGH,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;QACZjB,KAAK;IACP,OAAO;QACLgB,QAAQC,GAAG,CAAC;QACZjB,KAAK;IACP;AACF"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-semvers",
3
- "version": "1.5.14",
3
+ "version": "1.5.15",
4
4
  "description": "Utilities for managing versions of node including looking up codenames",
5
5
  "keywords": [
6
6
  "node",
@@ -34,13 +34,13 @@
34
34
  "files": [
35
35
  "dist",
36
36
  "bin",
37
- "assets",
38
- "scripts"
37
+ "assets"
39
38
  ],
40
39
  "scripts": {
41
40
  "build": "tsds build",
41
+ "build:assets": "tsds build && mkdir -p assets && cp -R dist/cjs/assets/*.cjs assets/",
42
42
  "format": "tsds format",
43
- "postinstall": "node scripts/postinstall.cjs",
43
+ "postinstall": "node assets/postinstall.cjs",
44
44
  "prepublishOnly": "tsds validate",
45
45
  "test": "tsds test:node --no-timeouts",
46
46
  "test:engines": "nvu engines tsds test:node --no-timeouts",
@@ -56,9 +56,9 @@
56
56
  "@types/mocha": "^10.0.10",
57
57
  "@types/node": "^25.0.1",
58
58
  "cr": "^0.1.0",
59
- "cross-spawn-cb": "^2.4.10",
59
+ "cross-spawn-cb": "^2.4.11",
60
60
  "fs-remove-compat": "^0.2.1",
61
- "node-version-use": "^2.1.3",
61
+ "node-version-use": "^2.1.4",
62
62
  "pinkie-promise": "^2.0.1",
63
63
  "rollup": "^4.53.3",
64
64
  "ts-dev-stack": "^1.21.3",
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1,9 +0,0 @@
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)');
9
- }