mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-11 02:33:10 +08:00
fix(dev-server-block): stop blocking dev-<suffix> scripts (#2179)
`DEV_PATTERN`'s trailing `\b` treats a hyphen as a word boundary, so `dev\b` matched the `dev` prefix of distinct npm scripts like `dev-setup` / `dev-docs` / `dev-build` and blocked them with exit 2. Replace the trailing `\b` with `(?![\w-])` so the dev server still matches (`dev`, `dev;`, `dev:ssr`) but `dev-<suffix>` scripts pass. Adds regression tests for dev-setup/dev-docs/dev-build (allowed) and dev:ssr (still blocked). Co-authored-by: bymle <229636660+bymle@users.noreply.github.com>
This commit is contained in:
@@ -161,7 +161,11 @@ process.stdin.on('data', chunk => {
|
||||
});
|
||||
|
||||
const TMUX_LAUNCHER = /^\s*tmux\s+(new|new-session|new-window|split-window)\b/;
|
||||
const DEV_PATTERN = /\b(npm\s+run\s+dev|pnpm(?:\s+run)?\s+dev|yarn(?:\s+run)?\s+dev|bun(?:\s+run)?\s+dev)\b/;
|
||||
// Trailing (?![\w-]) rather than \b: \b treats a hyphen as a word boundary, so
|
||||
// `dev\b` matches the `dev` prefix of distinct scripts like `dev-setup` /
|
||||
// `dev-docs` / `dev-build` and wrongly blocks them. The lookahead still matches
|
||||
// the dev server (`dev`, `dev;`, `dev:ssr`, ...) but not a `dev-<suffix>` script.
|
||||
const DEV_PATTERN = /\b(npm\s+run\s+dev|pnpm(?:\s+run)?\s+dev|yarn(?:\s+run)?\s+dev|bun(?:\s+run)?\s+dev)(?![\w-])/;
|
||||
|
||||
/**
|
||||
* Collect every command-line segment we should evaluate. Returns the top-level
|
||||
|
||||
Reference in New Issue
Block a user