Documentation
¶
Overview ¶
Package projectconfig finds, loads, and validates project configuration. it also runs TypeScript configuration files.
Index ¶
- Constants
- func ConfigNames() []string
- func NormalizeGitRemote(value string) (string, error)
- func ServiceWorktreeLabel(service string, worktree Worktree) string
- func SharedProjectIdentity(worktree Worktree, projectRoot string) string
- func SharedProjectLabel(role string, worktree Worktree, projectRoot string, salt [32]byte) string
- func TypeScriptKeyMappings() map[string]string
- type LocalPublicationIdentity
- type Project
- func (p Project) AppService(cwd, selected string) (string, error)
- func (p Project) CaptureServiceTrust(ctx context.Context, cache *targettrust.Cache, name, target string) (*targettrust.Snapshot, error)
- func (p Project) CaptureTargetTrust(ctx context.Context, cache *targettrust.Cache, name, discovered string) (*TargetTrustSnapshot, error)
- func (p Project) ComposeFile(name string) (string, error)
- func (p Project) ComposeProject(name string) (string, error)
- func (p Project) EffectiveService(name string) (config.TNL, error)
- func (p Project) Found() bool
- func (p Project) GitHubRepository(ctx context.Context) (string, error)
- func (p Project) LocalPublicationIdentity() LocalPublicationIdentity
- func (p Project) LocalWorktreeKey() string
- func (p Project) ResolvePublish(name, discovered string) (*config.Publish, error)
- func (p Project) Snapshot() ([]byte, string, error)
- func (p Project) SourceIdentity(ctx context.Context) (SourceIdentity, error)
- func (p Project) StaticMap() (map[string]any, error)
- type ProjectContext
- type Selection
- type SourceIdentity
- type TargetTrustSnapshot
- type Worktree
- type WorktreeLabel
Constants ¶
const MaxSnapshotBytes = 1 << 20
Variables ¶
This section is empty.
Functions ¶
func ConfigNames ¶
func ConfigNames() []string
ConfigNames returns the supported project configuration filenames in discovery order.
func NormalizeGitRemote ¶
func ServiceWorktreeLabel ¶
ServiceWorktreeLabel returns the built-in hostname label for one service.
func SharedProjectIdentity ¶
SharedProjectIdentity is the checkout-independent local state key.
func SharedProjectLabel ¶
SharedProjectLabel gives linked worktrees one label for project integration URLs.
func TypeScriptKeyMappings ¶
TypeScriptKeyMappings returns the static-to-TypeScript property mappings used by evaluation and declaration generation.
Types ¶
type LocalPublicationIdentity ¶
LocalPublicationIdentity identifies configured development services in this canonical project directory. Git initialization, origin changes and branches do not change it. it is not a portable source identity for apply or workloads.
type Project ¶
type Project struct {
Selection Selection
Config config.TNL
Declared *config.TNL
Worktree Worktree
Root string
}
Project is a selected and resolved project configuration.
func Resolve ¶
Resolve loads a selected project configuration and resolves its worktree and configuration. an empty selection still resolves cwd as a project so commands without a configuration file share the same identity.
func (Project) AppService ¶
AppService selects a configured app target. cwd identifies the project only; when more than one app is configured, the caller must select one by name.
func (Project) CaptureServiceTrust ¶
func (p Project) CaptureServiceTrust(ctx context.Context, cache *targettrust.Cache, name, target string) (*targettrust.Snapshot, error)
CaptureServiceTrust captures trust for a service's resolved target. the caller compares it with control's approved metadata before mutations.
func (Project) CaptureTargetTrust ¶
func (p Project) CaptureTargetTrust(ctx context.Context, cache *targettrust.Cache, name, discovered string) (*TargetTrustSnapshot, error)
CaptureTargetTrust reads the declared CA source at apply time. source paths and bundle URLs never enter the resulting declaration or remote worker.
func (Project) ComposeFile ¶
ComposeFile resolves a configured Compose file and rejects symlink escapes. the runtime receives an absolute file path for its explicit project command.
func (Project) ComposeProject ¶
ComposeProject derives a worktree-specific Compose project name unless the target explicitly selects an existing project.
func (Project) EffectiveService ¶
EffectiveService merges one named service over the root defaults.
func (Project) GitHubRepository ¶
GitHubRepository infers only github.com origins. source identity remains a separate checkout-independent contract and never carries job credentials.
func (Project) LocalPublicationIdentity ¶
func (p Project) LocalPublicationIdentity() LocalPublicationIdentity
func (Project) LocalWorktreeKey ¶
LocalWorktreeKey identifies this project directory without sending local paths to control. server, team and source identity remain separate scope checks.
func (Project) ResolvePublish ¶
ResolvePublish finishes private discovery and resolves a relative target CA path against the selected configuration's directory, independent of cwd.
func (Project) Snapshot ¶
Snapshot transfers an already evaluated configuration to a native owner. it stays in the private process pipe; metadata and journals never contain it.
func (Project) SourceIdentity ¶
func (p Project) SourceIdentity(ctx context.Context) (SourceIdentity, error)
type ProjectContext ¶
type ProjectContext struct {
RelativeDirectory string `json:"relativeDirectory"`
}
type SourceIdentity ¶
SourceIdentity is independent of checkout directory, branch and client state. the full fingerprint lets control reject a project-key collision.
type TargetTrustSnapshot ¶
TargetTrustSnapshot is portable publisher-to-target trust for every protocol. its CA-only material adds to system roots, independently of visitor TLS.
func (TargetTrustSnapshot) TargetTrust ¶
func (s TargetTrustSnapshot) TargetTrust() (*targettrust.Snapshot, error)
TargetTrust uses the same verifier for applied and local target trust.
func (TargetTrustSnapshot) Validate ¶
func (s TargetTrustSnapshot) Validate() error
type Worktree ¶
type Worktree struct {
Root string `json:"root"`
Name string `json:"name"`
Label WorktreeLabel `json:"label"`
IsGit bool `json:"isGit"`
// contains filtered or unexported fields
}
func ApplyWorktreeHashSalt ¶
func ResolveWorktree ¶
ResolveWorktree returns project facts and falls back to cwd when Git is unavailable or cwd is not inside a worktree. ApplyWorktreeHashSalt adds the client-state-specific label used in public hostnames.
func (Worktree) PrimaryCheckoutRoot ¶
PrimaryCheckoutRoot returns the primary Git checkout shared by linked worktrees.
type WorktreeLabel ¶
type WorktreeLabel struct {
Project string `json:"project"`
Checkout string `json:"checkout,omitempty"`
ID string `json:"id"`
FullLabel string `json:"fullLabel"`
}
WorktreeLabel exposes the DNS-safe pieces used in the finished label. the primary checkout has no checkout component.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
package githubmetadata resolves immutable repository metadata during trusted apply.
|
package githubmetadata resolves immutable repository metadata during trusted apply. |
|
package projectinit owns project initialization planning, safe edits, and project-local dependency installation.
|
package projectinit owns project initialization planning, safe edits, and project-local dependency installation. |
|
Package projectmeta validates and writes browser-safe project metadata.
|
Package projectmeta validates and writes browser-safe project metadata. |
|
package resolve composes project selection with client state and current server facts.
|
package resolve composes project selection with client state and current server facts. |
|
package sourcestate records bounded Git identifiers without saving source files.
|
package sourcestate records bounded Git identifiers without saving source files. |
|
package workloadmanifest owns the nonsecret build-to-runtime workload context.
|
package workloadmanifest owns the nonsecret build-to-runtime workload context. |