Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 21 additions & 16 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
## 改动说明
## Summary / 改动说明

<!-- What this PR does and why. For a new plugin, clearly explain the problem it solves. -->
<!-- 这个 PR 做了什么、为什么要做。新插件请写清楚它解决什么问题。 -->

## 涉及的插件
## Affected Plugins / 涉及的插件

<!-- Plugin ID and version change, e.g., my-tool 1.0.0 -> 1.1.0, or "New plugin". Write "None" if only changing tooling. -->
<!-- 插件 ID 与版本变化,例如:my-tool 1.0.0 → 1.1.0;新插件写「新插件」。只改开发工具可写「无」。 -->

## 权限说明
## Permissions / 权限说明

<!-- Explain where each declared permission is used; for network access, list target domains and purposes. Write "No change" if unchanged. -->
<!-- 每个声明的权限用在哪里;用了网络请写明请求的域名和用途。没有新增权限可写「无变化」。 -->

## 验证
## Verification / 验证

验证过的系统:<!-- 例如 Windows 11 x64 / macOS 15 Apple Silicon,与 targets 一致 -->
Tested OS / 验证过的系统:<!-- e.g., Windows 11 x64 / macOS 15 Apple Silicon, matching targets -->

运行过的检查:
Checks run / 运行过的检查:

- [ ] `node scripts/build-declarative.mjs <id>`
- [ ] `node scripts/scan-plugin-security.mjs extensions/<id>`
- [ ] `node --test extensions/<id>/tests/*.test.mjs`
- [ ] `node scripts/verify-changed-plugins.mjs --base refs/remotes/upstream/main`

在客户端里试用过:
Verified in the ZTools client / 在客户端里试用过:

- [ ] 正常操作
- [ ] 空结果
- [ ] 出错或无权限时的提示
- [ ] Normal flow / 正常操作
- [ ] Empty state / 空结果
- [ ] Error or missing-permission feedback / 出错或无权限时的提示

## 检查清单
## Checklist / 检查清单

