Fix Windows installer and build versioning

This commit is contained in:
2026-06-26 22:37:13 -05:00
parent 999f4a13b8
commit 7c006a7bb7
12 changed files with 39 additions and 19 deletions
+6 -4
View File
@@ -8,13 +8,14 @@ const assert = require('node:assert/strict');
const { makeTmpDir, rmrf } = require('./helpers');
const { stampVersion } = require('../../scripts/stamp-version');
test('stampVersion updates package metadata without semver validation', () => {
test('stampVersion splits build labels into package and build versions', () => {
const root = makeTmpDir('stamp-version');
try {
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({
name: 'stepforge',
version: '0.1.0',
private: true,
buildVersion: '0.1.0',
}, null, 2));
fs.writeFileSync(path.join(root, 'package-lock.json'), JSON.stringify({
@@ -35,9 +36,10 @@ test('stampVersion updates package metadata without semver validation', () => {
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
const lock = JSON.parse(fs.readFileSync(path.join(root, 'package-lock.json'), 'utf8'));
assert.equal(pkg.version, '0.3.2.1');
assert.equal(lock.version, '0.3.2.1');
assert.equal(lock.packages[''].version, '0.3.2.1');
assert.equal(pkg.version, '0.3.2');
assert.equal(pkg.buildVersion, '0.3.2.1');
assert.equal(lock.version, '0.3.2');
assert.equal(lock.packages[''].version, '0.3.2');
} finally {
rmrf(root);
}