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,70 +1,66 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.init = 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 constants_1 = require("../../constants");
9
- const checkIfProjectPathExists_1 = require("./checkIfProjectPathExists");
10
- const checkModSubdirectory_1 = require("./checkModSubdirectory");
11
- const checkModTargetDirectory_1 = require("./checkModTargetDirectory");
12
- const createMod_1 = require("./createMod");
13
- const getModsDir_1 = require("./getModsDir");
14
- const getProjectPath_1 = require("./getProjectPath");
15
- const git_1 = require("./git");
16
- const installVSCodeExtensions_1 = require("./installVSCodeExtensions");
17
- const promptSaveSlot_1 = require("./promptSaveSlot");
18
- const promptVSCode_1 = require("./promptVSCode");
19
- function init(argv) {
20
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
21
- const skipNPMInstall = argv["skipNpmInstall"] === true;
22
- const useCurrentDir = argv["useCurrentDir"] === true;
23
- const verbose = argv["verbose"] === true;
24
- const vscode = argv["vscode"] === true;
25
- const yes = argv["yes"] === true;
26
- const forceName = argv["forceName"] === true;
27
- // Prompt the end-user for some information (and validate it as we go).
28
- const [projectPath, createNewDir] = yield (0, getProjectPath_1.getProjectPath)(argv, useCurrentDir, yes, forceName);
29
- yield (0, checkIfProjectPathExists_1.checkIfProjectPathExists)(projectPath, yes, verbose);
30
- const modsDirectory = yield (0, getModsDir_1.getModsDir)(argv, verbose);
31
- (0, checkModSubdirectory_1.checkModSubdirectory)(projectPath, modsDirectory);
32
- const projectName = path_1.default.basename(projectPath);
33
- yield (0, checkModTargetDirectory_1.checkModTargetDirectory)(modsDirectory, projectName, yes, verbose);
34
- const saveSlot = yield (0, promptSaveSlot_1.promptSaveSlot)(argv, yes);
35
- const gitRemoteURL = yield (0, git_1.promptGitHubRepoOrGitRemoteURL)(projectName, yes, verbose);
36
- // Now that we have asked the user all of the questions we need, we can create the project.
37
- (0, createMod_1.createMod)(projectName, projectPath, createNewDir, modsDirectory, saveSlot, gitRemoteURL, skipNPMInstall, verbose);
38
- yield openVSCode(projectPath, vscode, verbose);
39
- printFinishMessage(projectPath, projectName);
40
- });
41
- }
42
- exports.init = init;
43
- function openVSCode(projectPath, vscode, verbose) {
44
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
45
- const VSCodeCommand = getVSCodeCommand();
46
- if (VSCodeCommand === null) {
47
- console.log('VSCode does not seem to be installed. (The "code" command is not in the path.) Skipping VSCode-related things.');
48
- return;
49
- }
50
- (0, installVSCodeExtensions_1.installVSCodeExtensions)(projectPath, VSCodeCommand, verbose);
51
- yield (0, promptVSCode_1.promptVSCode)(projectPath, VSCodeCommand, vscode, verbose);
52
- });
53
- }
54
- function getVSCodeCommand() {
55
- for (const VSCodeCommand of ["code", "codium", "code-oss", "code-insiders"]) {
56
- if (command_exists_1.default.sync(VSCodeCommand)) {
57
- return VSCodeCommand;
58
- }
59
- }
60
- return null;
61
- }
62
- function printFinishMessage(projectPath, projectName) {
63
- let commandsToType = "";
64
- if (projectPath !== constants_1.CWD) {
65
- commandsToType += `"${chalk_1.default.green(`cd ${projectName}`)}" and `;
66
- }
67
- commandsToType += `"${chalk_1.default.green("npx isaacscript")}"`;
68
- console.log(`Now, start ${constants_1.PROJECT_NAME} by typing ${commandsToType}.`);
69
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.init = 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 constants_1 = require("../../constants");
9
+ const checkIfProjectPathExists_1 = require("./checkIfProjectPathExists");
10
+ const checkModSubdirectory_1 = require("./checkModSubdirectory");
11
+ const checkModTargetDirectory_1 = require("./checkModTargetDirectory");
12
+ const createMod_1 = require("./createMod");
13
+ const getModsDir_1 = require("./getModsDir");
14
+ const getProjectPath_1 = require("./getProjectPath");
15
+ const git_1 = require("./git");
16
+ const installVSCodeExtensions_1 = require("./installVSCodeExtensions");
17
+ const promptSaveSlot_1 = require("./promptSaveSlot");
18
+ const promptVSCode_1 = require("./promptVSCode");
19
+ async function init(argv) {
20
+ const skipNPMInstall = argv["skipNpmInstall"] === true;
21
+ const useCurrentDir = argv["useCurrentDir"] === true;
22
+ const verbose = argv["verbose"] === true;
23
+ const vscode = argv["vscode"] === true;
24
+ const yes = argv["yes"] === true;
25
+ const forceName = argv["forceName"] === true;
26
+ // Prompt the end-user for some information (and validate it as we go).
27
+ const [projectPath, createNewDir] = await (0, getProjectPath_1.getProjectPath)(argv, useCurrentDir, yes, forceName);
28
+ await (0, checkIfProjectPathExists_1.checkIfProjectPathExists)(projectPath, yes, verbose);
29
+ const modsDirectory = await (0, getModsDir_1.getModsDir)(argv, verbose);
30
+ (0, checkModSubdirectory_1.checkModSubdirectory)(projectPath, modsDirectory);
31
+ const projectName = path_1.default.basename(projectPath);
32
+ await (0, checkModTargetDirectory_1.checkModTargetDirectory)(modsDirectory, projectName, yes, verbose);
33
+ const saveSlot = await (0, promptSaveSlot_1.promptSaveSlot)(argv, yes);
34
+ const gitRemoteURL = await (0, git_1.promptGitHubRepoOrGitRemoteURL)(projectName, yes, verbose);
35
+ // Now that we have asked the user all of the questions we need, we can create the project.
36
+ (0, createMod_1.createMod)(projectName, projectPath, createNewDir, modsDirectory, saveSlot, gitRemoteURL, skipNPMInstall, verbose);
37
+ await openVSCode(projectPath, vscode, verbose);
38
+ printFinishMessage(projectPath, projectName);
39
+ }
40
+ exports.init = init;
41
+ async function openVSCode(projectPath, vscode, verbose) {
42
+ const VSCodeCommand = getVSCodeCommand();
43
+ if (VSCodeCommand === null) {
44
+ console.log('VSCode does not seem to be installed. (The "code" command is not in the path.) Skipping VSCode-related things.');
45
+ return;
46
+ }
47
+ (0, installVSCodeExtensions_1.installVSCodeExtensions)(projectPath, VSCodeCommand, verbose);
48
+ await (0, promptVSCode_1.promptVSCode)(projectPath, VSCodeCommand, vscode, verbose);
49
+ }
50
+ function getVSCodeCommand() {
51
+ for (const VSCodeCommand of ["code", "codium", "code-oss", "code-insiders"]) {
52
+ if (command_exists_1.default.sync(VSCodeCommand)) {
53
+ return VSCodeCommand;
54
+ }
55
+ }
56
+ return null;
57
+ }
58
+ function printFinishMessage(projectPath, projectName) {
59
+ let commandsToType = "";
60
+ if (projectPath !== constants_1.CWD) {
61
+ commandsToType += `"${chalk_1.default.green(`cd ${projectName}`)}" and `;
62
+ }
63
+ commandsToType += `"${chalk_1.default.green("npx isaacscript")}"`;
64
+ console.log(`Now, start ${constants_1.PROJECT_NAME} by typing ${commandsToType}.`);
65
+ }
70
66
  //# sourceMappingURL=init.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/init.ts"],"names":[],"mappings":";;;;AAAA,0DAA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BAAiB,CAAC,GAAG,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,cAAc,wBAAY,cAAc,cAAc,GAAG,CAAC,CAAC;AACzE,CAAC"}
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/init.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,4EAA2C;AAC3C,wDAAwB;AACxB,+CAAoD;AACpD,yEAAsE;AACtE,iEAA8D;AAC9D,uEAAoE;AACpE,2CAAwC;AACxC,6CAA0C;AAC1C,qDAAkD;AAClD,+BAAuD;AACvD,uEAAoE;AACpE,qDAAkD;AAClD,iDAA8C;AAEvC,KAAK,UAAU,IAAI,CAAC,IAA6B;IACtD,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACvD,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IACzC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IACvC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACjC,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAE7C,uEAAuE;IACvE,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,GAAG,MAAM,IAAA,+BAAc,EACtD,IAAI,EACJ,aAAa,EACb,GAAG,EACH,SAAS,CACV,CAAC;IACF,MAAM,IAAA,mDAAwB,EAAC,WAAW,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1D,MAAM,aAAa,GAAG,MAAM,IAAA,uBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtD,IAAA,2CAAoB,EAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,cAAI,C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IAClE,IAAI,cAAc,GAAG,EAAE,CAAC;IACxB,IAAI,WAAW,KAAK,eAAG,EAAE;QACvB,cAAc,IAAI,IAAI,eAAK,CAAC,KAAK,CAAC,MAAM,WAAW,EAAE,CAAC,QAAQ,CAAC;KAChE;IACD,cAAc,IAAI,IAAI,eAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,cAAc,wBAAY,cAAc,cAAc,GAAG,CAAC,CAAC;AACzE,CAAC"}
@@ -1,33 +1,33 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installVSCodeExtensions = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const JSONC = tslib_1.__importStar(require("jsonc-parser"));
7
- const path_1 = tslib_1.__importDefault(require("path"));
8
- const exec_1 = require("../../exec");
9
- const file = tslib_1.__importStar(require("../../file"));
10
- const utils_1 = require("../../utils");
11
- function installVSCodeExtensions(projectPath, VSCodeCommand, verbose) {
12
- const extensions = getExtensionsFromJSON(projectPath, verbose);
13
- for (const extensionName of extensions) {
14
- (0, exec_1.execShell)(VSCodeCommand, ["--install-extension", extensionName], verbose);
15
- }
16
- }
17
- exports.installVSCodeExtensions = installVSCodeExtensions;
18
- function getExtensionsFromJSON(projectPath, verbose) {
19
- const extensionsJSONPath = path_1.default.join(projectPath, ".vscode", "extensions.json");
20
- if (!file.exists(extensionsJSONPath, verbose)) {
21
- return [];
22
- }
23
- const extensionsJSONRaw = file.read(extensionsJSONPath, verbose);
24
- let extensionsJSON;
25
- try {
26
- extensionsJSON = JSONC.parse(extensionsJSONRaw);
27
- }
28
- catch (err) {
29
- (0, utils_1.error)(`Failed to parse the "${chalk_1.default.green(extensionsJSONPath)}" file:`, err);
30
- }
31
- return extensionsJSON.recommendations;
32
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.installVSCodeExtensions = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const JSONC = tslib_1.__importStar(require("jsonc-parser"));
7
+ const path_1 = tslib_1.__importDefault(require("path"));
8
+ const exec_1 = require("../../exec");
9
+ const file = tslib_1.__importStar(require("../../file"));
10
+ const utils_1 = require("../../utils");
11
+ function installVSCodeExtensions(projectPath, VSCodeCommand, verbose) {
12
+ const extensions = getExtensionsFromJSON(projectPath, verbose);
13
+ for (const extensionName of extensions) {
14
+ (0, exec_1.execShell)(VSCodeCommand, ["--install-extension", extensionName], verbose);
15
+ }
16
+ }
17
+ exports.installVSCodeExtensions = installVSCodeExtensions;
18
+ function getExtensionsFromJSON(projectPath, verbose) {
19
+ const extensionsJSONPath = path_1.default.join(projectPath, ".vscode", "extensions.json");
20
+ if (!file.exists(extensionsJSONPath, verbose)) {
21
+ return [];
22
+ }
23
+ const extensionsJSONRaw = file.read(extensionsJSONPath, verbose);
24
+ let extensionsJSON;
25
+ try {
26
+ extensionsJSON = JSONC.parse(extensionsJSONRaw);
27
+ }
28
+ catch (err) {
29
+ (0, utils_1.error)(`Failed to parse the "${chalk_1.default.green(extensionsJSONPath)}" file:`, err);
30
+ }
31
+ return extensionsJSON.recommendations;
32
+ }
33
33
  //# sourceMappingURL=installVSCodeExtensions.js.map
@@ -1,25 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptSaveSlot = void 0;
4
- const tslib_1 = require("tslib");
5
- const prompt_1 = require("../../prompt");
6
- const utils_1 = require("../../utils");
7
- function promptSaveSlot(argv, yes) {
8
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
- if (argv["saveSlot"] !== undefined) {
10
- // They specified the "--save-slot" command-line flag, so there is no need to prompt the user
11
- // for it.
12
- return argv["saveSlot"]; // yargs converts this to a number
13
- }
14
- if (yes) {
15
- return 1;
16
- }
17
- const saveSlot = yield (0, prompt_1.getInputInt)("In-game, will you test your mod on save slot 1, 2, or 3?");
18
- if (saveSlot !== 1 && saveSlot !== 2 && saveSlot !== 3) {
19
- (0, utils_1.error)("Error: You must choose a number between 1 and 3.");
20
- }
21
- return saveSlot;
22
- });
23
- }
24
- exports.promptSaveSlot = promptSaveSlot;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.promptSaveSlot = void 0;
4
+ const prompt_1 = require("../../prompt");
5
+ const utils_1 = require("../../utils");
6
+ async function promptSaveSlot(argv, yes) {
7
+ if (argv["saveSlot"] !== undefined) {
8
+ // They specified the "--save-slot" command-line flag, so there is no need to prompt the user
9
+ // for it.
10
+ return argv["saveSlot"]; // yargs converts this to a number
11
+ }
12
+ if (yes) {
13
+ return 1;
14
+ }
15
+ const saveSlot = await (0, prompt_1.getInputInt)("In-game, will you test your mod on save slot 1, 2, or 3?");
16
+ if (saveSlot !== 1 && saveSlot !== 2 && saveSlot !== 3) {
17
+ (0, utils_1.error)("Error: You must choose a number between 1 and 3.");
18
+ }
19
+ return saveSlot;
20
+ }
21
+ exports.promptSaveSlot = promptSaveSlot;
25
22
  //# sourceMappingURL=promptSaveSlot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"promptSaveSlot.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/promptSaveSlot.ts"],"names":[],"mappings":";;;;AAAA,yCAA2C;AAC3C,uCAAoC;AAEpC,SAAsB,cAAc,CAClC,IAA6B,EAC7B,GAAY;;QAEZ,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;YAClC,6FAA6F;YAC7F,UAAU;YACV,OAAO,IAAI,CAAC,UAAU,CAAW,CAAC,CAAC,kCAAkC;SACtE;QAED,IAAI,GAAG,EAAE;YACP,OAAO,CAAC,CAAC;SACV;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,0DAA0D,CAC3D,CAAC;QAEF,IAAI,QAAQ,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,EAAE;YACtD,IAAA,aAAK,EAAC,kDAAkD,CAAC,CAAC;SAC3D;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AAvBD,wCAuBC"}
