create-video 4.0.407 → 4.0.409
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/ask-skills.d.ts +1 -0
- package/dist/ask-skills.js +25 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/init.js +15 -7
- package/dist/install-skills.d.ts +1 -0
- package/dist/install-skills.js +28 -0
- package/dist/list-of-remotion-packages.js +1 -0
- package/dist/open-in-editor-flow.js +8 -4
- package/dist/pkg-managers.js +1 -1
- package/dist/resolve-project-root.js +1 -2
- package/dist/select-template.d.ts +11 -0
- package/dist/select-template.js +6 -6
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const askSkills: () => Promise<boolean>;
|
|
@@ -0,0 +1,25 @@
|
|
|
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.askSkills = void 0;
|
|
7
|
+
const make_link_1 = require("./hyperlinks/make-link");
|
|
8
|
+
const prompts_1 = __importDefault(require("./prompts"));
|
|
9
|
+
const askSkills = async () => {
|
|
10
|
+
const link = (0, make_link_1.makeHyperlink)({
|
|
11
|
+
text: 'agent skills',
|
|
12
|
+
url: 'https://remotion.dev/docs/ai/skills',
|
|
13
|
+
fallback: 'agent skills',
|
|
14
|
+
});
|
|
15
|
+
const { answer } = await (0, prompts_1.default)({
|
|
16
|
+
type: 'toggle',
|
|
17
|
+
name: 'answer',
|
|
18
|
+
message: `Add ${link}?`,
|
|
19
|
+
initial: false,
|
|
20
|
+
active: 'Yes',
|
|
21
|
+
inactive: 'No',
|
|
22
|
+
});
|
|
23
|
+
return answer;
|
|
24
|
+
};
|
|
25
|
+
exports.askSkills = askSkills;
|
package/dist/esm/index.mjs
CHANGED
package/dist/init.js
CHANGED
|
@@ -9,18 +9,20 @@ const execa_1 = __importDefault(require("execa"));
|
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const add_tailwind_1 = require("./add-tailwind");
|
|
11
11
|
const add_yarn2_support_1 = require("./add-yarn2-support");
|
|
12
|
+
const ask_skills_1 = require("./ask-skills");
|
|
12
13
|
const ask_tailwind_1 = require("./ask-tailwind");
|
|
13
14
|
const create_public_folder_1 = require("./create-public-folder");
|
|
14
15
|
const degit_1 = require("./degit");
|
|
16
|
+
const install_skills_1 = require("./install-skills");
|
|
15
17
|
const latest_remotion_version_1 = require("./latest-remotion-version");
|
|
16
18
|
const log_1 = require("./log");
|
|
17
19
|
const open_in_editor_flow_1 = require("./open-in-editor-flow");
|
|
18
20
|
const patch_package_json_1 = require("./patch-package-json");
|
|
19
21
|
const patch_readme_1 = require("./patch-readme");
|
|
20
22
|
const pkg_managers_1 = require("./pkg-managers");
|
|
23
|
+
const prompts_1 = __importDefault(require("./prompts"));
|
|
21
24
|
const resolve_project_root_1 = require("./resolve-project-root");
|
|
22
25
|
const select_template_1 = require("./select-template");
|
|
23
|
-
const yesno_1 = require("./yesno");
|
|
24
26
|
const gitExists = (commandToCheck, argsToCheck) => {
|
|
25
27
|
try {
|
|
26
28
|
execa_1.default.sync(commandToCheck, argsToCheck);
|
|
@@ -73,7 +75,6 @@ const init = async () => {
|
|
|
73
75
|
const directoryArgument = (0, select_template_1.getDirectoryArgument)();
|
|
74
76
|
// Select template first
|
|
75
77
|
const selectedTemplate = await (0, select_template_1.selectTemplate)();
|
|
76
|
-
log_1.Log.info(`Selected ${chalk_1.default.blue(selectedTemplate.shortName)}.`);
|
|
77
78
|
// If Editor Starter (paid) is selected, show purchase link and exit
|
|
78
79
|
if (selectedTemplate.cliId === 'editor-starter') {
|
|
79
80
|
log_1.Log.newLine();
|
|
@@ -86,18 +87,21 @@ const init = async () => {
|
|
|
86
87
|
directoryArgument,
|
|
87
88
|
selectedTemplate,
|
|
88
89
|
});
|
|
89
|
-
log_1.Log.info();
|
|
90
90
|
const result = await (0, exports.checkGitAvailability)(projectRoot, 'git', ['--version']);
|
|
91
91
|
if (result.type === 'git-not-installed') {
|
|
92
92
|
log_1.Log.error('Git is not installed or not in the path. Install Git to continue.');
|
|
93
93
|
process.exit(1);
|
|
94
94
|
}
|
|
95
95
|
if (result.type === 'is-git-repo') {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
const { shouldContinue } = await (0, prompts_1.default)({
|
|
97
|
+
type: 'toggle',
|
|
98
|
+
name: 'shouldContinue',
|
|
99
|
+
message: `You are already inside a Git repo (${node_path_1.default.resolve(result.location)}).\nThis might lead to a Git Submodule being created. Do you want to continue?`,
|
|
100
|
+
initial: false,
|
|
101
|
+
active: 'Yes',
|
|
102
|
+
inactive: 'No',
|
|
99
103
|
});
|
|
100
|
-
if (!
|
|
104
|
+
if (!shouldContinue) {
|
|
101
105
|
process.exit(1);
|
|
102
106
|
}
|
|
103
107
|
}
|
|
@@ -105,6 +109,7 @@ const init = async () => {
|
|
|
105
109
|
const shouldOverrideTailwind = selectedTemplate.allowEnableTailwind
|
|
106
110
|
? await (0, ask_tailwind_1.askTailwind)()
|
|
107
111
|
: false;
|
|
112
|
+
const shouldInstallSkills = await (0, ask_skills_1.askSkills)();
|
|
108
113
|
const pkgManager = (0, pkg_managers_1.selectPackageManager)();
|
|
109
114
|
const pkgManagerVersion = await (0, pkg_managers_1.getPackageManagerVersionOrNull)(pkgManager);
|
|
110
115
|
try {
|
|
@@ -140,6 +145,9 @@ const init = async () => {
|
|
|
140
145
|
projectRoot,
|
|
141
146
|
});
|
|
142
147
|
await getGitStatus(projectRoot);
|
|
148
|
+
if (shouldInstallSkills) {
|
|
149
|
+
await (0, install_skills_1.installSkills)(projectRoot);
|
|
150
|
+
}
|
|
143
151
|
const relativeToCurrent = node_path_1.default.relative(process.cwd(), projectRoot);
|
|
144
152
|
const cdToFolder = relativeToCurrent.startsWith('.')
|
|
145
153
|
? projectRoot
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const installSkills: (projectRoot: string) => Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
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.installSkills = void 0;
|
|
7
|
+
const execa_1 = __importDefault(require("execa"));
|
|
8
|
+
const log_1 = require("./log");
|
|
9
|
+
const installSkills = async (projectRoot) => {
|
|
10
|
+
try {
|
|
11
|
+
await (0, execa_1.default)('npx', [
|
|
12
|
+
'-y',
|
|
13
|
+
'--loglevel=error',
|
|
14
|
+
'add-skill@1.0.20',
|
|
15
|
+
'remotion-dev/skills',
|
|
16
|
+
'--yes',
|
|
17
|
+
], {
|
|
18
|
+
cwd: projectRoot,
|
|
19
|
+
stdio: 'inherit',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
log_1.Log.error('Error installing skills:', e);
|
|
24
|
+
log_1.Log.error('You can install them manually by running:');
|
|
25
|
+
log_1.Log.error(' npx add-skill remotion-dev/skills');
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.installSkills = installSkills;
|
|
@@ -7,7 +7,7 @@ exports.openInEditorFlow = void 0;
|
|
|
7
7
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
8
|
const log_1 = require("./log");
|
|
9
9
|
const open_in_editor_1 = require("./open-in-editor");
|
|
10
|
-
const
|
|
10
|
+
const prompts_1 = __importDefault(require("./prompts"));
|
|
11
11
|
const openInEditorFlow = async (projectRoot) => {
|
|
12
12
|
const editors = await (0, open_in_editor_1.guessEditor)();
|
|
13
13
|
const [guiEditor] = editors.filter((e) => !(0, open_in_editor_1.isTerminalEditor)(e.command));
|
|
@@ -15,9 +15,13 @@ const openInEditorFlow = async (projectRoot) => {
|
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
const displayName = (0, open_in_editor_1.getDisplayNameForEditor)(guiEditor.command);
|
|
18
|
-
const should = await (0,
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const should = await (0, prompts_1.default)({
|
|
19
|
+
message: `💻 Open in ${displayName}?`,
|
|
20
|
+
initial: true,
|
|
21
|
+
type: 'toggle',
|
|
22
|
+
name: 'answer',
|
|
23
|
+
active: 'Yes',
|
|
24
|
+
inactive: 'No',
|
|
21
25
|
});
|
|
22
26
|
if (should) {
|
|
23
27
|
await (0, open_in_editor_1.launchEditor)({
|
package/dist/pkg-managers.js
CHANGED
|
@@ -136,7 +136,7 @@ const getDevCommand = (manager, template) => {
|
|
|
136
136
|
};
|
|
137
137
|
exports.getDevCommand = getDevCommand;
|
|
138
138
|
const getPackageManagerVersion = (manager) => {
|
|
139
|
-
const cmd = `${manager} -v`;
|
|
139
|
+
const cmd = manager === 'npm' ? 'npm -v --loglevel=error' : `${manager} -v`;
|
|
140
140
|
return new Promise((resolve, reject) => {
|
|
141
141
|
(0, node_child_process_1.exec)(cmd, (error, stdout, stderr) => {
|
|
142
142
|
if (error) {
|
|
@@ -49,9 +49,8 @@ const resolveProjectRoot = async (options) => {
|
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
51
|
// Print selected template info before prompting for directory
|
|
52
|
-
if (options === null || options === void 0 ? void 0 : options.selectedTemplate) {
|
|
52
|
+
if ((options === null || options === void 0 ? void 0 : options.selectedTemplate) && select_template_1.isFlagSelected) {
|
|
53
53
|
log_1.Log.info(`Selected template: ${chalk_1.default.blue(options.selectedTemplate.shortName)}`);
|
|
54
|
-
log_1.Log.info();
|
|
55
54
|
}
|
|
56
55
|
try {
|
|
57
56
|
const currentMs = Date.now();
|
|
@@ -2,6 +2,17 @@ import type { Template } from './templates';
|
|
|
2
2
|
export declare const isTmpFlagSelected: () => boolean;
|
|
3
3
|
export declare const getPositionalArguments: () => string[];
|
|
4
4
|
export declare const getDirectoryArgument: () => string | null;
|
|
5
|
+
export declare const isFlagSelected: Template | {
|
|
6
|
+
homePageLabel: string;
|
|
7
|
+
shortName: string;
|
|
8
|
+
org: string;
|
|
9
|
+
repoName: string;
|
|
10
|
+
description: string;
|
|
11
|
+
longerDescription: string;
|
|
12
|
+
cliId: "editor-starter";
|
|
13
|
+
defaultBranch: string;
|
|
14
|
+
previewURL: string;
|
|
15
|
+
} | undefined;
|
|
5
16
|
export declare const selectTemplate: () => Promise<Template | {
|
|
6
17
|
homePageLabel: string;
|
|
7
18
|
shortName: string;
|
package/dist/select-template.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.selectTemplate = exports.getDirectoryArgument = exports.getPositionalArguments = exports.isTmpFlagSelected = void 0;
|
|
6
|
+
exports.selectTemplate = exports.isFlagSelected = exports.getDirectoryArgument = exports.getPositionalArguments = exports.isTmpFlagSelected = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const minimist_1 = __importDefault(require("minimist"));
|
|
9
9
|
const make_link_1 = require("./hyperlinks/make-link");
|
|
@@ -23,12 +23,12 @@ const getDirectoryArgument = () => {
|
|
|
23
23
|
return positionalArgs.length > 0 ? positionalArgs[0] || null : null;
|
|
24
24
|
};
|
|
25
25
|
exports.getDirectoryArgument = getDirectoryArgument;
|
|
26
|
+
exports.isFlagSelected = ALL_TEMPLATES.find((f) => {
|
|
27
|
+
return parsed[f.cliId];
|
|
28
|
+
});
|
|
26
29
|
const selectTemplate = async () => {
|
|
27
|
-
|
|
28
|
-
return
|
|
29
|
-
});
|
|
30
|
-
if (isFlagSelected) {
|
|
31
|
-
return isFlagSelected;
|
|
30
|
+
if (exports.isFlagSelected) {
|
|
31
|
+
return exports.isFlagSelected;
|
|
32
32
|
}
|
|
33
33
|
return (await (0, prompts_1.selectAsync)({
|
|
34
34
|
message: 'Choose a template:',
|
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.409",
|
|
7
7
|
"description": "Create a new Remotion project",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"bin": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@types/prompts": "^2.0.12",
|
|
30
30
|
"@types/tar": "6.1.1",
|
|
31
31
|
"react": "19.2.3",
|
|
32
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
32
|
+
"@remotion/eslint-config-internal": "4.0.409",
|
|
33
33
|
"eslint": "9.19.0"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|