isaacscript 2.0.6 → 2.0.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 +12 -6
- package/dist/src/commands/init/createMod.js +9 -9
- package/dist/src/commands/init/git.js +3 -3
- package/dist/src/commands/init/init.js +2 -2
- package/dist/src/commands/monitor/monitor.js +9 -9
- package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js +2 -2
- package/dist/src/configFile.js +1 -1
- package/dist/src/constants.js +12 -9
- package/dist/src/file.js +1 -1
- package/dist/src/main.js +3 -3
- package/dist/src/utils.js +5 -5
- package/dist/src/validateInIsaacScriptProject.js +1 -1
- package/package.json +12 -6
- package/.cspell.json +0 -25
- package/.eslintrc.js +0 -28
- package/.gitattributes +0 -9
- package/.github/workflows/ci.yml +0 -47
- package/.prettierignore +0 -5
- package/.prettierrc.js +0 -42
- package/.vscode/extensions.json +0 -9
- package/.vscode/settings.json +0 -75
- package/build.sh +0 -30
- package/check-file-updates.sh +0 -67
- package/check-file-updates.txt +0 -8
- package/check-gitignore.sh +0 -26
- package/check-orphaned-words.sh +0 -58
- package/dist/src/checkForWindowsTerminalBugs.js.map +0 -1
- package/dist/src/commands/copy/copy.js.map +0 -1
- package/dist/src/commands/init/checkIfProjectPathExists.js.map +0 -1
- package/dist/src/commands/init/checkModSubdirectory.js.map +0 -1
- package/dist/src/commands/init/checkModTargetDirectory.js.map +0 -1
- package/dist/src/commands/init/createMod.js.map +0 -1
- package/dist/src/commands/init/getModsDir.js.map +0 -1
- package/dist/src/commands/init/getProjectPath.js.map +0 -1
- package/dist/src/commands/init/git.js.map +0 -1
- package/dist/src/commands/init/init.js.map +0 -1
- package/dist/src/commands/init/installVSCodeExtensions.js.map +0 -1
- package/dist/src/commands/init/promptSaveSlot.js.map +0 -1
- package/dist/src/commands/init/promptVSCode.js.map +0 -1
- package/dist/src/commands/monitor/copyWatcherMod.js.map +0 -1
- package/dist/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js.map +0 -1
- package/dist/src/commands/monitor/monitor.js.map +0 -1
- package/dist/src/commands/monitor/notifyGame.js.map +0 -1
- package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js.map +0 -1
- package/dist/src/commands/monitor/saveDatWriter/types.js.map +0 -1
- package/dist/src/commands/monitor/spawnSaveDatWriter.js.map +0 -1
- package/dist/src/commands/monitor/touchWatcherSaveDatFiles.js.map +0 -1
- package/dist/src/commands/publish/publish.js.map +0 -1
- package/dist/src/configFile.js.map +0 -1
- package/dist/src/constants.js.map +0 -1
- package/dist/src/exec.js.map +0 -1
- package/dist/src/file.js.map +0 -1
- package/dist/src/main.js.map +0 -1
- package/dist/src/parseArgs.js.map +0 -1
- package/dist/src/prompt.js.map +0 -1
- package/dist/src/types/Command.js.map +0 -1
- package/dist/src/types/Config.js.map +0 -1
- package/dist/src/types/GitHubCLIHostsYAML.js.map +0 -1
- package/dist/src/utils.js.map +0 -1
- package/dist/src/validateInIsaacScriptProject.js.map +0 -1
- package/dist/src/validateNodeVersion.js.map +0 -1
- package/dist/src/validateOS.js.map +0 -1
- package/eslint-debug.sh +0 -11
- package/file-templates/dynamic/README.md +0 -3
- package/file-templates/dynamic/gitignore +0 -144
- package/file-templates/dynamic/main.ts +0 -19
- package/file-templates/dynamic/metadata.vdf +0 -6
- package/file-templates/dynamic/metadata.xml +0 -8
- package/file-templates/dynamic/package.json +0 -20
- package/file-templates/static/.cspell.json.template +0 -21
- package/file-templates/static/.env_template +0 -2
- package/file-templates/static/.eslintrc.js +0 -24
- package/file-templates/static/.gitattributes +0 -9
- package/file-templates/static/.github/workflows/ci.yml +0 -53
- package/file-templates/static/.prettierignore +0 -14
- package/file-templates/static/.prettierrc.js +0 -42
- package/file-templates/static/.vscode/extensions.json +0 -10
- package/file-templates/static/.vscode/settings.json +0 -75
- package/file-templates/static/LICENSE +0 -674
- package/file-templates/static/build.sh +0 -15
- package/file-templates/static/check-orphaned-words.sh +0 -58
- package/file-templates/static/lint.sh +0 -39
- package/file-templates/static/nuke.sh +0 -18
- package/file-templates/static/plugins/addCrashDebugStatements.ts +0 -40
- package/file-templates/static/plugins/addIsaacScriptCommentHeader.ts +0 -37
- package/file-templates/static/plugins/noExtendedEnums.ts +0 -66
- package/file-templates/static/publish.sh +0 -10
- package/file-templates/static/run.sh +0 -10
- package/file-templates/static/src/bundleEntry.ts +0 -10
- package/file-templates/static/tsconfig.eslint.json +0 -11
- package/file-templates/static/tsconfig.json +0 -33
- package/file-templates/static/update.sh +0 -21
- package/file-templates/static-alt/.prettierignore-base +0 -5
- package/file-templates/static-alt/.prettierrc-base.js +0 -30
- package/file-templates/static-alt/.vscode/extensions-format.json +0 -8
- package/file-templates/static-alt/.vscode/extensions-typescript.json +0 -9
- package/file-templates/static-alt/.vscode/settings-typescript.json +0 -63
- package/file-templates/static-alt/check-file-updates.sh +0 -67
- package/lint.sh +0 -38
- package/misc/logo.png +0 -0
- package/misc/mouseover.png +0 -0
- package/nuke.sh +0 -18
- package/publish.sh +0 -11
- package/src/checkForWindowsTerminalBugs.ts +0 -106
- package/src/commands/copy/copy.ts +0 -41
- package/src/commands/init/checkIfProjectPathExists.ts +0 -34
- package/src/commands/init/checkModSubdirectory.ts +0 -20
- package/src/commands/init/checkModTargetDirectory.ts +0 -42
- package/src/commands/init/createMod.ts +0 -196
- package/src/commands/init/getModsDir.ts +0 -107
- package/src/commands/init/getProjectPath.ts +0 -111
- package/src/commands/init/git.ts +0 -249
- package/src/commands/init/init.ts +0 -93
- package/src/commands/init/installVSCodeExtensions.ts +0 -47
- package/src/commands/init/promptSaveSlot.ts +0 -27
- package/src/commands/init/promptVSCode.ts +0 -33
- package/src/commands/monitor/copyWatcherMod.ts +0 -54
- package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts +0 -67
- package/src/commands/monitor/monitor.ts +0 -180
- package/src/commands/monitor/notifyGame.ts +0 -59
- package/src/commands/monitor/saveDatWriter/saveDatWriter.ts +0 -145
- package/src/commands/monitor/saveDatWriter/types.ts +0 -6
- package/src/commands/monitor/spawnSaveDatWriter.ts +0 -36
- package/src/commands/monitor/touchWatcherSaveDatFiles.ts +0 -20
- package/src/commands/publish/publish.ts +0 -392
- package/src/configFile.ts +0 -80
- package/src/constants.ts +0 -85
- package/src/exec.ts +0 -125
- package/src/file.ts +0 -235
- package/src/main.ts +0 -131
- package/src/parseArgs.ts +0 -127
- package/src/prompt.ts +0 -109
- package/src/types/Command.ts +0 -3
- package/src/types/Config.ts +0 -23
- package/src/types/GitHubCLIHostsYAML.ts +0 -7
- package/src/utils.ts +0 -92
- package/src/validateInIsaacScriptProject.ts +0 -35
- package/src/validateNodeVersion.ts +0 -29
- package/src/validateOS.ts +0 -20
- package/tsconfig.eslint.json +0 -11
- package/tsconfig.json +0 -21
- package/update.sh +0 -21
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
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,14 @@
|
|
|
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
|
+
"isaacscript-watcher/**"
|
|
23
|
+
],
|
|
18
24
|
"dependencies": {
|
|
19
|
-
"@types/node": "^17.0.
|
|
25
|
+
"@types/node": "^17.0.35",
|
|
20
26
|
"chalk": "4.1.2",
|
|
21
27
|
"command-exists": "^1.2.9",
|
|
22
28
|
"dotenv": "^16.0.1",
|
|
@@ -25,17 +31,17 @@
|
|
|
25
31
|
"isaacscript-tsconfig": "^1.1.16",
|
|
26
32
|
"jsonc-parser": "^3.0.0",
|
|
27
33
|
"moment": "^2.29.3",
|
|
28
|
-
"npm-check-updates": "^
|
|
34
|
+
"npm-check-updates": "^13.0.1",
|
|
29
35
|
"prompt": "^1.3.0",
|
|
30
36
|
"source-map": "^0.7.3",
|
|
31
37
|
"source-map-support": "^0.5.21",
|
|
32
|
-
"sync-directory": "^5.0.
|
|
38
|
+
"sync-directory": "^5.0.8",
|
|
33
39
|
"ts-node": "^10.7.0",
|
|
34
40
|
"typescript": "^4.6.4",
|
|
35
41
|
"typescript-to-lua": "^1.4.4",
|
|
36
42
|
"update-notifier": "^5.1.0",
|
|
37
43
|
"yaml": "^2.1.0",
|
|
38
|
-
"yargs": "^17.5.
|
|
44
|
+
"yargs": "^17.5.1"
|
|
39
45
|
},
|
|
40
46
|
"devDependencies": {
|
|
41
47
|
"@types/command-exists": "^1.2.0",
|
|
@@ -45,7 +51,7 @@
|
|
|
45
51
|
"@types/source-map-support": "^0.5.4",
|
|
46
52
|
"@types/update-notifier": "^5.1.0",
|
|
47
53
|
"@types/yargs": "^17.0.10",
|
|
48
|
-
"isaacscript-lint": "^1.0.
|
|
54
|
+
"isaacscript-lint": "^1.0.156",
|
|
49
55
|
"isaacscript-spell": "^1.0.3"
|
|
50
56
|
}
|
|
51
57
|
}
|
|
@@ -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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
// (
|
|
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) {
|
|
@@ -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
|
});
|
package/dist/src/configFile.js
CHANGED
|
@@ -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);
|
package/dist/src/constants.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
//
|
|
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,
|
|
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.
|
|
3
|
+
"version": "2.0.9",
|
|
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,14 @@
|
|
|
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
|
+
"isaacscript-watcher/**"
|
|
23
|
+
],
|
|
18
24
|
"dependencies": {
|
|
19
|
-
"@types/node": "^17.0.
|
|
25
|
+
"@types/node": "^17.0.35",
|
|
20
26
|
"chalk": "4.1.2",
|
|
21
27
|
"command-exists": "^1.2.9",
|
|
22
28
|
"dotenv": "^16.0.1",
|
|
@@ -25,17 +31,17 @@
|
|
|
25
31
|
"isaacscript-tsconfig": "^1.1.16",
|
|
26
32
|
"jsonc-parser": "^3.0.0",
|
|
27
33
|
"moment": "^2.29.3",
|
|
28
|
-
"npm-check-updates": "^
|
|
34
|
+
"npm-check-updates": "^13.0.1",
|
|
29
35
|
"prompt": "^1.3.0",
|
|
30
36
|
"source-map": "^0.7.3",
|
|
31
37
|
"source-map-support": "^0.5.21",
|
|
32
|
-
"sync-directory": "^5.0.
|
|
38
|
+
"sync-directory": "^5.0.8",
|
|
33
39
|
"ts-node": "^10.7.0",
|
|
34
40
|
"typescript": "^4.6.4",
|
|
35
41
|
"typescript-to-lua": "^1.4.4",
|
|
36
42
|
"update-notifier": "^5.1.0",
|
|
37
43
|
"yaml": "^2.1.0",
|
|
38
|
-
"yargs": "^17.5.
|
|
44
|
+
"yargs": "^17.5.1"
|
|
39
45
|
},
|
|
40
46
|
"devDependencies": {
|
|
41
47
|
"@types/command-exists": "^1.2.0",
|
|
@@ -45,7 +51,7 @@
|
|
|
45
51
|
"@types/source-map-support": "^0.5.4",
|
|
46
52
|
"@types/update-notifier": "^5.1.0",
|
|
47
53
|
"@types/yargs": "^17.0.10",
|
|
48
|
-
"isaacscript-lint": "^1.0.
|
|
54
|
+
"isaacscript-lint": "^1.0.156",
|
|
49
55
|
"isaacscript-spell": "^1.0.3"
|
|
50
56
|
}
|
|
51
57
|
}
|
package/.cspell.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
|
|
3
|
-
"version": "0.2",
|
|
4
|
-
"import": [
|
|
5
|
-
"isaacscript-spell/.cspell-isaacscript.json"
|
|
6
|
-
],
|
|
7
|
-
"files": [
|
|
8
|
-
"**"
|
|
9
|
-
],
|
|
10
|
-
"ignorePaths": [
|
|
11
|
-
"*.anm2",
|
|
12
|
-
"*.pyc",
|
|
13
|
-
"*.wav",
|
|
14
|
-
".git/**",
|
|
15
|
-
"dist/**",
|
|
16
|
-
"node_modules/**",
|
|
17
|
-
"mod/main.lua",
|
|
18
|
-
"mod/resources/rooms/**"
|
|
19
|
-
],
|
|
20
|
-
"words": [
|
|
21
|
-
"APPDATA",
|
|
22
|
-
"npmignore",
|
|
23
|
-
"syncer"
|
|
24
|
-
]
|
|
25
|
-
}
|
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
|
package/.github/workflows/ci.yml
DELETED
|
@@ -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
package/.prettierrc.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// This is the configuration file for Prettier, the auto-formatter:
|
|
2
|
-
// https://prettier.io/docs/en/configuration.html
|
|
3
|
-
module.exports = {
|
|
4
|
-
// Always print trailing commas:
|
|
5
|
-
// https://prettier.io/docs/en/options.html#trailing-commas
|
|
6
|
-
// The default is "es5" - Trailing commas where valid in ES5 (objects, arrays, etc.). However,
|
|
7
|
-
// always having trailing commas is objectively better. The Airbnb style guide agrees:
|
|
8
|
-
// https://github.com/airbnb/javascript#commas--dangling
|
|
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
|
|
11
|
-
// https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8
|
|
12
|
-
// Prettier will change the default in the future:
|
|
13
|
-
// https://github.com/prettier/prettier/issues/9369
|
|
14
|
-
trailingComma: "all",
|
|
15
|
-
|
|
16
|
-
// We want to always use "lf" to be consistent with all platforms.
|
|
17
|
-
endOfLine: "lf",
|
|
18
|
-
|
|
19
|
-
// Allow proper formatting of JSONC files:
|
|
20
|
-
// https://github.com/prettier/prettier/issues/5708
|
|
21
|
-
overrides: [
|
|
22
|
-
{
|
|
23
|
-
files: ["**/.vscode/*.json", "**/tsconfig.json", "**/tsconfig.*.json"],
|
|
24
|
-
options: {
|
|
25
|
-
parser: "json5",
|
|
26
|
-
quoteProps: "preserve",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
files: ["**/*.xml"],
|
|
31
|
-
options: {
|
|
32
|
-
printWidth: 1000000,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
|
|
37
|
-
// Allow proper formatting of XML files:
|
|
38
|
-
// https://github.com/prettier/plugin-xml#configuration
|
|
39
|
-
// The default is "struct". However, whitespace cannot be reformatted unless this is set to
|
|
40
|
-
// "ignore".
|
|
41
|
-
xmlWhitespaceSensitivity: "ignore",
|
|
42
|
-
};
|
package/.vscode/extensions.json
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// These are Visual Studio Code extensions that are intended to be used with this particular
|
|
2
|
-
// repository: https://go.microsoft.com/fwlink/?LinkId=827846
|
|
3
|
-
{
|
|
4
|
-
"recommendations": [
|
|
5
|
-
"esbenp.prettier-vscode", // The TypeScript formatter
|
|
6
|
-
"dbaeumer.vscode-eslint", // The TypeScript linter
|
|
7
|
-
"streetsidesoftware.code-spell-checker", // A spell-checker extension based on cspell
|
|
8
|
-
],
|
|
9
|
-
}
|