create-video 3.3.80 → 3.3.82

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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const checkGitAvailability: (cwd: string, command: string) => Promise<{
1
+ export declare const checkGitAvailability: (cwd: string, commandToCheck: string, argsToCheck: string[]) => Promise<{
2
2
  type: 'no-git-repo';
3
3
  } | {
4
4
  type: 'is-git-repo';
package/dist/init.js CHANGED
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.init = exports.checkGitAvailability = void 0;
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
8
  const execa_1 = __importDefault(require("execa"));
9
- const os_1 = __importDefault(require("os"));
10
9
  const add_yarn2_support_1 = require("./add-yarn2-support");
11
10
  const degit_1 = require("./degit");
12
11
  const latest_remotion_version_1 = require("./latest-remotion-version");
@@ -18,23 +17,21 @@ const pkg_managers_1 = require("./pkg-managers");
18
17
  const resolve_project_root_1 = require("./resolve-project-root");
19
18
  const select_template_1 = require("./select-template");
20
19
  const yesno_1 = require("./yesno");
21
- const binaryExists = (name) => {
22
- const isWin = os_1.default.platform() === 'win32';
23
- const where = isWin ? 'where' : 'which';
20
+ const gitExists = (commandToCheck, argsToCheck) => {
24
21
  try {
25
- execa_1.default.sync(where, [name]);
22
+ execa_1.default.sync(commandToCheck, argsToCheck);
26
23
  return true;
27
24
  }
28
25
  catch (err) {
29
26
  return false;
30
27
  }
31
28
  };
32
- const checkGitAvailability = async (cwd, command) => {
33
- if (!binaryExists(command)) {
29
+ const checkGitAvailability = async (cwd, commandToCheck, argsToCheck) => {
30
+ if (!gitExists(commandToCheck, argsToCheck)) {
34
31
  return { type: 'git-not-installed' };
35
32
  }
36
33
  try {
37
- const result = await (0, execa_1.default)(command, ['rev-parse', '--show-toplevel'], {
34
+ const result = await (0, execa_1.default)('git', ['rev-parse', '--show-toplevel'], {
38
35
  cwd,
39
36
  });
40
37
  return { type: 'is-git-repo', location: result.stdout };
@@ -68,7 +65,9 @@ const getGitStatus = async (root) => {
68
65
  };
69
66
  const init = async () => {
70
67
  var _a, _b, _c, _d, _e, _f;
71
- const result = await (0, exports.checkGitAvailability)(process.cwd(), 'git');
68
+ const result = await (0, exports.checkGitAvailability)(process.cwd(), 'git', [
69
+ '--version',
70
+ ]);
72
71
  if (result.type === 'git-not-installed') {
73
72
  log_1.Log.error('Git is not installed or not in the path. Install Git to continue.');
74
73
  process.exit(1);
@@ -7,7 +7,9 @@ const path_1 = __importDefault(require("path"));
7
7
  const vitest_1 = require("vitest");
8
8
  const init_1 = require("../init");
9
9
  (0, vitest_1.test)('Get git status', async () => {
10
- const status = await (0, init_1.checkGitAvailability)(process.cwd(), 'git');
10
+ const status = await (0, init_1.checkGitAvailability)(process.cwd(), 'git', [
11
+ '--version',
12
+ ]);
11
13
  (0, vitest_1.expect)(status).toEqual({
12
14
  type: 'is-git-repo',
13
15
  location: path_1.default.posix
@@ -17,8 +19,8 @@ const init_1 = require("../init");
17
19
  if (status.type !== 'is-git-repo') {
18
20
  throw new Error('is git repo');
19
21
  }
20
- const status2 = await (0, init_1.checkGitAvailability)(path_1.default.dirname(status.location), 'git');
22
+ const status2 = await (0, init_1.checkGitAvailability)(path_1.default.dirname(status.location), 'git', ['--version']);
21
23
  (0, vitest_1.expect)(status2).toEqual({ type: 'no-git-repo' });
22
- const status3 = await (0, init_1.checkGitAvailability)(path_1.default.dirname(status.location), 'wronggitbinary');
24
+ const status3 = await (0, init_1.checkGitAvailability)(path_1.default.dirname(status.location), 'wronggitbinary', ['--version']);
23
25
  (0, vitest_1.expect)(status3).toEqual({ type: 'git-not-installed' });
24
26
  });
@@ -103,6 +103,16 @@ const getFileForTemplate = (template, file) => {
103
103
  (0, vitest_1.expect)(contents).not.toContain('Config.Output');
104
104
  (0, vitest_1.expect)(contents).not.toContain('Config.Preview');
105
105
  }, 12000);
106
+ (0, vitest_1.it)(template.shortName + ' should use noUnusedLocals', async () => {
107
+ if (template.shortName.includes('JavaScript')) {
108
+ return;
109
+ }
110
+ const { contents } = await findFile([
111
+ getFileForTemplate(template, 'tsconfig.json'),
112
+ ]);
113
+ const json = JSON.parse(contents);
114
+ (0, vitest_1.expect)(json.compilerOptions.noUnusedLocals).toBe(true);
115
+ }, 12000);
106
116
  }
107
117
  });
108
118
  const findFile = async (options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-video",
3
- "version": "3.3.80",
3
+ "version": "3.3.82",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "bin": {