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
package/src/parseArgs.js CHANGED
@@ -1,107 +1,107 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseArgs = void 0;
4
- const tslib_1 = require("tslib");
5
- const yargs_1 = tslib_1.__importDefault(require("yargs"));
6
- const constants_1 = require("./constants");
7
- function parseArgs() {
8
- const yargsObject = (0, yargs_1.default)(process.argv.slice(2))
9
- .strict()
10
- .usage("usage: isaacscript <command> [options]")
11
- .scriptName("isaacscript")
12
- .command("monitor", "Monitor a project for changes. (default)", (builder) => builder
13
- .option("mods-directory", {
14
- alias: "m",
15
- type: "string",
16
- description: "The directory where Isaac mods live on your system",
17
- })
18
- .option("save-slot", {
19
- alias: "s",
20
- type: "number",
21
- choices: [1, 2, 3],
22
- description: "The save slot in-game that you use",
23
- })
24
- .option("verbose", {
25
- alias: "v",
26
- type: "boolean",
27
- description: "Enable verbose output",
28
- }))
29
- .command("init [name]", `Initialize a new ${constants_1.PROJECT_NAME} mod.`, (builder) => builder
30
- .option("yes", {
31
- alias: "y",
32
- type: "boolean",
33
- description: 'Answer yes to every dialog option, similar to how "npm init --yes" works.',
34
- })
35
- .option("use-current-dir", {
36
- alias: "u",
37
- type: "boolean",
38
- description: "Use the current directory as the root for the project",
39
- })
40
- .option("mods-directory", {
41
- alias: "m",
42
- type: "string",
43
- description: "The directory where Isaac mods live on your system",
44
- })
45
- .option("save-slot", {
46
- alias: "s",
47
- type: "number",
48
- choices: [1, 2, 3],
49
- description: "The in-game save slot that you use",
50
- })
51
- .option("vscode", {
52
- alias: "c",
53
- type: "boolean",
54
- description: "Open the project in VSCode after initialization",
55
- })
56
- .option("skip-npm-install", {
57
- alias: "i",
58
- type: "boolean",
59
- description: 'Don\'t automatically run "npm install" after initializing the project',
60
- })
61
- .option("force-name", {
62
- alias: "f",
63
- type: "boolean",
64
- description: "Allow project names that are normally illegal",
65
- })
66
- .option("verbose", {
67
- alias: "v",
68
- type: "boolean",
69
- description: "Enable verbose output",
70
- }))
71
- .command("copy", "Only compile & copy the mod.", (builder) => builder.option("verbose", {
72
- alias: "v",
73
- type: "boolean",
74
- description: "Enable verbose output",
75
- }))
76
- .command("publish", "Bump the version & automatically publish the new files using the steamcmd tool.", (builder) => builder
77
- .option("skip", {
78
- alias: "s",
79
- type: "boolean",
80
- description: "skip incrementing the version number",
81
- })
82
- .option("set-version", {
83
- alias: "t",
84
- type: "string",
85
- description: "specify the version number instead of incrementing it",
86
- })
87
- .option("dry-run", {
88
- alias: "d",
89
- type: "boolean",
90
- description: "skip invoking steamcmd",
91
- })
92
- .option("only-upload", {
93
- alias: "u",
94
- type: "boolean",
95
- description: "only upload the mod to the Steam Workshop (without doing anything else)",
96
- })
97
- .option("verbose", {
98
- alias: "v",
99
- type: "boolean",
100
- description: "Enable verbose output",
101
- }))
102
- .alias("h", "help") // By default, only "--help" is enabled
103
- .alias("v", "version"); // By default, only "--version" is enabled
104
- return yargsObject.argv;
105
- }
106
- exports.parseArgs = parseArgs;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseArgs = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const yargs_1 = tslib_1.__importDefault(require("yargs"));
6
+ const constants_1 = require("./constants");
7
+ function parseArgs() {
8
+ const yargsObject = (0, yargs_1.default)(process.argv.slice(2))
9
+ .strict()
10
+ .usage("usage: isaacscript <command> [options]")
11
+ .scriptName("isaacscript")
12
+ .command("monitor", "Monitor a project for changes. (default)", (builder) => builder
13
+ .option("mods-directory", {
14
+ alias: "m",
15
+ type: "string",
16
+ description: "The directory where Isaac mods live on your system",
17
+ })
18
+ .option("save-slot", {
19
+ alias: "s",
20
+ type: "number",
21
+ choices: [1, 2, 3],
22
+ description: "The save slot in-game that you use",
23
+ })
24
+ .option("verbose", {
25
+ alias: "v",
26
+ type: "boolean",
27
+ description: "Enable verbose output",
28
+ }))
29
+ .command("init [name]", `Initialize a new ${constants_1.PROJECT_NAME} mod.`, (builder) => builder
30
+ .option("yes", {
31
+ alias: "y",
32
+ type: "boolean",
33
+ description: 'Answer yes to every dialog option, similar to how "npm init --yes" works.',
34
+ })
35
+ .option("use-current-dir", {
36
+ alias: "u",
37
+ type: "boolean",
38
+ description: "Use the current directory as the root for the project",
39
+ })
40
+ .option("mods-directory", {
41
+ alias: "m",
42
+ type: "string",
43
+ description: "The directory where Isaac mods live on your system",
44
+ })
45
+ .option("save-slot", {
46
+ alias: "s",
47
+ type: "number",
48
+ choices: [1, 2, 3],
49
+ description: "The in-game save slot that you use",
50
+ })
51
+ .option("vscode", {
52
+ alias: "c",
53
+ type: "boolean",
54
+ description: "Open the project in VSCode after initialization",
55
+ })
56
+ .option("skip-npm-install", {
57
+ alias: "i",
58
+ type: "boolean",
59
+ description: 'Don\'t automatically run "npm install" after initializing the project',
60
+ })
61
+ .option("force-name", {
62
+ alias: "f",
63
+ type: "boolean",
64
+ description: "Allow project names that are normally illegal",
65
+ })
66
+ .option("verbose", {
67
+ alias: "v",
68
+ type: "boolean",
69
+ description: "Enable verbose output",
70
+ }))
71
+ .command("copy", "Only compile & copy the mod.", (builder) => builder.option("verbose", {
72
+ alias: "v",
73
+ type: "boolean",
74
+ description: "Enable verbose output",
75
+ }))
76
+ .command("publish", "Bump the version & automatically publish the new files using the steamcmd tool.", (builder) => builder
77
+ .option("skip", {
78
+ alias: "s",
79
+ type: "boolean",
80
+ description: "skip incrementing the version number",
81
+ })
82
+ .option("set-version", {
83
+ alias: "t",
84
+ type: "string",
85
+ description: "specify the version number instead of incrementing it",
86
+ })
87
+ .option("dry-run", {
88
+ alias: "d",
89
+ type: "boolean",
90
+ description: "skip invoking steamcmd",
91
+ })
92
+ .option("only-upload", {
93
+ alias: "u",
94
+ type: "boolean",
95
+ description: "only upload the mod to the Steam Workshop (without doing anything else)",
96
+ })
97
+ .option("verbose", {
98
+ alias: "v",
99
+ type: "boolean",
100
+ description: "Enable verbose output",
101
+ }))
102
+ .alias("h", "help") // By default, only "--help" is enabled
103
+ .alias("v", "version"); // By default, only "--version" is enabled
104
+ return yargsObject.argv;
105
+ }
106
+ exports.parseArgs = parseArgs;
107
107
  //# sourceMappingURL=parseArgs.js.map
