isaacscript 2.0.11 → 2.0.14-dev.0

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 (137) hide show
  1. package/README.md +8 -4
  2. package/package.json +2 -53
  3. package/src/checkForWindowsTerminalBugs.d.ts +5 -0
  4. package/src/checkForWindowsTerminalBugs.js +80 -0
  5. package/src/checkForWindowsTerminalBugs.js.map +1 -0
  6. package/src/commands/copy/copy.d.ts +3 -0
  7. package/src/commands/copy/copy.js +33 -0
  8. package/src/commands/copy/copy.js.map +1 -0
  9. package/src/commands/init/checkIfProjectPathExists.d.ts +1 -0
  10. package/src/commands/init/checkIfProjectPathExists.js +30 -0
  11. package/src/commands/init/checkIfProjectPathExists.js.map +1 -0
  12. package/src/commands/init/checkModSubdirectory.d.ts +1 -0
  13. package/src/commands/init/checkModSubdirectory.js +16 -0
  14. package/src/commands/init/checkModSubdirectory.js.map +1 -0
  15. package/src/commands/init/checkModTargetDirectory.d.ts +1 -0
  16. package/src/commands/init/checkModTargetDirectory.js +33 -0
  17. package/src/commands/init/checkModTargetDirectory.js.map +1 -0
  18. package/src/commands/init/createMod.d.ts +1 -0
  19. package/{dist/src → src}/commands/init/createMod.js +137 -162
  20. package/src/commands/init/createMod.js.map +1 -0
  21. package/src/commands/init/getModsDir.d.ts +1 -0
  22. package/src/commands/init/getModsDir.js +58 -0
  23. package/src/commands/init/getModsDir.js.map +1 -0
  24. package/src/commands/init/getProjectPath.d.ts +1 -0
  25. package/src/commands/init/getProjectPath.js +93 -0
  26. package/src/commands/init/getProjectPath.js.map +1 -0
  27. package/src/commands/init/git.d.ts +4 -0
  28. package/{dist/src → src}/commands/init/git.js +152 -175
  29. package/src/commands/init/git.js.map +1 -0
  30. package/src/commands/init/init.d.ts +1 -0
  31. package/src/commands/init/init.js +70 -0
  32. package/src/commands/init/init.js.map +1 -0
  33. package/src/commands/init/installVSCodeExtensions.d.ts +1 -0
  34. package/src/commands/init/installVSCodeExtensions.js +33 -0
  35. package/src/commands/init/installVSCodeExtensions.js.map +1 -0
  36. package/src/commands/init/promptSaveSlot.d.ts +1 -0
  37. package/src/commands/init/promptSaveSlot.js +25 -0
  38. package/src/commands/init/promptSaveSlot.js.map +1 -0
  39. package/src/commands/init/promptVSCode.d.ts +1 -0
  40. package/src/commands/init/promptVSCode.js +27 -0
  41. package/src/commands/init/promptVSCode.js.map +1 -0
  42. package/src/commands/monitor/constants.d.ts +1 -0
  43. package/{dist/src → src}/commands/monitor/constants.js +4 -4
  44. package/src/commands/monitor/constants.js.map +1 -0
  45. package/src/commands/monitor/copyWatcherMod.d.ts +2 -0
  46. package/{dist/src → src}/commands/monitor/copyWatcherMod.js +38 -63
  47. package/src/commands/monitor/copyWatcherMod.js.map +1 -0
  48. package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.d.ts +1 -0
  49. package/{dist/src → src}/commands/monitor/modDirectorySyncer/modDirectorySyncer.js +49 -51
  50. package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js.map +1 -0
  51. package/src/commands/monitor/monitor.d.ts +2 -0
  52. package/{dist/src → src}/commands/monitor/monitor.js +146 -171
  53. package/src/commands/monitor/monitor.js.map +1 -0
  54. package/src/commands/monitor/notifyGame.d.ts +3 -0
  55. package/{dist/src → src}/commands/monitor/notifyGame.js +57 -59
  56. package/src/commands/monitor/notifyGame.js.map +1 -0
  57. package/src/commands/monitor/saveDatWriter/saveDatWriter.d.ts +1 -0
  58. package/{dist/src → src}/commands/monitor/saveDatWriter/saveDatWriter.js +116 -141
  59. package/src/commands/monitor/saveDatWriter/saveDatWriter.js.map +1 -0
  60. package/src/commands/monitor/saveDatWriter/types.d.ts +5 -0
  61. package/{dist/src → src}/commands/monitor/saveDatWriter/types.js +2 -2
  62. package/src/commands/monitor/saveDatWriter/types.js.map +1 -0
  63. package/src/commands/monitor/spawnSaveDatWriter.d.ts +4 -0
  64. package/{dist/src → src}/commands/monitor/spawnSaveDatWriter.js +34 -36
  65. package/src/commands/monitor/spawnSaveDatWriter.js.map +1 -0
  66. package/src/commands/monitor/touchWatcherSaveDatFiles.d.ts +2 -0
  67. package/src/commands/monitor/touchWatcherSaveDatFiles.js +21 -0
  68. package/src/commands/monitor/touchWatcherSaveDatFiles.js.map +1 -0
  69. package/src/commands/publish/publish.d.ts +2 -0
  70. package/{dist/src → src}/commands/publish/publish.js +220 -260
  71. package/src/commands/publish/publish.js.map +1 -0
  72. package/src/configFile.d.ts +4 -0
  73. package/src/configFile.js +66 -0
  74. package/src/configFile.js.map +1 -0
  75. package/src/constants.d.ts +34 -0
  76. package/{dist/src → src}/constants.js +59 -61
  77. package/src/constants.js.map +1 -0
  78. package/src/exec.d.ts +4 -0
  79. package/{dist/src → src}/exec.js +95 -97
  80. package/src/exec.js.map +1 -0
  81. package/src/file.d.ts +12 -0
  82. package/{dist/src → src}/file.js +193 -195
  83. package/src/file.js.map +1 -0
  84. package/src/main.d.ts +2 -0
  85. package/src/main.js +122 -0
  86. package/src/main.js.map +1 -0
  87. package/src/parseArgs.d.ts +1 -0
  88. package/{dist/src → src}/parseArgs.js +106 -108
  89. package/src/parseArgs.js.map +1 -0
  90. package/src/prompt.d.ts +5 -0
  91. package/src/prompt.js +93 -0
  92. package/src/prompt.js.map +1 -0
  93. package/src/types/Command.d.ts +2 -0
  94. package/{dist/src → src}/types/Command.js +4 -4
  95. package/src/types/Command.js.map +1 -0
  96. package/src/types/Config.d.ts +18 -0
  97. package/{dist/src → src}/types/Config.js +12 -12
  98. package/src/types/Config.js.map +1 -0
  99. package/src/types/GitHubCLIHostsYAML.d.ts +7 -0
  100. package/{dist/src → src}/types/GitHubCLIHostsYAML.js +2 -2
  101. package/src/types/GitHubCLIHostsYAML.js.map +1 -0
  102. package/src/utils.d.ts +13 -0
  103. package/{dist/src → src}/utils.js +81 -83
  104. package/src/utils.js.map +1 -0
  105. package/src/validateInIsaacScriptProject.d.ts +1 -0
  106. package/src/validateInIsaacScriptProject.js +27 -0
  107. package/src/validateInIsaacScriptProject.js.map +1 -0
  108. package/src/validateNodeVersion.d.ts +5 -0
  109. package/{dist/src → src}/validateNodeVersion.js +24 -26
  110. package/src/validateNodeVersion.js.map +1 -0
  111. package/src/validateOS.d.ts +1 -0
  112. package/{dist/src → src}/validateOS.js +16 -18
  113. package/src/validateOS.js.map +1 -0
  114. package/LICENSE +0 -674
  115. package/dist/package.json +0 -57
  116. package/dist/src/checkForWindowsTerminalBugs.js +0 -101
  117. package/dist/src/commands/copy/copy.js +0 -58
  118. package/dist/src/commands/init/checkIfProjectPathExists.js +0 -53
  119. package/dist/src/commands/init/checkModSubdirectory.js +0 -41
  120. package/dist/src/commands/init/checkModTargetDirectory.js +0 -56
  121. package/dist/src/commands/init/getModsDir.js +0 -81
  122. package/dist/src/commands/init/getProjectPath.js +0 -91
  123. package/dist/src/commands/init/init.js +0 -68
  124. package/dist/src/commands/init/installVSCodeExtensions.js +0 -58
  125. package/dist/src/commands/init/promptSaveSlot.js +0 -22
  126. package/dist/src/commands/init/promptVSCode.js +0 -27
  127. package/dist/src/commands/monitor/touchWatcherSaveDatFiles.js +0 -46
  128. package/dist/src/configFile.js +0 -89
  129. package/dist/src/main.js +0 -136
  130. package/dist/src/prompt.js +0 -89
  131. package/dist/src/validateInIsaacScriptProject.js +0 -52
  132. package/isaacscript-watcher/.luacheckrc +0 -96
  133. package/isaacscript-watcher/README.md +0 -8
  134. package/isaacscript-watcher/main.lua +0 -270
  135. package/isaacscript-watcher/metadata.xml +0 -7
  136. package/isaacscript-watcher/resources/gfx/logo.anm2 +0 -27
  137. package/isaacscript-watcher/resources/gfx/logo.png +0 -0
