mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
The 1.0.0 release of the package was broken end-to-end:
1. index.js re-exported from "./index.ts" — Node can't import .ts at runtime,
so any consumer who `npm install`ed the package got ERR_UNKNOWN_FILE_EXTENSION.
2. The emitted provider shape did not match the OpenCode schema
(https://opencode.ai/config.json). It used a custom `{id, name, npm, options, auth}`
instead of the schema's `{npm: "@ai-sdk/openai-compatible", name, options, models}`.
3. README told users to pass `baseURL: "http://localhost:20128/v1"` but the code
appended `/v1` again — every request would 404 at `/v1/v1/...`.
4. No build step, no LICENSE file, no repository/author/engines fields, no tests.
This rewrite:
- Moves source under `src/`, adds a tsup build emitting CJS + ESM + .d.ts.
- `createOmniRouteProvider` now returns a schema-valid entry with
`npm: "@ai-sdk/openai-compatible"` + `models: Record<string, { name }>`.
- Adds `buildOmniRouteOpenCodeConfig` for full-document scaffolding.
- `normalizeBaseURL` deduplicates trailing `/` and `/v1`, accepts both forms,
and rejects malformed URLs and empty inputs.
- 13 unit tests covering URL normalisation, input validation, default model
catalog, custom models + labels, dedup/trim behaviour, and JSON round-trip.
- Adds LICENSE, full package.json (repository, engines, scripts, exports),
.gitignore, .npmignore, tsconfig.json, and a comprehensive README.
- Resets version to 0.1.0 to signal the pre-1.0 reset (1.0.0 was never on npm).
Documentation:
- New `docs/frameworks/OPENCODE.md` covering both integration paths (CLI vs npm),
URL normalisation, auth modes, troubleshooting, and runtime flow.
- README.md links the package and points to the new doc.
- CHANGELOG entry under Unreleased > Changed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
104 lines
1.4 KiB
Plaintext
104 lines
1.4 KiB
Plaintext
# Database files - NEVER publish
|
|
data/
|
|
**/data/
|
|
**/db.json
|
|
|
|
# VS Code extension test runtime (large binary, not needed in npm package)
|
|
app/vscode-extension/
|
|
**/data/
|
|
**/db.json
|
|
|
|
# Source code (pre-built app/ is published instead)
|
|
src/
|
|
open-sse/
|
|
docs/
|
|
tests/
|
|
cloud/
|
|
images/
|
|
logs/
|
|
scripts/
|
|
|
|
# Config/dev files
|
|
*.md
|
|
!README.md
|
|
.gitignore
|
|
.git/
|
|
.github/
|
|
.husky/
|
|
.vscode/
|
|
.agents/
|
|
.env*
|
|
app/.env
|
|
app/.env*
|
|
eslint.config.mjs
|
|
prettier.config.mjs
|
|
postcss.config.mjs
|
|
next.config.mjs
|
|
tsconfig.json
|
|
tsconfig.typecheck-core.json
|
|
tsconfig.typecheck-noimplicit-core.json
|
|
playwright.config.ts
|
|
vitest.config.ts
|
|
next-env.d.ts
|
|
llm.txt
|
|
|
|
# Docker
|
|
docker-compose*.yml
|
|
Dockerfile
|
|
.dockerignore
|
|
|
|
# Misc
|
|
AGENTS.md
|
|
bun.lock
|
|
|
|
# Build artifacts (pre-built goes inside app/)
|
|
/.next/
|
|
/node_modules/
|
|
|
|
# Ignore large binary files and other build directories
|
|
*.tgz
|
|
*.AppImage
|
|
*.deb
|
|
*.rpm
|
|
electron/
|
|
app/electron/
|
|
app/vscode-extension/
|
|
|
|
# Subprojects
|
|
clipr/
|
|
omnirouteCloud/
|
|
omnirouteSite/
|
|
vscode-extension/
|
|
|
|
# Root-level underscore-prefixed directories (private/draft — never publish)
|
|
/_*/
|
|
app/_*/
|
|
app/coverage/
|
|
app/logs/
|
|
app/tests/
|
|
|
|
# Consistent with .gitignore and .dockerignore
|
|
.DS_Store
|
|
.idea/
|
|
.config/
|
|
.data/
|
|
.omnivscodeagent/
|
|
.omc/
|
|
*.sqlite-*
|
|
*.tsbuildinfo
|
|
security-analysis/
|
|
.analysis/
|
|
antigravity-manager-analysis/
|
|
.sisyphus/
|
|
.plans/
|
|
app.__qa_backup/
|
|
.app-build-backup-*/
|
|
.gitnexus
|
|
.worktrees
|
|
.next-playwright/
|
|
test-results/
|
|
playwright-report/
|
|
blob-report/
|
|
coverage/
|
|
@omniroute/
|