openvibers/openvibe.shared Commits

Shared: docs-status (and so the pin bot) updates a STATUS.json packages list too (#40)

OP OpenVibers committed 9 Oct 2026 · 9ad37b24bc · 2 files, +24 −1

Changes

ddiff --git a/scripts/docs-status.js b/scripts/docs-status.js
iindex ef11440..27f669d 100644
---- a/scripts/docs-status.js
++++ b/scripts/docs-status.js
@@@ -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;
}
ddiff --git a/test/docs-status.test.js b/test/docs-status.test.js
iindex 0145878..8456679 100644
---- a/test/docs-status.test.js
++++ b/test/docs-status.test.js
@@@ -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');