make the test suite and openapi generator platform-independent

Windows checkouts turned LF into CRLF (core.autocrlf=true), and several
tests plus the openapi generator hardcoded LF or POSIX path separators.
The result was a suite that was green on Linux CI but red on Windows, and
an openapi.json whose /api/hermes/* routes silently disappeared when
generated on Windows.

Pin the repository to LF via .gitattributes, strip shebangs before
Vite's SSR transform, and key route files by their posix path. Add a
manually triggered macOS verification workflow so the same checks run
on a self-hosted macOS runner.
This commit is contained in:
2026-10-20 11:17:34 +08:00
committed by trae-solo-agent
parent 8052bf5781
commit a1fff482bf
20 changed files with 251 additions and 48 deletions
+5 -1
View File
@@ -3,7 +3,11 @@ import { tmpdir } from 'os'
import { join } from 'path'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
describe('Hermes plugin discovery environment', () => {
// 这个用例的假 python 是一段 #!/bin/sh 脚本,验证的是「从 hermes 的 shebang
// 解析出 venv python」这条 POSIX 链路。Windows 没有 shebang 执行语义,
// venv 布局也是 .venv\Scripts\python.exe,这条链路在那边根本不存在,
// 所以在 Windows 上整组跳过,而不是伪造一个假的 Windows 结果。
describe.skipIf(process.platform === 'win32')('Hermes plugin discovery environment', () => {
const originalEnv = { ...process.env }
let tempDir = ''