isaacscript 2.0.14-dev.6 → 2.0.14-dev.9

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 (93) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +4 -6
  3. package/file-templates/static/{.eslintrc.js → .eslintrc.js.template} +0 -0
  4. package/file-templates/static/.github/workflows/ci.yml +4 -3
  5. package/package.json +5 -1
  6. package/src/checkForWindowsTerminalBugs.js +75 -79
  7. package/src/checkForWindowsTerminalBugs.js.map +1 -1
  8. package/src/commands/copy/copy.js +32 -32
  9. package/src/commands/init/checkIfProjectPathExists.js +27 -29
  10. package/src/commands/init/checkIfProjectPathExists.js.map +1 -1
  11. package/src/commands/init/checkModSubdirectory.js +15 -15
  12. package/src/commands/init/checkModTargetDirectory.js +30 -32
  13. package/src/commands/init/checkModTargetDirectory.js.map +1 -1
  14. package/src/commands/init/createMod.js +142 -137
  15. package/src/commands/init/createMod.js.map +1 -1
  16. package/src/commands/init/getModsDir.js +55 -57
  17. package/src/commands/init/getModsDir.js.map +1 -1
  18. package/src/commands/init/getProjectPath.js +88 -92
  19. package/src/commands/init/getProjectPath.js.map +1 -1
  20. package/src/commands/init/git.js +150 -152
  21. package/src/commands/init/git.js.map +1 -1
  22. package/src/commands/init/init.js +65 -69
  23. package/src/commands/init/init.js.map +1 -1
  24. package/src/commands/init/installVSCodeExtensions.js +32 -32
  25. package/src/commands/init/promptSaveSlot.js +21 -24
  26. package/src/commands/init/promptSaveSlot.js.map +1 -1
  27. package/src/commands/init/promptVSCode.js +24 -26
  28. package/src/commands/init/promptVSCode.js.map +1 -1
  29. package/src/commands/monitor/constants.js +4 -4
  30. package/src/commands/monitor/copyWatcherMod.js +38 -38
  31. package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js +49 -49
  32. package/src/commands/monitor/monitor.js +146 -146
  33. package/src/commands/monitor/notifyGame.js +57 -57
  34. package/src/commands/monitor/saveDatWriter/saveDatWriter.js +116 -116
  35. package/src/commands/monitor/saveDatWriter/types.js +2 -2
  36. package/src/commands/monitor/spawnSaveDatWriter.js +34 -34
  37. package/src/commands/monitor/touchWatcherSaveDatFiles.js +20 -20
  38. package/src/commands/publish/publish.js +220 -220
  39. package/src/configFile.js +63 -65
  40. package/src/configFile.js.map +1 -1
  41. package/src/constants.js +59 -59
  42. package/src/constants.js.map +1 -1
  43. package/src/exec.js +95 -95
  44. package/src/file.js +193 -193
  45. package/src/main.js +117 -121
  46. package/src/main.js.map +1 -1
  47. package/src/parseArgs.js +106 -106
  48. package/src/prompt.js +86 -92
  49. package/src/prompt.js.map +1 -1
  50. package/src/types/Command.js +4 -4
  51. package/src/types/Config.js +12 -12
  52. package/src/types/GitHubCLIHostsYAML.js +2 -2
  53. package/src/utils.js +81 -81
  54. package/src/validateInIsaacScriptProject.js +26 -26
  55. package/src/validateNodeVersion.js +24 -24
  56. package/src/validateOS.js +16 -16
  57. package/src/checkForWindowsTerminalBugs.d.ts +0 -5
  58. package/src/commands/copy/copy.d.ts +0 -3
  59. package/src/commands/init/checkIfProjectPathExists.d.ts +0 -1
  60. package/src/commands/init/checkModSubdirectory.d.ts +0 -1
  61. package/src/commands/init/checkModTargetDirectory.d.ts +0 -1
  62. package/src/commands/init/createMod.d.ts +0 -1
  63. package/src/commands/init/getModsDir.d.ts +0 -1
  64. package/src/commands/init/getProjectPath.d.ts +0 -1
  65. package/src/commands/init/git.d.ts +0 -4
  66. package/src/commands/init/init.d.ts +0 -1
  67. package/src/commands/init/installVSCodeExtensions.d.ts +0 -1
  68. package/src/commands/init/promptSaveSlot.d.ts +0 -1
  69. package/src/commands/init/promptVSCode.d.ts +0 -1
  70. package/src/commands/monitor/constants.d.ts +0 -1
  71. package/src/commands/monitor/copyWatcherMod.d.ts +0 -2
  72. package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.d.ts +0 -1
  73. package/src/commands/monitor/monitor.d.ts +0 -2
  74. package/src/commands/monitor/notifyGame.d.ts +0 -3
  75. package/src/commands/monitor/saveDatWriter/saveDatWriter.d.ts +0 -1
  76. package/src/commands/monitor/saveDatWriter/types.d.ts +0 -5
  77. package/src/commands/monitor/spawnSaveDatWriter.d.ts +0 -4
  78. package/src/commands/monitor/touchWatcherSaveDatFiles.d.ts +0 -2
  79. package/src/commands/publish/publish.d.ts +0 -2
  80. package/src/configFile.d.ts +0 -4
  81. package/src/constants.d.ts +0 -34
  82. package/src/exec.d.ts +0 -4
  83. package/src/file.d.ts +0 -12
  84. package/src/main.d.ts +0 -2
  85. package/src/parseArgs.d.ts +0 -1
  86. package/src/prompt.d.ts +0 -5
  87. package/src/types/Command.d.ts +0 -2
  88. package/src/types/Config.d.ts +0 -18
  89. package/src/types/GitHubCLIHostsYAML.d.ts +0 -7
  90. package/src/utils.d.ts +0 -13
  91. package/src/validateInIsaacScriptProject.d.ts +0 -1
  92. package/src/validateNodeVersion.d.ts +0 -5
  93. package/src/validateOS.d.ts +0 -1
