isaacscript 1.1.47 → 1.1.51

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.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript",
3
- "version": "1.1.47",
3
+ "version": "1.1.51",
4
4
  "description": "A command line tool for managing Isaac mods written in TypeScript",
5
5
  "homepage": "https://isaacscript.github.io/",
6
6
  "bugs": {
@@ -28,19 +28,19 @@
28
28
  "source-map-support": "^0.5.21",
29
29
  "sync-directory": "^4.0.7",
30
30
  "typescript": "4.4.4",
31
- "typescript-to-lua": "^1.1.1",
31
+ "typescript-to-lua": "1.1.1",
32
32
  "update-notifier": "^5.1.0",
33
- "yargs": "^17.2.1"
33
+ "yargs": "^17.3.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/command-exists": "^1.2.0",
37
37
  "@types/figlet": "^1.5.4",
38
38
  "@types/fs-extra": "^9.0.13",
39
- "@types/node": "^16.11.10",
39
+ "@types/node": "^16.11.11",
40
40
  "@types/prompts": "^2.0.14",
41
41
  "@types/source-map-support": "^0.5.4",
42
42
  "@types/update-notifier": "^5.1.0",
43
43
  "@types/yargs": "^17.0.7",
44
- "isaacscript-lint": "^1.0.67"
44
+ "isaacscript-lint": "^1.0.71"
45
45
  }
46
46
  }
@@ -42,6 +42,20 @@ see the official website: https://isaacscript.github.io/
42
42
  --]]
43
43
 
44
44
  `;
45
+ const MAIN_LUA_REPLACEMENTS = [
46
+ // For TSTL v1.2.0
47
+ /*
48
+ ["WeakMap = __TS__Class()", "WeakMap = WeakMap or __TS__Class()"],
49
+ ["WeakSet = __TS__Class()", "WeakSet = WeakSet or __TS__Class()"],
50
+ ["Map = __TS__Class()", "Map = Map or __TS__Class()"],
51
+ "Set = __TS__Class()", "Set = Set or __TS__Class()"],
52
+ */
53
+ // For TSTL v1.1.1
54
+ ["WeakMap = (function", "WeakMap = WeakMap or (function"],
55
+ ["WeakSet = (function", "WeakSet = WeakSet or (function"],
56
+ ["Map = (function", "Map = Map or (function"],
57
+ ["Set = (function", "Set = Set or (function"],
58
+ ];
45
59
  function monkeyPatchMainLua(targetModDirectory) {
46
60
  const mainLuaPath = path_1.default.join(targetModDirectory, constants_1.MAIN_LUA);
47
61
  let mainLua = file.read(mainLuaPath);
@@ -61,10 +75,9 @@ function patchInformationalHeader(mainLua) {
61
75
  // at the transpiled Lua code
62
76
  function patchGlobalObjects(originalMainLua) {
63
77
  let mainLua = originalMainLua;
64
- mainLua = mainLua.replace("WeakMap = (function", "WeakMap = WeakMap or (function");
65
- mainLua = mainLua.replace("WeakSet = (function", "WeakSet = WeakSet or (function");
66
- mainLua = mainLua.replace("Map = (function", "Map = Map or (function");
67
- mainLua = mainLua.replace("Set = (function", "Set = Set or (function");
78
+ for (const [findString, replaceString] of MAIN_LUA_REPLACEMENTS) {
79
+ mainLua = mainLua.replace(findString, replaceString);
80
+ }
68
81
  return mainLua;
69
82
  }
70
83
  //# sourceMappingURL=monkeyPatch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"monkeyPatch.js","sourceRoot":"","sources":["../../src/monkeyPatch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,2CAAuC;AACvC,6CAA+B;AAE/B,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;CAe5B,CAAC;AAEF,SAAgB,kBAAkB,CAAC,kBAA0B;IAC3D,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,oBAAQ,CAAC,CAAC;IAC5D,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAErC,OAAO,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAEtC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AARD,gD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CAAC;IAErC,OAAO,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAEtC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AARD,gDAQC;AAED,kFAAkF;AAClF,SAAS,wBAAwB,CAAC,OAAe;IAC/C,OAAO,oBAAoB,GAAG,OAAO,CAAC;AACxC,CAAC;AAED,2EAA2E;AAC3E,mFAAmF;AACnF,oDAAoD;AACpD,kGAAkG;AAClG,6BAA6B;AAC7B,SAAS,kBAAkB,CAAC,eAAuB;IACjD,IAAI,OAAO,GAAG,eAAe,CAAC;IAE9B,KAAK,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,IAAI,qBAAqB,EAAE;QAC/D,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;KACtD;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript",
3
- "version": "1.1.47",
3
+ "version": "1.1.51",
4
4
  "description": "A command line tool for managing Isaac mods written in TypeScript",
5
5
  "homepage": "https://isaacscript.github.io/",
6
6
  "bugs": {
@@ -28,19 +28,19 @@
28
28
  "source-map-support": "^0.5.21",
29
29
  "sync-directory": "^4.0.7",
30
30
  "typescript": "4.4.4",
31
- "typescript-to-lua": "^1.1.1",
31
+ "typescript-to-lua": "1.1.1",
32
32
  "update-notifier": "^5.1.0",
33
- "yargs": "^17.2.1"
33
+ "yargs": "^17.3.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/command-exists": "^1.2.0",
37
37
  "@types/figlet": "^1.5.4",
38
38
  "@types/fs-extra": "^9.0.13",
39
- "@types/node": "^16.11.10",
39
+ "@types/node": "^16.11.11",
40
40
  "@types/prompts": "^2.0.14",
41
41
  "@types/source-map-support": "^0.5.4",
42
42
  "@types/update-notifier": "^5.1.0",
43
43
  "@types/yargs": "^17.0.7",
44
- "isaacscript-lint": "^1.0.67"
44
+ "isaacscript-lint": "^1.0.71"
45
45
  }
46
46
  }
@@ -19,6 +19,22 @@ see the official website: https://isaacscript.github.io/
19
19
 
20
20
  `;