@@ -1,64 +1,39 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.copyWatcherMod = void 0;
30
- const path_1 = __importDefault(require("path"));
31
- const constants_1 = require("../../constants");
32
- const file = __importStar(require("../../file"));
33
- function copyWatcherMod(config, verbose) {
34
- // Check to see if this mod was disabled.
35
- const watcherModPath = path_1.default.join(config.modsDirectory, constants_1.WATCHER_MOD_NAME);
36
- const disableItPath = path_1.default.join(watcherModPath, constants_1.DISABLE_IT_FILE);
37
- const watcherModDisabled = file.exists(disableItPath, verbose);
38
- // Delete and re-copy the watcher mod every time IsaacScript starts. This ensures that it is
39
- // always the latest version.
40
- if (file.exists(watcherModPath, verbose)) {
41
- file.deleteFileOrDirectory(watcherModPath, verbose);
42
- }
43
- file.copy(constants_1.WATCHER_MOD_SOURCE_PATH, watcherModPath, verbose);
44
- if (watcherModDisabled) {
45
- // Since we deleted the directory, the "disable.it" file was deleted. Restore it.
46
- file.write(disableItPath, "", verbose);
47
- }
48
- // By default, the IsaacScript watcher mod automatically restarts the game, so we only need to
49
- // disable it if the config option is explicitly set to false.
50
- if (config.enableIsaacScriptWatcherAutoRestart === false) {
51
- disableIsaacScriptWatcherAutomaticRestart(watcherModPath, verbose);
52
- }
53
- // If we copied a new version of the watcher mod into place, but the user currently has the game
54
- // open, then the old version will stay loaded. However, if the watcher mod reloads itself, the
55
- // game will crash, so there is no automated solution for this.
56
- }
57
- exports.copyWatcherMod = copyWatcherMod;
58
- function disableIsaacScriptWatcherAutomaticRestart(watcherModPath, verbose) {
59
- const mainLuaPath = path_1.default.join(watcherModPath, constants_1.MAIN_LUA);
60
- const mainLua = file.read(mainLuaPath, verbose);
61
- const modifiedMainLua = mainLua.replace("local RESTART_GAME_ON_RECOMPILATION = true", "local RESTART_GAME_ON_RECOMPILATION = false");
62
- file.write(mainLuaPath, modifiedMainLua, verbose);
63
- }
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
+ }
64
39
  //# sourceMappingURL=copyWatcherMod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copyWatcherMod.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/monitor/copyWatcherMod.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AACxB,+CAKyB;AACzB,yDAAmC;AAGnC,SAAgB,cAAc,CAAC,MAAc,EAAE,OAAgB;IAC7D,yCAAyC;IACzC,MAAM,cAAc,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,4BAAgB,CAAC,CAAC;IACzE,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,cAAc,EAAE,2BAAe,CAAC,CAAC;IACjE,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAE/D,4FAA4F;IAC5F,6BAA6B;IAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE;QACxC,IAAI,CAAC,qBAAqB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;KACrD;IAED,IAAI,CAAC,IAAI,CAAC,mCAAuB,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAE5D,IAAI,kBAAkB,EAAE;QACtB,iFAAiF;QACjF,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;KACxC;IAED,8FAA8F;IAC9F,8DAA8D;IAC9D,IAAI,MAAM,CAAC,mCAAmC,KAAK,KAAK,EAAE;QACxD,yCAAyC,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;KACpE;IAED,gGAAgG;IAChG,+FAA+F;IAC/F,+DAA+D;AACjE,CAAC;AA5BD,wCA4BC;AAED,SAAS,yCAAyC,CAChD,cAAsB,EACtB,OAAgB;IAEhB,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,cAAc,EAAE,oBAAQ,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAEhD,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CACrC,4CAA4C,EAC5C,6CAA6C,CAC9C,CAAC;IAEF,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC"}
