Skip to content

🎥 Make videos programmatically with React

feat: integrate PAID_TEMPLATES into template selection logic

Shankhadeep Deyc5c62441633c
diff --git a/packages/create-video/src/select-template.ts b/packages/create-video/src/select-template.ts
index d5097c08f2..b6097b7f0e 100644
--- a/packages/create-video/src/select-template.ts
+++ b/packages/create-video/src/select-template.ts
@@ -3,14 +3,16 @@ import minimist from 'minimist';
import {makeHyperlink} from './hyperlinks/make-link';
import {selectAsync} from './prompts';
import type {Template} from './templates';
-import {FEATURED_TEMPLATES} from './templates';
+import {FEATURED_TEMPLATES, PAID_TEMPLATES} from './templates';
+
+const ALL_TEMPLATES = [...FEATURED_TEMPLATES, ...PAID_TEMPLATES];
type Options = {
tmp: boolean;
};
const parsed = minimist<Options>(process.argv.slice(2), {
- boolean: [...FEATURED_TEMPLATES.map((f) => f.cliId), 'tmp'],
+ boolean: [...ALL_TEMPLATES.map((f) => f.cliId), 'tmp'],
string: ['_'],
});
@@ -24,7 +26,7 @@ export const getDirectoryArgument = (): string | null => {
};
export const selectTemplate = async () => {
- const isFlagSelected = FEATURED_TEMPLATES.find((f) => {
+ const isFlagSelected = ALL_TEMPLATES.find((f) => {
return parsed[f.cliId];
});
@@ -36,7 +38,7 @@ export const selectTemplate = async () => {
message: 'Choose a template:',
optionsPerPage: 20,
- choices: FEATURED_TEMPLATES.map((template) => {
+ choices: ALL_TEMPLATES.map((template) => {
return {
value: template,
title: `${chalk.blue(template.shortName)}${
diff --git a/packages/create-video/src/templates.ts b/packages/create-video/src/templates.ts
index b636dedfaa..0960a0b37a 100644
--- a/packages/create-video/src/templates.ts
+++ b/packages/create-video/src/templates.ts
@@ -488,6 +488,9 @@ export const FEATURED_TEMPLATES: Template[] = [
templateInMonorepo: 'template-tiktok',
allowEnableTailwind: true,
},
+].filter(truthy);
+
+export const PAID_TEMPLATES = [
{
homePageLabel: 'Editor Starter',
shortName: 'Editor Starter',
@@ -496,17 +499,10 @@ export const FEATURED_TEMPLATES: Template[] = [
description: 'Professional Remotion Editor Starter (Paid)',
longerDescription:
'A premium starter for building a Remotion-based editor. Select to get the purchase link.',
- promoBanner: {
- src: '/img/template-editor-starter.png',
- width: 1200,
- height: 628,
- },
+
cliId: 'editor-starter' as const,
- type: 'image' as const,
defaultBranch: 'main',
- featuredOnHomePage: null,
- previewURL: null,
- templateInMonorepo: 'template-editor-starter',
- allowEnableTailwind: false,
+ previewURL: 'https://editor-starter.remotion.dev/',
+ purchaseURL: 'https://www.remotion.pro/editor-starter',
},
].filter(truthy);