# 开发与发布 项目仓库:[sh1robana/dsh-plugin-message-edit](https://github.com/sh1robana/dsh-plugin-message-edit)。首个正式版本为 `0.3.0`。本页说明流程;上线状态以 npm 页面、GitHub Release 和市场实际条目为准。 ## 构建安装包 需要 Node.js 24 或以上。安装开发依赖后执行: ```sh npm ci npm run build npm test npm pack --ignore-scripts --pack-destination artifacts ``` 先创建 `artifacts` 目录。安装包包含已构建的宿主与客户端、README、许可、构建指纹及演示截图,不包含本机配置、会话或备份。GitHub Release 的安装包名称固定为 `dsh-plugin-message-edit-0.3.0.tgz`。 官方宿主包的开发依赖和 peerDependencies 已固定,兼容范围为实际验证的 `0.2.0-rc.2`。改名、改版本或改源码后都需要重新构建、测试和打包。 ## GitHub 1. 使用维护者账号创建公开仓库,添加 `dsh-plugin` topic。 2. 核对 `package.json` 的 `repository`、`homepage`、`bugs` 和贡献者指向实际项目与 GitHub 公开名称。 3. 推送源码,保留上游来源与许可。不要推送 `.inspection`、`.local-backups`、`.dsh`、`node_modules` 或个人会话截图。 4. 创建 `v0.3.0` Release,附上测试通过的 `.tgz`,核对下载内容。安装时将 Release 附件的完整链接交给 `dsh plugin add`。 GitHub CLI 可以通过 `gh auth login --hostname github.com --git-protocol https --web` 登录。账号认证由维护者本人完成。 ## npm `dsh-plugin-message-edit` 的无作用域包名已被其他维护者占用。npm 包使用维护者的作用域 `@sh1robana/dsh-plugin-message-edit`;GitHub 仓库名称不受影响。 使用实际维护者的 npm 账号完成官方网页登录: ```sh npm login --auth-type=web --registry https://registry.npmjs.org/ npm whoami ``` 包名已经同步到 manifest、锁文件、补丁、构建配置和 README。重新构建、测试、打包后,使用检查过的安装包执行 `npm publish artifacts/dsh-plugin-message-edit-0.3.0.tgz --access public --tag latest`。 网页登录或发布的双重验证由账号持有人完成,不需要向协作者提供密码或长期令牌。发布后核对 `npm view @sh1robana/dsh-plugin-message-edit@0.3.0 version dist.integrity repository`,再用干净的测试 profile 验证从 registry 拉取。 参考:[npm 作用域公共包发布说明](https://docs.npmjs.com/creating-and-publishing-scoped-public-packages/)、[发布双重验证](https://docs.npmjs.com/requiring-2fa-for-package-publishing-and-settings-modification/)。 ## DSH 社区市场 [dsh-market](https://github.com/dsh-market/dsh-market) 使用 [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) 的社区目录。按照其[贡献指南](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/blob/main/contributing.md)投稿: 1. 仓库需真实可用、声明 `dsh.bundle`,且**创建满一天**。 2. 在目录仓库新增 `data/plugins/sh1robana__dsh-plugin-message-edit.yml`,分类使用 `session`。 3. 填写实际仓库地址、英文与中文功能描述,`tarball` 指向 GitHub Release 的 HTTPS `.tgz` 下载链接。本仓库的 `docs/market-entry.yml` 是投稿条目。 4. 提交目录 PR,维护者审核合并后市场再同步;提交成功不等于已经上架。 npm 发布不是市场收录的必要条件。带版本号的安装包使用固定 tag 下载链接;使用 `latest/download` 时应提供文件名固定的安装包。仓库的 `screenshots.json` 声明两张无私人资料的示例截图。 本项目基于原插件继续维护,并增加原地保存、完整附件编辑和编辑输入框等功能;投稿介绍实际差异,避免宣称没有同类插件。 ## 本地更新与验证 源码目录提供 `scripts/install-desktop.ps1`,会先备份配置再调用桌面 CLI;配置备份只保存在本地。迁移旧版时先卸载 `dsh-message-edit`,再安装本项目,避免两个实现重复注册。 安装后彻底退出并重启 DSH。`npm run check:installed` 可检查安装版本和产物哈希;桌面页面的 `__DSH_MESSAGE_EDIT__.diagnostics()` 可核对实际加载的前后端构建。