fix(commitinfo): update project metadata and make commit info generation compatible with current tooling

This commit is contained in:
2026-05-01 18:16:09 +00:00
parent 536588f61f
commit 631b346b0a
12 changed files with 4976 additions and 3709 deletions
+32
View File
@@ -0,0 +1,32 @@
import * as fs from 'fs';
import * as path from 'path';
import { tap } from '@git.zone/tstest/tapbundle';
import * as commitinfo from '../ts/index.js';
tap.test('first test', async () => {
const testDir = path.join(process.cwd(), '.nogit', 'commitinfo-test');
fs.rmSync(testDir, { recursive: true, force: true });
fs.mkdirSync(path.join(testDir, 'ts'), { recursive: true });
fs.writeFileSync(
path.join(testDir, 'package.json'),
JSON.stringify(
{
name: '@push.rocks/commitinfo-test',
version: '1.0.0',
description: 'test package',
},
null,
2
)
);
const testCommitinfo = new commitinfo.CommitInfo(testDir, 'patch');
await testCommitinfo.writeIntoPotentialDirs();
const commitInfoFile = fs.readFileSync(path.join(testDir, 'ts', '00_commitinfo_data.ts'), 'utf8');
if (!commitInfoFile.includes("version: '1.0.1'")) {
throw new Error('Expected commitinfo to write the next patch version.');
}
});
export default tap.start();