2026-03-30 00:54:20 +00:00
|
|
|
// SPDX-License-Identifier: EUPL-1.2
|
2026-03-29 23:59:48 +00:00
|
|
|
|
feat(manifest): add compile step and marketplace index builder
Add manifest compilation (.core/manifest.yaml → core.json) with build
metadata (commit, tag, timestamp, signature) and marketplace index
generation by crawling directories for compiled or source manifests.
New files:
- manifest/compile.go: CompiledManifest, Compile(), ParseCompiled(),
WriteCompiled(), LoadCompiled(), MarshalJSON()
- marketplace/builder.go: Builder.BuildFromDirs(), BuildFromManifests(),
WriteIndex()
- cmd/scm/: CLI commands — compile, index, export
Tests: 26 new (12 manifest, 14 marketplace), all passing.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 13:45:24 +00:00
|
|
|
// Package scm provides CLI commands for manifest compilation and marketplace
|
|
|
|
|
// index generation.
|
|
|
|
|
//
|
|
|
|
|
// Commands:
|
|
|
|
|
// - compile: Compile .core/manifest.yaml into core.json
|
|
|
|
|
// - index: Build marketplace index from repository directories
|
|
|
|
|
// - export: Export a compiled manifest as JSON to stdout
|
|
|
|
|
package scm
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"forge.lthn.ai/core/cli/pkg/cli"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
cli.RegisterCommands(AddScmCommands)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Style aliases from shared package.
|
|
|
|
|
var (
|
|
|
|
|
successStyle = cli.SuccessStyle
|
|
|
|
|
errorStyle = cli.ErrorStyle
|
|
|
|
|
dimStyle = cli.DimStyle
|
|
|
|
|
valueStyle = cli.ValueStyle
|
|
|
|
|
numberStyle = cli.NumberStyle
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// AddScmCommands registers the 'scm' command and all subcommands.
|
2026-03-30 14:11:15 +00:00
|
|
|
// Usage: AddScmCommands(...)
|
feat(manifest): add compile step and marketplace index builder
Add manifest compilation (.core/manifest.yaml → core.json) with build
metadata (commit, tag, timestamp, signature) and marketplace index
generation by crawling directories for compiled or source manifests.
New files:
- manifest/compile.go: CompiledManifest, Compile(), ParseCompiled(),
WriteCompiled(), LoadCompiled(), MarshalJSON()
- marketplace/builder.go: Builder.BuildFromDirs(), BuildFromManifests(),
WriteIndex()
- cmd/scm/: CLI commands — compile, index, export
Tests: 26 new (12 manifest, 14 marketplace), all passing.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 13:45:24 +00:00
|
|
|
func AddScmCommands(root *cli.Command) {
|
|
|
|
|
scmCmd := &cli.Command{
|
|
|
|
|
Use: "scm",
|
|
|
|
|
Short: "SCM manifest and marketplace operations",
|
|
|
|
|
Long: "Compile manifests, build marketplace indexes, and export distribution metadata.",
|
|
|
|
|
}
|
|
|
|
|
root.AddCommand(scmCmd)
|
|
|
|
|
|
|
|
|
|
addCompileCommand(scmCmd)
|
|
|
|
|
addIndexCommand(scmCmd)
|
|
|
|
|
addExportCommand(scmCmd)
|
|
|
|
|
}
|