From af517e453f89c9faf95707c996a181a58db97458 Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Wed, 6 Dec 2023 22:29:09 +0000 Subject: [PATCH] fix: ensure module manifest doesn't reference template module name --- src/manifest.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/manifest.ts b/src/manifest.ts index c83b918..eae41aa 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -6,6 +6,10 @@ export { ModuleManifest, ModuleManifestMaintainer, ModuleManifestRuntime } /** Validate that a manifest looks correctly populated */ export function validateManifest(manifest: ModuleManifest): void { + const manifestStr = JSON.stringify(manifest) + if (manifestStr.includes('companion-module-your-module-name')) + throw new Error(`Manifest incorrectly references template module 'companion-module-your-module-name'`) + if (!validateManifestSchema(manifest)) { const errors = validateManifestSchema.errors if (!errors) throw new Error(`Manifest failed validation with unknown reason`)