package/src/prompt.js CHANGED
@@ -1,93 +1,87 @@
1
- "use strict";
2
- // Both the Inquirer.js library and the Prompts library have a bug where text is duplicated in a Git
3
- // Bash terminal. Thus, we revert to using the simpler Prompt library.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getInputInt = exports.getInputString = exports.getInputYesNo = exports.promptInit = void 0;
6
- const tslib_1 = require("tslib");
7
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
- const prompt_1 = tslib_1.__importDefault(require("prompt"));
9
- const utils_1 = require("./utils");
10
- const VALID_YES_RESPONSES = new Set(["yes", "ye", "y"]);
11
- const VALID_NO_RESPONSES = new Set(["no", "n"]);
12
- function promptInit() {
13
- // Override some of the prompt library's default values:
14
- // https://github.com/flatiron/prompt#customizing-your-prompt
15
- prompt_1.default.message = chalk_1.default.green("?");
16
- prompt_1.default.delimiter = " ";
17
- prompt_1.default.colors = false;
18
- }
19
- exports.promptInit = promptInit;
20
- function getInputYesNo(msg, defaultValue = true) {
21
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
- prompt_1.default.start();
23
- // Capitalize the letter that represents the default option.
24
- const y = defaultValue ? "Y" : "y";
25
- const n = defaultValue ? "n" : "N";
26
- const questionSuffix = `(${y}\\${n})`;
27
- const description = `${chalk_1.default.bold(msg)} ${chalk_1.default.gray(questionSuffix)}`;
28
- const { response } = yield prompt_1.default.get({
29
- properties: {
30
- response: {
31
- type: "string",
32
- description,
33
- },
34
- },
35
- });
36
- if (typeof response !== "string") {
37
- console.log(typeof response);
38
- (0, utils_1.error)("Failed to get a proper response from the prompt library.");
39
- }
40
- const cleanedResponse = response.toLowerCase().trim();
41
- // Default to true.
42
- if (cleanedResponse === "") {
43
- return defaultValue;
44
- }
45
- if (VALID_YES_RESPONSES.has(cleanedResponse)) {
46
- return true;
47
- }
48
- if (VALID_NO_RESPONSES.has(cleanedResponse)) {
49
- return false;
50
- }
51
- return (0, utils_1.error)('Invalid response; must answer "yes" or "no".');
52
- });
53
- }
54
- exports.getInputYesNo = getInputYesNo;
55
- /** Returns trimmed input. */
56
- function getInputString(msg, defaultValue) {
57
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
- prompt_1.default.start();
59
- let description = `${chalk_1.default.bold(msg)}`;
60
- if (defaultValue !== undefined) {
61
- description += ` ${chalk_1.default.gray(`(${defaultValue})`)}`;
62
- }
63
- const { response } = yield prompt_1.default.get({
64
- properties: {
65
- response: {
66
- type: "string",
67
- description,
68
- },
69
- },
70
- });
71
- if (typeof response !== "string") {
72
- (0, utils_1.error)("Failed to get a proper response from the prompt library.");
73
- }
74
- if (response === "" && defaultValue !== undefined) {
75
- return defaultValue;
76
- }
77
- return response.trim();
78
- });
79
- }
80
- exports.getInputString = getInputString;
81
- function getInputInt(msg, defaultValue = 1) {
82
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
83
- const defaultValueString = defaultValue.toString();
84
- const string = yield getInputString(msg, defaultValueString);
85
- const int = (0, utils_1.parseIntSafe)(string);
86
- if (Number.isNaN(int)) {
87
- (0, utils_1.error)("Error: You must enter an integer.");
88
- }
89
- return int;
90
- });
91
- }
92
- exports.getInputInt = getInputInt;
1
+ "use strict";
2
+ // Both the Inquirer.js library and the Prompts library have a bug where text is duplicated in a Git
3
+ // Bash terminal. Thus, we revert to using the simpler Prompt library.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getInputInt = exports.getInputString = exports.getInputYesNo = exports.promptInit = void 0;
6
+ const tslib_1 = require("tslib");
7
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
+ const prompt_1 = tslib_1.__importDefault(require("prompt"));
9
+ const utils_1 = require("./utils");
10
+ const VALID_YES_RESPONSES = new Set(["yes", "ye", "y"]);
11
+ const VALID_NO_RESPONSES = new Set(["no", "n"]);
12
+ function promptInit() {
13
+ // Override some of the prompt library's default values:
14
+ // https://github.com/flatiron/prompt#customizing-your-prompt
15
+ prompt_1.default.message = chalk_1.default.green("?");
16
+ prompt_1.default.delimiter = " ";
17
+ prompt_1.default.colors = false;
18
+ }
19
+ exports.promptInit = promptInit;
20
+ async function getInputYesNo(msg, defaultValue = true) {
21
+ prompt_1.default.start();
22
+ // Capitalize the letter that represents the default option.
23
+ const y = defaultValue ? "Y" : "y";
24
+ const n = defaultValue ? "n" : "N";
25
+ const questionSuffix = `(${y}\\${n})`;
26
+ const description = `${chalk_1.default.bold(msg)} ${chalk_1.default.gray(questionSuffix)}`;
27
+ const { response } = await prompt_1.default.get({
28
+ properties: {
29
+ response: {
30
+ type: "string",
31
+ description,
32
+ },
33
+ },
34
+ });
35
+ if (typeof response !== "string") {
36
+ console.log(typeof response);
37
+ (0, utils_1.error)("Failed to get a proper response from the prompt library.");
38
+ }
39
+ const cleanedResponse = response.toLowerCase().trim();
40
+ // Default to true.
41
+ if (cleanedResponse === "") {
42
+ return defaultValue;
43
+ }
44
+ if (VALID_YES_RESPONSES.has(cleanedResponse)) {
45
+ return true;
46
+ }
47
+ if (VALID_NO_RESPONSES.has(cleanedResponse)) {
48
+ return false;
49
+ }
50
+ return (0, utils_1.error)('Invalid response; must answer "yes" or "no".');
51
+ }
52
+ exports.getInputYesNo = getInputYesNo;
53
+ /** Returns trimmed input. */
54
+ async function getInputString(msg, defaultValue) {
55
+ prompt_1.default.start();
56
+ let description = `${chalk_1.default.bold(msg)}`;
57
+ if (defaultValue !== undefined) {
58
+ description += ` ${chalk_1.default.gray(`(${defaultValue})`)}`;
59
+ }
60
+ const { response } = await prompt_1.default.get({
61
+ properties: {
62
+ response: {
63
+ type: "string",
64
+ description,
65
+ },
66
+ },
67
+ });
68
+ if (typeof response !== "string") {
69
+ (0, utils_1.error)("Failed to get a proper response from the prompt library.");
70
+ }
71
+ if (response === "" && defaultValue !== undefined) {
72
+ return defaultValue;
73
+ }
74
+ return response.trim();
75
+ }
76
+ exports.getInputString = getInputString;
77
+ async function getInputInt(msg, defaultValue = 1) {
78
+ const defaultValueString = defaultValue.toString();
79
+ const string = await getInputString(msg, defaultValueString);
80
+ const int = (0, utils_1.parseIntSafe)(string);
81
+ if (Number.isNaN(int)) {
82
+ (0, utils_1.error)("Error: You must enter an integer.");
83
+ }
84
+ return int;
85
+ }
86
+ exports.getInputInt = getInputInt;
93
87
  //# sourceMappingURL=prompt.js.map
