create-video 4.0.183 → 4.0.185

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.
@@ -0,0 +1 @@
1
+ export declare function supportsHyperlink(): false | string;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ // From https://github.com/jamestalmage/supports-hyperlinks/blob/master/index.js
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.supportsHyperlink = void 0;
5
+ // MIT License
6
+ // Copyright (c) James Talmage <james@talmage.io> (github.com/jamestalmage)
7
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+ function parseVersion(versionString) {
11
+ if (/^\d{3,4}$/.test(versionString)) {
12
+ // Env var doesn't always use dots. example: 4601 => 46.1.0
13
+ const m = /(\d{1,2})(\d{2})/.exec(versionString) || [];
14
+ return {
15
+ major: 0,
16
+ minor: parseInt(m[1], 10),
17
+ patch: parseInt(m[2], 10),
18
+ };
19
+ }
20
+ const versions = (versionString || '').split('.').map((n) => parseInt(n, 10));
21
+ return {
22
+ major: versions[0],
23
+ minor: versions[1],
24
+ patch: versions[2],
25
+ };
26
+ }
27
+ function supportsHyperlink() {
28
+ const { CI, NETLIFY, TEAMCITY_VERSION, TERM_PROGRAM, TERM_PROGRAM_VERSION, VTE_VERSION, } = process.env;
29
+ // Netlify does not run a TTY, it does not need `supportsColor` check
30
+ if (NETLIFY) {
31
+ return 'Click';
32
+ }
33
+ if (process.platform === 'win32') {
34
+ return false;
35
+ }
36
+ if (CI) {
37
+ return false;
38
+ }
39
+ if (TEAMCITY_VERSION) {
40
+ return false;
41
+ }
42
+ if (TERM_PROGRAM) {
43
+ const version = parseVersion(TERM_PROGRAM_VERSION || '');
44
+ switch (TERM_PROGRAM) {
45
+ case 'iTerm.app':
46
+ if (version.major === 3) {
47
+ return version.minor >= 1 ? 'Cmd+Click' : false;
48
+ }
49
+ return version.major > 3 ? 'Cmd+Click' : false;
50
+ case 'WezTerm':
51
+ return version.major >= 20200620 ? 'Click' : false;
52
+ case 'vscode':
53
+ // eslint-disable-next-line no-mixed-operators
54
+ return version.major > 1 ||
55
+ (version.major === 1 && version.minor >= 72)
56
+ ? process.platform === 'darwin'
57
+ ? 'Option+Click'
58
+ : 'Ctrl+Click'
59
+ : false;
60
+ // No default
61
+ }
62
+ }
63
+ if (VTE_VERSION) {
64
+ // 0.50.0 was supposed to support hyperlinks, but throws a segfault
65
+ if (VTE_VERSION === '0.50.0') {
66
+ return false;
67
+ }
68
+ const version = parseVersion(VTE_VERSION);
69
+ return version.major > 0 || version.minor >= 50
70
+ ? 'Click'
71
+ : false;
72
+ }
73
+ return false;
74
+ }
75
+ exports.supportsHyperlink = supportsHyperlink;
@@ -0,0 +1,5 @@
1
+ export declare const makeHyperlink: ({ text, url, fallback, }: {
2
+ text: string | ((clickInstruction: string) => string);
3
+ url: string;
4
+ fallback: string;
5
+ }) => string;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeHyperlink = void 0;
4
+ const is_supported_1 = require("./is-supported");
5
+ const OSC = '\u001B]';
6
+ const SEP = ';';
7
+ const BEL = '\u0007';
8
+ const makeHyperlink = ({ text, url, fallback, }) => {
9
+ const supports = (0, is_supported_1.supportsHyperlink)();
10
+ if (!supports) {
11
+ return fallback;
12
+ }
13
+ const label = typeof text === 'function' ? text(supports) : text;
14
+ return [OSC, '8', SEP, SEP, url, BEL, label, OSC, '8', SEP, SEP, BEL].join('');
15
+ };
16
+ exports.makeHyperlink = makeHyperlink;
package/dist/init.js CHANGED
@@ -1,3 +1,4 @@
1
+ #! /usr/bin/env node
1
2
  "use strict";
2
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -29,6 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.selectTemplate = void 0;
30
30
  const chalk_1 = __importDefault(require("chalk"));
31
31
  const minimist_1 = __importDefault(require("minimist"));
32
+ const make_link_1 = require("./hyperlinks/make-link");
32
33
  const prompts_1 = __importStar(require("./prompts"));
33
34
  const strip_ansi_1 = require("./strip-ansi");
34
35
  const templates_1 = require("./templates");
@@ -57,8 +58,11 @@ const selectTemplate = async () => {
57
58
  }
58
59
  return {
59
60
  value: template,
60
- title: chalk_1.default.bold(padEnd(template.shortName, descriptionColumn)) +
61
- template.description.trim(),
61
+ title: chalk_1.default.bold(padEnd((0, make_link_1.makeHyperlink)({
62
+ text: template.shortName,
63
+ url: `https://remotion.dev/templates/${template.cliId}`,
64
+ fallback: template.shortName,
65
+ }), descriptionColumn)) + template.description.trim(),
62
66
  };
63
67
  }),
64
68
  }, {}));
@@ -21,7 +21,7 @@ export type Template = {
21
21
  repoName: string;
22
22
  homePageLabel: string;
23
23
  longerDescription: React.ReactNode;
24
- cliId: 'hello-world' | 'javascript' | 'blank' | 'next' | 'next-tailwind' | 'next-pages-dir' | 'remix' | 'three' | 'still' | 'tts' | 'google-tts' | 'audiogram' | 'skia' | 'tailwind' | 'overlay' | 'stargazer' | 'tiktok';
24
+ cliId: 'hello-world' | 'javascript' | 'blank' | 'next' | 'next-tailwind' | 'next-pages-dir' | 'remix' | 'three' | 'still' | 'tts' | 'google-tts' | 'audiogram' | 'skia' | 'tailwind' | 'overlay' | 'stargazer' | 'tiktok' | 'code-hike';
25
25
  defaultBranch: string;
26
26
  featuredOnHomePage: string | null;
27
27
  previewURL?: string | null;
package/dist/templates.js CHANGED
@@ -268,6 +268,24 @@ exports.FEATURED_TEMPLATES = [
268
268
  defaultBranch: 'main',
269
269
  featuredOnHomePage: null,
270
270
  },
271
+ {
272
+ homePageLabel: 'Code Hike',
273
+ shortName: 'Code Hike',
274
+ org: 'remotion-dev',
275
+ repoName: 'template-code-hike',
276
+ description: 'Beautiful code animations',
277
+ longerDescription: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Add code snippets and animate between them using", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://codehike.org/", children: "Code Hike" }), ". Supports many languages, TypeScript error annotations, and many themes."] })),
278
+ promoVideo: {
279
+ muxId: 'fKwnpTAOqvnZpu00fwEezi00cpF3927NumGcS1gGdUj8A',
280
+ width: 1080,
281
+ height: 1080,
282
+ },
283
+ cliId: 'code-hike',
284
+ type: 'video',
285
+ defaultBranch: 'main',
286
+ featuredOnHomePage: null,
287
+ previewURL: 'https://template-code-hike.vercel.app/',
288
+ },
271
289
  {
272
290
  homePageLabel: 'Stargazer',
273
291
  shortName: 'Stargazer',
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.183",
6
+ "version": "4.0.185",
7
7
  "description": "Create a new Remotion project",
8
8
  "main": "dist/index.js",
9
9
  "bin": {