create-video 3.0.5 → 3.0.6

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.
Files changed (2) hide show
  1. package/dist/init.js +3 -86
  2. package/package.json +2 -2
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', [], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-video",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -37,5 +37,5 @@
37
37
  "ts-node": "^9.1.1",
38
38
  "typescript": "^4.5.5"
39
39
  },
40
- "gitHead": "9e3767ddb637f32a83577e2284ae3661f87763ae"
40
+ "gitHead": "507118b6edd67a8e749a81ae19237a55682cd378"
41
41
  }