create-video 3.2.12 → 3.2.13
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/index.js
CHANGED
|
@@ -6,5 +6,5 @@ exports.CreateVideoInternals = {
|
|
|
6
6
|
FEATURED_TEMPLATES: templates_1.FEATURED_TEMPLATES,
|
|
7
7
|
};
|
|
8
8
|
exports.default = () => {
|
|
9
|
-
throw new Error('create-video is a CLI tool only. Run `
|
|
9
|
+
throw new Error('create-video is a CLI tool only. Run `npm init video`, `pnpm create video` or `yarn create video` instead!');
|
|
10
10
|
};
|
package/dist/init.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.init = void 0;
|
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const execa_1 = __importDefault(require("execa"));
|
|
9
9
|
const degit_1 = require("./degit");
|
|
10
|
+
const latest_remotion_version_1 = require("./latest-remotion-version");
|
|
10
11
|
const log_1 = require("./log");
|
|
11
12
|
const open_in_editor_flow_1 = require("./open-in-editor-flow");
|
|
12
13
|
const patch_package_json_1 = require("./patch-package-json");
|
|
@@ -50,6 +51,7 @@ const init = async () => {
|
|
|
50
51
|
var _a, _b, _c, _d, _e, _f;
|
|
51
52
|
const [projectRoot, folderName] = await (0, resolve_project_root_1.resolveProjectRoot)();
|
|
52
53
|
await isGitExecutableAvailable();
|
|
54
|
+
const latestRemotionVersionPromise = (0, latest_remotion_version_1.getLatestRemotionVersion)();
|
|
53
55
|
const selectedTemplate = await (0, select_template_1.selectTemplate)();
|
|
54
56
|
const pkgManager = (0, pkg_managers_1.selectPackageManager)();
|
|
55
57
|
try {
|
|
@@ -59,7 +61,12 @@ const init = async () => {
|
|
|
59
61
|
dest: projectRoot,
|
|
60
62
|
});
|
|
61
63
|
(0, patch_readme_1.patchReadmeMd)(projectRoot, pkgManager);
|
|
62
|
-
|
|
64
|
+
const latestVersion = await latestRemotionVersionPromise;
|
|
65
|
+
(0, patch_package_json_1.patchPackageJson)({
|
|
66
|
+
projectRoot,
|
|
67
|
+
projectName: folderName,
|
|
68
|
+
latestRemotionVersion: latestVersion,
|
|
69
|
+
});
|
|
63
70
|
}
|
|
64
71
|
catch (e) {
|
|
65
72
|
log_1.Log.error(e);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getLatestRemotionVersion: () => Promise<any>;
|
|
@@ -0,0 +1,31 @@
|
|
|
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.getLatestRemotionVersion = void 0;
|
|
7
|
+
const https_1 = __importDefault(require("https"));
|
|
8
|
+
const getPackageJsonForRemotion = () => {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const req = https_1.default.get('https://registry.npmjs.org/remotion', {
|
|
11
|
+
headers: {
|
|
12
|
+
accept: 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
|
|
13
|
+
},
|
|
14
|
+
}, (res) => {
|
|
15
|
+
let data = '';
|
|
16
|
+
res.on('data', (d) => {
|
|
17
|
+
data += d;
|
|
18
|
+
});
|
|
19
|
+
res.on('end', () => resolve(data));
|
|
20
|
+
});
|
|
21
|
+
req.on('error', (error) => {
|
|
22
|
+
reject(error);
|
|
23
|
+
});
|
|
24
|
+
req.end();
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const getLatestRemotionVersion = async () => {
|
|
28
|
+
const pkgJson = await getPackageJsonForRemotion();
|
|
29
|
+
return JSON.parse(pkgJson)['dist-tags'].latest;
|
|
30
|
+
};
|
|
31
|
+
exports.getLatestRemotionVersion = getLatestRemotionVersion;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const listOfRemotionPackages: string[];
|
|
2
|
+
export declare const patchPackageJson: ({ projectRoot, projectName, latestRemotionVersion, }: {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
projectName: string;
|
|
5
|
+
latestRemotionVersion: string;
|
|
6
|
+
}) => void;
|
|
@@ -3,16 +3,45 @@ 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 = void 0;
|
|
6
|
+
exports.patchPackageJson = exports.listOfRemotionPackages = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
|
|
9
|
+
exports.listOfRemotionPackages = [
|
|
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/paths',
|
|
18
|
+
'@remotion/babel-loader',
|
|
19
|
+
'@remotion/lambda',
|
|
20
|
+
'@remotion/player',
|
|
21
|
+
'@remotion/preload',
|
|
22
|
+
'@remotion/three',
|
|
23
|
+
'@remotion/gif',
|
|
24
|
+
'remotion',
|
|
25
|
+
];
|
|
26
|
+
const patchPackageJson = ({ projectRoot, projectName, latestRemotionVersion, }) => {
|
|
10
27
|
const fileName = path_1.default.join(projectRoot, 'package.json');
|
|
11
28
|
const contents = fs_1.default.readFileSync(fileName, 'utf-8');
|
|
12
29
|
const packageJson = JSON.parse(contents);
|
|
30
|
+
const { name, dependencies, ...others } = packageJson;
|
|
31
|
+
const newDependencies = Object.keys(dependencies)
|
|
32
|
+
.map((d) => {
|
|
33
|
+
if (exports.listOfRemotionPackages.includes(d)) {
|
|
34
|
+
return [d, latestRemotionVersion];
|
|
35
|
+
}
|
|
36
|
+
return [d, dependencies[d]];
|
|
37
|
+
})
|
|
38
|
+
.reduce((a, b) => {
|
|
39
|
+
return { ...a, [b[0]]: b[1] };
|
|
40
|
+
}, {});
|
|
13
41
|
const newPackageJson = JSON.stringify({
|
|
14
|
-
...packageJson,
|
|
15
42
|
name: projectName,
|
|
43
|
+
...others,
|
|
44
|
+
dependencies: newDependencies,
|
|
16
45
|
}, undefined, 2);
|
|
17
46
|
fs_1.default.writeFileSync(fileName, newPackageJson);
|
|
18
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-video",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"prettier-plugin-organize-imports": "^2.3.4",
|
|
36
36
|
"typescript": "^4.7.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "989d20fc0ace36685c71396847e1b7b7a06d00d7"
|
|
39
39
|
}
|