create-video 4.0.0-webhook.27 → 4.1.0-alpha2
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/LICENSE.md +8 -8
- package/dist/add-yarn2-support.d.ts +6 -0
- package/dist/add-yarn2-support.js +27 -0
- package/dist/degit.d.ts +0 -0
- package/dist/degit.js +8 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/init.d.ts +8 -0
- package/dist/init.js +55 -13
- package/dist/latest-remotion-version.d.ts +0 -0
- package/dist/latest-remotion-version.js +0 -0
- package/dist/list-of-remotion-packages.d.ts +1 -0
- package/dist/list-of-remotion-packages.js +29 -0
- package/dist/log.d.ts +0 -0
- package/dist/log.js +0 -0
- package/dist/mkdirp.d.ts +0 -0
- package/dist/mkdirp.js +4 -4
- package/dist/open-in-editor-flow.d.ts +0 -0
- package/dist/open-in-editor-flow.js +2 -2
- package/dist/open-in-editor.d.ts +2 -2
- package/dist/open-in-editor.js +16 -16
- package/dist/patch-package-json.d.ts +6 -2
- package/dist/patch-package-json.js +26 -35
- package/dist/patch-readme.d.ts +2 -1
- package/dist/patch-readme.js +9 -9
- package/dist/pkg-managers.d.ts +7 -3
- package/dist/pkg-managers.js +55 -9
- package/dist/prompts.d.ts +3 -3
- package/dist/prompts.js +0 -0
- package/dist/resolve-project-root.d.ts +0 -0
- package/dist/resolve-project-root.js +6 -6
- package/dist/select-template.d.ts +0 -0
- package/dist/select-template.js +0 -0
- package/dist/strip-ansi.d.ts +0 -0
- package/dist/strip-ansi.js +0 -0
- package/dist/templates.d.ts +21 -8
- package/dist/templates.js +103 -14
- package/dist/test/git-status.test.d.ts +1 -0
- package/dist/test/git-status.test.js +26 -0
- package/dist/test/patch-package-json.test.d.ts +1 -0
- package/dist/test/patch-package-json.test.js +53 -0
- package/dist/test/validate-templates.test.d.ts +1 -0
- package/dist/test/validate-templates.test.js +136 -0
- package/dist/validate-name.d.ts +0 -0
- package/dist/validate-name.js +0 -0
- package/dist/yesno.d.ts +0 -0
- package/dist/yesno.js +0 -0
- package/package.json +42 -38
|
@@ -0,0 +1,136 @@
|
|
|
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://github.com/${template.org}/${template.repoName}/raw/${template.defaultBranch}/${file}`;
|
|
11
|
+
};
|
|
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
|
+
// TODO: Enable this for v4
|
|
30
|
+
// expect(body.dependencies.remotion).toMatch(/^\^?4/);
|
|
31
|
+
// expect(body.dependencies['@remotion/cli']).toMatch(/^\^?4/);
|
|
32
|
+
(0, vitest_1.expect)(body.dependencies.react).toMatch(/^\^?18/);
|
|
33
|
+
(0, vitest_1.expect)(body.dependencies['react-dom']).toMatch(/^\^?18/);
|
|
34
|
+
(0, vitest_1.expect)(body.devDependencies.prettier).toMatch(/^\^?2.8.1/);
|
|
35
|
+
(0, vitest_1.expect)(body.devDependencies.eslint).toMatch(/^\^?8.30/);
|
|
36
|
+
// @ts-expect-error
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
|
+
const eitherPluginOrConfig = ((_a = body.devDependencies['@remotion/eslint-config']) === null || _a === void 0 ? void 0 : _a.match(/^\^?3/)) ||
|
|
39
|
+
((_b = body.devDependencies['@remotion/eslint-plugin']) === null || _b === void 0 ? void 0 : _b.match(/^\^?3/));
|
|
40
|
+
// TODO: Enable after v4 merge
|
|
41
|
+
// expect(eitherPluginOrConfig).toBeTruthy();
|
|
42
|
+
if (!template.shortName.includes('JavaScript')) {
|
|
43
|
+
(0, vitest_1.expect)(body.devDependencies.typescript).toMatch(/^\^?4/);
|
|
44
|
+
}
|
|
45
|
+
}, 12000);
|
|
46
|
+
(0, vitest_1.it)(template.shortName + ' should not have a package-lock.json', async () => {
|
|
47
|
+
const packageLockJson = getFileForTemplate(template, 'package-lock.json');
|
|
48
|
+
const res = await (0, got_1.default)(packageLockJson, {
|
|
49
|
+
throwHttpErrors: false,
|
|
50
|
+
});
|
|
51
|
+
(0, vitest_1.expect)(res.statusCode).toBe(404);
|
|
52
|
+
}, 12000);
|
|
53
|
+
(0, vitest_1.it)(template.shortName + ' should not have a yarn.lock', async () => {
|
|
54
|
+
const packageLockJson = getFileForTemplate(template, 'yarn.lock');
|
|
55
|
+
const res = await (0, got_1.default)(packageLockJson, {
|
|
56
|
+
throwHttpErrors: false,
|
|
57
|
+
});
|
|
58
|
+
(0, vitest_1.expect)(res.statusCode).toBe(404);
|
|
59
|
+
}, 12000);
|
|
60
|
+
(0, vitest_1.it)(template.shortName + ' should not have a pnpm-lock.yaml', async () => {
|
|
61
|
+
const packageLockJson = getFileForTemplate(template, 'pnpm-lock.yaml');
|
|
62
|
+
const res = await (0, got_1.default)(packageLockJson, {
|
|
63
|
+
throwHttpErrors: false,
|
|
64
|
+
});
|
|
65
|
+
(0, vitest_1.expect)(res.statusCode).toBe(404);
|
|
66
|
+
}, 12000);
|
|
67
|
+
(0, vitest_1.it)(template.shortName + ' should not have a standard entry point', async () => {
|
|
68
|
+
const { contents, entryPoint } = await findFile([
|
|
69
|
+
getFileForTemplate(template, 'src/index.ts'),
|
|
70
|
+
getFileForTemplate(template, 'src/index.js'),
|
|
71
|
+
getFileForTemplate(template, 'remotion/index.ts'),
|
|
72
|
+
getFileForTemplate(template, 'app/remotion/index.ts'),
|
|
73
|
+
]);
|
|
74
|
+
(0, vitest_1.expect)(entryPoint).toBeTruthy();
|
|
75
|
+
(0, vitest_1.expect)(contents).toMatch(/RemotionRoot/);
|
|
76
|
+
}, 12000);
|
|
77
|
+
(0, vitest_1.it)(template.shortName + ' should not have a standard Root file', async () => {
|
|
78
|
+
const { contents, entryPoint } = await findFile([
|
|
79
|
+
getFileForTemplate(template, 'src/Root.tsx'),
|
|
80
|
+
getFileForTemplate(template, 'src/Root.jsx'),
|
|
81
|
+
getFileForTemplate(template, 'remotion/Root.tsx'),
|
|
82
|
+
getFileForTemplate(template, 'app/remotion/Root.tsx'),
|
|
83
|
+
]);
|
|
84
|
+
(0, vitest_1.expect)(entryPoint).toBeTruthy();
|
|
85
|
+
(0, vitest_1.expect)(contents).toMatch(/export const RemotionRoot/);
|
|
86
|
+
}, 12000);
|
|
87
|
+
(0, vitest_1.it)(template.shortName + ' should not have a standard Root file', async () => {
|
|
88
|
+
const { contents, entryPoint } = await findFile([
|
|
89
|
+
getFileForTemplate(template, 'src/Root.tsx'),
|
|
90
|
+
getFileForTemplate(template, 'src/Root.jsx'),
|
|
91
|
+
getFileForTemplate(template, 'remotion/Root.tsx'),
|
|
92
|
+
getFileForTemplate(template, 'app/remotion/Root.tsx'),
|
|
93
|
+
]);
|
|
94
|
+
(0, vitest_1.expect)(entryPoint).toBeTruthy();
|
|
95
|
+
(0, vitest_1.expect)(contents).toMatch(/export const RemotionRoot/);
|
|
96
|
+
}, 12000);
|
|
97
|
+
(0, vitest_1.it)(template.shortName + 'should use the new config file format', async () => {
|
|
98
|
+
const { contents, entryPoint } = await findFile([
|
|
99
|
+
getFileForTemplate(template, 'remotion.config.ts'),
|
|
100
|
+
getFileForTemplate(template, 'remotion.config.js'),
|
|
101
|
+
]);
|
|
102
|
+
(0, vitest_1.expect)(entryPoint).toBeTruthy();
|
|
103
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Rendering');
|
|
104
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Bundling');
|
|
105
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Log');
|
|
106
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Puppeteer');
|
|
107
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Output');
|
|
108
|
+
(0, vitest_1.expect)(contents).not.toContain('Config.Preview');
|
|
109
|
+
}, 12000);
|
|
110
|
+
(0, vitest_1.it)(template.shortName + ' should use noUnusedLocals', async () => {
|
|
111
|
+
if (template.shortName.includes('JavaScript')) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const { contents } = await findFile([
|
|
115
|
+
getFileForTemplate(template, 'tsconfig.json'),
|
|
116
|
+
]);
|
|
117
|
+
const json = JSON.parse(contents);
|
|
118
|
+
(0, vitest_1.expect)(json.compilerOptions.noUnusedLocals).toBe(true);
|
|
119
|
+
}, 12000);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
const findFile = async (options) => {
|
|
123
|
+
let entryPoint = null;
|
|
124
|
+
let contents = null;
|
|
125
|
+
for (const point of options) {
|
|
126
|
+
const res = await (0, got_1.default)(point, {
|
|
127
|
+
throwHttpErrors: false,
|
|
128
|
+
});
|
|
129
|
+
if (res.statusCode === 200) {
|
|
130
|
+
entryPoint = point;
|
|
131
|
+
contents = res.body;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return { entryPoint, contents };
|
|
136
|
+
};
|
package/dist/validate-name.d.ts
CHANGED
|
File without changes
|
package/dist/validate-name.js
CHANGED
|
File without changes
|
package/dist/yesno.d.ts
CHANGED
|
File without changes
|
package/dist/yesno.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,39 +1,43 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
2
|
+
"name": "create-video",
|
|
3
|
+
"version": "4.1.0-alpha2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create-video": "bin.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
13
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"chalk": "4.1.2",
|
|
16
|
+
"execa": "5.1.1",
|
|
17
|
+
"minimist": "1.2.6",
|
|
18
|
+
"prompts": "2.4.1",
|
|
19
|
+
"react": "18.0.0",
|
|
20
|
+
"tar": "6.1.11"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@jonny/eslint-config": "3.0.266",
|
|
24
|
+
"@types/minimist": "1.2.2",
|
|
25
|
+
"@types/node": "18.14.6",
|
|
26
|
+
"@types/prompts": "^2.0.12",
|
|
27
|
+
"@types/react": "18.0.26",
|
|
28
|
+
"@types/tar": "6.1.1",
|
|
29
|
+
"eslint": "8.42.0",
|
|
30
|
+
"got": "^11",
|
|
31
|
+
"prettier": "2.6.2",
|
|
32
|
+
"prettier-plugin-organize-imports": "^2.3.4",
|
|
33
|
+
"typescript": "4.9.5",
|
|
34
|
+
"vitest": "0.31.1"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"formatting": "prettier src --check",
|
|
38
|
+
"build": "tsc -d",
|
|
39
|
+
"watch": "tsc -w",
|
|
40
|
+
"lint": "eslint src --ext ts,tsx",
|
|
41
|
+
"test": "vitest --run"
|
|
42
|
+
}
|
|
43
|
+
}
|