Phase 002: rebrand to hermes-ui and consolidate i18n to zh/en
Removes the ekko / hermes-web-ui branding from the whole tree and drops eight locale files, so the project presents one name and one language pair. Data compatibility is deliberate, not accidental: DB filenames, the JWT audience, and skill manifest ownership all still recognise their pre-rename values so existing deployments under ~/.hermes-web-ui keep working without a re-login or a re-injection. scripts/harness-check.mjs now scans for the legacy strings and fails the build on any new occurrence, with an explicit allow-list (and reasons) for the compatibility paths that must keep them.
This commit is contained in:
@@ -22,9 +22,9 @@ async function loadUpdateController(overrides: LoadUpdateControllerOptions = {})
|
||||
const spawn = overrides.spawn ?? vi.fn(() => ({ unref, on: vi.fn() }))
|
||||
const existsSync = overrides.existsSync ?? vi.fn(() => true)
|
||||
const readFileSync = overrides.readFileSync ?? vi.fn(() => JSON.stringify({
|
||||
name: 'hermes-web-ui',
|
||||
name: 'hermes-ui',
|
||||
version: '0.0.0',
|
||||
repository: { url: 'https://github.com/EKKOLearnAI/hermes-studio.git' },
|
||||
repository: { url: 'https://gitea.erhe.top/toor/hermes-ui.git' },
|
||||
}))
|
||||
const appendFileSync = overrides.appendFileSync ?? vi.fn()
|
||||
|
||||
@@ -75,8 +75,8 @@ function getNpmCliPath() {
|
||||
|
||||
function getGlobalCliScript(prefix: string) {
|
||||
return process.platform === 'win32'
|
||||
? join(prefix, 'node_modules', 'hermes-web-ui', 'bin', 'hermes-web-ui.mjs')
|
||||
: join(prefix, 'lib', 'node_modules', 'hermes-web-ui', 'bin', 'hermes-web-ui.mjs')
|
||||
? join(prefix, 'node_modules', 'hermes-ui', 'bin', 'hermes-ui.mjs')
|
||||
: join(prefix, 'lib', 'node_modules', 'hermes-ui', 'bin', 'hermes-ui.mjs')
|
||||
}
|
||||
|
||||
describe('update controller', () => {
|
||||
@@ -123,7 +123,7 @@ describe('update controller', () => {
|
||||
|
||||
expect(mocks.execFileSync).toHaveBeenCalledWith(
|
||||
process.execPath,
|
||||
[npmCli, 'install', '-g', 'hermes-web-ui@latest'],
|
||||
[npmCli, 'install', '-g', 'hermes-ui@latest'],
|
||||
expect.objectContaining({
|
||||
encoding: 'utf-8',
|
||||
timeout: 10 * 60 * 1000,
|
||||
@@ -204,7 +204,7 @@ describe('update controller', () => {
|
||||
|
||||
it('returns a 500 with stderr when installation fails', async () => {
|
||||
const execFileSync = vi.fn((_command: string, args: string[]) => {
|
||||
if (args.includes('install') && args.includes('hermes-web-ui@latest')) {
|
||||
if (args.includes('install') && args.includes('hermes-ui@latest')) {
|
||||
const error = new Error('install failed') as Error & { stderr?: string }
|
||||
error.stderr = 'engine mismatch'
|
||||
throw error
|
||||
@@ -239,7 +239,7 @@ describe('update controller', () => {
|
||||
})
|
||||
|
||||
it('loads preview tags through async git with a short timeout', async () => {
|
||||
process.env.HERMES_WEB_UI_PREVIEW_REPO = 'https://github.com/EKKOLearnAI/hermes-studio'
|
||||
process.env.HERMES_WEB_UI_PREVIEW_REPO = 'https://gitea.erhe.top/toor/hermes-ui'
|
||||
const execFile = vi.fn((_command: string, _args: string[], _options: any, callback: any) => {
|
||||
callback(null, [
|
||||
'ghi789\trefs/tags/v0.6.9',
|
||||
@@ -278,14 +278,14 @@ describe('update controller', () => {
|
||||
})
|
||||
expect(mocks.execFile).toHaveBeenCalledWith(
|
||||
'git',
|
||||
['ls-remote', '--tags', '--refs', 'https://github.com/EKKOLearnAI/hermes-studio.git'],
|
||||
['ls-remote', '--tags', '--refs', 'https://gitea.erhe.top/toor/hermes-ui.git'],
|
||||
expect.objectContaining({ timeout: 8000 }),
|
||||
expect.any(Function),
|
||||
)
|
||||
})
|
||||
|
||||
it('falls back to GitHub API when async git tag loading fails', async () => {
|
||||
process.env.HERMES_WEB_UI_PREVIEW_REPO = 'https://github.com/EKKOLearnAI/hermes-studio'
|
||||
process.env.HERMES_WEB_UI_PREVIEW_REPO = 'https://gitea.erhe.top/toor/hermes-ui'
|
||||
const execFile = vi.fn((_command: string, _args: string[], _options: any, callback: any) => {
|
||||
callback(new Error('git timeout'), '', '')
|
||||
})
|
||||
@@ -328,9 +328,9 @@ describe('update controller', () => {
|
||||
],
|
||||
})
|
||||
expect(fetchMock).toHaveBeenCalledWith(
|
||||
'https://api.github.com/repos/EKKOLearnAI/hermes-studio/tags?per_page=100',
|
||||
'https://gitea.erhe.top/api/v1/repos/toor/hermes-ui/tags?per_page=100',
|
||||
expect.objectContaining({
|
||||
headers: { 'User-Agent': 'hermes-web-ui-preview' },
|
||||
headers: { 'User-Agent': 'hermes-ui-preview' },
|
||||
signal: expect.any(AbortSignal),
|
||||
}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user