isaacscript 2.0.5 → 2.0.8

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 (150) hide show
  1. package/dist/package.json +12 -6
  2. package/dist/src/commands/init/createMod.js +9 -9
  3. package/dist/src/commands/init/git.js +3 -3
  4. package/dist/src/commands/init/init.js +2 -2
  5. package/dist/src/commands/monitor/monitor.js +13 -13
  6. package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js +2 -2
  7. package/dist/src/configFile.js +1 -1
  8. package/dist/src/constants.js +12 -9
  9. package/dist/src/file.js +1 -1
  10. package/dist/src/main.js +3 -3
  11. package/dist/src/utils.js +5 -5
  12. package/dist/src/validateInIsaacScriptProject.js +1 -1
  13. package/package.json +12 -6
  14. package/.cspell-base.json +0 -38
  15. package/.cspell-check-unused.json +0 -7
  16. package/.cspell.json +0 -53
  17. package/.eslintrc.js +0 -28
  18. package/.gitattributes +0 -9
  19. package/.github/workflows/ci.yml +0 -47
  20. package/.prettierignore +0 -5
  21. package/.prettierrc.js +0 -42
  22. package/.vscode/extensions.json +0 -9
  23. package/.vscode/settings.json +0 -73
  24. package/build.sh +0 -30
  25. package/check-file-updates.sh +0 -57
  26. package/check-gitignore.sh +0 -26
  27. package/check-orphaned-words.sh +0 -53
  28. package/dist/src/checkForWindowsTerminalBugs.js.map +0 -1
  29. package/dist/src/commands/copy/copy.js.map +0 -1
  30. package/dist/src/commands/init/checkIfProjectPathExists.js.map +0 -1
  31. package/dist/src/commands/init/checkModSubdirectory.js.map +0 -1
  32. package/dist/src/commands/init/checkModTargetDirectory.js.map +0 -1
  33. package/dist/src/commands/init/createMod.js.map +0 -1
  34. package/dist/src/commands/init/getModsDir.js.map +0 -1
  35. package/dist/src/commands/init/getProjectPath.js.map +0 -1
  36. package/dist/src/commands/init/git.js.map +0 -1
  37. package/dist/src/commands/init/init.js.map +0 -1
  38. package/dist/src/commands/init/installVSCodeExtensions.js.map +0 -1
  39. package/dist/src/commands/init/promptSaveSlot.js.map +0 -1
  40. package/dist/src/commands/init/promptVSCode.js.map +0 -1
  41. package/dist/src/commands/monitor/copyWatcherMod.js.map +0 -1
  42. package/dist/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js.map +0 -1
  43. package/dist/src/commands/monitor/monitor.js.map +0 -1
  44. package/dist/src/commands/monitor/notifyGame.js.map +0 -1
  45. package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js.map +0 -1
  46. package/dist/src/commands/monitor/saveDatWriter/types.js.map +0 -1
  47. package/dist/src/commands/monitor/spawnSaveDatWriter.js.map +0 -1
  48. package/dist/src/commands/monitor/touchWatcherSaveDatFiles.js.map +0 -1
  49. package/dist/src/commands/publish/publish.js.map +0 -1
  50. package/dist/src/configFile.js.map +0 -1
  51. package/dist/src/constants.js.map +0 -1
  52. package/dist/src/exec.js.map +0 -1
  53. package/dist/src/file.js.map +0 -1
  54. package/dist/src/main.js.map +0 -1
  55. package/dist/src/parseArgs.js.map +0 -1
  56. package/dist/src/prompt.js.map +0 -1
  57. package/dist/src/types/Command.js.map +0 -1
  58. package/dist/src/types/Config.js.map +0 -1
  59. package/dist/src/types/GitHubCLIHostsYAML.js.map +0 -1
  60. package/dist/src/utils.js.map +0 -1
  61. package/dist/src/validateInIsaacScriptProject.js.map +0 -1
  62. package/dist/src/validateNodeVersion.js.map +0 -1
  63. package/dist/src/validateOS.js.map +0 -1
  64. package/eslint-debug.sh +0 -11
  65. package/file-templates/dynamic/README.md +0 -3
  66. package/file-templates/dynamic/gitignore +0 -144
  67. package/file-templates/dynamic/main.ts +0 -19
  68. package/file-templates/dynamic/metadata.vdf +0 -6
  69. package/file-templates/dynamic/metadata.xml +0 -8
  70. package/file-templates/dynamic/package.json +0 -19
  71. package/file-templates/static/.cspell-check-unused.json +0 -9
  72. package/file-templates/static/.cspell.json.template +0 -9
  73. package/file-templates/static/.env_template +0 -2
  74. package/file-templates/static/.eslintrc.js +0 -24
  75. package/file-templates/static/.gitattributes +0 -9
  76. package/file-templates/static/.github/workflows/ci.yml +0 -53
  77. package/file-templates/static/.prettierignore +0 -14
  78. package/file-templates/static/.prettierrc.js +0 -42
  79. package/file-templates/static/.vscode/extensions.json +0 -10
  80. package/file-templates/static/.vscode/settings.json +0 -76
  81. package/file-templates/static/LICENSE +0 -674
  82. package/file-templates/static/build.sh +0 -15
  83. package/file-templates/static/check-orphaned-words.sh +0 -53
  84. package/file-templates/static/lint.sh +0 -39
  85. package/file-templates/static/nuke.sh +0 -18
  86. package/file-templates/static/plugins/addCrashDebugStatements.ts +0 -40
  87. package/file-templates/static/plugins/addIsaacScriptCommentHeader.ts +0 -37
  88. package/file-templates/static/plugins/noExtendedEnums.ts +0 -66
  89. package/file-templates/static/publish.sh +0 -10
  90. package/file-templates/static/run.sh +0 -10
  91. package/file-templates/static/src/bundleEntry.ts +0 -10
  92. package/file-templates/static/tsconfig.eslint.json +0 -11
  93. package/file-templates/static/tsconfig.json +0 -33
  94. package/file-templates/static/update.sh +0 -21
  95. package/file-templates/static-alt/.cspell-base.json +0 -38
  96. package/file-templates/static-alt/.cspell-check-unused-base.json +0 -7
  97. package/file-templates/static-alt/.prettierignore-base +0 -5
  98. package/file-templates/static-alt/.prettierrc-base.js +0 -30
  99. package/file-templates/static-alt/.vscode/extensions-typescript.json +0 -9
  100. package/file-templates/static-alt/.vscode/settings-typescript.json +0 -63
  101. package/isaacscript-watcher/.luacheckrc +0 -96
  102. package/isaacscript-watcher/README.md +0 -8
  103. package/isaacscript-watcher/main.lua +0 -270
  104. package/isaacscript-watcher/metadata.xml +0 -7
  105. package/isaacscript-watcher/resources/gfx/logo.anm2 +0 -27
  106. package/isaacscript-watcher/resources/gfx/logo.png +0 -0
  107. package/lint.sh +0 -38
  108. package/misc/logo.png +0 -0
  109. package/misc/mouseover.png +0 -0
  110. package/nuke.sh +0 -18
  111. package/publish.sh +0 -11
  112. package/src/checkForWindowsTerminalBugs.ts +0 -106
  113. package/src/commands/copy/copy.ts +0 -41
  114. package/src/commands/init/checkIfProjectPathExists.ts +0 -34
  115. package/src/commands/init/checkModSubdirectory.ts +0 -20
  116. package/src/commands/init/checkModTargetDirectory.ts +0 -42
  117. package/src/commands/init/createMod.ts +0 -196
  118. package/src/commands/init/getModsDir.ts +0 -107
  119. package/src/commands/init/getProjectPath.ts +0 -111
  120. package/src/commands/init/git.ts +0 -249
  121. package/src/commands/init/init.ts +0 -93
  122. package/src/commands/init/installVSCodeExtensions.ts +0 -47
  123. package/src/commands/init/promptSaveSlot.ts +0 -27
  124. package/src/commands/init/promptVSCode.ts +0 -33
  125. package/src/commands/monitor/copyWatcherMod.ts +0 -54
  126. package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts +0 -67
  127. package/src/commands/monitor/monitor.ts +0 -180
  128. package/src/commands/monitor/notifyGame.ts +0 -59
  129. package/src/commands/monitor/saveDatWriter/saveDatWriter.ts +0 -145
  130. package/src/commands/monitor/saveDatWriter/types.ts +0 -6
  131. package/src/commands/monitor/spawnSaveDatWriter.ts +0 -36
  132. package/src/commands/monitor/touchWatcherSaveDatFiles.ts +0 -20
  133. package/src/commands/publish/publish.ts +0 -392
  134. package/src/configFile.ts +0 -80
  135. package/src/constants.ts +0 -85
  136. package/src/exec.ts +0 -125
  137. package/src/file.ts +0 -235
  138. package/src/main.ts +0 -131
  139. package/src/parseArgs.ts +0 -127
  140. package/src/prompt.ts +0 -109
  141. package/src/types/Command.ts +0 -3
  142. package/src/types/Config.ts +0 -23
  143. package/src/types/GitHubCLIHostsYAML.ts +0 -7
  144. package/src/utils.ts +0 -92
  145. package/src/validateInIsaacScriptProject.ts +0 -35
  146. package/src/validateNodeVersion.ts +0 -29
  147. package/src/validateOS.ts +0 -20
  148. package/tsconfig.eslint.json +0 -11
  149. package/tsconfig.json +0 -21
  150. package/update.sh +0 -21
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript",
3
- "version": "2.0.5",
3
+ "version": "2.0.8",
4
4
  "description": "A command line tool for managing Isaac mods written in TypeScript",
