界面迁移更新

This commit is contained in:
2026-09-05 00:12:11 +08:00
parent e2762d631d
commit 0aa66e1ec7
3187 changed files with 667915 additions and 211 deletions
@@ -0,0 +1,36 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { join } from 'node:path';
import { readFileSync, writeFileSync } from 'node:fs';
import { makeTempMonorepo, makeGameProject, cleanup } from './helpers.mjs';
import { bumpVersion } from '../bump-cocos.mjs';
test('bumpVersion 改写各工程 creator.version 并报告 from/to', () => {
const mono = makeTempMonorepo();
try {
const a = makeGameProject(mono.games, 'a', '3.8.8');
const changed = bumpVersion([mono.host, a], '3.8.9');
assert.equal(changed.length, 2);
assert.equal(changed[1].from, '3.8.8');
assert.equal(changed[1].to, '3.8.9');
const pkgA = JSON.parse(readFileSync(join(a, 'package.json'), 'utf8'));
assert.equal(pkgA.creator.version, '3.8.9');
const pkgHost = JSON.parse(readFileSync(join(mono.host, 'package.json'), 'utf8'));
assert.equal(pkgHost.creator.version, '3.8.9');
} finally {
cleanup(mono.root);
}
});
test('bumpVersion 对缺 creator 字段的工程补建后写入', () => {
const mono = makeTempMonorepo();
try {
const a = makeGameProject(mono.games, 'a', '3.8.8');
writeFileSync(join(a, 'package.json'), JSON.stringify({ name: 'a' }));
bumpVersion([a], '3.8.9');
const pkgA = JSON.parse(readFileSync(join(a, 'package.json'), 'utf8'));
assert.equal(pkgA.creator.version, '3.8.9');
} finally {
cleanup(mono.root);
}
});