@@ -1,52 +1,50 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const sync_directory_1 = __importDefault(require("sync-directory"));
7
- const constants_1 = require("../../../constants");
8
- const SUBPROCESS_NAME = "directory syncer";
9
- const BASE_ARGV_LENGTH = 2;
10
- let modSourcePath;
11
- let modTargetPath;
12
- init();
13
- function init() {
14
- const firstArg = process.argv[BASE_ARGV_LENGTH];
15
- if (firstArg === undefined) {
16
- throw new Error(`The ${SUBPROCESS_NAME} process did not get a valid first argument.`);
17
- }
18
- const secondArg = process.argv[BASE_ARGV_LENGTH + 1];
19
- if (secondArg === undefined) {
20
- throw new Error(`The ${SUBPROCESS_NAME} process did not get the right amount of arguments.`);
21
- }
22
- modSourcePath = firstArg;
23
- modTargetPath = secondArg;
24
- (0, sync_directory_1.default)(modSourcePath, modTargetPath, {
25
- watch: true,
26
- type: "copy",
27
- afterEachSync,
28
- onError,
29
- chokidarWatchOptions: {
30
- awaitWriteFinish: {
31
- stabilityThreshold: 1000,
32
- },
33
- },
34
- });
35
- }
36
- function afterEachSync(params) {
37
- if (params === undefined) {
38
- return;
39
- }
40
- if (params.eventType !== "init:copy") {
41
- send(`${constants_1.FILE_SYNCED_MESSAGE} ${params.relativePath}`);
42
- }
43
- }
44
- function onError(err) {
45
- send(`The directory syncer encountered an error: ${err}`);
46
- }
47
- function send(msg) {
48
- if (process.send !== undefined) {
49
- process.send(msg);
50
- }
51
- }
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
+ }
52
50
  //# sourceMappingURL=modDirectorySyncer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modDirectorySyncer.js","sourceRoot":"","sources":["../../../../../../../packages/isaacscript-cli/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts"],"names":[],"mappings":";;;AAAA,4EAA2C;AAC3C,kDAAyD;AAEzD,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAC3C,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,IAAI,aAAqB,CAAC;AAC1B,IAAI,aAAqB,CAAC;AAE1B,IAAI,EAAE,CAAC;AAEP,SAAS,IAAI;IACX,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAChD,IAAI,QAAQ,KAAK,SAAS,EAAE;QAC1B,MAAM,IAAI,KAAK,CACb,OAAO,eAAe,8CAA8C,CACrE,CAAC;KACH;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC;IACrD,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,OAAO,eAAe,qDAAqD,CAC5E,CAAC;KACH;IAED,aAAa,GAAG,QAAQ,CAAC;IACzB,aAAa,GAAG,SAAS,CAAC;IAE1B,IAAA,wBAAa,EAAC,aAAa,EAAE,aAAa,EAAE;QAC1C,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,MAAM;QACZ,aAAa;QACb,OAAO;QACP,oBAAoB,EAAE;YACpB,gBAAgB,EAAE;gBAChB,kBAAkB,EAAE,IAAI;aACzB;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,aAAa,CAAC,MAMtB;IACC,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO;KACR;IAED,IAAI,MAAM,CAAC,SAAS,KAAK,WAAW,EAAE;QACpC,IAAI,CAAC,GAAG,+BAAmB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;KACvD;AACH,CAAC;AAED,SAAS,OAAO,CAAC,GAAU;IACzB,IAAI,CAAC,8CAA8C,GAAG,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,IAAI,CAAC,GAAW;IACvB,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE;QAC9B,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACnB;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Config } from "../../types/Config";