package/src/prompt.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../packages/isaacscript-cli/src/prompt.ts"],"names":[],"mappings":";AAAA,oGAAoG;AACpG,sEAAsE;;;;AAEtE,0DAA0B;AAC1B,4DAA4B;AAC5B,mCAA8C;AAE9C,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACxD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AAEhD,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,KAAK,EAAE,IAAI,YAAY,KAAK,SAAS,EAAE;QACjD,OAAO,YAAY,CAAC;KACrB;IAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC;AA7BD,wCA6BC;AAEM,KAAK,UAAU,WAAW,CAC/B,GAAW,EACX,YAAY,GAAG,CAAC;IAEhB,MAAM,kBAAkB,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IACnD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,IAAA,oBAAY,EAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACrB,IAAA,aAAK,EAAC,mCAAmC,CAAC,CAAC;KAC5C;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAbD,kCAaC"}
@@ -1,5 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_COMMAND = void 0;
4
- exports.DEFAULT_COMMAND = "monitor";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_COMMAND = void 0;
4
+ exports.DEFAULT_COMMAND = "monitor";
5
5
  //# sourceMappingURL=Command.js.map
@@ -1,13 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Config = void 0;
4
- class Config {
5
- constructor() {
6
- /** The "mods" directory that lives next to the "isaac-ng.exe" program. */
7
- this.modsDirectory = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\mods";
8
- /** The save slot that you test your mod on. */
9
- this.saveSlot = 1;
10
- }
11
- }
12
- exports.Config = Config;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Config = void 0;
4
+ class Config {
5
+ constructor() {
6
+ /** The "mods" directory that lives next to the "isaac-ng.exe" program. */
7
+ this.modsDirectory = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\mods";
8
+ /** The save slot that you test your mod on. */
9
+ this.saveSlot = 1;
10
+ }
11
+ }
12
+ exports.Config = Config;
13
13
  //# sourceMappingURL=Config.js.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=GitHubCLIHostsYAML.js.map
