scripts/.lune/lib/manifest.luau
Erica Marigold 22552c0f80
refactor: restructure to use script package system
General restructuring
=====================
* Restructures to workspace with script packages for each tool choice.
* Include build script to generate package for every supported tool
  choice in library into the `.pesde/` directory.
* Remove testing .lune scripts for Rojo.

Manifest changes
================
* Exclude `.spec.luau` test files for library package.
* Include .pesde directory for library package.
* Add pathfs dev-dependency.
* Include metadata for build script package codegen.
* Use new git URL for index repo.
* Setup workspace including top level itself & tool choice script packages.

These changes require an unstable version of pesde: 2b2d280fe0.
2024-12-08 11:09:53 +00:00

71 lines
1.9 KiB
Text

local fs = require("@lune/fs")
local serde = require("@lune/serde")
export type SPDXLicense =
"MIT"
| "Apache-2.0"
| "BSD-2-Clause"
| "BSD-3-Clause"
| "GPL-2.0"
| "GPL-3.0"
| "LGPL-2.1"
| "LGPL-3.0"
| "MPL-2.0"
| "ISC"
| "Unlicense"
| "WTFPL"
| "Zlib"
| "CC0-1.0"
| "CC-BY-4.0"
| "CC-BY-SA-4.0"
| "BSL-1.0"
| "EPL-2.0"
| "AGPL-3.0"
export type DependencySpecifier = ((
{ name: string, version: string, index: string? }
| { workspace: string, version: string }
| { repo: string, rev: string, path: string? }
) & {
target: string?,
}) | { wally: string, version: string, index: string? }
export type PackageTarget = {
environment: "luau" | "lune" | "roblox" | "roblox_server",
lib: string,
} | ({ environment: "luau" | "lune" } & ({
bin: string,
} | {
scripts: { [string]: string },
}))
export type PesdeManifest<T = {}> = {
name: string,
version: string,
description: string?,
license: SPDXLicense?,
authors: { string }?,
repository: string?,
private: boolean?,
includes: { string }?,
pesde_version: string?,
workspace_members: { string }?,
target: PackageTarget,
build_files: { string }?,
scripts: { [string]: string }?,
indices: { [string]: string },
wally_indices: { [string]: string }?,
overrides: { [string]: DependencySpecifier }?,
patches: { [string]: { [string]: string } }?,
place: { [string]: string }?,
dependencies: { [string]: DependencySpecifier }?,
peer_dependencies: { [string]: DependencySpecifier }?,
dev_dependencies: { [string]: DependencySpecifier }?,
} & T
return function<T>(path: string?, _phantom: T): PesdeManifest<T>
local manifestContents = fs.readFile(path or "pesde.toml")
local decoded = serde.decode("toml", manifestContents)
return decoded :: PesdeManifest<T>
end