create-video 3.0.4 → 3.0.7

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/degit.d.ts CHANGED
@@ -4,4 +4,3 @@ export declare const degit: ({ repoOrg, repoName, dest, }: {
4
4
  repoName: string;
5
5
  dest: string;
6
6
  }) => Promise<void>;
7
- //# sourceMappingURL=degit.d.ts.map
package/dist/degit.js CHANGED
@@ -53,4 +53,3 @@ function untar(file, dest) {
53
53
  C: dest,
54
54
  }, []);
55
55
  }
56
- //# sourceMappingURL=degit.js.map
@@ -0,0 +1,6 @@
1
+ export declare const CreateVideoInternals: {
2
+ FEATURED_TEMPLATES: import("./templates").Template[];
3
+ };
4
+ export { Template } from './templates';
5
+ declare const _default: () => never;
6
+ export default _default;
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateVideoInternals = void 0;
4
+ const templates_1 = require("./templates");
5
+ exports.CreateVideoInternals = {
6
+ FEATURED_TEMPLATES: templates_1.FEATURED_TEMPLATES,
7
+ };
8
+ exports.default = () => {
9
+ throw new Error('create-video is a CLI tool only. Run `yarn create video` or `npm init video` instead!');
10
+ };
package/dist/init.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export declare const init: () => Promise<void>;
2
- //# sourceMappingURL=init.d.ts.map
package/dist/init.js CHANGED
@@ -1,23 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
22
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
4
  };
@@ -31,58 +12,8 @@ const open_in_editor_flow_1 = require("./open-in-editor-flow");
31
12
  const patch_package_json_1 = require("./patch-package-json");
32
13
  const patch_readme_1 = require("./patch-readme");
33
14
  const pkg_managers_1 = require("./pkg-managers");
34
- const prompts_1 = __importStar(require("./prompts"));
35
15
  const resolve_project_root_1 = require("./resolve-project-root");