5
5
  "homepage": "https://isaacscript.github.io/",
6
6
  "bugs": {
@@ -15,8 +15,13 @@
15
15
  "bin": {
16
16
  "isaacscript": "./dist/src/main.js"
17
17
  },
18
+ "files": [
19
+ "dist/**/*.js",
20
+ "dist/**/*.d.ts",
21
+ "dist/**/*.json"
22
+ ],
18
23
  "dependencies": {
19
- "@types/node": "^17.0.33",
24
+ "@types/node": "^17.0.35",
20
25
  "chalk": "4.1.2",
21
26
  "command-exists": "^1.2.9",
22
27
  "dotenv": "^16.0.1",
@@ -25,17 +30,17 @@
25
30
  "isaacscript-tsconfig": "^1.1.16",
26
31
  "jsonc-parser": "^3.0.0",
27
32
  "moment": "^2.29.3",
28
- "npm-check-updates": "^12.5.11",
33
+ "npm-check-updates": "^13.0.1",
29
34
  "prompt": "^1.3.0",
30
35
  "source-map": "^0.7.3",
31
36
  "source-map-support": "^0.5.21",
32
- "sync-directory": "^5.0.5",
37
+ "sync-directory": "^5.0.8",
33
38
  "ts-node": "^10.7.0",
34
39
  "typescript": "^4.6.4",
35
40
  "typescript-to-lua": "^1.4.4",
36
41
  "update-notifier": "^5.1.0",
37
42
  "yaml": "^2.1.0",
38
- "yargs": "^17.5.0"
43
+ "yargs": "^17.5.1"
39
44
  },
40
45
  "devDependencies": {
41
46
  "@types/command-exists": "^1.2.0",
@@ -45,6 +50,7 @@
45
50
  "@types/source-map-support": "^0.5.4",
46
51
  "@types/update-notifier": "^5.1.0",
47
52
  "@types/yargs": "^17.0.10",
48
- "isaacscript-lint": "^1.0.141"
53
+ "isaacscript-lint": "^1.0.156",
54
+ "isaacscript-spell": "^1.0.3"
49
55
  }
50
56
  }
