Skip to content

Commit e4a6834

Browse files
committed
refactor: extract option helpers and add gh-pages integration tests
Extract option preparation helpers into dedicated module for better separation of concerns and add comprehensive gh-pages integration tests. **Refactoring:** - Extract 6 helper functions from engine.ts to engine.prepare-options-helpers.ts: - setupMonkeypatch(), mapNegatedBooleans(), handleUserCredentials() - warnDeprecatedParameters(), appendCIMetadata(), injectTokenIntoRepoUrl() - Create PreparedOptions type to replace verbose inline type definitions - Move all 34 option helper tests to engine.prepare-options-helpers.spec.ts - Reduce engine.ts from 439 to 244 lines (-44%) **gh-pages Integration:** - Add 30 new tests in engine.gh-pages-integration.spec.ts - Verify exact arguments passed to gh-pages.publish() and gh-pages.clean() - Implement options whitelist to filter internal options before passing to gh-pages - Use module-level jest.mock() to avoid test file conflicts - Mock Git class from gh-pages/lib/git to avoid spawning actual git processes **Options Filtering:** Internal options now filtered out before passing to gh-pages: - dryRun, noDotfiles, noNotfound, noNojekyll (internal flags) - notfound, nojekyll (used for file creation only) - cname (used for CNAME file creation only) - name, email (transformed to user object) Only whitelisted options passed to gh-pages: - repo, branch, message, remote, git, add, dotfiles, user **Test Updates:** - Update 7 builder-integration tests to verify filtered options - All 315 tests passing This ensures clean API contract with gh-pages and makes future upgrades safer by explicitly controlling what gets passed through.
1 parent ade5cff commit e4a6834

File tree

7 files changed

+950
-387
lines changed

7 files changed

+950
-387
lines changed

.claude/settings.local.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424
"Bash(git log:*)",
2525
"Bash(npm test:*)",
2626
"Bash(gh issue view:*)",
27-
"WebSearch"
27+
"WebSearch",
28+
"Bash(npm ls:*)",
29+
"Bash(find:*)",
30+
"Bash(gh pr view:*)",
31+
"Bash(gh pr diff:*)",
32+
"Bash(cat:*)",
33+
"Bash(npm view:*)",
34+
"WebFetch(domain:raw.githubusercontent.com)"
2835
],
2936
"deny": [],
3037
"ask": []

0 commit comments

Comments
 (0)