projectfile

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package projectfile discovers and validates the structural ridu.toml file owned by a generated application.

Index

Constants

View Source
const CurrentVersion = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseAdapter

type DatabaseAdapter string

DatabaseAdapter is the closed set of official stores selectable by an ordinary project. Connection details remain runtime-owned and are not serialized into ridu.toml.

const (
	DatabasePostgres DatabaseAdapter = "postgres"
	DatabaseSQLite   DatabaseAdapter = "sqlite"
	DatabaseMongoDB  DatabaseAdapter = "mongodb"
)

type File

type File struct {
	Path               string
	Root               string
	Version            int
	Database           DatabaseAdapter
	PackageManager     PackageManager
	Entry              string
	Admin              string
	Client             string
	Schema             string
	OpenAPI            string
	Migrations         string
	Assets             string
	Plugins            string
	PluginGo           string
	GeneratedArtifacts []GeneratedArtifact
}

File is a validated project definition rooted at the directory containing ridu.toml. Structural paths are always relative and cannot escape Root.

func Discover

func Discover(start string) (File, error)

Discover walks from start toward the filesystem root until it finds ridu.toml.

func Load

func Load(path string) (File, error)

Load parses and validates one versioned project file.

func (File) Absolute

func (project File) Absolute(relative string) string

Absolute resolves a validated project-relative path against Root.

func (File) FrontendPackageManager

func (project File) FrontendPackageManager() PackageManager

FrontendPackageManager returns the configured manager. Bun is the fallback only for projects created before package_manager was added to version 1.

type GeneratedArtifact

type GeneratedArtifact struct {
	Plugin string
	Name   string
	Path   string
}

GeneratedArtifact maps one compiled plugin artifact to a project-relative destination. Plugin and Name form the protocol identity.

type PackageManager

type PackageManager string

PackageManager is the frontend dependency manager selected by a project. Existing version-1 project files that omit the key retain Bun for backwards compatibility; newly scaffolded projects always write the selection.

const (
	PackageManagerBun  PackageManager = "bun"
	PackageManagerNPM  PackageManager = "npm"
	PackageManagerPNPM PackageManager = "pnpm"
	PackageManagerYarn PackageManager = "yarn"
)

func (PackageManager) Valid

func (manager PackageManager) Valid() bool

Valid reports whether manager is one of the supported frontend package managers.

Jump to

Keyboard shortcuts

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