Skip to content
Source
Sign inSign up
TanStack/intent

fix: write the hook script parser as fixed text #326

MergedLadyBluenotes(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/326/headmerged by LadyBluenotes(GitHub profile, opens in a new tab)

Showing 4 changed files with 22 additions and 5 deletions (loading 1).

x
0 of 4 viewed, 4 left
5 additions and 0 deletions.changeset/hook-script-fixed-text.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/intent': patch
+---
+​
+Write the command parser in the hook script as fixed text, so the script content no longer changes with the build tooling. Hook behavior does not change. The next `intent hooks install` rewrites the installed script once and reports `Updated Intent hooks`; later runs report no changes.
13 additions and 2 deletionspackages/intent/src/hooks/install.tsModified
View file
@@ -8,7 +8,7 @@
import {
EDIT_TOOLS_BY_AGENT,
GATE_DENY_REASON,
- parseIntentInvocation,
+ INTENT_INVOCATION_PATTERN,
} from './policy.js'
import type { HookAgent, HookInstallScope } from './types.js'
​
@@ -89,7 +89,7 @@
const LOAD_COMMAND = ${JSON.stringify(loadCommand)}
const EDIT_TOOLS = new Set(${JSON.stringify(editTools)})
const GATE_DENY_REASON = ${JSON.stringify(GATE_DENY_REASON)}
-const parseIntentInvocation = ${parseIntentInvocation.toString()}
+const INTENT_INVOCATION_PATTERN = ${INTENT_INVOCATION_PATTERN}