Skip to content

Commit 8f39d45

Browse files
committed
Use ClawPack for bundle publish
1 parent 025f5c5 commit 8f39d45

4 files changed

Lines changed: 33 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## 0.1.4 - 2026-05-26
44

55
- Published through ClawHub's newer ClawPack npm-pack artifact path.
6-
- Forced package publishing as a `code-plugin` so ClawHub stores the release as `.tgz` instead of legacy zip.
6+
- Kept the existing `bundle-plugin` package family while uploading a `.tgz` ClawPack instead of legacy zip files.
77
- Updated readiness checks and publish wrapper to preserve the npm-pack artifact format.
88

99
## 0.1.3 - 2026-05-26

docs/CLAWHUB_READINESS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Result:
4747
"source": "github:CompleteTech-LLC-AI-Research/openclaw-mautic-plugin@main",
4848
"name": "@completetech/openclaw-mautic-plugin",
4949
"displayName": "Mautic Control",
50-
"family": "code-plugin",
50+
"family": "bundle-plugin",
5151
"version": "0.1.4"
5252
}
5353
```
@@ -66,7 +66,7 @@ Result: passed. ClawHub detected:
6666
{
6767
"name": "@completetech/openclaw-mautic-plugin",
6868
"displayName": "Mautic Control",
69-
"family": "code-plugin",
69+
"family": "bundle-plugin",
7070
"version": "0.1.4"
7171
}
7272
```

scripts/clawhub-package.mjs

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env node
22
import { readFileSync } from "node:fs";
3+
import { mkdtempSync, rmSync } from "node:fs";
34
import { spawnSync } from "node:child_process";
5+
import { tmpdir } from "node:os";
6+
import { join } from "node:path";
47

58
const args = new Set(process.argv.slice(2));
69
const publish = args.has("--publish");
@@ -64,16 +67,39 @@ if (publish) {
6467
}
6568
}
6669

70+
const packDir = mkdtempSync(join(tmpdir(), "mautic-control-clawpack-"));
71+
const packResult = run("npm", [
72+
"exec",
73+
"--yes",
74+
"clawhub",
75+
"--",
76+
"package",
77+
"pack",
78+
".",
79+
"--pack-destination",
80+
packDir,
81+
"--json",
82+
]);
83+
84+
let packed;
85+
try {
86+
packed = JSON.parse(requireSuccess(packResult, "clawhub package pack"));
87+
} catch (error) {
88+
rmSync(packDir, { recursive: true, force: true });
89+
if (error instanceof SyntaxError) {
90+
throw new Error(`clawhub package pack returned invalid JSON:\n${packResult.stdout || ""}${packResult.stderr || ""}`);
91+
}
92+
throw error;
93+
}
94+
6795
const command = [
6896
"exec",
6997
"--yes",
7098
"clawhub",
7199
"--",
72100
"package",
73101
"publish",
74-
".",
75-
"--family",
76-
"code-plugin",
102+
packed.path,
77103
"--source-repo",
78104
sourceRepo,
79105
"--source-commit",
@@ -92,4 +118,5 @@ if (owner) command.push("--owner", owner);
92118
if (changelog) command.push("--changelog", changelog);
93119

94120
const result = run("npm", command, { stdio: "inherit" });
121+
rmSync(packDir, { recursive: true, force: true });
95122
process.exit(result.status ?? 1);

scripts/readiness-check.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ const directDryRun = run("npm", [
5757
"package",
5858
"publish",
5959
sourceRepo,
60-
"--family",
61-
"code-plugin",
6260
"--dry-run",
6361
]);
6462
record("direct GitHub-source ClawHub dry-run passes", directDryRun.status === 0, output(directDryRun));

0 commit comments

Comments
 (0)