@balena/compose 3.0.6 → 3.0.7
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
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file
|
|
|
4
4
|
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
|
7
|
+
## 3.0.7 - 2023-11-10
|
|
8
|
+
|
|
9
|
+
* NodeResolver: Refactor the recursion to an async-await loop [Thodoris Greasidis]
|
|
10
|
+
* Drop bluebird & bluebird-lru-cache in favor of memoizee [Thodoris Greasidis]
|
|
11
|
+
|
|
7
12
|
## 3.0.6 - 2023-11-10
|
|
8
13
|
|
|
9
14
|
* Fix the remaining linting errors [Thodoris Greasidis]
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NodeResolver = void 0;
|
|
4
|
-
const
|
|
4
|
+
const memoize = require("memoizee");
|
|
5
5
|
const _ = require("lodash");
|
|
6
6
|
const request = require("request");
|
|
7
7
|
const semver = require("semver");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const util_1 = require("util");
|
|
9
|
+
const getAsync = (0, util_1.promisify)(request.get);
|
|
10
10
|
const versionTest = RegExp.prototype.test.bind(/^[0-9]+\.[0-9]+\.[0-9]+$/);
|
|
11
|
-
const
|
|
11
|
+
const getDeviceTypeVersions = memoize(async (deviceType) => {
|
|
12
|
+
const tags = [];
|
|
13
|
+
let nextUrl = `https://hub.docker.com/v2/repositories/resin/${deviceType}-node/tags/?page_size=100`;
|
|
14
|
+
while (nextUrl != null) {
|
|
15
|
+
const res = (await getAsync({
|
|
16
|
+
url: nextUrl,
|
|
17
|
+
json: true,
|
|
18
|
+
})).body;
|
|
19
|
+
const curr = res.results
|
|
20
|
+
.map(({ name }) => name)
|
|
21
|
+
.filter(versionTest);
|
|
22
|
+
tags.push(...curr);
|
|
23
|
+
nextUrl = res.next;
|
|
24
|
+
}
|
|
25
|
+
return tags;
|
|
26
|
+
}, {
|
|
27
|
+
promise: true,
|
|
28
|
+
primitive: true,
|
|
12
29
|
maxAge: 3600 * 1000,
|
|
13
|
-
fetchFn: (deviceType) => {
|
|
14
|
-
const get = (prev, url) => {
|
|
15
|
-
return Promise.resolve(getAsync({
|
|
16
|
-
url,
|
|
17
|
-
json: true,
|
|
18
|
-
})
|
|
19
|
-
.get('body')
|
|
20
|
-
.then((res) => {
|
|
21
|
-
const curr = res.results
|
|
22
|
-
.map(({ name }) => name)
|
|
23
|
-
.filter(versionTest);
|
|
24
|
-
const tags = prev.concat(curr);
|
|
25
|
-
if (res.next != null) {
|
|
26
|
-
return get(tags, res.next);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return tags;
|
|
30
|
-
}
|
|
31
|
-
}));
|
|
32
|
-
};
|
|
33
|
-
return get([], `https://hub.docker.com/v2/repositories/resin/${deviceType}-node/tags/?page_size=100`);
|
|
34
|
-
},
|
|
35
30
|
});
|
|
36
31
|
class NodeResolver {
|
|
37
32
|
constructor() {
|
|
@@ -81,7 +76,7 @@ class NodeResolver {
|
|
|
81
76
|
throw new Error('package.json: engines.node must be a string if present');
|
|
82
77
|
}
|
|
83
78
|
const range = nodeEngine;
|
|
84
|
-
const versions = await
|
|
79
|
+
const versions = await getDeviceTypeVersions(bundle.deviceType);
|
|
85
80
|
const nodeVersion = semver.maxSatisfying(versions, range);
|
|
86
81
|
if (nodeVersion == null) {
|
|
87
82
|
throw new Error(`Couldn't satisfy node version ${range}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeResolver.js","sourceRoot":"","sources":["../../../lib/resolve/resolvers/nodeResolver.ts"],"names":[],"mappings":";;;AAgBA,
|
|
1
|
+
{"version":3,"file":"nodeResolver.js","sourceRoot":"","sources":["../../../lib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E,IAAI,UAAU,IAAI,IAAI,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;SAChE;QACD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;YACnC,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;SAC1E;QACD,MAAM,KAAK,GAAW,UAAU,CAAC;QAEjC,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAChE,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAE1D,IAAI,WAAW,IAAI,IAAI,EAAE;YACxB,MAAM,IAAI,KAAK,CAAC,iCAAiC,KAAK,EAAE,CAAC,CAAC;SAC1D;QAED,IAAI,UAAkB,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,EAAE;YACpB,UAAU,GAAG;mBACG,MAAM,CAAC,UAAU,SAAS,WAAW;;;;;;OAMjD,CAAC;SACL;aAAM;YACN,UAAU,GAAG;mBACG,MAAM,CAAC,UAAU,SAAS,WAAW;;MAElD,CAAC;SACJ;QACD,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC;QACrC,OAAO;YACN,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,UAAU,CAAC,MAAM;YACvB,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;SACjC,CAAC;IACH,CAAC;IAEM,gBAAgB;QACtB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC3E,CAAC;CACD;AA5GD,oCA4GC;AAED,kBAAe,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/compose",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"description": "Complete toolkit to build docker-compose.yml files and optionally deploy them to balenaCloud",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"homepage": "https://github.com/balena-io-modules/balena-compose#readme",
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@balena/lint": "^7.2.1",
|
|
38
|
-
"@types/bluebird": "^3.5.32",
|
|
39
38
|
"@types/chai-as-promised": "^7.1.3",
|
|
40
39
|
"@types/docker-modem": "^3.0.1",
|
|
41
40
|
"@types/dockerode": "^3.3.8",
|
|
@@ -46,6 +45,7 @@
|
|
|
46
45
|
"@types/jsonstream": "^0.8.30",
|
|
47
46
|
"@types/klaw": "^3.0.3",
|
|
48
47
|
"@types/lodash": "^4.14.181",
|
|
48
|
+
"@types/memoizee": "^0.4.11",
|
|
49
49
|
"@types/mocha": "^10.0.1",
|
|
50
50
|
"@types/mz": "^2.7.4",
|
|
51
51
|
"@types/proxyquire": "^1.3.28",
|
|
@@ -64,8 +64,6 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"ajv": "^6.12.3",
|
|
67
|
-
"bluebird": "^3.7.2",
|
|
68
|
-
"bluebird-lru-cache": "^1.0.1",
|
|
69
67
|
"docker-file-parser": "^1.0.7",
|
|
70
68
|
"docker-modem": "^3.0.3",
|
|
71
69
|
"docker-progress": "^5.1.0",
|
|
@@ -81,6 +79,7 @@
|
|
|
81
79
|
"JSONStream": "^1.3.5",
|
|
82
80
|
"klaw": "^4.0.1",
|
|
83
81
|
"lodash": "^4.17.19",
|
|
82
|
+
"memoizee": "^0.4.15",
|
|
84
83
|
"mz": "^2.7.0",
|
|
85
84
|
"p-map": "^4.0.0",
|
|
86
85
|
"pinejs-client-request": "^7.3.5",
|
|
@@ -92,6 +91,6 @@
|
|
|
92
91
|
"typed-error": "^3.2.1"
|
|
93
92
|
},
|
|
94
93
|
"versionist": {
|
|
95
|
-
"publishedAt": "2023-11-
|
|
94
|
+
"publishedAt": "2023-11-10T16:05:22.903Z"
|
|
96
95
|
}
|
|
97
96
|
}
|