opencode-git-plugin 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/dist/tui.js +2123 -0
- package/package.json +5 -4
- package/src/config/constants.ts +0 -16
- package/src/config/index.ts +0 -2
- package/src/config/options.ts +0 -8
- package/src/diff/body.tsx +0 -90
- package/src/diff/header.tsx +0 -77
- package/src/diff/index.ts +0 -2
- package/src/diff/keymap.ts +0 -113
- package/src/diff/open-diff.ts +0 -57
- package/src/diff/panel.tsx +0 -156
- package/src/diff/search.tsx +0 -38
- package/src/git/diff-parse.ts +0 -35
- package/src/git/index.ts +0 -3
- package/src/git/porcelain.ts +0 -10
- package/src/git/runner.ts +0 -45
- package/src/sidebar/file-list.tsx +0 -47
- package/src/sidebar/focus.tsx +0 -37
- package/src/sidebar/header.tsx +0 -55
- package/src/sidebar/index.ts +0 -1
- package/src/sidebar/keymap.ts +0 -143
- package/src/sidebar/list-navigation.tsx +0 -96
- package/src/sidebar/staging.tsx +0 -108
- package/src/sidebar/status.tsx +0 -29
- package/src/sidebar/view.tsx +0 -159
- package/src/sidebar/working-copy.tsx +0 -81
- package/src/state/diff-store.ts +0 -34
- package/src/state/index.ts +0 -1
- package/src/tui.tsx +0 -25
- package/src/types.ts +0 -63
- package/src/ui/format.ts +0 -67
- package/src/ui/index.ts +0 -2
- package/src/ui/syntax.ts +0 -61
- package/tui.ts +0 -1
package/README.md
CHANGED
|
@@ -82,6 +82,7 @@ Do not add the plugin to `opencode.json(c)`; that file is for server plugins and
|
|
|
82
82
|
| Option | Type | Default | Description |
|
|
83
83
|
| --- | --- | --- | --- |
|
|
84
84
|
| `intervalMs` | `number` | `4000` | Refresh interval in milliseconds; values below `1000` are clamped. |
|
|
85
|
+
| `folderTree` | `string` | `"none"` | File list style: `"none"` (full paths), `"comfortable"` (indented tree, 2 cols/level), `"compact"` (tree, 1 col/level), or `"minimal"` (plain indentation). |
|
|
85
86
|
|
|
86
87
|
## Usage
|
|
87
88
|
|
|
@@ -92,6 +93,7 @@ Do not add the plugin to `opencode.json(c)`; that file is for server plugins and
|
|
|
92
93
|
- Click a row to open its diff; click the branch name to enter stage mode (every clicked file toggles staged/unstaged; branch click or `ESC` exits)
|
|
93
94
|
- Clicking the prompt input exits list mode so typing is never hijacked
|
|
94
95
|
- Staging also via palette (`Git Panel: Stage/Unstage File`)
|
|
96
|
+
- With `folderTree` enabled, clicking a folder collapses/expands it; in stage mode, clicking a folder stages/unstages everything inside it (unstages only when all of its files are already staged)
|
|
95
97
|
|
|
96
98
|
### Diff panel
|
|
97
99
|
|
|
@@ -110,7 +112,7 @@ Do not add the plugin to `opencode.json(c)`; that file is for server plugins and
|
|
|
110
112
|
|
|
111
113
|
- `Loading…` while fetching
|
|
112
114
|
- `Working tree clean` when there is nothing to show (header stats hidden)
|
|
113
|
-
- `Empty repo — no commits yet` before the first commit
|
|
115
|
+
- `Empty repo — no commits yet` before the first commit when nothing is staged or untracked (files still list normally once they exist)
|
|
114
116
|
- `Not a git repository` outside a repo, plus raw fetch errors
|
|
115
117
|
|
|
116
118
|
## Development
|
|
@@ -118,12 +120,15 @@ Do not add the plugin to `opencode.json(c)`; that file is for server plugins and
|
|
|
118
120
|
```sh
|
|
119
121
|
bun install
|
|
120
122
|
bun run check
|
|
123
|
+
bun run build
|
|
121
124
|
npm pack --dry-run
|
|
122
125
|
```
|
|
123
126
|
|
|
124
|
-
The package exposes
|
|
127
|
+
The published package exposes `./tui` as `dist/tui.js`, compiled by `bun run build` with the OpenTUI Solid transform. OpenCode does not compile JSX inside `node_modules`, so shipping raw `.tsx` makes the panel fail to render once installed from npm. `npm pack` and `npm publish` run the build automatically.
|
|
125
128
|
|
|
126
|
-
|
|
129
|
+
A local directory plugin is resolved as `<dir>/tui`, so local development loads `tui.ts` at the repository root, which re-exports `src/tui.tsx` and is compiled by OpenCode on the fly.
|
|
130
|
+
|
|
131
|
+
Any module that imports runtime values from `solid-js` (`createSignal`, `createMemo`, `onCleanup`, …) must be a `.tsx` file. For local plugins OpenCode only applies its Solid transform to `.jsx`/`.tsx` files; in a `.ts` file the import loads a second Solid instance and the UI stops updating. A test enforces this.
|
|
127
132
|
|
|
128
133
|
Before publishing, test the packed tarball rather than the working directory:
|
|
129
134
|
|