@revideo/create 0.1.4-alpha.876 → 0.1.4-alpha.881

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 CHANGED
@@ -63,7 +63,7 @@ const PLUGINS = {
63
63
  type: 'text',
64
64
  name: 'name',
65
65
  message: 'Project name',
66
- initial: 'my-video',
66
+ initial: 'my-revideo-project',
67
67
  validate: value =>
68
68
  isValidPackageName(value)
69
69
  ? true
@@ -102,7 +102,7 @@ const PLUGINS = {
102
102
  return;
103
103
  }
104
104
 
105
- const plugins = ['core', 'ffmpeg'];
105
+ const plugins = [PLUGINS.core, PLUGINS.ffmpeg];
106
106
  const language = 'ts';
107
107
 
108
108
  const templateDir = path.resolve(
@@ -111,15 +111,14 @@ const PLUGINS = {
111
111
  `template-2d-${language}`,
112
112
  );
113
113
  copyDirectory(templateDir, response.path);
114
- createConfig(response, PLUGINS, language);
114
+ createConfig(response, plugins, language);
115
115
 
116
116
  const manifest = JSON.parse(
117
117
  fs.readFileSync(path.join(templateDir, `package.json`), 'utf-8'),
118
118
  );
119
119
  manifest.name = response.name;
120
120
  manifest.dependencies ??= {};
121
- for (const plugin of plugins) {
122
- const data = PLUGINS[plugin];
121
+ for (const data of plugins) {
123
122
  if (data.version) {
124
123
  manifest.dependencies[data.package] = data.version;
125
124
  }
@@ -181,9 +180,10 @@ function copy(src, dest) {
181
180
  }
182
181
  }
183
182
 
184
- function createConfig(response, plugins, language) {
183
+ function createConfig(response, selectedPlugins, language) {
185
184
  const imports = [];
186
- for (const data of plugins) {
185
+ const plugins = [];
186
+ for (const data of selectedPlugins) {
187
187
  imports.push(`import ${data.variable} from '${data.package}';\n`);
188
188
  plugins.push(`${data.variable}(${data.options?.(response) ?? ''}),`);
189
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revideo/create",
3
- "version": "0.1.4-alpha.876+062cccb",
3
+ "version": "0.1.4-alpha.881+847f2e5",
4
4
  "description": "Quickly scaffold revideo projects",
5
5
  "main": "index.js",
6
6
  "author": "revideo",
@@ -29,5 +29,5 @@
29
29
  "minimist": "^1.2.8",
30
30
  "prompts": "^2.4.2"
31
31
  },
32
- "gitHead": "062cccbd390d0c4eb076e6ddeba60bc2d344067c"
32
+ "gitHead": "847f2e517e83130e9f1dd2d9e19f838b47f054c5"
33
33
  }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -18,4 +18,4 @@
18
18
  "typescript": "^5.2.2",
19
19
  "vite": "^4.5"
20
20
  }
21
- }
21
+ }
@@ -1,58 +1,38 @@
1
- import {Audio, Img, Layout, Rect, Txt, Video, makeScene2D} from '@revideo/2d';
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
7
  view.add(
9
8
  <>
10
- <Layout direction={'column'} size={[1024, 1792]} layout={true}>
11
- <Rect
12
- fill={'#FFFFFF'}
13
- size={['100%', '40%']}
14
- direction={'column'}
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={6.6}
17
+ time={17.0}
35
18
  />
36
19
  </>,
37
20
  );
38
21
 
39
- yield* waitFor(0.5);
22
+ yield* waitFor(1);
40
23
 
41
- upperBox().add(
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={'https://revideo-example-assets.s3.amazonaws.com/revideo-banner.png'}
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(30, 2), logoRef().rotation(360, 2)),
56
- logoRef().scale(40, 2),
35
+ all(logoRef().scale(40, 2), logoRef().rotation(360, 2)),
36
+ logoRef().scale(60, 1),
57
37
  );
58
38
  });
@@ -1,15 +0,0 @@
1
- # Generated files
2
- node_modules
3
- output
4
- dist
5
-
6
- # Editor directories and files
7
- .vscode/*
8
- !.vscode/extensions.json
9
- .idea
10
- .DS_Store
11
- *.suo
12
- *.ntvs*
13
- *.njsproj
14
- *.sln
15
- *.sw?