@revideo/create 0.4.2-red.992 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/default/package.json +7 -7
- package/examples/saas-template/next/app/page.tsx +14 -9
- package/examples/saas-template/next/package.json +1 -1
- package/examples/saas-template/revideo/package.json +7 -7
- package/examples/saas-template/revideo/src/project.meta +2 -2
- package/index.js +22 -5
- package/package.json +9 -9
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"render": "tsc && node dist/render.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@revideo/core": "^0.4.
|
|
13
|
-
"@revideo/2d": "^0.4.
|
|
14
|
-
"@revideo/renderer": "^0.4.
|
|
15
|
-
"@revideo/vite-plugin": "^0.4.
|
|
16
|
-
"@revideo/ffmpeg": "^0.4.
|
|
12
|
+
"@revideo/core": "^0.4.2",
|
|
13
|
+
"@revideo/2d": "^0.4.2",
|
|
14
|
+
"@revideo/renderer": "^0.4.2",
|
|
15
|
+
"@revideo/vite-plugin": "^0.4.2",
|
|
16
|
+
"@revideo/ffmpeg": "^0.4.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@revideo/ui": "^0.4.
|
|
20
|
-
"@revideo/cli": "^0.4.
|
|
19
|
+
"@revideo/ui": "^0.4.2",
|
|
20
|
+
"@revideo/cli": "^0.4.2",
|
|
21
21
|
"typescript": "^5.2.2",
|
|
22
22
|
"vite": "^4.5"
|
|
23
23
|
}
|
|
@@ -19,6 +19,7 @@ function Button({
|
|
|
19
19
|
<button
|
|
20
20
|
className="text-sm flex items-center gap-x-2 rounded-md p-2 bg-gray-200 text-gray-700 hover:bg-gray-300"
|
|
21
21
|
onClick={() => onClick()}
|
|
22
|
+
disabled={loading}
|
|
22
23
|
>
|
|
23
24
|
{loading && <LoaderCircle className="animate-spin h-4 w-4 text-gray-700" />}
|
|
24
25
|
{children}
|
|
@@ -31,11 +32,12 @@ export default function Home() {
|
|
|
31
32
|
const [repoImage, setRepoImage] = useState<string | null>();
|
|
32
33
|
const [stargazerTimes, setStargazerTimes] = useState<number[]>([]);
|
|
33
34
|
|
|
34
|
-
const [
|
|
35
|
+
const [githubLoading, setGithubLoading] = useState(false);
|
|
35
36
|
const [needsKey, setNeedsKey] = useState(false);
|
|
36
37
|
const [key, setKey] = useState('');
|
|
37
38
|
const [error, setError] = useState<string | null>();
|
|
38
39
|
|
|
40
|
+
const [renderLoading, setRenderLoading] = useState(false);
|
|
39
41
|
const [progress, setProgress] = useState(0);
|
|
40
42
|
const [downloadUrl, setDownloadUrl] = useState<string | null>(null);
|
|
41
43
|
|
|
@@ -46,9 +48,9 @@ export default function Home() {
|
|
|
46
48
|
* @returns
|
|
47
49
|
*/
|
|
48
50
|
async function fetchInformation(repoName: `${string}/${string}`, key: string) {
|
|
49
|
-
|
|
51
|
+
setGithubLoading(true);
|
|
50
52
|
const response = await getGithubRepositoryInfo(repoName, key ?? undefined);
|
|
51
|
-
|
|
53
|
+
setGithubLoading(false);
|
|
52
54
|
|
|
53
55
|
if (response.status === 'rate-limit') {
|
|
54
56
|
setNeedsKey(true);
|
|
@@ -68,6 +70,7 @@ export default function Home() {
|
|
|
68
70
|
* Render the video.
|
|
69
71
|
*/
|
|
70
72
|
async function render() {
|
|
73
|
+
setRenderLoading(true);
|
|
71
74
|
const res = await fetch('/api/render', {
|
|
72
75
|
method: 'POST',
|
|
73
76
|
headers: {
|
|
@@ -75,19 +78,21 @@ export default function Home() {
|
|
|
75
78
|
},
|
|
76
79
|
body: JSON.stringify({
|
|
77
80
|
variables: {
|
|
78
|
-
data: stargazerTimes,
|
|
79
|
-
repoName: repoName,
|
|
80
|
-
repoImage: repoImage,
|
|
81
|
+
data: stargazerTimes.length ? stargazerTimes : undefined,
|
|
82
|
+
repoName: repoName || undefined,
|
|
83
|
+
repoImage: repoImage || undefined,
|
|
81
84
|
},
|
|
82
85
|
streamProgress: true,
|
|
83
86
|
}),
|
|
84
87
|
}).catch((e) => console.log(e));
|
|
85
88
|
|
|
86
89
|
if (!res) {
|
|
90
|
+
alert('Failed to render video.');
|
|
87
91
|
return;
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
const downloadUrl = await parseStream(res.body!.getReader(), (p) => setProgress(p));
|
|
95
|
+
setRenderLoading(false);
|
|
91
96
|
setDownloadUrl(downloadUrl);
|
|
92
97
|
}
|
|
93
98
|
|
|
@@ -105,7 +110,7 @@ export default function Home() {
|
|
|
105
110
|
/>
|
|
106
111
|
{!needsKey && (
|
|
107
112
|
<Button
|
|
108
|
-
loading={
|
|
113
|
+
loading={githubLoading}
|
|
109
114
|
onClick={() => fetchInformation(repoName as `${string}/${string}`, key)}
|
|
110
115
|
>
|
|
111
116
|
Fetch information
|
|
@@ -127,7 +132,7 @@ export default function Home() {
|
|
|
127
132
|
onChange={(e) => setKey(e.target.value)}
|
|
128
133
|
/>
|
|
129
134
|
<Button
|
|
130
|
-
loading={
|
|
135
|
+
loading={githubLoading}
|
|
131
136
|
onClick={() => fetchInformation(repoName as `${string}/${string}`, key)}
|
|
132
137
|
>
|
|
133
138
|
Fetch information
|
|
@@ -171,7 +176,7 @@ export default function Home() {
|
|
|
171
176
|
Download video
|
|
172
177
|
</a>
|
|
173
178
|
) : (
|
|
174
|
-
<Button onClick={() => render()} loading={
|
|
179
|
+
<Button onClick={() => render()} loading={renderLoading}>
|
|
175
180
|
Render video
|
|
176
181
|
</Button>
|
|
177
182
|
)}
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"render": "tsc && node dist/render.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@revideo/core": "0.4.
|
|
13
|
-
"@revideo/2d": "0.4.
|
|
14
|
-
"@revideo/renderer": "0.4.
|
|
15
|
-
"@revideo/vite-plugin": "0.4.
|
|
16
|
-
"@revideo/ffmpeg": "0.4.
|
|
12
|
+
"@revideo/core": "0.4.2",
|
|
13
|
+
"@revideo/2d": "0.4.2",
|
|
14
|
+
"@revideo/renderer": "0.4.2",
|
|
15
|
+
"@revideo/vite-plugin": "0.4.2",
|
|
16
|
+
"@revideo/ffmpeg": "0.4.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@revideo/ui": "0.4.
|
|
20
|
-
"@revideo/cli": "0.4.
|
|
19
|
+
"@revideo/ui": "0.4.2",
|
|
20
|
+
"@revideo/cli": "0.4.2",
|
|
21
21
|
"typescript": "^5.2.2",
|
|
22
22
|
"vite": "^4.5"
|
|
23
23
|
}
|
package/index.js
CHANGED
|
@@ -108,19 +108,36 @@ async function run() {
|
|
|
108
108
|
|
|
109
109
|
// Tell user that the process is complete
|
|
110
110
|
const manager = getPackageManager();
|
|
111
|
-
console.log(
|
|
111
|
+
console.log(
|
|
112
|
+
kleur.green(
|
|
113
|
+
'\n√ Scaffolding complete. Run the following commands to get started:',
|
|
114
|
+
),
|
|
115
|
+
);
|
|
112
116
|
if (response.path !== process.cwd()) {
|
|
113
117
|
console.log(
|
|
114
118
|
` ${kleur.bold('cd')} ${path.relative(process.cwd(), response.path)}`,
|
|
115
119
|
);
|
|
116
120
|
}
|
|
121
|
+
|
|
117
122
|
const boldManager = kleur.bold(manager);
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
const installCommand =
|
|
124
|
+
manager === 'yarn' ? ` ${boldManager}` : ` ${boldManager} install`;
|
|
125
|
+
|
|
126
|
+
if (response.starter == 'default') {
|
|
127
|
+
console.log(installCommand);
|
|
120
128
|
console.log(` ${boldManager} start`);
|
|
121
129
|
} else {
|
|
122
|
-
console.log(
|
|
123
|
-
console.log(` ${
|
|
130
|
+
console.log(kleur.blue('\n√ Start the NextJS server:'));
|
|
131
|
+
console.log(` ${kleur.bold('cd')} next`);
|
|
132
|
+
console.log(installCommand);
|
|
133
|
+
console.log(` ${boldManager} run dev`);
|
|
134
|
+
|
|
135
|
+
console.log(
|
|
136
|
+
kleur.blue('\nIn another terminal, serve your revideo project:'),
|
|
137
|
+
);
|
|
138
|
+
console.log(` ${kleur.bold('cd')} revideo`);
|
|
139
|
+
console.log(installCommand);
|
|
140
|
+
console.log(` ${kleur.bold('npx')} revideo serve`);
|
|
124
141
|
}
|
|
125
142
|
console.log();
|
|
126
143
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revideo/create",
|
|
3
|
-
"version": "0.4.2
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Quickly scaffold revideo projects",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "revideo",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"url": "https://github.com/havenhq/revideo.git"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@revideo/2d": "
|
|
24
|
-
"@revideo/core": "
|
|
25
|
-
"@revideo/ffmpeg": "
|
|
26
|
-
"@revideo/renderer": "
|
|
27
|
-
"@revideo/ui": "
|
|
28
|
-
"@revideo/vite-plugin": "
|
|
23
|
+
"@revideo/2d": "0.4.2",
|
|
24
|
+
"@revideo/core": "0.4.2",
|
|
25
|
+
"@revideo/ffmpeg": "0.4.2",
|
|
26
|
+
"@revideo/renderer": "0.4.2",
|
|
27
|
+
"@revideo/ui": "0.4.2",
|
|
28
|
+
"@revideo/vite-plugin": "0.4.2"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@revideo/telemetry": "
|
|
31
|
+
"@revideo/telemetry": "0.4.2",
|
|
32
32
|
"minimist": "^1.2.8",
|
|
33
33
|
"prompts": "^2.4.2"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "c4477ae1e4c1fff062566a493e6029728d2c7984"
|
|
36
36
|
}
|