🎥 Make videos programmatically with React
feat: add 'Editor Starter' template with purchase link and update selection logic
Shankhadeep Dey817920aafdcc
diff --git a/packages/create-video/src/init.ts b/packages/create-video/src/init.tsindex dab219a752..dfd0b6a465 100644--- a/packages/create-video/src/init.ts+++ b/packages/create-video/src/init.ts@@ -90,6 +90,18 @@ export const init = async () => {const selectedTemplate = await selectTemplate();Log.info(`Selected ${chalk.blue(selectedTemplate.shortName)}.`);+ // If Editor Starter (paid) is selected, show purchase link and exit+ if (selectedTemplate.cliId === 'editor-starter') {+ Log.newLine();+ Log.info(+ `${chalk.yellow('Editor Starter is a paid template.')}\nGet it here: ${chalk.underline(+ 'https://www.remotion.pro/editor-starter',+ )}`,+ );+ Log.newLine();+ return;+ }+// Then resolve project root with template info and directory argumentconst {projectRoot, folderName} = await resolveProjectRoot({directoryArgument,diff --git a/packages/create-video/src/select-template.ts b/packages/create-video/src/select-template.tsindex a08d09a234..9694e9c65a 100644--- a/packages/create-video/src/select-template.ts+++ b/packages/create-video/src/select-template.ts@@ -1,6 +1,5 @@import chalk from 'chalk';import minimist from 'minimist';-import {makeHyperlink} from './hyperlinks/make-link';import {selectAsync} from './prompts';import type {Template} from './templates';import {FEATURED_TEMPLATES} from './templates';@@ -39,15 +38,11 @@ export const selectTemplate = async () => {choices: FEATURED_TEMPLATES.map((template) => {return {value: template,- title: `${chalk.blue(template.shortName)}${chalk.reset(- ` ${chalk.gray(template.description.trim())} ${chalk.gray(- makeHyperlink({- text: '(?)',- url: `https://remotion.dev/templates/${template.cliId}`,- fallback: '',- }),- )}`,- )}`,+ title: `${chalk.blue(template.shortName)}${+ template.cliId === 'editor-starter'+ ? ' ' + chalk.yellow('(Paid)')+ : ''+ }`,};}),})) as Template;diff --git a/packages/create-video/src/templates.ts b/packages/create-video/src/templates.tsindex 2ad9b5b640..b636dedfaa 100644--- a/packages/create-video/src/templates.ts+++ b/packages/create-video/src/templates.ts@@ -43,7 +43,8 @@ export type Template = {| 'tiktok'| 'code-hike'| 'render-server'- | 'recorder';+ | 'recorder'+ | 'editor-starter';defaultBranch: string;featuredOnHomePage: string | null;previewURL: string | null;@@ -487,4 +488,25 @@ export const FEATURED_TEMPLATES: Template[] = [templateInMonorepo: 'template-tiktok',allowEnableTailwind: true,},+ {+ homePageLabel: 'Editor Starter',+ shortName: 'Editor Starter',+ org: 'remotion-dev',+ repoName: 'editor-starter',+ 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,+ },].filter(truthy);