specflow-cc 1.18.2 → 1.18.3
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 +7 -0
- package/bin/install.js +26 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ 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.3] - 2026-04-11
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Auto-heal for users upgrading from 1.18.0 / 1.18.1** — the installer now scans `hooks.PostToolUse` during every install and removes any flat `{ type, command }` entry that references `context-monitor`. These entries were written by the buggy `1.18.0`/`1.18.1` installer and would otherwise linger in `settings.json` next to the newly written correct matcher group, still tripping Claude Code's `"Expected array, but received undefined"` parse error. Foreign flat entries (belonging to other tools) are left untouched — only entries unambiguously written by prior SpecFlow versions are removed.
|
|
13
|
+
- Three new smoke tests cover clean auto-heal, preservation of foreign flat entries, and the mixed state (pre-existing correct hook + flat broken duplicate).
|
|
14
|
+
|
|
8
15
|
## [1.18.2] - 2026-04-11
|
|
9
16
|
|
|
10
17
|
### Fixed
|
package/bin/install.js
CHANGED
|
@@ -289,6 +289,32 @@ 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
|
+
// Auto-heal: remove flat, broken context-monitor entries written by
|
|
293
|
+
// installer versions 1.18.0 and 1.18.1. Those versions pushed
|
|
294
|
+
// { type: "command", command: "..." } directly into PostToolUse, but
|
|
295
|
+
// Claude Code requires every PostToolUse entry to be a matcher group
|
|
296
|
+
// of shape { matcher?, hooks: [{ type, command }, ...] }. A flat entry
|
|
297
|
+
// makes Claude Code fail to parse settings.json entirely. Only entries
|
|
298
|
+
// that are unambiguously ours (flat + command references context-monitor)
|
|
299
|
+
// are removed; everything else is left untouched.
|
|
300
|
+
{
|
|
301
|
+
const before = settings.hooks.PostToolUse.length;
|
|
302
|
+
settings.hooks.PostToolUse = settings.hooks.PostToolUse.filter(entry => {
|
|
303
|
+
const isFlatBrokenMonitor =
|
|
304
|
+
entry &&
|
|
305
|
+
!Array.isArray(entry.hooks) &&
|
|
306
|
+
entry.type === 'command' &&
|
|
307
|
+
typeof entry.command === 'string' &&
|
|
308
|
+
entry.command.includes('context-monitor');
|
|
309
|
+
return !isFlatBrokenMonitor;
|
|
310
|
+
});
|
|
311
|
+
const removed = before - settings.hooks.PostToolUse.length;
|
|
312
|
+
if (removed > 0) {
|
|
313
|
+
const plural = removed === 1 ? 'y' : 'ies';
|
|
314
|
+
console.log(` ${green}✓${reset} Repaired settings.json (removed ${removed} broken hook entr${plural} from prior install)`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
292
318
|
// Claude Code expects each PostToolUse entry to be a matcher group:
|
|
293
319
|
// { matcher?: string, hooks: [{ type, command }, ...] }
|
|
294
320
|
// Detect an existing context-monitor hook inside any matcher group.
|