mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
chore: drop npm and Prettier tooling
Remove package.json, package-lock.json, .prettierrc.json and .prettierignore. CI no longer installs npm dependencies or runs the Prettier check; the WebUI syntax check now calls `node --check webui/app.js` directly. Docs and .gitignore are updated to match.
This commit is contained in:
1 parent
feb4b18d26
commit
0973fb83e6
9 files changed
+10
-85
No files matched your search
@@ -44,8 +44,6 @@ jobs:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: npm
|
||||
- run: npm ci --ignore-scripts
|
||||
- name: Check Go formatting
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -54,7 +52,7 @@ jobs:
|
||||
printf '%s\n' "$unformatted"
|
||||
exit 1
|
||||
fi
|
||||
- run: npm run format:check
|
||||
- run: npm run check:web
|
||||
- name: Check WebUI syntax
|
||||
run: node --check webui/app.js
|
||||
- name: Check container entrypoint syntax
|
||||
run: sh -n docker-entrypoint.sh
|
||||
@@ -10,7 +10,6 @@ opencode/
|
||||
.tmp/
|
||||
.gocache/
|
||||
*.models.catalog.json
|
||||
node_modules/
|
||||
coverage.out
|
||||
*.test
|
||||
*.test.exe
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
node_modules/
|
||||
dist/
|
||||
build/
|
||||
.tmp/
|
||||
.gocache/
|
||||
config.json
|
||||
config.json.bak
|
||||
*.models.dev.json
|
||||
*.models.catalog.json
|
||||
coverage.out
|
||||
package-lock.json
|
||||
|
||||
.local/
|
||||
*.rotation.json
|
||||
*.availability.json
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "all",
|
||||
"proseWrap": "preserve",
|
||||
"endOfLine": "lf"
|
||||
}
|
||||
@@ -458,16 +458,13 @@ go build -o opencode2api ./cmd/opencode2api
|
||||
|
||||
For local development, start the service with `go run ./cmd/opencode2api -config config.json`. Release builds still inject the version with `-ldflags "-X main.version=vX.Y.Z"`.
|
||||
|
||||
Node.js is only needed for development formatting and JavaScript syntax checks:
|
||||
Node.js is only needed for the WebUI JavaScript syntax check:
|
||||
|
||||
```bash
|
||||
npm ci --ignore-scripts
|
||||
npm run format
|
||||
npm run format:check
|
||||
npm run check:web
|
||||
node --check webui/app.js
|
||||
```
|
||||
|
||||
`.editorconfig`, `.gitattributes`, Go formatting, and pinned Prettier settings standardize the source. CI runs `go vet` and builds with Go 1.24 and stable Go on Linux/Windows, plus formatting, WebUI syntax, and entrypoint shell syntax checks. Release archives include both READMEs.
|
||||
`.editorconfig`, `.gitattributes`, and Go formatting standardize the source. CI runs `go vet` and builds with Go 1.24 and stable Go on Linux/Windows, plus Go formatting, WebUI syntax, and entrypoint shell syntax checks. Release archives include both READMEs.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
||||
+3
-6
@@ -453,16 +453,13 @@ go build -o opencode2api ./cmd/opencode2api
|
||||
|
||||
开发时可以直接运行 `go run ./cmd/opencode2api -config config.json`。发布构建仍通过 `-ldflags "-X main.version=vX.Y.Z"` 注入版本号。
|
||||
|
||||
Node.js 仅用于开发时的格式化和 JavaScript 语法检查:
|
||||
Node.js 仅用于 WebUI 的 JavaScript 语法检查:
|
||||
|
||||
```bash
|
||||
npm ci --ignore-scripts
|
||||
npm run format
|
||||
npm run format:check
|
||||
npm run check:web
|
||||
node --check webui/app.js
|
||||
```
|
||||
|
||||
项目通过 `.editorconfig`、`.gitattributes`、Go 格式化和固定版本的 Prettier 统一格式。CI 覆盖 Linux / Windows 上的 Go 1.24 与稳定版 Go 的 `go vet` 和构建,以及格式、WebUI 语法和容器入口脚本语法检查。发布压缩包包含中英文两份 README。
|
||||
项目通过 `.editorconfig`、`.gitattributes` 和 Go 格式化统一格式。CI 覆盖 Linux / Windows 上的 Go 1.24 与稳定版 Go 的 `go vet` 和构建,以及 Go 格式、WebUI 语法和容器入口脚本语法检查。发布压缩包包含中英文两份 README。
|
||||
|
||||
## 常见问题
|
||||
|
||||
|
||||
@@ -32,8 +32,7 @@
|
||||
go test ./...
|
||||
go test -race ./...
|
||||
go vet ./...
|
||||
npm run check:web
|
||||
npx prettier --check webui/index.html webui/app.js webui/styles.css
|
||||
node --check webui/app.js
|
||||
go build -trimpath -o opencode2api ./cmd/opencode2api
|
||||
```
|
||||
|
||||
@@ -81,7 +80,7 @@ Messages,以及这三种协议的流式输出。真实模型 ID 的原有调
|
||||
- `POST /api/rotation/current`:`{"group":"sota","model":"glm-5.3"}`;立即
|
||||
修改当前模型并解除该模型的临时暂停。
|
||||
|
||||
验证:`go test -race ./...`、`go vet ./...`、`npm run check:web`。
|
||||
验证:`go test -race ./...`、`go vet ./...`、`node --check webui/app.js`。
|
||||
模拟上游测试覆盖 9 次普通错误上限、超过 3 个额度跳过、混合错误预算、
|
||||
Retry-After、单个模型故障不影响 Key、三种入口协议的跨协议转换、成功保持、
|
||||
别名发现与用量归属、畸形响应、输出前错误、首个输出超时、输出后故障、
|
||||
|
||||
Generated
-29
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"name": "opencode2api-dev",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "opencode2api-dev",
|
||||
"devDependencies": {
|
||||
"prettier": "3.9.6"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.9.6",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz",
|
||||
"integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"name": "opencode2api-dev",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"format": "prettier --write .",
|
||||
"format:check": "prettier --check .",
|
||||
"check:web": "node --check webui/app.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "3.9.6"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user