stackbite 0.5.51 → 0.5.53
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 +1 -1
- package/packaging/npm/lib/bootstrap.js +27 -3
- package/packaging/npm/release.json +16 -16
package/package.json
CHANGED
|
@@ -69,10 +69,27 @@ function expectedMembers(hashes) {
|
|
|
69
69
|
if (!expected.has('portable.json') || !expected.has('runtime/build-info.json')) fail('Required release metadata is missing');
|
|
70
70
|
return expected;
|
|
71
71
|
}
|
|
72
|
+
// Runs at most `limit` tasks at once; queued tasks start in submission order.
|
|
73
|
+
function boundedRunner(limit) {
|
|
74
|
+
let active = 0;
|
|
75
|
+
const queue = [];
|
|
76
|
+
function next() {
|
|
77
|
+
if (active >= limit || !queue.length) return;
|
|
78
|
+
const { task, resolve, reject } = queue.shift();
|
|
79
|
+
active++;
|
|
80
|
+
task().then(resolve, reject).finally(() => { active--; next(); });
|
|
81
|
+
}
|
|
82
|
+
return task => new Promise((resolve, reject) => { queue.push({ task, resolve, reject }); next(); });
|
|
83
|
+
}
|
|
84
|
+
// Bounded concurrency overlaps file reads; every pinned member is still hashed in full.
|
|
85
|
+
const HASH_CONCURRENCY = 8;
|
|
72
86
|
// Walks the payload; every file or in-root link must resolve to a bounded regular file and pinned members must match.
|
|
73
87
|
async function payloadFiles(root, expected, hashes) {
|
|
74
|
-
const actual = new Set();
|
|
88
|
+
const actual = new Set(), run = boundedRunner(HASH_CONCURRENCY), checks = [];
|
|
75
89
|
let total = 0, entries = 0;
|
|
90
|
+
async function checkHash(relative, resolved) {
|
|
91
|
+
if (await hashFile(resolved) !== hashes[relative]) fail(`Release file SHA-256 mismatch: ${relative}`);
|
|
92
|
+
}
|
|
76
93
|
async function visit(directoryPath) {
|
|
77
94
|
for (const name of await fs.readdir(directoryPath)) {
|
|
78
95
|
if (++entries > LIMITS.members * 2) fail('Cached release has too many entries');
|
|
@@ -88,10 +105,17 @@ async function payloadFiles(root, expected, hashes) {
|
|
|
88
105
|
total += resolvedInfo.size;
|
|
89
106
|
if (total > LIMITS.expanded) fail('Cached release exceeds expansion limit');
|
|
90
107
|
actual.add(relative);
|
|
91
|
-
|
|
108
|
+
// Each check settles to its error (or null) at once, so none is ever an unhandled rejection.
|
|
109
|
+
if (expected.has(relative)) checks.push(run(() => checkHash(relative, resolved)).then(() => null, error => error));
|
|
92
110
|
}
|
|
93
111
|
}
|
|
94
|
-
|
|
112
|
+
// Every started read settles before returning or failing; a walk failure takes precedence,
|
|
113
|
+
// otherwise the first mismatch in walk order is reported.
|
|
114
|
+
const walkError = await visit(root).then(() => null, error => error);
|
|
115
|
+
const hashErrors = await Promise.all(checks);
|
|
116
|
+
if (walkError) throw walkError;
|
|
117
|
+
const mismatch = hashErrors.find(Boolean);
|
|
118
|
+
if (mismatch) throw mismatch;
|
|
95
119
|
return actual;
|
|
96
120
|
}
|
|
97
121
|
// The checksum documents themselves are the only unhashed members; Linux also ships the text form.
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"commit": "
|
|
3
|
+
"version": "0.5.53",
|
|
4
|
+
"commit": "12893f646a5c93c77aad1f4611c85a782440b0da",
|
|
5
5
|
"repository": "Shinick-Han/stackbite",
|
|
6
6
|
"platforms": {
|
|
7
7
|
"win32-x64": {
|
|
8
|
-
"asset": "stackbite-0.5.
|
|
9
|
-
"url": "https://github.com/Shinick-Han/stackbite/releases/download/v0.5.
|
|
10
|
-
"sha256": "
|
|
11
|
-
"size":
|
|
12
|
-
"root": "stackbite-0.5.
|
|
13
|
-
"manifestSha256": "
|
|
14
|
-
"metadataSha256": "
|
|
8
|
+
"asset": "stackbite-0.5.53-windows-x64-12893f646a5c.zip",
|
|
9
|
+
"url": "https://github.com/Shinick-Han/stackbite/releases/download/v0.5.53/stackbite-0.5.53-windows-x64-12893f646a5c.zip",
|
|
10
|
+
"sha256": "dc7536114969d01e42d15686e3291489e81044dacec3912eb31d3b28de1cc861",
|
|
11
|
+
"size": 45939422,
|
|
12
|
+
"root": "stackbite-0.5.53-windows-x64-12893f646a5c",
|
|
13
|
+
"manifestSha256": "94683b77cdb258002c5d7aeaa5806f20387e82bfaf90fe9b628981695c66ebf3",
|
|
14
|
+
"metadataSha256": "2d9025f8751221986548039de848edf588ad3431373f51ee1664f25bda65e3a5"
|
|
15
15
|
},
|
|
16
16
|
"linux-x64": {
|
|
17
|
-
"asset": "stackbite-0.5.
|
|
18
|
-
"url": "https://github.com/Shinick-Han/stackbite/releases/download/v0.5.
|
|
19
|
-
"sha256": "
|
|
20
|
-
"size":
|
|
21
|
-
"root": "stackbite-0.5.
|
|
22
|
-
"manifestSha256": "
|
|
23
|
-
"metadataSha256": "
|
|
17
|
+
"asset": "stackbite-0.5.53-linux-x86_64-12893f646a5c.tar.gz",
|
|
18
|
+
"url": "https://github.com/Shinick-Han/stackbite/releases/download/v0.5.53/stackbite-0.5.53-linux-x86_64-12893f646a5c.tar.gz",
|
|
19
|
+
"sha256": "6a8d230b6f1406081e26c4bf1701d37f0f0b8ee314c2da6def31ef3778286397",
|
|
20
|
+
"size": 32983655,
|
|
21
|
+
"root": "stackbite-0.5.53-linux-x86_64-12893f646a5c",
|
|
22
|
+
"manifestSha256": "12241bc8b5fbf58f938c024863888b6e7f4fac83b30a87a4ed1620fa9291540f",
|
|
23
|
+
"metadataSha256": "3803a66ad3506987c7de3a64dcd68a0dc5068e8ddc6a8f1e8dab0c09424ce448"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|