sil-openclaw 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Mirror the single source-of-truth version (package.json#version) into
4
- * openclaw.plugin.json#version so the two never drift.
5
- *
6
- * package.json#version is authoritative — `pnpm version <bump>` bumps it,
7
- * and this script copies it into the OpenClaw manifest. Wired into the
8
- * `version` lifecycle (runs inside `pnpm version`, staged into the version
9
- * commit) and re-runnable standalone (`pnpm sync-version`).
10
- *
11
- * Edits only the manifest's `version` string in place — all other bytes
12
- * and formatting are preserved, so the diff is one line. Idempotent (a
13
- * no-op when already in sync) and fail-fast on a non-semver version. The
14
- * version-parity integration test is the guard that keeps this honest.
15
- */
16
-
17
- import { readFileSync, writeFileSync } from "node:fs";
18
- import { resolve, dirname } from "node:path";
19
- import { fileURLToPath } from "node:url";
20
-
21
- const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
22
- const PKG_PATH = resolve(ROOT, "package.json");
23
- const MANIFEST_PATH = resolve(ROOT, "openclaw.plugin.json");
24
-
25
- const SEMVER = /^\d+\.\d+\.\d+(?:-[\w.]+)?$/;
26
-
27
- const version = JSON.parse(readFileSync(PKG_PATH, "utf8")).version;
28
- if (typeof version !== "string" || !SEMVER.test(version)) {
29
- console.error(`[sync-version] refusing to sync non-semver version: ${version}`);
30
- process.exit(1);
31
- }
32
-
33
- const before = readFileSync(MANIFEST_PATH, "utf8");
34
- if (JSON.parse(before).version === version) {
35
- console.log(`[sync-version] openclaw.plugin.json already at ${version}; no change.`);
36
- process.exit(0);
37
- }
38
-
39
- // Replace only the first `"version": "..."` — the top-level manifest field
40
- // (it precedes every nested object in the file). The re-parse below proves
41
- // the edit landed on the right key.
42
- const after = before.replace(/("version"\s*:\s*)"[^"]*"/, `$1"${version}"`);
43
- const reparsed = JSON.parse(after);
44
- if (reparsed.version !== version) {
45
- console.error(
46
- `[sync-version] post-edit manifest version is ${reparsed.version}, expected ${version} — aborting.`,
47
- );
48
- process.exit(1);
49
- }
50
-
51
- writeFileSync(MANIFEST_PATH, after, "utf8");
52
- console.log(`[sync-version] openclaw.plugin.json → ${version}`);