Split all cmd/* packages for maintainability, following the pattern established in cmd/php. Each package now has: - Main file with styles (using cmd/shared) and Add*Commands function - Separate files for logical command groupings Packages refactored: - cmd/dev: 13 files (was 2779 lines in one file) - cmd/build: 5 files (was 913 lines) - cmd/setup: 6 files (was 961 lines) - cmd/go: 5 files (was 655 lines) - cmd/pkg: 5 files (was 634 lines) - cmd/vm: 4 files (was 717 lines) - cmd/ai: 5 files (was 800 lines) - cmd/docs: 5 files (was 379 lines) - cmd/doctor: 5 files (was 301 lines) - cmd/test: 3 files (was 429 lines) - cmd/ci: 5 files (was 272 lines) All packages now import shared styles from cmd/shared instead of redefining them locally. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
// Package docs provides documentation management commands.
|
|
package docs
|
|
|
|
import (
|
|
"github.com/charmbracelet/lipgloss"
|
|
"github.com/host-uk/core/cmd/shared"
|
|
"github.com/leaanthony/clir"
|
|
)
|
|
|
|
// Style and utility aliases from shared
|
|
var (
|
|
repoNameStyle = shared.RepoNameStyle
|
|
successStyle = shared.SuccessStyle
|
|
errorStyle = shared.ErrorStyle
|
|
dimStyle = shared.DimStyle
|
|
headerStyle = shared.HeaderStyle
|
|
confirm = shared.Confirm
|
|
)
|
|
|
|
// Package-specific styles
|
|
var (
|
|
docsFoundStyle = lipgloss.NewStyle().
|
|
Foreground(lipgloss.Color("#22c55e")) // green-500
|
|
|
|
docsMissingStyle = lipgloss.NewStyle().
|
|
Foreground(lipgloss.Color("#6b7280")) // gray-500
|
|
|
|
docsFileStyle = lipgloss.NewStyle().
|
|
Foreground(lipgloss.Color("#3b82f6")) // blue-500
|
|
)
|
|
|
|
// AddDocsCommand adds the 'docs' command to the given parent command.
|
|
func AddDocsCommand(parent *clir.Cli) {
|
|
docsCmd := parent.NewSubCommand("docs", "Documentation management")
|
|
docsCmd.LongDescription("Manage documentation across all repos.\n" +
|
|
"Scan for docs, check coverage, and sync to core-php/docs/packages/.")
|
|
|
|
// Add subcommands
|
|
addDocsSyncCommand(docsCmd)
|
|
addDocsListCommand(docsCmd)
|
|
}
|