Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.log
*.nupkg
.chocolatey/
_build/
temp/
Expand Down
49 changes: 18 additions & 31 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Repository Overview

This is a Chocolatey package that provides a Windows CLI wrapper for the Wheels MVC framework CommandBox tools. The package creates a `wheels` command that simplifies CommandBox usage by eliminating the need to prefix commands with `box wheels`.
This is a Chocolatey package that provides a Windows CLI wrapper for the Wheels MVC framework, powered by LuCLI. The package creates a `wheels` command that delegates to `lucli wheels`.

## Package Structure

- **wheels.nuspec**: Package specification with metadata, dependencies (CommandBox), and version info
- **tools/chocolateyinstall.ps1**: Installation script that creates wrapper scripts dynamically
- **tools/wheels.cmd**: Windows batch wrapper that handles argument conversion and CommandBox integration
- **wheels.nuspec**: Package specification with metadata, dependencies (LuCLI), and version info
- **tools/chocolateyinstall.ps1**: Installation script — installs Wheels LuCLI module, creates wrapper scripts
- **tools/chocolateyuninstall.ps1**: Uninstall script — removes module and wrapper scripts
- **tools/wheels.cmd**: Windows batch wrapper that passes arguments to `lucli wheels`
- **build.ps1**: Build script for packaging with version management
- **test-local.ps1**: Local testing script for package installation
- **test-wrapper.ps1**: Logic verification script for wrapper functionality
Expand All @@ -23,10 +24,10 @@ This is a Chocolatey package that provides a Windows CLI wrapper for the Wheels
choco pack

# Build with specific version
.\build.ps1 -Version "1.0.6"
.\build.ps1 -Version "2.0.0"

