Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b96062b621 | ||
|
|
35d31be9cf | ||
|
|
a36ae054c0 |
5 changed files with 38 additions and 31 deletions
28
.core/build.yaml
Normal file
28
.core/build.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
# Core PHP build configuration
|
||||||
|
# Used by: core build
|
||||||
|
|
||||||
|
version: 1
|
||||||
|
|
||||||
|
project:
|
||||||
|
name: core-php
|
||||||
|
description: PHP development CLI with FrankenPHP integration
|
||||||
|
main: ./cmd/core-php
|
||||||
|
binary: core-php
|
||||||
|
|
||||||
|
build:
|
||||||
|
cgo: false
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
ldflags:
|
||||||
|
- -s
|
||||||
|
- -w
|
||||||
|
|
||||||
|
targets:
|
||||||
|
- os: linux
|
||||||
|
arch: amd64
|
||||||
|
- os: linux
|
||||||
|
arch: arm64
|
||||||
|
- os: darwin
|
||||||
|
arch: arm64
|
||||||
|
- os: windows
|
||||||
|
arch: amd64
|
||||||
23
Taskfile.yml
23
Taskfile.yml
|
|
@ -1,23 +0,0 @@
|
||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
build:
|
|
||||||
desc: Build core-php binary
|
|
||||||
cmds:
|
|
||||||
- CGO_ENABLED=0 go build -o ./bin/core-php ./cmd/core-php
|
|
||||||
|
|
||||||
build-frankenphp:
|
|
||||||
desc: Build with FrankenPHP support (needs PHP-ZTS)
|
|
||||||
cmds:
|
|
||||||
- go build -o ./bin/core-php ./cmd/core-php
|
|
||||||
|
|
||||||
test:
|
|
||||||
desc: Run tests
|
|
||||||
cmds:
|
|
||||||
- CGO_ENABLED=0 go test ./...
|
|
||||||
|
|
||||||
run:
|
|
||||||
desc: Build and run
|
|
||||||
cmds:
|
|
||||||
- task: build
|
|
||||||
- ./bin/core-php {{.CLI_ARGS}}
|
|
||||||
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/cli"
|
"forge.lthn.ai/core/cli/pkg/cli"
|
||||||
"forge.lthn.ai/core/go/pkg/framework"
|
"forge.lthn.ai/core/go/pkg/core"
|
||||||
"forge.lthn.ai/core/go-i18n"
|
"forge.lthn.ai/core/go-i18n"
|
||||||
"forge.lthn.ai/core/go/pkg/process"
|
"forge.lthn.ai/core/go-process"
|
||||||
)
|
)
|
||||||
|
|
||||||
// QARunner orchestrates PHP QA checks using pkg/process.
|
// QARunner orchestrates PHP QA checks using pkg/process.
|
||||||
|
|
@ -17,7 +17,7 @@ type QARunner struct {
|
||||||
dir string
|
dir string
|
||||||
fix bool
|
fix bool
|
||||||
service *process.Service
|
service *process.Service
|
||||||
core *framework.Core
|
core *core.Core
|
||||||
|
|
||||||
// Output tracking
|
// Output tracking
|
||||||
outputMu sync.Mutex
|
outputMu sync.Mutex
|
||||||
|
|
@ -27,14 +27,14 @@ type QARunner struct {
|
||||||
// NewQARunner creates a QA runner for the given directory.
|
// NewQARunner creates a QA runner for the given directory.
|
||||||
func NewQARunner(dir string, fix bool) (*QARunner, error) {
|
func NewQARunner(dir string, fix bool) (*QARunner, error) {
|
||||||
// Create a Core with process service for the QA session
|
// Create a Core with process service for the QA session
|
||||||
core, err := framework.New(
|
core, err := core.New(
|
||||||
framework.WithName("process", process.NewService(process.Options{})),
|
core.WithName("process", process.NewService(process.Options{})),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, cli.WrapVerb(err, "create", "process service")
|
return nil, cli.WrapVerb(err, "create", "process service")
|
||||||
}
|
}
|
||||||
|
|
||||||
svc, err := framework.ServiceFor[*process.Service](core, "process")
|
svc, err := core.ServiceFor[*process.Service](core, "process")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, cli.WrapVerb(err, "get", "process service")
|
return nil, cli.WrapVerb(err, "get", "process service")
|
||||||
}
|
}
|
||||||
|
|
@ -238,7 +238,7 @@ func (r *QARunner) Run(ctx context.Context, stages []QAStage) (*QARunResult, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register output handler
|
// Register output handler
|
||||||
r.core.RegisterAction(func(c *framework.Core, msg framework.Message) error {
|
r.core.RegisterAction(func(c *core.Core, msg core.Message) error {
|
||||||
switch m := msg.(type) {
|
switch m := msg.(type) {
|
||||||
case process.ActionProcessOutput:
|
case process.ActionProcessOutput:
|
||||||
r.outputMu.Lock()
|
r.outputMu.Lock()
|
||||||
|
|
|
||||||
3
go.mod
3
go.mod
|
|
@ -4,15 +4,16 @@ go 1.26.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
forge.lthn.ai/core/cli v0.1.0
|
forge.lthn.ai/core/cli v0.1.0
|
||||||
forge.lthn.ai/core/go v0.1.0
|
|
||||||
forge.lthn.ai/core/go-i18n v0.1.0
|
forge.lthn.ai/core/go-i18n v0.1.0
|
||||||
forge.lthn.ai/core/go-io v0.0.1
|
forge.lthn.ai/core/go-io v0.0.1
|
||||||
|
forge.lthn.ai/core/go-process v0.1.0
|
||||||
github.com/dunglas/frankenphp v1.5.0
|
github.com/dunglas/frankenphp v1.5.0
|
||||||
github.com/stretchr/testify v1.11.1
|
github.com/stretchr/testify v1.11.1
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
forge.lthn.ai/core/go v0.1.0 // indirect
|
||||||
forge.lthn.ai/core/go-crypt v0.0.3 // indirect
|
forge.lthn.ai/core/go-crypt v0.0.3 // indirect
|
||||||
forge.lthn.ai/core/go-inference v0.0.2 // indirect
|
forge.lthn.ai/core/go-inference v0.0.2 // indirect
|
||||||
forge.lthn.ai/core/go-log v0.0.1 // indirect
|
forge.lthn.ai/core/go-log v0.0.1 // indirect
|
||||||
|
|
|
||||||
1
go.sum
1
go.sum
|
|
@ -12,6 +12,7 @@ forge.lthn.ai/core/go-io v0.0.1 h1:N/GCl6Asusfr4gs53JZixJVtqcnerQ6GcxSN8F8iJXY=
|
||||||
forge.lthn.ai/core/go-io v0.0.1/go.mod h1:l+gG/G5TMIOTG8G7y0dg4fh1a7Suy8wCYVwsz4duV7M=
|
forge.lthn.ai/core/go-io v0.0.1/go.mod h1:l+gG/G5TMIOTG8G7y0dg4fh1a7Suy8wCYVwsz4duV7M=
|
||||||
forge.lthn.ai/core/go-log v0.0.1 h1:x/E6EfF9vixzqiLHQOl2KT25HyBcMc9qiBkomqVlpPg=
|
forge.lthn.ai/core/go-log v0.0.1 h1:x/E6EfF9vixzqiLHQOl2KT25HyBcMc9qiBkomqVlpPg=
|
||||||
forge.lthn.ai/core/go-log v0.0.1/go.mod h1:r14MXKOD3LF/sI8XUJQhRk/SZHBE7jAFVuCfgkXoZPw=
|
forge.lthn.ai/core/go-log v0.0.1/go.mod h1:r14MXKOD3LF/sI8XUJQhRk/SZHBE7jAFVuCfgkXoZPw=
|
||||||
|
forge.lthn.ai/core/go-process v0.1.0 h1:lRpliQuu/Omt+kAHMFoQYOb5PKEIKg8yTMchFhejpK8=
|
||||||
github.com/ProtonMail/go-crypto v1.3.0 h1:ILq8+Sf5If5DCpHQp4PbZdS1J7HDFRXz/+xKBiRGFrw=
|
github.com/ProtonMail/go-crypto v1.3.0 h1:ILq8+Sf5If5DCpHQp4PbZdS1J7HDFRXz/+xKBiRGFrw=
|
||||||
github.com/ProtonMail/go-crypto v1.3.0/go.mod h1:9whxjD8Rbs29b4XWbB8irEcE8KHMqaR2e7GWU1R+/PE=
|
github.com/ProtonMail/go-crypto v1.3.0/go.mod h1:9whxjD8Rbs29b4XWbB8irEcE8KHMqaR2e7GWU1R+/PE=
|
||||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
||||||
|
|
|
||||||
Reference in a new issue