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.
- package/README.md +8 -4
- package/package.json +2 -53
- package/src/checkForWindowsTerminalBugs.d.ts +5 -0
- package/src/checkForWindowsTerminalBugs.js +80 -0
- package/src/checkForWindowsTerminalBugs.js.map +1 -0
- package/src/commands/copy/copy.d.ts +3 -0
- package/src/commands/copy/copy.js +33 -0
- package/src/commands/copy/copy.js.map +1 -0
- package/src/commands/init/checkIfProjectPathExists.d.ts +1 -0
- package/src/commands/init/checkIfProjectPathExists.js +30 -0
- package/src/commands/init/checkIfProjectPathExists.js.map +1 -0
- package/src/commands/init/checkModSubdirectory.d.ts +1 -0
- package/src/commands/init/checkModSubdirectory.js +16 -0
- package/src/commands/init/checkModSubdirectory.js.map +1 -0
- package/src/commands/init/checkModTargetDirectory.d.ts +1 -0
- package/src/commands/init/checkModTargetDirectory.js +33 -0
- package/src/commands/init/checkModTargetDirectory.js.map +1 -0
- package/src/commands/init/createMod.d.ts +1 -0
- package/{dist/src → src}/commands/init/createMod.js +137 -162
- package/src/commands/init/createMod.js.map +1 -0
- package/src/commands/init/getModsDir.d.ts +1 -0
- package/src/commands/init/getModsDir.js +58 -0
- package/src/commands/init/getModsDir.js.map +1 -0
- package/src/commands/init/getProjectPath.d.ts +1 -0
- package/src/commands/init/getProjectPath.js +93 -0
- package/src/commands/init/getProjectPath.js.map +1 -0
- package/src/commands/init/git.d.ts +4 -0
- package/{dist/src → src}/commands/init/git.js +152 -175
- package/src/commands/init/git.js.map +1 -0
- package/src/commands/init/init.d.ts +1 -0
- package/src/commands/init/init.js +70 -0
- package/src/commands/init/init.js.map +1 -0
- package/src/commands/init/installVSCodeExtensions.d.ts +1 -0
- package/src/commands/init/installVSCodeExtensions.js +33 -0
- package/src/commands/init/installVSCodeExtensions.js.map +1 -0
- package/src/commands/init/promptSaveSlot.d.ts +1 -0
- package/src/commands/init/promptSaveSlot.js +25 -0
- package/src/commands/init/promptSaveSlot.js.map +1 -0
- package/src/commands/init/promptVSCode.d.ts +1 -0
- package/src/commands/init/promptVSCode.js +27 -0
- package/src/commands/init/promptVSCode.js.map +1 -0
- package/src/commands/monitor/constants.d.ts +1 -0
- package/{dist/src → src}/commands/monitor/constants.js +4 -4
- package/src/commands/monitor/constants.js.map +1 -0
- package/src/commands/monitor/copyWatcherMod.d.ts +2 -0
- package/{dist/src → src}/commands/monitor/copyWatcherMod.js +38 -63
- package/src/commands/monitor/copyWatcherMod.js.map +1 -0
- package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.d.ts +1 -0
- package/{dist/src → src}/commands/monitor/modDirectorySyncer/modDirectorySyncer.js +49 -51
- package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js.map +1 -0
- package/src/commands/monitor/monitor.d.ts +2 -0
- package/{dist/src → src}/commands/monitor/monitor.js +146 -171
- package/src/commands/monitor/monitor.js.map +1 -0
- package/src/commands/monitor/notifyGame.d.ts +3 -0
- package/{dist/src → src}/commands/monitor/notifyGame.js +57 -59
- package/src/commands/monitor/notifyGame.js.map +1 -0
- package/src/commands/monitor/saveDatWriter/saveDatWriter.d.ts +1 -0
- package/{dist/src → src}/commands/monitor/saveDatWriter/saveDatWriter.js +116 -141
- package/src/commands/monitor/saveDatWriter/saveDatWriter.js.map +1 -0
- package/src/commands/monitor/saveDatWriter/types.d.ts +5 -0
- package/{dist/src → src}/commands/monitor/saveDatWriter/types.js +2 -2
- package/src/commands/monitor/saveDatWriter/types.js.map +1 -0
- package/src/commands/monitor/spawnSaveDatWriter.d.ts +4 -0
- package/{dist/src → src}/commands/monitor/spawnSaveDatWriter.js +34 -36
- package/src/commands/monitor/spawnSaveDatWriter.js.map +1 -0
- package/src/commands/monitor/touchWatcherSaveDatFiles.d.ts +2 -0
- package/src/commands/monitor/touchWatcherSaveDatFiles.js +21 -0
- package/src/commands/monitor/touchWatcherSaveDatFiles.js.map +1 -0
- package/src/commands/publish/publish.d.ts +2 -0
- package/{dist/src → src}/commands/publish/publish.js +220 -260
- package/src/commands/publish/publish.js.map +1 -0
- package/src/configFile.d.ts +4 -0
- package/src/configFile.js +66 -0
- package/src/configFile.js.map +1 -0
- package/src/constants.d.ts +34 -0
- package/{dist/src → src}/constants.js +59 -61
- package/src/constants.js.map +1 -0
- package/src/exec.d.ts +4 -0
- package/{dist/src → src}/exec.js +95 -97
- package/src/exec.js.map +1 -0
- package/src/file.d.ts +12 -0
- package/{dist/src → src}/file.js +193 -195
- package/src/file.js.map +1 -0
- package/src/main.d.ts +2 -0
- package/src/main.js +122 -0
- package/src/main.js.map +1 -0
- package/src/parseArgs.d.ts +1 -0
- package/{dist/src → src}/parseArgs.js +106 -108
- package/src/parseArgs.js.map +1 -0
- package/src/prompt.d.ts +5 -0
- package/src/prompt.js +93 -0
- package/src/prompt.js.map +1 -0
- package/src/types/Command.d.ts +2 -0
- package/{dist/src → src}/types/Command.js +4 -4
- package/src/types/Command.js.map +1 -0
- package/src/types/Config.d.ts +18 -0
- package/{dist/src → src}/types/Config.js +12 -12
- package/src/types/Config.js.map +1 -0
- package/src/types/GitHubCLIHostsYAML.d.ts +7 -0
- package/{dist/src → src}/types/GitHubCLIHostsYAML.js +2 -2
- package/src/types/GitHubCLIHostsYAML.js.map +1 -0
- package/src/utils.d.ts +13 -0
- package/{dist/src → src}/utils.js +81 -83
- package/src/utils.js.map +1 -0
- package/src/validateInIsaacScriptProject.d.ts +1 -0
- package/src/validateInIsaacScriptProject.js +27 -0
- package/src/validateInIsaacScriptProject.js.map +1 -0
- package/src/validateNodeVersion.d.ts +5 -0
- package/{dist/src → src}/validateNodeVersion.js +24 -26
- package/src/validateNodeVersion.js.map +1 -0
- package/src/validateOS.d.ts +1 -0
- package/{dist/src → src}/validateOS.js +16 -18
- package/src/validateOS.js.map +1 -0
- package/LICENSE +0 -674
- package/dist/package.json +0 -57
- package/dist/src/checkForWindowsTerminalBugs.js +0 -101
- package/dist/src/commands/copy/copy.js +0 -58
- package/dist/src/commands/init/checkIfProjectPathExists.js +0 -53
- package/dist/src/commands/init/checkModSubdirectory.js +0 -41
- package/dist/src/commands/init/checkModTargetDirectory.js +0 -56
- package/dist/src/commands/init/getModsDir.js +0 -81
- package/dist/src/commands/init/getProjectPath.js +0 -91
- package/dist/src/commands/init/init.js +0 -68
- package/dist/src/commands/init/installVSCodeExtensions.js +0 -58
- package/dist/src/commands/init/promptSaveSlot.js +0 -22
- package/dist/src/commands/init/promptVSCode.js +0 -27
- package/dist/src/commands/monitor/touchWatcherSaveDatFiles.js +0 -46
- package/dist/src/configFile.js +0 -89
- package/dist/src/main.js +0 -136
- package/dist/src/prompt.js +0 -89
- package/dist/src/validateInIsaacScriptProject.js +0 -52
- package/isaacscript-watcher/.luacheckrc +0 -96
- package/isaacscript-watcher/README.md +0 -8
- package/isaacscript-watcher/main.lua +0 -270
- package/isaacscript-watcher/metadata.xml +0 -7
- package/isaacscript-watcher/resources/gfx/logo.anm2 +0 -27
- package/isaacscript-watcher/resources/gfx/logo.png +0 -0
|
@@ -1,58 +0,0 @@
|
|
|
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.installVSCodeExtensions = void 0;
|
|
30
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
31
|
-
const JSONC = __importStar(require("jsonc-parser"));
|
|
32
|
-
const path_1 = __importDefault(require("path"));
|
|
33
|
-
const exec_1 = require("../../exec");
|
|
34
|
-
const file = __importStar(require("../../file"));
|
|
35
|
-
const utils_1 = require("../../utils");
|
|
36
|
-
function installVSCodeExtensions(projectPath, VSCodeCommand, verbose) {
|
|
37
|
-
const extensions = getExtensionsFromJSON(projectPath, verbose);
|
|
38
|
-
for (const extensionName of extensions) {
|
|
39
|
-
(0, exec_1.execShell)(VSCodeCommand, ["--install-extension", extensionName], verbose);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.installVSCodeExtensions = installVSCodeExtensions;
|
|
43
|
-
function getExtensionsFromJSON(projectPath, verbose) {
|
|
44
|
-
const extensionsJSONPath = path_1.default.join(projectPath, ".vscode", "extensions.json");
|
|
45
|
-
if (!file.exists(extensionsJSONPath, verbose)) {
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
const extensionsJSONRaw = file.read(extensionsJSONPath, verbose);
|
|
49
|
-
let extensionsJSON;
|
|
50
|
-
try {
|
|
51
|
-
extensionsJSON = JSONC.parse(extensionsJSONRaw);
|
|
52
|
-
}
|
|
53
|
-
catch (err) {
|
|
54
|
-
(0, utils_1.error)(`Failed to parse the "${chalk_1.default.green(extensionsJSONPath)}" file:`, err);
|
|
55
|
-
}
|
|
56
|
-
return extensionsJSON.recommendations;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=installVSCodeExtensions.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.promptSaveSlot = void 0;
|
|
4
|
-
const prompt_1 = require("../../prompt");
|
|
5
|
-
const utils_1 = require("../../utils");
|
|
6
|
-
async function promptSaveSlot(argv, yes) {
|
|
7
|
-
if (argv["saveSlot"] !== undefined) {
|
|
8
|
-
// They specified the "--save-slot" command-line flag, so there is no need to prompt the user
|
|
9
|
-
// for it.
|
|
10
|
-
return argv["saveSlot"]; // yargs converts this to a number
|
|
11
|
-
}
|
|
12
|
-
if (yes) {
|
|
13
|
-
return 1;
|
|
14
|
-
}
|
|
15
|
-
const saveSlot = await (0, prompt_1.getInputInt)("In-game, will you test your mod on save slot 1, 2, or 3?");
|
|
16
|
-
if (saveSlot !== 1 && saveSlot !== 2 && saveSlot !== 3) {
|
|
17
|
-
(0, utils_1.error)("Error: You must choose a number between 1 and 3.");
|
|
18
|
-
}
|
|
19
|
-
return saveSlot;
|
|
20
|
-
}
|
|
21
|
-
exports.promptSaveSlot = promptSaveSlot;
|
|
22
|
-
//# sourceMappingURL=promptSaveSlot.js.map
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
exports.promptVSCode = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const constants_1 = require("../../constants");
|
|
9
|
-
const exec_1 = require("../../exec");
|
|
10
|
-
const prompt_1 = require("../../prompt");
|
|
11
|
-
async function promptVSCode(projectPath, VSCodeCommand, vscode, verbose) {
|
|
12
|
-
if (vscode) {
|
|
13
|
-
// They supplied the "--vscode" command-line flag, so there is no need to prompt the user.
|
|
14
|
-
openVSCode(projectPath, VSCodeCommand, verbose);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const shouldOpenVSCode = await (0, prompt_1.getInputYesNo)("Do you want to open your new project in VSCode now?");
|
|
18
|
-
if (shouldOpenVSCode) {
|
|
19
|
-
openVSCode(projectPath, VSCodeCommand, verbose);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.promptVSCode = promptVSCode;
|
|
23
|
-
function openVSCode(projectPath, VSCodeCommand, verbose) {
|
|
24
|
-
const MAIN_TS_PATH = path_1.default.join(projectPath, "src", constants_1.MAIN_TS);
|
|
25
|
-
(0, exec_1.execShell)(VSCodeCommand, [projectPath, MAIN_TS_PATH], verbose);
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=promptVSCode.js.map
|
|
@@ -1,46 +0,0 @@
|
|
|
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.touchWatcherSaveDatFiles = void 0;
|
|
30
|
-
const path_1 = __importDefault(require("path"));
|
|
31
|
-
const constants_1 = require("../../constants");
|
|
32
|
-
const file = __importStar(require("../../file"));
|
|
33
|
-
function touchWatcherSaveDatFiles(config, verbose) {
|
|
34
|
-
const modsDataPath = path_1.default.join(config.modsDirectory, "..", "data");
|
|
35
|
-
const watcherModDataPath = path_1.default.join(modsDataPath, constants_1.WATCHER_MOD_NAME);
|
|
36
|
-
if (!file.exists(watcherModDataPath, verbose)) {
|
|
37
|
-
file.makeDir(watcherModDataPath, verbose);
|
|
38
|
-
}
|
|
39
|
-
const saveDatFileName = `save${config.saveSlot}.dat`;
|
|
40
|
-
const saveDatPath = path_1.default.join(watcherModDataPath, saveDatFileName);
|
|
41
|
-
if (!file.exists(saveDatPath, verbose)) {
|
|
42
|
-
file.touch(saveDatPath, verbose);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.touchWatcherSaveDatFiles = touchWatcherSaveDatFiles;
|
|
46
|
-
//# sourceMappingURL=touchWatcherSaveDatFiles.js.map
|
package/dist/src/configFile.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
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.createFile = exports.createObject = exports.get = void 0;
|
|
30
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
31
|
-
const JSONC = __importStar(require("jsonc-parser"));
|
|
32
|
-
const path_1 = __importDefault(require("path"));
|
|
33
|
-
const getModsDir_1 = require("./commands/init/getModsDir");
|
|
34
|
-
const promptSaveSlot_1 = require("./commands/init/promptSaveSlot");
|
|
35
|
-
const constants_1 = require("./constants");
|
|
36
|
-
const file = __importStar(require("./file"));
|
|
37
|
-
const utils_1 = require("./utils");
|
|
38
|
-
async function get(argv) {
|
|
39
|
-
const verbose = argv["verbose"] === true;
|
|
40
|
-
const yes = argv["yes"] === true;
|
|
41
|
-
const existingConfig = readExistingConfig(verbose);
|
|
42
|
-
if (existingConfig !== undefined) {
|
|
43
|
-
return existingConfig;
|
|
44
|
-
}
|
|
45
|
-
// No config file exists, so prompt the user for some information and create one.
|
|
46
|
-
const modsDirectory = await (0, getModsDir_1.getModsDir)(argv, verbose);
|
|
47
|
-
const saveSlot = await (0, promptSaveSlot_1.promptSaveSlot)(argv, yes);
|
|
48
|
-
const config = createObject(modsDirectory, saveSlot);
|
|
49
|
-
createFile(constants_1.CWD, config, verbose);
|
|
50
|
-
return config;
|
|
51
|
-
}
|
|
52
|
-
exports.get = get;
|
|
53
|
-
function readExistingConfig(verbose) {
|
|
54
|
-
if (!file.exists(constants_1.CONFIG_FILE_PATH, verbose)) {
|
|
55
|
-
return undefined;
|
|
56
|
-
}
|
|
57
|
-
const configRaw = file.read(constants_1.CONFIG_FILE_PATH, verbose);
|
|
58
|
-
let config;
|
|
59
|
-
try {
|
|
60
|
-
config = JSONC.parse(configRaw);
|
|
61
|
-
}
|
|
62
|
-
catch (err) {
|
|
63
|
-
(0, utils_1.error)(`Failed to parse the "${chalk_1.default.green(constants_1.CONFIG_FILE_PATH)}" file:`, err);
|
|
64
|
-
}
|
|
65
|
-
if (config.modsDirectory === undefined) {
|
|
66
|
-
errorMissing("modsDirectory", "This should be equal to the directory where Isaac mods live on your system.");
|
|
67
|
-
}
|
|
68
|
-
if (config.saveSlot === undefined) {
|
|
69
|
-
errorMissing("saveSlot", "This should be equal to the save slot that you test your mods on.");
|
|
70
|
-
}
|
|
71
|
-
return config;
|
|
72
|
-
}
|
|
73
|
-
function errorMissing(field, description) {
|
|
74
|
-
(0, utils_1.error)(`The "${constants_1.CONFIG_FILE_NAME}" file is missing a "${field}" value. ${description} Please add it.`);
|
|
75
|
-
}
|
|
76
|
-
function createObject(modsDirectory, saveSlot) {
|
|
77
|
-
return {
|
|
78
|
-
modsDirectory,
|
|
79
|
-
saveSlot,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
exports.createObject = createObject;
|
|
83
|
-
function createFile(projectPath, config, verbose) {
|
|
84
|
-
const configFilePath = path_1.default.join(projectPath, constants_1.CONFIG_FILE_NAME);
|
|
85
|
-
const configContents = JSON.stringify(config, null, 2);
|
|
86
|
-
file.write(configFilePath, configContents, verbose);
|
|
87
|
-
}
|
|
88
|
-
exports.createFile = createFile;
|
|
89
|
-
//# sourceMappingURL=configFile.js.map
|
package/dist/src/main.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
31
|
-
const dotenv = __importStar(require("dotenv"));
|
|
32
|
-
const figlet_1 = __importDefault(require("figlet"));
|
|
33
|
-
const path_1 = __importDefault(require("path"));
|
|
34
|
-
const source_map_support_1 = __importDefault(require("source-map-support"));
|
|
35
|
-
const update_notifier_1 = __importDefault(require("update-notifier"));
|
|
36
|
-
const package_json_1 = __importDefault(require("../package.json"));
|
|
37
|
-
const checkForWindowsTerminalBugs_1 = require("./checkForWindowsTerminalBugs");
|
|
38
|
-
const copy_1 = require("./commands/copy/copy");
|
|
39
|
-
const init_1 = require("./commands/init/init");
|
|
40
|
-
const monitor_1 = require("./commands/monitor/monitor");
|
|
41
|
-
const publish_1 = require("./commands/publish/publish");
|
|
42
|
-
const configFile = __importStar(require("./configFile"));
|
|
43
|
-
const constants_1 = require("./constants");
|
|
44
|
-
const exec_1 = require("./exec");
|
|
45
|
-
const file = __importStar(require("./file"));
|
|
46
|
-
const parseArgs_1 = require("./parseArgs");
|
|
47
|
-
const prompt_1 = require("./prompt");
|
|
48
|
-
const Command_1 = require("./types/Command");
|
|
49
|
-
const Config_1 = require("./types/Config");
|
|
50
|
-
const utils_1 = require("./utils");
|
|
51
|
-
const validateInIsaacScriptProject_1 = require("./validateInIsaacScriptProject");
|
|
52
|
-
const validateNodeVersion_1 = require("./validateNodeVersion");
|
|
53
|
-
const validateOS_1 = require("./validateOS");
|
|
54
|
-
main().catch((err) => {
|
|
55
|
-
(0, utils_1.error)(`${constants_1.PROJECT_NAME} failed:`, err);
|
|
56
|
-
});
|
|
57
|
-
async function main() {
|
|
58
|
-
source_map_support_1.default.install();
|
|
59
|
-
(0, prompt_1.promptInit)();
|
|
60
|
-
(0, validateNodeVersion_1.validateNodeVersion)();
|
|
61
|
-
(0, validateOS_1.validateOS)();
|
|
62
|
-
loadEnvironmentVariables();
|
|
63
|
-
// Get command line arguments.
|
|
64
|
-
const argv = (0, parseArgs_1.parseArgs)();
|
|
65
|
-
const verbose = argv["verbose"] === true;
|
|
66
|
-
printBanner();
|
|
67
|
-
// Check for a new version.
|
|
68
|
-
(0, update_notifier_1.default)({ pkg: package_json_1.default }).notify();
|
|
69
|
-
// Pre-flight checks.
|
|
70
|
-
await (0, checkForWindowsTerminalBugs_1.checkForWindowsTerminalBugs)(verbose);
|
|
71
|
-
await handleCommands(argv, verbose);
|
|
72
|
-
}
|
|
73
|
-
function loadEnvironmentVariables() {
|
|
74
|
-
const envFile = path_1.default.join(constants_1.CWD, ".env");
|
|
75
|
-
dotenv.config({ path: envFile });
|
|
76
|
-
}
|
|
77
|
-
function printBanner() {
|
|
78
|
-
console.log(chalk_1.default.green(figlet_1.default.textSync(constants_1.PROJECT_NAME)));
|
|
79
|
-
const bannerLength = 55; // From measuring the banner created by Figlet
|
|
80
|
-
const version = `v${package_json_1.default.version}`;
|
|
81
|
-
const leftPaddingAmount = Math.floor((bannerLength + version.length) / 2);
|
|
82
|
-
console.log(version.padStart(leftPaddingAmount));
|
|
83
|
-
console.log();
|
|
84
|
-
}
|
|
85
|
-
async function handleCommands(argv, verbose) {
|
|
86
|
-
const positionalArgs = argv["_"];
|
|
87
|
-
let command;
|
|
88
|
-
if (positionalArgs.length > 0) {
|
|
89
|
-
command = positionalArgs[0];
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
command = Command_1.DEFAULT_COMMAND;
|
|
93
|
-
}
|
|
94
|
-
let config = new Config_1.Config();
|
|
95
|
-
if (command !== "init") {
|
|
96
|
-
(0, validateInIsaacScriptProject_1.validateInIsaacScriptProject)(verbose);
|
|
97
|
-
config = await configFile.get(argv);
|
|
98
|
-
ensureDepsAreInstalled(verbose);
|
|
99
|
-
}
|
|
100
|
-
switch (command) {
|
|
101
|
-
case "monitor": {
|
|
102
|
-
(0, monitor_1.monitor)(argv, config);
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
case "init": {
|
|
106
|
-
await (0, init_1.init)(argv);
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
case "copy": {
|
|
110
|
-
(0, copy_1.copy)(argv, config);
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
case "publish": {
|
|
114
|
-
(0, publish_1.publish)(argv, config);
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
default: {
|
|
118
|
-
(0, utils_1.ensureAllCases)(command);
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (command !== "monitor") {
|
|
123
|
-
process.exit(0);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function ensureDepsAreInstalled(verbose) {
|
|
127
|
-
if (file.exists(constants_1.YARN_LOCK_PATH, verbose)) {
|
|
128
|
-
console.log('Running "yarn" to ensure that the project\'s dependencies are installed correctly.');
|
|
129
|
-
(0, exec_1.execShell)("yarn");
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
// https://stackoverflow.com/questions/57016579/checking-if-package-json-dependencies-match-the-installed-dependencies
|
|
133
|
-
console.log('Running "npm install" to ensure that the project\'s dependencies are installed correctly.');
|
|
134
|
-
(0, exec_1.execShell)("npm", ["install"], verbose);
|
|
135
|
-
}
|
|
136
|
-
//# sourceMappingURL=main.js.map
|
package/dist/src/prompt.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Both the Inquirer.js library and the Prompts library have a bug where text is duplicated in a Git
|
|
3
|
-
// Bash terminal. Thus, we revert to using the simpler Prompt library.
|
|
4
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.getInputInt = exports.getInputString = exports.getInputYesNo = exports.promptInit = void 0;
|
|
9
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
const prompt_1 = __importDefault(require("prompt"));
|
|
11
|
-
const utils_1 = require("./utils");
|
|
12
|
-
const VALID_YES_RESPONSES = new Set(["yes", "ye", "y"]);
|
|
13
|
-
const VALID_NO_RESPONSES = new Set(["no", "n"]);
|
|
14
|
-
function promptInit() {
|
|
15
|
-
// Override some of the prompt library's default values:
|
|
16
|
-
// https://github.com/flatiron/prompt#customizing-your-prompt
|
|
17
|
-
prompt_1.default.message = chalk_1.default.green("?");
|
|
18
|
-
prompt_1.default.delimiter = " ";
|
|
19
|
-
prompt_1.default.colors = false;
|
|
20
|
-
}
|
|
21
|
-
exports.promptInit = promptInit;
|
|
22
|
-
async function getInputYesNo(msg, defaultValue = true) {
|
|
23
|
-
prompt_1.default.start();
|
|
24
|
-
// Capitalize the letter that represents the default option.
|
|
25
|
-
const y = defaultValue ? "Y" : "y";
|
|
26
|
-
const n = defaultValue ? "n" : "N";
|
|
27
|
-
const questionSuffix = `(${y}\\${n})`;
|
|
28
|
-
const description = `${chalk_1.default.bold(msg)} ${chalk_1.default.gray(questionSuffix)}`;
|
|
29
|
-
const { response } = await prompt_1.default.get({
|
|
30
|
-
properties: {
|
|
31
|
-
response: {
|
|
32
|
-
type: "string",
|
|
33
|
-
description,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
if (typeof response !== "string") {
|
|
38
|
-
console.log(typeof response);
|
|
39
|
-
(0, utils_1.error)("Failed to get a proper response from the prompt library.");
|
|
40
|
-
}
|
|
41
|
-
const cleanedResponse = response.toLowerCase().trim();
|
|
42
|
-
// Default to true.
|
|
43
|
-
if (cleanedResponse === "") {
|
|
44
|
-
return defaultValue;
|
|
45
|
-
}
|
|
46
|
-
if (VALID_YES_RESPONSES.has(cleanedResponse)) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
if (VALID_NO_RESPONSES.has(cleanedResponse)) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return (0, utils_1.error)('Invalid response; must answer "yes" or "no".');
|
|
53
|
-
}
|
|
54
|
-
exports.getInputYesNo = getInputYesNo;
|
|
55
|
-
/** Returns trimmed input. */
|
|
56
|
-
async function getInputString(msg, defaultValue) {
|
|
57
|
-
prompt_1.default.start();
|
|
58
|
-
let description = `${chalk_1.default.bold(msg)}`;
|
|
59
|
-
if (defaultValue !== undefined) {
|
|
60
|
-
description += ` ${chalk_1.default.gray(`(${defaultValue})`)}`;
|
|
61
|
-
}
|
|
62
|
-
const { response } = await prompt_1.default.get({
|
|
63
|
-
properties: {
|
|
64
|
-
response: {
|
|
65
|
-
type: "string",
|
|
66
|
-
description,
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
if (typeof response !== "string") {
|
|
71
|
-
(0, utils_1.error)("Failed to get a proper response from the prompt library.");
|
|
72
|
-
}
|
|
73
|
-
if (response === "" && defaultValue !== undefined) {
|
|
74
|
-
return defaultValue;
|
|
75
|
-
}
|
|
76
|
-
return response.trim();
|
|
77
|
-
}
|
|
78
|
-
exports.getInputString = getInputString;
|
|
79
|
-
async function getInputInt(msg, defaultValue = 1) {
|
|
80
|
-
const defaultValueString = defaultValue.toString();
|
|
81
|
-
const string = await getInputString(msg, defaultValueString);
|
|
82
|
-
const int = (0, utils_1.parseIntSafe)(string);
|
|
83
|
-
if (Number.isNaN(int)) {
|
|
84
|
-
(0, utils_1.error)("Error: You must enter an integer.");
|
|
85
|
-
}
|
|
86
|
-
return int;
|
|
87
|
-
}
|
|
88
|
-
exports.getInputInt = getInputInt;
|
|
89
|
-
//# sourceMappingURL=prompt.js.map
|
|
@@ -1,52 +0,0 @@
|
|
|
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.validateInIsaacScriptProject = void 0;
|
|
30
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
31
|
-
const path_1 = __importDefault(require("path"));
|
|
32
|
-
const constants_1 = require("./constants");
|
|
33
|
-
const file = __importStar(require("./file"));
|
|
34
|
-
// Validate that we are in a directory that looks like an IsaacScript project.
|
|
35
|
-
function validateInIsaacScriptProject(verbose) {
|
|
36
|
-
const subdirectoriesToCheck = ["src", "mod", "node_modules"];
|
|
37
|
-
for (const subdirectoryName of subdirectoriesToCheck) {
|
|
38
|
-
const subdirectoryPath = path_1.default.join(constants_1.CWD, subdirectoryName);
|
|
39
|
-
if (!file.exists(subdirectoryPath, verbose) ||
|
|
40
|
-
!file.isDir(subdirectoryPath, verbose)) {
|
|
41
|
-
errorNotExists(subdirectoryPath);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.validateInIsaacScriptProject = validateInIsaacScriptProject;
|
|
46
|
-
function errorNotExists(dirName) {
|
|
47
|
-
console.error(chalk_1.default.red(`It looks like the current working directory is not an ${constants_1.PROJECT_NAME} project. (There is no "${dirName}" subdirectory here.)`));
|
|
48
|
-
console.error(`Did you mean to create a new ${constants_1.PROJECT_NAME} project with "${chalk_1.default.green("npx isaacscript init")}"?`);
|
|
49
|
-
console.error(`If not, then change the current working directory to an ${constants_1.PROJECT_NAME} project.`);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=validateInIsaacScriptProject.js.map
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
-- These are all of the declarations in the "enums.lua" file in the "scripts" subdirectory,
|
|
2
|
-
-- sorted alphabetically
|
|
3
|
-
globals = {
|
|
4
|
-
"ActionTriggers",
|
|
5
|
-
"BabySubType",
|
|
6
|
-
"BombSubType",
|
|
7
|
-
"BombVariant",
|
|
8
|
-
"ButtonAction",
|
|
9
|
-
"CacheFlag",
|
|
10
|
-
"Card",
|
|
11
|
-
"Challenge",
|
|
12
|
-
"ChestSubType",
|
|
13
|
-
"CoinSubType",
|
|
14
|
-
"CollectibleType",
|
|
15
|
-
"Color",
|
|
16
|
-
"DamageFlag",
|
|
17
|
-
"Difficulty",
|
|
18
|
-
"Direction",
|
|
19
|
-
"DoorSlot",
|
|
20
|
-
"DoorState",
|
|
21
|
-
"DoorVariant",
|
|
22
|
-
"EffectVariant",
|
|
23
|
-
"EntityCollisionClass",
|
|
24
|
-
"EntityFlag",
|
|
25
|
-
"EntityGridCollisionClass",
|
|
26
|
-
"EntityPartition",
|
|
27
|
-
"EntityPtr",
|
|
28
|
-
"EntityRef",
|
|
29
|
-
"EntityType",
|
|
30
|
-
"FamiliarVariant",
|
|
31
|
-
"Font",
|
|
32
|
-
"Game",
|
|
33
|
-
"GameStateFlag",
|
|
34
|
-
"GetPtrHash",
|
|
35
|
-
"GridCollisionClass",
|
|
36
|
-
"GridEntityType",
|
|
37
|
-
"GridRooms",
|
|
38
|
-
"HeartSubType",
|
|
39
|
-
"Input",
|
|
40
|
-
"InputHook",
|
|
41
|
-
"Isaac",
|
|
42
|
-
"ItemConfig",
|
|
43
|
-
"ItemPoolType",
|
|
44
|
-
"ItemType",
|
|
45
|
-
"KColor",
|
|
46
|
-
"Keyboard",
|
|
47
|
-
"KeySubType",
|
|
48
|
-
"LaserOffset",
|
|
49
|
-
"LevelCurse",
|
|
50
|
-
"LevelStage",
|
|
51
|
-
"LevelStateFlag",
|
|
52
|
-
"LocustSubtypes",
|
|
53
|
-
"ModCallbacks",
|
|
54
|
-
"Mouse",
|
|
55
|
-
"Music",
|
|
56
|
-
"MusicManager",
|
|
57
|
-
"NpcState",
|
|
58
|
-
"NullItemID",
|
|
59
|
-
"PickupPrice",
|
|
60
|
-
"PickupVariant",
|
|
61
|
-
"PillColor",
|
|
62
|
-
"PillEffect",
|
|
63
|
-
"PlayerForm",
|
|
64
|
-
"PlayerItemState",
|
|
65
|
-
"PlayerSpriteLayer",
|
|
66
|
-
"PlayerType",
|
|
67
|
-
"ProjectileFlags",
|
|
68
|
-
"ProjectileParams",
|
|
69
|
-
"ProjectileVariant",
|
|
70
|
-
"Random",
|
|
71
|
-
"RandomVector",
|
|
72
|
-
"RegisterMod",
|
|
73
|
-
"RNG",
|
|
74
|
-
"RoomShape",
|
|
75
|
-
"RoomType",
|
|
76
|
-
"SeedEffect",
|
|
77
|
-
"SFXManager",
|
|
78
|
-
"SortingLayer",
|
|
79
|
-
"SoundEffect",
|
|
80
|
-
"Sprite",
|
|
81
|
-
"StageType",
|
|
82
|
-
"TearFlags",
|
|
83
|
-
"TearVariant",
|
|
84
|
-
"TrinketType",
|
|
85
|
-
"Vector",
|
|
86
|
-
"WeaponType",
|
|
87
|
-
|
|
88
|
-
-- Global variables
|
|
89
|
-
"ModConfigMenu",
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
max_line_length = 100
|
|
93
|
-
|
|
94
|
-
-- Luacheck complains about functions in a module declared with a colon if self is unused;
|
|
95
|
-
-- we may want all functions to be declared with a colon for uniformity
|
|
96
|
-
unused_args = false
|