isaacscript 1.2.6 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +2 -2
- package/dist/src/checkForWindowsTerminalBugs.js +2 -2
- package/dist/src/checkForWindowsTerminalBugs.js.map +1 -1
- package/dist/src/commands/copy/copy.js +3 -3
- package/dist/src/commands/copy/copy.js.map +1 -1
- package/dist/src/commands/init/checkIfProjectPathExists.js +2 -2
- package/dist/src/commands/init/checkIfProjectPathExists.js.map +1 -1
- package/dist/src/commands/init/checkModTargetDirectory.js +2 -2
- package/dist/src/commands/init/checkModTargetDirectory.js.map +1 -1
- package/dist/src/commands/init/createMod.js +3 -3
- package/dist/src/commands/init/createMod.js.map +1 -1
- package/dist/src/commands/init/getModsDir.js +6 -6
- package/dist/src/commands/init/getModsDir.js.map +1 -1
- package/dist/src/commands/init/getProjectPath.js +2 -2
- package/dist/src/commands/init/getProjectPath.js.map +1 -1
- package/dist/src/commands/init/installVSCodeExtensions.js +2 -2
- package/dist/src/commands/init/installVSCodeExtensions.js.map +1 -1
- package/dist/src/commands/init/promptSaveSlot.js +2 -2
- package/dist/src/commands/init/promptSaveSlot.js.map +1 -1
- package/dist/src/commands/monitor/getTSConfigInclude.js +4 -4
- package/dist/src/commands/monitor/getTSConfigInclude.js.map +1 -1
- package/dist/src/commands/monitor/monitor.js +12 -35
- package/dist/src/commands/monitor/monitor.js.map +1 -1
- package/dist/src/commands/monitor/notifyGame.js +2 -2
- package/dist/src/commands/monitor/notifyGame.js.map +1 -1
- package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js +3 -3
- package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js.map +1 -1
- package/dist/src/commands/monitor/spawnSaveDatWriter.js +3 -3
- package/dist/src/commands/monitor/spawnSaveDatWriter.js.map +1 -1
- package/dist/src/commands/publish/publish.js +17 -17
- package/dist/src/commands/publish/publish.js.map +1 -1
- package/dist/src/configFile.js +3 -3
- package/dist/src/configFile.js.map +1 -1
- package/dist/src/constants.js +2 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/exec.js +6 -6
- package/dist/src/exec.js.map +1 -1
- package/dist/src/file.js +10 -10
- package/dist/src/file.js.map +1 -1
- package/dist/src/main.js +3 -3
- package/dist/src/main.js.map +1 -1
- package/dist/src/parseArgs.js +0 -5
- package/dist/src/parseArgs.js.map +1 -1
- package/dist/src/prompt.js +6 -6
- package/dist/src/prompt.js.map +1 -1
- package/dist/src/{util.js → utils.js} +1 -1
- package/dist/src/utils.js.map +1 -0
- package/dist/src/validateNodeVersion.js +2 -2
- package/dist/src/validateNodeVersion.js.map +1 -1
- package/package.json +2 -2
- package/src/checkForWindowsTerminalBugs.ts +1 -1
- package/src/commands/copy/copy.ts +3 -7
- package/src/commands/init/checkIfProjectPathExists.ts +1 -1
- package/src/commands/init/checkModTargetDirectory.ts +1 -1
- package/src/commands/init/createMod.ts +1 -1
- package/src/commands/init/getModsDir.ts +1 -1
- package/src/commands/init/getProjectPath.ts +1 -1
- package/src/commands/init/installVSCodeExtensions.ts +1 -1
- package/src/commands/init/promptSaveSlot.ts +1 -1
- package/src/commands/monitor/getTSConfigInclude.ts +1 -1
- package/src/commands/monitor/monitor.ts +7 -48
- package/src/commands/monitor/notifyGame.ts +1 -1
- package/src/commands/monitor/saveDatWriter/saveDatWriter.ts +1 -1
- package/src/commands/monitor/spawnSaveDatWriter.ts +1 -1
- package/src/commands/publish/publish.ts +1 -1
- package/src/configFile.ts +1 -1
- package/src/constants.ts +2 -1
- package/src/exec.ts +1 -1
- package/src/file.ts +1 -1
- package/src/main.ts +1 -1
- package/src/parseArgs.ts +0 -5
- package/src/prompt.ts +1 -1
- package/src/{util.ts → utils.ts} +0 -0
- package/src/validateNodeVersion.ts +1 -1
- package/dist/src/util.js.map +0 -1
|
@@ -2,7 +2,7 @@ import chalk from "chalk";
|
|
|
2
2
|
import { CWD } from "../../constants";
|
|
3
3
|
import * as file from "../../file";
|
|
4
4
|
import { getInputYesNo } from "../../prompt";
|
|
5
|
-
import { error } from "../../
|
|
5
|
+
import { error } from "../../utils";
|
|
6
6
|
|
|
7
7
|
export async function checkIfProjectPathExists(
|
|
8
8
|
projectPath: string,
|
|
@@ -3,7 +3,7 @@ import path from "path";
|
|
|
3
3
|
import { PROJECT_NAME } from "../../constants";
|
|
4
4
|
import * as file from "../../file";
|
|
5
5
|
import { getInputYesNo } from "../../prompt";
|
|
6
|
-
import { error } from "../../
|
|
6
|
+
import { error } from "../../utils";
|
|
7
7
|
|
|
8
8
|
export async function checkModTargetDirectory(
|
|
9
9
|
modsDirectory: string,
|
|
@@ -23,7 +23,7 @@ import { execShell } from "../../exec";
|
|
|
23
23
|
import * as file from "../../file";
|
|
24
24
|
import { getInputString, getInputYesNo } from "../../prompt";
|
|
25
25
|
import { GitHubCLIHostsYAML } from "../../types/GitHubCLIHostsYAML";
|
|
26
|
-
import { error, parseSemVer } from "../../
|
|
26
|
+
import { error, parseSemVer } from "../../utils";
|
|
27
27
|
|
|
28
28
|
const REQUIRED_GIT_MAJOR_VERSION = 2;
|
|
29
29
|
const REQUIRED_GIT_MINOR_VERSION = 30;
|
|
@@ -2,7 +2,7 @@ import chalk from "chalk";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { CURRENT_DIRECTORY_NAME, CWD } from "../../constants";
|
|
4
4
|
import { getInputString, getInputYesNo } from "../../prompt";
|
|
5
|
-
import { hasWhiteSpace } from "../../
|
|
5
|
+
import { hasWhiteSpace } from "../../utils";
|
|
6
6
|
|
|
7
7
|
// From: https://gist.github.com/doctaphred/d01d05291546186941e1b7ddc02034d3
|
|
8
8
|
const ILLEGAL_CHARACTERS_FOR_WINDOWS_FILENAMES = [
|
|
@@ -3,7 +3,7 @@ import * as JSONC from "jsonc-parser";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { execShell } from "../../exec";
|
|
5
5
|
import * as file from "../../file";
|
|
6
|
-
import { error } from "../../
|
|
6
|
+
import { error } from "../../utils";
|
|
7
7
|
|
|
8
8
|
export function installVSCodeExtensions(
|
|
9
9
|
projectPath: string,
|
|
@@ -2,7 +2,7 @@ import chalk from "chalk";
|
|
|
2
2
|
import * as JSONC from "jsonc-parser";
|
|
3
3
|
import { TSCONFIG_PATH } from "../../constants";
|
|
4
4
|
import * as file from "../../file";
|
|
5
|
-
import { error } from "../../
|
|
5
|
+
import { error } from "../../utils";
|
|
6
6
|
|
|
7
7
|
export function getTSConfigInclude(): string {
|
|
8
8
|
const tsConfigRaw = file.read(TSCONFIG_PATH);
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
-
import {
|
|
2
|
+
import { fork, spawn } from "child_process";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import {
|
|
5
|
-
CUSTOM_NODE_JS_STACK_SIZE,
|
|
6
5
|
CWD,
|
|
7
6
|
FILE_SYNCED_MESSAGE,
|
|
8
7
|
MAIN_LUA,
|
|
9
8
|
MOD_SOURCE_PATH,
|
|
10
|
-
PACKAGE_JSON,
|
|
11
9
|
PROJECT_NAME,
|
|
12
10
|
} from "../../constants";
|
|
13
11
|
import * as file from "../../file";
|
|
14
12
|
import { Config } from "../../types/Config";
|
|
15
|
-
import { error, getModTargetDirectoryName } from "../../
|
|
13
|
+
import { error, getModTargetDirectoryName } from "../../utils";
|
|
16
14
|
import { copyWatcherMod } from "./copyWatcherMod";
|
|
17
15
|
import { getTSConfigInclude } from "./getTSConfigInclude";
|
|
18
16
|
import * as notifyGame from "./notifyGame";
|
|
@@ -53,7 +51,7 @@ export function monitor(argv: Record<string, unknown>, config: Config): void {
|
|
|
53
51
|
spawnModDirectorySyncer(config);
|
|
54
52
|
|
|
55
53
|
// Subprocess #3 - tstl --watch (to automatically convert TypeScript to Lua)
|
|
56
|
-
spawnTSTLWatcher(
|
|
54
|
+
spawnTSTLWatcher();
|
|
57
55
|
|
|
58
56
|
// Also, start constantly pinging the watcher mod
|
|
59
57
|
setInterval(() => {
|
|
@@ -101,42 +99,11 @@ function spawnModDirectorySyncer(config: Config) {
|
|
|
101
99
|
});
|
|
102
100
|
}
|
|
103
101
|
|
|
104
|
-
function spawnTSTLWatcher(
|
|
102
|
+
function spawnTSTLWatcher() {
|
|
105
103
|
const processDescription = "tstl";
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (crashDebug) {
|
|
110
|
-
tstlArgs.push("--luaPlugins");
|
|
111
|
-
tstlArgs.push(
|
|
112
|
-
'\'{ "name": "./node_modules/isaacscript/src/plugins/addCrashDebugStatements.ts" }\'',
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
let tstl: ChildProcessWithoutNullStreams;
|
|
117
|
-
if (runningFromLocalPath()) {
|
|
118
|
-
const tstlPath = path.join(
|
|
119
|
-
CWD,
|
|
120
|
-
"..",
|
|
121
|
-
"isaacscript",
|
|
122
|
-
"node_modules",
|
|
123
|
-
"typescript-to-lua",
|
|
124
|
-
"dist",
|
|
125
|
-
"tstl.js",
|
|
126
|
-
);
|
|
127
|
-
tstl = spawn("node", [tstlPath, ...tstlArgs], {
|
|
128
|
-
shell: true,
|
|
129
|
-
cwd: CWD,
|
|
130
|
-
});
|
|
131
|
-
} else {
|
|
132
|
-
tstl = spawn(
|
|
133
|
-
"npx",
|
|
134
|
-
[`--stack-size=${CUSTOM_NODE_JS_STACK_SIZE}`, "tstl", ...tstlArgs],
|
|
135
|
-
{
|
|
136
|
-
shell: true,
|
|
137
|
-
},
|
|
138
|
-
);
|
|
139
|
-
}
|
|
104
|
+
const tstl = spawn("npx", ["tstl", "--watch", "--preserveWatchOutput"], {
|
|
105
|
+
shell: true,
|
|
106
|
+
});
|
|
140
107
|
|
|
141
108
|
tstl.stdout.on("data", (data: Buffer[]) => {
|
|
142
109
|
const msg = data.toString().trim();
|
|
@@ -173,11 +140,3 @@ function spawnTSTLWatcher(argv: Record<string, unknown>) {
|
|
|
173
140
|
error(`Error: ${processDescription} subprocess exited with code: ${code}`);
|
|
174
141
|
});
|
|
175
142
|
}
|
|
176
|
-
|
|
177
|
-
// Returns whether or not IsaacScript is a local path in "package.json"
|
|
178
|
-
// e.g. "isaacscript": "../isaacscript"
|
|
179
|
-
function runningFromLocalPath() {
|
|
180
|
-
const packageJSONPath = path.join(CWD, PACKAGE_JSON);
|
|
181
|
-
const packageJSON = file.read(packageJSONPath);
|
|
182
|
-
return packageJSON.includes('"isaacscript": "file:../isaacscript"');
|
|
183
|
-
}
|
|
@@ -3,7 +3,7 @@ import * as JSONC from "jsonc-parser";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { PROJECT_NAME } from "../../../constants";
|
|
5
5
|
import * as file from "../../../file";
|
|
6
|
-
import { ensureAllCases, error } from "../../../
|
|
6
|
+
import { ensureAllCases, error } from "../../../utils";
|
|
7
7
|
import { SaveDatMessage, SaveDatMessageType } from "./types";
|
|
8
8
|
|
|
9
9
|
const MAX_MESSAGES = 100;
|
|
@@ -2,7 +2,7 @@ import { ChildProcess, fork } from "child_process";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { WATCHER_MOD_NAME } from "../../constants";
|
|
4
4
|
import { Config } from "../../types/Config";
|
|
5
|
-
import { error } from "../../
|
|
5
|
+
import { error } from "../../utils";
|
|
6
6
|
import { SaveDatMessage } from "./saveDatWriter/types";
|
|
7
7
|
|
|
8
8
|
let saveDatWriter: ChildProcess | null = null;
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { execExe, execShell } from "../../exec";
|
|
16
16
|
import * as file from "../../file";
|
|
17
17
|
import { Config } from "../../types/Config";
|
|
18
|
-
import { error, getModTargetDirectoryName, parseIntSafe } from "../../
|
|
18
|
+
import { error, getModTargetDirectoryName, parseIntSafe } from "../../utils";
|
|
19
19
|
import { compileAndCopy } from "../copy/copy";
|
|
20
20
|
|
|
21
21
|
const UPDATE_SCRIPT_NAME = "update.sh";
|
package/src/configFile.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { promptSaveSlot } from "./commands/init/promptSaveSlot";
|
|
|
6
6
|
import { CONFIG_FILE_NAME, CONFIG_FILE_PATH, CWD } from "./constants";
|
|
7
7
|
import * as file from "./file";
|
|
8
8
|
import { Config } from "./types/Config";
|
|
9
|
-
import { error } from "./
|
|
9
|
+
import { error } from "./utils";
|
|
10
10
|
|
|
11
11
|
export async function get(argv: Record<string, unknown>): Promise<Config> {
|
|
12
12
|
const verbose = argv.verbose === true;
|
package/src/constants.ts
CHANGED
|
@@ -17,7 +17,8 @@ export const PROJECT_NAME = "IsaacScript";
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The default Node.js stack size is 984 kilobytes, but this is not large enough to compile the
|
|
20
|
-
* biggest mods, resulting in an error of "RangeError: Maximum call stack size exceeded".
|
|
20
|
+
* biggest mods, resulting in an error of "RangeError: Maximum call stack size exceeded". Thus, we
|
|
21
|
+
* specify a custom stack size that is bigger than the default.
|
|
21
22
|
*/
|
|
22
23
|
export const CUSTOM_NODE_JS_STACK_SIZE = 2048;
|
|
23
24
|
|
package/src/exec.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { execSync, spawnSync, SpawnSyncReturns } from "child_process";
|
|
3
3
|
import { CWD } from "./constants";
|
|
4
|
-
import { error } from "./
|
|
4
|
+
import { error } from "./utils";
|
|
5
5
|
|
|
6
6
|
export function execExe(path: string, verbose = false, cwd = CWD): string {
|
|
7
7
|
if (verbose) {
|
package/src/file.ts
CHANGED
package/src/main.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { parseArgs } from "./parseArgs";
|
|
|
18
18
|
import { promptInit } from "./prompt";
|
|
19
19
|
import { Command, DEFAULT_COMMAND } from "./types/Command";
|
|
20
20
|
import { Config } from "./types/Config";
|
|
21
|
-
import { ensureAllCases, error } from "./
|
|
21
|
+
import { ensureAllCases, error } from "./utils";
|
|
22
22
|
import { validateInIsaacScriptProject } from "./validateInIsaacScriptProject";
|
|
23
23
|
import { validateNodeVersion } from "./validateNodeVersion";
|
|
24
24
|
import { validateOS } from "./validateOS";
|
package/src/parseArgs.ts
CHANGED
|
@@ -20,11 +20,6 @@ export function parseArgs() {
|
|
|
20
20
|
choices: [1, 2, 3],
|
|
21
21
|
description: "The save slot in-game that you use",
|
|
22
22
|
})
|
|
23
|
-
.option("crash-debug", {
|
|
24
|
-
alias: "c",
|
|
25
|
-
type: "boolean",
|
|
26
|
-
description: "Enable crash debugging",
|
|
27
|
-
})
|
|
28
23
|
.option("verbose", {
|
|
29
24
|
alias: "v",
|
|
30
25
|
type: "boolean",
|
package/src/prompt.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
import prompt from "prompt";
|
|
7
|
-
import { error, parseIntSafe } from "./
|
|
7
|
+
import { error, parseIntSafe } from "./utils";
|
|
8
8
|
|
|
9
9
|
const VALID_YES_RESPONSES = new Set(["yes", "ye", "y"]);
|
|
10
10
|
const VALID_NO_RESPONSES = new Set(["no", "n"]);
|
package/src/{util.ts → utils.ts}
RENAMED
|
File without changes
|
package/dist/src/util.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,2CAAqD;AAG9C,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,CAA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