@revideo/create 0.1.4-alpha.877 → 0.1.4-alpha.878
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/index.js +5 -7
- package/package.json +6 -6
- package/template-2d-ts/node_modules/.vite/deps_temp_1df31ee2/package.json +3 -0
- package/template-2d-ts/package.json +1 -1
- package/template-2d-ts/src/project.meta +2 -2
- package/template-2d-ts/src/scenes/example.tsx +16 -36
- package/template-2d-ts/gitignore +0 -15
package/index.js
CHANGED
|
@@ -63,7 +63,7 @@ const PLUGINS = {
|
|
|
63
63
|
type: 'text',
|
|
64
64
|
name: 'name',
|
|
65
65
|
message: 'Project name',
|
|
66
|
-
initial: 'my-
|
|
66
|
+
initial: 'my-revideo-project',
|
|
67
67
|
validate: value =>
|
|
68
68
|
isValidPackageName(value)
|
|
69
69
|
? true
|
|
@@ -103,15 +103,13 @@ const PLUGINS = {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
const plugins = [PLUGINS.core, PLUGINS.ffmpeg];
|
|
106
|
-
const language = 'ts';
|
|
107
|
-
|
|
108
106
|
const templateDir = path.resolve(
|
|
109
107
|
fileURLToPath(import.meta.url),
|
|
110
108
|
'..',
|
|
111
|
-
`template-2d
|
|
109
|
+
`template-2d-ts`,
|
|
112
110
|
);
|
|
113
111
|
copyDirectory(templateDir, response.path);
|
|
114
|
-
createConfig(response, plugins
|
|
112
|
+
createConfig(response, plugins);
|
|
115
113
|
|
|
116
114
|
const manifest = JSON.parse(
|
|
117
115
|
fs.readFileSync(path.join(templateDir, `package.json`), 'utf-8'),
|
|
@@ -180,7 +178,7 @@ function copy(src, dest) {
|
|
|
180
178
|
}
|
|
181
179
|
}
|
|
182
180
|
|
|
183
|
-
function createConfig(response, selectedPlugins
|
|
181
|
+
function createConfig(response, selectedPlugins) {
|
|
184
182
|
const imports = [];
|
|
185
183
|
const plugins = [];
|
|
186
184
|
for (const data of selectedPlugins) {
|
|
@@ -188,7 +186,7 @@ function createConfig(response, selectedPlugins, language) {
|
|
|
188
186
|
plugins.push(`${data.variable}(${data.options?.(response) ?? ''}),`);
|
|
189
187
|
}
|
|
190
188
|
|
|
191
|
-
const configFile = path.resolve(response.path, `vite.config
|
|
189
|
+
const configFile = path.resolve(response.path, `vite.config.ts`);
|
|
192
190
|
|
|
193
191
|
fs.writeFileSync(
|
|
194
192
|
configFile,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revideo/create",
|
|
3
|
-
"version": "0.1.4-alpha.
|
|
3
|
+
"version": "0.1.4-alpha.878+9cd8b9f",
|
|
4
4
|
"description": "Quickly scaffold revideo projects",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "revideo",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"url": "https://github.com/havenhq/revideo.git"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@revideo/2d": "^0.1.
|
|
24
|
-
"@revideo/core": "^0.1.
|
|
25
|
-
"@revideo/ui": "^0.1.
|
|
26
|
-
"@revideo/vite-plugin": "^0.1.
|
|
23
|
+
"@revideo/2d": "^0.1.4-alpha.878+9cd8b9f",
|
|
24
|
+
"@revideo/core": "^0.1.4-alpha.878+9cd8b9f",
|
|
25
|
+
"@revideo/ui": "^0.1.4-alpha.878+9cd8b9f",
|
|
26
|
+
"@revideo/vite-plugin": "^0.1.4-alpha.878+9cd8b9f"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"minimist": "^1.2.8",
|
|
30
30
|
"prompts": "^2.4.2"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "9cd8b9fbdf8d9a8c2b985e08a888a2b0101b9f61"
|
|
33
33
|
}
|
|
@@ -1,58 +1,38 @@
|
|
|
1
|
-
import {Audio, Img,
|
|
1
|
+
import {Audio, Img, Video, makeScene2D} from '@revideo/2d';
|
|
2
2
|
import {all, chain, createRef, waitFor} from '@revideo/core';
|
|
3
3
|
|
|
4
4
|
export default makeScene2D(function* (view) {
|
|
5
|
-
const upperBox = createRef<Rect>();
|
|
6
5
|
const logoRef = createRef<Img>();
|
|
7
6
|
|
|
8
|
-
view.add(
|
|
7
|
+
yield view.add(
|
|
9
8
|
<>
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
gap={'20%'}
|
|
16
|
-
ref={upperBox}
|
|
17
|
-
justifyContent={'center'}
|
|
18
|
-
alignItems={'center'}
|
|
19
|
-
layout={true}
|
|
20
|
-
/>
|
|
21
|
-
<Video
|
|
22
|
-
src={
|
|
23
|
-
'https://revideo-example-assets.s3.amazonaws.com/aurora-borealis.mp4'
|
|
24
|
-
}
|
|
25
|
-
size={['100%', '60%']}
|
|
26
|
-
play={true}
|
|
27
|
-
/>
|
|
28
|
-
</Layout>
|
|
9
|
+
<Video
|
|
10
|
+
src={'https://revideo-example-assets.s3.amazonaws.com/stars.mp4'}
|
|
11
|
+
size={['100%', '100%']}
|
|
12
|
+
play={true}
|
|
13
|
+
/>
|
|
29
14
|
<Audio
|
|
30
|
-
src={
|
|
31
|
-
'https://revideo-example-assets.s3.amazonaws.com/heart-on-my-sleeve.mp3'
|
|
32
|
-
}
|
|
15
|
+
src={'https://revideo-example-assets.s3.amazonaws.com/chill-beat.mp3'}
|
|
33
16
|
play={true}
|
|
34
|
-
time={
|
|
17
|
+
time={17.0}
|
|
35
18
|
/>
|
|
36
19
|
</>,
|
|
37
20
|
);
|
|
38
21
|
|
|
39
|
-
yield* waitFor(
|
|
22
|
+
yield* waitFor(1);
|
|
40
23
|
|
|
41
|
-
|
|
42
|
-
<Txt fontWeight={700} fontSize={70}>
|
|
43
|
-
Hello! Welcome to
|
|
44
|
-
</Txt>,
|
|
45
|
-
);
|
|
46
|
-
upperBox().add(
|
|
24
|
+
view.add(
|
|
47
25
|
<Img
|
|
48
26
|
width={'1%'}
|
|
49
27
|
ref={logoRef}
|
|
50
|
-
src={
|
|
28
|
+
src={
|
|
29
|
+
'https://revideo-example-assets.s3.amazonaws.com/revideo-logo-white.png'
|
|
30
|
+
}
|
|
51
31
|
/>,
|
|
52
32
|
);
|
|
53
33
|
|
|
54
34
|
yield* chain(
|
|
55
|
-
all(logoRef().scale(
|
|
56
|
-
logoRef().scale(
|
|
35
|
+
all(logoRef().scale(40, 2), logoRef().rotation(360, 2)),
|
|
36
|
+
logoRef().scale(60, 1),
|
|
57
37
|
);
|
|
58
38
|
});
|