36
- const strip_ansi_1 = require("./strip-ansi");
37
- const FEATURED_TEMPLATES = [
38
- {
39
- shortName: 'Hello World',
40
- org: 'remotion-dev',
41
- repoName: 'template-helloworld',
42
- description: 'The default starter template (recommended)',
43
- },
44
- {
45
- shortName: 'Blank',
46
- description: 'Nothing except an empty canvas',
47
- org: 'remotion-dev',
48
- repoName: 'template-empty',
49
- },
50
- {
51
- shortName: 'Hello World (Javascript)',
52
- org: 'remotion-dev',
53
- repoName: 'template-helloworld-javascript',
54
- description: 'The default starter template in plain JS',
55
- },
56
- {
57
- shortName: 'React Three Fiber',
58
- org: 'remotion-dev',
59
- repoName: 'template-three',
60
- description: 'Remotion + React Three Fiber Starter Template',
61
- },
62
- {
63
- shortName: 'Still images',
64
- org: 'remotion-dev',
65
- repoName: 'template-still',
66
- description: 'Dynamic PNG/JPEG template with built-in server',
67
- },
68
- {
69
- shortName: 'Text To Speech',
70
- org: 'FelippeChemello',
71
- repoName: 'Remotion-TTS-Example',
72
- description: 'Turns text into speech and makes a video',
73
- },
74
- {
75
- shortName: 'Audiogram',
76
- org: 'marcusstenbeck',
77
- repoName: 'remotion-template-audiogram',
78
- description: 'Text and waveform visualization for podcasts',
79
- },
80
- ];
81
- function padEnd(str, width) {
82
- // Pulled from commander for overriding
83
- const len = Math.max(0, width - (0, strip_ansi_1.stripAnsi)(str).length);
84
- return str + Array(len + 1).join(' ');
85
- }
16
+ const select_template_1 = require("./select-template");
86
17
  const isGitExecutableAvailable = async () => {
87
18
  try {
88
19
  await (0, execa_1.default)('git', ['--version']);
@@ -119,21 +50,7 @@ const init = async () => {
119
50
  var _a, _b, _c, _d, _e, _f;
120
51
  const [projectRoot, folderName] = await (0, resolve_project_root_1.resolveProjectRoot)();
121
52
  await isGitExecutableAvailable();
122
- const descriptionColumn = Math.max(...FEATURED_TEMPLATES.map((t) => typeof t === 'object' ? t.shortName.length : 0)) + 2;
123
- const selectedTemplate = (await (0, prompts_1.selectAsync)({
124
- message: 'Choose a template:',
125
- optionsPerPage: 20,
126
- choices: FEATURED_TEMPLATES.map((template) => {
127
- if (typeof template === 'string') {
128
- return prompts_1.default.separator(template);
129
- }
130
- return {
131
- value: template,
132
- title: chalk_1.default.bold(padEnd(template.shortName, descriptionColumn)) +
133
- template.description.trim(),
134
- };
135
- }),
136
- }, {}));
53
+ const selectedTemplate = await (0, select_template_1.selectTemplate)();
137
54
  const pkgManager = (0, pkg_managers_1.selectPackageManager)();
138
55
  try {
139
56
  await (0, degit_1.degit)({
@@ -149,7 +66,7 @@ const init = async () => {
149
66
  log_1.Log.error('Error with template cloning. Aborting');
150
67
  process.exit(1);
151
68
  }
152
- log_1.Log.info(`Created project at ${chalk_1.default.blueBright(folderName)}. Installing dependencies...`);
69
+ log_1.Log.info(`Copied ${chalk_1.default.blueBright(selectedTemplate.shortName)} to ${chalk_1.default.blueBright(folderName)}. Installing dependencies...`);
153
70
  if (pkgManager === 'yarn') {
154
71
  log_1.Log.info('> yarn');
155
72
  const promise = (0, execa_1.default)('yarn', [], {
@@ -199,4 +116,3 @@ const init = async () => {
199
116
  log_1.Log.info('Enjoy Remotion!');
200
117
  };
201
118
  exports.init = init;
202
- //# sourceMappingURL=init.js.map
package/dist/log.d.ts CHANGED
@@ -17,4 +17,3 @@ export declare const Log: {
17
17
  error: (message?: any, ...optionalParams: any[]) => void;
18
18
  newLine: () => void;
19
19
  };
20
- //# sourceMappingURL=log.d.ts.map
package/dist/log.js CHANGED
@@ -24,4 +24,3 @@ exports.Log = {
24
24
  return console.log();
25
25
  },
26
26
  };
27
- //# sourceMappingURL=log.js.map
package/dist/mkdirp.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export declare function mkdirp(dir: string): void;
2
- //# sourceMappingURL=mkdirp.d.ts.map
package/dist/mkdirp.js CHANGED
@@ -20,4 +20,3 @@ function mkdirp(dir) {
20
20
  }
21
21
  }
22
22
  exports.mkdirp = mkdirp;
23
- //# sourceMappingURL=mkdirp.js.map
@@ -1,2 +1 @@
1
1
  export declare const openInEditorFlow: (projectRoot: string) => Promise<void>;
2
- //# sourceMappingURL=open-in-editor-flow.d.ts.map
@@ -44,4 +44,3 @@ const openInEditorFlow = async (projectRoot) => {
44
44
  log_1.Log.info();
45
45
  };
46
46
  exports.openInEditorFlow = openInEditorFlow;
47
- //# sourceMappingURL=open-in-editor-flow.js.map
@@ -12,4 +12,3 @@ export declare function launchEditor({ colNumber, editor, fileName, lineNumber,
12
12
  vsCodeNewWindow: boolean;
13
13
  }): boolean;
14
14
  export {};
15
- //# sourceMappingURL=open-in-editor.d.ts.map
@@ -452,4 +452,3 @@ function launchEditor({ colNumber, editor, fileName, lineNumber, vsCodeNewWindow
452
452
  return true;
453
453
  }
454
454
  exports.launchEditor = launchEditor;
455
- //# sourceMappingURL=open-in-editor.js.map
@@ -1,2 +1 @@
1
1
  export declare const patchPackageJson: (projectRoot: string, projectName: string) => void;
2
- //# sourceMappingURL=patch-package-json.d.ts.map
@@ -17,4 +17,3 @@ const patchPackageJson = (projectRoot, projectName) => {
17
17
  fs_1.default.writeFileSync(fileName, newPackageJson);
18
18
  };
19
19
  exports.patchPackageJson = patchPackageJson;
20
- //# sourceMappingURL=patch-package-json.js.map
@@ -1,3 +1,2 @@
1
1
  import { PackageManager } from './pkg-managers';
2
2
  export declare const patchReadmeMd: (projectRoot: string, packageManager: PackageManager) => void;
3
- //# sourceMappingURL=patch-readme.d.ts.map
@@ -31,4 +31,3 @@ const patchReadmeMd = (projectRoot, packageManager) => {
31
31
  fs_1.default.writeFileSync(fileName, newContents);
32
32
  };
33
33
  exports.patchReadmeMd = patchReadmeMd;
34
- //# sourceMappingURL=patch-readme.js.map
@@ -4,4 +4,3 @@ export declare const getInstallCommand: (manager: PackageManager) => "yarn" | "n
4
4
  export declare const getStartCommand: (manager: PackageManager) => "npm start" | "yarn start" | "pnpm start" | undefined;
5
5
  export declare const getRenderCommand: (manager: PackageManager) => "npm run build" | "yarn build" | "pnpm build" | undefined;
6
6
  export declare const getUpgradeCommand: (manager: PackageManager) => "npm run upgrade" | "yarn run upgrade" | "pnpm run upgrade" | undefined;
7
- //# sourceMappingURL=pkg-managers.d.ts.map
@@ -83,4 +83,3 @@ const getUpgradeCommand = (manager) => {
83
83
  }
84
84
  };
85
85
  exports.getUpgradeCommand = getUpgradeCommand;
86
- //# sourceMappingURL=pkg-managers.js.map
package/dist/prompts.d.ts CHANGED
@@ -16,4 +16,3 @@ declare namespace prompt {
16
16
  }
17
17
  export default prompt;
18
18
  export declare function selectAsync(questions: NamelessQuestion, options?: PromptOptions): Promise<unknown>;
19
- //# sourceMappingURL=prompts.d.ts.map
package/dist/prompts.js CHANGED
@@ -102,4 +102,3 @@ async function selectAsync(questions, options) {
102
102
  return value !== null && value !== void 0 ? value : null;
103
103
  }
104
104
  exports.selectAsync = selectAsync;
105
- //# sourceMappingURL=prompts.js.map
@@ -1,2 +1 @@
1
1
  export declare const resolveProjectRoot: () => Promise<[string, string]>;
2
- //# sourceMappingURL=resolve-project-root.d.ts.map
@@ -66,4 +66,3 @@ const resolveProjectRoot = async () => {
66
66
  return [projectRoot, folderName];
67
67
  };
68
68
  exports.resolveProjectRoot = resolveProjectRoot;
69
- //# sourceMappingURL=resolve-project-root.js.map
@@ -0,0 +1,2 @@
1
+ import { Template } from './templates';
2
+ export declare const selectTemplate: () => Promise<Template>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.selectTemplate = void 0;
26
+ const chalk_1 = __importDefault(require("chalk"));
27
+ const minimist_1 = __importDefault(require("minimist"));
28
+ const prompts_1 = __importStar(require("./prompts"));
29
+ const strip_ansi_1 = require("./strip-ansi");
30
+ const templates_1 = require("./templates");
31
+ const parsed = (0, minimist_1.default)(process.argv.slice(2), {
32
+ boolean: templates_1.FEATURED_TEMPLATES.map((f) => f.cliId),
33
+ });
34
+ function padEnd(str, width) {
35
+ // Pulled from commander for overriding
36
+ const len = Math.max(0, width - (0, strip_ansi_1.stripAnsi)(str).length);
37
+ return str + Array(len + 1).join(' ');
38
+ }
39
+ const descriptionColumn = Math.max(...templates_1.FEATURED_TEMPLATES.map((t) => typeof t === 'object' ? t.shortName.length : 0)) + 2;
40
+ const selectTemplate = async () => {
41
+ const isFlagSelected = templates_1.FEATURED_TEMPLATES.find((f) => {
42
+ return parsed[f.cliId];
43
+ });
44
+ if (isFlagSelected) {
45
+ return isFlagSelected;
46
+ }
47
+ const selectedTemplate = (await (0, prompts_1.selectAsync)({
48
+ message: 'Choose a template:',
49
+ optionsPerPage: 20,
50
+ choices: templates_1.FEATURED_TEMPLATES.map((template) => {
51
+ if (typeof template === 'string') {
52
+ return prompts_1.default.separator(template);
53
+ }
54
+ return {
55
+ value: template,
56
+ title: chalk_1.default.bold(padEnd(template.shortName, descriptionColumn)) +
57
+ template.description.trim(),
58
+ };
59
+ }),
60
+ }, {}));
61
+ return selectedTemplate;
62
+ };
63
+ exports.selectTemplate = selectTemplate;
@@ -1,2 +1 @@
1
1
  export declare const stripAnsi: (str: string) => string;
2
- //# sourceMappingURL=strip-ansi.d.ts.map
@@ -19,4 +19,3 @@ const stripAnsi = (str) => {
19
19
  return str.replace(ansiRegex(), '');
20
20
  };
21
21
  exports.stripAnsi = stripAnsi;
22
- //# sourceMappingURL=strip-ansi.js.map
@@ -0,0 +1,15 @@
1
+ export declare type Template = {
2
+ shortName: string;
3
+ description: string;
4
+ org: string;
5
+ repoName: string;
6
+ homePageLabel: string;
7
+ longerDescription: string;
8
+ promoVideo: {
9
+ muxId: string;
10
+ width: number;
11
+ height: number;
12
+ };
13
+ cliId: string;
14
+ };
15
+ export declare const FEATURED_TEMPLATES: Template[];
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FEATURED_TEMPLATES = void 0;
4
+ exports.FEATURED_TEMPLATES = [
5
+ {
6
+ homePageLabel: 'TypeScript',
7
+ shortName: 'Hello World',
8
+ org: 'remotion-dev',
9
+ repoName: 'template-helloworld',
10
+ description: 'The default starter template (recommended)',
11
+ longerDescription: 'A basic template with TypeScript, Prettier and ESLint preconfigured. Our recommended choice for beginners.',
12
+ promoVideo: {
13
+ muxId: 'vKvV6aa7GXGlR01cmpc6J8Zz4Gkj9d2hBSnVYoef00900I',
14
+ height: 1080,
15
+ width: 1920,
16
+ },
17
+ cliId: 'hello-world',
18
+ },
19
+ {
20
+ homePageLabel: 'JavaScript',
21
+ shortName: 'Hello World (Javascript)',
22
+ org: 'remotion-dev',
23
+ repoName: 'template-helloworld-javascript',
24
+ description: 'The default starter template in plain JS',
25
+ longerDescription: 'The Hello World template, but in plain JavaScript. Recommended for people who detest TypeScript.',
26
+ promoVideo: {
27
+ muxId: 'dRIuc00f8QWnKedM8GBGPqXJWqU01DPJFgPTHpJgixxas',
28
+ width: 1920,
29
+ height: 1080,
30
+ },
31
+ cliId: 'javascript',
32
+ },
33
+ {
34
+ homePageLabel: 'Blank',
35
+ shortName: 'Blank',
36
+ description: 'Nothing except an empty canvas',
37
+ org: 'remotion-dev',
38
+ repoName: 'template-empty',
39
+ longerDescription: 'A template containing nothing but an empty canvas. Recommended for people who already worked with Remotion.',
40
+ promoVideo: {
41
+ muxId: 'JD00x15y859GjqO7C9hpILkrSddGzd55K4lfj02dv8gU4',
42
+ width: 1280,
43
+ height: 720,
44
+ },
45
+ cliId: 'blank',
46
+ },
47
+ {
48
+ homePageLabel: '3D',
49
+ shortName: 'React Three Fiber',
50
+ org: 'remotion-dev',
51
+ repoName: 'template-three',
52
+ description: 'Remotion + React Three Fiber Starter Template',
53
+ longerDescription: 'A template with a React Three Fiber scene to play around.',
54
+ promoVideo: {
55
+ muxId: 'mN40242xogVDx023lCChyg8JJBLT02Mqu01Pp00rbbk00SL8M',
56
+ width: 1280,
57
+ height: 720,
58
+ },
59
+ cliId: 'three',
60
+ },
61
+ {
62
+ homePageLabel: 'Stills',
63
+ shortName: 'Still images',
64
+ org: 'remotion-dev',
65
+ repoName: 'template-still',
66
+ description: 'Dynamic PNG/JPEG template with built-in server',
67
+ longerDescription: 'A template for creating still images. Includes a built-in HTTP server that can be deployed to Heroku.',
68
+ promoVideo: {
69
+ muxId: 'admEY3QofSXUf01YbLKR8KqoZXhhprTvEZCM9onSo0001o',
70
+ height: 628,
71
+ width: 1200,
72
+ },
73
+ cliId: 'still',
74
+ },
75
+ {
76
+ homePageLabel: 'TTS',
77
+ shortName: 'Text To Speech',
78
+ org: 'FelippeChemello',
79
+ repoName: 'Remotion-TTS-Example',
80
+ description: 'Turns text into speech and makes a video',
81
+ longerDescription: 'A template that turns text into a spoken video. Integrates with Azure Cloud for Speech synthesis.',
82
+ promoVideo: {
83
+ muxId: '8vJJ01lNuFmQCx7n59VILevqQGxRuQHp9a7VBR7B4C8k',
84
+ width: 1920,
85
+ height: 1080,
86
+ },
87
+ cliId: 'tts',
88
+ },
89
+ {
90
+ homePageLabel: 'Audiogram',
91
+ shortName: 'Audiogram',
92
+ org: 'marcusstenbeck',
93
+ repoName: 'remotion-template-audiogram',
94
+ description: 'Text and waveform visualization for podcasts',
95
+ longerDescription: 'A template that turns podcast snippets into videos that can be posted on Social Media.',
96
+ promoVideo: {
97
+ muxId: 'nqGuji1CJuoPoU3iprRRhiy3HXiQN0201HLyliOg44HOU',
98
+ height: 1080,
99
+ width: 1080,
100
+ },
101
+ cliId: 'audiogram',
102
+ },
103
+ ];
@@ -1,2 +1 @@
1
1
  export declare function validateName(name?: string): string | true;
2
- //# sourceMappingURL=validate-name.d.ts.map
@@ -11,4 +11,3 @@ function validateName(name) {
11
11
  return true;
12
12
  }
13
13
  exports.validateName = validateName;
14
- //# sourceMappingURL=validate-name.js.map
package/dist/yesno.d.ts CHANGED
@@ -2,4 +2,3 @@ export declare const yesOrNo: ({ question, defaultValue, }: {
2
2
  question: string;
3
3
  defaultValue: boolean;
4
4
  }) => Promise<boolean>;
5
- //# sourceMappingURL=yesno.d.ts.map
package/dist/yesno.js CHANGED
@@ -43,4 +43,3 @@ const yesOrNo = ({ question, defaultValue, }) => {
43
43
  });
44
44
  };
45
45
  exports.yesOrNo = yesOrNo;
46
- //# sourceMappingURL=yesno.js.map
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "create-video",
3
- "version": "3.0.4",
3
+ "version": "3.0.7",
4
4
  "description": "",
5
- "main": "index.js",
5
+ "main": "dist/index.js",
6
6
  "bin": {
7
7
  "create-video": "bin.js"
8
8
  },
@@ -20,12 +20,14 @@
20
20
  "dependencies": {
21
21
  "chalk": "4.1.2",
22
22
  "execa": "5.1.1",
23
+ "minimist": "1.2.6",
23
24
  "prompts": "2.4.1",
24
25
  "tar": "6.1.11"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@jonny/eslint-config": "3.0.259",
28
29
  "@types/degit": "^2.8.3",
30
+ "@types/minimist": "1.2.2",
29
31
  "@types/node": "^16.7.5",
30
32
  "@types/prompts": "^2.0.12",
31
33
  "@types/tar": "6.1.1",
@@ -35,5 +37,5 @@
35
37
  "ts-node": "^9.1.1",
36
38
  "typescript": "^4.5.5"
37
39
  },
38
- "gitHead": "fe6cd08c090ed8aa6c2a1b610851c0ab97749a2c"
40
+ "gitHead": "e44469b9a64608db9bec219339bf93a0ac6e9655"
39
41
  }
package/index.js DELETED
@@ -1,5 +0,0 @@
1
- export default () => {
2
- throw new Error(
3
- 'create-video is a CLI tool only. Run `yarn create video` or `npm init video` instead!'
4
- );
5
- };