From 0c6d8bb2c50620968b164ac5e2056032dbffe83e Mon Sep 17 00:00:00 2001 From: orion Date: Wed, 25 Feb 2026 14:09:14 +0000 Subject: [PATCH] feat(release): add plugin packaging script and release notes --- .gitignore | 1 + Makefile | 5 ++++- docs/RELEASE.md | 27 +++++++++++++++++++++++++++ scripts/package-plugin.mjs | 15 +++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 docs/RELEASE.md create mode 100644 scripts/package-plugin.mjs diff --git a/.gitignore b/.gitignore index 1625333..fd7d79d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules/ +dist/ .env .DS_Store *.log diff --git a/Makefile b/Makefile index de263ab..87f994c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: check check-rules test-api up down smoke render-config +.PHONY: check check-rules test-api up down smoke render-config package-plugin check: cd plugin && npm run check @@ -20,3 +20,6 @@ smoke: render-config: node scripts/render-openclaw-config.mjs + +package-plugin: + node scripts/package-plugin.mjs diff --git a/docs/RELEASE.md b/docs/RELEASE.md new file mode 100644 index 0000000..6c98b8c --- /dev/null +++ b/docs/RELEASE.md @@ -0,0 +1,27 @@ +# Release / Packaging + +## Package plugin files + +```bash +node scripts/package-plugin.mjs +``` + +Output: + +- `dist/plugin/index.ts` +- `dist/plugin/rules.ts` +- `dist/plugin/openclaw.plugin.json` +- `dist/plugin/README.md` +- `dist/plugin/package.json` + +## Use packaged plugin path + +Point OpenClaw `plugins.load.paths` to: + +`/absolute/path/to/WhisperGate/dist/plugin` + +## Verify package completeness + +```bash +cd plugin && npm run check +``` diff --git a/scripts/package-plugin.mjs b/scripts/package-plugin.mjs new file mode 100644 index 0000000..46e6326 --- /dev/null +++ b/scripts/package-plugin.mjs @@ -0,0 +1,15 @@ +import fs from "node:fs"; +import path from "node:path"; + +const root = process.cwd(); +const pluginDir = path.join(root, "plugin"); +const outDir = path.join(root, "dist", "plugin"); + +fs.rmSync(outDir, { recursive: true, force: true }); +fs.mkdirSync(outDir, { recursive: true }); + +for (const f of ["index.ts", "rules.ts", "openclaw.plugin.json", "README.md", "package.json"]) { + fs.copyFileSync(path.join(pluginDir, f), path.join(outDir, f)); +} + +console.log(`packaged plugin to ${outDir}`);