GeezerVison is showing github.com — ci: improve test coverage · argszero/opencode@4b94d98
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboard +30Lines changed: 30 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +name: test | | 2 | + | | 3 | +on: | | 4 | + push: | | 5 | + branches-ignore: | | 6 | + - production | | 7 | + pull_request: | | 8 | + branches-ignore: | | 9 | + - production | | 10 | + workflow_dispatch: | | 11 | +jobs: | | 12 | + format: | | 13 | + runs-on: ubuntu-latest | | 14 | + steps: | | 15 | + - name: Checkout repository | | 16 | + uses: actions/checkout@v4 | | 17 | + with: | | 18 | + token: ${{ secrets.GITHUB_TOKEN }} | | 19 | + | | 20 | + - name: Setup Bun | | 21 | + uses: oven-sh/setup-bun@v1 | | 22 | + with: | | 23 | + bun-version: 1.2.21 | | 24 | + | | 25 | + - name: run | | 26 | + run: | | | 27 | + bun install | | 28 | + bun turbo test | | 29 | + env: | | 30 | + CI: true |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/package.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | "private": true, | 7 | 7 | "scripts": { | 8 | 8 | "typecheck": "tsc --noEmit", | | 9 | + "test": "bun test", | 9 | 10 | "build": "./script/build.ts", | 10 | 11 | "dev": "bun run --conditions=development ./src/index.ts" | 11 | 12 | }, | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/tool/edit.ts +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -596,13 +596,13 @@ export function replace(content: string, oldString: string, newString: string, r | 596 | 596 | for (const replacer of [ | 597 | 597 | SimpleReplacer, | 598 | 598 | LineTrimmedReplacer, | 599 | | - // BlockAnchorReplacer, | | 599 | + BlockAnchorReplacer, | 600 | 600 | WhitespaceNormalizedReplacer, | 601 | 601 | IndentationFlexibleReplacer, | 602 | 602 | EscapeNormalizedReplacer, | 603 | | - // TrimmedBoundaryReplacer, | 604 | | - // ContextAwareReplacer, | 605 | | - // MultiOccurrenceReplacer, | | 603 | + TrimmedBoundaryReplacer, | | 604 | + ContextAwareReplacer, | | 605 | + MultiOccurrenceReplacer, | 606 | 606 | ]) { | 607 | 607 | for (const search of replacer(content, oldString)) { | 608 | 608 | const index = content.indexOf(search) | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/tool/registry.ts +16-20Lines changed: 16 additions & 20 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -20,25 +20,6 @@ import z from "zod/v4" | 20 | 20 | import { Plugin } from "../plugin" | 21 | 21 |
| 22 | 22 | export namespace ToolRegistry { | 23 | | - // Built-in tools that ship with opencode | 24 | | - function builtin() { | 25 | | - return [ | 26 | | - InvalidTool, | 27 | | - BashTool, | 28 | | - EditTool, | 29 | | - WebFetchTool, | 30 | | - GlobTool, | 31 | | - GrepTool, | 32 | | - ListTool, | 33 | | - PatchTool, | 34 | | - ReadTool, | 35 | | - WriteTool, | 36 | | - TodoWriteTool, | 37 | | - TodoReadTool, | 38 | | - TaskTool, | 39 | | - ] | 40 | | - } | 41 | | - | 42 | 23 | export const state = Instance.state(async () => { | 43 | 24 | const custom = [] as Tool.Info[] | 44 | 25 | const glob = new Bun.Glob("tool/*.{js,ts}") | @@ -93,7 +74,22 @@ export namespace ToolRegistry { | 93 | 74 |
| 94 | 75 | async function all(): Promise<Tool.Info[]> { | 95 | 76 | const custom = await state().then((x) => x.custom) | 96 | | - return [...builtin(), ...custom] | | 77 | + return [ | | 78 | + InvalidTool, | | 79 | + BashTool, | | 80 | + EditTool, | | 81 | + WebFetchTool, | | 82 | + GlobTool, | | 83 | + GrepTool, | | 84 | + ListTool, | | 85 | + PatchTool, | | 86 | + ReadTool, | | 87 | + WriteTool, | | 88 | + TodoWriteTool, | | 89 | + TodoReadTool, | | 90 | + TaskTool, | | 91 | + ...custom, | | 92 | + ] | 97 | 93 | } | 98 | 94 |
| 99 | 95 | export async function ids() { | |
|