create-video 3.2.44 → 3.3.1

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/dist/init.js CHANGED
@@ -114,10 +114,10 @@ const init = async () => {
114
114
  await (0, open_in_editor_flow_1.openInEditorFlow)(projectRoot);
115
115
  log_1.Log.info('Get started by running');
116
116
  log_1.Log.info(chalk_1.default.blueBright(`cd ${folderName}`));
117
- log_1.Log.info(chalk_1.default.blueBright((0, pkg_managers_1.getStartCommand)(pkgManager)));
117
+ log_1.Log.info(chalk_1.default.blueBright((0, pkg_managers_1.getDevCommand)(pkgManager, selectedTemplate)));
118
118
  log_1.Log.info('');
119
119
  log_1.Log.info('To render a video, run');
120
- log_1.Log.info(chalk_1.default.blueBright((0, pkg_managers_1.getRenderCommand)(pkgManager)));
120
+ log_1.Log.info(chalk_1.default.blueBright((0, pkg_managers_1.getRenderCommandForTemplate)(pkgManager, selectedTemplate)));
121
121
  log_1.Log.info('');
122
122
  log_1.Log.info('Docs to get you started:', chalk_1.default.underline('https://www.remotion.dev/docs/the-fundamentals'));
123
123
  log_1.Log.info('Enjoy Remotion!');
@@ -1,6 +1,9 @@
1
+ import type { Template } from './templates';
1
2
  export declare type PackageManager = 'npm' | 'yarn' | 'pnpm';
2
3
  export declare const selectPackageManager: () => PackageManager;
3
4
  export declare const getInstallCommand: (manager: PackageManager) => "yarn" | "npm i" | "pnpm i" | undefined;
5
+ export declare const getDevCommand: (manager: PackageManager, template: Template) => string | undefined;
6
+ export declare const getRenderCommandForTemplate: (manager: PackageManager, template: Template) => string | undefined;
4
7
  export declare const getStartCommand: (manager: PackageManager) => "npm start" | "yarn start" | "pnpm start" | undefined;
5
8
  export declare const getRenderCommand: (manager: PackageManager) => "npm run build" | "yarn build" | "pnpm build" | undefined;
6
9
  export declare const getRunCommand: (manager: PackageManager) => "npm run" | "yarn run" | "pnpm run";
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getRunCommand = exports.getRenderCommand = exports.getStartCommand = exports.getInstallCommand = exports.selectPackageManager = void 0;
6
+ exports.getRunCommand = exports.getRenderCommand = exports.getStartCommand = exports.getRenderCommandForTemplate = exports.getDevCommand = exports.getInstallCommand = exports.selectPackageManager = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const shouldUseYarn = () => {
9
9
  var _a, _b;
@@ -47,6 +47,23 @@ const getInstallCommand = (manager) => {
47
47
  }
48
48
  };
49
49
  exports.getInstallCommand = getInstallCommand;
50
+ const getDevCommand = (manager, template) => {
51
+ if (template.cliId === 'remix') {
52
+ return `${(0, exports.getRunCommand)(manager)} dev`;
53
+ }
54
+ return (0, exports.getStartCommand)(manager);
55
+ };
56
+ exports.getDevCommand = getDevCommand;
57
+ const getRenderCommandForTemplate = (manager, template) => {
58
+ if (template.cliId === 'remix') {
59
+ return `${(0, exports.getRunCommand)(manager)} remotion:render`;
60
+ }
61
+ if (template.cliId === 'still') {
62
+ return `${(0, exports.getRunCommand)(manager)} render`;
63
+ }
64
+ return (0, exports.getRenderCommand)(manager);
65
+ };
66
+ exports.getRenderCommandForTemplate = getRenderCommandForTemplate;
50
67
  const getStartCommand = (manager) => {
51
68
  if (manager === 'npm') {
52
69
  return `npm start`;
@@ -20,7 +20,8 @@ export declare type Template = {
20
20
  repoName: string;
21
21
  homePageLabel: string;
22
22
  longerDescription: string;
23
- cliId: string;
23
+ cliId: 'hello-world' | 'javascript' | 'blank' | 'remix' | 'three' | 'still' | 'tts' | 'audiogram' | 'skia' | 'tailwind';
24
+ defaultBranch: string;
24
25
  } & DynamicTemplate;
25
26
  export declare const FEATURED_TEMPLATES: Template[];
26
27
  export {};
package/dist/templates.js CHANGED
@@ -16,10 +16,11 @@ exports.FEATURED_TEMPLATES = [
16
16
  },
17
17
  cliId: 'hello-world',
18
18
  type: 'video',
19
+ defaultBranch: 'main',
19
20
  },
20
21
  {
21
22
  homePageLabel: 'JavaScript',
22
- shortName: 'Hello World (Javascript)',
23
+ shortName: 'Hello World (JavaScript)',
23
24
  org: 'remotion-dev',
24
25
  repoName: 'template-helloworld-javascript',
25
26
  description: 'The default starter template in plain JS',
@@ -31,6 +32,7 @@ exports.FEATURED_TEMPLATES = [
31
32
  },
32
33
  cliId: 'javascript',
33
34
  type: 'video',
35
+ defaultBranch: 'main',
34
36
  },
35
37
  {
36
38
  homePageLabel: 'Blank',
@@ -46,6 +48,7 @@ exports.FEATURED_TEMPLATES = [
46
48
  },
47
49
  cliId: 'blank',
48
50
  type: 'video',
51
+ defaultBranch: 'main',
49
52
  },
50
53
  {
51
54
  homePageLabel: 'Remix',
@@ -61,6 +64,7 @@ exports.FEATURED_TEMPLATES = [
61
64
  },
62
65
  cliId: 'remix',
63
66
  type: 'image',
67
+ defaultBranch: 'main',
64
68
  },
65
69
  {
66
70
  homePageLabel: '3D',
@@ -76,6 +80,7 @@ exports.FEATURED_TEMPLATES = [
76
80
  },
77
81
  cliId: 'three',
78
82
  type: 'video',
83
+ defaultBranch: 'main',
79
84
  },
80
85
  {
81
86
  homePageLabel: 'Stills',
@@ -91,6 +96,7 @@ exports.FEATURED_TEMPLATES = [
91
96
  },
92
97
  cliId: 'still',
93
98
  type: 'video',
99
+ defaultBranch: 'main',
94
100
  },
95
101
  {
96
102
  homePageLabel: 'TTS',
@@ -106,6 +112,7 @@ exports.FEATURED_TEMPLATES = [
106
112
  },
107
113
  cliId: 'tts',
108
114
  type: 'video',
115
+ defaultBranch: 'master',
109
116
  },
110
117
  {
111
118
  homePageLabel: 'Audiogram',
@@ -121,6 +128,7 @@ exports.FEATURED_TEMPLATES = [
121
128
  },
122
129
  cliId: 'audiogram',
123
130
  type: 'video',
131
+ defaultBranch: 'main',
124
132
  },
125
133
  {
126
134
  homePageLabel: 'Skia',
@@ -136,6 +144,7 @@ exports.FEATURED_TEMPLATES = [
136
144
  },
137
145
  cliId: 'skia',
138
146
  type: 'video',
147
+ defaultBranch: 'main',
139
148
  },
140
149
  {
141
150
  homePageLabel: 'Tailwind',
@@ -151,5 +160,6 @@ exports.FEATURED_TEMPLATES = [
151
160
  },
152
161
  cliId: 'tailwind',
153
162
  type: 'video',
163
+ defaultBranch: 'main',
154
164
  },
155
165
  ];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const got_1 = __importDefault(require("got"));
7
+ const vitest_1 = require("vitest");
8
+ const templates_1 = require("../templates");
9
+ const getFileForTemplate = (template, file) => {
10
+ return `https://raw.githubusercontent.com/${template.org}/${template.repoName}/${template.defaultBranch}/${file}`;
11
+ };
12
+ for (const template of templates_1.FEATURED_TEMPLATES) {
13
+ (0, vitest_1.test)(template.shortName + ' should have a valid package.json', async () => {
14
+ var _a, _b;
15
+ const packageLockJson = getFileForTemplate(template, 'package.json');
16
+ const res = await (0, got_1.default)(packageLockJson, {
17
+ throwHttpErrors: false,
18
+ });
19
+ (0, vitest_1.expect)(res.statusCode).toBe(200);
20
+ const body = JSON.parse(res.body);
21
+ if (!template.shortName.includes('Remix')) {
22
+ (0, vitest_1.expect)(body.scripts.build).toMatch(/render/);
23
+ (0, vitest_1.expect)(body.scripts.build).not.toContain('index');
24
+ }
25
+ (0, vitest_1.expect)(body.dependencies.remotion).toMatch(/^\^3/);
26
+ (0, vitest_1.expect)(body.dependencies['@remotion/cli']).toMatch(/^\^3/);
27
+ (0, vitest_1.expect)(body.dependencies.react).toMatch(/^\^?18/);
28
+ (0, vitest_1.expect)(body.dependencies['react-dom']).toMatch(/^\^?18/);
29
+ (0, vitest_1.expect)(body.devDependencies.prettier).toMatch(/^\^?2/);
30
+ (0, vitest_1.expect)(body.devDependencies.eslint).toMatch(/^\^?8/);
31
+ const eitherPluginOrConfig = ((_a = body.devDependencies['@remotion/eslint-config']) === null || _a === void 0 ? void 0 : _a.match(/^\^3/)) ||
32
+ ((_b = body.devDependencies['@remotion/eslint-plugin']) === null || _b === void 0 ? void 0 : _b.match(/^\^3/));
33
+ (0, vitest_1.expect)(eitherPluginOrConfig).toBeTruthy();
34
+ if (!template.shortName.includes('JavaScript')) {
35
+ (0, vitest_1.expect)(body.devDependencies.typescript).toMatch(/^\^?4/);
36
+ }
37
+ });
38
+ (0, vitest_1.test)(template.shortName + ' should not have a package-lock.json', async () => {
39
+ const packageLockJson = getFileForTemplate(template, 'package-lock.json');
40
+ const res = await (0, got_1.default)(packageLockJson, {
41
+ throwHttpErrors: false,
42
+ });
43
+ (0, vitest_1.expect)(res.statusCode).toBe(404);
44
+ });
45
+ (0, vitest_1.test)(template.shortName + ' should not have a yarn.lock', async () => {
46
+ const packageLockJson = getFileForTemplate(template, 'yarn.lock');
47
+ const res = await (0, got_1.default)(packageLockJson, {
48
+ throwHttpErrors: false,
49
+ });
50
+ (0, vitest_1.expect)(res.statusCode).toBe(404);
51
+ });
52
+ (0, vitest_1.test)(template.shortName + ' should not have a pnpm-lock.yaml', async () => {
53
+ const packageLockJson = getFileForTemplate(template, 'pnpm-lock.yaml');
54
+ const res = await (0, got_1.default)(packageLockJson, {
55
+ throwHttpErrors: false,
56
+ });
57
+ (0, vitest_1.expect)(res.statusCode).toBe(404);
58
+ });
59
+ (0, vitest_1.test)(template.shortName + ' should not have a standard entry point', async () => {
60
+ const { contents, entryPoint } = await findFile([
61
+ getFileForTemplate(template, 'src/index.ts'),
62
+ getFileForTemplate(template, 'src/index.js'),
63
+ getFileForTemplate(template, 'remotion/index.ts'),
64
+ getFileForTemplate(template, 'app/remotion/index.ts'),
65
+ ]);
66
+ (0, vitest_1.expect)(entryPoint).toBeTruthy();
67
+ (0, vitest_1.expect)(contents).toMatch(/RemotionRoot/);
68
+ });
69
+ (0, vitest_1.test)(template.shortName + ' should not have a standard Root file', async () => {
70
+ const { contents, entryPoint } = await findFile([
71
+ getFileForTemplate(template, 'src/Root.tsx'),
72
+ getFileForTemplate(template, 'src/Root.jsx'),
73
+ getFileForTemplate(template, 'remotion/Root.tsx'),
74
+ getFileForTemplate(template, 'app/remotion/Root.tsx'),
75
+ ]);
76
+ (0, vitest_1.expect)(entryPoint).toBeTruthy();
77
+ (0, vitest_1.expect)(contents).toMatch(/export const RemotionRoot/);
78
+ });
79
+ }
80
+ const findFile = async (options) => {
81
+ let entryPoint = null;
82
+ let contents = null;
83
+ for (const point of options) {
84
+ const res = await (0, got_1.default)(point, {
85
+ throwHttpErrors: false,
86
+ });
87
+ if (res.statusCode === 200) {
88
+ entryPoint = point;
89
+ contents = res.body;
90
+ break;
91
+ }
92
+ }
93
+ return { entryPoint, contents };
94
+ };
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "create-video",
3
- "version": "3.2.44",
3
+ "version": "3.3.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "create-video": "bin.js"
8
8
  },
9
9
  "files": [
10
- "dist",
11
- "_template"
10
+ "dist"
12
11
  ],
13
12
  "scripts": {
14
13
  "build": "tsc -d",
@@ -31,9 +30,11 @@
31
30
  "@types/prompts": "^2.0.12",
32
31
  "@types/tar": "6.1.1",
33
32
  "eslint": "8.25.0",
33
+ "got": "^11",
34
34
  "prettier": "2.6.2",
35
35
  "prettier-plugin-organize-imports": "^2.3.4",
36
- "typescript": "^4.7.0"
36
+ "typescript": "^4.7.0",
37
+ "vitest": "0.24.3"
37
38
  },
38
- "gitHead": "443b4b387b78905e747ebe69b3b91ee85966796d"
39
+ "gitHead": "f56a29f8ab19e279e1a9950d3a3ccbb3c8ae42e0"
39
40
  }