Skip to content

Commit bd755df

Browse files
committed
convert.remotion.dev -> remotion.dev/convert
1 parent 61dd2bf commit bd755df

File tree

9 files changed

+79
-26
lines changed

9 files changed

+79
-26
lines changed

packages/convert/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules
33
/.cache
44
build
55
.env
6+
spa-dist
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React, {useState} from 'react';
2+
import {SAMPLE_FILE, TEST_FAST} from '~/lib/config';
3+
import {Source} from '~/lib/convert-state';
4+
import {FileAvailable} from './FileAvailable';
5+
import {PickFile} from './PickFile';
6+
7+
export const Main: React.FC = () => {
8+
const [src, setSrc] = useState<Source | null>(
9+
TEST_FAST ? {type: 'url', url: SAMPLE_FILE} : null,
10+
);
11+
12+
return (
13+
<div className="font-sans min-h-screen bg-slate-50">
14+
{src ? (
15+
<FileAvailable
16+
key={src.type === 'url' ? src.url : src.file.name}
17+
src={src}
18+
setSrc={setSrc}
19+
/>
20+
) : (
21+
<PickFile setSrc={setSrc} />
22+
)}
23+
</div>
24+
);
25+
};
+3-23
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,15 @@
11
import type {MetaFunction} from '@remix-run/node';
2-
import {useState} from 'react';
3-
import {FileAvailable} from '~/components/FileAvailable';
4-
import {PickFile} from '~/components/PickFile';
5-
import {SAMPLE_FILE, TEST_FAST} from '~/lib/config';
6-
import {Source} from '~/lib/convert-state';
2+
import {Main} from '~/components/Main';
73

84
export const meta: MetaFunction = () => {
95
return [
106
{title: 'Remotion Convert'},
11-
{name: 'description', content: 'Fast video conersion in the browser.'},
7+
{name: 'description', content: 'Fast video conversion in the browser.'},
128
];
139
};
1410

1511
const Index = () => {
16-
const [src, setSrc] = useState<Source | null>(
17-
TEST_FAST ? {type: 'url', url: SAMPLE_FILE} : null,
18-
);
19-
20-
return (
21-
<div className="font-sans min-h-screen bg-slate-50">
22-
{src ? (
23-
<FileAvailable
24-
key={src.type === 'url' ? src.url : src.file.name}
25-
src={src}
26-
setSrc={setSrc}
27-
/>
28-
) : (
29-
<PickFile setSrc={setSrc} />
30-
)}
31-
</div>
32-
);
12+
return <Main />;
3313
};
3414

3515
export default Index;
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type {MetaFunction} from '@remix-run/node';
2+
import {Main} from '~/components/Main';
3+
4+
export const meta: MetaFunction = () => {
5+
return [
6+
{title: 'Remotion Convert'},
7+
{name: 'description', content: 'Fast video conversion in the browser.'},
8+
];
9+
};
10+
11+
const Index = () => {
12+
return <Main />;
13+
};
14+
15+
export default Index;

packages/convert/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"build-page": "remix vite:build",
9+
"build-spa": "remix vite:build -c vite-spa.config.ts",
910
"dev": "remix vite:dev",
1011
"typecheck": "tsc",
1112
"test": "bun test test",

packages/convert/vite-spa.config.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {vitePlugin as remix} from '@remix-run/dev';
2+
import {installGlobals} from '@remix-run/node';
3+
import path from 'path';
4+
import {defineConfig} from 'vite';
5+
import tsconfigPaths from 'vite-tsconfig-paths';
6+
7+
installGlobals();
8+
9+
export default defineConfig({
10+
plugins: [
11+
remix({ssr: false, buildDirectory: path.resolve(__dirname, 'spa-dist')}),
12+
tsconfigPaths(),
13+
],
14+
base: '/convert/',
15+
resolve: {
16+
alias: {
17+
'@': path.resolve(__dirname, './app'),
18+
},
19+
},
20+
});

packages/docs/copy-convert.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {$} from 'bun';
2+
import fs from 'fs';
3+
import path from 'path';
4+
5+
await $`bunx turbo "@remotion/convert#build-spa"`;
6+
7+
const dir = path.join(__dirname, '../convert/spa-dist/client');
8+
9+
fs.cpSync(dir, path.join(__dirname, './build/convert'), {recursive: true});

packages/docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"docusaurus": "docusaurus",
1111
"start": "docusaurus start --host 0.0.0.0",
1212
"start-docs": "docusaurus start",
13-
"build-docs": "DOCUSAURUS_IGNORE_SSG_WARNINGS=true node --max_old_space_size=16000 node_modules/@docusaurus/core/bin/docusaurus.mjs build && bun count-pages.ts",
13+
"build-docs": "DOCUSAURUS_IGNORE_SSG_WARNINGS=true node --max_old_space_size=16000 node_modules/@docusaurus/core/bin/docusaurus.mjs build && bun copy-convert.ts && bun count-pages.ts",
1414
"swizzle": "docusaurus swizzle",
1515
"deploy": "docusaurus deploy",
1616
"serve": "docusaurus serve",

turbo.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@
8787
"outputs": ["build", ".vercel"],
8888
"outputLogs": "new-only"
8989
},
90-
"convert": {
91-
"dependsOn": ["^@remotion/convert#build-page"]
90+
"@remotion/convert#build-spa": {
91+
"dependsOn": ["^@remotion/webcodecs#make"],
92+
"outputs": ["spa-dist"],
93+
"outputLogs": "new-only"
9294
}
9395
}
9496
}

0 commit comments

Comments
 (0)