Skip to content

Commit 40d3b59

Browse files
committed
docs: update documentation for single-file plugin
Update AGENTS.md and README.md to reflect the single-file, zero-dependency architecture. Bump version to 1.1.0.
1 parent 1e183da commit 40d3b59

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ OpenCode 插件,在 Windows + PowerShell 7 环境下自动为所有 `bash`/`sh
88

99
- **TypeScript** — 源码语言
1010
- **tsup** — 构建工具(ESM 输出)
11+
- **Node.js 内置模块** — 零 npm 运行时依赖
12+
- **tsup** — 构建工具(ESM 输出)
1113
- **@opencode-ai/plugin** — OpenCode 插件 API
1214

1315
## 目录结构
1416

1517
```
1618
src/
17-
├── index.ts # 入口点,导出插件
18-
└── utf8-encoding.ts # 插件实现(tool.execute.before hook)
19+
└── utf8-encoding.ts # 插件源码(单文件,tool.execute.before hook)
1920
dist/ # 构建输出(gitignore)
2021
```
2122

@@ -39,8 +40,8 @@ npm run typecheck # tsc --noEmit 类型检查
3940
## 编码规范
4041

4142
- 使用 `strict` TypeScript 模式
42-
- 导出遵循 `Plugin` 类型签名的具名导出
43-
- 最小依赖:仅 `@opencode-ai/plugin`
43+
- 具名导出 `Utf8EncodingPlugin`
44+
- 零 npm 运行时依赖(仅使用 Node.js 内置模块)
4445
- 日志写入 `$TMP/utf8-plugin.log`(调试用,生产无感)
4546

4647
## 提交规范
@@ -55,5 +56,4 @@ npm run typecheck # tsc --noEmit 类型检查
5556

5657
1. `npm run build` — 构建
5758
2. `npm version <patch|minor|major>` — 版本号
58-
3. `npm publish` — 发布到 npm
59-
4. `git push --follow-tags` — 推送标签
59+
3. `git push --follow-tags` — 推送标签触发 GitHub Actions 自动发布 npm

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![npm version](https://img.shields.io/npm/v/opencode-windows-encoding)](https://www.npmjs.com/package/opencode-windows-encoding)
44
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
55

6-
OpenCode plugin that fixes UTF-8 encoding issues when executing PowerShell commands on Windows.
6+
OpenCode plugin that fixes UTF-8 encoding issues when executing PowerShell commands on Windows. Single-file, zero npm dependencies.
77

88
## The Problem
99

@@ -46,11 +46,12 @@ Or with a specific version:
4646
```jsonc
4747
{
4848
"plugin": [
49-
"opencode-windows-encoding@1.0.0"
49+
"opencode-windows-encoding@^1.1"
5050
]
5151
}
5252
```
5353

54+
After adding the plugin, restart OpenCode. All subsequent shell commands will use UTF-8 encoding automatically.
5455
After adding the plugin, restart OpenCode. All subsequent shell commands will use UTF-8 encoding automatically.
5556

5657
## 本地使用(复制即用)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-windows-encoding",
3-
"version": "1.0.3",
3+
"version": "1.1.0",
44
"description": "OpenCode plugin to fix UTF-8 encoding issues in PowerShell on Windows",
55
"type": "module",
66
"main": "./dist/utf8-encoding.js",

0 commit comments

Comments
 (0)