internal

package
v0.0.0-...-614400f Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConfig = fmt.Errorf("cannot find %s config file", configName)

Functions

func Build

func Build(repo *Repository, opts BuildOptions) error

func Clean

func Clean(repo *Repository) error

func Deps

func Deps(repo *Repository) error

func EnsureTmp

func EnsureTmp(repo *Repository) error

func Pack

func Pack(repo *Repository, pkg *Package) error

func Publish

func Publish(repo *Repository, pkg *Package) error

func Run

func Run(repo *Repository, opts RunOptions) error

func TempDir

func TempDir(repo *Repository, prefix string) (string, error)

func TempFile

func TempFile(repo *Repository, prefix string) (*os.File, error)

func WriteJSON

func WriteJSON(filename string, data interface{}) (err error)

func WritePackageJSON

func WritePackageJSON(metadata PackageMetadata, dir string) error

Types

type BuildOptions

type BuildOptions struct {
	Package *Package
	Version string
}

type Config

type Config struct {
	Packages     map[string]PackageConfig
	Dependencies map[string]string
}

func LoadConfig

func LoadConfig(filepath string) (*Config, error)

type Package

type Package struct {
	Name        string
	Public      bool
	Description string
	Entrypoint  string
}

type PackageConfig

type PackageConfig struct {
	Public      bool
	Description string
	Entrypoint  string
}

type PackageMetadata

type PackageMetadata struct {
	Name         string            `json:"name,omitempty"`
	Description  string            `json:"description,omitempty"`
	Version      string            `json:"version,omitempty"`
	Private      bool              `json:"private"`
	Main         string            `json:"main,omitempty"`
	Dependencies map[string]string `json:"dependencies"`
}

func ReadPackageJSON

func ReadPackageJSON(dir string) (*PackageMetadata, error)

type Repository

type Repository struct {
	ConfigPath   string
	RootDir      string
	OutDir       string
	DistDir      string
	TmpDir       string
	Packages     map[string]*Package
	Dependencies map[string]string
}

func LoadRepository

func LoadRepository(searchDir string) (*Repository, error)

type RunOptions

type RunOptions struct {
	Watch      bool
	Entrypoint string
	Args       []string
}

Jump to

Keyboard shortcuts

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