- [ ] 按[作者署名](https://github.com/ZToolsTeam/ZTools-extensions/blob/main/docs/publishing.md#作者署名)填写 `author`;社区新插件署名本人或实际团队,参与已有插件保留原署名
- [ ] 按 [界面规范](https://github.com/ZToolsTeam/ZTools-extensions/blob/main/docs/ui-guidelines.md#提交前自检) 做完「提交前自检」6 条
- [ ] 修改已有插件时升高了 `version`
- [ ] `targets` 只包含实际测试过的平台
- [ ] 没有提交 `dist/`、本机路径、凭据或日志里的个人信息
- [ ] `author` follows [Author Attribution](https://github.com/ZToolsTeam/ZTools-extensions/blob/main/docs/en/publishing.md#author-attribution) ([作者署名](https://github.com/ZToolsTeam/ZTools-extensions/blob/main/docs/publishing.md#作者署名)): use your GitHub handle or real team name for new community plugins; keep original attribution when updating existing plugins
- [ ] Passed all 6 items in the [UI Guidelines Pre-Submit Checklist](https://github.com/ZToolsTeam/ZTools-extensions/blob/main/docs/en/ui-guidelines.md#pre-submit-checklist) ([界面规范 · 提交前自检](https://github.com/ZToolsTeam/ZTools-extensions/blob/main/docs/ui-guidelines.md#提交前自检))
- [ ] Bumped `version` when modifying an existing plugin / 修改已有插件时升高了 `version`
- [ ] `targets` includes only platforms actually tested / `targets` 只包含实际测试过的平台
- [ ] No `dist/`, local paths, credentials, or personal data committed / 没有提交 `dist/`、本机路径、凭据或日志里的个人信息

<!-- Note: After the PR is merged, the official team publishes approved plugins to the plugin marketplace. / 说明:PR 合并后由官方发布到插件市场。 -->
44 changes: 23 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
# 贡献指南
**English** | [简体中文](CONTRIBUTING.zh-CN.md)

欢迎通过 Issue 和 Pull Request 改进插件与开发工具。第一次写插件请先看 [开发入门](docs/getting-started.md)。
# Contributing Guide

## 提交前检查清单
Issues and Pull Requests that improve plugins or developer tooling are welcome. If this is your first plugin, start with [Getting Started](docs/en/getting-started.md).

- [ ] 插件放在 `extensions/<id>/`,目录名与 `plugin.json` 的 `id` 一致,ID 不与已有插件重复。
- [ ] `author` 按[作者署名](docs/publishing.md#作者署名)填写:社区新插件推荐 GitHub 用户名,不加 `ZTools Community`;参与已有插件保留原署名。
- [ ] 提交了 `src/`、清单、图标和测试;没有提交 `dist/`、本机路径、凭据或构建缓存。
- [ ] 界面只用 `@ztools/declarative-ui` 组件,按 [界面规范](docs/ui-guidelines.md) 做完「提交前自检」6 条。
- [ ] 只声明用到的权限,并在 PR 里说明每个权限的用途([权限说明](docs/api.md#权限))。
- [ ] `targets` 只写实际测试过的平台,并在那些平台的 ZTools 客户端里试用过正常、空结果和出错三种情况([试用方法](docs/getting-started.md#7-在-ztools-客户端里试用))。
- [ ] 修改已有插件时升高了 `version`;没做完的标了 `draft`;要下架的写 `revoked` 而不是删目录([发布规则](docs/publishing.md))。
- [ ] 复制了 `extensions/shared/` 里的文件时,副本与原文件一致。
- [ ] 本地跑过下面的检查并全部通过。
## Pre-Submit Checklist

审核人员会看什么见 [审核标准](docs/review.md)。
- [ ] Plugin lives in `extensions/<id>/`, directory name matches `plugin.json` `id`, and the ID is unique across the repository.
- [ ] `author` follows [Author Attribution](docs/en/publishing.md#author-attribution): use your GitHub username (or real team name) for new community plugins without `ZTools Community`; preserve the original author when contributing to an existing plugin.
- [ ] Committed `src/`, manifest, icon, and tests; excluded `dist/`, local machine paths, credentials, and build caches.
- [ ] UI uses only `@ztools/declarative-ui` components and passes all 6 items in the [UI Guidelines Pre-Submit Checklist](docs/en/ui-guidelines.md#pre-submit-checklist).
- [ ] Declared only required permissions and documented each permission's purpose in the PR ([Permissions](docs/en/api.md#permissions)).
- [ ] `targets` lists only platforms actually tested, and normal, empty, and error states were verified in the real ZTools client on each target OS ([Try in ZTools](docs/en/getting-started.md#7-try-it-in-the-ztools-client)).
- [ ] Bumped `version` when modifying an existing plugin; marked unfinished work with `draft`; used `revoked` instead of deleting a plugin directory ([Publishing Guide](docs/en/publishing.md)).
- [ ] Any file copied from `extensions/shared/` matches the original verbatim.
- [ ] All local checks below pass.

## 本地检查
See [Review Standards](docs/en/review.md) for what maintainers check during review.

开发中针对单个插件:
## Local Verification

For a single plugin during development:

```bash
node scripts/build-declarative.mjs <id>
node scripts/scan-plugin-security.mjs extensions/<id>
node --test extensions/<id>/tests/*.test.mjs
```

提交到自己的分支后,运行和 CI 相同的合并前检查:
After committing to your branch, run the same pre-merge checks that CI runs:

```bash
# 把官方 main 拉到本地 refs/remotes/upstream/main(Fork 仓库也可以用)
# Fetch upstream main to refs/remotes/upstream/main (works in forks too)
git fetch https://github.com/ZToolsTeam/ZTools-extensions.git main:refs/remotes/upstream/main
node scripts/verify-changed-plugins.mjs --base refs/remotes/upstream/main
node --test packages/ztools-plugins-spec/tests/*.test.mjs
```

`verify-changed-plugins.mjs` 只看已提交的改动,先提交、保持工作区干净再运行,详见 [发布规则 · 合并前检查](docs/publishing.md#合并前检查)。
`verify-changed-plugins.mjs` inspects committed diffs only—commit your changes and keep the working tree clean before running it. See [Pre-Merge Checks](docs/en/publishing.md#pre-merge-checks).

## 提交 Pull Request
## Submitting a Pull Request

按 PR 模板填写:改了什么、涉及哪些插件、在哪些系统上验证过、运行了哪些检查、为什么需要这些权限。维护者审核通过后合并,PR 合并后由官方发布到插件市场。
Fill out the PR template: what changed, affected plugins, tested platforms, checks executed, and why each permission is needed. Once approved and merged by maintainers, the official team publishes the release to the plugin marketplace.

改的是开发工具(`scripts/`、`packages/`)时,CI 会重新检查全部插件,请在 PR 里说明影响范围。客户端本身的问题请到 [ZTools 仓库](https://github.com/ZToolsTeam/ZTools) 提交。
If your PR modifies shared tooling (`scripts/`, `packages/`), CI re-verifies every plugin—clearly describe the blast radius in your PR. For desktop client bugs, submit them to the [ZTools repository](https://github.com/ZToolsTeam/ZTools).
46 changes: 46 additions & 0 deletions CONTRIBUTING.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[English](CONTRIBUTING.md) | **简体中文**

# 贡献指南

欢迎通过 Issue 和 Pull Request 改进插件与开发工具。第一次写插件请先看 [开发入门](docs/getting-started.md)。

## 提交前检查清单

- [ ] 插件放在 `extensions/<id>/`,目录名与 `plugin.json` 的 `id` 一致,ID 不与已有插件重复。
- [ ] `author` 按[作者署名](docs/publishing.md#作者署名)填写:社区新插件推荐 GitHub 用户名,不加 `ZTools Community`;参与已有插件保留原署名。
- [ ] 提交了 `src/`、清单、图标和测试;没有提交 `dist/`、本机路径、凭据或构建缓存。
- [ ] 界面只用 `@ztools/declarative-ui` 组件,按 [界面规范](docs/ui-guidelines.md) 做完「提交前自检」6 条。
- [ ] 只声明用到的权限,并在 PR 里说明每个权限的用途([权限说明](docs/api.md#权限))。
- [ ] `targets` 只写实际测试过的平台,并在那些平台的 ZTools 客户端里试用过正常、空结果和出错三种情况([试用方法](docs/getting-started.md#7-在-ztools-客户端里试用))。
- [ ] 修改已有插件时升高了 `version`;没做完的标了 `draft`;要下架的写 `revoked` 而不是删目录([发布规则](docs/publishing.md))。
- [ ] 复制了 `extensions/shared/` 里的文件时,副本与原文件一致。
- [ ] 本地跑过下面的检查并全部通过。

审核人员会看什么见 [审核标准](docs/review.md)。

## 本地检查

开发中针对单个插件:

```bash
node scripts/build-declarative.mjs <id>
node scripts/scan-plugin-security.mjs extensions/<id>
node --test extensions/<id>/tests/*.test.mjs
```

提交到自己的分支后,运行和 CI 相同的合并前检查:

```bash
# 把官方 main 拉到本地 refs/remotes/upstream/main(Fork 仓库也可以用)
git fetch https://github.com/ZToolsTeam/ZTools-extensions.git main:refs/remotes/upstream/main
node scripts/verify-changed-plugins.mjs --base refs/remotes/upstream/main
node --test packages/ztools-plugins-spec/tests/*.test.mjs
```

`verify-changed-plugins.mjs` 只看已提交的改动,先提交、保持工作区干净再运行,详见 [发布规则 · 合并前检查](docs/publishing.md#合并前检查)。

## 提交 Pull Request

按 PR 模板填写:改了什么、涉及哪些插件、在哪些系统上验证过、运行了哪些检查、为什么需要这些权限。维护者审核通过后合并,PR 合并后由官方发布到插件市场。

改的是开发工具(`scripts/`、`packages/`)时,CI 会重新检查全部插件,请在 PR 里说明影响范围。客户端本身的问题请到 [ZTools 仓库](https://github.com/ZToolsTeam/ZTools) 提交。
88 changes: 46 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,84 @@

<h1 align="center">ZTools Extensions</h1>

<p align="center">ZTools 插件源码与开发工具</p>
<p align="center">Plugin source code and developer tooling for ZTools</p>

<p align="center">
<a href="https://www.ztools.cn">官网</a> ·
<a href="https://github.com/ZToolsTeam/ZTools/releases">下载 ZTools</a> ·
<a href="https://github.com/ZToolsTeam/ZTools">客户端源码</a> ·
<a href="https://github.com/ZToolsTeam/ZTools-extensions/issues">插件问题</a>
<strong>English</strong> | <a href="README.zh-CN.md">简体中文</a>
</p>

本仓库存放:
<p align="center">
<a href="https://www.ztools.cn">Website</a> ·
<a href="https://github.com/ZToolsTeam/ZTools/releases">Download ZTools</a> ·
<a href="https://github.com/ZToolsTeam/ZTools">Client Source</a> ·
<a href="https://github.com/ZToolsTeam/ZTools-extensions/issues">Plugin Issues</a>
</p>

This repository hosts:

- ZTools 插件的源码
- 开发插件要用的 SDK、脚手架、构建和检查脚本
- Source code for ZTools plugins (with built-in English & Simplified Chinese localization support)
- The SDK, scaffolding, build, and security verification scripts for developing plugins

插件用 `List`、`Detail`、`Form`、`ActionPanel` 等声明式组件描述界面,由 ZTools 客户端负责渲染和提供系统能力。
Plugins declare their UI with `List`, `Detail`, `Form`, `ActionPanel`, and related primitives, while the ZTools desktop client handles rendering, theming, and system capabilities.

> **只想安装插件?**
> **Just want to install plugins?**
>
> 从 [ZTools Releases](https://github.com/ZToolsTeam/ZTools/releases) 下载客户端,在客户端的插件市场里安装。
> Download the desktop client from [ZTools Releases](https://github.com/ZToolsTeam/ZTools/releases) and install plugins directly from the in-app marketplace.
>
> 仓库里有某个插件的源码,不代表它已经在市场上架,能装哪些以插件市场为准。
> Presence of plugin source code in this repository does not mean it is published in the marketplace yet; the in-app marketplace catalog is the source of truth.

## 5 分钟贡献你的首款插件
## Build Your First Plugin in 5 Minutes

准备 Node.js 24 和 Git,然后在终端执行:
With Node.js 24 and Git installed:

```bash
git clone https://github.com/ZToolsTeam/ZTools-extensions.git
cd ZTools-extensions
npm ci --ignore-scripts

# 生成 extensions/my-tool/(一个能直接运行的示例插件)
npm run create-plugin -- my-tool "我的工具" "一句话说明插件做什么" --author "你的名字"
# Scaffold extensions/my-tool/ (a runnable starter plugin)
npm run create-plugin -- my-tool "My Tool" "One-line description of what the plugin does" --author "your-github-handle"

# 编译、检查、测试
# Build, scan, and test
node scripts/build-declarative.mjs my-tool
node scripts/scan-plugin-security.mjs extensions/my-tool
node --test extensions/my-tool/tests/*.test.mjs
```

接下来改 `extensions/my-tool/src/` 实现功能,在 ZTools 客户端里试用,最后提交 Pull Request。每一步怎么做见 [开发入门](docs/getting-started.md)。
Next, implement your logic in `extensions/my-tool/src/`, try it inside the ZTools client, and open a Pull Request. See [Getting Started](docs/en/getting-started.md) for the full walkthrough.

## 文档
## Documentation

| 文档 | 什么时候看 |
| Document | When to Read |
| --- | --- |
| [开发入门](docs/getting-started.md) | 第一次写插件:创建、编译、测试、在客户端里试用、提交 |
| [界面规范](docs/ui-guidelines.md) | 设计界面前:三种标准布局、键盘约定、提交前自检 |
| [API 参考](docs/api.md) | 写代码时:组件与属性、系统能力、可用模块、权限 |
| [审核标准](docs/review.md) | 提交前:官方审核看什么、CI 检查什么 |
| [发布规则](docs/publishing.md) | 改清单或发新版本时:版本号、平台、草稿、下架 |
| [贡献指南](CONTRIBUTING.md) | 提交 Pull Request 前的检查清单 |
| [Getting Started](docs/en/getting-started.md) | First plugin: scaffold, build, test, try in ZTools, submit a PR |
| [UI Guidelines](docs/en/ui-guidelines.md) | Before designing UI: three standard layouts, keyboard model, pre-submit checklist |
| [API Reference](docs/en/api.md) | While coding: components, props, hooks, host APIs, allowed modules, permissions |
| [Review Standards](docs/en/review.md) | Before submitting: what maintainers review and what CI enforces |
| [Publishing Guide](docs/en/publishing.md) | Updating manifests or releasing: versioning, targets, drafts, revocation |
| [Contributing Guide](CONTRIBUTING.md) | Pre-submit checklist and local verification commands |

## 目录结构
## Directory Structure

| 目录 | 内容 |
| Directory | Contents |
| --- | --- |
| [`extensions/`](extensions/) | 每个插件一个目录:清单、源码、图标与测试 |
| [`extensions/shared/`](extensions/shared/) | 插件共用的源码和测试工具;插件里的副本必须与这里一致 |
| [`packages/declarative-ui/`](packages/declarative-ui/) | 编译和测试用的 SDK(类型声明与运行时);用户安装后由客户端提供运行时 |
| [`packages/ztools-plugins-spec/`](packages/ztools-plugins-spec/) | 插件清单的 Schema 与校验器 |
| [`scripts/`](scripts/) | 脚手架、构建、扫描、合并前检查与发布脚本 |
| [`extensions/`](extensions/) | One directory per plugin: manifest, source, icon, and tests |
| [`extensions/shared/`](extensions/shared/) | Shared source and test harness; copies inside plugins must match verbatim |
| [`packages/declarative-ui/`](packages/declarative-ui/) | SDK types and runtime for compilation and testing (at runtime, the client provides the runtime) |
| [`packages/ztools-plugins-spec/`](packages/ztools-plugins-spec/) | `plugin.json` JSON Schema and validator |
| [`scripts/`](scripts/) | Scaffolding, build, security scanner, pre-merge verification, and release scripts |

## 问题反馈
## Reporting Issues

插件或本仓库开发工具的问题请提交到[本仓库 Issues](https://github.com/ZToolsTeam/ZTools-extensions/issues),并注明:
Report plugin or tooling issues in [this repository's Issues](https://github.com/ZToolsTeam/ZTools-extensions/issues) and include:

- 插件 ID 与版本、客户端版本
- 操作系统及架构
- 复现步骤和错误信息
- 源码构建问题:Node.js 版本与执行的命令
- Plugin ID, plugin version, and ZTools client version
- OS and CPU architecture
- Steps to reproduce and error output
- For build issues: Node.js version and exact command run

日志和截图请先去掉个人信息与凭据。客户端本身的问题请提交到 [ZTools Issues](https://github.com/ZToolsTeam/ZTools/issues)。
Remove personal details and credentials from logs or screenshots before posting. For desktop client bugs, report them in [ZTools Issues](https://github.com/ZToolsTeam/ZTools/issues).

## 许可证
## License

本仓库使用 [MIT License](LICENSE)。
This repository is licensed under the [MIT License](LICENSE).
Loading
Loading