isaacscript 1.2.40 → 1.2.43

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 (71) hide show
  1. package/.cspell.json +0 -3
  2. package/.prettierrc.js +1 -1
  3. package/.vscode/settings.json +8 -3
  4. package/dist/package.json +8 -8
  5. package/dist/src/checkForWindowsTerminalBugs.js +2 -2
  6. package/dist/src/checkForWindowsTerminalBugs.js.map +1 -1
  7. package/dist/src/commands/copy/copy.js +1 -1
  8. package/dist/src/commands/copy/copy.js.map +1 -1
  9. package/dist/src/commands/init/getModsDir.js +2 -2
  10. package/dist/src/commands/init/getModsDir.js.map +1 -1
  11. package/dist/src/commands/init/getProjectPath.js +2 -3
  12. package/dist/src/commands/init/getProjectPath.js.map +1 -1
  13. package/dist/src/commands/init/git.js +9 -4
  14. package/dist/src/commands/init/git.js.map +1 -1
  15. package/dist/src/commands/init/init.js +6 -6
  16. package/dist/src/commands/init/init.js.map +1 -1
  17. package/dist/src/commands/init/promptSaveSlot.js +3 -2
  18. package/dist/src/commands/init/promptSaveSlot.js.map +1 -1
  19. package/dist/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js +11 -5
  20. package/dist/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js.map +1 -1
  21. package/dist/src/commands/monitor/monitor.js +29 -7
  22. package/dist/src/commands/monitor/monitor.js.map +1 -1
  23. package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js +6 -5
  24. package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js.map +1 -1
  25. package/dist/src/commands/publish/publish.js +7 -7
  26. package/dist/src/commands/publish/publish.js.map +1 -1
  27. package/dist/src/configFile.js +2 -2
  28. package/dist/src/configFile.js.map +1 -1
  29. package/dist/src/exec.js +5 -6
  30. package/dist/src/exec.js.map +1 -1
  31. package/dist/src/main.js +2 -2
  32. package/dist/src/main.js.map +1 -1
  33. package/dist/src/utils.js +2 -2
  34. package/dist/src/utils.js.map +1 -1
  35. package/dist/src/validateNodeVersion.js +3 -3
  36. package/dist/src/validateNodeVersion.js.map +1 -1
  37. package/eslint-debug.sh +3 -0
  38. package/file-templates/dynamic/gitignore +19 -5
  39. package/file-templates/static/.prettierrc.js +1 -1
  40. package/file-templates/static/.vscode/settings.json +5 -0
  41. package/file-templates/static/nuke.sh +1 -1
  42. package/file-templates/static/plugins/addCrashDebugStatements.ts +12 -0
  43. package/file-templates/static/plugins/addIsaacScriptCommentHeader.ts +2 -0
  44. package/file-templates/static/plugins/noExtendedEnums.ts +70 -0
  45. package/file-templates/static/tsconfig.eslint.json +2 -2
  46. package/file-templates/static/tsconfig.json +4 -1
  47. package/file-templates/static/update.sh +5 -1
  48. package/lint.sh +6 -0
  49. package/nuke.sh +1 -1
  50. package/package.json +8 -8
  51. package/src/checkForWindowsTerminalBugs.ts +2 -2
  52. package/src/commands/copy/copy.ts +1 -1
  53. package/src/commands/init/getModsDir.ts +2 -2
  54. package/src/commands/init/getProjectPath.ts +2 -3
  55. package/src/commands/init/git.ts +11 -10
  56. package/src/commands/init/init.ts +6 -6
  57. package/src/commands/init/promptSaveSlot.ts +3 -2
  58. package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts +15 -5
  59. package/src/commands/monitor/monitor.ts +46 -7
  60. package/src/commands/monitor/saveDatWriter/saveDatWriter.ts +7 -6
  61. package/src/commands/publish/publish.ts +7 -7
  62. package/src/configFile.ts +2 -2
  63. package/src/exec.ts +7 -8
  64. package/src/main.ts +2 -2
  65. package/src/utils.ts +4 -4
  66. package/src/validateNodeVersion.ts +3 -3
  67. package/tsconfig.eslint.json +0 -2
  68. package/update.sh +5 -1
  69. package/dist/src/commands/monitor/getTSConfigInclude.js +0 -53
  70. package/dist/src/commands/monitor/getTSConfigInclude.js.map +0 -1
  71. package/src/commands/monitor/getTSConfigInclude.ts +0 -32
