Add directive checking

This commit is contained in:
Endeavorance 2025-02-25 13:27:26 -05:00
parent 8b276cc226
commit d4eb0c8a4f
4 changed files with 11 additions and 6 deletions

View file

@ -4,7 +4,7 @@
"": { "": {
"name": "@proscenium/muse", "name": "@proscenium/muse",
"dependencies": { "dependencies": {
"@proscenium/playbill": "0.0.5", "@proscenium/playbill": "0.0.2",
"chalk": "^5.4.1", "chalk": "^5.4.1",
"yaml": "^2.7.0", "yaml": "^2.7.0",
"zod": "^3.24.1", "zod": "^3.24.1",
@ -37,7 +37,7 @@
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@1.9.4", "", { "os": "win32", "cpu": "x64" }, "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA=="], "@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@1.9.4", "", { "os": "win32", "cpu": "x64" }, "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA=="],
"@proscenium/playbill": ["@proscenium/playbill@0.0.5", "https://git.astral.camp/api/packages/proscenium/npm/%40proscenium%2Fplaybill/-/0.0.5/playbill-0.0.5.tgz", { "peerDependencies": { "typescript": "^5" } }, "sha512-4TzEe3LpZ2WAep/OWtuNoGiRb2NilfBBN9KQ65/sYSkmBq4Wtdploqo/7+R1Twja/AvOBGgw+Art12beywhqtQ=="], "@proscenium/playbill": ["@proscenium/playbill@0.0.2", "https://git.astral.camp/api/packages/proscenium/npm/%40proscenium%2Fplaybill/-/0.0.2/playbill-0.0.2.tgz", { "peerDependencies": { "typescript": "^5" } }, "sha512-eXrfAK9xQzr0AnY3QJcY+DujWafJh6ntO5KYDdhWE4HE5VfWrLVk42LVFlM7HDkulnjwa6uvwaET2QrR3RWKlw=="],
"@types/bun": ["@types/bun@1.2.3", "", { "dependencies": { "bun-types": "1.2.3" } }, "sha512-054h79ipETRfjtsCW9qJK8Ipof67Pw9bodFWmkfkaUaRiIQ1dIV2VTlheshlBx3mpKr0KeK8VqnMMCtgN9rQtw=="], "@types/bun": ["@types/bun@1.2.3", "", { "dependencies": { "bun-types": "1.2.3" } }, "sha512-054h79ipETRfjtsCW9qJK8Ipof67Pw9bodFWmkfkaUaRiIQ1dIV2VTlheshlBx3mpKr0KeK8VqnMMCtgN9rQtw=="],

View file

@ -14,7 +14,7 @@
"chalk": "^5.4.1", "chalk": "^5.4.1",
"yaml": "^2.7.0", "yaml": "^2.7.0",
"zod": "^3.24.1", "zod": "^3.24.1",
"@proscenium/playbill": "0.0.5" "@proscenium/playbill": "0.0.2"
}, },
"scripts": { "scripts": {
"fmt": "bunx --bun biome check --fix", "fmt": "bunx --bun biome check --fix",

View file

@ -3,6 +3,3 @@ id: the-great-spires
name: The Great Spires name: The Great Spires
author: "Endeavorance <hello@endeavorance.camp>" author: "Endeavorance <hello@endeavorance.camp>"
version: 0.0.1 version: 0.0.1
files:
- ./spires/**/*.yaml
- ./spires/**/*.md

View file

@ -2,6 +2,7 @@ import { parseArgs } from "node:util";
import { import {
type AnyResource, type AnyResource,
ValidatedPlaybillSchema, ValidatedPlaybillSchema,
checkDirectives,
getEmptyPlaybill, getEmptyPlaybill,
} from "@proscenium/playbill"; } from "@proscenium/playbill";
import chalk from "chalk"; import chalk from "chalk";
@ -164,6 +165,13 @@ async function main(): Promise<number> {
return ExitCode.Error; return ExitCode.Error;
} }
const directiveValidationResult = checkDirectives(validatedPlaybill.data);
if (!directiveValidationResult) {
console.error("Error validating playbill directives");
return ExitCode.Error;
}
verboseLog("Playbill validated"); verboseLog("Playbill validated");
// -- EXIT EARLY IF JUST CHECKING VALIDATION --// // -- EXIT EARLY IF JUST CHECKING VALIDATION --//