package/src/utils.js CHANGED
@@ -1,82 +1,82 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseSemVer = exports.parseIntSafe = exports.isKebabCase = exports.hasWhiteSpace = exports.getTime = exports.getModTargetDirectoryName = exports.error = exports.ensureAllCases = void 0;
4
- const tslib_1 = require("tslib");
5
- const moment_1 = tslib_1.__importDefault(require("moment"));
6
- const constants_1 = require("./constants");
7
- /** From: https://github.com/expandjs/expandjs/blob/master/lib/kebabCaseRegex.js */
8
- const KEBAB_CASE_REGEX = /^([a-z](?![\d])|[\d](?![a-z]))+(-?([a-z](?![\d])|[\d](?![a-z])))*$|^$/;
9
- const ensureAllCases = (obj) => obj;
10
- exports.ensureAllCases = ensureAllCases;
11
- function error(...args) {
12
- console.error(...args);
13
- process.exit(1);
14
- }
15
- exports.error = error;
16
- function getModTargetDirectoryName(config) {
17
- return config.customTargetModDirectoryName === undefined
18
- ? constants_1.CURRENT_DIRECTORY_NAME
19
- : config.customTargetModDirectoryName;
20
- }
21
- exports.getModTargetDirectoryName = getModTargetDirectoryName;
22
- function getTime() {
23
- return (0, moment_1.default)().format("h:mm:ss A"); // e.g. "1:23:45 AM"
24
- }
25
- exports.getTime = getTime;
26
- // From: https://stackoverflow.com/questions/1731190/check-if-a-string-has-white-space
27
- function hasWhiteSpace(s) {
28
- return /\s/g.test(s);
29
- }
30
- exports.hasWhiteSpace = hasWhiteSpace;
31
- function isKebabCase(s) {
32
- return KEBAB_CASE_REGEX.test(s);
33
- }
34
- exports.isKebabCase = isKebabCase;
35
- /**
36
- * `parseIntSafe` is a more reliable version of `parseInt`. By default, `parseInt('1a')` will return
37
- * "1", which is unexpected. This returns either an integer or NaN.
38
- */
39
- function parseIntSafe(input) {
40
- if (typeof input !== "string") {
41
- return NaN;
42
- }
43
- // Remove all leading and trailing whitespace.
44
- let trimmedInput = input.trim();
45
- const isNegativeNumber = trimmedInput.startsWith("-");
46
- if (isNegativeNumber) {
47
- // Remove the leading minus sign before we match the regular expression.
48
- trimmedInput = trimmedInput.substring(1);
49
- }
50
- // "\d" matches any digit (same as "[0-9]").
51
- if (/^\d+$/.exec(trimmedInput) === null) {
52
- return NaN;
53
- }
54
- if (isNegativeNumber) {
55
- // Add the leading minus sign back.
56
- trimmedInput = `-${trimmedInput}`;
57
- }
58
- return parseInt(trimmedInput, 10);
59
- }
60
- exports.parseIntSafe = parseIntSafe;
61
- function parseSemVer(versionString) {
62
- const match = versionString.match(/^v*(\d+)\.(\d+)\.(\d+)/);
63
- if (match === null) {
64
- error(`Failed to parse the version string of: ${versionString}`);
65
- }
66
- const [, majorVersionString, minorVersionString, patchVersionString] = match;
67
- const majorVersion = parseIntSafe(majorVersionString);
68
- if (Number.isNaN(majorVersion)) {
69
- error(`Failed to parse the major version number from: ${versionString}`);
70
- }
71
- const minorVersion = parseIntSafe(minorVersionString);
72
- if (Number.isNaN(minorVersion)) {
73
- error(`Failed to parse the minor version number from: ${versionString}`);
74
- }
75
- const patchVersion = parseIntSafe(patchVersionString);
76
- if (Number.isNaN(patchVersion)) {
77
- error(`Failed to parse the patch version number from: ${versionString}`);
78
- }
79
- return [majorVersion, minorVersion, patchVersion];
80
- }
81
- exports.parseSemVer = parseSemVer;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseSemVer = exports.parseIntSafe = exports.isKebabCase = exports.hasWhiteSpace = exports.getTime = exports.getModTargetDirectoryName = exports.error = exports.ensureAllCases = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const moment_1 = tslib_1.__importDefault(require("moment"));
6
+ const constants_1 = require("./constants");
7
+ /** From: https://github.com/expandjs/expandjs/blob/master/lib/kebabCaseRegex.js */
8
+ const KEBAB_CASE_REGEX = /^([a-z](?![\d])|[\d](?![a-z]))+(-?([a-z](?![\d])|[\d](?![a-z])))*$|^$/;
9
+ const ensureAllCases = (obj) => obj;
10
+ exports.ensureAllCases = ensureAllCases;
11
+ function error(...args) {
12
+ console.error(...args);
13
+ process.exit(1);
14
+ }
15
+ exports.error = error;
16
+ function getModTargetDirectoryName(config) {
17
+ return config.customTargetModDirectoryName === undefined
18
+ ? constants_1.CURRENT_DIRECTORY_NAME
19
+ : config.customTargetModDirectoryName;
20
+ }
21
+ exports.getModTargetDirectoryName = getModTargetDirectoryName;
22
+ function getTime() {
23
+ return (0, moment_1.default)().format("h:mm:ss A"); // e.g. "1:23:45 AM"
24
+ }
25
+ exports.getTime = getTime;
26
+ // From: https://stackoverflow.com/questions/1731190/check-if-a-string-has-white-space
27
+ function hasWhiteSpace(s) {
28
+ return /\s/g.test(s);
29
+ }
30
+ exports.hasWhiteSpace = hasWhiteSpace;
31
+ function isKebabCase(s) {
32
+ return KEBAB_CASE_REGEX.test(s);
33
+ }
34
+ exports.isKebabCase = isKebabCase;
35
+ /**
36
+ * `parseIntSafe` is a more reliable version of `parseInt`. By default, `parseInt('1a')` will return
37
+ * "1", which is unexpected. This returns either an integer or NaN.
38
+ */
39
+ function parseIntSafe(input) {
40
+ if (typeof input !== "string") {
41
+ return NaN;
42
+ }
43
+ // Remove all leading and trailing whitespace.
44
+ let trimmedInput = input.trim();
45
+ const isNegativeNumber = trimmedInput.startsWith("-");
46
+ if (isNegativeNumber) {
47
+ // Remove the leading minus sign before we match the regular expression.
48
+ trimmedInput = trimmedInput.substring(1);
49
+ }
50
+ // "\d" matches any digit (same as "[0-9]").
51
+ if (/^\d+$/.exec(trimmedInput) === null) {
52
+ return NaN;
53
+ }
54
+ if (isNegativeNumber) {
55
+ // Add the leading minus sign back.
56
+ trimmedInput = `-${trimmedInput}`;
57
+ }
58
+ return parseInt(trimmedInput, 10);
59
+ }
60
+ exports.parseIntSafe = parseIntSafe;
61
+ function parseSemVer(versionString) {
62
+ const match = versionString.match(/^v*(\d+)\.(\d+)\.(\d+)/);
63
+ if (match === null) {
64
+ error(`Failed to parse the version string of: ${versionString}`);
65
+ }
66
+ const [, majorVersionString, minorVersionString, patchVersionString] = match;
67
+ const majorVersion = parseIntSafe(majorVersionString);
68
+ if (Number.isNaN(majorVersion)) {
69
+ error(`Failed to parse the major version number from: ${versionString}`);
70
+ }
71
+ const minorVersion = parseIntSafe(minorVersionString);
72
+ if (Number.isNaN(minorVersion)) {
73
+ error(`Failed to parse the minor version number from: ${versionString}`);
74
+ }
75
+ const patchVersion = parseIntSafe(patchVersionString);
76
+ if (Number.isNaN(patchVersion)) {
77
+ error(`Failed to parse the patch version number from: ${versionString}`);
78
+ }
79
+ return [majorVersion, minorVersion, patchVersion];
80
+ }
81
+ exports.parseSemVer = parseSemVer;
82
82
  //# sourceMappingURL=utils.js.map