Development
Ce contenu n’est pas encore disponible dans votre langue.
Install the necessary tools for development by following their respective installation instructions.
- Go
- GitHub CLI (optional, for theme development with private repositories)
Project Setup
Section titled “Project Setup”Clone the repository and build the project:
git clone https://github.com/germainlefebvre4/cvwonder.gitcd cvwondermake buildBuild the binary:
make buildThis creates the cvwonder executable in the project root.
Development Workflow
Section titled “Development Workflow”Working with Private Theme Repositories
Section titled “Working with Private Theme Repositories”If you’re developing or testing themes in private repositories, CVWonder supports multiple authentication methods:
Option 1: GitHub CLI (Recommended)
# Authenticate oncegh auth login
# CVWonder automatically detects and uses your gh credentials./cvwonder theme install https://github.com/your-org/your-private-themeOption 2: Environment Variables
# Set the token in your environmentexport GITHUB_TOKEN="ghp_your_personal_access_token"
# Or use GH_TOKENexport GH_TOKEN="ghp_your_personal_access_token"
# Install themes./cvwonder theme install https://github.com/your-org/your-private-themeAuthentication Priority:
CVWonder checks for credentials in this order:
- GitHub CLI (
gh) - automatic if logged in GITHUB_TOKENenvironment variableGH_TOKENenvironment variable- Unauthenticated (public repositories only)
Debugging Authentication:
Use debug logging to verify which authentication method is being used:
./cvwonder theme install <url> --log-level debugTesting Authentication Flow:
When developing authentication features, test all methods:
# Test GitHub CLIgh auth login./cvwonder theme install <private-repo> --log-level debug
# Test environment variablegh auth logoutexport GITHUB_TOKEN="token_here"./cvwonder theme install <private-repo> --log-level debug
# Test unauthenticated (should fail for private repos)unset GITHUB_TOKENunset GH_TOKEN./cvwonder theme install <private-repo> --log-level debugLive Development
Section titled “Live Development”Use the serve command with watch mode for live reloading:
./cvwonder serve --watchLint the codebase (TODO: add linting configuration):
# golangci-lint runUnit tests
Section titled “Unit tests”Run all unit tests:
go test ./...Run tests for a specific package:
go test ./internal/utils/...go test ./internal/themes/...Run tests with coverage:
go test ./... -coverRun tests with verbose output:
go test ./... -vIntegration tests
Section titled “Integration tests”Integration tests are run as part of the CI/CD pipeline.
Documentation
Section titled “Documentation”Documentation is built using Astro Starlight and located in docs/github-pages/.
Running Documentation Locally
Section titled “Running Documentation Locally”cd docs/github-pagesnpm cinpm run devThis starts a local development server at http://localhost:4321/
Building Documentation
Section titled “Building Documentation”cd docs/github-pagesnpm run buildArchitecture
Section titled “Architecture”For information about the codebase structure and architecture, see the Architecture documentation.