@koishi-ce/scripts
v1.2.2
Published
Scaffolding and release scripts for Koishi plugin development
Readme
@koishi-ce/scripts
简体中文 | English
Koishi CE 宿主工作区的插件开发与发布 CLI,提供 koishi-scripts 命令。面向「宿主项目 external/ 目录下的第三方插件项目」的日常开发:创建、克隆、构建与发布,均在宿主工作区内完成;另含宿主依赖的白名单安全更新。
子命令
| 命令 | 说明 |
| --- | --- |
| setup [name](别名 create / init / new) | 在 external/ 下初始化插件项目 |
| clone [repo] [name] | 克隆插件仓库到 external/ 并安装依赖 |
| update | 安全更新宿主项目的 @koishi-ce/* 依赖(alias 冻结线与市场安装的第三方插件不受影响;裸 bun update 是全树更新语义,勿用) |
| version | 对 external/ 下有未消费 changeset 的项目执行 changeset version |
| build | 串行构建 external/ 下全部可构建项目,失败即中断 |
| publish [--dry-run] | 校验 registry 与 npm 所有权后,按拓扑序逐包 npm publish,发布时把 workspace 协议改写为真实版本区间 |
setup 的选项:--monorepo, -m(插件集合仓库形态)、--console, -c(附带 client/ 前端扩展)、--name= --desc= --owner=(非交互模式)。交互模式询问包名(自动补 koishi-plugin- 前缀)、描述与 GitHub 所有者。生成的项目自带 TypeScript、tsdown、biome、Changesets 与 git 初始化(不自动提交、不自动安装)。
说明
- 由
create-koishi-ce生成的项目预置本包为 devDependency,并绑定npm run new; - 本包与仓库自身的发布链(
tooling/release)互不相干:后者面向 Koishi-CE monorepo 的 workspace 发布,本命令面向下游宿主项目里的 external 插件。
许可证
MIT,本仓库原创作品,版权归 Koishi-CE 贡献者,见 NOTICE。
English
The plugin development and publishing CLI for Koishi CE host workspaces, providing the koishi-scripts command. It covers the daily workflow of third-party plugin projects living under the external/ directory of a host project: create, clone, build and publish — all inside the host workspace; plus a whitelisted safe update for host dependencies.
Subcommands
| Command | Description |
| --- | --- |
| setup [name] (aliases create / init / new) | Scaffold a plugin project under external/ |
| clone [repo] [name] | Clone a plugin repository into external/ and install dependencies |
| update | Safely update @koishi-ce/* dependencies of the host project (alias freeze lines and market-installed third-party plugins untouched; bare bun update is a whole-tree update, avoid it) |
| version | Run changeset version for external/ projects with pending changesets |
| build | Build all buildable external/ projects serially, aborting on failure |
| publish [--dry-run] | Verify registry state and npm ownership, then publish packages in topological order, rewriting workspace protocols to real version ranges at publish time |
setup options: --monorepo, -m (multi-plugin repository), --console, -c (include a client/ frontend extension), --name= --desc= --owner= (non-interactive). Interactive mode asks for the package name (auto-prefixed with koishi-plugin-), description and GitHub owner. Generated projects ship with TypeScript, tsdown, biome, Changesets and an initialized git repository (no auto-commit, no auto-install).
Notes
- Projects generated by
create-koishi-cepreinstall this package as a devDependency bound tonpm run new. - This package is unrelated to the repository's own release chain (
tooling/release): the latter publishes the Koishi-CE monorepo workspaces, while this CLI serves external plugins inside downstream host projects.
License
MIT, original work of this repository, copyright Koishi-CE contributors — see NOTICE.