# Build and push to Chocolatey (requires API key)
.\build.ps1 -Version "1.0.6" -Push -ApiKey YOUR_API_KEY
.\build.ps1 -Version "2.0.0" -Push -ApiKey YOUR_API_KEY
```

### Local Testing
Expand All @@ -44,47 +45,33 @@ choco pack
## Architecture Details

### Wrapper Logic (tools/wheels.cmd)
- Checks for CommandBox availability at runtime
- Auto-installs Wheels CLI tools if not present (`box install wheels-cli`)
- Converts standard CLI arguments to CommandBox parameter format:
- `--parameter=value` → `parameter=value`
- `--flag` → `flag=true`
- `--noFlag` → `flag=false`
- Handles special cases for `--help`, `--version`
- Checks for LuCLI availability at runtime
- Passes all arguments directly to `lucli wheels` (no conversion needed)
- LuCLI handles standard CLI conventions natively

### Installation Process
1. Creates `wheels.bat` and `wheels.ps1` wrapper scripts in tools directory
2. Chocolatey automatically adds tools directory to PATH
3. Wrapper scripts check CommandBox dependency and install Wheels CLI on first use
1. Verifies LuCLI dependency is available
2. Installs Wheels module via `lucli modules install wheels`
3. Creates `wheels.bat` and `wheels.ps1` wrapper scripts in tools directory
4. Chocolatey automatically adds tools directory to PATH

### Version Management
The build script automatically updates the version in `wheels.nuspec` when using the `-Version` parameter.

## Dependencies

- **CommandBox**: Required dependency (version 5.0.0+) specified in nuspec
- **Wheels CLI**: Auto-installed by wrapper on first use via `box install wheels-cli`
- **LuCLI**: Required dependency specified in nuspec
- **Wheels module**: Installed from wheels-dev/wheels monorepo archive during package install

## Testing Approach

- `test-local.ps1`: Full end-to-end testing with actual Chocolatey installation
- `test-wrapper.ps1`: Logic verification without system changes
- Manual testing: Install package and verify `wheels` command works

## Recent Fixes (v1.0.6)

**Chocolatey Automated Validation Issues Resolved:**
- ✅ **Choco commands in scripts**: Confirmed package scripts (chocolateyinstall.ps1, chocolateyuninstall.ps1) contain no choco commands (requirement satisfied)
- ✅ **IconUrl**: Added iconUrl element pointing to Wheels project logo
- ✅ **ProjectSourceUrl**: Already correctly points to software source code (wheels-dev/wheels)

**Package Quality Notes:**
- Package maintainer (wheels-dev) matches software author (Wheels Team) - standard for official packages
- ProjectUrl points to this package repository, ProjectSourceUrl points to main software repository (correct)

## Permissions Configuration

The repository includes Claude Code permissions in `.claude/settings.local.json` allowing:
- Directory operations
- Git operations (add/commit)
- Chocolatey pack operations
- Git operations (add/commit)
- Chocolatey pack operations
18 changes: 8 additions & 10 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build script for Wheels Chocolatey package
param(
[string]$Version = "1.0.6",
[string]$Version = "2.0.0",
[switch]$Push,
[string]$ApiKey = $env:CHOCOLATEY_API_KEY,
[string]$Source = "https://push.chocolatey.org/"
Expand All @@ -24,25 +24,23 @@ Remove-Item *.nupkg -ErrorAction SilentlyContinue

# Pack the package
Write-Host "Packing the Chocolatey package..." -ForegroundColor Cyan
# Build package using chocolatey pack command
Write-Host "Package build would run here" -ForegroundColor Green
choco pack "$PSScriptRoot\wheels.nuspec"

# Find the generated package
$packageFile = Get-ChildItem -Filter "*.nupkg" | Select-Object -First 1

if ($packageFile) {
Write-Host "Package created: $($packageFile.Name)" -ForegroundColor Green

if ($Push) {
if (-not $ApiKey) {
Write-Error "API key is required to push the package. Set CHOCOLATEY_API_KEY environment variable or use -ApiKey parameter."
exit 1
}

Write-Host "Pushing package to Chocolatey..." -ForegroundColor Cyan
# Push package using chocolatey push command
Write-Host "Package push would run here" -ForegroundColor Green

choco push $packageFile.FullName --source $Source --api-key $ApiKey

if ($LASTEXITCODE -eq 0) {
Write-Host "Package pushed successfully!" -ForegroundColor Green
} else {
Expand All @@ -52,12 +50,12 @@ if ($packageFile) {
} else {
Write-Host ""
Write-Host "To test the package locally, run:" -ForegroundColor Yellow
Write-Host " Install-Package wheels -Provider Chocolatey -Source ." -ForegroundColor Cyan
Write-Host " .\test-local.ps1" -ForegroundColor Cyan
Write-Host ""
Write-Host "To push the package to Chocolatey, run:" -ForegroundColor Yellow
Write-Host " .\build.ps1 -Push -ApiKey YOUR_API_KEY" -ForegroundColor Cyan
}
} else {
Write-Error "Failed to create package"
exit 1
}
}
43 changes: 23 additions & 20 deletions test-local.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ $ErrorActionPreference = 'Stop'

if ($Uninstall) {
Write-Host "Uninstalling wheels package..." -ForegroundColor Yellow
# Uninstall using chocolatey command
Write-Host "Would uninstall wheels package"
choco uninstall wheels -y 2>$null
Write-Host "Done."
exit
}

Write-Host "Testing local installation of Wheels package" -ForegroundColor Green
Write-Host "Testing local installation of Wheels package (LuCLI)" -ForegroundColor Green
Write-Host ""

# Pre-check: LuCLI must be available
if (-not (Get-Command "lucli" -ErrorAction SilentlyContinue)) {
Write-Warning "LuCLI is not installed. Install it first: choco install lucli"
Write-Host "Continuing with package build only..." -ForegroundColor Yellow
}

# Build the package first
Write-Host "Building the package..." -ForegroundColor Cyan
& "$PSScriptRoot\build.ps1"
Expand All @@ -28,36 +34,33 @@ Write-Host ""
Write-Host "Installing the package locally..." -ForegroundColor Cyan

# Uninstall if already installed
# Check if package is installed
$installed = $false # Placeholder for installation check
if ($installed) {
Write-Host "Removing existing installation..." -ForegroundColor Yellow
# Uninstall existing package
Write-Host "Would uninstall existing wheels package"
}
choco uninstall wheels -y 2>$null

# Install from current directory
# Install package locally
Write-Host "Would install wheels package from local source"
$nupkg = Get-ChildItem -Filter "*.nupkg" | Select-Object -First 1
if ($nupkg) {
choco install wheels --source "." -y
} else {
Write-Error "No .nupkg file found. Run build.ps1 first."
exit 1
}

if ($LASTEXITCODE -eq 0) {
Write-Host ""
Write-Host "Installation successful!" -ForegroundColor Green
Write-Host ""

# Test the installation
Write-Host "Testing the wheels command..." -ForegroundColor Cyan

# Check if wheels command exists

$wheelsPath = Get-Command wheels -ErrorAction SilentlyContinue
if ($wheelsPath) {
Write-Host "Wheels command found at: $($wheelsPath.Source)" -ForegroundColor Green

# Try to run wheels version

Write-Host ""
Write-Host "Running 'wheels --version':" -ForegroundColor Yellow
wheels --version

Write-Host ""
Write-Host "Test completed successfully!" -ForegroundColor Green
Write-Host ""
Expand All @@ -69,11 +72,11 @@ if ($LASTEXITCODE -eq 0) {
} else {
Write-Warning "Wheels command not found in PATH. You may need to restart your terminal."
}

Write-Host ""
Write-Host "To uninstall the test installation, run:" -ForegroundColor Yellow
Write-Host " .\test-local.ps1 -Uninstall" -ForegroundColor Cyan
} else {
Write-Error "Installation failed"
exit 1
}
}
Loading