Skip to content

🎥 Make videos programmatically with React

validate templates

Jonny Burgerd111fe2f5cf9
diff --git a/packages/create-video/src/templates.ts b/packages/create-video/src/templates.ts
index 59306045d0..632aecbee8 100644
--- a/packages/create-video/src/templates.ts
+++ b/packages/create-video/src/templates.ts
@@ -47,7 +47,7 @@ export const FEATURED_TEMPLATES: Template[] = [
},
{
homePageLabel: 'JavaScript',
- shortName: 'Hello World (Javascript)',
+ shortName: 'Hello World (JavaScript)',
org: 'remotion-dev',
repoName: 'template-helloworld-javascript',
description: 'The default starter template in plain JS',
diff --git a/packages/create-video/src/test/validate-templates.test.ts b/packages/create-video/src/test/validate-templates.test.ts
index 8dffc83270..64e3ce154f 100644
--- a/packages/create-video/src/test/validate-templates.test.ts
+++ b/packages/create-video/src/test/validate-templates.test.ts
@@ -8,13 +8,30 @@ const getFileForTemplate = (template: Template, file: string) => {
};
for (const template of FEATURED_TEMPLATES) {
- test(template.shortName + ' should have a package.json', async () => {
+ test(template.shortName + ' should have a valid package.json', async () => {
const packageLockJson = getFileForTemplate(template, 'package.json');
const res = await got(packageLockJson, {
throwHttpErrors: false,
});
expect(res.statusCode).toBe(200);
+ const body = JSON.parse(res.body);
+ expect(body.dependencies.remotion).toMatch(/^\^3/);
+ expect(body.dependencies['@remotion/cli']).toMatch(/^\^3/);
+ expect(body.dependencies.react).toMatch(/^\^?18/);
+ expect(body.dependencies['react-dom']).toMatch(/^\^?18/);
+
+ expect(body.devDependencies.prettier).toMatch(/^\^?2/);
+ expect(body.devDependencies.eslint).toMatch(/^\^?8/);
+ const eitherPluginOrConfig =
+ body.devDependencies['@remotion/eslint-config']?.match(/^\^3/) ||
+ body.devDependencies['@remotion/eslint-plugin']?.match(/^\^3/);
+
+ expect(eitherPluginOrConfig).toBeTruthy();
+
+ if (!template.shortName.includes('JavaScript')) {
+ expect(body.devDependencies.typescript).toMatch(/^\^?4/);
+ }
});
test(