templateresidue

package
v0.4.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package templateresidue compares a project whose game.yaml records an origin of kind template against a bundled template and returns advisory warnings for files and metadata that are still unchanged.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(fsys fs.FS, templates []Template) []assetcheck.Problem

Check returns advisory warnings for a project in fsys whose game.yaml records an origin of kind template matching an entry in templates with non-nil Files: rule and data files still byte-identical to the template's, a name or window title still the template's, and a README.md or CREDITS.md still the template's. origin.keep leaves out the categories it names. A directory without a readable game.yaml, or with an origin of another kind or an unresolved or conflicting template, gets none.

func Kind

func Kind(name string) string

Kind returns the origin.keep category a template file counts toward ("rules" or "data"), or "" for a file the comparison leaves out: files game new renders from the project's name and module, project and build settings, the game brief, the template manifest, editor debug configuration under .vscode, CI workflows under .github, tests, playtest recordings and touch layouts.

Types

type Template

type Template struct {
	// Name is the template's name (origin.path), such as "cards2d".
	Name string
	// Module is the template's Go module path (origin.source), such as "github.com/nsgo-dev/game/template/cards2d".
	Module string
	// Files holds the template's files at its root; nil disables residue comparison for this template.
	Files fs.FS
}

Template describes one bundled project template that a project's origin may refer to.

func Resolve

func Resolve(o *project.Origin, templates []Template) (Template, bool)

Resolve finds the template in templates that o names: by path, or by module when path is empty. When o.Source names a template's Module, any recorded o.Path must agree with that template's Name.

Jump to

Keyboard shortcuts

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