create-video 3.3.38 → 3.3.40
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/add-yarn2-support.d.ts +6 -0
- package/dist/add-yarn2-support.js +27 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/init.js +7 -1
- package/dist/list-of-remotion-packages.d.ts +1 -0
- package/dist/list-of-remotion-packages.js +25 -0
- package/dist/patch-package-json.d.ts +0 -1
- package/dist/patch-package-json.js +3 -22
- package/dist/patch-readme.d.ts +2 -1
- package/dist/patch-readme.js +2 -2
- package/dist/pkg-managers.d.ts +0 -1
- package/dist/pkg-managers.js +4 -5
- package/dist/templates.d.ts +1 -1
- package/dist/templates.js +43 -20
- package/dist/test/validate-templates.test.js +96 -71
- package/package.json +2 -2
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
exports.createYarnYmlFile = void 0;
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const log_1 = require("./log");
|
|
10
|
+
const createYarnYmlFile = ({ projectRoot, pkgManagerVersion, pkgManager, }) => {
|
|
11
|
+
if (pkgManager !== 'yarn') {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (!pkgManagerVersion) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const majorVersion = pkgManagerVersion[0];
|
|
18
|
+
const majorVersionNumber = Number(majorVersion);
|
|
19
|
+
if (majorVersionNumber < 2) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
log_1.Log.info('Remotion has no support for automatically installing the Yarn PnP modules yet.');
|
|
23
|
+
log_1.Log.info('Creating .yarnrc.yml file to disable Yarn PnP.');
|
|
24
|
+
const yarnrcYml = `nodeLinker: node-modules\n`;
|
|
25
|
+
(0, fs_1.writeFileSync)(path_1.default.join(projectRoot, '.yarnrc.yml'), yarnrcYml);
|
|
26
|
+
};
|
|
27
|
+
exports.createYarnYmlFile = createYarnYmlFile;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateVideoInternals = void 0;
|
|
4
|
+
const list_of_remotion_packages_1 = require("./list-of-remotion-packages");
|
|
4
5
|
const templates_1 = require("./templates");
|
|
5
6
|
exports.CreateVideoInternals = {
|
|
6
7
|
FEATURED_TEMPLATES: templates_1.FEATURED_TEMPLATES,
|
|
8
|
+
listOfRemotionPackages: list_of_remotion_packages_1.listOfRemotionPackages,
|
|
7
9
|
};
|
|
8
10
|
exports.default = () => {
|
|
9
11
|
throw new Error('create-video is a CLI tool only. Run `npm init video`, `pnpm create video` or `yarn create video` instead!');
|
package/dist/init.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.init = exports.checkGitAvailability = void 0;
|
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const execa_1 = __importDefault(require("execa"));
|
|
9
9
|
const os_1 = __importDefault(require("os"));
|
|
10
|
+
const add_yarn2_support_1 = require("./add-yarn2-support");
|
|
10
11
|
const degit_1 = require("./degit");
|
|
11
12
|
const latest_remotion_version_1 = require("./latest-remotion-version");
|
|
12
13
|
const log_1 = require("./log");
|
|
@@ -93,7 +94,7 @@ const init = async () => {
|
|
|
93
94
|
repoName: selectedTemplate.repoName,
|
|
94
95
|
dest: projectRoot,
|
|
95
96
|
});
|
|
96
|
-
(0, patch_readme_1.patchReadmeMd)(projectRoot, pkgManager);
|
|
97
|
+
(0, patch_readme_1.patchReadmeMd)(projectRoot, pkgManager, selectedTemplate);
|
|
97
98
|
const latestVersion = await latestRemotionVersionPromise;
|
|
98
99
|
(0, patch_package_json_1.patchPackageJson)({
|
|
99
100
|
projectRoot,
|
|
@@ -110,6 +111,11 @@ const init = async () => {
|
|
|
110
111
|
process.exit(1);
|
|
111
112
|
}
|
|
112
113
|
log_1.Log.info(`Copied ${chalk_1.default.blueBright(selectedTemplate.shortName)} to ${chalk_1.default.blueBright(folderName)}. Installing dependencies...`);
|
|
114
|
+
(0, add_yarn2_support_1.createYarnYmlFile)({
|
|
115
|
+
pkgManager,
|
|
116
|
+
pkgManagerVersion,
|
|
117
|
+
projectRoot,
|
|
118
|
+
});
|
|
113
119
|
if (pkgManager === 'yarn') {
|
|
114
120
|
log_1.Log.info('> yarn');
|
|
115
121
|
const promise = (0, execa_1.default)('yarn', [], {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const listOfRemotionPackages: string[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listOfRemotionPackages = void 0;
|
|
4
|
+
exports.listOfRemotionPackages = [
|
|
5
|
+
'@remotion/bundler',
|
|
6
|
+
'@remotion/cli',
|
|
7
|
+
'@remotion/eslint-config',
|
|
8
|
+
'@remotion/eslint-plugin',
|
|
9
|
+
'@remotion/renderer',
|
|
10
|
+
'@remotion/skia',
|
|
11
|
+
'@remotion/lottie',
|
|
12
|
+
'@remotion/media-utils',
|
|
13
|
+
'@remotion/motion-blur',
|
|
14
|
+
'@remotion/google-fonts',
|
|
15
|
+
'@remotion/noise',
|
|
16
|
+
'@remotion/paths',
|
|
17
|
+
'@remotion/babel-loader',
|
|
18
|
+
'@remotion/lambda',
|
|
19
|
+
'@remotion/player',
|
|
20
|
+
'@remotion/preload',
|
|
21
|
+
'@remotion/three',
|
|
22
|
+
'@remotion/gif',
|
|
23
|
+
'@remotion/shapes',
|
|
24
|
+
'remotion',
|
|
25
|
+
];
|
|
@@ -3,29 +3,10 @@ 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.patchPackageJson =
|
|
6
|
+
exports.patchPackageJson = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
|
|
10
|
-
'@remotion/bundler',
|
|
11
|
-
'@remotion/cli',
|
|
12
|
-
'@remotion/eslint-config',
|
|
13
|
-
'@remotion/renderer',
|
|
14
|
-
'@remotion/skia',
|
|
15
|
-
'@remotion/lottie',
|
|
16
|
-
'@remotion/media-utils',
|
|
17
|
-
'@remotion/motion-blur',
|
|
18
|
-
'@remotion/google-fonts',
|
|
19
|
-
'@remotion/noise',
|
|
20
|
-
'@remotion/paths',
|
|
21
|
-
'@remotion/babel-loader',
|
|
22
|
-
'@remotion/lambda',
|
|
23
|
-
'@remotion/player',
|
|
24
|
-
'@remotion/preload',
|
|
25
|
-
'@remotion/three',
|
|
26
|
-
'@remotion/gif',
|
|
27
|
-
'remotion',
|
|
28
|
-
];
|
|
9
|
+
const list_of_remotion_packages_1 = require("./list-of-remotion-packages");
|
|
29
10
|
const patchPackageJson = ({ projectRoot, projectName, latestRemotionVersion, packageManager, }, { getPackageJson = (filename) => fs_1.default.readFileSync(filename, 'utf-8'), setPackageJson = (filename, content) => fs_1.default.writeFileSync(filename, content), } = {}) => {
|
|
30
11
|
const fileName = path_1.default.join(projectRoot, 'package.json');
|
|
31
12
|
const contents = getPackageJson(fileName);
|
|
@@ -33,7 +14,7 @@ const patchPackageJson = ({ projectRoot, projectName, latestRemotionVersion, pac
|
|
|
33
14
|
const { name, dependencies, ...others } = packageJson;
|
|
34
15
|
const newDependencies = Object.keys(dependencies)
|
|
35
16
|
.map((d) => {
|
|
36
|
-
if (
|
|
17
|
+
if (list_of_remotion_packages_1.listOfRemotionPackages.includes(d)) {
|
|
37
18
|
return [d, latestRemotionVersion];
|
|
38
19
|
}
|
|
39
20
|
return [d, dependencies[d]];
|
package/dist/patch-readme.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { PackageManager } from './pkg-managers';
|
|
2
|
-
|
|
2
|
+
import type { Template } from './templates';
|
|
3
|
+
export declare const patchReadmeMd: (projectRoot: string, packageManager: PackageManager, template: Template) => void;
|
package/dist/patch-readme.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.patchReadmeMd = void 0;
|
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const pkg_managers_1 = require("./pkg-managers");
|
|
10
|
-
const patchReadmeMd = (projectRoot, packageManager) => {
|
|
10
|
+
const patchReadmeMd = (projectRoot, packageManager, template) => {
|
|
11
11
|
const fileName = path_1.default.join(projectRoot, 'README.md');
|
|
12
12
|
const contents = fs_1.default.readFileSync(fileName, 'utf8');
|
|
13
13
|
const newContents = contents
|
|
@@ -17,7 +17,7 @@ const patchReadmeMd = (projectRoot, packageManager) => {
|
|
|
17
17
|
return (0, pkg_managers_1.getInstallCommand)(packageManager);
|
|
18
18
|
}
|
|
19
19
|
if (c.startsWith('npm start')) {
|
|
20
|
-
return (0, pkg_managers_1.
|
|
20
|
+
return (0, pkg_managers_1.getDevCommand)(packageManager, template);
|
|
21
21
|
}
|
|
22
22
|
if (c.startsWith('npm run build')) {
|
|
23
23
|
return (0, pkg_managers_1.getRenderCommand)(packageManager);
|
package/dist/pkg-managers.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export declare const selectPackageManager: () => PackageManager;
|
|
|
4
4
|
export declare const getInstallCommand: (manager: PackageManager) => "yarn" | "npm i" | "pnpm i" | undefined;
|
|
5
5
|
export declare const getDevCommand: (manager: PackageManager, template: Template) => string | undefined;
|
|
6
6
|
export declare const getRenderCommandForTemplate: (manager: PackageManager, template: Template) => string | undefined;
|
|
7
|
-
export declare const getStartCommand: (manager: PackageManager) => "npm start" | "yarn start" | "pnpm start" | undefined;
|
|
8
7
|
export declare const getRenderCommand: (manager: PackageManager) => "npm run build" | "yarn build" | "pnpm build" | undefined;
|
|
9
8
|
export declare const getRunCommand: (manager: PackageManager) => "npm run" | "yarn run" | "pnpm run";
|
|
10
9
|
export declare const getPackageManagerVersion: (manager: PackageManager) => Promise<string>;
|
package/dist/pkg-managers.js
CHANGED
|
@@ -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.getPackageManagerVersionOrNull = exports.getPackageManagerVersion = exports.getRunCommand = exports.getRenderCommand = exports.
|
|
6
|
+
exports.getPackageManagerVersionOrNull = exports.getPackageManagerVersion = exports.getRunCommand = exports.getRenderCommand = exports.getRenderCommandForTemplate = exports.getDevCommand = exports.getInstallCommand = exports.selectPackageManager = void 0;
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const shouldUseYarn = () => {
|
|
@@ -49,14 +49,14 @@ const getInstallCommand = (manager) => {
|
|
|
49
49
|
};
|
|
50
50
|
exports.getInstallCommand = getInstallCommand;
|
|
51
51
|
const getDevCommand = (manager, template) => {
|
|
52
|
-
if (template.cliId === 'remix') {
|
|
52
|
+
if (template.cliId === 'remix' || template.cliId === 'next') {
|
|
53
53
|
return `${(0, exports.getRunCommand)(manager)} dev`;
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return getStartCommand(manager);
|
|
56
56
|
};
|
|
57
57
|
exports.getDevCommand = getDevCommand;
|
|
58
58
|
const getRenderCommandForTemplate = (manager, template) => {
|
|
59
|
-
if (template.cliId === 'remix') {
|
|
59
|
+
if (template.cliId === 'remix' || template.cliId === 'next') {
|
|
60
60
|
return `${(0, exports.getRunCommand)(manager)} remotion:render`;
|
|
61
61
|
}
|
|
62
62
|
if (template.cliId === 'still') {
|
|
@@ -76,7 +76,6 @@ const getStartCommand = (manager) => {
|
|
|
76
76
|
return `pnpm start`;
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
exports.getStartCommand = getStartCommand;
|
|
80
79
|
const getRenderCommand = (manager) => {
|
|
81
80
|
if (manager === 'npm') {
|
|
82
81
|
return `npm run build`;
|
package/dist/templates.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare type Template = {
|
|
|
21
21
|
repoName: string;
|
|
22
22
|
homePageLabel: string;
|
|
23
23
|
longerDescription: React.ReactNode;
|
|
24
|
-
cliId: 'hello-world' | 'javascript' | 'blank' | 'remix' | 'three' | 'still' | 'tts' | 'audiogram' | 'skia' | 'tailwind' | 'overlay';
|
|
24
|
+
cliId: 'hello-world' | 'javascript' | 'blank' | 'next' | 'remix' | 'three' | 'still' | 'tts' | 'audiogram' | 'skia' | 'tailwind' | 'overlay';
|
|
25
25
|
defaultBranch: string;
|
|
26
26
|
} & DynamicTemplate;
|
|
27
27
|
export declare const FEATURED_TEMPLATES: Template[];
|
package/dist/templates.js
CHANGED
|
@@ -2,13 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FEATURED_TEMPLATES = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function truthy(value) {
|
|
6
|
+
return Boolean(value);
|
|
7
|
+
}
|
|
8
|
+
const ENABLE_NEXT = false;
|
|
9
|
+
const nextTemplate = {
|
|
10
|
+
homePageLabel: 'Next.js',
|
|
11
|
+
shortName: 'Next.js',
|
|
12
|
+
org: 'remotion-dev',
|
|
13
|
+
repoName: 'template-next',
|
|
14
|
+
description: 'SaaS template for video generation apps',
|
|
15
|
+
longerDescription: 'A software-as-a-service starter kit which has the Remotion Player and rendering via Remotion Lambda built-in. Our recommended choice for people who want to build a video generation app.',
|
|
16
|
+
promoBanner: {
|
|
17
|
+
width: 1280,
|
|
18
|
+
height: 720,
|
|
19
|
+
// TODO: Update this image
|
|
20
|
+
src: '/img/remix-template.png',
|
|
21
|
+
},
|
|
22
|
+
cliId: 'next',
|
|
23
|
+
type: 'image',
|
|
24
|
+
defaultBranch: 'main',
|
|
25
|
+
};
|
|
26
|
+
// Note that this page is statically analyzed by extract-articles.mjs
|
|
5
27
|
exports.FEATURED_TEMPLATES = [
|
|
6
28
|
{
|
|
7
|
-
homePageLabel: '
|
|
29
|
+
homePageLabel: 'Hello World',
|
|
8
30
|
shortName: 'Hello World',
|
|
9
31
|
org: 'remotion-dev',
|
|
10
32
|
repoName: 'template-helloworld',
|
|
11
|
-
description: '
|
|
33
|
+
description: 'A "Hello World" starter template',
|
|
12
34
|
longerDescription: 'A basic template with TypeScript, Prettier and ESLint preconfigured. Our recommended choice for beginners.',
|
|
13
35
|
promoVideo: {
|
|
14
36
|
muxId: 'vKvV6aa7GXGlR01cmpc6J8Zz4Gkj9d2hBSnVYoef00900I',
|
|
@@ -19,22 +41,7 @@ exports.FEATURED_TEMPLATES = [
|
|
|
19
41
|
type: 'video',
|
|
20
42
|
defaultBranch: 'main',
|
|
21
43
|
},
|
|
22
|
-
|
|
23
|
-
homePageLabel: 'JavaScript',
|
|
24
|
-
shortName: 'Hello World (JavaScript)',
|
|
25
|
-
org: 'remotion-dev',
|
|
26
|
-
repoName: 'template-helloworld-javascript',
|
|
27
|
-
description: 'The default starter template in plain JS',
|
|
28
|
-
longerDescription: 'The Hello World template, but in plain JavaScript. Recommended for people who detest TypeScript.',
|
|
29
|
-
promoVideo: {
|
|
30
|
-
muxId: 'dRIuc00f8QWnKedM8GBGPqXJWqU01DPJFgPTHpJgixxas',
|
|
31
|
-
width: 1920,
|
|
32
|
-
height: 1080,
|
|
33
|
-
},
|
|
34
|
-
cliId: 'javascript',
|
|
35
|
-
type: 'video',
|
|
36
|
-
defaultBranch: 'main',
|
|
37
|
-
},
|
|
44
|
+
ENABLE_NEXT ? nextTemplate : null,
|
|
38
45
|
{
|
|
39
46
|
homePageLabel: 'Blank',
|
|
40
47
|
shortName: 'Blank',
|
|
@@ -51,6 +58,22 @@ exports.FEATURED_TEMPLATES = [
|
|
|
51
58
|
type: 'video',
|
|
52
59
|
defaultBranch: 'main',
|
|
53
60
|
},
|
|
61
|
+
{
|
|
62
|
+
homePageLabel: 'JavaScript',
|
|
63
|
+
shortName: 'Hello World (JavaScript)',
|
|
64
|
+
org: 'remotion-dev',
|
|
65
|
+
repoName: 'template-helloworld-javascript',
|
|
66
|
+
description: 'The default starter template in plain JS',
|
|
67
|
+
longerDescription: 'The Hello World template, but in plain JavaScript. Recommended for people who detest TypeScript.',
|
|
68
|
+
promoVideo: {
|
|
69
|
+
muxId: 'dRIuc00f8QWnKedM8GBGPqXJWqU01DPJFgPTHpJgixxas',
|
|
70
|
+
width: 1920,
|
|
71
|
+
height: 1080,
|
|
72
|
+
},
|
|
73
|
+
cliId: 'javascript',
|
|
74
|
+
type: 'video',
|
|
75
|
+
defaultBranch: 'main',
|
|
76
|
+
},
|
|
54
77
|
{
|
|
55
78
|
homePageLabel: 'Remix',
|
|
56
79
|
shortName: 'Remix',
|
|
@@ -100,7 +123,7 @@ exports.FEATURED_TEMPLATES = [
|
|
|
100
123
|
defaultBranch: 'main',
|
|
101
124
|
},
|
|
102
125
|
{
|
|
103
|
-
homePageLabel: '
|
|
126
|
+
homePageLabel: 'Text-To-Speech',
|
|
104
127
|
shortName: 'Text To Speech',
|
|
105
128
|
org: 'FelippeChemello',
|
|
106
129
|
repoName: 'Remotion-TTS-Example',
|
|
@@ -179,4 +202,4 @@ exports.FEATURED_TEMPLATES = [
|
|
|
179
202
|
type: 'video',
|
|
180
203
|
defaultBranch: 'main',
|
|
181
204
|
},
|
|
182
|
-
];
|
|
205
|
+
].filter(truthy);
|
|
@@ -9,77 +9,102 @@ const templates_1 = require("../templates");
|
|
|
9
9
|
const getFileForTemplate = (template, file) => {
|
|
10
10
|
return `https://github.com/${template.org}/${template.repoName}/raw/${template.defaultBranch}/${file}`;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
!template.shortName.includes('
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
((
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
12
|
+
(0, vitest_1.describe)('Templates should be valid', () => {
|
|
13
|
+
for (const template of templates_1.FEATURED_TEMPLATES) {
|
|
14
|
+
(0, vitest_1.it)(template.shortName + ' should have a valid package.json', async () => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const packageJson = getFileForTemplate(template, 'package.json');
|
|
17
|
+
const res = await (0, got_1.default)(packageJson, {
|
|
18
|
+
throwHttpErrors: false,
|
|
19
|
+
cache: false,
|
|
20
|
+
followRedirect: true,
|
|
21
|
+
});
|
|
22
|
+
(0, vitest_1.expect)(res.statusCode).toBe(200);
|
|
23
|
+
const body = JSON.parse(res.body);
|
|
24
|
+
if (!template.shortName.includes('Remix') &&
|
|
25
|
+
!template.shortName.includes('Still')) {
|
|
26
|
+
(0, vitest_1.expect)(body.scripts.build).toMatch(/render/);
|
|
27
|
+
(0, vitest_1.expect)(body.scripts.build).not.toContain('index');
|
|
28
|
+
}
|
|
29
|
+
(0, vitest_1.expect)(body.dependencies.remotion).toMatch(/^\^?3/);
|
|
30
|
+
(0, vitest_1.expect)(body.dependencies['@remotion/cli']).toMatch(/^\^?3/);
|
|
31
|
+
(0, vitest_1.expect)(body.dependencies.react).toMatch(/^\^?18/);
|
|
32
|
+
(0, vitest_1.expect)(body.dependencies['react-dom']).toMatch(/^\^?18/);
|
|
33
|
+
(0, vitest_1.expect)(body.devDependencies.prettier).toMatch(/^\^?2.8.1/);
|
|
34
|
+
(0, vitest_1.expect)(body.devDependencies.eslint).toMatch(/^\^?8.30/);
|
|
35
|
+
const eitherPluginOrConfig = ((_a = body.devDependencies['@remotion/eslint-config']) === null || _a === void 0 ? void 0 : _a.match(/^\^?3/)) ||
|
|
36
|
+
((_b = body.devDependencies['@remotion/eslint-plugin']) === null || _b === void 0 ? void 0 : _b.match(/^\^?3/));
|
|
37
|
+
(0, vitest_1.expect)(eitherPluginOrConfig).toBeTruthy();
|
|
38
|
+
if (!template.shortName.includes('JavaScript')) {
|
|
39
|
+
(0, vitest_1.expect)(body.devDependencies.typescript).toMatch(/^\^?4/);
|
|
40
|
+
}
|
|
41
|
+
}, 12000);
|
|
42
|
+
(0, vitest_1.it)(template.shortName + ' should not have a package-lock.json', async () => {
|
|
43
|
+
const packageLockJson = getFileForTemplate(template, 'package-lock.json');
|
|
44
|
+
const res = await (0, got_1.default)(packageLockJson, {
|
|
45
|
+
throwHttpErrors: false,
|
|
46
|
+
});
|
|
47
|
+
(0, vitest_1.expect)(res.statusCode).toBe(404);
|
|
48
|
+
}, 12000);
|
|
49
|
+
(0, vitest_1.it)(template.shortName + ' should not have a yarn.lock', async () => {
|
|
50
|
+
const packageLockJson = getFileForTemplate(template, 'yarn.lock');
|
|
51
|
+
const res = await (0, got_1.default)(packageLockJson, {
|
|
52
|
+
throwHttpErrors: false,
|
|
53
|
+
});
|
|
54
|
+
(0, vitest_1.expect)(res.statusCode).toBe(404);
|
|
55
|
+
}, 12000);
|
|
56
|
+
(0, vitest_1.it)(template.shortName + ' should not have a pnpm-lock.yaml', async () => {
|
|
57
|
+
const packageLockJson = getFileForTemplate(template, 'pnpm-lock.yaml');
|
|
58
|
+
const res = await (0, got_1.default)(packageLockJson, {
|
|
59
|
+
throwHttpErrors: false,
|
|
60
|
+
});
|
|
61
|
+
(0, vitest_1.expect)(res.statusCode).toBe(404);
|
|
62
|
+
}, 12000);
|
|
63
|
+
(0, vitest_1.it)(template.shortName + ' should not have a standard entry point', async () => {
|
|
64
|
+
const { contents, entryPoint } = await findFile([
|
|
65
|
+
getFileForTemplate(template, 'src/index.ts'),
|
|
66
|
+
getFileForTemplate(template, 'src/index.js'),
|
|
67
|
+
getFileForTemplate(template, 'remotion/index.ts'),
|
|
68
|
+
getFileForTemplate(template, 'app/remotion/index.ts'),
|
|
69
|
+
]);
|
|
70
|
+
(0, vitest_1.expect)(entryPoint).toBeTruthy();
|
|
71
|
+
(0, vitest_1.expect)(contents).toMatch(/RemotionRoot/);
|
|
72
|
+
}, 12000);
|
|
73
|
+
(0, vitest_1.it)(template.shortName + ' should not have a standard Root file', async () => {
|
|
74
|
+
const { contents, entryPoint } = await findFile([
|
|
75
|
+
getFileForTemplate(template, 'src/Root.tsx'),
|
|
76
|
+
getFileForTemplate(template, 'src/Root.jsx'),
|
|
77
|
+
getFileForTemplate(template, 'remotion/Root.tsx'),
|
|
78
|
+
getFileForTemplate(template, 'app/remotion/Root.tsx'),
|
|
79
|
+
]);
|
|
80
|
+
(0, vitest_1.expect)(entryPoint).toBeTruthy();
|
|
81
|
+
(0, vitest_1.expect)(contents).toMatch(/export const RemotionRoot/);
|
|
82
|
+
}, 12000);
|
|
83
|
+
(0, vitest_1.it)(template.shortName + ' should not have a standard Root file', async () => {
|
|
84
|
+
const { contents, entryPoint } = await findFile([
|
|
85
|
+
getFileForTemplate(template, 'src/Root.tsx'),
|
|
86
|
+
getFileForTemplate(template, 'src/Root.jsx'),
|
|
87
|
+
getFileForTemplate(template, 'remotion/Root.tsx'),
|
|
88
|
+
getFileForTemplate(template, 'app/remotion/Root.tsx'),
|
|
89
|
+
]);
|
|
90
|
+
(0, vitest_1.expect)(entryPoint).toBeTruthy();
|
|
91
|
+
(0, vitest_1.expect)(contents).toMatch(/export const RemotionRoot/);
|
|
92
|
+
}, 12000);
|
|
93
|
+
(0, vitest_1.it)(template.shortName + 'should use the new config file format', async () => {
|
|
94
|
+
const { contents, entryPoint } = await findFile([
|
|
95
|
+
getFileForTemplate(template, 'remotion.config.ts'),
|
|
96
|
+
getFileForTemplate(template, 'remotion.config.js'),
|
|
97
|
+
]);
|
|
98
|
+
(0, vitest_1.expect)(entryPoint).toBeTruthy();
|
|
99
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Rendering');
|
|
100
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Bundling');
|
|
101
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Log');
|
|
102
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Puppeteer');
|
|
103
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Output');
|
|
104
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Preview');
|
|
105
|
+
}, 12000);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
83
108
|
const findFile = async (options) => {
|
|
84
109
|
let entryPoint = null;
|
|
85
110
|
let contents = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-video",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.40",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"typescript": "^4.7.0",
|
|
40
40
|
"vitest": "0.24.3"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "be5f606a81761f7f8e1e191ebabd5f8d225d8c09"
|
|
43
43
|
}
|