also looking at this
fix(cli): let packages.strategy reach its flags, and sync CLAUDE.md's embedded README
#1441
4 files
+182
-64
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -657,7 +657,7 @@ cli | ||
| 657 | 657 | .option('--verbose, -v', 'Enable verbose logging') |
| 658 | 658 | .option('--packages <names>', 'Comma-separated list of packages to check') |
| 659 | 659 | .option('--pattern <pattern>', 'Glob pattern to match packages') |
| 660 | .option('--strategy <type>', 'Update strategy: major|minor|patch|all', { default: 'all' }) | |
| 660 | .option('--strategy <type>', 'Update strategy: major|minor|patch|all (default: packages.strategy from config, else all)') | |
| 661 | 661 | .option('--ignore <names>', 'Comma-separated list of packages to ignore') |
| 662 | 662 | .option('--respect-latest', 'Respect "latest", "*", and other dynamic version indicators (default: true)') |
| 663 | 663 | .option('--no-respect-latest', 'Allow updating "latest", "*", and other dynamic version indicators') |
| @@ -847,7 +847,7 @@ cli | ||
| 847 | 847 | cli |
| 848 | 848 | .command('update', 'Update dependencies and create PRs') |
| 849 | 849 | .option('--verbose, -v', 'Enable verbose logging') |
| 850 | .option('--strategy <type>', 'Update strategy: major|minor|patch|all', { default: 'all' }) | |
| 850 | .option('--strategy <type>', 'Update strategy: major|minor|patch|all (default: packages.strategy from config, else all)') | |
| 851 | 851 | .option('--ignore <names>', 'Comma-separated list of packages to ignore') |
| 852 | 852 | .option('--dry-run', 'Preview changes without making them') |
| 853 | 853 | .option('--reviewers <names>', 'Comma-separated reviewers to assign (overrides pullRequest.reviewers)') |
| @@ -1766,7 +1766,7 @@ cli | ||
| 1766 | 1766 | cli |
| 1767 | 1767 | .command('check <packages...>', 'Check specific packages for updates') |
| 1768 | 1768 | .option('--verbose, -v', 'Enable verbose logging') |
| 1769 | .option('--strategy <type>', 'Update strategy: major|minor|patch|all', { default: 'all' }) | |
| 1769 | .option('--strategy <type>', 'Update strategy: major|minor|patch|all (default: packages.strategy from config, else all)') | |
| 1770 | 1770 | .example('buddy check react typescript') |
| 1771 | 1771 | .example('buddy check react --verbose') |
| 1772 | 1772 | .action(async (...args: any[]) => { |
| @@ -1816,7 +1816,7 @@ cli | ||
| 1816 | 1816 | cli |
| 1817 | 1817 | .command('schedule', 'Run automated dependency updates on schedule') |
| 1818 | 1818 | .option('--verbose, -v', 'Enable verbose logging') |
| 1819 | .option('--strategy <type>', 'Update strategy: major|minor|patch|all', { default: 'all' }) | |
| 1819 | .option('--strategy <type>', 'Update strategy: major|minor|patch|all (default: packages.strategy from config, else all)') | |
| 1820 | 1820 | .example('buddy schedule') |
| 1821 | 1821 | .example('buddy schedule --verbose') |
| 1822 | 1822 | .example('buddy schedule --strategy patch') |
| @@ -17,7 +17,7 @@ buddy scan [options] | ||
| 17 | 17 | - `--verbose, -v` - Enable verbose logging |
| 18 | 18 | - `--packages <names>` - Comma-separated list of packages to check |
| 19 | 19 | - `--pattern <pattern>` - Glob pattern to match packages |
| 20 | - `--strategy <type>` - Update strategy: major|minor|patch|all (default: all) | |
| 20 | - `--strategy <type>` - Update strategy: major|minor|patch|all (default: `packages.strategy` from config, else all) | |
| 21 | 21 | - `--ignore <names>` - Comma-separated list of packages to ignore |
| 22 | 22 | - `--respect-latest` - Leave `latest`, `*` and other dynamic ranges alone (default) |
| 23 | 23 | - `--no-respect-latest` - Propose updates for dynamic ranges too |
| @@ -75,7 +75,7 @@ buddy update [options] | ||
| 75 | 75 | ### Options |
| 76 | 76 | |
| 77 | 77 | - `--verbose, -v` - Enable verbose logging |
| 78 | - `--strategy <type>` - Update strategy: major|minor|patch|all (default: all) | |
| 78 | - `--strategy <type>` - Update strategy: major|minor|patch|all (default: `packages.strategy` from config, else all) | |
| 79 | 79 | - `--ignore <names>` - Comma-separated list of packages to ignore |
| 80 | 80 | - `--dry-run` - Preview changes without making them |
| 81 | 81 | - `--reviewers <names>` - Comma-separated reviewers to assign, overriding `pullRequest.reviewers` |
| @@ -93,6 +93,18 @@ describe('CLI surface', () => { | ||
| 93 | 93 | } |
| 94 | 94 | }, 30000) |
| 95 | 95 | |
| 96 | it('success case - the strategy flag no longer shadows the config', async () => { | |
| 97 | // `--strategy` carried `{ default: 'all' }`, so the option was always | |
| 98 | // "set" and the handler's `options.strategy ?? config.packages?.strategy` | |
| 99 | // chain never reached the config — packages.strategy was dead on the | |
| 100 | // scan/update/check/schedule paths unless a flag was typed. | |
| 101 | const { code, output } = await run(['update', '--help']) | |
| 102 | ||
| 103 | expect(code).toBe(0) | |
| 104 | expect(output).toContain('packages.strategy from config') | |
| 105 | expect(output).not.toContain('(default: all)') | |
| 106 | }, 30000) | |
| 107 | ||
| 96 | 108 | it('failure case - an unknown flag is rejected rather than ignored', async () => { |
| 97 | 109 | // clapp hard-errors on unknown options, which is why a documented-but- |
| 98 | 110 | // unimplemented flag crashed rather than degrading. |