openvibers/openvibe.shared Commits
Shared: docs-status (and so the pin bot) updates a STATUS.json packages list too (#40)
Changes
@@@ -165,8 +165,16 @@ function withStatusFields(status, pins, today) {out[key] = value;}if (!placed) for (const f of tracked) if (updates[f] !== undefined) out[f] = updates[f];++ // A `packages` list ("openvibe-shared v2.15.0", …) names the pins too: each entry of a pinned library follows it++ // (Wiki#19 failed its status-pins check on a stale entry the fields above had already moved past).++ if (Array.isArray(status.packages)) {++ out.packages = status.packages.map((entry) => {++ const m = /^(openvibe-[a-z]+) v\d+\.\d+\.\d+/.exec(String(entry));++ return m && pins[m[1]] ? statusValue(entry, m[1], pins[m[1]]) : entry;++ });++ }// `updated` moves only when a tracked field really changed, so a rerun with no pin change writes nothing.-- const changed = tracked.some((f) => out[f] !== status[f]);++ const changed = tracked.some((f) => out[f] !== status[f]) || JSON.stringify(out.packages) !== JSON.stringify(status.packages);out.updated = changed || status.updated === undefined ? today : status.updated;return out;}@@@ -135,4 +135,19 @@ assert.strictEqual(applyBlock('a\n\n<!-- versions:start -->\n- openvibe-sdk: v0.assert.strictEqual(cli.status, 0, cli.stdout + cli.stderr);fs.rmSync(dir, { recursive: true, force: true });}++// A `packages` list follows the pins too (Wiki's STATUS.json lists them there as well as in the fields).++{++ const dir = tmp('packages');++ write(dir, 'package.json', JSON.stringify({ dependencies: {++ 'openvibe-shared': url('OpenVibe.Shared', 'v2.17.0'),++ 'openvibe-publishing': url('OpenVibe.Publishing', 'v1.3.0'),++ } }));++ write(dir, 'STATUS.json', JSON.stringify({ repository: 'OpenVibers/W', shared: 'openvibe-shared v2.15.0', packages: ['openvibe-publishing v1.2.0', 'openvibe-shared v2.15.0', 'openvibe-sdk v0.37.0 (not pinned here)', 'something else'] }));++ assert.deepStrictEqual(update(dir, { today: '2026-10-09' }), ['STATUS.json']);++ const status = JSON.parse(read(dir, 'STATUS.json'));++ assert.strictEqual(status.shared, 'openvibe-shared v2.17.0');++ assert.deepStrictEqual(status.packages, ['openvibe-publishing v1.3.0', 'openvibe-shared v2.17.0', 'openvibe-sdk v0.37.0 (not pinned here)', 'something else'], 'pinned entries follow, the rest stay');++ assert.deepStrictEqual(update(dir, { today: '2026-10-10' }), [], 'a rerun writes nothing');++ fs.rmSync(dir, { recursive: true, force: true });++}console.log('docs-status: all checks passed');
@@ -165,8 +165,16 @@ function withStatusFields(status, pins, today) {
@@ -165,8 +165,16 @@ function withStatusFields(status, pins, today) {
out[key] = value;
out[key] = value;
}
}
if (!placed) for (const f of tracked) if (updates[f] !== undefined) out[f] = updates[f];
if (!placed) for (const f of tracked) if (updates[f] !== undefined) out[f] = updates[f];
+ // A `packages` list ("openvibe-shared v2.15.0", …) names the pins too: each entry of a pinned library follows it
+ // (Wiki#19 failed its status-pins check on a stale entry the fields above had already moved past).
+ if (Array.isArray(status.packages)) {
+ out.packages = status.packages.map((entry) => {
+ const m = /^(openvibe-[a-z]+) v\d+\.\d+\.\d+/.exec(String(entry));
+ return m && pins[m[1]] ? statusValue(entry, m[1], pins[m[1]]) : entry;
+ });
+ }
// `updated` moves only when a tracked field really changed, so a rerun with no pin change writes nothing.
// `updated` moves only when a tracked field really changed, so a rerun with no pin change writes nothing.
- const changed = tracked.some((f) => out[f] !== status[f]);
+ const changed = tracked.some((f) => out[f] !== status[f]) || JSON.stringify(out.packages) !== JSON.stringify(status.packages);
out.updated = changed || status.updated === undefined ? today : status.updated;
out.updated = changed || status.updated === undefined ? today : status.updated;
return out;
return out;
}
}
@@ -135,4 +135,19 @@ assert.strictEqual(applyBlock('a\n\n<!-- versions:start -->\n- openvibe-sdk: v0.
@@ -135,4 +135,19 @@ assert.strictEqual(applyBlock('a\n\n<!-- versions:start -->\n- openvibe-sdk: v0.
assert.strictEqual(cli.status, 0, cli.stdout + cli.stderr);
assert.strictEqual(cli.status, 0, cli.stdout + cli.stderr);
fs.rmSync(dir, { recursive: true, force: true });
fs.rmSync(dir, { recursive: true, force: true });
}
}
+// A `packages` list follows the pins too (Wiki's STATUS.json lists them there as well as in the fields).
+{
+ const dir = tmp('packages');
+ write(dir, 'package.json', JSON.stringify({ dependencies: {
+ 'openvibe-shared': url('OpenVibe.Shared', 'v2.17.0'),
+ 'openvibe-publishing': url('OpenVibe.Publishing', 'v1.3.0'),
+ } }));
+ write(dir, 'STATUS.json', JSON.stringify({ repository: 'OpenVibers/W', shared: 'openvibe-shared v2.15.0', packages: ['openvibe-publishing v1.2.0', 'openvibe-shared v2.15.0', 'openvibe-sdk v0.37.0 (not pinned here)', 'something else'] }));
+ assert.deepStrictEqual(update(dir, { today: '2026-10-09' }), ['STATUS.json']);
+ const status = JSON.parse(read(dir, 'STATUS.json'));
+ assert.strictEqual(status.shared, 'openvibe-shared v2.17.0');
+ assert.deepStrictEqual(status.packages, ['openvibe-publishing v1.3.0', 'openvibe-shared v2.17.0', 'openvibe-sdk v0.37.0 (not pinned here)', 'something else'], 'pinned entries follow, the rest stay');
+ assert.deepStrictEqual(update(dir, { today: '2026-10-10' }), [], 'a rerun writes nothing');
+ fs.rmSync(dir, { recursive: true, force: true });
+}
console.log('docs-status: all checks passed');
console.log('docs-status: all checks passed');