apps

package
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectFiles

func CollectFiles(app AppConfig) ([]string, error)

CollectFiles returns all files under dir matching glob, project-root relative.

func ExecutePush

func ExecutePush(ctx context.Context, client *api.Client, app AppConfig, result Result) error

ExecutePush uploads/updates/deletes remote app files.

func ExplicitFiles

func ExplicitFiles(discovered []string, explicit []string) ([]string, error)

ExplicitFiles intersects discovered files with explicit project-relative selections.

func NormalizeHost

func NormalizeHost(raw string) string

NormalizeHost converts an API URL into the stored host form.

func OrderFiles

func OrderFiles(app AppConfig, files []string, provided ...map[string]string) ([]string, error)

OrderFiles topologically orders files by local import/require dependencies.

func RemoteName

func RemoteName(app AppConfig, projectRel string) string

Types

type AppConfig

type AppConfig struct {
	config.AppProjectConfig
	ProjectRoot string
}

AppConfig is one resolved local app config.

func ResolveApp

func ResolveApp(candidates []AppConfig, requested string) (AppConfig, error)

ResolveApp selects one app by local name.

func VisibleApps

func VisibleApps(projectRoot string, project config.ProjectConfig, activeHost, activeSite string) []AppConfig

VisibleApps filters apps by active host/site.

type FileAction

type FileAction struct {
	Action string `json:"action"`
	Local  string `json:"local,omitempty"`
	Name   string `json:"name"`
}

FileAction describes one cloud-code operation.

type PushPlan

type PushPlan struct {
	Uploads []FileAction `json:"uploads,omitempty"`
	Deletes []FileAction `json:"deletes,omitempty"`
}

PushPlan groups upload/delete work.

func BuildPushPlan

func BuildPushPlan(app AppConfig, localFiles []string, remoteFiles []api.AppCodeFile, sync bool) PushPlan

BuildPushPlan computes upload/delete actions.

type Result

type Result struct {
	AppKey    string       `json:"app_key"`
	LocalName string       `json:"local_name"`
	Files     []string     `json:"files,omitempty"`
	Uploads   []FileAction `json:"uploads,omitempty"`
	Created   []FileAction `json:"created,omitempty"`
	Updated   []FileAction `json:"updated,omitempty"`
	Deleted   []FileAction `json:"deleted,omitempty"`
	Sync      bool         `json:"sync,omitempty"`
}

Result is emitted by apps push.

func PlanPush

func PlanPush(ctx context.Context, client *api.Client, app AppConfig, selected []string, sync bool) (Result, []string, error)

PlanPush computes a structured push result from local and remote files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL