create-video 3.0.0-lambda.404 → 3.0.0-lambda.414

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 (68) hide show
  1. package/LICENSE.md +2 -2
  2. package/dist/copy-template.js +2 -2
  3. package/dist/copy-template.js.map +1 -1
  4. package/dist/degit/degit.d.ts +3 -0
  5. package/dist/degit/degit.d.ts.map +1 -0
  6. package/dist/degit/degit.js +71 -0
  7. package/dist/degit/degit.js.map +1 -0
  8. package/dist/degit/index.d.ts +3 -0
  9. package/dist/degit/index.d.ts.map +1 -0
  10. package/dist/degit/index.js +71 -0
  11. package/dist/degit/index.js.map +1 -0
  12. package/dist/degit/utils.d.ts +1 -0
  13. package/dist/degit/utils.d.ts.map +1 -0
  14. package/dist/degit/utils.js +2 -0
  15. package/dist/degit/utils.js.map +1 -0
  16. package/dist/degit.d.ts +7 -0
  17. package/dist/degit.d.ts.map +1 -0
  18. package/dist/degit.js +56 -0
  19. package/dist/degit.js.map +1 -0
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/index.js +2 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/init.d.ts.map +1 -1
  25. package/dist/init.js +50 -136
  26. package/dist/init.js.map +1 -1
  27. package/dist/log.d.ts +1 -1
  28. package/dist/mkdirp.d.ts +2 -0
  29. package/dist/mkdirp.d.ts.map +1 -0
  30. package/dist/mkdirp.js +23 -0
  31. package/dist/mkdirp.js.map +1 -0
  32. package/dist/open-in-editor-flow.js +2 -2
  33. package/dist/open-in-editor-flow.js.map +1 -1
  34. package/dist/open-in-editor.d.ts +1 -1
  35. package/dist/open-in-editor.d.ts.map +1 -1
  36. package/dist/open-in-editor.js +1 -1
  37. package/dist/open-in-editor.js.map +1 -1
  38. package/dist/patch-package-json.d.ts +2 -0
  39. package/dist/patch-package-json.d.ts.map +1 -0
  40. package/dist/patch-package-json.js +20 -0
  41. package/dist/patch-package-json.js.map +1 -0
  42. package/dist/patch-readme.d.ts +3 -0
  43. package/dist/patch-readme.d.ts.map +1 -0
  44. package/dist/patch-readme.js +34 -0
  45. package/dist/patch-readme.js.map +1 -0
  46. package/dist/pkg-managers.d.ts +3 -2
  47. package/dist/pkg-managers.d.ts.map +1 -1
  48. package/dist/pkg-managers.js +25 -1
  49. package/dist/pkg-managers.js.map +1 -1
  50. package/dist/resolve-project-root.d.ts +2 -0
  51. package/dist/resolve-project-root.d.ts.map +1 -0
  52. package/dist/resolve-project-root.js +69 -0
  53. package/dist/resolve-project-root.js.map +1 -0
  54. package/dist/strip-ansi.d.ts +2 -0
  55. package/dist/strip-ansi.d.ts.map +1 -0
  56. package/dist/strip-ansi.js +22 -0
  57. package/dist/strip-ansi.js.map +1 -0
  58. package/dist/validate-name.d.ts +2 -0
  59. package/dist/validate-name.d.ts.map +1 -0
  60. package/dist/validate-name.js +14 -0
  61. package/dist/validate-name.js.map +1 -0
  62. package/dist/yesno.js +1 -1
  63. package/dist/yesno.js.map +1 -1
  64. package/package.json +4 -6
  65. package/dist/script.d.ts +0 -1
  66. package/dist/script.d.ts.map +0 -1
  67. package/dist/script.js +0 -4
  68. package/dist/script.js.map +0 -1
package/LICENSE.md CHANGED
@@ -7,7 +7,7 @@ Depending on the type of your legal entity, you are granted permission to use Re
7
7
 
8
8
  ## Free license
9
9
 
10
- Copyright © 2021 [Jonny Burger](https://jonny.io)
10
+ Copyright © 2022 [Jonny Burger](https://jonny.io)
11
11
 
12
12
  ### Eligibility
13
13
 
@@ -32,7 +32,7 @@ The software is provided "as is", without warranty of any kind, express or impli
32
32
 
33
33
  ### Support
34
34
 
35
- Support is provided on a best-we-can-do basis via GitHub Issues.
35
+ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
36
36
 
37
37
  ## Company license
38
38
 
@@ -3,15 +3,15 @@ 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
- const path_1 = __importDefault(require("path"));
7
6
  const execa_1 = __importDefault(require("execa"));
7
+ const path_1 = __importDefault(require("path"));
8
8
  const xns_1 = __importDefault(require("xns"));
9
9
  const dotfiles_1 = require("./dotfiles");
10
10
  (0, xns_1.default)(async () => {
11
11
  await (0, execa_1.default)('rm', ['-rf', dotfiles_1.templateFolderName]);
12
12
  await (0, execa_1.default)('git', [
13
13
  'clone',
14
- 'https://github.com/jonnyburger/remotion-template',
14
+ 'https://github.com/remotion-dev/template',
15
15
  dotfiles_1.templateFolderName,
16
16
  ]);
17
17
  await (0, execa_1.default)('rm', ['-r', path_1.default.join(dotfiles_1.templateFolderName, '.git')]);
@@ -1 +1 @@
1
- {"version":3,"file":"copy-template.js","sourceRoot":"","sources":["../src/copy-template.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,8CAAsB;AACtB,yCAAkE;AAElE,IAAA,aAAG,EAAC,KAAK,IAAI,EAAE;IACd,MAAM,IAAA,eAAK,EAAC,IAAI,EAAE,CAAC,KAAK,EAAE,6BAAkB,CAAC,CAAC,CAAC;IAC/C,MAAM,IAAA,eAAK,EAAC,KAAK,EAAE;QAClB,OAAO;QACP,kDAAkD;QAClD,6BAAkB;KAClB,CAAC,CAAC;IACH,MAAM,IAAA,eAAK,EAAC,IAAI,EAAE,CAAC,IAAI,EAAE,cAAI,CAAC,IAAI,CAAC,6BAAkB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,MAAM,IAAA,6BAAkB,EAAC,6BAAkB,CAAC,CAAC;IAC7C,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"copy-template.js","sourceRoot":"","sources":["../src/copy-template.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,8CAAsB;AACtB,yCAAkE;AAElE,IAAA,aAAG,EAAC,KAAK,IAAI,EAAE;IACd,MAAM,IAAA,eAAK,EAAC,IAAI,EAAE,CAAC,KAAK,EAAE,6BAAkB,CAAC,CAAC,CAAC;IAC/C,MAAM,IAAA,eAAK,EAAC,KAAK,EAAE;QAClB,OAAO;QACP,0CAA0C;QAC1C,6BAAkB;KAClB,CAAC,CAAC;IACH,MAAM,IAAA,eAAK,EAAC,IAAI,EAAE,CAAC,IAAI,EAAE,cAAI,CAAC,IAAI,CAAC,6BAAkB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,MAAM,IAAA,6BAAkB,EAAC,6BAAkB,CAAC,CAAC;IAC7C,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function fetch(url: string, dest: string): Promise<void>;
2
+ export declare const degit: (repoOrg: string, repoName: string, src: string, dest: string) => Promise<void>;
3
+ //# sourceMappingURL=degit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"degit.d.ts","sourceRoot":"","sources":["../../src/degit/degit.ts"],"names":[],"mappings":"AAUA,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAwB9C;AAID,eAAO,MAAM,KAAK,YACR,MAAM,YACL,MAAM,OACX,MAAM,QACL,MAAM,kBAKZ,CAAC"}
@@ -0,0 +1,71 @@
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.degit = exports.fetch = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const tar_1 = __importDefault(require("tar"));
10
+ const log_1 = require("../log");
11
+ const https_1 = __importDefault(require("https"));
12
+ const os_1 = require("os");
13
+ const homeOrTemp = (0, os_1.homedir)() || (0, os_1.tmpdir)();
14
+ function fetch(url, dest) {
15
+ return new Promise((resolve, reject) => {
16
+ https_1.default
17
+ .get(url, (response) => {
18
+ const code = response.statusCode;
19
+ if (code >= 400) {
20
+ reject(new Error(`Network request to ${url} failed with code ${code} (${response.statusMessage})`));
21
+ }
22
+ else if (code >= 300) {
23
+ fetch(response.headers.location, dest)
24
+ .then(resolve)
25
+ .catch(reject);
26
+ }
27
+ else {
28
+ response
29
+ .pipe(fs_1.default.createWriteStream(dest))
30
+ .on('finish', () => resolve())
31
+ .on('error', reject);
32
+ }
33
+ })
34
+ .on('error', reject);
35
+ });
36
+ }
37
+ exports.fetch = fetch;
38
+ const base = path_1.default.join(homeOrTemp, '.degit');
39
+ const degit = async (repoOrg, repoName, src, dest) => {
40
+ const dir = path_1.default.join(base, repoOrg, repoName);
41
+ await cloneWithTar(src, dir, dest);
42
+ };
43
+ exports.degit = degit;
44
+ async function cloneWithTar(src, dir, dest) {
45
+ const file = `${dir}/HEAD.tar.gz`;
46
+ const url = `${src}/archive/HEAD.tar.gz`;
47
+ try {
48
+ try {
49
+ fs_1.default.statSync(file);
50
+ }
51
+ catch (err) {
52
+ mkdirp(path_1.default.dirname(file));
53
+ await fetch(url, file);
54
+ }
55
+ }
56
+ catch (err) {
57
+ log_1.Log.error('Could not download ' + url);
58
+ log_1.Log.error(err);
59
+ process.exit(1);
60
+ }
61
+ mkdirp(dest);
62
+ await untar(file, dest);
63
+ }
64
+ function untar(file, dest) {
65
+ return tar_1.default.extract({
66
+ file,
67
+ strip: 1,
68
+ C: dest,
69
+ }, []);
70
+ }
71
+ //# sourceMappingURL=degit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"degit.js","sourceRoot":"","sources":["../../src/degit/degit.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,8CAAsB;AACtB,gCAA2B;AAE3B,kDAA0B;AAC1B,2BAAmC;AAEnC,MAAM,UAAU,GAAG,IAAA,YAAO,GAAE,IAAI,IAAA,WAAM,GAAE,CAAC;AAEzC,SAAgB,KAAK,CAAC,GAAW,EAAE,IAAY;IAC9C,OAAO,IA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AAE,GAAW,EAAE,IAAY;IACjE,MAAM,IAAI,GAAG,GAAG,GAAG,cAAc,CAAC;IAClC,MAAM,GAAG,GAAG,GAAG,GAAG,sBAAsB,CAAC;IAEzC,IAAI;QACH,IAAI;YACH,YAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SAClB;QAAC,OAAO,GAAG,EAAE;YACb,MAAM,CAAC,cAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YAE3B,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SACvB;KACD;IAAC,OAAO,GAAG,EAAE;QACb,SAAG,CAAC,KAAK,CAAC,qBAAqB,GAAG,GAAG,CAAC,CAAC;QACvC,SAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KAChB;IAED,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,MAAM,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,KAAK,CAAC,IAAY,EAAE,IAAY;IACxC,OAAO,aAAG,CAAC,OAAO,CACjB;QACC,IAAI;QACJ,KAAK,EAAE,CAAC;QACR,CAAC,EAAE,IAAI;KACP,EACD,EAAE,CACF,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function fetch(url: string, dest: string): Promise<void>;
2
+ export declare const degit: (repoOrg: string, repoName: string, src: string, dest: string) => Promise<void>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/degit/index.ts"],"names":[],"mappings":"AAUA,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAwB9C;AAID,eAAO,MAAM,KAAK,YACR,MAAM,YACL,MAAM,OACX,MAAM,QACL,MAAM,kBAKZ,CAAC"}
@@ -0,0 +1,71 @@
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.degit = exports.fetch = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const tar_1 = __importDefault(require("tar"));
10
+ const log_1 = require("../log");
11
+ const https_1 = __importDefault(require("https"));
12
+ const os_1 = require("os");
13
+ const homeOrTemp = (0, os_1.homedir)() || (0, os_1.tmpdir)();
14
+ function fetch(url, dest) {
15
+ return new Promise((resolve, reject) => {
16
+ https_1.default
17
+ .get(url, (response) => {
18
+ const code = response.statusCode;
19
+ if (code >= 400) {
20
+ reject(new Error(`Network request to ${url} failed with code ${code} (${response.statusMessage})`));
21
+ }
22
+ else if (code >= 300) {
23
+ fetch(response.headers.location, dest)
24
+ .then(resolve)
25
+ .catch(reject);
26
+ }
27
+ else {
28
+ response
29
+ .pipe(fs_1.default.createWriteStream(dest))
30
+ .on('finish', () => resolve())
31
+ .on('error', reject);
32
+ }
33
+ })
34
+ .on('error', reject);
35
+ });
36
+ }
37
+ exports.fetch = fetch;
38
+ const base = path_1.default.join(homeOrTemp, '.degit');
39
+ const degit = async (repoOrg, repoName, src, dest) => {
40
+ const dir = path_1.default.join(base, repoOrg, repoName);
41
+ await cloneWithTar(src, dir, dest);
42
+ };
43
+ exports.degit = degit;
44
+ async function cloneWithTar(src, dir, dest) {
45
+ const file = `${dir}/HEAD.tar.gz`;
46
+ const url = `${src}/archive/HEAD.tar.gz`;
47
+ try {
48
+ try {
49
+ fs_1.default.statSync(file);
50
+ }
51
+ catch (err) {
52
+ mkdirp(path_1.default.dirname(file));
53
+ await fetch(url, file);
54
+ }
55
+ }
56
+ catch (err) {
57
+ log_1.Log.error('Could not download ' + url);
58
+ log_1.Log.error(err);
59
+ process.exit(1);
60
+ }
61
+ mkdirp(dest);
62
+ await untar(file, dest);
63
+ }
64
+ function untar(file, dest) {
65
+ return tar_1.default.extract({
66
+ file,
67
+ strip: 1,
68
+ C: dest,
69
+ }, []);
70
+ }
71
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/degit/index.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,8CAAsB;AACtB,gCAA2B;AAE3B,kDAA0B;AAC1B,2BAAmC;AAEnC,MAAM,UAAU,GAAG,IAAA,YAAO,GAAE,IAAI,IAAA,WAAM,GAAE,CAAC;AAEzC,SAAgB,KAAK,CAAC,GAAW,EAAE,IAAY;IAC9C,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC5C,eAAK;aACH,GAAG,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE;YACtB,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAoB,CAAC;YAC3C,IAAI,IAAI,IAAI,GAAG,EAAE;gBAChB,MAAM,CACL,IAAI,KAAK,CACR,sBAAsB,GAAG,qBAAqB,IAAI,KAAK,QAAQ,CAAC,aAAa,GAAG,CAChF,CACD,CAAC;aACF;iBAAM,IAAI,IAAI,IAAI,GAAG,EAAE;gBACvB,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAkB,EAAE,IAAI,CAAC;qBAC9C,IAAI,CAAC,OAAO,CAAC;qBACb,KAAK,CAAC,MAAM,CAAC,CAAC;aAChB;iBAAM;gBACN,QAAQ;qBACN,IAAI,CAAC,YAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;qBAChC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;qBAC7B,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;aACtB;QACF,CAAC,CAAC;aACD,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACJ,CAAC;AAxBD,sBA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 +1 @@
1
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/degit/utils.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/degit/utils.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export declare function fetch(url: string, dest: string): Promise<void>;
2
+ export declare const degit: ({ repoOrg, repoName, dest, }: {
3
+ repoOrg: string;
4
+ repoName: string;
5
+ dest: string;
6
+ }) => Promise<void>;
7
+ //# sourceMappingURL=degit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"degit.d.ts","sourceRoot":"","sources":["../src/degit.ts"],"names":[],"mappings":"AAQA,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAwB9C;AAED,eAAO,MAAM,KAAK;aAKR,MAAM;cACL,MAAM;UACV,MAAM;mBAaZ,CAAC"}
package/dist/degit.js ADDED
@@ -0,0 +1,56 @@
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.degit = exports.fetch = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const tar_1 = __importDefault(require("tar"));
10
+ const https_1 = __importDefault(require("https"));
11
+ const os_1 = require("os");
12
+ const mkdirp_1 = require("./mkdirp");
13
+ function fetch(url, dest) {
14
+ return new Promise((resolve, reject) => {
15
+ https_1.default
16
+ .get(url, (response) => {
17
+ const code = response.statusCode;
18
+ if (code >= 400) {
19
+ reject(new Error(`Network request to ${url} failed with code ${code} (${response.statusMessage})`));
20
+ }
21
+ else if (code >= 300) {
22
+ fetch(response.headers.location, dest)
23
+ .then(resolve)
24
+ .catch(reject);
25
+ }
26
+ else {
27
+ response
28
+ .pipe(fs_1.default.createWriteStream(dest))
29
+ .on('finish', () => resolve())
30
+ .on('error', reject);
31
+ }
32
+ })
33
+ .on('error', reject);
34
+ });
35
+ }
36
+ exports.fetch = fetch;
37
+ const degit = async ({ repoOrg, repoName, dest, }) => {
38
+ const base = path_1.default.join((0, os_1.tmpdir)(), '.degit');
39
+ const dir = path_1.default.join(base, repoOrg, repoName);
40
+ const file = `${dir}/HEAD.tar.gz`;
41
+ const url = `https://github.com/${repoOrg}/${repoName}/archive/HEAD.tar.gz`;
42
+ (0, mkdirp_1.mkdirp)(path_1.default.dirname(file));
43
+ await fetch(url, file);
44
+ (0, mkdirp_1.mkdirp)(dest);
45
+ await untar(file, dest);
46
+ fs_1.default.unlinkSync(file);
47
+ };
48
+ exports.degit = degit;
49
+ function untar(file, dest) {
50
+ return tar_1.default.extract({
51
+ file,
52
+ strip: 1,
53
+ C: dest,
54
+ }, []);
55
+ }
56
+ //# sourceMappingURL=degit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"degit.js","sourceRoot":"","sources":["../src/degit.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,8CAAsB;AAEtB,kDAA0B;AAC1B,2BAA0B;AAC1B,qCAAgC;AAEhC,SAAgB,KAAK,CAAC,GAAW,EAAE,IAAY;IAC9C,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC5C,eAAK;aACH,GAAG,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE;YACtB,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAoB,CAAC;YAC3C,IAAI,IAAI,IAAI,GAAG,EAAE;gBAChB,MAAM,CACL,IAAI,KAAK,CACR,sBAAsB,GAAG,qBAAqB,IAAI,KAAK,QAAQ,CAAC,aAAa,GAAG,CAChF,CACD,CAAC;aACF;iBAAM,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AAY,EAAE,IAAY;IACxC,OAAO,aAAG,CAAC,OAAO,CACjB;QACC,IAAI;QACJ,KAAK,EAAE,CAAC;QACR,CAAC,EAAE,IAAI;KACP,EACD,EAAE,CACF,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAkNA,eAAO,MAAM,IAAI,qBAyHhB,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AA0GA,eAAO,MAAM,IAAI,qBA0GhB,CAAC"}
package/dist/init.js CHANGED
@@ -24,86 +24,65 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.init = void 0;
26
26
  const chalk_1 = __importDefault(require("chalk"));
27
- const degit_1 = __importDefault(require("degit"));
28
27
  const execa_1 = __importDefault(require("execa"));
29
- const fs_extra_1 = __importDefault(require("fs-extra"));
30
- const path_1 = __importDefault(require("path"));
31
- const strip_ansi_1 = __importDefault(require("strip-ansi"));
28
+ const strip_ansi_1 = require("./strip-ansi");
32
29
  const log_1 = require("./log");
33
30
  const open_in_editor_flow_1 = require("./open-in-editor-flow");
34
31
  const pkg_managers_1 = require("./pkg-managers");
35
32
  const prompts_1 = __importStar(require("./prompts"));
36
- const os_1 = require("os");
33
+ const resolve_project_root_1 = require("./resolve-project-root");
34
+ const patch_readme_1 = require("./patch-readme");
35
+ const patch_package_json_1 = require("./patch-package-json");
36
+ const degit_1 = require("./degit");
37
37
  const FEATURED_TEMPLATES = [
38
38
  {
39
39
  shortName: 'Hello World',
40
- name: 'remotion-dev/template-helloworld',
40
+ org: 'remotion-dev',
41
+ repoName: 'template-helloworld',
41
42
  description: 'The default starter template (recommended)',
42
43
  },
43
44
  {
44
45
  shortName: 'Blank',
45
- name: 'remotion-dev/template-empty',
46
46
  description: 'Nothing except an empty canvas',
47
+ org: 'remotion-dev',
48
+ repoName: 'template-empty',
47
49
  },
48
50
  {
49
51
  shortName: 'Hello World (Javascript)',
50
- name: 'remotion-dev/template-helloworld-javascript',
52
+ org: 'remotion-dev',
53
+ repoName: 'template-helloworld-javascript',
51
54
  description: 'The default starter template in plain JS',
52
55
  },
53
56
  {
54
57
  shortName: 'React Three Fiber',
55
- name: 'remotion-dev/template-three',
58
+ org: 'remotion-dev',
59
+ repoName: 'template-three',
56
60
  description: 'Remotion + React Three Fiber Starter Template',
57
61
  },
58
62
  {
59
63
  shortName: 'Still images',
60
- name: 'remotion-dev/template-still',
64
+ org: 'remotion-dev',
65
+ repoName: 'template-still',
61
66
  description: 'Dynamic PNG/JPEG template with built-in server',
62
67
  },
63
68
  {
64
69
  shortName: 'Text To Speech',
65
- name: 'FelippeChemello/Remotion-TTS-Example',
70
+ org: 'FelippeChemello',
71
+ repoName: 'Remotion-TTS-Example',
66
72
  description: 'Turns text into speech and makes a video',
67
73
  },
68
74
  {
69
75
  shortName: 'Audiogram',
70
- name: 'marcusstenbeck/remotion-template-audiogram',
76
+ org: 'marcusstenbeck',
77
+ repoName: 'remotion-template-audiogram',
71
78
  description: 'Text and waveform visualization for podcasts',
72
79
  },
73
80
  ];
74
81
  function padEnd(str, width) {
75
82
  // Pulled from commander for overriding
76
- const len = Math.max(0, width - (0, strip_ansi_1.default)(str).length);
83
+ const len = Math.max(0, width - (0, strip_ansi_1.stripAnsi)(str).length);
77
84
  return str + Array(len + 1).join(' ');
78
85
  }
79
- function validateName(name) {
80
- if (typeof name !== 'string' || name === '') {
81
- return 'The project name can not be empty.';
82
- }
83
- if (!/^[a-z0-9@.\-_]+$/i.test(name)) {
84
- return 'The project name can only contain URL-friendly characters (alphanumeric and @ . - _)';
85
- }
86
- return true;
87
- }
88
- function assertValidName(folderName) {
89
- const validation = validateName(folderName);
90
- if (typeof validation === 'string') {
91
- throw new Error(`Cannot create an app named ${chalk_1.default.red(`"${folderName}"`)}. ${validation}`);
92
- }
93
- }
94
- function assertFolderEmptyAsync(projectRoot) {
95
- const conflicts = fs_extra_1.default
96
- .readdirSync(projectRoot)
97
- .filter((file) => !/\.iml$/.test(file));
98
- if (conflicts.length > 0) {
99
- log_1.Log.newLine();
100
- log_1.Log.error(`Something already exists at "${projectRoot}"`);
101
- log_1.Log.error('Try using a new directory name, or moving these files.');
102
- log_1.Log.newLine();
103
- return { exists: true };
104
- }
105
- return { exists: false };
106
- }
107
86
  const isGitExecutableAvailable = async () => {
108
87
  try {
109
88
  await (0, execa_1.default)('git', ['--version']);
@@ -116,87 +95,29 @@ const isGitExecutableAvailable = async () => {
116
95
  }
117
96
  }
118
97
  };
119
- const initGitRepoAsync = async (root, flags = { silent: false, commit: true }) => {
120
- // let's see if we're in a git tree
121
- try {
122
- await (0, execa_1.default)('git', ['rev-parse', '--is-inside-work-tree'], {
123
- cwd: root,
124
- });
125
- if (!flags.silent) {
126
- log_1.Log.info('New project is already inside of a git repo, skipping git init.');
127
- }
128
- }
129
- catch (e) {
130
- if (e.errno === 'ENOENT') {
131
- if (!flags.silent) {
132
- log_1.Log.warn('Unable to initialize git repo. `git` not in PATH.');
133
- }
134
- return false;
135
- }
136
- }
98
+ const initGitRepoAsync = async (root) => {
137
99
  // not in git tree, so let's init
138
100
  try {
139
101
  await (0, execa_1.default)('git', ['init'], { cwd: root });
140
- if (!flags.silent) {
141
- log_1.Log.info('Initialized a git repository.');
142
- }
143
- if (flags.commit) {
144
- await (0, execa_1.default)('git', ['add', '--all'], { cwd: root, stdio: 'ignore' });
145
- await (0, execa_1.default)('git', ['commit', '-m', 'Create a new Remotion video'], {
146
- cwd: root,
147
- stdio: 'ignore',
148
- });
149
- await (0, execa_1.default)('git', ['branch', '-M', 'main'], {
150
- cwd: root,
151
- stdio: 'ignore',
152
- });
153
- }
154
- return true;
102
+ await (0, execa_1.default)('git', ['add', '--all'], { cwd: root, stdio: 'ignore' });
103
+ await (0, execa_1.default)('git', ['commit', '-m', 'Create new Remotion video'], {
104
+ cwd: root,
105
+ stdio: 'ignore',
106
+ });
107
+ await (0, execa_1.default)('git', ['branch', '-M', 'main'], {
108
+ cwd: root,
109
+ stdio: 'ignore',
110
+ });
155
111
  }
156
112
  catch (e) {
157
- log_1.Log.verbose('git error:', e);
113
+ log_1.Log.error('Error creating git repository:', e);
114
+ log_1.Log.error('Project has been created nonetheless.');
158
115
  // no-op -- this is just a convenience and we don't care if it fails
159
- return false;
160
- }
161
- };
162
- const resolveProjectRootAsync = async () => {
163
- let projectName = '';
164
- try {
165
- const { answer } = await (0, prompts_1.default)({
166
- type: 'text',
167
- name: 'answer',
168
- message: 'What would you like to name your video?',
169
- initial: 'my-video',
170
- validate: (name) => {
171
- const validation = validateName(path_1.default.basename(path_1.default.resolve(name)));
172
- if (typeof validation === 'string') {
173
- return 'Invalid project name: ' + validation;
174
- }
175
- return true;
176
- },
177
- });
178
- if (typeof answer === 'string') {
179
- projectName = answer.trim();
180
- }
181
- }
182
- catch (error) {
183
- // Handle the aborted message in a custom way.
184
- if (error.code !== 'ABORTED') {
185
- throw error;
186
- }
187
- }
188
- const projectRoot = path_1.default.resolve(projectName);
189
- const folderName = path_1.default.basename(projectRoot);
190
- assertValidName(folderName);
191
- await fs_extra_1.default.ensureDir(projectRoot);
192
- if (assertFolderEmptyAsync(projectRoot).exists) {
193
- return resolveProjectRootAsync();
194
116
  }
195
- return [projectRoot, folderName];
196
117
  };
197
118
  const init = async () => {
198
- var _a, _b, _c, _d, _e, _f, _g;
199
- const [projectRoot, folderName] = await resolveProjectRootAsync();
119
+ var _a, _b, _c, _d, _e, _f;
120
+ const [projectRoot, folderName] = await (0, resolve_project_root_1.resolveProjectRoot)();
200
121
  await isGitExecutableAvailable();
201
122
  const descriptionColumn = Math.max(...FEATURED_TEMPLATES.map((t) => typeof t === 'object' ? t.shortName.length : 0)) + 2;
202
123
  const selectedTemplate = (await (0, prompts_1.selectAsync)({
@@ -207,24 +128,21 @@ const init = async () => {
207
128
  return prompts_1.default.separator(template);
208
129
  }
209
130
  return {
210
- value: template.name,
131
+ value: template,
211
132
  title: chalk_1.default.bold(padEnd(template.shortName, descriptionColumn)) +
212
133
  template.description.trim(),
213
134
  };
214
135
  }),
215
136
  }, {}));
137
+ const pkgManager = (0, pkg_managers_1.selectPackageManager)();
216
138
  try {
217
- const homeOrTmp = (0, os_1.homedir)() || (0, os_1.tmpdir)();
218
- // Remove degit cache because of https://github.com/remotion-dev/remotion/issues/852
219
- // https://github.com/Rich-Harris/degit/issues/313
220
- const degitFolder = path_1.default.join(homeOrTmp, '.degit', 'github', ...selectedTemplate.split('/'));
221
- if (fs_extra_1.default.existsSync(degitFolder)) {
222
- await ((_a = fs_extra_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_extra_1.default.promises.rmdir)(degitFolder, {
223
- recursive: true,
224
- });
225
- }
226
- const emitter = (0, degit_1.default)(`https://github.com/${selectedTemplate}`);
227
- await emitter.clone(projectRoot);
139
+ await (0, degit_1.degit)({
140
+ repoOrg: selectedTemplate.org,
141
+ repoName: selectedTemplate.repoName,
142
+ dest: projectRoot,
143
+ });
144
+ (0, patch_readme_1.patchReadmeMd)(projectRoot, pkgManager);
145
+ (0, patch_package_json_1.patchPackageJson)(projectRoot, folderName);
228
146
  }
229
147
  catch (e) {
230
148
  log_1.Log.error(e);
@@ -232,7 +150,6 @@ const init = async () => {
232
150
  process.exit(1);
233
151
  }
234
152
  log_1.Log.info(`Created project at ${chalk_1.default.blueBright(folderName)}. Installing dependencies...`);
235
- const pkgManager = (0, pkg_managers_1.selectPackageManager)();
236
153
  if (pkgManager === 'yarn') {
237
154
  log_1.Log.info('> yarn');
238
155
  const promise = (0, execa_1.default)('yarn', [], {
@@ -240,8 +157,8 @@ const init = async () => {
240
157
  stdio: 'inherit',
241
158
  env: { ...process.env, ADBLOCK: '1', DISABLE_OPENCOLLECTIVE: '1' },
242
159
  });
243
- (_b = promise.stderr) === null || _b === void 0 ? void 0 : _b.pipe(process.stderr);
244
- (_c = promise.stdout) === null || _c === void 0 ? void 0 : _c.pipe(process.stdout);
160
+ (_a = promise.stderr) === null || _a === void 0 ? void 0 : _a.pipe(process.stderr);
161
+ (_b = promise.stdout) === null || _b === void 0 ? void 0 : _b.pipe(process.stdout);
245
162
  await promise;
246
163
  }
247
164
  else if (pkgManager === 'pnpm') {
@@ -251,8 +168,8 @@ const init = async () => {
251
168
  stdio: 'inherit',
252
169
  env: { ...process.env, ADBLOCK: '1', DISABLE_OPENCOLLECTIVE: '1' },
253
170
  });
254
- (_d = promise.stderr) === null || _d === void 0 ? void 0 : _d.pipe(process.stderr);
255
- (_e = promise.stdout) === null || _e === void 0 ? void 0 : _e.pipe(process.stdout);
171
+ (_c = promise.stderr) === null || _c === void 0 ? void 0 : _c.pipe(process.stderr);
172
+ (_d = promise.stdout) === null || _d === void 0 ? void 0 : _d.pipe(process.stdout);
256
173
  await promise;
257
174
  }
258
175
  else {
@@ -262,14 +179,11 @@ const init = async () => {
262
179
  cwd: projectRoot,
263
180
  env: { ...process.env, ADBLOCK: '1', DISABLE_OPENCOLLECTIVE: '1' },
264
181
  });
265
- (_f = promise.stderr) === null || _f === void 0 ? void 0 : _f.pipe(process.stderr);
266
- (_g = promise.stdout) === null || _g === void 0 ? void 0 : _g.pipe(process.stdout);
182
+ (_e = promise.stderr) === null || _e === void 0 ? void 0 : _e.pipe(process.stderr);
183
+ (_f = promise.stdout) === null || _f === void 0 ? void 0 : _f.pipe(process.stdout);
267
184
  await promise;
268
185
  }
269
- await initGitRepoAsync(projectRoot, {
270
- silent: true,
271
- commit: true,
272
- });
186
+ await initGitRepoAsync(projectRoot);
273
187
  log_1.Log.info();
274
188
  log_1.Log.info(`Welcome to ${chalk_1.default.blueBright('Remotion')}!`);
275
189
  log_1.Log.info(`✨ Your video has been created at ${chalk_1.default.blueBright(folderName)}.`);