1
+ {"version":3,"file":"promptSaveSlot.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/promptSaveSlot.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,uCAAoC;AAE7B,KAAK,UAAU,cAAc,CAClC,IAA6B,EAC7B,GAAY;IAEZ,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;QAClC,6FAA6F;QAC7F,UAAU;QACV,OAAO,IAAI,CAAC,UAAU,CAAW,CAAC,CAAC,kCAAkC;KACtE;IAED,IAAI,GAAG,EAAE;QACP,OAAO,CAAC,CAAC;KACV;IAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,0DAA0D,CAC3D,CAAC;IAEF,IAAI,QAAQ,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,EAAE;QACtD,IAAA,aAAK,EAAC,kDAAkD,CAAC,CAAC;KAC3D;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAvBD,wCAuBC"}
@@ -1,27 +1,25 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptVSCode = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- const constants_1 = require("../../constants");
7
- const exec_1 = require("../../exec");
8
- const prompt_1 = require("../../prompt");
9
- function promptVSCode(projectPath, VSCodeCommand, vscode, verbose) {
10
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
- if (vscode) {
12
- // They supplied the "--vscode" command-line flag, so there is no need to prompt the user.
13
- openVSCode(projectPath, VSCodeCommand, verbose);
14
- return;
15
- }
16
- const shouldOpenVSCode = yield (0, prompt_1.getInputYesNo)("Do you want to open your new project in VSCode now?");
17
- if (shouldOpenVSCode) {
18
- openVSCode(projectPath, VSCodeCommand, verbose);
19
- }
20
- });
21
- }
22
- exports.promptVSCode = promptVSCode;
23
- function openVSCode(projectPath, VSCodeCommand, verbose) {
24
- const MAIN_TS_PATH = path_1.default.join(projectPath, "src", constants_1.MAIN_TS);
25
- (0, exec_1.execShell)(VSCodeCommand, [projectPath, MAIN_TS_PATH], verbose);
26
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.promptVSCode = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const path_1 = tslib_1.__importDefault(require("path"));
6
+ const constants_1 = require("../../constants");
7
+ const exec_1 = require("../../exec");
8
+ const prompt_1 = require("../../prompt");
9
+ async function promptVSCode(projectPath, VSCodeCommand, vscode, verbose) {
10
+ if (vscode) {
11
+ // They supplied the "--vscode" command-line flag, so there is no need to prompt the user.
12
+ openVSCode(projectPath, VSCodeCommand, verbose);
13
+ return;
14
+ }
15
+ const shouldOpenVSCode = await (0, prompt_1.getInputYesNo)("Do you want to open your new project in VSCode now?");
16
+ if (shouldOpenVSCode) {
17
+ openVSCode(projectPath, VSCodeCommand, verbose);
18
+ }
19
+ }
20
+ exports.promptVSCode = promptVSCode;
21
+ function openVSCode(projectPath, VSCodeCommand, verbose) {
22
+ const MAIN_TS_PATH = path_1.default.join(projectPath, "src", constants_1.MAIN_TS);
23
+ (0, exec_1.execShell)(VSCodeCommand, [projectPath, MAIN_TS_PATH], verbose);
24
+ }
27
25
  //# sourceMappingURL=promptVSCode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"promptVSCode.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/promptVSCode.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AACxB,+CAA0C;AAC1C,qCAAuC;AACvC,yCAA6C;AAE7C,SAAsB,YAAY,CAChC,WAAmB,EACnB,aAAqB,EACrB,MAAe,EACf,OAAgB;;QAEhB,IAAI,MAAM,EAAE;YACV,0FAA0F;YAC1F,UAAU,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;YAChD,OAAO;SACR;QAED,MAAM,gBAAgB,GAAG,MAAM,IAAA,sBAAa,EAC1C,qDAAqD,CACtD,CAAC;QACF,IAAI,gBAAgB,EAAE;YACpB,UAAU,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;SACjD;IACH,CAAC;CAAA;AAlBD,oCAkBC;AAED,SAAS,UAAU,CACjB,WAAmB,EACnB,aAAqB,EACrB,OAAgB;IAEhB,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,mBAAO,CAAC,CAAC;IAC5D,IAAA,gBAAS,EAAC,aAAa,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC"}
1
+ {"version":3,"file":"promptVSCode.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/promptVSCode.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AACxB,+CAA0C;AAC1C,qCAAuC;AACvC,yCAA6C;AAEtC,KAAK,UAAU,YAAY,CAChC,WAAmB,EACnB,aAAqB,EACrB,MAAe,EACf,OAAgB;IAEhB,IAAI,MAAM,EAAE;QACV,0FAA0F;QAC1F,UAAU,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;QAChD,OAAO;KACR;IAED,MAAM,gBAAgB,GAAG,MAAM,IAAA,sBAAa,EAC1C,qDAAqD,CACtD,CAAC;IACF,IAAI,gBAAgB,EAAE;QACpB,UAAU,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;KACjD;AACH,CAAC;AAlBD,oCAkBC;AAED,SAAS,UAAU,CACjB,WAAmB,EACnB,aAAqB,EACrB,OAAgB;IAEhB,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,mBAAO,CAAC,CAAC;IAC5D,IAAA,gBAAS,EAAC,aAAa,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC"}
@@ -1,5 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMPILATION_SUCCESSFUL = void 0;
4
- exports.COMPILATION_SUCCESSFUL = "Compilation successful.";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.COMPILATION_SUCCESSFUL = void 0;
4
+ exports.COMPILATION_SUCCESSFUL = "Compilation successful.";
5
5
  //# sourceMappingURL=constants.js.map
@@ -1,39 +1,39 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.copyWatcherMod = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- const constants_1 = require("../../constants");
7
- const file = tslib_1.__importStar(require("../../file"));
8
- function copyWatcherMod(config, verbose) {
9
- // Check to see if this mod was disabled.
10
- const watcherModPath = path_1.default.join(config.modsDirectory, constants_1.WATCHER_MOD_NAME);
11
- const disableItPath = path_1.default.join(watcherModPath, constants_1.DISABLE_IT_FILE);
12
- const watcherModDisabled = file.exists(disableItPath, verbose);
13
- // Delete and re-copy the watcher mod every time IsaacScript starts. This ensures that it is
14
- // always the latest version.
15
- if (file.exists(watcherModPath, verbose)) {
16
- file.deleteFileOrDirectory(watcherModPath, verbose);
17
- }
18
- file.copy(constants_1.WATCHER_MOD_SOURCE_PATH, watcherModPath, verbose);
19
- if (watcherModDisabled) {
20
- // Since we deleted the directory, the "disable.it" file was deleted. Restore it.
21
- file.write(disableItPath, "", verbose);
22
- }
23
- // By default, the IsaacScript watcher mod automatically restarts the game, so we only need to
24
- // disable it if the config option is explicitly set to false.
25
- if (config.enableIsaacScriptWatcherAutoRestart === false) {
26
- disableIsaacScriptWatcherAutomaticRestart(watcherModPath, verbose);
27
- }
28
- // If we copied a new version of the watcher mod into place, but the user currently has the game
29
- // open, then the old version will stay loaded. However, if the watcher mod reloads itself, the
30
- // game will crash, so there is no automated solution for this.
31
- }
32
- exports.copyWatcherMod = copyWatcherMod;
33
- function disableIsaacScriptWatcherAutomaticRestart(watcherModPath, verbose) {
34
- const mainLuaPath = path_1.default.join(watcherModPath, constants_1.MAIN_LUA);
35
- const mainLua = file.read(mainLuaPath, verbose);
36
- const modifiedMainLua = mainLua.replace("local RESTART_GAME_ON_RECOMPILATION = true", "local RESTART_GAME_ON_RECOMPILATION = false");
37
- file.write(mainLuaPath, modifiedMainLua, verbose);
38
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.copyWatcherMod = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const path_1 = tslib_1.__importDefault(require("path"));
6
+ const constants_1 = require("../../constants");
7
+ const file = tslib_1.__importStar(require("../../file"));
8
+ function copyWatcherMod(config, verbose) {
9
+ // Check to see if this mod was disabled.
10
+ const watcherModPath = path_1.default.join(config.modsDirectory, constants_1.WATCHER_MOD_NAME);
11
+ const disableItPath = path_1.default.join(watcherModPath, constants_1.DISABLE_IT_FILE);
12
+ const watcherModDisabled = file.exists(disableItPath, verbose);
13
+ // Delete and re-copy the watcher mod every time IsaacScript starts. This ensures that it is
14
+ // always the latest version.
15
+ if (file.exists(watcherModPath, verbose)) {
16
+ file.deleteFileOrDirectory(watcherModPath, verbose);
17
+ }
18
+ file.copy(constants_1.WATCHER_MOD_SOURCE_PATH, watcherModPath, verbose);
19
+ if (watcherModDisabled) {
20
+ // Since we deleted the directory, the "disable.it" file was deleted. Restore it.
21
+ file.write(disableItPath, "", verbose);
22
+ }
23
+ // By default, the IsaacScript watcher mod automatically restarts the game, so we only need to
24
+ // disable it if the config option is explicitly set to false.
25
+ if (config.enableIsaacScriptWatcherAutoRestart === false) {
26
+ disableIsaacScriptWatcherAutomaticRestart(watcherModPath, verbose);
27
+ }
28
+ // If we copied a new version of the watcher mod into place, but the user currently has the game
29
+ // open, then the old version will stay loaded. However, if the watcher mod reloads itself, the
30
+ // game will crash, so there is no automated solution for this.
31
+ }
32
+ exports.copyWatcherMod = copyWatcherMod;
33
+ function disableIsaacScriptWatcherAutomaticRestart(watcherModPath, verbose) {
34
+ const mainLuaPath = path_1.default.join(watcherModPath, constants_1.MAIN_LUA);
35
+ const mainLua = file.read(mainLuaPath, verbose);
36
+ const modifiedMainLua = mainLua.replace("local RESTART_GAME_ON_RECOMPILATION = true", "local RESTART_GAME_ON_RECOMPILATION = false");
37
+ file.write(mainLuaPath, modifiedMainLua, verbose);
38
+ }
39
39
  //# sourceMappingURL=copyWatcherMod.js.map
@@ -1,50 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const sync_directory_1 = tslib_1.__importDefault(require("sync-directory"));
5
- const constants_1 = require("../../../constants");
6
- const SUBPROCESS_NAME = "directory syncer";
7
- const BASE_ARGV_LENGTH = 2;
8
- let modSourcePath;
9
- let modTargetPath;
10
- init();
11
- function init() {
12
- const firstArg = process.argv[BASE_ARGV_LENGTH];
13
- if (firstArg === undefined) {
14
- throw new Error(`The ${SUBPROCESS_NAME} process did not get a valid first argument.`);
15
- }
16
- const secondArg = process.argv[BASE_ARGV_LENGTH + 1];
17
- if (secondArg === undefined) {
18
- throw new Error(`The ${SUBPROCESS_NAME} process did not get the right amount of arguments.`);
19
- }
20
- modSourcePath = firstArg;
21
- modTargetPath = secondArg;
22
- (0, sync_directory_1.default)(modSourcePath, modTargetPath, {
23
- watch: true,
24
- type: "copy",
25
- afterEachSync,
26
- onError,
27
- chokidarWatchOptions: {
28
- awaitWriteFinish: {
29
- stabilityThreshold: 1000,
30
- },
31
- },
32
- });
33
- }
34
- function afterEachSync(params) {
35
- if (params === undefined) {
36
- return;
37
- }
38
- if (params.eventType !== "init:copy") {
39
- send(`${constants_1.FILE_SYNCED_MESSAGE} ${params.relativePath}`);
40
- }
41
- }
42
- function onError(err) {
43
- send(`The directory syncer encountered an error: ${err}`);
44
- }
45
- function send(msg) {
46
- if (process.send !== undefined) {
47
- process.send(msg);
48
- }
49
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const sync_directory_1 = tslib_1.__importDefault(require("sync-directory"));
5
+ const constants_1 = require("../../../constants");
6
+ const SUBPROCESS_NAME = "directory syncer";
7
+ const BASE_ARGV_LENGTH = 2;
8
+ let modSourcePath;
9
+ let modTargetPath;
10
+ init();
11
+ function init() {
12
+ const firstArg = process.argv[BASE_ARGV_LENGTH];
13
+ if (firstArg === undefined) {
14
+ throw new Error(`The ${SUBPROCESS_NAME} process did not get a valid first argument.`);
15
+ }
16
+ const secondArg = process.argv[BASE_ARGV_LENGTH + 1];
17
+ if (secondArg === undefined) {
18
+ throw new Error(`The ${SUBPROCESS_NAME} process did not get the right amount of arguments.`);
19
+ }
20
+ modSourcePath = firstArg;
21
+ modTargetPath = secondArg;
22
+ (0, sync_directory_1.default)(modSourcePath, modTargetPath, {
23
+ watch: true,
24
+ type: "copy",
25
+ afterEachSync,
26
+ onError,
27
+ chokidarWatchOptions: {
28
+ awaitWriteFinish: {
29
+ stabilityThreshold: 1000,
30
+ },
31
+ },
32
+ });
33
+ }
34
+ function afterEachSync(params) {
35
+ if (params === undefined) {
36
+ return;
37
+ }
38
+ if (params.eventType !== "init:copy") {
39
+ send(`${constants_1.FILE_SYNCED_MESSAGE} ${params.relativePath}`);
40
+ }
41
+ }
42
+ function onError(err) {
43
+ send(`The directory syncer encountered an error: ${err}`);
44
+ }
45
+ function send(msg) {
46
+ if (process.send !== undefined) {
47
+ process.send(msg);
48
+ }
49
+ }
50
50
  //# sourceMappingURL=modDirectorySyncer.js.map