@@ -47,7 +47,7 @@ function createMod(projectName, projectPath, createNewDir, modsDirectory, saveSl
47
47
  updateNodeModules(projectPath, verbose);
48
48
  installNodeModules(projectPath, skipNPMInstall, verbose);
49
49
  formatFiles(projectPath, verbose);
50
- // Only make the initial commit once all of the files have been copied and formatted
50
+ // Only make the initial commit once all of the files have been copied and formatted.
51
51
  (0, git_1.initGitRepository)(projectPath, gitRemoteURL, verbose);
52
52
  console.log(`Successfully created mod: ${chalk_1.default.green(projectName)}`);
53
53
  }
@@ -77,12 +77,12 @@ function copyStaticFiles(projectPath, verbose) {
77
77
  }
78
78
  /** Copy files that need to have text replaced inside of them. */
79
79
  function copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose) {
80
- // ".gitignore"
80
+ // `.gitignore`
81
81
  {
82
82
  const fileName = constants_1.GITIGNORE;
83
83
  const templatePath = constants_1.GITIGNORE_TEMPLATE_PATH;
84
84
  const template = file.read(templatePath, verbose);
85
- // Prepend a header with the project name
85
+ // Prepend a header with the project name.
86
86
  let separatorLine = "# ";
87
87
  for (let i = 0; i < projectName.length; i++) {
88
88
  separatorLine += "-";
@@ -93,9 +93,9 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose)
93
93
  const destinationPath = path_1.default.join(projectPath, `.${fileName}`); // We need to prepend a period
94
94
  file.write(destinationPath, gitignore, verbose);
95
95
  }
96
- // "package.json"
96
+ // `package.json`
97
97
  {
98
- // Modify and copy the file
98
+ // Modify and copy the file.
99
99
  const fileName = constants_1.PACKAGE_JSON;
100
100
  const templatePath = constants_1.PACKAGE_JSON_TEMPLATE_PATH;
101
101
  const template = file.read(templatePath, verbose);
@@ -103,7 +103,7 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose)
103
103
  const destinationPath = path_1.default.join(projectPath, fileName);
104
104
  file.write(destinationPath, packageJSON, verbose);
105
105
  }
106
- // "README.md"
106
+ // `README.md`
107
107
  {
108
108
  const fileName = constants_1.README_MD;
109
109
  const templatePath = constants_1.README_MD_TEMPLATES_PATH;
@@ -112,7 +112,7 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose)
112
112
  const destinationPath = path_1.default.join(projectPath, fileName);
113
113
  file.write(destinationPath, readmeMD, verbose);
114
114
  }
115
- // "mod/metadata.xml"
115
+ // `mod/metadata.xml`
116
116
  {
117
117
  const fileName = constants_1.METADATA_XML;
118
118
  const templatePath = constants_1.METADATA_XML_TEMPLATE_PATH;
@@ -122,7 +122,7 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose)
122
122
  const destinationPath = path_1.default.join(modPath, fileName);
123
123
  file.write(destinationPath, metadataXML, verbose);
124
124
  }
125
- // "mod/metadata.vdf"
125
+ // `mod/metadata.vdf`
126
126
  {
127
127
  const fileName = constants_1.METADATA_VDF;
128
128
  const templatePath = constants_1.METADATA_VDF_TEMPLATE_PATH;
@@ -132,7 +132,7 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose)
132
132
  const destinationPath = path_1.default.join(modPath, fileName);
133
133
  file.write(destinationPath, metadataVDF, verbose);
134
134
  }
