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,163 +1,138 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
exports.createMod =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
file.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
file.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
file.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
file
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
// example TypeScript file fail to compile.)
|
|
139
|
-
const srcPath = path_1.default.join(projectPath, "src");
|
|
140
|
-
const fileName = constants_1.MAIN_TS;
|
|
141
|
-
const templatePath = constants_1.MAIN_TS_TEMPLATE_PATH;
|
|
142
|
-
const template = file.read(templatePath, verbose);
|
|
143
|
-
const mainTS = template.replace(/MOD-NAME-TO-REPLACE/g, projectName);
|
|
144
|
-
const destinationPath = path_1.default.join(srcPath, fileName);
|
|
145
|
-
file.write(destinationPath, mainTS, verbose);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
/** The "package.json" file has to be copied first before this step. */
|
|
149
|
-
function updateNodeModules(projectPath, verbose) {
|
|
150
|
-
console.log("Finding out the latest versions of the NPM packages...");
|
|
151
|
-
(0, exec_1.execShell)("npx", ["npm-check-updates", "--upgrade", "--packageFile", "package.json"], verbose, false, projectPath);
|
|
152
|
-
}
|
|
153
|
-
function installNodeModules(projectPath, skipNPMInstall, verbose) {
|
|
154
|
-
if (skipNPMInstall) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
console.log("Installing node modules... (This can take a long time.)");
|
|
158
|
-
(0, exec_1.execShell)("npm", ["install"], verbose, false, projectPath);
|
|
159
|
-
}
|
|
160
|
-
function formatFiles(projectPath, verbose) {
|
|
161
|
-
(0, exec_1.execShell)("npx", ["prettier", "--write", projectPath], verbose, false, projectPath);
|
|
162
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMod = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const configFile = tslib_1.__importStar(require("../../configFile"));
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const exec_1 = require("../../exec");
|
|
10
|
+
const file = tslib_1.__importStar(require("../../file"));
|
|
11
|
+
const git_1 = require("./git");
|
|
12
|
+
function createMod(projectName, projectPath, createNewDir, modsDirectory, saveSlot, gitRemoteURL, skipNPMInstall, verbose) {
|
|
13
|
+
if (createNewDir) {
|
|
14
|
+
file.makeDir(projectPath, verbose);
|
|
15
|
+
}
|
|
16
|
+
const config = configFile.createObject(modsDirectory, saveSlot);
|
|
17
|
+
configFile.createFile(projectPath, config, verbose);
|
|
18
|
+
const targetModDirectory = path_1.default.join(config.modsDirectory, projectName);
|
|
19
|
+
makeSubdirectories(projectPath, verbose);
|
|
20
|
+
copyStaticFiles(projectPath, verbose);
|
|
21
|
+
copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose);
|
|
22
|
+
updateNodeModules(projectPath, verbose);
|
|
23
|
+
installNodeModules(projectPath, skipNPMInstall, verbose);
|
|
24
|
+
formatFiles(projectPath, verbose);
|
|
25
|
+
// Only make the initial commit once all of the files have been copied and formatted.
|
|
26
|
+
(0, git_1.initGitRepository)(projectPath, gitRemoteURL, verbose);
|
|
27
|
+
console.log(`Successfully created mod: ${chalk_1.default.green(projectName)}`);
|
|
28
|
+
}
|
|
29
|
+
exports.createMod = createMod;
|
|
30
|
+
function makeSubdirectories(projectPath, verbose) {
|
|
31
|
+
// The "src" directory is created during copying of static files.
|
|
32
|
+
for (const subdirectory of ["mod"]) {
|
|
33
|
+
const srcPath = path_1.default.join(projectPath, subdirectory);
|
|
34
|
+
file.makeDir(srcPath, verbose);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** Copy static files, like ".eslintrc.js", "tsconfig.json", etc. */
|
|
38
|
+
function copyStaticFiles(projectPath, verbose) {
|
|
39
|
+
const staticFileList = file.getDirList(constants_1.TEMPLATES_STATIC_DIR, verbose);
|
|
40
|
+
staticFileList.forEach((fileName) => {
|
|
41
|
+
const templateFilePath = path_1.default.join(constants_1.TEMPLATES_STATIC_DIR, fileName);
|
|
42
|
+
const destinationFilePath = path_1.default.join(projectPath, fileName);
|
|
43
|
+
if (!file.exists(destinationFilePath, verbose)) {
|
|
44
|
+
file.copy(templateFilePath, destinationFilePath, verbose);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
// Rename ".cspell.json.template" to ".cspell.json.template". (If it is kept as ".cspell.json",
|
|
48
|
+
// then local spell checking will fail.)
|
|
49
|
+
const cSpellConfigPath = path_1.default.join(projectPath, ".cspell.json.template");
|
|
50
|
+
const correctCSpellConfigPath = path_1.default.join(projectPath, ".cspell.json");
|
|
51
|
+
file.rename(cSpellConfigPath, correctCSpellConfigPath, verbose);
|
|
52
|
+
}
|
|
53
|
+
/** Copy files that need to have text replaced inside of them. */
|
|
54
|
+
function copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose) {
|
|
55
|
+
// `.gitignore`
|
|
56
|
+
{
|
|
57
|
+
const fileName = constants_1.GITIGNORE;
|
|
58
|
+
const templatePath = constants_1.GITIGNORE_TEMPLATE_PATH;
|
|
59
|
+
const template = file.read(templatePath, verbose);
|
|
60
|
+
// Prepend a header with the project name.
|
|
61
|
+
let separatorLine = "# ";
|
|
62
|
+
for (let i = 0; i < projectName.length; i++) {
|
|
63
|
+
separatorLine += "-";
|
|
64
|
+
}
|
|
65
|
+
separatorLine += "\n";
|
|
66
|
+
const gitignoreHeader = `${separatorLine}# ${projectName}\n${separatorLine}\n`;
|
|
67
|
+
const gitignore = gitignoreHeader + template;
|
|
68
|
+
const destinationPath = path_1.default.join(projectPath, `.${fileName}`); // We need to prepend a period
|
|
69
|
+
file.write(destinationPath, gitignore, verbose);
|
|
70
|
+
}
|
|
71
|
+
// `package.json`
|
|
72
|
+
{
|
|
73
|
+
// Modify and copy the file.
|
|
74
|
+
const fileName = constants_1.PACKAGE_JSON;
|
|
75
|
+
const templatePath = constants_1.PACKAGE_JSON_TEMPLATE_PATH;
|
|
76
|
+
const template = file.read(templatePath, verbose);
|
|
77
|
+
const packageJSON = template.replace(/MOD-NAME-TO-REPLACE/g, projectName);
|
|
78
|
+
const destinationPath = path_1.default.join(projectPath, fileName);
|
|
79
|
+
file.write(destinationPath, packageJSON, verbose);
|
|
80
|
+
}
|
|
81
|
+
// `README.md`
|
|
82
|
+
{
|
|
83
|
+
const fileName = constants_1.README_MD;
|
|
84
|
+
const templatePath = constants_1.README_MD_TEMPLATES_PATH;
|
|
85
|
+
const template = file.read(templatePath, verbose);
|
|
86
|
+
const readmeMD = template.replace(/MOD-NAME-TO-REPLACE/g, projectName);
|
|
87
|
+
const destinationPath = path_1.default.join(projectPath, fileName);
|
|
88
|
+
file.write(destinationPath, readmeMD, verbose);
|
|
89
|
+
}
|
|
90
|
+
// `mod/metadata.xml`
|
|
91
|
+
{
|
|
92
|
+
const fileName = constants_1.METADATA_XML;
|
|
93
|
+
const templatePath = constants_1.METADATA_XML_TEMPLATE_PATH;
|
|
94
|
+
const template = file.read(templatePath, verbose);
|
|
95
|
+
const metadataXML = template.replace(/MOD-NAME-TO-REPLACE/g, projectName);
|
|
96
|
+
const modPath = path_1.default.join(projectPath, "mod");
|
|
97
|
+
const destinationPath = path_1.default.join(modPath, fileName);
|
|
98
|
+
file.write(destinationPath, metadataXML, verbose);
|
|
99
|
+
}
|
|
100
|
+
// `mod/metadata.vdf`
|
|
101
|
+
{
|
|
102
|
+
const fileName = constants_1.METADATA_VDF;
|
|
103
|
+
const templatePath = constants_1.METADATA_VDF_TEMPLATE_PATH;
|
|
104
|
+
const template = file.read(templatePath, verbose);
|
|
105
|
+
const metadataVDF = template.replace(/MOD-TARGET-DIR/g, targetModDirectory);
|
|
106
|
+
const modPath = path_1.default.join(projectPath, "mod");
|
|
107
|
+
const destinationPath = path_1.default.join(modPath, fileName);
|
|
108
|
+
file.write(destinationPath, metadataVDF, verbose);
|
|
109
|
+
}
|
|
110
|
+
// `src/main.ts`
|
|
111
|
+
{
|
|
112
|
+
// Convert snake_case and kebab-case to camelCase. (Kebab-case in particular will make the
|
|
113
|
+
// example TypeScript file fail to compile.)
|
|
114
|
+
const srcPath = path_1.default.join(projectPath, "src");
|
|
115
|
+
const fileName = constants_1.MAIN_TS;
|
|
116
|
+
const templatePath = constants_1.MAIN_TS_TEMPLATE_PATH;
|
|
117
|
+
const template = file.read(templatePath, verbose);
|
|
118
|
+
const mainTS = template.replace(/MOD-NAME-TO-REPLACE/g, projectName);
|
|
119
|
+
const destinationPath = path_1.default.join(srcPath, fileName);
|
|
120
|
+
file.write(destinationPath, mainTS, verbose);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** The "package.json" file has to be copied first before this step. */
|
|
124
|
+
function updateNodeModules(projectPath, verbose) {
|
|
125
|
+
console.log("Finding out the latest versions of the NPM packages...");
|
|
126
|
+
(0, exec_1.execShell)("npx", ["npm-check-updates", "--upgrade", "--packageFile", "package.json"], verbose, false, projectPath);
|
|
127
|
+
}
|
|
128
|
+
function installNodeModules(projectPath, skipNPMInstall, verbose) {
|
|
129
|
+
if (skipNPMInstall) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
console.log("Installing node modules... (This can take a long time.)");
|
|
133
|
+
(0, exec_1.execShell)("npm", ["install"], verbose, false, projectPath);
|
|
134
|
+
}
|
|
135
|
+
function formatFiles(projectPath, verbose) {
|
|
136
|
+
(0, exec_1.execShell)("npx", ["prettier", "--write", projectPath], verbose, false, projectPath);
|
|
137
|
+
}
|
|
163
138
|
//# sourceMappingURL=createMod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createMod.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/createMod.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,wDAAwB;AACxB,qEAA+C;AAC/C,+CAcyB;AACzB,qCAAuC;AACvC,yDAAmC;AACnC,+BAA0C;AAE1C,SAAgB,SAAS,CACvB,WAAmB,EACnB,WAAmB,EACnB,YAAqB,EACrB,aAAqB,EACrB,QAAgB,EAChB,YAAgC,EAChC,cAAuB,EACvB,OAAgB;IAEhB,IAAI,YAAY,EAAE;QAChB,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;KACpC;IAED,MAAM,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E,QAAQ,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;KAC9C;AACH,CAAC;AAED,uEAAuE;AACvE,SAAS,iBAAiB,CAAC,WAAmB,EAAE,OAAgB;IAC9D,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IACtE,IAAA,gBAAS,EACP,KAAK,EACL,CAAC,mBAAmB,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,CAAC,EACnE,OAAO,EACP,KAAK,EACL,WAAW,CACZ,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,WAAmB,EACnB,cAAuB,EACvB,OAAgB;IAEhB,IAAI,cAAc,EAAE;QAClB,OAAO;KACR;IAED,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACvE,IAAA,gBAAS,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,WAAW,CAAC,WAAmB,EAAE,OAAgB;IACxD,IAAA,gBAAS,EACP,KAAK,EACL,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC,EACpC,OAAO,EACP,KAAK,EACL,WAAW,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getModsDir(argv: Record<string, unknown>, verbose: boolean): Promise<string>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getModsDir = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const constants_1 = require("../../constants");
|
|
8
|
+
const file = tslib_1.__importStar(require("../../file"));
|
|
9
|
+
const prompt_1 = require("../../prompt");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
const MODS = "mods";
|
|
12
|
+
const DEFAULT_MODS_PATH_WINDOWS = path_1.default.join("C:", "Program Files (x86)", "Steam", "steamapps", "common", "The Binding of Isaac Rebirth", MODS);
|
|
13
|
+
/** This is a subdirectory of `$HOME`. */
|
|
14
|
+
const DEFAULT_MODS_PATH_LINUX = path_1.default.join(constants_1.HOME_DIR, ".local", "share", "Steam", "steamapps", "common", "The Binding of Isaac Rebirth", MODS);
|
|
15
|
+
function getModsDir(argv, verbose) {
|
|
16
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
if (argv["modsDirectory"] !== undefined) {
|
|
18
|
+
// They specified the "--mods-directory" command-line flag, so there is no need to prompt the
|
|
19
|
+
// user for it.
|
|
20
|
+
return argv["modsDirectory"];
|
|
21
|
+
}
|
|
22
|
+
const defaultModsPath = getDefaultModsPath(process.platform);
|
|
23
|
+
if (file.exists(defaultModsPath, verbose) &&
|
|
24
|
+
file.isDir(defaultModsPath, verbose)) {
|
|
25
|
+
return defaultModsPath;
|
|
26
|
+
}
|
|
27
|
+
console.error(`Failed to find your mods directory at: ${chalk_1.default.green(defaultModsPath)}`);
|
|
28
|
+
const modsDir = yield (0, prompt_1.getInputString)(`Enter the full path to the "${MODS}" directory on your system, which should be next to your "isaac-ng.exe" program:`);
|
|
29
|
+
if (modsDir === "") {
|
|
30
|
+
(0, utils_1.error)("Error: You did not provide a response; exiting.");
|
|
31
|
+
}
|
|
32
|
+
if (!file.exists(modsDir, verbose)) {
|
|
33
|
+
(0, utils_1.error)(`Error: The directory of "${chalk_1.default.green(modsDir)}" does not exist. Exiting.`);
|
|
34
|
+
}
|
|
35
|
+
if (!file.isDir(modsDir, verbose)) {
|
|
36
|
+
(0, utils_1.error)(`Error: The path of "${chalk_1.default.green(modsDir)}" is not a directory. Exiting.`);
|
|
37
|
+
}
|
|
38
|
+
if (path_1.default.basename(modsDir) !== MODS) {
|
|
39
|
+
(0, utils_1.error)(`Error: You entered a path of "${chalk_1.default.green(modsDir)}", but you need to input a directory with a name of "${MODS}" at the end. Exiting.`);
|
|
40
|
+
}
|
|
41
|
+
return modsDir;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.getModsDir = getModsDir;
|
|
45
|
+
function getDefaultModsPath(platform) {
|
|
46
|
+
switch (platform) {
|
|
47
|
+
case "win32": {
|
|
48
|
+
return DEFAULT_MODS_PATH_WINDOWS;
|
|
49
|
+
}
|
|
50
|
+
case "linux": {
|
|
51
|
+
return DEFAULT_MODS_PATH_LINUX;
|
|
52
|
+
}
|
|
53
|
+
default: {
|
|
54
|
+
return (0, utils_1.error)(`There does not exist a default mod path for the platform of: ${chalk_1.default.green(platform)}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=getModsDir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getModsDir.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/getModsDir.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,wDAAwB;AACxB,+CAA2C;AAC3C,yDAAmC;AACnC,yCAA8C;AAC9C,uCAAoC;AAEpC,MAAM,IAAI,GAAG,MAAM,CAAC;AAEpB,MAAM,yBAAyB,GAAG,cAAI,CAAC,IAAI,CACzC,IAAI,EACJ,qBAAqB,EACrB,OAAO,EACP,WAAW,EACX,QAAQ,EACR,8BAA8B,EAC9B,IAAI,CACL,CAAC;AAEF,yCAAyC;AACzC,MAAM,uBAAuB,GAAG,cAAI,CAAC,IAAI,CACvC,oBAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,EACP,WAAW,EACX,QAAQ,EACR,8BAA8B,EAC9B,IAAI,CACL,CAAC;AAEF,SAAsB,UAAU,CAC9B,IAA6B,EAC7B,OAAgB;;QAEhB,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,SAAS,EAAE;Y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AED,KAAK,OAAO,CAAC,CAAC;YACZ,OAAO,uBAAuB,CAAC;SAChC;QAED,OAAO,CAAC,CAAC;YACP,OAAO,IAAA,aAAK,EACV,gEAAgE,eAAK,CAAC,KAAK,CACzE,QAAQ,CACT,EAAE,CACJ,CAAC;SACH;KACF;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getProjectPath(argv: Record<string, unknown>, useCurrentDir: boolean, yes: boolean, forceName: boolean): Promise<[string, boolean]>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProjectPath = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const constants_1 = require("../../constants");
|
|
8
|
+
const prompt_1 = require("../../prompt");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
// From: https://gist.github.com/doctaphred/d01d05291546186941e1b7ddc02034d3
|
|
11
|
+
const ILLEGAL_CHARACTERS_FOR_WINDOWS_FILENAMES = [
|
|
12
|
+
"<",
|
|
13
|
+
">",
|
|
14
|
+
":",
|
|
15
|
+
'"',
|
|
16
|
+
"/",
|
|
17
|
+
"\\",
|
|
18
|
+
"|",
|
|
19
|
+
"?",
|
|
20
|
+
"*",
|
|
21
|
+
];
|
|
22
|
+
function getProjectPath(argv, useCurrentDir, yes, forceName) {
|
|
23
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
let projectName = getProjectNameFromCommandLineArgument(argv);
|
|
25
|
+
let projectPath;
|
|
26
|
+
let createNewDir;
|
|
27
|
+
if (useCurrentDir) {
|
|
28
|
+
// The "--use-current-dir" command-line flag was specified, so there is no need to prompt the
|
|
29
|
+
// user.
|
|
30
|
+
projectName = constants_1.CURRENT_DIRECTORY_NAME;
|
|
31
|
+
projectPath = constants_1.CWD;
|
|
32
|
+
createNewDir = false;
|
|
33
|
+
}
|
|
34
|
+
else if (projectName !== undefined) {
|
|
35
|
+
// The project name was specified on the command-line.
|
|
36
|
+
projectPath = path_1.default.join(constants_1.CWD, projectName);
|
|
37
|
+
createNewDir = true;
|
|
38
|
+
}
|
|
39
|
+
else if (yes) {
|
|
40
|
+
// The "--yes" command-line flag was specified and the project name was not specified on the
|
|
41
|
+
// command-line, so default to using the current directory.
|
|
42
|
+
projectName = constants_1.CURRENT_DIRECTORY_NAME;
|
|
43
|
+
projectPath = constants_1.CWD;
|
|
44
|
+
createNewDir = false;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// The project name was not specified on the command-line, so prompt the user for it.
|
|
48
|
+
[projectName, projectPath, createNewDir] = yield getNewProjectName();
|
|
49
|
+
}
|
|
50
|
+
validateProjectName(projectName, forceName);
|
|
51
|
+
console.log(`Using a project name of: ${chalk_1.default.green(projectName)}`);
|
|
52
|
+
return [projectPath, createNewDir];
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
exports.getProjectPath = getProjectPath;
|
|
56
|
+
function getProjectNameFromCommandLineArgument(argv) {
|
|
57
|
+
const name = argv["name"];
|
|
58
|
+
return typeof name === "string" && name !== "" ? name : undefined;
|
|
59
|
+
}
|
|
60
|
+
function getNewProjectName() {
|
|
61
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
console.log("You did not specify a project name as a command-line argument.");
|
|
63
|
+
const shouldUseCurrentDir = yield (0, prompt_1.getInputYesNo)(`Would you like to create a new project using the current directory "${chalk_1.default.green(constants_1.CURRENT_DIRECTORY_NAME)}" as the root?`);
|
|
64
|
+
if (shouldUseCurrentDir) {
|
|
65
|
+
return [constants_1.CURRENT_DIRECTORY_NAME, constants_1.CWD, false];
|
|
66
|
+
}
|
|
67
|
+
const projectName = yield (0, prompt_1.getInputString)("Enter the name of the project:");
|
|
68
|
+
const projectPath = path_1.default.join(constants_1.CWD, projectName);
|
|
69
|
+
return [projectName, projectPath, true];
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function validateProjectName(projectName, forceName) {
|
|
73
|
+
if (projectName === "") {
|
|
74
|
+
(0, utils_1.error)("Error: You cannot have a blank project name.");
|
|
75
|
+
}
|
|
76
|
+
if (process.platform === "win32") {
|
|
77
|
+
for (const character of ILLEGAL_CHARACTERS_FOR_WINDOWS_FILENAMES) {
|
|
78
|
+
if (projectName.includes(character)) {
|
|
79
|
+
(0, utils_1.error)(`Error: The "${character}" character is not allowed in a Windows file name.`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (forceName) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if ((0, utils_1.hasWhiteSpace)(projectName)) {
|
|
87
|
+
(0, utils_1.error)('Error: The project name has whitespace in it, which is not allowed. Use kebab-case for your project name. (e.g. "green-candle")');
|
|
88
|
+
}
|
|
89
|
+
if (!(0, utils_1.isKebabCase)(projectName)) {
|
|
90
|
+
(0, utils_1.error)('Error: The project name is not in kebab-case. (Kebab-case is the style of using all lowercase letters, with words separated by hyphens.) Project names must use kebab-case to match GitHub repository standards. If necessary, you can override this check with the "--force-name" flag.');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=getProjectPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProjectPath.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/getProjectPath.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,wDAAwB;AACxB,+CAA8D;AAC9D,yCAA6D;AAC7D,uCAAgE;AAEhE,4EAA4E;AAC5E,MAAM,wCAAwC,GAAG;IAC/C,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;CACJ,CAAC;AAEF,SAAsB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C,gEAAgE,CAAC,CAAC;QAC9E,MAAM,mBAAmB,GAAG,MAAM,IAAA,sBAAa,EAC7C,uEAAuE,eAAK,CAAC,KAAK,CAChF,kCAAsB,CACvB,gBAAgB,CAClB,CAAC;QAEF,IAAI,mBAAmB,EAAE;YACvB,OAAO,CAAC,kCAAsB,EAAE,eAAG,EAAE,KAAK,CAAC,CAAC;SAC7C;QAED,MAAM,WAAW,GAAG,MAAM,IAAA,uBAAc,EAAC,gCAAgC,CAAC,CAAC;QAC3E,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,eAAG,EAAE,WAAW,CAAC,CAAC;QAEhD,OAAO,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;CAAA;AAED,SAAS,mBAAmB,CAAC,WAAmB,EAAE,SAAkB;IAClE,IAAI,WAAW,KAAK,EAAE,EAAE;QACtB,IAAA,aAAK,EAAC,8CAA8C,CAAC,CAAC;KACvD;IAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QAChC,KAAK,MAAM,SAAS,IAAI,wCAAwC,EAAE;YAChE,IAAI,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;gBACnC,IAAA,aAAK,EACH,eAAe,SAAS,oDAAoD,CAC7E,CAAC;aACH;SACF;KACF;IAED,IAAI,SAAS,EAAE;QACb,OAAO;KACR;IAED,IAAI,IAAA,qBAAa,EAAC,WAAW,CAAC,EAAE;QAC9B,IAAA,aAAK,EACH,iIAAiI,CAClI,CAAC;KACH;IAED,IAAI,CAAC,IAAA,mBAAW,EAAC,WAAW,CAAC,EAAE;QAC7B,IAAA,aAAK,EACH,0RAA0R,CAC3R,CAAC;KACH;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function promptGitHubRepoOrGitRemoteURL(projectName: string, yes: boolean, verbose: boolean): Promise<string | undefined>;
|
|
2
|
+
export declare function initGitRepository(projectPath: string, gitRemoteURL: string | undefined, verbose: boolean): void;
|
|
3
|
+
export declare function isGitDirty(verbose: boolean): boolean;
|
|
4
|
+
export declare function gitCommitIfChanges(version: string, verbose: boolean): void;
|