🎥 Make videos programmatically with React
write some docs
Jonny Burgercd92aa9367e1
diff --git a/packages/compositor-darwin-arm64/remotion b/packages/compositor-darwin-arm64/remotionindex c7d6478166..515981eea0 100755Binary files a/packages/compositor-darwin-arm64/remotion and b/packages/compositor-darwin-arm64/remotion differdiff --git a/packages/docs/docs/licensing/TableOfContents.tsx b/packages/docs/docs/licensing/TableOfContents.tsxnew file mode 100644index 0000000000..1dcc1e5a45--- /dev/null+++ b/packages/docs/docs/licensing/TableOfContents.tsx@@ -0,0 +1,16 @@+import React from 'react';+import {Grid} from '../../components/TableOfContents/Grid';+import {TOCItem} from '../../components/TableOfContents/TOCItem';++export const TableOfContents: React.FC = () => {+ return (+ <div>+ <Grid>+ <TOCItem link="/docs/webcodecs/convert-media">+ <strong>{'convertMedia()'}</strong>+ <div>Converts a video using WebCodecs and Media Parser</div>+ </TOCItem>+ </Grid>+ </div>+ );+};diff --git a/packages/docs/docs/licensing/get-usage.mdx b/packages/docs/docs/licensing/get-usage.mdxnew file mode 100644index 0000000000..e69de29bb2diff --git a/packages/docs/docs/licensing/index.mdx b/packages/docs/docs/licensing/index.mdxnew file mode 100644index 0000000000..480357d093--- /dev/null+++ b/packages/docs/docs/licensing/index.mdx@@ -0,0 +1,25 @@+---+sidebar_label: Overview+title: '@remotion/licensing'+---++_available from v4.0.237_++This package allows holders of the [company license](https://remotion.pro/license) to send events to Remotion to track the following usage of Remotion products:++- Cloud renders+- WebCodecs conversions++Also, it offers an API to programmatically check the usage in order to implement spend controls.++## Installation++<Installation pkg="@remotion/licensing" />++import {TableOfContents} from './TableOfContents';++<TableOfContents />++## license++[Remotion License](https://remotion.dev/license)diff --git a/packages/docs/docs/licensing/register-usage-point.mdx b/packages/docs/docs/licensing/register-usage-point.mdxnew file mode 100644index 0000000000..e69de29bb2diff --git a/packages/docs/package.json b/packages/docs/package.jsonindex faa88701c8..054d1a10c0 100644--- a/packages/docs/package.json+++ b/packages/docs/package.json@@ -46,6 +46,7 @@"@remotion/install-whisper-cpp": "workspace:*","@remotion/lambda": "workspace:*","@remotion/layout-utils": "workspace:*",+ "@remotion/licensing": "workspace:*","@remotion/lottie": "workspace:*","@remotion/media-utils": "workspace:*","@remotion/motion-blur": "workspace:*",diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex c1546f3443..27bcca32da 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -640,6 +640,15 @@ module.exports = {},items: ['fonts-api/load-font'],},+ {+ type: 'category',+ label: '@remotion/licensing',+ link: {+ type: 'doc',+ id: 'licensing/index',+ },+ items: ['licensing/register-usage-point', 'licensing/get-usage'],+ },],mainSidebar: [{diff --git a/packages/licensing/src/index.ts b/packages/licensing/src/index.tsindex 7db220961a..432710d7c4 100644--- a/packages/licensing/src/index.ts+++ b/packages/licensing/src/index.ts@@ -1,5 +1,5 @@-import {registerCompanyLicenseUsageEvent} from './register-company-license-usage-point';--export const LicensingInternals = {- trackWebCodecConversion: registerCompanyLicenseUsageEvent,-};+export {+ UsageEventClassification as Classification,+ RegisterUsageEventResponse,+ registerUsageEvent,+} from './register-usage-point';diff --git a/packages/licensing/src/register-company-license-usage-point.ts b/packages/licensing/src/register-usage-point.tssimilarity index 66%rename from packages/licensing/src/register-company-license-usage-point.tsrename to packages/licensing/src/register-usage-point.tsindex f453288000..eacca6b72a 100644--- a/packages/licensing/src/register-company-license-usage-point.ts+++ b/packages/licensing/src/register-usage-point.ts@@ -4,24 +4,24 @@ type ApiResponse =| {success: true;billable: boolean;- classification: Classification;+ classification: UsageEventClassification;}| {success: false;error: string;};-export type TrackWebCodecConversionResponse = {+export type RegisterUsageEventResponse = {success: true;billable: boolean;- classification: Classification;+ classification: UsageEventClassification;};-type CompanyLicenseUsageEvent = 'webcodec-conversion' | 'cloud-render';+type UsageEventType = 'webcodec-conversion' | 'cloud-render';-export type Classification = 'billable' | 'development' | 'failed';+export type UsageEventClassification = 'billable' | 'development' | 'failed';-export const registerCompanyLicenseUsageEvent = async ({+export const registerUsageEvent = async ({apiKey,host,succeeded,@@ -30,8 +30,8 @@ export const registerCompanyLicenseUsageEvent = async ({apiKey: string;host: string;succeeded: boolean;- event: CompanyLicenseUsageEvent;-}): Promise<TrackWebCodecConversionResponse> => {+ event: UsageEventType;+}): Promise<RegisterUsageEventResponse> => {const res = await fetch(`${HOST}/api/track`, {method: 'POST',body: JSON.stringify({diff --git a/packages/licensing/src/test/register.test.ts b/packages/licensing/src/test/register.test.tsindex d6507951af..78e5233efe 100644--- a/packages/licensing/src/test/register.test.ts+++ b/packages/licensing/src/test/register.test.ts@@ -2,10 +2,10 @@// of a Remotion team member with an instance of remotion.pro running locallyimport {expect, test} from 'bun:test';-import {registerCompanyLicenseUsageEvent} from '../register-company-license-usage-point';+import {registerUsageEvent} from '../register-usage-point';test('Should be able to track production usage', async () => {- const result = await registerCompanyLicenseUsageEvent({+ const result = await registerUsageEvent({apiKey: 'rm_pub_1dd7193534bbe72571b55bd43926654ddaaca3dd6f07772b',host: 'http://localhost:50955',succeeded: true,@@ -19,7 +19,7 @@ test('Should be able to track production usage', async () => {});test('Should be able to track development usage', async () => {- const result = await registerCompanyLicenseUsageEvent({+ const result = await registerUsageEvent({apiKey: 'rm_pub_1dd7193534bbe72571b55bd43926654ddaaca3dd6f07772b',host: 'https://remotion.dev',succeeded: true,@@ -33,7 +33,7 @@ test('Should be able to track development usage', async () => {});test('Should reject invalid API key', async () => {- const result = registerCompanyLicenseUsageEvent({+ const result = registerUsageEvent({apiKey: 'rm_pub_1dd719b',host: 'http://localhost:50955',succeeded: true,@@ -43,7 +43,7 @@ test('Should reject invalid API key', async () => {});test('Should reject invalid secret API key', async () => {- const result = registerCompanyLicenseUsageEvent({+ const result = registerUsageEvent({apiKey: 'rm_sec_1dd719b',host: 'http://localhost:50955',succeeded: true,diff --git a/packages/licensing/tsconfig.json b/packages/licensing/tsconfig.jsonindex 5b9931e6fc..fb02538ad5 100644--- a/packages/licensing/tsconfig.json+++ b/packages/licensing/tsconfig.json@@ -4,8 +4,7 @@"rootDir": "src","outDir": "dist","jsx": "react-jsx",- "skipLibCheck": true,- "target": "ES2023"+ "skipLibCheck": true},"include": ["src"],"references": []diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex a7a2e382aa..bda36051c8 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -623,6 +623,9 @@ importers:'@remotion/layout-utils':specifier: workspace:*version: link:../layout-utils+ '@remotion/licensing':+ specifier: workspace:*+ version: link:../licensing'@remotion/lottie':specifier: workspace:*version: link:../lottie