2
+ export declare function monitor(argv: Record<string, unknown>, config: Config): void;
@@ -1,172 +1,147 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.monitor = void 0;
30
- const chalk_1 = __importDefault(require("chalk"));
31
- const child_process_1 = require("child_process");
32
- const JSONC = __importStar(require("jsonc-parser"));
33
- const path_1 = __importDefault(require("path"));
34
- const constants_1 = require("../../constants");
35
- const file = __importStar(require("../../file"));
36
- const utils_1 = require("../../utils");
37
- const constants_2 = require("./constants");
38
- const copyWatcherMod_1 = require("./copyWatcherMod");
39
- const notifyGame = __importStar(require("./notifyGame"));
40
- const spawnSaveDatWriter_1 = require("./spawnSaveDatWriter");
41
- const touchWatcherSaveDatFiles_1 = require("./touchWatcherSaveDatFiles");
42
- let compilationStartTime = new Date();
43
- function monitor(argv, config) {
44
- const verbose = argv["verbose"] === true;
45
- // If they specified some command-line flags, override the values found in the config file.
46
- if (argv["modsDirectory"] !== undefined) {
47
- config.modsDirectory = argv["modsDirectory"]; // eslint-disable-line no-param-reassign
48
- }
49
- if (argv["saveSlot"] !== undefined) {
50
- config.saveSlot = argv["saveSlot"]; // eslint-disable-line no-param-reassign
51
- }
52
- // Read the "tsconfig.json" file.
53
- const tsConfigInclude = getFirstTSConfigIncludePath(verbose);
54
- const resolvedIncludePath = path_1.default.resolve(constants_1.CWD, tsConfigInclude);
55
- const modTargetDirectoryName = (0, utils_1.getModTargetDirectoryName)(config);
56
- const modTargetPath = path_1.default.join(config.modsDirectory, modTargetDirectoryName);
57
- // Prepare the IsaacScript watcher mod.
58
- (0, copyWatcherMod_1.copyWatcherMod)(config, verbose);
59
- (0, touchWatcherSaveDatFiles_1.touchWatcherSaveDatFiles)(config, verbose);
60
- // Delete and re-copy the mod every time IsaacScript starts. This ensures that it is always the
61
- // latest version.
62
- if (file.exists(modTargetPath, verbose)) {
63
- file.deleteFileOrDirectory(modTargetPath, true);
64
- }
65
- // Subprocess #1 - The "save#.dat" file writer.
66
- (0, spawnSaveDatWriter_1.spawnSaveDatWriter)(config);
67
- // Subprocess #2 - The mod directory syncer.
68
- spawnModDirectorySyncer(config);
69
- // Subprocess #3 - tstl --watch (to automatically convert TypeScript to Lua).
70
- spawnTSTLWatcher();
71
- // Also, start constantly pinging the watcher mod.
72
- setInterval(() => {
73
- notifyGame.ping();
74
- }, 1000); // Every second
75
- console.log("Automatically monitoring the following for changes:");
76
- console.log(`1) your TypeScript code: ${chalk_1.default.green(resolvedIncludePath)}`);
77
- console.log(`2) the source mod directory: ${chalk_1.default.green(constants_1.MOD_SOURCE_PATH)}`);
78
- console.log("");
79
- console.log(`Copying files to: ${chalk_1.default.green(modTargetPath)}`);
80
- console.log("");
81
- // (The process will now continue indefinitely for as long as the subprocesses exist.)
82
- }
83
- exports.monitor = monitor;
84
- function spawnModDirectorySyncer(config) {
85
- const processName = "modDirectorySyncer";
86
- const processDescription = "Directory syncer";
87
- const processPath = path_1.default.join(__dirname, processName, processName);
88
- const modTargetName = (0, utils_1.getModTargetDirectoryName)(config);
89
- const modTargetPath = path_1.default.join(config.modsDirectory, modTargetName);
90
- const directorySyncer = (0, child_process_1.fork)(processPath, [constants_1.MOD_SOURCE_PATH, modTargetPath]);
91
- directorySyncer.on("message", (msg) => {
92
- notifyGame.msg(msg);
93
- // If the "main.lua" file was successfully copied over, we also have to tell isaacscript-watcher
94
- // to reload the mod. Look for something like: "File synced: \main.lua"
95
- if (msg === `${constants_1.FILE_SYNCED_MESSAGE} ${path_1.default.sep}${constants_1.MAIN_LUA}`) {
96
- notifyGame.command(`luamod ${modTargetName}`);
97
- notifyGame.command("restart");
98
- notifyGame.msg("Reloaded the mod.");
99
- }
100
- });
101
- directorySyncer.on("close", (code) => {
102
- (0, utils_1.error)(`Error: ${processDescription} subprocess closed with code: ${code}`);
103
- });
104
- directorySyncer.on("exit", (code) => {
105
- (0, utils_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
106
- });
107
- }
108
- function spawnTSTLWatcher() {
109
- const processDescription = "tstl";
110
- const tstl = (0, child_process_1.spawn)("npx", ["tstl", "--watch", "--preserveWatchOutput"], {
111
- shell: true,
112
- });
113
- tstl.stdout.on("data", (data) => {
114
- const msg = data.toString().trim();
115
- if (msg.includes("Starting compilation in watch mode...")) {
116
- const newMsg = `${constants_1.PROJECT_NAME} is now watching for changes.`;
117
- notifyGame.msg(newMsg);
118
- }
119
- else if (msg.includes("File change detected. Starting incremental compilation...")) {
120
- compilationStartTime = new Date();
121
- const newMsg = "TypeScript change detected. Compiling...";
122
- notifyGame.msg(newMsg);
123
- }
124
- else if (msg.includes("Found 0 errors. Watching for file changes.")) {
125
- const compilationFinishTime = new Date();
126
- const elapsedTimeMilliseconds = compilationFinishTime.getTime() - compilationStartTime.getTime();
127
- const elapsedTimeSeconds = elapsedTimeMilliseconds / 1000;
128
- const newMsg = `${constants_2.COMPILATION_SUCCESSFUL} (in ${elapsedTimeSeconds} seconds)`;
129
- notifyGame.msg(newMsg);
130
- }
131
- else {
132
- notifyGame.msg(msg);
133
- }
134
- });
135
- tstl.stderr.on("data", (data) => {
136
- const msg = data.toString().trim();
137
- if (msg === "^C") {
138
- // Hide the line that appears when you cancel the program with `Ctrl + c`.
139
- return;
140
- }
141
- notifyGame.msg(`Error: ${msg}`);
142
- });
143
- tstl.on("close", (code) => {
144
- (0, utils_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
145
- });
146
- tstl.on("exit", (code) => {
147
- (0, utils_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
148
- });
149
- }
150
- function getFirstTSConfigIncludePath(verbose) {
151
- const tsConfigRaw = file.read(constants_1.TSCONFIG_PATH, verbose);
152
- let tsConfig;
153
- try {
154
- tsConfig = JSONC.parse(tsConfigRaw);
155
- }
156
- catch (err) {
157
- (0, utils_1.error)(`Failed to parse "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}":`, err);
158
- }
159
- const include = tsConfig["include"];
160
- if (include === undefined) {
161
- (0, utils_1.error)(`Your "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}" file does not have an "include" property, which is surely a mistake. Delete the file and re-run ${constants_1.PROJECT_NAME}.`);
162
- }
163
- if (!Array.isArray(include)) {
164
- (0, utils_1.error)(`Your "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}" file has an "include" property that is not an array, which is surely a mistake. Delete the file and re-run ${constants_1.PROJECT_NAME}.`);
165
- }
166
- const firstInclude = include[0];
167
- if (firstInclude === undefined) {
168
- (0, utils_1.error)(`Your "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}" file has an empty "include" property, which is surely a mistake. Delete the file and re-run ${constants_1.PROJECT_NAME}.`);
169
- }
170
- return firstInclude;
171
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.monitor = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const child_process_1 = require("child_process");
7
+ const JSONC = tslib_1.__importStar(require("jsonc-parser"));
8
+ const path_1 = tslib_1.__importDefault(require("path"));
9
+ const constants_1 = require("../../constants");
10
+ const file = tslib_1.__importStar(require("../../file"));
11
+ const utils_1 = require("../../utils");
12
+ const constants_2 = require("./constants");
13
+ const copyWatcherMod_1 = require("./copyWatcherMod");
14
+ const notifyGame = tslib_1.__importStar(require("./notifyGame"));
15
+ const spawnSaveDatWriter_1 = require("./spawnSaveDatWriter");
16
+ const touchWatcherSaveDatFiles_1 = require("./touchWatcherSaveDatFiles");
17
+ let compilationStartTime = new Date();
18
+ function monitor(argv, config) {
19
+ const verbose = argv["verbose"] === true;
20
+ // If they specified some command-line flags, override the values found in the config file.
21
+ if (argv["modsDirectory"] !== undefined) {
22
+ config.modsDirectory = argv["modsDirectory"]; // eslint-disable-line no-param-reassign
23
+ }
24
+ if (argv["saveSlot"] !== undefined) {
25
+ config.saveSlot = argv["saveSlot"]; // eslint-disable-line no-param-reassign
26
+ }
27
+ // Read the "tsconfig.json" file.
28
+ const tsConfigInclude = getFirstTSConfigIncludePath(verbose);
29
+ const resolvedIncludePath = path_1.default.resolve(constants_1.CWD, tsConfigInclude);
30
+ const modTargetDirectoryName = (0, utils_1.getModTargetDirectoryName)(config);
31
+ const modTargetPath = path_1.default.join(config.modsDirectory, modTargetDirectoryName);
32
+ // Prepare the IsaacScript watcher mod.
33
+ (0, copyWatcherMod_1.copyWatcherMod)(config, verbose);
34
+ (0, touchWatcherSaveDatFiles_1.touchWatcherSaveDatFiles)(config, verbose);
35
+ // Delete and re-copy the mod every time IsaacScript starts. This ensures that it is always the
36
+ // latest version.
37
+ if (file.exists(modTargetPath, verbose)) {
38
+ file.deleteFileOrDirectory(modTargetPath, true);
39
+ }
40
+ // Subprocess #1 - The "save#.dat" file writer.
41
+ (0, spawnSaveDatWriter_1.spawnSaveDatWriter)(config);
42
+ // Subprocess #2 - The mod directory syncer.
43
+ spawnModDirectorySyncer(config);
44
+ // Subprocess #3 - tstl --watch (to automatically convert TypeScript to Lua).
45
+ spawnTSTLWatcher();
46
+ // Also, start constantly pinging the watcher mod.
47
+ setInterval(() => {
48
+ notifyGame.ping();
49
+ }, 1000); // Every second
50
+ console.log("Automatically monitoring the following for changes:");
51
+ console.log(`1) your TypeScript code: ${chalk_1.default.green(resolvedIncludePath)}`);
52
+ console.log(`2) the source mod directory: ${chalk_1.default.green(constants_1.MOD_SOURCE_PATH)}`);
53
+ console.log("");
54
+ console.log(`Copying files to: ${chalk_1.default.green(modTargetPath)}`);
55
+ console.log("");
56
+ // (The process will now continue indefinitely for as long as the subprocesses exist.)
57
+ }
58
+ exports.monitor = monitor;
59
+ function spawnModDirectorySyncer(config) {
60
+ const processName = "modDirectorySyncer";
61
+ const processDescription = "Directory syncer";
62
+ const processPath = path_1.default.join(__dirname, processName, processName);
63
+ const modTargetName = (0, utils_1.getModTargetDirectoryName)(config);
64
+ const modTargetPath = path_1.default.join(config.modsDirectory, modTargetName);
65
+ const directorySyncer = (0, child_process_1.fork)(processPath, [constants_1.MOD_SOURCE_PATH, modTargetPath]);
66
+ directorySyncer.on("message", (msg) => {
67
+ notifyGame.msg(msg);
68
+ // If the "main.lua" file was successfully copied over, we also have to tell isaacscript-watcher
69
+ // to reload the mod. Look for something like: "File synced: \main.lua"
70
+ if (msg === `${constants_1.FILE_SYNCED_MESSAGE} ${path_1.default.sep}${constants_1.MAIN_LUA}`) {
71
+ notifyGame.command(`luamod ${modTargetName}`);
72
+ notifyGame.command("restart");
73
+ notifyGame.msg("Reloaded the mod.");
74
+ }
75
+ });
76
+ directorySyncer.on("close", (code) => {
77
+ (0, utils_1.error)(`Error: ${processDescription} subprocess closed with code: ${code}`);
78
+ });
79
+ directorySyncer.on("exit", (code) => {
80
+ (0, utils_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
81
+ });
82
+ }
83
+ function spawnTSTLWatcher() {
84
+ const processDescription = "tstl";
85
+ const tstl = (0, child_process_1.spawn)("npx", ["tstl", "--watch", "--preserveWatchOutput"], {
86
+ shell: true,
87
+ });
88
+ tstl.stdout.on("data", (data) => {
89
+ const msg = data.toString().trim();
90
+ if (msg.includes("Starting compilation in watch mode...")) {
91
+ const newMsg = `${constants_1.PROJECT_NAME} is now watching for changes.`;
92
+ notifyGame.msg(newMsg);
93
+ }
94
+ else if (msg.includes("File change detected. Starting incremental compilation...")) {
95
+ compilationStartTime = new Date();
96
+ const newMsg = "TypeScript change detected. Compiling...";
97
+ notifyGame.msg(newMsg);
98
+ }
99
+ else if (msg.includes("Found 0 errors. Watching for file changes.")) {
100
+ const compilationFinishTime = new Date();
101
+ const elapsedTimeMilliseconds = compilationFinishTime.getTime() - compilationStartTime.getTime();
102
+ const elapsedTimeSeconds = elapsedTimeMilliseconds / 1000;
103
+ const newMsg = `${constants_2.COMPILATION_SUCCESSFUL} (in ${elapsedTimeSeconds} seconds)`;
104
+ notifyGame.msg(newMsg);
105
+ }
106
+ else {
107
+ notifyGame.msg(msg);
108
+ }
109
+ });
110
+ tstl.stderr.on("data", (data) => {
111
+ const msg = data.toString().trim();
112
+ if (msg === "^C") {
113
+ // Hide the line that appears when you cancel the program with `Ctrl + c`.
114
+ return;
115
+ }
116
+ notifyGame.msg(`Error: ${msg}`);
117
+ });
118
+ tstl.on("close", (code) => {
119
+ (0, utils_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
120
+ });
121
+ tstl.on("exit", (code) => {
122
+ (0, utils_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
123
+ });
124
+ }
125
+ function getFirstTSConfigIncludePath(verbose) {
126
+ const tsConfigRaw = file.read(constants_1.TSCONFIG_PATH, verbose);
127
+ let tsConfig;
128
+ try {
129
+ tsConfig = JSONC.parse(tsConfigRaw);
130
+ }
131
+ catch (err) {
132
+ (0, utils_1.error)(`Failed to parse "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}":`, err);
133
+ }
134
+ const include = tsConfig["include"];
135
+ if (include === undefined) {
136
+ (0, utils_1.error)(`Your "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}" file does not have an "include" property, which is surely a mistake. Delete the file and re-run ${constants_1.PROJECT_NAME}.`);
137
+ }
138
+ if (!Array.isArray(include)) {
139
+ (0, utils_1.error)(`Your "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}" file has an "include" property that is not an array, which is surely a mistake. Delete the file and re-run ${constants_1.PROJECT_NAME}.`);
140
+ }
141
+ const firstInclude = include[0];
142
+ if (firstInclude === undefined) {
143
+ (0, utils_1.error)(`Your "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}" file has an empty "include" property, which is surely a mistake. Delete the file and re-run ${constants_1.PROJECT_NAME}.`);
144
+ }
145
+ return firstInclude;
146
+ }
172
147
  //# sourceMappingURL=monitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monitor.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/monitor/monitor.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,iDAA4C;AAC5C,4DAAsC;AACtC,wDAAwB;AACxB,+CAOyB;AACzB,yDAAmC;AAEnC,uCAA+D;AAC/D,2CAAqD;AACrD,qDAAkD;AAClD,iEAA2C;AAC3C,6DAA0D;AAC1D,yEAAsE;AAEtE,IAAI,oBAAoB,GAAG,IAAI,IAAI,EAAE,CAAC;AAEtC,SAAg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I;QACF,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAA6B,CAAC;KACjE;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,aAAK,EAAC,oBAAoB,eAAK,CAAC,KAAK,CAAC,yBAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;KAChE;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IACpC,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,IAAA,aAAK,EACH,SAAS,eAAK,CAAC,KAAK,CAClB,yBAAa,CACd,qGAAqG,wBAAY,GAAG,CACtH,CAAC;KACH;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,IAAA,aAAK,EACH,SAAS,eAAK,CAAC,KAAK,CAClB,yBAAa,CACd,gHAAgH,wBAAY,GAAG,CACjI,CAAC;KACH;IAED,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAChC,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,IAAA,aAAK,EACH,SAAS,eAAK,CAAC,KAAK,CAClB,yBAAa,CACd,iGAAiG,wBAAY,GAAG,CAClH,CAAC;KACH;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function msg(data: string): void;
2
+ export declare function command(data: string): void;
3
+ export declare function ping(): void;