## Summary - Extract PHP/Laravel commands to `core/php` repo (42 files, standalone module) - Extract CI/release + SDK commands to `core/ci` repo (10 files) - Remove `internal/variants/` build tag system entirely - Move all 30 remaining command packages from `internal/cmd/` to top-level `cmd/` - Rewrite `main.go` with direct imports — no more variant selection - PHP and CI are now optional via commented import lines in main.go Co-authored-by: Claude <developers@lethean.io> Reviewed-on: #2 Co-authored-by: Charon <charon@lthn.ai> Co-committed-by: Charon <charon@lthn.ai>
35 lines
840 B
Go
35 lines
840 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
// Read package.json
|
|
data, err := os.ReadFile("package.json")
|
|
if err != nil {
|
|
fmt.Println("Error reading package.json, skipping version file generation.")
|
|
os.Exit(0)
|
|
}
|
|
|
|
// Parse package.json
|
|
var pkg struct {
|
|
Version string `json:"version"`
|
|
}
|
|
if err := json.Unmarshal(data, &pkg); err != nil {
|
|
fmt.Println("Error parsing package.json, skipping version file generation.")
|
|
os.Exit(0)
|
|
}
|
|
|
|
// Create the version file
|
|
content := fmt.Sprintf("package updater\n\n// Generated by go:generate. DO NOT EDIT.\n\nconst PkgVersion = %q\n", pkg.Version)
|
|
err = os.WriteFile("version.go", []byte(content), 0644)
|
|
if err != nil {
|
|
fmt.Printf("Error writing version file: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
fmt.Println("Generated version.go with version:", pkg.Version)
|
|
}
|