135
- // "src/main.ts"
135
+ // `src/main.ts`
136
136
  {
137
137
  // Convert snake_case and kebab-case to camelCase. (Kebab-case in particular will make the
138
138
  // example TypeScript file fail to compile.)
@@ -39,7 +39,7 @@ const utils_1 = require("../../utils");
39
39
  const REQUIRED_GIT_MAJOR_VERSION = 2;
40
40
  const REQUIRED_GIT_MINOR_VERSION = 30;
41
41
  async function promptGitHubRepoOrGitRemoteURL(projectName, yes, verbose) {
42
- // We do not need to prompt the user if they do not have Git installed
42
+ // We do not need to prompt the user if they do not have Git installed.
43
43
  if (!command_exists_1.default.sync("git")) {
44
44
  console.log('Git does not seem to be installed. (The "git" command is not in the path.) Skipping Git-related things.');
45
45
  return undefined;
@@ -108,7 +108,7 @@ function validateNewGitVersion(verbose) {
108
108
  process.exit(1);
109
109
  }
110
110
  function getGitHubUsername(verbose) {
111
- // If the GitHub CLI is installed, we can derive the user's GitHub username
111
+ // If the GitHub CLI is installed, we can derive the user's GitHub username.
112
112
  if (!command_exists_1.default.sync("gh")) {
113
113
  return undefined;
114
114
  }
@@ -165,7 +165,7 @@ function isGitDirty(verbose) {
165
165
  }
166
166
  exports.isGitDirty = isGitDirty;
167
167
  function gitCommitIfChanges(version, verbose) {
168
- // Throw an error if this is not a git repository
168
+ // Throw an error if this is not a git repository.
169
169
  (0, exec_1.execShell)("git", ["status"], verbose);
170
170
  if (!isGitDirty(verbose)) {
171
171
  console.log("There are no changes to commit.");
@@ -25,7 +25,7 @@ async function init(argv) {
25
25
  const vscode = argv["vscode"] === true;
26
26
  const yes = argv["yes"] === true;
27
27
  const forceName = argv["forceName"] === true;
28
- // Prompt the end-user for some information (and validate it as we go)
28
+ // Prompt the end-user for some information (and validate it as we go).
29
29
  const [projectPath, createNewDir] = await (0, getProjectPath_1.getProjectPath)(argv, useCurrentDir, yes, forceName);
30
30
  await (0, checkIfProjectPathExists_1.checkIfProjectPathExists)(projectPath, yes, verbose);
31
31
  const modsDirectory = await (0, getModsDir_1.getModsDir)(argv, verbose);
@@ -34,7 +34,7 @@ async function init(argv) {
34
34
  await (0, checkModTargetDirectory_1.checkModTargetDirectory)(modsDirectory, projectName, yes, verbose);
35
35
  const saveSlot = await (0, promptSaveSlot_1.promptSaveSlot)(argv, yes);
36
36
  const gitRemoteURL = await (0, git_1.promptGitHubRepoOrGitRemoteURL)(projectName, yes, verbose);
37
- // Now that we have asked the user all of the questions we need, we can create the project
37
+ // Now that we have asked the user all of the questions we need, we can create the project.
38
38
  (0, createMod_1.createMod)(projectName, projectPath, createNewDir, modsDirectory, saveSlot, gitRemoteURL, skipNPMInstall, verbose);
39
39
  await openVSCode(projectPath, vscode, verbose);
40
40
  printFinishMessage(projectPath, projectName);
@@ -40,19 +40,19 @@ const spawnSaveDatWriter_1 = require("./spawnSaveDatWriter");
40
40
  const touchWatcherSaveDatFiles_1 = require("./touchWatcherSaveDatFiles");
41
41
  function monitor(argv, config) {
42
42
  const verbose = argv["verbose"] === true;
43
- // If they specified some command-line flags, override the values found in the config file
43
+ // If they specified some command-line flags, override the values found in the config file.
44
44
  if (argv["modsDirectory"] !== undefined) {
45
45
  config.modsDirectory = argv["modsDirectory"]; // eslint-disable-line no-param-reassign
46
46
  }
47
47
  if (argv["saveSlot"] !== undefined) {
48
48
  config.saveSlot = argv["saveSlot"]; // eslint-disable-line no-param-reassign
49
49
  }
50
- // Read the "tsconfig.json" file
50
+ // Read the "tsconfig.json" file.
51
51
  const tsConfigInclude = getFirstTSConfigIncludePath(verbose);
52
52
  const resolvedIncludePath = path_1.default.resolve(constants_1.CWD, tsConfigInclude);
53
53
  const modTargetDirectoryName = (0, utils_1.getModTargetDirectoryName)(config);
54
54
  const modTargetPath = path_1.default.join(config.modsDirectory, modTargetDirectoryName);
55
- // Prepare the IsaacScript watcher mod
55
+ // Prepare the IsaacScript watcher mod.
56
56
  (0, copyWatcherMod_1.copyWatcherMod)(config, verbose);
57
57
  (0, touchWatcherSaveDatFiles_1.touchWatcherSaveDatFiles)(config, verbose);
58
58
  // Delete and re-copy the mod every time IsaacScript starts. This ensures that it is always the
@@ -60,13 +60,13 @@ function monitor(argv, config) {
60
60
  if (file.exists(modTargetPath, verbose)) {
61
61
  file.deleteFileOrDirectory(modTargetPath, true);
62
62
  }
63
- // Subprocess #1 - The "save#.dat" file writer
63
+ // Subprocess #1 - The "save#.dat" file writer.
64
64
  (0, spawnSaveDatWriter_1.spawnSaveDatWriter)(config);
65
- // Subprocess #2 - The mod directory syncer
65
+ // Subprocess #2 - The mod directory syncer.
66
66
  spawnModDirectorySyncer(config);
67
- // Subprocess #3 - tstl --watch (to automatically convert TypeScript to Lua)
67
+ // Subprocess #3 - tstl --watch (to automatically convert TypeScript to Lua).
68
68
  spawnTSTLWatcher();
69
- // Also, start constantly pinging the watcher mod
69
+ // Also, start constantly pinging the watcher mod.
70
70
  setInterval(() => {
71
71
  notifyGame.ping();
72
72
  }, 1000); // Every second
@@ -76,7 +76,7 @@ function monitor(argv, config) {
76
76
  console.log("");
77
77
  console.log(`Copying files to: ${chalk_1.default.green(modTargetPath)}`);
78
78
  console.log("");
79
- // (the process will now continue indefinitely for as long as the subprocesses exist)
79
+ // (The process will now continue indefinitely for as long as the subprocesses exist.)
80
80
  }
81
81
  exports.monitor = monitor;
82
82
  function spawnModDirectorySyncer(config) {
@@ -85,8 +85,8 @@ function spawnModDirectorySyncer(config) {
85
85
  const processPath = path_1.default.join(__dirname, processName, processName);
86
86
  const modTargetName = (0, utils_1.getModTargetDirectoryName)(config);
87
87
  const modTargetPath = path_1.default.join(config.modsDirectory, modTargetName);
88
- const directorySycner = (0, child_process_1.fork)(processPath, [constants_1.MOD_SOURCE_PATH, modTargetPath]);
89
- directorySycner.on("message", (msg) => {
88
+ const directorySyncer = (0, child_process_1.fork)(processPath, [constants_1.MOD_SOURCE_PATH, modTargetPath]);
89
+ directorySyncer.on("message", (msg) => {
90
90
  notifyGame.msg(msg);
91
91
  // If the "main.lua" file was successfully copied over, we also have to tell isaacscript-watcher
92
92
  // to reload the mod. Look for something like: "File synced: \main.lua"
@@ -96,10 +96,10 @@ function spawnModDirectorySyncer(config) {
96
96
  notifyGame.msg("Reloaded the mod.");
97
97
  }
98
98
  });
99
- directorySycner.on("close", (code) => {
99
+ directorySyncer.on("close", (code) => {
100
100
  (0, utils_1.error)(`Error: ${processDescription} subprocess closed with code: ${code}`);
101
101
  });
102
- directorySycner.on("exit", (code) => {
102
+ directorySyncer.on("exit", (code) => {
103
103
  (0, utils_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
104
104
  });
105
105
  }
@@ -129,7 +129,7 @@ function spawnTSTLWatcher() {
129
129
  tstl.stderr.on("data", (data) => {
130
130
  const msg = data.toString().trim();
131
131
  if (msg === "^C") {
132
- // Hide the line that appears when you cancel the program with Ctrl + c
132
+ // Hide the line that appears when you cancel the program with `Ctrl + c`.
133
133
  return;
134
134
  }
135
135
  notifyGame.msg(`Error: ${msg}`);
@@ -45,12 +45,12 @@ function init(verbose) {
45
45
  }
46
46
  saveDatPath = firstArg;
47
47
  saveDatFileName = path_1.default.basename(saveDatPath);
48
- // Check to see if the data directory exists
48
+ // Check to see if the data directory exists.
49
49
  const watcherModDataPath = path_1.default.dirname(saveDatPath);
50
50
  if (!file.exists(watcherModDataPath, verbose)) {
51
51
  file.makeDir(watcherModDataPath, verbose);
52
52
  }
53
- // Listen for messages from the parent process
53
+ // Listen for messages from the parent process.
54
54
  process.on("message", (msg) => {
55
55
  onMessage(msg.type, msg.data);
56
56
  });
@@ -42,7 +42,7 @@ async function get(argv) {
42
42
  if (existingConfig !== undefined) {
43
43
  return existingConfig;
44
44
  }
45
- // No config file exists, so prompt the user for some information and create one
45
+ // No config file exists, so prompt the user for some information and create one.
46
46
  const modsDirectory = await (0, getModsDir_1.getModsDir)(argv, verbose);
47
47
  const saveSlot = await (0, promptSaveSlot_1.promptSaveSlot)(argv, yes);
48
48
  const config = createObject(modsDirectory, saveSlot);
@@ -7,7 +7,10 @@ exports.PUBLISH_POST_COPY_PY_PATH = exports.PUBLISH_PRE_COPY_PY_PATH = exports.V
7
7
  const os_1 = __importDefault(require("os"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const cwd = process.cwd();
10
- // https://stackoverflow.com/questions/9080085/node-js-find-home-directory-in-platform-agnostic-way
10
+ /**
11
+ * From:
12
+ * https://stackoverflow.com/questions/9080085/node-js-find-home-directory-in-platform-agnostic-way
13
+ */
11
14
  const homeDir = os_1.default.homedir();
12
15
  // Miscellaneous
13
16
  exports.CURRENT_DIRECTORY_NAME = path_1.default.basename(cwd);
@@ -16,17 +19,17 @@ exports.HOME_DIR = homeDir;
16
19
  exports.FILE_SYNCED_MESSAGE = "File synced:";
17
20
  exports.MOD_UPLOADER_PATH = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\tools\\ModUploader\\ModUploader.exe";
18
21
  exports.PROJECT_NAME = "IsaacScript";
19
- // isaacscript
22
+ // `isaacscript`
20
23
  const REPO_ROOT = path_1.default.join(__dirname, "..", "..");
21
- // isaacscript/isaacscript-watcher
24
+ // `isaacscript/isaacscript-watcher`
22
25
  exports.DISABLE_IT_FILE = "disable.it";
23
26
  exports.WATCHER_MOD_NAME = "isaacscript-watcher";
24
27
  exports.WATCHER_MOD_SOURCE_PATH = path_1.default.join(REPO_ROOT, exports.WATCHER_MOD_NAME);
25
- // isaacscript/file-templates
28
+ // `isaacscript/file-templates`
26
29
  const TEMPLATES_DIR = path_1.default.join(REPO_ROOT, "file-templates");
27
- // isaacscript/file-templates/static
30
+ // `isaacscript/file-templates/static`
28
31
  exports.TEMPLATES_STATIC_DIR = path_1.default.join(TEMPLATES_DIR, "static");
29
- // isaacscript/file-templates/dynamic
32
+ // `isaacscript/file-templates/dynamic`
30
33
  const TEMPLATES_DYNAMIC_DIR = path_1.default.join(TEMPLATES_DIR, "dynamic");
31
34
  exports.GITIGNORE = "gitignore"; // Not named ".gitignore" to prevent NPM from deleting it
32
35
  exports.GITIGNORE_TEMPLATE_PATH = path_1.default.join(TEMPLATES_DYNAMIC_DIR, exports.GITIGNORE);
@@ -40,19 +43,19 @@ exports.PACKAGE_JSON = "package.json";
40
43
  exports.PACKAGE_JSON_TEMPLATE_PATH = path_1.default.join(TEMPLATES_DYNAMIC_DIR, exports.PACKAGE_JSON);
41
44
  exports.README_MD = "README.md";
42
45
  exports.README_MD_TEMPLATES_PATH = path_1.default.join(TEMPLATES_DYNAMIC_DIR, exports.README_MD);
43
- // project
46
+ // `project`
44
47
  exports.CONFIG_FILE_NAME = "isaacscript.json";
45
48
  exports.CONFIG_FILE_PATH = path_1.default.join(exports.CWD, exports.CONFIG_FILE_NAME);
46
49
  exports.TSCONFIG_PATH = path_1.default.join(exports.CWD, "tsconfig.json");
47
50
  exports.PACKAGE_JSON_PATH = path_1.default.join(exports.CWD, "package.json");
48
51
  exports.CONSTANTS_TS_PATH = path_1.default.join(exports.CWD, "src", "constants.ts");
49
52
  exports.YARN_LOCK_PATH = path_1.default.join(exports.CWD, "yarn.lock");
50
- // project/mod
53
+ // `project/mod`
51
54
  exports.MOD_SOURCE_PATH = path_1.default.join(exports.CWD, "mod");
52
55
  exports.MAIN_LUA = "main.lua";
53
56
  exports.METADATA_XML_PATH = path_1.default.join(exports.MOD_SOURCE_PATH, "metadata.xml");
54
57
  exports.VERSION_TXT_PATH = path_1.default.join(exports.MOD_SOURCE_PATH, "version.txt");
55
- // project/scripts
58
+ // `project/scripts`
56
59
  const SCRIPTS_PATH = path_1.default.join(exports.CWD, "scripts");
57
60
  exports.PUBLISH_PRE_COPY_PY_PATH = path_1.default.join(SCRIPTS_PATH, "publish_pre_copy.py");
58
61
  exports.PUBLISH_POST_COPY_PY_PATH = path_1.default.join(SCRIPTS_PATH, "publish_post_copy.py");
package/dist/src/file.js CHANGED
@@ -13,7 +13,7 @@ function copy(srcPath, dstPath, verbose) {
13
13
  console.log(`Copying: ${srcPath} --> ${dstPath}`);
14
14
  }
15
15
  try {
16
- // "copySync()" is a "fs-extra" method for copying directories recursively
16
+ // `copySync` is a `fs-extra` method for copying directories recursively.
17
17
  fs_extra_1.default.copySync(srcPath, dstPath, {
18
18
  recursive: true,
19
19
  });
package/dist/src/main.js CHANGED
@@ -60,13 +60,13 @@ async function main() {
60
60
  (0, validateNodeVersion_1.validateNodeVersion)();
61
61
  (0, validateOS_1.validateOS)();
62
62
  loadEnvironmentVariables();
63
- // Get command line arguments
63
+ // Get command line arguments.
64
64
  const argv = (0, parseArgs_1.parseArgs)();
65
65
  const verbose = argv["verbose"] === true;
66
66
  printBanner();
67
- // Check for a new version
67
+ // Check for a new version.
68
68
  (0, update_notifier_1.default)({ pkg: package_json_1.default }).notify();
69
- // Pre-flight checks
69
+ // Pre-flight checks.
70
70
  await (0, checkForWindowsTerminalBugs_1.checkForWindowsTerminalBugs)(verbose);
71
71
  await handleCommands(argv, verbose);
72
72
  }
package/dist/src/utils.js CHANGED
@@ -35,26 +35,26 @@ function isKebabCase(s) {
35
35
  }
36
36
  exports.isKebabCase = isKebabCase;
37
37
  /**
38
- * `parseIntSafe` is a more reliable version of `parseInt`. By default, "parseInt('1a')" will return
38
+ * `parseIntSafe` is a more reliable version of `parseInt`. By default, `parseInt('1a')` will return
39
39
  * "1", which is unexpected. This returns either an integer or NaN.
40
40
  */
41
41
  function parseIntSafe(input) {
42
42
  if (typeof input !== "string") {
43
43
  return NaN;
44
44
  }
45
- // Remove all leading and trailing whitespace
45
+ // Remove all leading and trailing whitespace.
46
46
  let trimmedInput = input.trim();
47
47
  const isNegativeNumber = trimmedInput.startsWith("-");
48
48
  if (isNegativeNumber) {
49
- // Remove the leading minus sign before we match the regular expression
49
+ // Remove the leading minus sign before we match the regular expression.
50
50
  trimmedInput = trimmedInput.substring(1);
51
51
  }
52
+ // "\d" matches any digit (same as "[0-9]").
52
53
  if (/^\d+$/.exec(trimmedInput) === null) {
53
- // "\d" matches any digit (same as "[0-9]")
54
54
  return NaN;
55
55
  }
56
56
  if (isNegativeNumber) {
57
- // Add the leading minus sign back
57
+ // Add the leading minus sign back.
58
58
  trimmedInput = `-${trimmedInput}`;
59
59
  }
60
60
  return parseInt(trimmedInput, 10);
@@ -31,7 +31,7 @@ const chalk_1 = __importDefault(require("chalk"));
31
31
  const path_1 = __importDefault(require("path"));
32
32
  const constants_1 = require("./constants");
33
33
  const file = __importStar(require("./file"));
34
- // Validate that we are in a directory that looks like an IsaacScript project
34
+ // Validate that we are in a directory that looks like an IsaacScript project.
35
35
  function validateInIsaacScriptProject(verbose) {
36
36
  const subdirectoriesToCheck = ["src", "mod", "node_modules"];
37
37
  for (const subdirectoryName of subdirectoriesToCheck) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript",
3
- "version": "2.0.5",
3
+ "version": "2.0.8",
4
4
  "description": "A command line tool for managing Isaac mods written in TypeScript",
5
5
  "homepage": "https://isaacscript.github.io/",
6
6
  "bugs": {
@@ -15,8 +15,13 @@
15
15
  "bin": {
16
16
  "isaacscript": "./dist/src/main.js"
17
17
  },
18
+ "files": [
19
+ "dist/**/*.js",
20
+ "dist/**/*.d.ts",
21
+ "dist/**/*.json"
22
+ ],
18
23
  "dependencies": {
19
- "@types/node": "^17.0.33",
24
+ "@types/node": "^17.0.35",
20
25
  "chalk": "4.1.2",
21
26
  "command-exists": "^1.2.9",
22
27
  "dotenv": "^16.0.1",
@@ -25,17 +30,17 @@
25
30
  "isaacscript-tsconfig": "^1.1.16",
26
31
  "jsonc-parser": "^3.0.0",
27
32
  "moment": "^2.29.3",
28
- "npm-check-updates": "^12.5.11",
33
+ "npm-check-updates": "^13.0.1",
29
34
  "prompt": "^1.3.0",
30
35
  "source-map": "^0.7.3",
31
36
  "source-map-support": "^0.5.21",
32
- "sync-directory": "^5.0.5",
37
+ "sync-directory": "^5.0.8",
33
38
  "ts-node": "^10.7.0",
34
39
  "typescript": "^4.6.4",
35
40
  "typescript-to-lua": "^1.4.4",
36
41
  "update-notifier": "^5.1.0",
37
42
  "yaml": "^2.1.0",
38
- "yargs": "^17.5.0"
43
+ "yargs": "^17.5.1"
39
44
  },
40
45
  "devDependencies": {
41
46
  "@types/command-exists": "^1.2.0",
@@ -45,6 +50,7 @@
45
50
  "@types/source-map-support": "^0.5.4",
46
51
  "@types/update-notifier": "^5.1.0",
47
52
  "@types/yargs": "^17.0.10",
48
- "isaacscript-lint": "^1.0.141"
53
+ "isaacscript-lint": "^1.0.156",
54
+ "isaacscript-spell": "^1.0.3"
49
55
  }
50
56
  }
package/.cspell-base.json DELETED
@@ -1,38 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
3
- "version": "0.2",
4
- "loadDefaultConfiguration": true,
5
- "import": [
6
- "@cspell/dict-companies/cspell-ext.json",
7
- "@cspell/dict-en_us/cspell-ext.json",
8
- "@cspell/dict-public-licenses/cspell-ext.json",
9
- "@cspell/dict-software-terms/cspell-ext.json",
10
- "@cspell/dict-typescript/cspell-ext.json"
11
- ],
12
- "dictionaries": [
13
- "companies",
14
- "en_US",
15
- "networking-terms",
16
- "public-licenses",
17
- "software-terms",
18
- "typescript"
19
- ],
20
- "ignoreRegExpList": [
21
- "Base64MultiLine",
22
- "Base64SingleLine",
23
- "CommitHash",
24
- "CommitHashLink",
25
- "CSSHexValue",
26
- "CStyleHexValue",
27
- "Email",
28
- "HashStrings",
29
- "RsaCert",
30
- "SHA",
31
- "SpellCheckerDisable",
32
- "SpellCheckerIgnoreInDocSetting",
33
- "SshRsa",
34
- "UnicodeRef",
35
- "Urls",
36
- "UUID"
37
- ]
38
- }
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
3
- "version": "0.2",
4
- "import": ["./.cspell-base.json"],
5
- "files": ["**"],
6
- "ignorePaths": [".cspell-temp.json", ".git/**", "dist/**", "node_modules/**"]
7
- }
package/.cspell.json DELETED
@@ -1,53 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
3
- "version": "0.2",
4
- "import": [
5
- "./.cspell-base.json"
6
- ],
7
- "files": [
8
- "**"
9
- ],
10
- "ignorePaths": [
11
- ".git/**",
12
- "dist/**",
13
- "node_modules/**"
14
- ],
15
- "words": [
16
- "APPDATA",
17
- "contentfolder",
18
- "dbaeumer",
19
- "dotenv",
20
- "eslintcache",
21
- "isaacscript",
22
- "jscoverage",
23
- "jspm",
24
- "lcov",
25
- "luamod",
26
- "Microbundle",
27
- "noout",
28
- "npmignore",
29
- "nuxt",
30
- "pftempestasevencondensed",
31
- "pids",
32
- "pnpm",
33
- "prettierignore",
34
- "prettierrc",
35
- "publishedfileid",
36
- "sarisia",
37
- "Spritesheet",
38
- "Spritesheets",
39
- "steamapps",
40
- "steamcmd",
41
- "stylelint",
42
- "stylelintcache",
43
- "subprocesses",
44
- "sycner",
45
- "syncer",
46
- "technote",
47
- "tstl",
48
- "vuepress",
49
- "workshopitem",
50
- "wscript",
51
- "zamiell"
52
- ]
53
- }
package/.eslintrc.js DELETED
@@ -1,28 +0,0 @@
1
- // This is the configuration file for ESLint, the TypeScript linter:
2
- // https://eslint.org/docs/user-guide/configuring
3
- module.exports = {
4
- extends: [
5
- /**
6
- * The linter base is the shared IsaacScript config:
7
- * https://github.com/IsaacScript/eslint-config-isaacscript/blob/main/base.js
8
- */
9
- "eslint-config-isaacscript/base",
10
- ],
11
-
12
- /**
13
- * Don't bother linting the template files (for inserting into a new IsaacScript project) or the
14
- * compiled output.
15
- */
16
- ignorePatterns: ["./file-templates/**", "./dist/**"],
17
-
18
- parserOptions: {
19
- /**
20
- * ESLint needs to know about the project's TypeScript settings in order for TypeScript-specific
21
- * things to lint correctly. We do not point this at "./tsconfig.json" because certain files
22
- * (such at this file) should be linted but not included in the actual project output.
23
- */
24
- project: "./tsconfig.eslint.json",
25
- },
26
-
27
- rules: {},
28
- };
package/.gitattributes DELETED
@@ -1,9 +0,0 @@
1
- # Prevent Windows systems from cloning this repository with "\r\n" line endings.
2
- core.autocrlf=false
3
-
4
- # Prevent people from making merge commits:
5
- # https://www.endoflineblog.com/gitflow-considered-harmful
6
- pull.rebase=true
7
-
8
- # Convert all files to use "\n" line endings.
9
- * text=auto eol=lf
@@ -1,47 +0,0 @@
1
- name: CI
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- build_and_lint:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - name: Checkout the repository
10
- uses: actions/checkout@v2
11
-
12
- - name: Setup Node.js
13
- uses: actions/setup-node@v2
14
- with:
15
- # The default version is 14. The ESLint config requires Node 16 to work properly.
16
- node-version: "16"
17
-
18
- - name: Retrieve the cached "node_modules" directory (if present)
19
- uses: actions/cache@v2
20
- id: node-cache
21
- with:
22
- path: node_modules
23
- key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
24
-
25
- - name: Install dependencies (if the cached directory was not found)
26
- if: steps.node-cache.outputs.cache-hit != 'true'
27
- run: npm ci
28
-
29
- - name: Test to see if the project compiles
30
- run: bash build.sh
31
-
32
- - name: Perform automated checks
33
- run: bash lint.sh
34
-
35
- discord:
36
- name: Discord Failure Notification
37
- needs: [build_and_lint]
38
- if: always() # This is needed to always run this job, even if the other jobs fail.
39
- runs-on: ubuntu-latest
40
- steps:
41
- - uses: technote-space/workflow-conclusion-action@v2
42
- - if: env.WORKFLOW_CONCLUSION != 'success' && env.WORKFLOW_CONCLUSION != 'cancelled'
43
- uses: sarisia/actions-status-discord@v1
44
- with:
45
- webhook: ${{ secrets.DISCORD_WEBHOOK }}
46
- status: ${{ env.WORKFLOW_CONCLUSION }}
47
- title: ""
package/.prettierignore DELETED
@@ -1,5 +0,0 @@
1
- # Ignore compiled output.
2
- dist
3
-
4
- # The VSCode CSpell plugin causes the file to become unformatted whenever a new word is added.
5
- .cspell.json