create-video 4.0.471 → 4.0.472
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
|
@@ -113,7 +113,9 @@ const init = async () => {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
const latestRemotionVersionPromise = (0, latest_remotion_version_1.getLatestRemotionVersion)(
|
|
116
|
+
const latestRemotionVersionPromise = (0, latest_remotion_version_1.getLatestRemotionVersion)({
|
|
117
|
+
onError: log_1.Log.warn,
|
|
118
|
+
});
|
|
117
119
|
const shouldOverrideTailwind = selectedTemplate.allowEnableTailwind
|
|
118
120
|
? (0, select_template_1.isYesFlagSelected)()
|
|
119
121
|
? !(0, select_template_1.isNoTailwindFlagSelected)()
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
type GetLatestRemotionVersionOptions = {
|
|
2
|
+
getRegistry?: () => string;
|
|
3
|
+
getPackageJsonForRemotion?: (registry: string) => Promise<string>;
|
|
4
|
+
fallbackVersion?: string;
|
|
5
|
+
onError?: (message: string) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const getLatestRemotionVersion: ({ getRegistry: getRegistryOption, getPackageJsonForRemotion: getPackageJsonForRemotionOption, fallbackVersion, onError, }?: GetLatestRemotionVersionOptions) => Promise<string>;
|
|
8
|
+
export {};
|
|
@@ -8,6 +8,7 @@ const node_child_process_1 = require("node:child_process");
|
|
|
8
8
|
const node_http_1 = __importDefault(require("node:http"));
|
|
9
9
|
const node_https_1 = __importDefault(require("node:https"));
|
|
10
10
|
const DEFAULT_REGISTRY = 'https://registry.npmjs.org';
|
|
11
|
+
const packageJson = require('../package.json');
|
|
11
12
|
const getRegistry = () => {
|
|
12
13
|
try {
|
|
13
14
|
const registry = (0, node_child_process_1.execSync)('npm config get registry', {
|
|
@@ -24,8 +25,7 @@ const getRegistry = () => {
|
|
|
24
25
|
}
|
|
25
26
|
return DEFAULT_REGISTRY;
|
|
26
27
|
};
|
|
27
|
-
const getPackageJsonForRemotion = () => {
|
|
28
|
-
const registry = getRegistry();
|
|
28
|
+
const getPackageJsonForRemotion = (registry) => {
|
|
29
29
|
const url = `${registry}/remotion`;
|
|
30
30
|
const client = url.startsWith('https') ? node_https_1.default : node_http_1.default;
|
|
31
31
|
return new Promise((resolve, reject) => {
|
|
@@ -46,17 +46,29 @@ const getPackageJsonForRemotion = () => {
|
|
|
46
46
|
req.end();
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
|
-
const
|
|
50
|
-
|
|
49
|
+
const parseLatestVersion = (pkgJson) => {
|
|
50
|
+
var _a;
|
|
51
|
+
const latest = (_a = JSON.parse(pkgJson)['dist-tags']) === null || _a === void 0 ? void 0 : _a.latest;
|
|
52
|
+
if (typeof latest !== 'string') {
|
|
53
|
+
throw new Error('The response did not include dist-tags.latest.');
|
|
54
|
+
}
|
|
55
|
+
return latest;
|
|
56
|
+
};
|
|
57
|
+
const stringifyError = (error) => {
|
|
58
|
+
if (error instanceof Error) {
|
|
59
|
+
return error.message;
|
|
60
|
+
}
|
|
61
|
+
return String(error);
|
|
62
|
+
};
|
|
63
|
+
const getLatestRemotionVersion = async ({ getRegistry: getRegistryOption = getRegistry, getPackageJsonForRemotion: getPackageJsonForRemotionOption = getPackageJsonForRemotion, fallbackVersion = packageJson.version, onError, } = {}) => {
|
|
64
|
+
const registry = getRegistryOption();
|
|
51
65
|
try {
|
|
52
|
-
|
|
66
|
+
const pkgJson = await getPackageJsonForRemotionOption(registry);
|
|
67
|
+
return parseLatestVersion(pkgJson);
|
|
53
68
|
}
|
|
54
|
-
catch (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
`The response was not valid JSON. ` +
|
|
58
|
-
`If you are behind a corporate proxy, make sure your npm registry is configured correctly ` +
|
|
59
|
-
`(npm config set registry <your-registry-url>).`);
|
|
69
|
+
catch (err) {
|
|
70
|
+
onError === null || onError === void 0 ? void 0 : onError(`Could not fetch the latest Remotion version from ${registry} (${stringifyError(err)}). Continuing with ${fallbackVersion}.`);
|
|
71
|
+
return fallbackVersion;
|
|
60
72
|
}
|
|
61
73
|
};
|
|
62
74
|
exports.getLatestRemotionVersion = getLatestRemotionVersion;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/create-video"
|
|
4
4
|
},
|
|
5
5
|
"name": "create-video",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.472",
|
|
7
7
|
"description": "Create a new Remotion project",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/prompts": "2.4.9",
|
|
31
31
|
"@types/tar": "6.1.1",
|
|
32
32
|
"react": "19.2.3",
|
|
33
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
33
|
+
"@remotion/eslint-config-internal": "4.0.472",
|
|
34
34
|
"eslint": "9.19.0",
|
|
35
35
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
36
36
|
},
|