Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.

Commit 357fa77

Browse files
Chrisclaude
andcommitted
docs + test: sync with --fix-index flip
Review follow-ups for PR #15: - docs/realm-repair.md still documented the old `--no-fix-index` form after b9646da flipped the flag to `--fix-index`. Updated the description to match the new opt-in behavior and explain why it's off by default (breaks Checkly-style prerendering). - test/commands/repair.test.ts had a misleading block titled "repair-realms batch defaults" that actually tested the handler's `?? false` fallback, not the commander CLI defaults. Renamed and clarified so it's obvious what it covers; the real commander-default coverage lives in the "commander flag parsing" block added in b9646da. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4cda30f commit 357fa77

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

docs/realm-repair.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ boxel doctor repair-realm <url> \
3333

3434
- `--match-endpoint`: force display name from endpoint slug (for example, `odd-sheep` -> `Odd Sheep`)
3535
- `--reconcile-matrix`: upsert/remove this specific realm URL in Matrix `app.boxel.realms`
36-
- `--no-fix-index`: skip `index.json` and `cards-grid.json` repairs
36+
- `--fix-index`: **opt-in.** Rewrite `index.json` and `cards-grid.json` starter cards. Off by default because this overwrites customized index files (which breaks things like Checkly prerendering that rely on a specific index shape). Only pass this when you know the realm has a standard index.
3737
- `--no-touch-index`: skip cache-busting mutation in `index.json`
3838
- `--include-personal`: include the special `personal` realm (excluded by default)
3939

test/commands/repair.test.ts

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -113,28 +113,24 @@ describe('repair name logic', () => {
113113
});
114114
});
115115

116-
describe('repair-realms batch defaults', () => {
117-
it('defaults to not fixing index in batch mode', () => {
118-
// Verify the default values match what we set in the code
116+
// NOTE: these tests check the handler-level `options.xxx ?? false` fallback
117+
// behavior when a caller (e.g. a test harness or programmatic invocation)
118+
// passes an empty options object. They do NOT cover the commander CLI
119+
// defaults — for that, see "repair commander flag parsing" below, which
120+
// parses commander directly and is the test that catches the real bug.
121+
describe('repair-realms handler fallback behavior', () => {
122+
it('treats absent options.fixIndex as false', () => {
119123
const options: { fixIndex?: boolean; touchIndex?: boolean; matchEndpoint?: boolean } = {};
120-
const fixIndex = options.fixIndex ?? false;
121-
const touchIndex = options.touchIndex ?? false;
122-
const matchEndpoint = options.matchEndpoint ?? false;
123-
124-
expect(fixIndex).toBe(false);
125-
expect(touchIndex).toBe(false);
126-
expect(matchEndpoint).toBe(false);
124+
expect(options.fixIndex ?? false).toBe(false);
125+
expect(options.touchIndex ?? false).toBe(false);
126+
expect(options.matchEndpoint ?? false).toBe(false);
127127
});
128128

129-
it('respects explicit opt-in for index fixing', () => {
129+
it('respects explicit opt-in', () => {
130130
const options = { fixIndex: true, touchIndex: true, matchEndpoint: true };
131-
const fixIndex = options.fixIndex ?? false;
132-
const touchIndex = options.touchIndex ?? false;
133-
const matchEndpoint = options.matchEndpoint ?? false;
134-
135-
expect(fixIndex).toBe(true);
136-
expect(touchIndex).toBe(true);
137-
expect(matchEndpoint).toBe(true);
131+
expect(options.fixIndex ?? false).toBe(true);
132+
expect(options.touchIndex ?? false).toBe(true);
133+
expect(options.matchEndpoint ?? false).toBe(true);
138134
});
139135
});
140136

0 commit comments

Comments
 (0)