isaacscript 2.19.1 → 2.20.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/file-templates/static-alt/.vscode/settings-typescript.json +2 -4
- package/package.json +3 -3
- package/schemas/isaacscript-schema.json +29 -0
- package/src/classes/Config.js +11 -1
- package/src/classes/Config.js.map +1 -1
- package/src/commands/init/createMod.js +2 -1
- package/src/commands/init/createMod.js.map +1 -1
- package/src/configFile.js +3 -10
- package/src/configFile.js.map +1 -1
- package/src/plugins/addIsaacScriptCommentHeaderCommon.js +48 -0
- package/src/plugins/addIsaacScriptCommentHeaderCommon.js.map +1 -0
- package/src/plugins/addIsaacScriptCommentHeaderDefinitions.js +49 -0
- package/src/plugins/addIsaacScriptCommentHeaderDefinitions.js.map +1 -0
|
@@ -15,11 +15,9 @@
|
|
|
15
15
|
"files.trimTrailingWhitespace": true,
|
|
16
16
|
|
|
17
17
|
// Configure glob patterns for excluding files and folders in full text searches and quick open.
|
|
18
|
-
// (File extensions must be specified or the glob won't work properly.)
|
|
19
18
|
"search.exclude": {
|
|
20
|
-
"dist
|
|
21
|
-
"
|
|
22
|
-
"dist/**/*.json": true,
|
|
19
|
+
"**/dist/": true,
|
|
20
|
+
"**/node_modules/": true,
|
|
23
21
|
},
|
|
24
22
|
|
|
25
23
|
// -----------------
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.0",
|
|
4
4
|
"description": "A command line tool for managing Isaac mods written in TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"ajv": "^8.11.0",
|
|
30
30
|
"chalk": "4.1.2",
|
|
31
31
|
"command-exists": "^1.2.9",
|
|
32
|
-
"dotenv": "^16.0.
|
|
32
|
+
"dotenv": "^16.0.2",
|
|
33
33
|
"figlet": "^1.5.2",
|
|
34
34
|
"fs-extra": "^10.1.0",
|
|
35
35
|
"git-dirty": "^1.0.2",
|
|
36
36
|
"glob": "^8.0.3",
|
|
37
37
|
"isaacscript-tsconfig": "^2.0.0",
|
|
38
|
-
"jsonc-parser": "^3.
|
|
38
|
+
"jsonc-parser": "^3.2.0",
|
|
39
39
|
"moment": "^2.29.4",
|
|
40
40
|
"npm-check-updates": "^16.0.6",
|
|
41
41
|
"prompt": "^1.3.0",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/Config",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"Config": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"description": "The mandatory properties must be explicitly validated in `configFile.ts`.",
|
|
8
|
+
"properties": {
|
|
9
|
+
"customTargetModDirectoryName": {
|
|
10
|
+
"description": "By default, the target mod directory name will be the same as the project directory name. This setting allows you to customize it.",
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"enableIsaacScriptWatcherAutoRestart": {
|
|
14
|
+
"description": "When your code is recompiled, IsaacScript watcher can restart the game to ensure that any run-related variables are properly reset. This is set to true by default.",
|
|
15
|
+
"type": "boolean"
|
|
16
|
+
},
|
|
17
|
+
"isaacScriptCommonDev": {
|
|
18
|
+
"description": "If set to true, the IsaacScript watcher will spawn an additional watcher process for the files in the `isaacscript-common` directory. (It assumes that you have `isaacscript-common` linked to a forked development repository.)",
|
|
19
|
+
"type": "boolean"
|
|
20
|
+
},
|
|
21
|
+
"steamCmdPath": {
|
|
22
|
+
"description": "The path to \"steamcmd.exe\". This is optional and only needed for automating publishing.",
|
|
23
|
+
"type": "string"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"type": "object"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/classes/Config.js
CHANGED
|
@@ -3,11 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Config = void 0;
|
|
4
4
|
/** The mandatory properties must be explicitly validated in `configFile.ts`. */
|
|
5
5
|
class Config {
|
|
6
|
-
constructor() {
|
|
6
|
+
constructor(modsDirectory, saveSlot, isaacScriptCommonDev) {
|
|
7
|
+
this.$schema = "https://raw.githubusercontent.com/IsaacScript/isaacscript/main/packages/isaacscript-cli/schemas/isaacscript-schema.json";
|
|
7
8
|
/** The "mods" directory that lives next to the "isaac-ng.exe" program. */
|
|
8
9
|
this.modsDirectory = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\mods";
|
|
9
10
|
/** The save slot that you test your mod on. */
|
|
10
11
|
this.saveSlot = 1;
|
|
12
|
+
if (modsDirectory !== undefined) {
|
|
13
|
+
this.modsDirectory = modsDirectory;
|
|
14
|
+
}
|
|
15
|
+
if (saveSlot !== undefined) {
|
|
16
|
+
this.saveSlot = saveSlot;
|
|
17
|
+
}
|
|
18
|
+
if (isaacScriptCommonDev !== undefined) {
|
|
19
|
+
this.isaacScriptCommonDev = isaacScriptCommonDev;
|
|
20
|
+
}
|
|
11
21
|
}
|
|
12
22
|
}
|
|
13
23
|
exports.Config = Config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../../../../packages/isaacscript-cli/src/classes/Config.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,MAAa,MAAM;
|
|
1
|
+
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../../../../packages/isaacscript-cli/src/classes/Config.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,MAAa,MAAM;IAiCjB,YACE,aAAsB,EACtB,QAAiB,EACjB,oBAA8B;QAnChC,YAAO,GACL,yHAAyH,CAAC;QAE5H,0EAA0E;QAC1E,kBAAa,GACX,uFAAuF,CAAC;QAE1F,+CAA+C;QAC/C,aAAQ,GAAG,CAAC,CAAC;QA6BX,IAAI,aAAa,KAAK,SAAS,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;SACpC;QAED,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;SAC1B;QAED,IAAI,oBAAoB,KAAK,SAAS,EAAE;YACtC,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;SAClD;IACH,CAAC;CACF;AAlDD,wBAkDC"}
|
|
@@ -4,6 +4,7 @@ exports.createMod = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const Config_1 = require("../../classes/Config");
|
|
7
8
|
const configFile_1 = require("../../configFile");
|
|
8
9
|
const constants_1 = require("../../constants");
|
|
9
10
|
const exec_1 = require("../../exec");
|
|
@@ -15,7 +16,7 @@ function createMod(projectName, projectPath, createNewDir, modsDirectory, saveSl
|
|
|
15
16
|
if (createNewDir) {
|
|
16
17
|
file.makeDir(projectPath, verbose);
|
|
17
18
|
}
|
|
18
|
-
const config =
|
|
19
|
+
const config = new Config_1.Config(modsDirectory, saveSlot, dev);
|
|
19
20
|
(0, configFile_1.createConfigFile)(projectPath, config, verbose);
|
|
20
21
|
copyStaticFiles(projectPath, verbose);
|
|
21
22
|
copyDynamicFiles(projectName, projectPath, packageManager, dev, verbose);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMod.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/createMod.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,wDAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"createMod.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/createMod.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,wDAAwB;AACxB,iDAA8C;AAC9C,i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
3
|
-
exports.createConfigFile = exports.
|
|
3
|
+
exports.createConfigFile = exports.getConfigFromFile = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
+
const Config_1 = require("./classes/Config");
|
|
6
7
|
const getModsDir_1 = require("./commands/init/getModsDir");
|
|
7
8
|
const promptSaveSlot_1 = require("./commands/init/promptSaveSlot");
|
|
8
9
|
const constants_1 = require("./constants");
|
|
@@ -21,7 +22,7 @@ async function getConfigFromFile(args) {
|
|
|
21
22
|
// No config file exists, so prompt the user for some information and create one.
|
|
22
23
|
const modsDirectory = await (0, getModsDir_1.getModsDir)(args, verbose);
|
|
23
24
|
const saveSlot = await (0, promptSaveSlot_1.promptSaveSlot)(args, yes);
|
|
24
|
-
const config =
|
|
25
|
+
const config = new Config_1.Config(modsDirectory, saveSlot, dev);
|
|
25
26
|
createConfigFile(constants_1.CWD, config, verbose);
|
|
26
27
|
return config;
|
|
27
28
|
}
|
|
@@ -49,14 +50,6 @@ function validateMandatoryConfigFields(config) {
|
|
|
49
50
|
function errorMissing(field, description) {
|
|
50
51
|
(0, utils_1.error)(`The "${constants_1.CONFIG_FILE_NAME}" file is missing a "${field}" value. ${description} Please add it.`);
|
|
51
52
|
}
|
|
52
|
-
function newConfig(modsDirectory, saveSlot, isaacScriptCommonDev) {
|
|
53
|
-
return {
|
|
54
|
-
modsDirectory,
|
|
55
|
-
saveSlot,
|
|
56
|
-
isaacScriptCommonDev,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
exports.newConfig = newConfig;
|
|
60
53
|
function createConfigFile(projectPath, config, verbose) {
|
|
61
54
|
const configFilePath = path_1.default.join(projectPath, constants_1.CONFIG_FILE_NAME);
|
|
62
55
|
// Add a newline at the end to satisfy Prettier.
|
package/src/configFile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configFile.js","sourceRoot":"","sources":["../../../../packages/isaacscript-cli/src/configFile.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;
|
|
1
|
+
{"version":3,"file":"configFile.js","sourceRoot":"","sources":["../../../../packages/isaacscript-cli/src/configFile.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AACxB,6CAA0C;AAC1C,2DAAwD;AACxD,mEAAgE;AAChE,2CAAsE;AACtE,qDAA+B;AAC/B,iCAAkC;AAElC,mCAAgC;AAEhC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAErB,KAAK,UAAU,iBAAiB,CAAC,IAAU;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC;IACtC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC;IAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC;IAE9B,MAAM,cAAc,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,cAAc,KAAK,SAAS,EAAE;QAChC,OAAO,cAAc,CAAC;KACvB;IAED,iFAAiF;IACjF,MAAM,aAAa,GAAG,MAAM,IAAA,uBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,MAAM,IAAA,+BAAc,EAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,aAAa,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IACxD,gBAAgB,CAAC,eAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC,OAAO,MAAM,CAAC;AAChB,CAAC;AAjBD,8CAiBC;AAED,SAAS,iBAAiB,CAAC,OAAgB;IACzC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,4BAAgB,EAAE,OAAO,CAAC,EAAE;QAC3C,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,MAAM,GAAG,IAAA,eAAQ,EAAC,4BAAgB,EAAE,OAAO,CAAC,CAAC;IACnD,6BAA6B,CAAC,MAAM,CAAC,CAAC;IAEtC,OAAO,MAA2B,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,SAAS,6BAA6B,CAAC,MAA+B;IACpE,IAAI,MAAM,CAAC,eAAe,CAAC,KAAK,SAAS,EAAE;QACzC,YAAY,CACV,eAAe,EACf,6EAA6E,CAC9E,CAAC;KACH;IAED,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;QACpC,YAAY,CACV,UAAU,EACV,mEAAmE,CACpE,CAAC;KACH;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAAa,EAAE,WAAmB;IACtD,IAAA,aAAK,EACH,QAAQ,4BAAgB,wBAAwB,KAAK,YAAY,WAAW,iBAAiB,CAC9F,CAAC;AACJ,CAAC;AAED,SAAgB,gBAAgB,CAC9B,WAAmB,EACnB,MAAc,EACd,OAAgB;IAEhB,MAAM,cAAc,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,4BAAgB,CAAC,CAAC;IAEhE,gDAAgD;IAChD,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC,MAAM,CAC3E,IAAI,CACL,CAAC;IAEF,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAbD,4CAaC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** This plugin adds an explanatory header to the top of the generated Lua code. */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const cwd = process.cwd();
|
|
8
|
+
const packageJSONPath = path.join(cwd, "package.json");
|
|
9
|
+
const packageJSONContents = fs.readFileSync(packageJSONPath, "utf8");
|
|
10
|
+
const packageJSON = JSON.parse(packageJSONContents);
|
|
11
|
+
const INFORMATIONAL_HEADER = `--[[
|
|
12
|
+
|
|
13
|
+
isaacscript-common ${packageJSON["version"]}
|
|
14
|
+
|
|
15
|
+
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
16
|
+
|
|
17
|
+
This library contains helper functions and features that abstract away much of the complexity in
|
|
18
|
+
working with the Isaac API. For more information on how to use this library, see the manual:
|
|
19
|
+
https://isaacscript.github.io/main/isaacscript-in-lua
|
|
20
|
+
|
|
21
|
+
DO NOT EDIT THIS FILE DIRECTLY!
|
|
22
|
+
|
|
23
|
+
The Lua code in this file is not actually the source code for the program. Rather, it was
|
|
24
|
+
automatically generated from higher-level TypeScript code, and might be hard to read. If you want to
|
|
25
|
+
understand how the code in this library works, you should read the actual TypeScript source code
|
|
26
|
+
directly, which is located at:
|
|
27
|
+
https://github.com/IsaacScript/isaacscript/tree/main/packages/isaacscript-common
|
|
28
|
+
|
|
29
|
+
Please open bug reports and pull requests on GitHub. You can also ask questions in the Discord
|
|
30
|
+
server: https://discord.gg/KapmKQ2gUD
|
|
31
|
+
|
|
32
|
+
Note that if you are writing your mod in TypeScript, using this file is unnecessary, as every
|
|
33
|
+
"isaacscript-common" feature will be automatically bundled with your mod as needed. For more
|
|
34
|
+
information about using TypeScript, see the website: https://isaacscript.github.io/main/features
|
|
35
|
+
|
|
36
|
+
--]]
|
|
37
|
+
|
|
38
|
+
`;
|
|
39
|
+
const plugin = {
|
|
40
|
+
beforeEmit(_program, _options, _emitHost, result) {
|
|
41
|
+
for (const file of result) {
|
|
42
|
+
file.code = `${INFORMATIONAL_HEADER}${file.code}`;
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
// ts-prune-ignore-next
|
|
47
|
+
exports.default = plugin;
|
|
48
|
+
//# sourceMappingURL=addIsaacScriptCommentHeaderCommon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addIsaacScriptCommentHeaderCommon.js","sourceRoot":"","sources":["../../../../../packages/isaacscript-cli/src/plugins/addIsaacScriptCommentHeaderCommon.ts"],"names":[],"mappings":";AAAA,mFAAmF;;;AAEnF,+CAAyB;AACzB,mDAA6B;AAI7B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAC1B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;AACvD,MAAM,mBAAmB,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AACrE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAA4B,CAAC;AAE/E,MAAM,oBAAoB,GAAG;;qBAER,WAAW,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAyB1C,CAAC;AAEF,MAAM,MAAM,GAAgB;IAC1B,UAAU,CACR,QAAoB,EACpB,QAA8B,EAC9B,SAAwB,EACxB,MAAuB;QAEvB,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE;YACzB,IAAI,CAAC,IAAI,GAAG,GAAG,oBAAoB,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;SACnD;IACH,CAAC;CACF,CAAC;AAEF,uBAAuB;AACvB,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** This plugin adds an explanatory header to the top of the generated Lua code. */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const cwd = process.cwd();
|
|
8
|
+
const packageJSONPath = path.join(cwd, "package.json");
|
|
9
|
+
const packageJSONContents = fs.readFileSync(packageJSONPath, "utf8");
|
|
10
|
+
const packageJSON = JSON.parse(packageJSONContents);
|
|
11
|
+
const INFORMATIONAL_HEADER = `--[[
|
|
12
|
+
|
|
13
|
+
isaac-typescript-definitions ${packageJSON["version"]}
|
|
14
|
+
|
|
15
|
+
This is the "isaac-typescript-definitions" library, which was created with the IsaacScript tool.
|
|
16
|
+
|
|
17
|
+
This library contains a leveled-up version of the vanilla enums with many bug fixes and community
|
|
18
|
+
contributed additions for everything that the developers forgot to include. For more information on
|
|
19
|
+
how to use this library, see the manual: https://isaacscript.github.io/main/isaacscript-in-lua
|
|
20
|
+
|
|
21
|
+
DO NOT EDIT THIS FILE DIRECTLY!
|
|
22
|
+
|
|
23
|
+
The Lua code in this file is not actually the source code for the program. Rather, it was
|
|
24
|
+
automatically generated from higher-level TypeScript code, and might be hard to read. If you want to
|
|
25
|
+
understand how the code in this library works, you should read the actual TypeScript source code
|
|
26
|
+
directly, which is located at:
|
|
27
|
+
https://github.com/IsaacScript/isaacscript/tree/main/packages/isaacscript-typescript-definitions
|
|
28
|
+
|
|
29
|
+
Please open bug reports and pull requests on GitHub. You can also ask questions in the Discord
|
|
30
|
+
server: https://discord.gg/KapmKQ2gUD
|
|
31
|
+
|
|
32
|
+
Note that if you are writing your mod in TypeScript, using this file is unnecessary, as every
|
|
33
|
+
"isaac-typescript-definitions" feature will be automatically bundled with your mod as needed. For
|
|
34
|
+
more information about using TypeScript, see the website:
|
|
35
|
+
https://isaacscript.github.io/main/features
|
|
36
|
+
|
|
37
|
+
--]]
|
|
38
|
+
|
|
39
|
+
`;
|
|
40
|
+
const plugin = {
|
|
41
|
+
beforeEmit(_program, _options, _emitHost, result) {
|
|
42
|
+
for (const file of result) {
|
|
43
|
+
file.code = `${INFORMATIONAL_HEADER}${file.code}`;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
// ts-prune-ignore-next
|
|
48
|
+
exports.default = plugin;
|
|
49
|
+
//# sourceMappingURL=addIsaacScriptCommentHeaderDefinitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addIsaacScriptCommentHeaderDefinitions.js","sourceRoot":"","sources":["../../../../../packages/isaacscript-cli/src/plugins/addIsaacScriptCommentHeaderDefinitions.ts"],"names":[],"mappings":";AAAA,mFAAmF;;;AAEnF,+CAAyB;AACzB,mDAA6B;AAI7B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAC1B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;AACvD,MAAM,mBAAmB,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AACrE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAA4B,CAAC;AAE/E,MAAM,oBAAoB,GAAG;;+BAEE,WAAW,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BpD,CAAC;AAEF,MAAM,MAAM,GAAgB;IAC1B,UAAU,CACR,QAAoB,EACpB,QAA8B,EAC9B,SAAwB,EACxB,MAAuB;QAEvB,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE;YACzB,IAAI,CAAC,IAAI,GAAG,GAAG,oBAAoB,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;SACnD;IACH,CAAC;CACF,CAAC;AAEF,uBAAuB;AACvB,kBAAe,MAAM,CAAC"}
|