Fix trailing commas in openclaw.plugin.json and add JSON manifest CI tests (#774)
Fixes #771 — two trailing commas in openclaw.plugin.json caused OpenClaw's strict JSON parser to reject the plugin manifest during installation. Also adds JSON validation tests for both the openclaw plugin manifest and the claude-code hooks.json so CI catches invalid JSON before release.
This commit is contained in:
parent
f30ca3deda
commit
704e41fa27
3 changed files with 38 additions and 2 deletions
14
hindsight-integrations/claude-code/tests/test_manifest.py
Normal file
14
hindsight-integrations/claude-code/tests/test_manifest.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"""Validate that JSON manifests are strict-valid JSON (no trailing commas, etc.)."""
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
INTEGRATION_ROOT = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
def test_hooks_json_is_valid():
|
||||
path = INTEGRATION_ROOT / "hooks" / "hooks.json"
|
||||
raw = path.read_text()
|
||||
parsed = json.loads(raw)
|
||||
assert "hooks" in parsed
|
||||
assert isinstance(parsed["hooks"], dict)
|
||||
|
|
@ -215,7 +215,7 @@
|
|||
"type": "number",
|
||||
"description": "Interval in ms to batch retain/recall log summaries. 0 = log every event individually. Default: 300000 (5 min).",
|
||||
"default": 300000
|
||||
},
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
|
|
@ -349,6 +349,6 @@
|
|||
"logSummaryIntervalMs": {
|
||||
"label": "Log Summary Interval (ms)",
|
||||
"placeholder": "300000"
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
22
hindsight-integrations/openclaw/src/manifest.test.ts
Normal file
22
hindsight-integrations/openclaw/src/manifest.test.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { readFileSync } from 'fs';
|
||||
import { resolve, dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const manifestPath = resolve(__dirname, '..', 'openclaw.plugin.json');
|
||||
|
||||
describe('openclaw.plugin.json', () => {
|
||||
it('is valid JSON', () => {
|
||||
const raw = readFileSync(manifestPath, 'utf-8');
|
||||
expect(() => JSON.parse(raw)).not.toThrow();
|
||||
});
|
||||
|
||||
it('has required top-level fields', () => {
|
||||
const manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));
|
||||
expect(manifest.id).toBe('hindsight-openclaw');
|
||||
expect(manifest.name).toBeTypeOf('string');
|
||||
expect(manifest.configSchema).toBeDefined();
|
||||
expect(manifest.configSchema.properties).toBeDefined();
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue