feat(release): add plugin packaging script and release notes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.env
|
||||
.DS_Store
|
||||
*.log
|
||||
|
||||
5
Makefile
5
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
|
||||
|
||||
27
docs/RELEASE.md
Normal file
27
docs/RELEASE.md
Normal file
@@ -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
|
||||
```
|
||||
15
scripts/package-plugin.mjs
Normal file
15
scripts/package-plugin.mjs
Normal file
@@ -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}`);
|
||||
Reference in New Issue
Block a user