specflow-cc 1.18.1 → 1.18.2
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.
- package/CHANGELOG.md +10 -0
- package/bin/install.js +12 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to SpecFlow will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.18.2] - 2026-04-11
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Installer no longer corrupts `settings.json`** — the installer wrote the `context-monitor` PostToolUse hook as a flat `{ type, command }` object, but Claude Code expects every `PostToolUse` entry to be a matcher group of the shape `{ matcher?, hooks: [{ type, command }] }`. Claude Code failed to parse `settings.json` with `"Expected array, but received undefined"`, and permission rules in the affected file were silently disabled
|
|
13
|
+
- The hook is now written as a proper matcher group
|
|
14
|
+
- Broken duplicate-detection fixed: the installer previously checked `entry.command` on the top-level entry, but in the correct format the command lives inside `entry.hooks[i].command`. As a result, every repeat install pushed a new (broken) entry. Detection now walks `entry.hooks[]` and matches the existing hook correctly, so repeat installs are idempotent
|
|
15
|
+
- Smoke test extended with four new cases: format assertion, presence check, repeat-install idempotency, and preservation of a pre-existing correctly-formatted hook
|
|
16
|
+
- **Heads-up:** if you already ran `1.18.0` or `1.18.1` against a `settings.json` that had a pre-existing PostToolUse hook, you may have a duplicate flat entry. Remove any `PostToolUse` element that lacks a `hooks:` array (i.e. has `type`/`command` at the top level) and re-run the installer
|
|
17
|
+
|
|
8
18
|
## [1.18.1] - 2026-04-11
|
|
9
19
|
|
|
10
20
|
### Fixed
|
package/bin/install.js
CHANGED
|
@@ -289,13 +289,21 @@ function finishInstall(settingsPath, settings, statuslineCommand, shouldInstallS
|
|
|
289
289
|
if (!settings.hooks) settings.hooks = {};
|
|
290
290
|
if (!settings.hooks.PostToolUse) settings.hooks.PostToolUse = [];
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
// Claude Code expects each PostToolUse entry to be a matcher group:
|
|
293
|
+
// { matcher?: string, hooks: [{ type, command }, ...] }
|
|
294
|
+
// Detect an existing context-monitor hook inside any matcher group.
|
|
295
|
+
const hasMonitor = settings.hooks.PostToolUse.some(entry =>
|
|
296
|
+
Array.isArray(entry && entry.hooks) &&
|
|
297
|
+
entry.hooks.some(h => h && h.command && h.command.includes('context-monitor'))
|
|
294
298
|
);
|
|
295
299
|
if (!hasMonitor) {
|
|
296
300
|
settings.hooks.PostToolUse.push({
|
|
297
|
-
|
|
298
|
-
|
|
301
|
+
hooks: [
|
|
302
|
+
{
|
|
303
|
+
type: 'command',
|
|
304
|
+
command: monitorCommand
|
|
305
|
+
}
|
|
306
|
+
]
|
|
299
307
|
});
|
|
300
308
|
console.log(` ${green}✓${reset} Configured context monitor hook`);
|
|
301
309
|
}
|