@@ -1,93 +1,89 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProjectPath = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const path_1 = tslib_1.__importDefault(require("path"));
7
- const constants_1 = require("../../constants");
8
- const prompt_1 = require("../../prompt");
9
- const utils_1 = require("../../utils");
10
- // From: https://gist.github.com/doctaphred/d01d05291546186941e1b7ddc02034d3
11
- const ILLEGAL_CHARACTERS_FOR_WINDOWS_FILENAMES = [
12
- "<",
13
- ">",
14
- ":",
15
- '"',
16
- "/",
17
- "\\",
18
- "|",
19
- "?",
20
- "*",
21
- ];
22
- function getProjectPath(argv, useCurrentDir, yes, forceName) {
23
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
- let projectName = getProjectNameFromCommandLineArgument(argv);
25
- let projectPath;
26
- let createNewDir;
27
- if (useCurrentDir) {
28
- // The "--use-current-dir" command-line flag was specified, so there is no need to prompt the
29
- // user.
30
- projectName = constants_1.CURRENT_DIRECTORY_NAME;
31
- projectPath = constants_1.CWD;
32
- createNewDir = false;
33
- }
34
- else if (projectName !== undefined) {
35
- // The project name was specified on the command-line.
36
- projectPath = path_1.default.join(constants_1.CWD, projectName);
37
- createNewDir = true;
38
- }
39
- else if (yes) {
40
- // The "--yes" command-line flag was specified and the project name was not specified on the
41
- // command-line, so default to using the current directory.
42
- projectName = constants_1.CURRENT_DIRECTORY_NAME;
43
- projectPath = constants_1.CWD;
44
- createNewDir = false;
45
- }
46
- else {
47
- // The project name was not specified on the command-line, so prompt the user for it.
48
- [projectName, projectPath, createNewDir] = yield getNewProjectName();
49
- }
50
- validateProjectName(projectName, forceName);
51
- console.log(`Using a project name of: ${chalk_1.default.green(projectName)}`);
52
- return [projectPath, createNewDir];
53
- });
54
- }
55
- exports.getProjectPath = getProjectPath;
56
- function getProjectNameFromCommandLineArgument(argv) {
57
- const name = argv["name"];
58
- return typeof name === "string" && name !== "" ? name : undefined;
59
- }
60
- function getNewProjectName() {
61
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
62
- console.log("You did not specify a project name as a command-line argument.");
63
- const shouldUseCurrentDir = yield (0, prompt_1.getInputYesNo)(`Would you like to create a new project using the current directory "${chalk_1.default.green(constants_1.CURRENT_DIRECTORY_NAME)}" as the root?`);
64
- if (shouldUseCurrentDir) {
65
- return [constants_1.CURRENT_DIRECTORY_NAME, constants_1.CWD, false];
66
- }
67
- const projectName = yield (0, prompt_1.getInputString)("Enter the name of the project:");
68
- const projectPath = path_1.default.join(constants_1.CWD, projectName);
69
- return [projectName, projectPath, true];
70
- });
71
- }
72
- function validateProjectName(projectName, forceName) {
73
- if (projectName === "") {
74
- (0, utils_1.error)("Error: You cannot have a blank project name.");
75
- }
76
- if (process.platform === "win32") {
77
- for (const character of ILLEGAL_CHARACTERS_FOR_WINDOWS_FILENAMES) {
78
- if (projectName.includes(character)) {
79
- (0, utils_1.error)(`Error: The "${character}" character is not allowed in a Windows file name.`);
80
- }
81
- }
82
- }
83
- if (forceName) {
84
- return;
85
- }
86
- if ((0, utils_1.hasWhiteSpace)(projectName)) {
87
- (0, utils_1.error)('Error: The project name has whitespace in it, which is not allowed. Use kebab-case for your project name. (e.g. "green-candle")');
88
- }
89
- if (!(0, utils_1.isKebabCase)(projectName)) {
90
- (0, utils_1.error)('Error: The project name is not in kebab-case. (Kebab-case is the style of using all lowercase letters, with words separated by hyphens.) Project names must use kebab-case to match GitHub repository standards. If necessary, you can override this check with the "--force-name" flag.');
91
- }
92
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProjectPath = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const path_1 = tslib_1.__importDefault(require("path"));
7
+ const constants_1 = require("../../constants");
8
+ const prompt_1 = require("../../prompt");
9
+ const utils_1 = require("../../utils");
10
+ // From: https://gist.github.com/doctaphred/d01d05291546186941e1b7ddc02034d3
11
+ const ILLEGAL_CHARACTERS_FOR_WINDOWS_FILENAMES = [
12
+ "<",
13
+ ">",
14
+ ":",
15
+ '"',
16
+ "/",
17
+ "\\",
18
+ "|",
19
+ "?",
20
+ "*",
21
+ ];
22
+ async function getProjectPath(argv, useCurrentDir, yes, forceName) {
23
+ let projectName = getProjectNameFromCommandLineArgument(argv);
24
+ let projectPath;
25
+ let createNewDir;
26
+ if (useCurrentDir) {
27
+ // The "--use-current-dir" command-line flag was specified, so there is no need to prompt the
28
+ // user.
29
+ projectName = constants_1.CURRENT_DIRECTORY_NAME;
30
+ projectPath = constants_1.CWD;
31
+ createNewDir = false;
32
+ }
33
+ else if (projectName !== undefined) {
34
+ // The project name was specified on the command-line.
35
+ projectPath = path_1.default.join(constants_1.CWD, projectName);
36
+ createNewDir = true;
37
+ }
38
+ else if (yes) {
39
+ // The "--yes" command-line flag was specified and the project name was not specified on the
40
+ // command-line, so default to using the current directory.
41
+ projectName = constants_1.CURRENT_DIRECTORY_NAME;
42
+ projectPath = constants_1.CWD;
43
+ createNewDir = false;
44
+ }
45
+ else {
46
+ // The project name was not specified on the command-line, so prompt the user for it.
47
+ [projectName, projectPath, createNewDir] = await getNewProjectName();
48
+ }
49
+ validateProjectName(projectName, forceName);
50
+ console.log(`Using a project name of: ${chalk_1.default.green(projectName)}`);
51
+ return [projectPath, createNewDir];
52
+ }
53
+ exports.getProjectPath = getProjectPath;
54
+ function getProjectNameFromCommandLineArgument(argv) {
55
+ const name = argv["name"];
56
+ return typeof name === "string" && name !== "" ? name : undefined;
57
+ }
58
+ async function getNewProjectName() {
59
+ console.log("You did not specify a project name as a command-line argument.");
60
+ const shouldUseCurrentDir = await (0, prompt_1.getInputYesNo)(`Would you like to create a new project using the current directory "${chalk_1.default.green(constants_1.CURRENT_DIRECTORY_NAME)}" as the root?`);
61
+ if (shouldUseCurrentDir) {
62
+ return [constants_1.CURRENT_DIRECTORY_NAME, constants_1.CWD, false];
63
+ }
64
+ const projectName = await (0, prompt_1.getInputString)("Enter the name of the project:");
65
+ const projectPath = path_1.default.join(constants_1.CWD, projectName);
66
+ return [projectName, projectPath, true];
67
+ }
68
+ function validateProjectName(projectName, forceName) {
69
+ if (projectName === "") {
70
+ (0, utils_1.error)("Error: You cannot have a blank project name.");
71
+ }
72
+ if (process.platform === "win32") {
73
+ for (const character of ILLEGAL_CHARACTERS_FOR_WINDOWS_FILENAMES) {
74
+ if (projectName.includes(character)) {
75
+ (0, utils_1.error)(`Error: The "${character}" character is not allowed in a Windows file name.`);
76
+ }
77
+ }
78
+ }
79
+ if (forceName) {
80
+ return;
81
+ }
82
+ if ((0, utils_1.hasWhiteSpace)(projectName)) {
83
+ (0, utils_1.error)('Error: The project name has whitespace in it, which is not allowed. Use kebab-case for your project name. (e.g. "green-candle")');
84
+ }
85
+ if (!(0, utils_1.isKebabCase)(projectName)) {
86
+ (0, utils_1.error)('Error: The project name is not in kebab-case. (Kebab-case is the style of using all lowercase letters, with words separated by hyphens.) Project names must use kebab-case to match GitHub repository standards. If necessary, you can override this check with the "--force-name" flag.');
87
+ }
88
+ }
93
89
  //# sourceMappingURL=getProjectPath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getProjectPath.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/getProjectPath.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,wDAAwB;AACxB,+CAA8D;AAC9D,yCAA6D;AAC7D,uCAAgE;AAEhE,4EAA4E;AAC5E,MAAM,wCAAwC,GAAG;IAC/C,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;CACJ,CAAC;AAEF,SAAsB,cAAc,CAClC,IAA6B,EAC7B,aAAsB,EACtB,GAAY,EACZ,SAAkB;;QAElB,IAAI,WAAW,GAAG,qCAAqC,CAAC,IAAI,CAAC,CAAC;QAC9D,IAAI,WAAmB,CAAC;QACxB,IAAI,YAAqB,CAAC;QAC1B,IAAI,aAAa,EAAE;YACjB,6FAA6F;YAC7F,QAAQ;YACR,WAAW,GAAG,kCAAsB,CAAC;YACrC,WAAW,GAAG,eAAG,CAAC;YAClB,YAAY,GAAG,KAAK,CAAC;SACtB;aAAM,IAAI,WAAW,KAAK,SAAS,EAAE;YACpC,sDAAsD;YACtD,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,eAAG,EAAE,WAAW,CAAC,CAAC;YAC1C,YAAY,GAAG,IAAI,CAAC;SACrB;aAAM,IAAI,GAAG,EAAE;YACd,4FAA4F;YAC5F,2DAA2D;YAC3D,WAAW,GAAG,kCAAsB,CAAC;YACrC,WAAW,GAAG,eAAG,CAAC;YAClB,YAAY,GAAG,KAAK,CAAC;SACtB;aAAM;YACL,qFAAqF;YACrF,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,GAAG,MAAM,iBAAiB,EAAE,CAAC;SACtE;QAED,mBAAmB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QAE5C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AC7E,CAAC;aACH;SACF;KACF;IAED,IAAI,SAAS,EAAE;QACb,OAAO;KACR;IAED,IAAI,IAAA,qBAAa,EAAC,WAAW,CAAC,EAAE;QAC9B,IAAA,aAAK,EACH,iIAAiI,CAClI,CAAC;KACH;IAED,IAAI,CAAC,IAAA,mBAAW,EAAC,WAAW,CAAC,EAAE;QAC7B,IAAA,aAAK,EACH,0RAA0R,CAC3R,CAAC;KACH;AACH,CAAC"}
1
+ {"version":3,"file":"getProjectPath.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/getProjectPath.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,wDAAwB;AACxB,+CAA8D;AAC9D,yCAA6D;AAC7D,uCAAgE;AAEhE,4EAA4E;AAC5E,MAAM,wCAAwC,GAAG;IAC/C,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;CACJ,CAAC;AAEK,KAAK,UAAU,cAAc,CAClC,IAA6B,EAC7B,aAAsB,EACtB,GAAY,EACZ,SAAkB;IAElB,IAAI,WAAW,GAAG,qCAAqC,CAAC,IAAI,CAAC,CAAC;IAC9D,IAAI,WAAmB,CAAC;IACxB,IAAI,YAAqB,CAAC;IAC1B,IAAI,aAAa,EAAE;QACjB,6FAA6F;QAC7F,QAAQ;QACR,WAAW,GAAG,kCAAsB,CAAC;QACrC,WAAW,GAAG,eAAG,CAAC;QAClB,YAAY,GAAG,KAAK,CAAC;KACtB;SAAM,IAAI,WAAW,KAAK,SAAS,EAAE;QACpC,sDAAsD;QACtD,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,eAAG,EAAE,WAAW,CAAC,CAAC;QAC1C,YAAY,GAAG,IAAI,CAAC;KACrB;SAAM,IAAI,GAAG,EAAE;QACd,4FAA4F;QAC5F,2DAA2D;QAC3D,WAAW,GAAG,kCAAsB,CAAC;QACrC,WAAW,GAAG,eAAG,CAAC;QA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AAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QAChC,KAAK,MAAM,SAAS,IAAI,wCAAwC,EAAE;YAChE,IAAI,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;gBACnC,IAAA,aAAK,EACH,eAAe,SAAS,oDAAoD,CAC7E,CAAC;aACH;SACF;KACF;IAED,IAAI,SAAS,EAAE;QACb,OAAO;KACR;IAED,IAAI,IAAA,qBAAa,EAAC,WAAW,CAAC,EAAE;QAC9B,IAAA,aAAK,EACH,iIAAiI,CAClI,CAAC;KACH;IAED,IAAI,CAAC,IAAA,mBAAW,EAAC,WAAW,CAAC,EAAE;QAC7B,IAAA,aAAK,EACH,0RAA0R,CAC3R,CAAC;KACH;AACH,CAAC"}
@@ -1,158 +1,156 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gitCommitIfChanges = exports.isGitDirty = exports.initGitRepository = exports.promptGitHubRepoOrGitRemoteURL = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const command_exists_1 = tslib_1.__importDefault(require("command-exists"));
7
- const path_1 = tslib_1.__importDefault(require("path"));
8
- const yaml_1 = tslib_1.__importDefault(require("yaml"));
9
- const constants_1 = require("../../constants");
10
- const exec_1 = require("../../exec");
11
- const file = tslib_1.__importStar(require("../../file"));
12
- const prompt_1 = require("../../prompt");
13
- const utils_1 = require("../../utils");
14
- const REQUIRED_GIT_MAJOR_VERSION = 2;
15
- const REQUIRED_GIT_MINOR_VERSION = 30;
16
- function promptGitHubRepoOrGitRemoteURL(projectName, yes, verbose) {
17
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
18
- // We do not need to prompt the user if they do not have Git installed.
19
- if (!command_exists_1.default.sync("git")) {
20
- console.log('Git does not seem to be installed. (The "git" command is not in the path.) Skipping Git-related things.');
21
- return undefined;
22
- }
23
- validateNewGitVersion(verbose);
24
- const gitHubUsername = getGitHubUsername(verbose);
25
- if (gitHubUsername !== undefined) {
26
- const [exitStatus] = (0, exec_1.execShell)("gh", ["repo", "view", projectName], verbose, true);
27
- const gitHubRepoExists = exitStatus === 0;
28
- const url = `https://github.com/${gitHubUsername}/${projectName}`;
29
- if (gitHubRepoExists) {
30
- console.log(`Detected an existing GitHub repository at: ${chalk_1.default.green(url)}`);
31
- const guessedRemoteURL = getGitRemoteURL(projectName, gitHubUsername);
32
- if (yes) {
33
- console.log(`Using a Git remote URL of: ${chalk_1.default.green(guessedRemoteURL)}`);
34
- return guessedRemoteURL;
35
- }
36
- const shouldUseGuessedURL = yield (0, prompt_1.getInputYesNo)(`Do you want to use a Git remote URL of: ${chalk_1.default.green(guessedRemoteURL)}`);
37
- if (shouldUseGuessedURL) {
38
- return guessedRemoteURL;
39
- }
40
- // Assume that since they do not want to connect this project to the existing GitHub
41
- // repository, they do not want to initialize a remote Git URL at all.
42
- return undefined;
43
- }
44
- if (yes) {
45
- (0, exec_1.execShell)("gh", ["repo", "create", projectName, "--public"]);
46
- console.log(`Created a new GitHub repository at: ${chalk_1.default.green(url)}`);
47
- return getGitRemoteURL(projectName, gitHubUsername);
48
- }
49
- const createNewGitHubRepo = yield (0, prompt_1.getInputYesNo)(`Would you like to create a new GitHub repository at: ${chalk_1.default.green(url)}`);
50
- if (createNewGitHubRepo) {
51
- (0, exec_1.execShell)("gh", ["repo", "create", projectName, "--public"]);
52
- console.log("Successfully created a new GitHub repository.");
53
- return getGitRemoteURL(projectName, gitHubUsername);
54
- }
55
- // Assume that since they do not want to create a new GitHub repository, they do not want to
56
- // initialize a remote Git URL at all.
57
- return undefined;
58
- }
59
- const gitRemoteURL = yield (0, prompt_1.getInputString)(`Paste in the remote Git URL for your project.
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gitCommitIfChanges = exports.isGitDirty = exports.initGitRepository = exports.promptGitHubRepoOrGitRemoteURL = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const command_exists_1 = tslib_1.__importDefault(require("command-exists"));
7
+ const path_1 = tslib_1.__importDefault(require("path"));
8
+ const yaml_1 = tslib_1.__importDefault(require("yaml"));
9
+ const constants_1 = require("../../constants");
10
+ const exec_1 = require("../../exec");
11
+ const file = tslib_1.__importStar(require("../../file"));
12
+ const prompt_1 = require("../../prompt");
13
+ const utils_1 = require("../../utils");
14
+ const REQUIRED_GIT_MAJOR_VERSION = 2;
15
+ const REQUIRED_GIT_MINOR_VERSION = 30;
16
+ async function promptGitHubRepoOrGitRemoteURL(projectName, yes, verbose) {
17
+ // We do not need to prompt the user if they do not have Git installed.
18
+ if (!command_exists_1.default.sync("git")) {
19
+ console.log('Git does not seem to be installed. (The "git" command is not in the path.) Skipping Git-related things.');
20
+ return undefined;
21
+ }
22
+ validateNewGitVersion(verbose);
23
+ const gitHubUsername = getGitHubUsername(verbose);
24
+ if (gitHubUsername !== undefined) {
25
+ const [exitStatus] = (0, exec_1.execShell)("gh", ["repo", "view", projectName], verbose, true);
26
+ const gitHubRepoExists = exitStatus === 0;
27
+ const url = `https://github.com/${gitHubUsername}/${projectName}`;
28
+ if (gitHubRepoExists) {
29
+ console.log(`Detected an existing GitHub repository at: ${chalk_1.default.green(url)}`);
30
+ const guessedRemoteURL = getGitRemoteURL(projectName, gitHubUsername);
31
+ if (yes) {
32
+ console.log(`Using a Git remote URL of: ${chalk_1.default.green(guessedRemoteURL)}`);
33
+ return guessedRemoteURL;
34
+ }
35
+ const shouldUseGuessedURL = await (0, prompt_1.getInputYesNo)(`Do you want to use a Git remote URL of: ${chalk_1.default.green(guessedRemoteURL)}`);
36
+ if (shouldUseGuessedURL) {
37
+ return guessedRemoteURL;
38
+ }
39
+ // Assume that since they do not want to connect this project to the existing GitHub
40
+ // repository, they do not want to initialize a remote Git URL at all.
41
+ return undefined;
42
+ }
43
+ if (yes) {
44
+ (0, exec_1.execShell)("gh", ["repo", "create", projectName, "--public"]);
45
+ console.log(`Created a new GitHub repository at: ${chalk_1.default.green(url)}`);
46
+ return getGitRemoteURL(projectName, gitHubUsername);
47
+ }
48
+ const createNewGitHubRepo = await (0, prompt_1.getInputYesNo)(`Would you like to create a new GitHub repository at: ${chalk_1.default.green(url)}`);
49
+ if (createNewGitHubRepo) {
50
+ (0, exec_1.execShell)("gh", ["repo", "create", projectName, "--public"]);
51
+ console.log("Successfully created a new GitHub repository.");
52
+ return getGitRemoteURL(projectName, gitHubUsername);
53
+ }
54
+ // Assume that since they do not want to create a new GitHub repository, they do not want to
55
+ // initialize a remote Git URL at all.
56
+ return undefined;
57
+ }
58
+ const gitRemoteURL = await (0, prompt_1.getInputString)(`Paste in the remote Git URL for your project.
60
59
  For example, if you have an SSH key, it would be something like:
61
60
  ${chalk_1.default.green("git@github.com:Alice/green-candle.git")}
62
61
  If you don't have an SSH key, it would be something like:
63
62
  ${chalk_1.default.green("https://github.com/Alice/green-candle.git")}
64
63
  If you don't want to initialize a Git repository for this project, press enter to skip.
65
- `);
66
- return gitRemoteURL === "" ? undefined : gitRemoteURL;
67
- });
68
- }
69
- exports.promptGitHubRepoOrGitRemoteURL = promptGitHubRepoOrGitRemoteURL;
70
- function validateNewGitVersion(verbose) {
71
- const [, stdout] = (0, exec_1.execShell)("git", ["--version"], verbose);
72
- const outputPrefix = "git version ";
73
- if (!stdout.startsWith(outputPrefix)) {
74
- (0, utils_1.error)(`Failed to parse the output from the "git --version" command: ${stdout}`);
75
- }
76
- const gitVersionString = stdout.slice(outputPrefix.length);
77
- const [majorVersion, minorVersion] = (0, utils_1.parseSemVer)(gitVersionString);
78
- if (majorVersion >= REQUIRED_GIT_MAJOR_VERSION &&
79
- minorVersion >= REQUIRED_GIT_MINOR_VERSION) {
80
- return;
81
- }
82
- console.error(`Your Git version is: ${chalk_1.default.red(gitVersionString)}`);
83
- console.error(`${constants_1.PROJECT_NAME} requires a Git version of ${chalk_1.default.red(`${REQUIRED_GIT_MAJOR_VERSION}.${REQUIRED_GIT_MINOR_VERSION}.0`)} or greater.`);
84
- console.error(`Please upgrade your version of Git before using ${constants_1.PROJECT_NAME}.`);
85
- process.exit(1);
86
- }
87
- function getGitHubUsername(verbose) {
88
- // If the GitHub CLI is installed, we can derive the user's GitHub username.
89
- if (!command_exists_1.default.sync("gh")) {
90
- return undefined;
91
- }
92
- const appData = process.env["APPDATA"];
93
- if (appData === undefined || appData === "") {
94
- return undefined;
95
- }
96
- const githubCLIHostsPath = path_1.default.join(appData, "GitHub CLI", "hosts.yml");
97
- if (!file.exists(githubCLIHostsPath, verbose)) {
98
- return undefined;
99
- }
100
- const configYAMLRaw = file.read(githubCLIHostsPath, verbose);
101
- const configYAML = yaml_1.default.parse(configYAMLRaw);
102
- const githubCom = configYAML["github.com"];
103
- if (githubCom === undefined) {
104
- return undefined;
105
- }
106
- const { user } = githubCom;
107
- if (user === undefined || user === "") {
108
- return undefined;
109
- }
110
- return user;
111
- }
112
- function getGitRemoteURL(projectName, gitHubUsername) {
113
- return `git@github.com:${gitHubUsername}/${projectName}.git`;
114
- }
115
- function initGitRepository(projectPath, gitRemoteURL, verbose) {
116
- if (!command_exists_1.default.sync("git")) {
117
- return;
118
- }
119
- if (gitRemoteURL === undefined) {
120
- return;
121
- }
122
- (0, exec_1.execShell)("git", ["init"], verbose, false, projectPath);
123
- (0, exec_1.execShell)("git", ["branch", "-M", "main"], verbose, false, projectPath);
124
- if (isGitNameAndEmailConfigured(verbose)) {
125
- (0, exec_1.execShell)("git", ["add", "--all"], verbose, false, projectPath);
126
- (0, exec_1.execShell)("git", ["commit", "--message", `${constants_1.PROJECT_NAME} template`], verbose, false, projectPath);
127
- }
128
- if (gitRemoteURL !== undefined) {
129
- (0, exec_1.execShell)("git", ["remote", "add", "origin", gitRemoteURL], verbose, false, projectPath);
130
- }
131
- }
132
- exports.initGitRepository = initGitRepository;
133
- function isGitNameAndEmailConfigured(verbose) {
134
- const [nameExitStatus] = (0, exec_1.execShell)("git", ["config", "--global", "user.name"], verbose, true);
135
- const [emailExitStatus] = (0, exec_1.execShell)("git", ["config", "--global", "user.email"], verbose, true);
136
- return nameExitStatus === 0 && emailExitStatus === 0;
137
- }
138
- function isGitDirty(verbose) {
139
- // From: https://remarkablemark.org/blog/2017/10/12/check-git-dirty/
140
- const [, stdout] = (0, exec_1.execShell)("git", ["status", "--porcelain"], verbose);
141
- return stdout !== "";
142
- }
143
- exports.isGitDirty = isGitDirty;
144
- function gitCommitIfChanges(version, verbose) {
145
- // Throw an error if this is not a git repository.
146
- (0, exec_1.execShell)("git", ["status"], verbose);
147
- if (!isGitDirty(verbose)) {
148
- console.log("There are no changes to commit.");
149
- return;
150
- }
151
- const commitMessage = `v${version}`;
152
- (0, exec_1.execShell)("git", ["add", "-A"], verbose);
153
- (0, exec_1.execShell)("git", ["commit", "-m", commitMessage], verbose);
154
- (0, exec_1.execShell)("git", ["push"], verbose);
155
- console.log(`Committed and pushed to the git repository with a message of: ${commitMessage}`);
156
- }
157
- exports.gitCommitIfChanges = gitCommitIfChanges;
64
+ `);
65
+ return gitRemoteURL === "" ? undefined : gitRemoteURL;
66
+ }
67
+ exports.promptGitHubRepoOrGitRemoteURL = promptGitHubRepoOrGitRemoteURL;
68
+ function validateNewGitVersion(verbose) {
69
+ const [, stdout] = (0, exec_1.execShell)("git", ["--version"], verbose);
70
+ const outputPrefix = "git version ";
71
+ if (!stdout.startsWith(outputPrefix)) {
72
+ (0, utils_1.error)(`Failed to parse the output from the "git --version" command: ${stdout}`);
73
+ }
74
+ const gitVersionString = stdout.slice(outputPrefix.length);
75
+ const [majorVersion, minorVersion] = (0, utils_1.parseSemVer)(gitVersionString);
76
+ if (majorVersion >= REQUIRED_GIT_MAJOR_VERSION &&
77
+ minorVersion >= REQUIRED_GIT_MINOR_VERSION) {
78
+ return;
79
+ }
80
+ console.error(`Your Git version is: ${chalk_1.default.red(gitVersionString)}`);
81
+ console.error(`${constants_1.PROJECT_NAME} requires a Git version of ${chalk_1.default.red(`${REQUIRED_GIT_MAJOR_VERSION}.${REQUIRED_GIT_MINOR_VERSION}.0`)} or greater.`);
82
+ console.error(`Please upgrade your version of Git before using ${constants_1.PROJECT_NAME}.`);
83
+ process.exit(1);
84
+ }
85
+ function getGitHubUsername(verbose) {
86
+ // If the GitHub CLI is installed, we can derive the user's GitHub username.
87
+ if (!command_exists_1.default.sync("gh")) {
88
+ return undefined;
89
+ }
90
+ const appData = process.env["APPDATA"];
91
+ if (appData === undefined || appData === "") {
92
+ return undefined;
93
+ }
94
+ const githubCLIHostsPath = path_1.default.join(appData, "GitHub CLI", "hosts.yml");
95
+ if (!file.exists(githubCLIHostsPath, verbose)) {
96
+ return undefined;
97
+ }
98
+ const configYAMLRaw = file.read(githubCLIHostsPath, verbose);
99
+ const configYAML = yaml_1.default.parse(configYAMLRaw);
100
+ const githubCom = configYAML["github.com"];
101
+ if (githubCom === undefined) {
102
+ return undefined;
103
+ }
104
+ const { user } = githubCom;
105
+ if (user === undefined || user === "") {
106
+ return undefined;
107
+ }
108
+ return user;
109
+ }
110
+ function getGitRemoteURL(projectName, gitHubUsername) {
111
+ return `git@github.com:${gitHubUsername}/${projectName}.git`;
112
+ }
113
+ function initGitRepository(projectPath, gitRemoteURL, verbose) {
114
+ if (!command_exists_1.default.sync("git")) {
115
+ return;
116
+ }
117
+ if (gitRemoteURL === undefined) {
118
+ return;
119
+ }
120
+ (0, exec_1.execShell)("git", ["init"], verbose, false, projectPath);
121
+ (0, exec_1.execShell)("git", ["branch", "-M", "main"], verbose, false, projectPath);
122
+ if (isGitNameAndEmailConfigured(verbose)) {
123
+ (0, exec_1.execShell)("git", ["add", "--all"], verbose, false, projectPath);
124
+ (0, exec_1.execShell)("git", ["commit", "--message", `${constants_1.PROJECT_NAME} template`], verbose, false, projectPath);
125
+ }
126
+ if (gitRemoteURL !== undefined) {
127
+ (0, exec_1.execShell)("git", ["remote", "add", "origin", gitRemoteURL], verbose, false, projectPath);
128
+ }
129
+ }
130
+ exports.initGitRepository = initGitRepository;
131
+ function isGitNameAndEmailConfigured(verbose) {
132
+ const [nameExitStatus] = (0, exec_1.execShell)("git", ["config", "--global", "user.name"], verbose, true);
133
+ const [emailExitStatus] = (0, exec_1.execShell)("git", ["config", "--global", "user.email"], verbose, true);
134
+ return nameExitStatus === 0 && emailExitStatus === 0;
135
+ }
136
+ function isGitDirty(verbose) {
137
+ // From: https://remarkablemark.org/blog/2017/10/12/check-git-dirty/
138
+ const [, stdout] = (0, exec_1.execShell)("git", ["status", "--porcelain"], verbose);
139
+ return stdout !== "";
140
+ }
141
+ exports.isGitDirty = isGitDirty;
142
+ function gitCommitIfChanges(version, verbose) {
143
+ // Throw an error if this is not a git repository.
144
+ (0, exec_1.execShell)("git", ["status"], verbose);
145
+ if (!isGitDirty(verbose)) {
146
+ console.log("There are no changes to commit.");
147
+ return;
148
+ }
149
+ const commitMessage = `v${version}`;
150
+ (0, exec_1.execShell)("git", ["add", "-A"], verbose);
151
+ (0, exec_1.execShell)("git", ["commit", "-m", commitMessage], verbose);
152
+ (0, exec_1.execShell)("git", ["push"], verbose);
153
+ console.log(`Committed and pushed to the git repository with a message of: ${commitMessage}`);
154
+ }
155
+ exports.gitCommitIfChanges = gitCommitIfChanges;
158
156
  //# sourceMappingURL=git.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/git.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,4EAA2C;AAC3C,wDAAwB;AACxB,wDAAwB;AACxB,+CAA+C;AAC/C,qCAAuC;AACvC,yDAAmC;AACnC,yCAA6D;AAE7D,uCAAiD;AAEjD,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACrC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAEtC,SAAsB,8BAA8B,CAClD,WAAmB,EACnB,GAAY,EACZ,OAAgB;;QAEhB,uEAAuE;QACvE,IAAI,CAAC,wBAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YAC9B,OAAO,CAAC,GAAG,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AAC;AACJ,CAAC;AAjBD,gDAiBC"}
1
+ {"version":3,"file":"git.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/git.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,4EAA2C;AAC3C,wDAAwB;AACxB,wDAAwB;AACxB,+CAA+C;AAC/C,qCAAuC;AACvC,yDAAmC;AACnC,yCAA6D;AAE7D,uCAAiD;AAEjD,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACrC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE/B,KAAK,UAAU,8BAA8B,CAClD,WAAmB,EACnB,GAAY,EACZ,OAAgB;IAEhB,uEAAuE;IACvE,IAAI,CAAC,wBAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QAC9B,OAAO,CAAC,GAAG,CACT,yGAAyG,CAC1G,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;IAED,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAE/B,MAAM,cAAc,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,cAAc,KAAK,SAAS,EAAE;QAChC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAA,gBAAS,EAC5B,IAAI,EACJ,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAC7B,OAAO,EACP,IAAI,CACL,CAAC;QACF,MAAM,gBAAgB,GAAG,UAAU,KAAK,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,sBAAsB,cAAc,IAAI,WAAW,EAAE,CAAC;QAElE,IAAI,gBAAgB,EAAE;YACpB,OAAO,CAAC,GAAG,CACT,8CAA8C,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CACjE,CAAC;YACF,MAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;YAEtE,IAAI,GAAG,EAAE;gBACP,OAAO,CAAC,GAAG,CACT,8BAA8B,eAAK,CAAC,KAAK,CAAC,gBAAgB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