node-semvers 1.3.0 → 1.3.1
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 +2 -2
- package/scripts/postinstall.cjs +19 -2
- package/assets/postinstall.cjs +0 -34
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-semvers",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Utilities for managing versions of node including looking up codenames",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsds build",
|
|
43
43
|
"deploy": "tsds deploy",
|
|
44
|
-
"format": "biome check --write --unsafe src/ && biome check --config-path biome.es5.json --write --unsafe assets/",
|
|
44
|
+
"format": "biome check --write --unsafe src/ && biome check --config-path biome.es5.json --write --unsafe assets/ scripts/",
|
|
45
45
|
"postinstall": "node scripts/postinstall.cjs",
|
|
46
46
|
"test": "tsds test:node --no-timeouts",
|
|
47
47
|
"test:engines": "nvu engines npm test",
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
var Cache = require('fetch-json-cache');
|
|
2
|
+
var constants = require('../assets/constants.cjs');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
function cache(callback) {
|
|
5
|
+
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);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// run patch
|
|
12
|
+
cache(function (err) {
|
|
13
|
+
if (err) {
|
|
14
|
+
console.log('postinstall failed. Error: ' + err.message);
|
|
15
|
+
process.exit(-1);
|
|
16
|
+
} else {
|
|
17
|
+
console.log('postinstall succeeded');
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
});
|
package/assets/postinstall.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var Cache = require('fetch-json-cache');
|
|
2
|
-
var constants = require('./constants.cjs');
|
|
3
|
-
|
|
4
|
-
module.exports = function postinstall() {
|
|
5
|
-
var cacheJSON = function cacheJSON(callback) {
|
|
6
|
-
cache.get(
|
|
7
|
-
constants.DISTS_URL,
|
|
8
|
-
{
|
|
9
|
-
force: true,
|
|
10
|
-
},
|
|
11
|
-
function (err) {
|
|
12
|
-
err
|
|
13
|
-
? callback(err)
|
|
14
|
-
: cache.get(
|
|
15
|
-
constants.SCHEDULES_URL,
|
|
16
|
-
{
|
|
17
|
-
force: true,
|
|
18
|
-
},
|
|
19
|
-
callback
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
var cache = new Cache(constants.CACHE_PATH);
|
|
25
|
-
cacheJSON(function (err) {
|
|
26
|
-
if (err) {
|
|
27
|
-
console.log(`postinstall failed. Error: ${err.message}`);
|
|
28
|
-
process.exit(-1);
|
|
29
|
-
} else {
|
|
30
|
-
console.log('postinstall succeeded');
|
|
31
|
-
process.exit(0);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
};
|