package/dist/src/exec.js CHANGED
@@ -57,13 +57,12 @@ function execShell(command, args = [], verbose = false, allowFailure = false, cw
57
57
  if (command.includes('"')) {
58
58
  (0, utils_1.error)("execShell cannot execute commands with double quotes in the command.");
59
59
  }
60
- for (let i = 0; i < args.length; i++) {
61
- if (args[i].includes('"')) {
62
- (0, utils_1.error)("execShell cannot execute commands with double quotes in the arguments.");
63
- }
64
- args[i] = `"${args[i]}"`; // eslint-disable-line no-param-reassign
60
+ const argsHasDoubleQuotes = args.some((arg) => arg.includes('"'));
61
+ if (argsHasDoubleQuotes) {
62
+ (0, utils_1.error)("execShell cannot execute commands with double quotes in the arguments.");
65
63
  }
66
- const commandDescription = `${command} ${args.join(" ")}`.trim();
64
+ const quotedArgs = args.map((arg) => `"${arg}"`);
65
+ const commandDescription = `${command} ${quotedArgs.join(" ")}`.trim();
67
66
  if (verbose) {
68
67
  console.log(`Executing command: ${commandDescription}`);
69
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/exec.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,iDAAsE;AACtE,2CAAkC;AAClC,mCAAgC;AAEhC,SAAgB,OAAO,CAAC,IAAY,EAAE,OAAgB,EAAE,GAAG,GAAG,eAAG;IAC/D,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;KAC1C;IAED,IAAI,MAAc,CAAC;IACnB,IAAI;QACF,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,IAAI,IAAI,GAAG,EAAE;YACnC,GAAG;SACJ,CAAC,CAAC;QACH,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;KACnC;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,aAAK,EAAC,kBAAkB,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;KACrD;IAED,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;KACzC;IAED,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E,IAAI;YACX,GAAG;SACJ,CAAC,CAAC;KACJ;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,aAAK,EACH,sBAAsB,eAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,YAAY,EACjE,GAAG,CACJ,CAAC;KACH;IAED,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,qBAAqB,kBAAkB,EAAE,CAAC,CAAC;KACxD;IAED,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAC3C,IAAI,UAAU,KAAK,IAAI,EAAE;QACvB,IAAA,aAAK,EAAC,+CAA+C,kBAAkB,EAAE,CAAC,CAAC;KAC5E;IAED,MAAM,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAEzD,IAAI,UAAU,KAAK,CAAC,EAAE;QACpB,IAAI,YAAY,EAAE;YAChB,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;SAC7B;QAED,OAAO,CAAC,KAAK,CACX,sBAAsB,eAAK,CAAC,KAAK,CAC/B,kBAAkB,CACnB,kCAAkC,UAAU,GAAG,CACjD,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAC5C,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACtB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC;AAtED,8BAsEC"}
package/dist/src/main.js CHANGED
@@ -61,7 +61,7 @@ async function main() {
61
61
  loadEnvironmentVariables();
62
62
  // Get command line arguments
63
63
  const argv = (0, parseArgs_1.parseArgs)();
64
- const verbose = argv.verbose === true;
64
+ const verbose = argv["verbose"] === true;
65
65
  printBanner();
66
66
  // Check for a new version
67
67
  (0, update_notifier_1.default)({ pkg: package_json_1.default }).notify();
@@ -82,7 +82,7 @@ function printBanner() {
82
82
  console.log();
83
83
  }
84
84
  async function handleCommands(argv, verbose) {
85
- const positionalArgs = argv._;
85
+ const positionalArgs = argv["_"];
86
86
  let command;
87
87
  if (positionalArgs.length > 0) {
88
88
  command = positionalArgs[0];
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kDAA0B;AAC1B,+CAAiC;AACjC,oDAA4B;AAC5B,gDAAwB;AACxB,4EAAkD;AAClD,sEAA6C;AAC7C,mEAAkC;AAClC,+EAA4E;AAC5E,+CAA4C;AAC5C,+CAA4C;AAC5C,wDAAqD;AACrD,wDAAqD;AACrD,yDAA2C;AAC3C,2CAAgD;AAChD,iCAAmC;AACnC,2CAAwC;AACxC,qCAAsC;AACtC,6CAA2D;AAC3D,2CAAwC;AACxC,mCAAgD;AAChD,iFAA8E;AAC9E,+DAA4D;AAC5D,6CAA0C;AAE1C,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,IAAA,aAAK,EAAC,GAAG,wBAAY,UAAU,EAAE,GAAG,CAAC,CAAC;AACxC,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,4BAAgB,CAAC,OAAO,EAAE,CAAC;IAC3B,IAAA,mBAAU,GAAE,CAAC;IACb,IAAA,yCAAmB,GAAE,CAAC;IACtB,IAAA,uBAAU,GAAE,CAAC;IACb,wBAAwB,EAAE,CAAC;IAE3B,6BAA6B;IAC7B,MAAM,IAAI,GAAG,IAAA,qBAAS,GAAE,CAAC;IACzB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC;IAEtC,WAAW,EAAE,CAAC;IAEd,0BAA0B;IAC1B,IAAA,yBAAc,EAAC,EAAE,GAAG,EAAH,sBAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAEjC,oBAAoB;IACpB,MAAM,IAAA,yDAA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AC;YACxB,MAAM;SACP;KACF;IAED,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC"}
package/dist/src/utils.js CHANGED
@@ -70,11 +70,11 @@ function parseSemVer(versionString) {
70
70
  if (Number.isNaN(majorVersion)) {
71
71
  error(`Failed to parse the major version number from: ${versionString}`);
72
72
  }
73
- const minorVersion = parseInt(minorVersionString, 10);
73
+ const minorVersion = parseIntSafe(minorVersionString);
74
74
  if (Number.isNaN(minorVersion)) {
75
75
  error(`Failed to parse the minor version number from: ${versionString}`);
76
76
  }
77
- const patchVersion = parseInt(patchVersionString, 10);
77
+ const patchVersion = parseIntSafe(patchVersionString);
78
78
  if (Number.isNaN(patchVersion)) {
79
79
  error(`Failed to parse the patch version number from: ${versionString}`);
80
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,2CAAqD;AAGrD,mFAAmF;AACnF,MAAM,gBAAgB,GACpB,uEAAuE,CAAC;AAEnE,MAAM,cAAc,GAAG,CAAC,GAAU,EAAS,EAAE,CAAC,GAAG,CAAC;AAA5C,QAAA,cAAc,kBAA8B;AAEzD,SAAgB,KAAK,CAAC,GAAG,IAAe;IACtC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAHD,sBAGC;AAED,SAAgB,yBAAyB,CAAC,MAAc;IACtD,OAAO,MAAM,CAAC,4BAA4B,KAAK,SAAS;QACtD,CAAC,CAAC,kCAAsB;QACxB,CAAC,CAAC,MAAM,CAAC,4BAA4B,CAAC;AAC1C,CAAC;AAJD,8DAIC;AAED,SAAgB,OAAO;IACrB,OAAO,IAAA,gBAAM,GAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,oBA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E,MAAM,YAAY,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACtD,IAAI,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;QAC9B,KAAK,CAAC,kDAAkD,aAAa,EAAE,CAAC,CAAC;KAC1E;IAED,MAAM,YAAY,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACtD,IAAI,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;QAC9B,KAAK,CAAC,kDAAkD,aAAa,EAAE,CAAC,CAAC;KAC1E;IAED,MAAM,YAAY,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACtD,IAAI,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;QAC9B,KAAK,CAAC,kDAAkD,aAAa,EAAE,CAAC,CAAC;KAC1E;IAED,OAAO,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AACpD,CAAC;AA1BD,kCA0BC"}
@@ -12,12 +12,12 @@ const REQUIRED_NODE_JS_MAJOR_VERSION = 16;
12
12
  // since that is the version that added the "fs.rmSync()" function
13
13
  // (I tested on Node v15.0.0 and it failed)
14
14
  function validateNodeVersion() {
15
- const nodeJSVersionString = process.version;
16
- const [majorVersion] = (0, utils_1.parseSemVer)(nodeJSVersionString);
15
+ const { version } = process;
16
+ const [majorVersion] = (0, utils_1.parseSemVer)(version);
17
17
  if (majorVersion >= REQUIRED_NODE_JS_MAJOR_VERSION) {
18
18
  return;
19
19
  }
20
- console.error(`Your Node.js version is: ${chalk_1.default.red(nodeJSVersionString)}`);
20
+ console.error(`Your Node.js version is: ${chalk_1.default.red(version)}`);
21
21
  console.error(`${constants_1.PROJECT_NAME} requires a Node.js version of ${chalk_1.default.red(`${REQUIRED_NODE_JS_MAJOR_VERSION}.0.0`)} or greater.`);
22
22
  console.error(`Please upgrade your version of Node.js before using ${constants_1.PROJECT_NAME}.`);
23
23
  process.exit(1);
@@ -1 +1 @@
1
- {"version":3,"file":"validateNodeVersion.js","sourceRoot":"","sources":["../../src/validateNodeVersion.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,2CAA2C;AAC3C,mCAAsC;AAEtC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAE1C,qDAAqD;AACrD,kEAAkE;AAClE,2CAA2C;AAC3C,SAAgB,mBAAmB;IACjC,MAAM,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAC5C,MAAM,CAAC,YAAY,CAAC,GAAG,IAAA,mBAAW,EAAC,mBAAmB,CAAC,CAAC;IAExD,IAAI,YAAY,IAAI,8BAA8B,EAAE;QAClD,OAAO;KACR;IAED,OAAO,CAAC,KAAK,CAAC,4BAA4B,eAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;IAC5E,OAAO,CAAC,KAAK,CACX,GAAG,wBAAY,kCAAkC,eAAK,CAAC,GAAG,CACxD,GAAG,8BAA8B,MAAM,CACxC,cAAc,CAChB,CAAC;IACF,OAAO,CAAC,KAAK,CACX,uDAAuD,wBAAY,GAAG,CACvE,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAlBD,kDAkBC"}
1
+ {"version":3,"file":"validateNodeVersion.js","sourceRoot":"","sources":["../../src/validateNodeVersion.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,2CAA2C;AAC3C,mCAAsC;AAEtC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAE1C,qDAAqD;AACrD,kEAAkE;AAClE,2CAA2C;AAC3C,SAAgB,mBAAmB;IACjC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,YAAY,CAAC,GAAG,IAAA,mBAAW,EAAC,OAAO,CAAC,CAAC;IAE5C,IAAI,YAAY,IAAI,8BAA8B,EAAE;QAClD,OAAO;KACR;IAED,OAAO,CAAC,KAAK,CAAC,4BAA4B,eAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAChE,OAAO,CAAC,KAAK,CACX,GAAG,wBAAY,kCAAkC,eAAK,CAAC,GAAG,CACxD,GAAG,8BAA8B,MAAM,CACxC,cAAc,CAChB,CAAC;IACF,OAAO,CAAC,KAAK,CACX,uDAAuD,wBAAY,GAAG,CACvE,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAlBD,kDAkBC"}
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ npx eslint --print-config ./src/main.ts > debug.txt
@@ -7,10 +7,10 @@ mod/main.lua
7
7
  # MacOS artifacts
8
8
  .DS_Store
9
9
 
10
- # --------------------------------------------------------------
10
+ # ------------------------------
11
11
  # GitHub Node.gitignore template
12
- # https://github.com/github/gitignore/blob/master/Node.gitignore
13
- # --------------------------------------------------------------
12
+ # https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore
13
+ # ------------------------------
14
14
 
15
15
  # Logs
16
16
  logs
@@ -19,6 +19,7 @@ npm-debug.log*
19
19
  yarn-debug.log*
20
20
  yarn-error.log*
21
21
  lerna-debug.log*
22
+ .pnpm-debug.log*
22
23
 
23
24
  # Diagnostic reports (https://nodejs.org/api/report.html)
24
25
  report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
@@ -67,6 +68,9 @@ web_modules/
67
68
  # Optional eslint cache
68
69
  .eslintcache
69
70
 
71
+ # Optional stylelint cache
72
+ .stylelintcache
73
+
70
74
  # Microbundle cache
71
75
  .rpt2_cache/
72
76
  .rts2_cache_cjs/
@@ -82,9 +86,12 @@ web_modules/
82
86
  # Yarn Integrity file
83
87
  .yarn-integrity
84
88
 
85
- # dotenv environment variables file
89
+ # dotenv environment variable files
86
90
  .env
87
- .env.test
91
+ .env.development.local
92
+ .env.test.local
93
+ .env.production.local
94
+ .env.local
88
95
 
89
96
  # parcel-bundler cache (https://parceljs.org/)
90
97
  .cache
@@ -107,6 +114,13 @@ dist
107
114
  # vuepress build output
108
115
  .vuepress/dist
109
116
 
117
+ # vuepress v2.x temp and cache directory
118
+ .temp
119
+ .cache
120
+
121
+ # Docusaurus cache and generated files
122
+ .docusaurus
123
+
110
124
  # Serverless directories
111
125
  .serverless/
112
126
 
@@ -7,7 +7,7 @@ module.exports = {
7
7
  // The Airbnb style guide agrees:
8
8
  // https://github.com/airbnb/javascript#commas--dangling
9
9
  // Prettier itself also acknowledges Nik Graf's blog in their official blog:
10
- // https://prettier.io/blog/2020/03/21/2.0.0.html#change-default-value-for-trailingcomma-to-es5-6963httpsgithubcomprettierprettierpull6963-by-fiskerhttpsgithubcomfisker
10
+ // https://prettier.io/blog/2020/03/21/2.0.0.html
11
11
  // https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8
12
12
  // Prettier will change the default in the future:
13
13
  // https://github.com/prettier/prettier/issues/9369
@@ -51,6 +51,11 @@
51
51
  "editor.formatOnSave": true,
52
52
  "editor.tabSize": 2,
53
53
  },
54
+ "[markdown]": {
55
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
56
+ "editor.formatOnSave": true,
57
+ "editor.tabSize": 2
58
+ },
54
59
  "[xml]": {
55
60
  "editor.defaultFormatter": "esbenp.prettier-vscode",
56
61
  "editor.formatOnSave": true,
@@ -15,4 +15,4 @@ rm -rf "$NODE_MODULES"
15
15
  echo "Successfully deleted: $NODE_MODULES"
16
16
 
17
17
  npm install
18
- echo "Successfully reinstalled Node depedencies."
18
+ echo "Successfully reinstalled Node dependencies."
@@ -1,3 +1,15 @@
1
+ /**
2
+ * When you write code that causes the game to crash, it can be difficult to find the exact line of
3
+ * code that is causing the crash.
4
+ *
5
+ * In these situations, you can enable this plugin, which will add a log statement in between every
6
+ * line of Lua code with a randomly-generated UUID. That way, you can cause the crash, and then look
7
+ * at the bottom of the "log.txt" for the final UUID that shows up.
8
+ *
9
+ * Next, you can Ctrl + f in the "main.lua" file for the matching UUID, which will bring you to the
10
+ * exact point in the code where the crash happened.
11
+ */
12
+
1
13
  import * as crypto from "crypto";
2
14
  import { SourceNode } from "source-map";
3
15
  import * as ts from "typescript";
@@ -1,3 +1,5 @@
1
+ /** This plugin adds an explanatory header to the top of the generated Lua code. */
2
+
1
3
  import * as ts from "typescript";
2
4
  import * as tstl from "typescript-to-lua";
3
5
 
@@ -0,0 +1,70 @@
1
+ /**
2
+ * This plugin prevents transpiled enums from using global variables as a base (if present).
3
+ *
4
+ * For example, by default, the following enum:
5
+ *
6
+ * ```ts
7
+ * export enum Foo {
8
+ * Value1,
9
+ * Value2,
10
+ * }
11
+ * ```
12
+ *
13
+ * Will be transpiled to this:
14
+ *
15
+ * ```lua
16
+ * local ____exports = {}
17
+ * ____exports.Foo = Foo or ({})
18
+ * ____exports.Foo.Value1 = 0
19
+ * ____exports.Foo[____exports.Foo.Value1] = "Value1"
20
+ * ____exports.Foo.Value2 = 1
21
+ * ____exports.Foo[____exports.Foo.Value2] = "Value2"
22
+ * return ____exports
23
+ * ```
24
+ *
25
+ * As we can see, the first line uses the existing global variable of "Foo" as a base, if present.
26
+ * The reason it does this is because TSTL needs to support the TypeScript feature of combining
27
+ * enums, like this:
28
+ *
29
+ * ```ts
30
+ * enum Foo {
31
+ * Value1,
32
+ * }
33
+ * enum Foo {
34
+ * Value2,
35
+ * }
36
+ * ```
37
+ *
38
+ * Unfortunately, this design decision means that local enums will essentially turn into global
39
+ * variables. This plugin removes this behavior, always making enums local variables.
40
+ */
41
+
42
+ import * as ts from "typescript";
43
+ import * as tstl from "typescript-to-lua";
44
+
45
+ const plugin: tstl.Plugin = {
46
+ visitors: {
47
+ [ts.SyntaxKind.EnumDeclaration]: (node, context) => {
48
+ // Call the normal TSTL enum transpilation method
49
+ const statements = context.superTransformStatements(node);
50
+
51
+ // Create a new element, which will be equal to:
52
+ // local ____exports.Foo = {}
53
+ const name = node.name.escapedText as string;
54
+ const identifier = tstl.createIdentifier(name, node.name);
55
+ const table = tstl.createTableExpression();
56
+ const declaration = tstl.createVariableDeclarationStatement(
57
+ identifier,
58
+ table,
59
+ );
60
+
61
+ // Swap the old first element, which will be equal to:
62
+ // local ____exports.Foo = Foo or ({})
63
+ statements[0] = declaration;
64
+
65
+ return statements;
66
+ },
67
+ },
68
+ };
69
+
70
+ export default plugin;
@@ -1,8 +1,8 @@
1
- // A special TypeScript project file, used by ESLint only
1
+ // A special TypeScript configuration file, used by ESLint only
2
2
  {
3
3
  "extends": "./tsconfig.json",
4
4
  "include": [
5
- // These must match the base the "include" setting in the base "tsconfig.json" file
5
+ // This must match the "include" setting in the "tsconfig.json" file
6
6
  "./src/**/*.ts",
7
7
 
8
8
  // These are ESLint-only inclusions
@@ -21,9 +21,12 @@
21
21
  "luaBundle": "./mod/main.lua", // Will bundle all output Lua files into a single file
22
22
  "luaBundleEntry": "./src/bundleEntry.ts", // This invokes the "main.ts" file
23
23
  "luaPlugins": [
24
- // A plugin to emit a helper comment at the top of the compiled "main.lua" file
24
+ // A plugin to add an explanatory comment at the top of the compiled "main.lua" file
25
25
  { "name": "./plugins/addIsaacScriptCommentHeader.ts" },
26
26
 
27
+ // A plugin to make enums safe from global variables
28
+ { "name": "./plugins/noExtendedEnums.ts" },
29
+
27
30
  // Uncomment this and recompile the mod to enable crash debugging, which will tell you the
28
31
  // exact line of the mod that is causing the crash
29
32
  // { "name": "./plugins/addCrashDebugStatements.ts" },
@@ -13,5 +13,9 @@ OLD_HASH=$(md5sum "$PACKAGE_JSON")
13
13
  npx npm-check-updates --upgrade --packageFile "$PACKAGE_JSON"
14
14
  NEW_HASH=$(md5sum "$PACKAGE_JSON")
15
15
  if [[ $OLD_HASH != $NEW_HASH ]]; then
16
- npm install
16
+ if test -f "$DIR/yarn.lock"; then
17
+ yarn
18
+ else
19
+ npm install
20
+ fi
17
21
  fi
package/lint.sh CHANGED
@@ -26,4 +26,10 @@ npx cspell --no-progress --no-summary "src/**/*.ts"
26
26
  # The "--error" flag makes it return an error code of 1 if unused exports are found
27
27
  npx ts-prune --error
28
28
 
29
+ # Step 5 - Check for gitignore updates from GitHub
30
+ tail -n +6 .gitignore > gitignore-template-local
31
+ curl https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore --output gitignore-template-github --silent
32
+ diff gitignore-template-local gitignore-template-github
33
+ rm -f gitignore-template-local gitignore-template-github
34
+
29
35
  echo "Successfully linted in $SECONDS seconds."
package/nuke.sh CHANGED
@@ -15,4 +15,4 @@ rm -rf "$NODE_MODULES"
15
15
  echo "Successfully deleted: $NODE_MODULES"
16
16
 
17
17
  npm install
18
- echo "Successfully reinstalled Node depedencies."
18
+ echo "Successfully reinstalled Node dependencies."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript",
3
- "version": "1.2.40",
3
+ "version": "1.2.43",
4
4
  "description": "A command line tool for managing Isaac mods written in TypeScript",
5
5
  "homepage": "https://isaacscript.github.io/",
6
6
  "bugs": {
@@ -16,23 +16,23 @@
16
16
  "isaacscript": "./dist/src/main.js"
17
17
  },
18
18
  "dependencies": {
19
- "@types/node": "^17.0.25",
19
+ "@types/node": "^17.0.31",
20
20
  "chalk": "4.1.2",
21
21
  "command-exists": "^1.2.9",
22
22
  "dotenv": "^16.0.0",
23
23
  "figlet": "^1.5.2",
24
24
  "fs-extra": "^10.1.0",
25
- "isaacscript-tsconfig": "^1.1.9",
25
+ "isaacscript-tsconfig": "^1.1.14",
26
26
  "jsonc-parser": "^3.0.0",
27
27
  "moment": "^2.29.3",
28
- "npm-check-updates": "^12.5.9",
28
+ "npm-check-updates": "^12.5.11",
29
29
  "prompt": "^1.3.0",
30
30
  "source-map": "^0.7.3",
31
31
  "source-map-support": "^0.5.21",
32
- "sync-directory": "^4.1.2",
32
+ "sync-directory": "^5.0.5",
33
33
  "ts-node": "^10.7.0",
34
- "typescript": "^4.6.3",
35
- "typescript-to-lua": "^1.4.3",
34
+ "typescript": "^4.6.4",
35
+ "typescript-to-lua": "^1.4.4",
36
36
  "update-notifier": "^5.1.0",
37
37
  "yaml": "^2.0.1",
38
38
  "yargs": "^17.4.1"
@@ -45,6 +45,6 @@
45
45
  "@types/source-map-support": "^0.5.4",
46
46
  "@types/update-notifier": "^5.1.0",
47
47
  "@types/yargs": "^17.0.10",
48
- "isaacscript-lint": "^1.0.99"
48
+ "isaacscript-lint": "^1.0.113"
49
49
  }
50
50
  }
@@ -18,7 +18,7 @@ export async function checkForWindowsTerminalBugs(
18
18
  return;
19
19
  }
20
20
 
21
- if (process.env.SHELL !== "C:\\Program Files\\Git\\usr\\bin\\bash.exe") {
21
+ if (process.env["SHELL"] !== "C:\\Program Files\\Git\\usr\\bin\\bash.exe") {
22
22
  return;
23
23
  }
24
24
 
@@ -26,7 +26,7 @@ export async function checkForWindowsTerminalBugs(
26
26
  }
27
27
 
28
28
  async function checkForWindowsBugColor(verbose: boolean) {
29
- if (process.env.FORCE_COLOR === "true") {
29
+ if (process.env["FORCE_COLOR"] === "true") {
30
30
  return;
31
31
  }
32
32
 
@@ -6,7 +6,7 @@ import { Config } from "../../types/Config";
6
6
  import { getModTargetDirectoryName } from "../../utils";
7
7
 
8
8
  export function copy(argv: Record<string, unknown>, config: Config): void {
9
- const verbose = argv.verbose === true;
9
+ const verbose = argv["verbose"] === true;
10
10
 
11
11
  const modTargetDirectoryName = getModTargetDirectoryName(config);
12
12
  const modTargetPath = path.join(config.modsDirectory, modTargetDirectoryName);
@@ -33,10 +33,10 @@ export async function getModsDir(
33
33
  argv: Record<string, unknown>,
34
34
  verbose: boolean,
35
35
  ): Promise<string> {
36
- if (argv.modsDirectory !== undefined) {
36
+ if (argv["modsDirectory"] !== undefined) {
37
37
  // They specified the "--mods-directory" command-line flag,
38
38
  // so there is no need to prompt the user for it
39
- return argv.modsDirectory as string;
39
+ return argv["modsDirectory"] as string;
40
40
  }
41
41
 
42
42
  const defaultModsPath = getDefaultModsPath(process.platform);
@@ -56,9 +56,8 @@ export async function getProjectPath(
56
56
  function getProjectNameFromCommandLineArgument(
57
57
  argv: Record<string, unknown>,
58
58
  ): string | undefined {
59
- return typeof argv.name === "string" && argv.name !== ""
60
- ? argv.name
61
- : undefined;
59
+ const name = argv["name"];
60
+ return typeof name === "string" && name !== "" ? name : undefined;
62
61
  }
63
62
 
64
63
  async function getNewProjectName(): Promise<[string, string, boolean]> {
@@ -133,19 +133,16 @@ function validateNewGitVersion(verbose: boolean) {
133
133
 
134
134
  function getGitHubUsername(verbose: boolean) {
135
135
  // If the GitHub CLI is installed, we can derive the user's GitHub username
136
- if (
137
- !commandExists.sync("gh") ||
138
- process.env.APPDATA === undefined ||
139
- process.env.APPDATA === ""
140
- ) {
136
+ if (!commandExists.sync("gh")) {
141
137
  return undefined;
142
138
  }
143
139
 
144
- const githubCLIHostsPath = path.join(
145
- process.env.APPDATA,
146
- "GitHub CLI",
147
- "hosts.yml",
148
- );
140
+ const appData = process.env["APPDATA"];
141
+ if (appData === undefined || appData === "") {
142
+ return undefined;
143
+ }
144
+
145
+ const githubCLIHostsPath = path.join(appData, "GitHub CLI", "hosts.yml");
149
146
  if (!file.exists(githubCLIHostsPath, verbose)) {
150
147
  return undefined;
151
148
  }
@@ -179,6 +176,10 @@ export function initGitRepository(
179
176
  return;
180
177
  }
181
178
 
179
+ if (gitRemoteURL === undefined) {
180
+ return;
181
+ }
182
+
182
183
  execShell("git", ["init"], verbose, false, projectPath);
183
184
  execShell("git", ["branch", "-M", "main"], verbose, false, projectPath);
184
185
 
@@ -14,12 +14,12 @@ import { promptSaveSlot } from "./promptSaveSlot";
14
14
  import { promptVSCode } from "./promptVSCode";
15
15
 
16
16
  export async function init(argv: Record<string, unknown>): Promise<void> {
17
- const skipNPMInstall = argv.skipNpmInstall === true;
18
- const useCurrentDir = argv.useCurrentDir === true;
19
- const verbose = argv.verbose === true;
20
- const vscode = argv.vscode === true;
21
- const yes = argv.yes === true;
22
- const forceName = argv.forceName === true;
17
+ const skipNPMInstall = argv["skipNpmInstall"] === true;
18
+ const useCurrentDir = argv["useCurrentDir"] === true;
19
+ const verbose = argv["verbose"] === true;
20
+ const vscode = argv["vscode"] === true;
21
+ const yes = argv["yes"] === true;
22
+ const forceName = argv["forceName"] === true;
23
23
 
24
24
  // Prompt the end-user for some information (and validate it as we go)
25
25
  const [projectPath, createNewDir] = await getProjectPath(
@@ -5,10 +5,11 @@ export async function promptSaveSlot(
5
5
  argv: Record<string, unknown>,
6
6
  yes: boolean,
7
7
  ): Promise<number> {
8
- if (argv.saveSlot !== undefined) {
8
+ if (argv["saveSlot"] !== undefined) {
9
9
  // They specified the "--save-slot" command-line flag,
10
10
  // so there is no need to prompt the user for it
11
- return argv.saveSlot as number;
11
+ // (yargs converts this to a number)
12
+ return argv["saveSlot"] as number;
12
13
  }
13
14
 
14
15
  if (yes) {
@@ -1,21 +1,31 @@
1
1
  import syncDirectory from "sync-directory";
2
2
  import { FILE_SYNCED_MESSAGE } from "../../../constants";
3
3
 
4
+ const SUBPROCESS_NAME = "directory syncer";
5
+ const BASE_ARGV_LENGTH = 2;
6
+
4
7
  let modSourcePath: string;
5
8
  let modTargetPath: string;
6
9
 
7
10
  init();
8
11
 
9
12
  function init() {
10
- const numArgs = 2;
11
- if (process.argv.length !== 2 + numArgs) {
13
+ const firstArg = process.argv[BASE_ARGV_LENGTH];
14
+ if (firstArg === undefined) {
15
+ throw new Error(
16
+ `The ${SUBPROCESS_NAME} process did not get a valid first argument.`,
17
+ );
18
+ }
19
+
20
+ const secondArg = process.argv[BASE_ARGV_LENGTH + 1];
21
+ if (secondArg === undefined) {
12
22
  throw new Error(
13
- "The directory syncer process did not get the right amount of arguments.",
23
+ `The ${SUBPROCESS_NAME} process did not get the right amount of arguments.`,
14
24
  );
15
25
  }
16
26
 
17
- modSourcePath = process.argv[2];
18
- modTargetPath = process.argv[3];
27
+ modSourcePath = firstArg;
28
+ modTargetPath = secondArg;
19
29
 
20
30
  syncDirectory(modSourcePath, modTargetPath, {
21
31
  watch: true,