@revideo/create 0.1.4-alpha.876 → 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 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,24 +102,21 @@ const PLUGINS = {
102
102
  return;
103
103
  }
104
104
 
105
- const plugins = ['core', 'ffmpeg'];
106
- const language = 'ts';
107
-
105
+ const plugins = [PLUGINS.core, PLUGINS.ffmpeg];
108
106
  const templateDir = path.resolve(
109
107
  fileURLToPath(import.meta.url),
110
108
  '..',
111
- `template-2d-${language}`,
109
+ `template-2d-ts`,
112
110
  );
113
111
  copyDirectory(templateDir, response.path);
114
- createConfig(response, PLUGINS, language);
112
+ createConfig(response, plugins);
115
113
 
116
114
  const manifest = JSON.parse(
117
115
  fs.readFileSync(path.join(templateDir, `package.json`), 'utf-8'),
118
116
  );
119
117
  manifest.name = response.name;
120
118
  manifest.dependencies ??= {};
121
- for (const plugin of plugins) {
122
- const data = PLUGINS[plugin];
119
+ for (const data of plugins) {
123
120
  if (data.version) {
124
121
  manifest.dependencies[data.package] = data.version;
125
122
  }
@@ -181,14 +178,15 @@ function copy(src, dest) {
181
178
  }
182
179
  }
183
180
 
184
- function createConfig(response, plugins, language) {
181
+ function createConfig(response, selectedPlugins) {
185
182
  const imports = [];
186
- for (const data of plugins) {
183
+ const plugins = [];
184
+ for (const data of selectedPlugins) {
187
185
  imports.push(`import ${data.variable} from '${data.package}';\n`);
188
186
  plugins.push(`${data.variable}(${data.options?.(response) ?? ''}),`);
189
187
  }
190
188
 
191
- const configFile = path.resolve(response.path, `vite.config.${language}`);
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.876+062cccb",
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.0",
24
- "@revideo/core": "^0.1.0",
25
- "@revideo/ui": "^0.1.0",
26
- "@revideo/vite-plugin": "^0.1.0"
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": "062cccbd390d0c4eb076e6ddeba60bc2d344067c"
32
+ "gitHead": "9cd8b9fbdf8d9a8c2b985e08a888a2b0101b9f61"
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
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "version": 0,
3
+ "shared": {
4
+ "background": null,
5
+ "range": [
6
+ 0,
7
+ null
8
+ ],
9
+ "size": {
10
+ "x": 1920,
11
+ "y": 1080
12
+ },
13
+ "audioOffset": 0
14
+ },
15
+ "preview": {
16
+ "fps": 30,
17
+ "resolutionScale": 1
18
+ },
19
+ "rendering": {
20
+ "fps": 30,
21
+ "resolutionScale": 1,
22
+ "colorSpace": "srgb",
23
+ "exporter": {
24
+ "name": "@revideo/ffmpeg",
25
+ "options": {
26
+ "fastStart": true,
27
+ "includeAudio": true
28
+ }
29
+ }
30
+ }
31
+ }
@@ -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
- view.add(
7
+ yield 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?