21
21
 
22
+ const MAIN_LUA_REPLACEMENTS = [
23
+ // For TSTL v1.2.0
24
+ /*
25
+ ["WeakMap = __TS__Class()", "WeakMap = WeakMap or __TS__Class()"],
26
+ ["WeakSet = __TS__Class()", "WeakSet = WeakSet or __TS__Class()"],
27
+ ["Map = __TS__Class()", "Map = Map or __TS__Class()"],
28
+ "Set = __TS__Class()", "Set = Set or __TS__Class()"],
29
+ */
30
+
31
+ // For TSTL v1.1.1
32
+ ["WeakMap = (function", "WeakMap = WeakMap or (function"],
33
+ ["WeakSet = (function", "WeakSet = WeakSet or (function"],
34
+ ["Map = (function", "Map = Map or (function"],
35
+ ["Set = (function", "Set = Set or (function"],
36
+ ];
37
+
22
38
  export function monkeyPatchMainLua(targetModDirectory: string): void {
23
39
  const mainLuaPath = path.join(targetModDirectory, MAIN_LUA);
24
40
  let mainLua = file.read(mainLuaPath);
@@ -42,16 +58,9 @@ function patchInformationalHeader(mainLua: string) {
42
58
  function patchGlobalObjects(originalMainLua: string) {
43
59
  let mainLua = originalMainLua;
44
60
 
45
- mainLua = mainLua.replace(
46
- "WeakMap = (function",
47
- "WeakMap = WeakMap or (function",
48
- );
49
- mainLua = mainLua.replace(
50
- "WeakSet = (function",
51
- "WeakSet = WeakSet or (function",
52
- );
53
- mainLua = mainLua.replace("Map = (function", "Map = Map or (function");
54
- mainLua = mainLua.replace("Set = (function", "Set = Set or (function");
61
+ for (const [findString, replaceString] of MAIN_LUA_REPLACEMENTS) {
62
+ mainLua = mainLua.replace(findString, replaceString);
63
+ }
55
64
 
56
65
  return mainLua;
57
66
  }
package/update.sh CHANGED
@@ -10,7 +10,7 @@ cd "$DIR"
10
10
 
11
11
  PACKAGE_JSON="$DIR/package.json"
12
12
  OLD_HASH=$(md5sum "$PACKAGE_JSON")
13
- npx npm-check-updates --upgrade --packageFile "$PACKAGE_JSON" --reject typescript,chalk
13
+ npx npm-check-updates --upgrade --packageFile "$PACKAGE_JSON" --reject chalk,typescript,typescript-to-lua
14
14
  NEW_HASH=$(md5sum "$PACKAGE_JSON")
15
15
  if [[ $OLD_HASH != $NEW_HASH ]]; then
16
16
  npm install