Commit graph

15 commits

Author SHA1 Message Date
Snider
0c5e0c6435 fix(vm): use double-dash flags for linuxkit build command (#57)
LinuxKit v1.8.2+ requires double-dash flags (--format, --name, etc.)
instead of single-dash flags. The old flags were being parsed incorrectly,
e.g., `-name` was interpreted as `-n` with value `ame`.

Files updated:
- pkg/build/builders/linuxkit.go
- pkg/php/container.go
- pkg/release/publishers/linuxkit.go
- pkg/release/publishers/linuxkit_test.go

Fixes #50

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 01:49:00 +00:00
Snider
6f3d8341d5 refactor(php,vm): migrate to cli ANSI styling
Removes direct lipgloss imports.
Migrates cli.Line usage to cli.Blank/Echo.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 23:54:01 +00:00
Snider
778ce64e4b refactor(plugin): rename plugin files and update command structure 2026-01-31 11:39:19 +00:00
Snider
96eaed507c refactor(i18n): migrate all pkg/* to grammar engine
Replace verbose map-based translation calls with concise grammar
engine helpers across all command packages:

- i18n.T("common.label.xxx") → i18n.Label("xxx")
- i18n.T("common.error.failed", map) → i18n.T("i18n.fail.verb", subj)
- i18n.T("common.progress.running", map) → i18n.ProgressSubject()
- i18n.T("common.count.xxx", map) → i18n.T("i18n.count.xxx", n)

Packages updated: ai, ci, dev, docs, php, pkgcmd, sdk, setup, test, vm

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 23:09:45 +00:00
Snider
9931593f9d refactor(cli): move commands from cmd/ to pkg/ with self-registration
Implements defence in depth through build variants - only compiled code
exists in the binary. Commands now self-register via cli.RegisterCommands()
in their init() functions, mirroring the i18n.RegisterLocales() pattern.

Structure changes:
- cmd/{ai,build,ci,dev,docs,doctor,go,php,pkg,sdk,setup,test,vm}/ → pkg/*/cmd_*.go
- cmd/core_dev.go, cmd/core_ci.go → cmd/variants/{full,ci,php,minimal}.go
- Added pkg/cli/commands.go with RegisterCommands API
- Updated pkg/cli/runtime.go to attach registered commands

Build variants:
- go build           → full (21MB, all 13 command groups)
- go build -tags ci  → ci (18MB, build/ci/sdk/doctor)
- go build -tags php → php (14MB, php/doctor)
- go build -tags minimal → minimal (11MB, doctor only)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:55:55 +00:00
Snider
71e15236e2 feat(i18n): add RegisterLocales for package locale registration
- Add i18n.RegisterLocales(fsys, dir) for packages to register translations
- Locales are automatically loaded when i18n.Init() is called
- Fix gram.word.* loading bug (strings were in wrong switch case)
- Fix loadJSON to merge messages instead of replacing
- Add common.* keys to base locale (labels, flags, progress, etc.)
- Add pkg/php/locales with PHP-specific translations
- pkg/php/i18n.go registers locales via init()

This enables the idiomatic pattern where packages register their
locale files and they're automatically loaded by the i18n system.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:51:32 +00:00
Snider
9aaaa0ad26 refactor(php): rename analyse to stan
- Rename "analyse" check to "stan" (PHPStan is commonly called "stan")
- Command: `core php stan` (with "analyse" alias for compatibility)
- Update QA pipeline to use "stan" for check name
- Update dependency chain: fmt → stan → psalm → test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:06:51 +00:00
Snider
6d8edeb89c fix(php): set XDEBUG_MODE=coverage for PHPUnit 11 compatibility
PHPUnit 11 returns exit code 1 when xdebug coverage mode isn't set,
even if all tests pass. This caused false failures in the QA pipeline.

Setting XDEBUG_MODE=coverage in the test environment resolves the
warning and ensures tests return exit code 0 on success.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 00:28:47 +00:00
Snider
e4d79ce952 feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing

Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands

QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
Snider
c9ebb7c781 test: increase coverage to 63.8% across packages
Coverage improvements:
- pkg/build: 89.4%
- pkg/release: 86.7% (from 36.7%)
- pkg/container: 85.7%
- pkg/php: 62.1% (from 26%)
- pkg/devops: 56.7% (from 33.1%)
- pkg/release/publishers: 54.7%

Also:
- Add GEMINI.md for Gemini agent guidance
- Update .gitignore to exclude coverage files
- Remove stray core.go at root
- Add core go cov command for coverage reports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:28:23 +00:00
Snider
605ee023ca feat(php): add Coolify deployment integration
Commands:
- core php deploy - deploy to production
- core php deploy --staging - deploy to staging
- core php deploy:status - show deployment status
- core php deploy:rollback - rollback to previous
- core php deploy:list - list recent deployments

Features:
- Coolify API client
- Config from .env (COOLIFY_URL, TOKEN, APP_ID)
- Wait for deployment completion with --wait

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:39:04 +00:00
Snider
312fce343d feat(php): add package management for local development
Commands:
- core php packages link <path>... - link local packages
- core php packages unlink <name>... - unlink packages
- core php packages update - update linked packages
- core php packages list - list linked packages

Features:
- Composer path repositories with symlink
- Auto-detect package name from composer.json
- Preserves existing composer.json fields

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:33:55 +00:00
Snider
5759d84268 feat(php): add testing and quality commands
Testing:
- core php test - run PHPUnit/Pest (auto-detected)
- core php test --parallel - parallel testing
- core php test --coverage - with coverage
- core php test --filter <pattern> - filter tests

Quality:
- core php fmt - format with Laravel Pint
- core php fmt --fix - auto-fix issues
- core php analyse - run PHPStan/Larastan
- core php analyse --level 9 - set analysis level

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:26:57 +00:00
Snider
5568f86768 feat(php): add container build support (Docker + LinuxKit)
Add container commands to pkg/php:
- core php build - Docker/LinuxKit image builds
- core php serve --production - run production container
- core php shell - shell into running container

Features:
- Auto-generate FrankenPHP Dockerfile from project
- Detect PHP extensions from composer.json
- Multi-stage builds with frontend assets
- Laravel optimizations (config/route/view caching)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:24:11 +00:00
Snider
96d394435a feat(php): implement Laravel development environment support
Add pkg/php for Laravel/PHP development:
- Auto-detect Laravel project and required services
- FrankenPHP/Octane, Vite, Horizon, Reverb, Redis orchestration
- mkcert SSL integration for local HTTPS
- Unified log streaming with colored service prefixes
- Graceful shutdown handling

CLI commands:
- core php dev - start all services
- core php logs - unified/per-service logs
- core php stop - stop all services
- core php status - show service status
- core php ssl - setup SSL certificates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:14:06 +00:00