Commit 81cbf01
refactor(cc): simplify CC generators by extracting shared helpers
Extract common patterns duplicated across CC generators into shared functions:
- ReadyExtensions() on ExtensionCache replaces inline filtering and readyExts()
- GetVersion() / GetPkgURLLink() on Extension replace repeated null-check patterns
- InferRepo() consolidates duplicate inferRepo methods from cc_page.go and cc_os.go
- WriteMarkdownFile() replaces repeated os.MkdirAll + os.WriteFile boilerplate
- runWithCache() in cmd/cc.go extracts InitDB+LoadCache boilerplate from 6 commands
- CCExtensionTable uses shared helpers, removing duplication in cc_markdown.go
- Remove NullBool/NullString type aliases in favor of direct sql.Null* types
Net reduction: ~350 lines removed across 9 files with no functional changes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent a57e67b commit 81cbf01
File tree
9 files changed
+770
-735
lines changed- cli
- cmd
9 files changed
+770
-735
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
249 | 260 | | |
250 | 261 | | |
251 | 262 | | |
| |||
0 commit comments