NAME

Luv::CLI::Manifest - reads and writes a luv project's luv.json manifest

VERSION

version 0.001

SYNOPSIS

my $manifest = Luv::CLI::Manifest->new(
    path         => 'luv.json',
    project_name => 'my-game',
);
$manifest->save;

my $loaded = Luv::CLI::Manifest->new(path => 'luv.json');
$loaded->load;

DESCRIPTION

Owns the on-disk shape of a luv project's luv.json file: project identity, source/library/assets/build directory locations, and the dependency list. All commands that read or modify project state go through this class rather than touching JSON directly.

NAME

Luv::CLI::Manifest - reads and writes a luv project's luv.json manifest

METHODS

add_dependency($name, %info)

Adds a dependency to the manifest. Dies if a dependency with the same name (case-insensitively) already exists. %info may include url, ref, and path.

remove_dependency($name)

Removes a dependency by name (case-insensitive). Dies if it doesn't exist.

has_dependency($name)

Returns true if a dependency with the given name (case-insensitive) exists.

dependencies()

Returns a hashref of all dependencies, keyed by lowercase name.

project_name()

Returns the project's name.

source_dir()

Returns the configured source directory (default src).

library_dir()

Returns the configured library/vendor directory (default lib).

assets_dir()

Returns the configured assets directory (default assets).

build_dir()

Returns the configured build output directory (default build).

output_name()

Returns the filename the built .love archive will be written as.

path()

Returns the path to the manifest file on disk.

to_hash()

Returns a plain hashref representation of the manifest, suitable for JSON encoding.

save()

Writes the manifest to path as JSON.

load()

Reads and parses the manifest from path, populating this object's fields.

exists_on_disk()

Returns true if the manifest file currently exists on disk.

AUTHOR

Nobunaga <nobunaga@cpan.org>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Nobunaga <nobunaga@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Ogun.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.