mirror of
https://github.com/yamadashy/repomix.git
synced 2026-09-19 06:00:49 +08:00
fix(mcp): Match both commander declaration styles and document the skip
intent(mcp-registry): address PR review — the flag extractor only matched `.option()`, so it tracked how `--mcp` is declared rather than whether it exists decision(cli-flags): match `new Option()` too, which brings the five addOption-declared flags (`--quiet`, `--output-file-path-style`, ...) into the set and decouples the assertion from the declaration style learned(mcp-registry): skipping the publish for an existing version made a metadata-only edit a silent no-op — the run goes green with nothing republished, since registry versions are immutable decision(mcp-registry): spell that out in the comment so a green run is not misread as "the description fix shipped" Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -88,7 +88,10 @@ jobs:
|
||||
|
||||
# Publishing a version the registry already holds is rejected, which would
|
||||
# make a re-run permanently red. Skipping the publish when the version is
|
||||
# already there turns a re-run into a plain re-verify.
|
||||
# already there turns a re-run into a plain re-verify. Note that registry
|
||||
# versions are immutable, so a server.json metadata change (description,
|
||||
# websiteUrl, ...) only reaches the registry with the next version bump:
|
||||
# re-running on an unchanged version reports success without republishing.
|
||||
- name: Check whether the version is already on the registry
|
||||
id: registry-check
|
||||
if: ${{ !inputs.dry-run }}
|
||||
|
||||
@@ -13,11 +13,13 @@ const repoRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), '../..'
|
||||
/**
|
||||
* Collects the CLI flags declared with commander in cliRun.ts, e.g. `--mcp` from
|
||||
* `.option('--mcp', ...)` and both `-w` and `--watch` from `.option('-w, --watch', ...)`.
|
||||
* Both declaration styles are matched so the assertion tracks whether a flag exists
|
||||
* rather than how it happens to be declared.
|
||||
*/
|
||||
const getDeclaredCliFlags = (): Set<string> => {
|
||||
const source = readFileSync(path.join(repoRoot, 'src/cli/cliRun.ts'), 'utf8');
|
||||
const flags = new Set<string>();
|
||||
for (const match of source.matchAll(/\.option\(\s*'([^']+)'/g)) {
|
||||
for (const match of source.matchAll(/(?:\.option\(|new Option\()\s*'([^']+)'/g)) {
|
||||
for (const part of match[1].split(',')) {
|
||||
// Drop the value placeholder, e.g. `--sandbox [dir]` -> `--sandbox`
|
||||
const flag = part.trim().split(/[\s<[]/)[0];
|
||||
|
||||
Reference in New Issue
Block a user