isaacscript 2.0.1 → 2.0.4
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/.prettierrc.js +12 -4
- package/check-file-updates.sh +1 -0
- package/check-orphaned-words.sh +7 -6
- package/dist/package.json +2 -2
- package/dist/src/constants.js +2 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/main.js +12 -3
- package/dist/src/main.js.map +1 -1
- package/file-templates/static/.cspell.json.template +1 -1
- package/file-templates/static/.prettierrc.js +12 -4
- package/file-templates/static/check-orphaned-words.sh +7 -6
- package/file-templates/static-alt/.prettierrc-base.js +3 -2
- package/package.json +2 -2
- package/src/constants.ts +1 -0
- package/src/main.ts +19 -6
package/.prettierrc.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// This is the configuration file for Prettier, the auto-formatter:
|
|
2
2
|
// https://prettier.io/docs/en/configuration.html
|
|
3
3
|
module.exports = {
|
|
4
|
+
// Always print trailing commas:
|
|
4
5
|
// https://prettier.io/docs/en/options.html#trailing-commas
|
|
5
|
-
// The default is "es5" - Trailing commas where valid in ES5 (objects, arrays, etc.)
|
|
6
|
-
//
|
|
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:
|
|
7
8
|
// https://github.com/airbnb/javascript#commas--dangling
|
|
8
9
|
// Prettier itself also acknowledges Nik Graf's blog in their official blog:
|
|
9
10
|
// https://prettier.io/blog/2020/03/21/2.0.0.html
|
|
@@ -25,10 +26,17 @@ module.exports = {
|
|
|
25
26
|
quoteProps: "preserve",
|
|
26
27
|
},
|
|
27
28
|
},
|
|
29
|
+
{
|
|
30
|
+
files: ["**/*.xml"],
|
|
31
|
+
options: {
|
|
32
|
+
printWidth: 1000000,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
28
35
|
],
|
|
29
36
|
|
|
37
|
+
// Allow proper formatting of XML files:
|
|
30
38
|
// https://github.com/prettier/plugin-xml#configuration
|
|
31
|
-
// The default is "struct".
|
|
32
|
-
//
|
|
39
|
+
// The default is "struct". However, whitespace cannot be reformatted unless this is set to
|
|
40
|
+
// "ignore".
|
|
33
41
|
xmlWhitespaceSensitivity: "ignore",
|
|
34
42
|
};
|
package/check-file-updates.sh
CHANGED
package/check-orphaned-words.sh
CHANGED
|
@@ -2,33 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
set -e # Exit on any errors
|
|
4
4
|
|
|
5
|
-
# Get the directory of this script
|
|
5
|
+
# Get the directory of this script:
|
|
6
6
|
# https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
|
|
7
7
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
8
8
|
|
|
9
9
|
REPO_ROOT="$DIR"
|
|
10
10
|
cd "$REPO_ROOT"
|
|
11
11
|
|
|
12
|
-
# Do nothing if the configuration file does not exist
|
|
12
|
+
# Do nothing if the configuration file does not exist.
|
|
13
13
|
CSPELL_CONFIGURATION_PATH="$REPO_ROOT/.cspell.json"
|
|
14
14
|
if ! test -f "$CSPELL_CONFIGURATION_PATH"; then
|
|
15
15
|
exit 0
|
|
16
16
|
fi
|
|
17
17
|
|
|
18
|
-
# Do nothing if the configuration file does not have any words in it
|
|
18
|
+
# Do nothing if the configuration file does not have any words in it.
|
|
19
19
|
if ! grep -q '"words": ' "$CSPELL_CONFIGURATION_PATH"; then
|
|
20
20
|
exit 0
|
|
21
21
|
fi
|
|
22
22
|
|
|
23
|
-
# Make a list of every misspelled word without any custom dictionaries
|
|
23
|
+
# Make a list of every misspelled word without any custom dictionaries.
|
|
24
|
+
# We need to move the configuration path temporarily or else the cspell command won't work properly.
|
|
24
25
|
CSPELL_CONFIGURATION_PATH_TEMP="$REPO_ROOT/.cspell-temp.json"
|
|
25
|
-
mv "$CSPELL_CONFIGURATION_PATH" "$CSPELL_CONFIGURATION_PATH_TEMP"
|
|
26
|
+
mv "$CSPELL_CONFIGURATION_PATH" "$CSPELL_CONFIGURATION_PATH_TEMP"
|
|
26
27
|
MISSPELLED_WORDS_PATH="/tmp/misspelled-words.txt"
|
|
27
28
|
CSPELL_CONFIGURATION_TEST_PATH="$REPO_ROOT/.cspell-check-unused.json"
|
|
28
29
|
npx cspell lint --config "$CSPELL_CONFIGURATION_TEST_PATH" --dot --no-progress --no-summary --unique --words-only | sort --ignore-case --unique > "$MISSPELLED_WORDS_PATH"
|
|
29
30
|
mv "$CSPELL_CONFIGURATION_PATH_TEMP" "$CSPELL_CONFIGURATION_PATH"
|
|
30
31
|
|
|
31
|
-
# Check that each ".cspell.json" word is actually being used
|
|
32
|
+
# Check that each ".cspell.json" word is actually being used.
|
|
32
33
|
echo "Checking for orphaned CSpell configuration words in: $CSPELL_CONFIGURATION_PATH"
|
|
33
34
|
CSPELL_CONFIGURATION_WORDS=$(cat "$CSPELL_CONFIGURATION_PATH" | python -c "import sys, json; print('\n'.join(json.load(sys.stdin)['words']))")
|
|
34
35
|
ONE_OR_MORE_FAILURES=0
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "A command line tool for managing Isaac mods written in TypeScript",
|
|
5
5
|
"homepage": "https://isaacscript.github.io/",
|
|
6
6
|
"bugs": {
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
"@types/source-map-support": "^0.5.4",
|
|
46
46
|
"@types/update-notifier": "^5.1.0",
|
|
47
47
|
"@types/yargs": "^17.0.10",
|
|
48
|
-
"isaacscript-lint": "^1.0.
|
|
48
|
+
"isaacscript-lint": "^1.0.141"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/dist/src/constants.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PUBLISH_POST_COPY_PY_PATH = exports.PUBLISH_PRE_COPY_PY_PATH = exports.VERSION_TXT_PATH = exports.METADATA_XML_PATH = exports.MAIN_LUA = exports.MOD_SOURCE_PATH = exports.CONSTANTS_TS_PATH = exports.PACKAGE_JSON_PATH = exports.TSCONFIG_PATH = exports.CONFIG_FILE_PATH = exports.CONFIG_FILE_NAME = exports.README_MD_TEMPLATES_PATH = exports.README_MD = exports.PACKAGE_JSON_TEMPLATE_PATH = exports.PACKAGE_JSON = exports.METADATA_VDF_TEMPLATE_PATH = exports.METADATA_VDF = exports.METADATA_XML_TEMPLATE_PATH = exports.METADATA_XML = exports.MAIN_TS_TEMPLATE_PATH = exports.MAIN_TS = exports.GITIGNORE_TEMPLATE_PATH = exports.GITIGNORE = exports.TEMPLATES_STATIC_DIR = exports.WATCHER_MOD_SOURCE_PATH = exports.WATCHER_MOD_NAME = exports.DISABLE_IT_FILE = exports.PROJECT_NAME = exports.MOD_UPLOADER_PATH = exports.FILE_SYNCED_MESSAGE = exports.HOME_DIR = exports.CWD = exports.CURRENT_DIRECTORY_NAME = void 0;
|
|
6
|
+
exports.PUBLISH_POST_COPY_PY_PATH = exports.PUBLISH_PRE_COPY_PY_PATH = exports.VERSION_TXT_PATH = exports.METADATA_XML_PATH = exports.MAIN_LUA = exports.MOD_SOURCE_PATH = exports.YARN_LOCK_PATH = exports.CONSTANTS_TS_PATH = exports.PACKAGE_JSON_PATH = exports.TSCONFIG_PATH = exports.CONFIG_FILE_PATH = exports.CONFIG_FILE_NAME = exports.README_MD_TEMPLATES_PATH = exports.README_MD = exports.PACKAGE_JSON_TEMPLATE_PATH = exports.PACKAGE_JSON = exports.METADATA_VDF_TEMPLATE_PATH = exports.METADATA_VDF = exports.METADATA_XML_TEMPLATE_PATH = exports.METADATA_XML = exports.MAIN_TS_TEMPLATE_PATH = exports.MAIN_TS = exports.GITIGNORE_TEMPLATE_PATH = exports.GITIGNORE = exports.TEMPLATES_STATIC_DIR = exports.WATCHER_MOD_SOURCE_PATH = exports.WATCHER_MOD_NAME = exports.DISABLE_IT_FILE = exports.PROJECT_NAME = exports.MOD_UPLOADER_PATH = exports.FILE_SYNCED_MESSAGE = exports.HOME_DIR = exports.CWD = exports.CURRENT_DIRECTORY_NAME = void 0;
|
|
7
7
|
const os_1 = __importDefault(require("os"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const cwd = process.cwd();
|
|
@@ -46,6 +46,7 @@ exports.CONFIG_FILE_PATH = path_1.default.join(exports.CWD, exports.CONFIG_FILE_
|
|
|
46
46
|
exports.TSCONFIG_PATH = path_1.default.join(exports.CWD, "tsconfig.json");
|
|
47
47
|
exports.PACKAGE_JSON_PATH = path_1.default.join(exports.CWD, "package.json");
|
|
48
48
|
exports.CONSTANTS_TS_PATH = path_1.default.join(exports.CWD, "src", "constants.ts");
|
|
49
|
+
exports.YARN_LOCK_PATH = path_1.default.join(exports.CWD, "yarn.lock");
|
|
49
50
|
// project/mod
|
|
50
51
|
exports.MOD_SOURCE_PATH = path_1.default.join(exports.CWD, "mod");
|
|
51
52
|
exports.MAIN_LUA = "main.lua";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE1B,mGAAmG;AACnG,MAAM,OAAO,GAAG,YAAE,CAAC,OAAO,EAAE,CAAC;AAE7B,gBAAgB;AACH,QAAA,sBAAsB,GAAG,cAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC5C,QAAA,GAAG,GAAG,GAAG,CAAC;AACV,QAAA,QAAQ,GAAG,OAAO,CAAC;AACnB,QAAA,mBAAmB,GAA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,EAAE,wBAAgB,CAAC,CAAC;AACpD,QAAA,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,eAAe,CAAC,CAAC;AAChD,QAAA,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,cAAc,CAAC,CAAC;AACnD,QAAA,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;AAC1D,QAAA,cAAc,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,WAAW,CAAC,CAAC;AAE1D,cAAc;AACD,QAAA,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,KAAK,CAAC,CAAC;AACxC,QAAA,QAAQ,GAAG,UAAU,CAAC;AACtB,QAAA,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,uBAAe,EAAE,cAAc,CAAC,CAAC;AAC/D,QAAA,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,uBAAe,EAAE,aAAa,CAAC,CAAC;AAE1E,kBAAkB;AAClB,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,SAAS,CAAC,CAAC;AAClC,QAAA,wBAAwB,GAAG,cAAI,CAAC,IAAI,CAC/C,YAAY,EACZ,qBAAqB,CACtB,CAAC;AACW,QAAA,yBAAyB,GAAG,cAAI,CAAC,IAAI,CAChD,YAAY,EACZ,sBAAsB,CACvB,CAAC"}
|
package/dist/src/main.js
CHANGED
|
@@ -42,6 +42,7 @@ const publish_1 = require("./commands/publish/publish");
|
|
|
42
42
|
const configFile = __importStar(require("./configFile"));
|
|
43
43
|
const constants_1 = require("./constants");
|
|
44
44
|
const exec_1 = require("./exec");
|
|
45
|
+
const file = __importStar(require("./file"));
|
|
45
46
|
const parseArgs_1 = require("./parseArgs");
|
|
46
47
|
const prompt_1 = require("./prompt");
|
|
47
48
|
const Command_1 = require("./types/Command");
|
|
@@ -94,9 +95,7 @@ async function handleCommands(argv, verbose) {
|
|
|
94
95
|
if (command !== "init") {
|
|
95
96
|
(0, validateInIsaacScriptProject_1.validateInIsaacScriptProject)(verbose);
|
|
96
97
|
config = await configFile.get(argv);
|
|
97
|
-
|
|
98
|
-
console.log('Running "npm install" to ensure that the project\'s dependencies are installed correctly.');
|
|
99
|
-
(0, exec_1.execShell)("npm", ["install"], verbose);
|
|
98
|
+
ensureDepsAreInstalled(verbose);
|
|
100
99
|
}
|
|
101
100
|
switch (command) {
|
|
102
101
|
case "monitor": {
|
|
@@ -124,4 +123,14 @@ async function handleCommands(argv, verbose) {
|
|
|
124
123
|
process.exit(0);
|
|
125
124
|
}
|
|
126
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
|
+
}
|
|
127
136
|
//# sourceMappingURL=main.js.map
|
package/dist/src/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kDAA0B;AAC1B,+CAAiC;AACjC,oDAA4B;AAC5B,gDAAwB;AACxB,4EAAkD;AAClD,sEAA6C;AAC7C,mEAAkC;AAClC,+EAA4E;AAC5E,+CAA4C;AAC5C,+CAA4C;AAC5C,wDAAqD;AACrD,wDAAqD;AACrD,yDAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":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AED,KAAK,MAAM,CAAC,CAAC;YACX,MAAM,IAAA,WAAI,EAAC,IAAI,CAAC,CAAC;YACjB,MAAM;SACP;QAED,KAAK,MAAM,CAAC,CAAC;YACX,IAAA,WAAI,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACnB,MAAM;SACP;QAED,KAAK,SAAS,CAAC,CAAC;YACd,IAAA,iBAAO,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACtB,MAAM;SACP;QAED,OAAO,CAAC,CAAC;YACP,IAAA,sBAAc,EAAC,OAAO,CAAC,CAAC;YACxB,MAAM;SACP;KACF;IAED,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,OAAgB;IAC9C,IAAI,IAAI,CAAC,MAAM,CAAC,0BAAc,EAAE,OAAO,CAAC,EAAE;QACxC,OAAO,CAAC,GAAG,CACT,oFAAoF,CACrF,CAAC;QACF,IAAA,gBAAS,EAAC,MAAM,CAAC,CAAC;QAClB,OAAO;KACR;IAED,sHAAsH;IACtH,OAAO,CAAC,GAAG,CACT,2FAA2F,CAC5F,CAAC;IACF,IAAA,gBAAS,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// This is the configuration file for Prettier, the auto-formatter:
|
|
2
2
|
// https://prettier.io/docs/en/configuration.html
|
|
3
3
|
module.exports = {
|
|
4
|
+
// Always print trailing commas:
|
|
4
5
|
// https://prettier.io/docs/en/options.html#trailing-commas
|
|
5
|
-
// The default is "es5" - Trailing commas where valid in ES5 (objects, arrays, etc.)
|
|
6
|
-
//
|
|
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:
|
|
7
8
|
// https://github.com/airbnb/javascript#commas--dangling
|
|
8
9
|
// Prettier itself also acknowledges Nik Graf's blog in their official blog:
|
|
9
10
|
// https://prettier.io/blog/2020/03/21/2.0.0.html
|
|
@@ -25,10 +26,17 @@ module.exports = {
|
|
|
25
26
|
quoteProps: "preserve",
|
|
26
27
|
},
|
|
27
28
|
},
|
|
29
|
+
{
|
|
30
|
+
files: ["**/*.xml"],
|
|
31
|
+
options: {
|
|
32
|
+
printWidth: 1000000,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
28
35
|
],
|
|
29
36
|
|
|
37
|
+
// Allow proper formatting of XML files:
|
|
30
38
|
// https://github.com/prettier/plugin-xml#configuration
|
|
31
|
-
// The default is "struct".
|
|
32
|
-
//
|
|
39
|
+
// The default is "struct". However, whitespace cannot be reformatted unless this is set to
|
|
40
|
+
// "ignore".
|
|
33
41
|
xmlWhitespaceSensitivity: "ignore",
|
|
34
42
|
};
|
|
@@ -2,33 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
set -e # Exit on any errors
|
|
4
4
|
|
|
5
|
-
# Get the directory of this script
|
|
5
|
+
# Get the directory of this script:
|
|
6
6
|
# https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
|
|
7
7
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
8
8
|
|
|
9
9
|
REPO_ROOT="$DIR"
|
|
10
10
|
cd "$REPO_ROOT"
|
|
11
11
|
|
|
12
|
-
# Do nothing if the configuration file does not exist
|
|
12
|
+
# Do nothing if the configuration file does not exist.
|
|
13
13
|
CSPELL_CONFIGURATION_PATH="$REPO_ROOT/.cspell.json"
|
|
14
14
|
if ! test -f "$CSPELL_CONFIGURATION_PATH"; then
|
|
15
15
|
exit 0
|
|
16
16
|
fi
|
|
17
17
|
|
|
18
|
-
# Do nothing if the configuration file does not have any words in it
|
|
18
|
+
# Do nothing if the configuration file does not have any words in it.
|
|
19
19
|
if ! grep -q '"words": ' "$CSPELL_CONFIGURATION_PATH"; then
|
|
20
20
|
exit 0
|
|
21
21
|
fi
|
|
22
22
|
|
|
23
|
-
# Make a list of every misspelled word without any custom dictionaries
|
|
23
|
+
# Make a list of every misspelled word without any custom dictionaries.
|
|
24
|
+
# We need to move the configuration path temporarily or else the cspell command won't work properly.
|
|
24
25
|
CSPELL_CONFIGURATION_PATH_TEMP="$REPO_ROOT/.cspell-temp.json"
|
|
25
|
-
mv "$CSPELL_CONFIGURATION_PATH" "$CSPELL_CONFIGURATION_PATH_TEMP"
|
|
26
|
+
mv "$CSPELL_CONFIGURATION_PATH" "$CSPELL_CONFIGURATION_PATH_TEMP"
|
|
26
27
|
MISSPELLED_WORDS_PATH="/tmp/misspelled-words.txt"
|
|
27
28
|
CSPELL_CONFIGURATION_TEST_PATH="$REPO_ROOT/.cspell-check-unused.json"
|
|
28
29
|
npx cspell lint --config "$CSPELL_CONFIGURATION_TEST_PATH" --dot --no-progress --no-summary --unique --words-only | sort --ignore-case --unique > "$MISSPELLED_WORDS_PATH"
|
|
29
30
|
mv "$CSPELL_CONFIGURATION_PATH_TEMP" "$CSPELL_CONFIGURATION_PATH"
|
|
30
31
|
|
|
31
|
-
# Check that each ".cspell.json" word is actually being used
|
|
32
|
+
# Check that each ".cspell.json" word is actually being used.
|
|
32
33
|
echo "Checking for orphaned CSpell configuration words in: $CSPELL_CONFIGURATION_PATH"
|
|
33
34
|
CSPELL_CONFIGURATION_WORDS=$(cat "$CSPELL_CONFIGURATION_PATH" | python -c "import sys, json; print('\n'.join(json.load(sys.stdin)['words']))")
|
|
34
35
|
ONE_OR_MORE_FAILURES=0
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// This is the configuration file for Prettier, the auto-formatter:
|
|
2
2
|
// https://prettier.io/docs/en/configuration.html
|
|
3
3
|
module.exports = {
|
|
4
|
+
// Always print trailing commas:
|
|
4
5
|
// https://prettier.io/docs/en/options.html#trailing-commas
|
|
5
|
-
// The default is "es5" - Trailing commas where valid in ES5 (objects, arrays, etc.)
|
|
6
|
-
//
|
|
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:
|
|
7
8
|
// https://github.com/airbnb/javascript#commas--dangling
|
|
8
9
|
// Prettier itself also acknowledges Nik Graf's blog in their official blog:
|
|
9
10
|
// https://prettier.io/blog/2020/03/21/2.0.0.html
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "A command line tool for managing Isaac mods written in TypeScript",
|
|
5
5
|
"homepage": "https://isaacscript.github.io/",
|
|
6
6
|
"bugs": {
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
"@types/source-map-support": "^0.5.4",
|
|
46
46
|
"@types/update-notifier": "^5.1.0",
|
|
47
47
|
"@types/yargs": "^17.0.10",
|
|
48
|
-
"isaacscript-lint": "^1.0.
|
|
48
|
+
"isaacscript-lint": "^1.0.141"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/src/constants.ts
CHANGED
|
@@ -65,6 +65,7 @@ export const CONFIG_FILE_PATH = path.join(CWD, CONFIG_FILE_NAME);
|
|
|
65
65
|
export const TSCONFIG_PATH = path.join(CWD, "tsconfig.json");
|
|
66
66
|
export const PACKAGE_JSON_PATH = path.join(CWD, "package.json");
|
|
67
67
|
export const CONSTANTS_TS_PATH = path.join(CWD, "src", "constants.ts");
|
|
68
|
+
export const YARN_LOCK_PATH = path.join(CWD, "yarn.lock");
|
|
68
69
|
|
|
69
70
|
// project/mod
|
|
70
71
|
export const MOD_SOURCE_PATH = path.join(CWD, "mod");
|
package/src/main.ts
CHANGED
|
@@ -13,8 +13,9 @@ import { init } from "./commands/init/init";
|
|
|
13
13
|
import { monitor } from "./commands/monitor/monitor";
|
|
14
14
|
import { publish } from "./commands/publish/publish";
|
|
15
15
|
import * as configFile from "./configFile";
|
|
16
|
-
import { CWD, PROJECT_NAME } from "./constants";
|
|
16
|
+
import { CWD, PROJECT_NAME, YARN_LOCK_PATH } from "./constants";
|
|
17
17
|
import { execShell } from "./exec";
|
|
18
|
+
import * as file from "./file";
|
|
18
19
|
import { parseArgs } from "./parseArgs";
|
|
19
20
|
import { promptInit } from "./prompt";
|
|
20
21
|
import { Command, DEFAULT_COMMAND } from "./types/Command";
|
|
@@ -78,11 +79,7 @@ async function handleCommands(argv: Record<string, unknown>, verbose: boolean) {
|
|
|
78
79
|
validateInIsaacScriptProject(verbose);
|
|
79
80
|
config = await configFile.get(argv);
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
console.log(
|
|
83
|
-
'Running "npm install" to ensure that the project\'s dependencies are installed correctly.',
|
|
84
|
-
);
|
|
85
|
-
execShell("npm", ["install"], verbose);
|
|
82
|
+
ensureDepsAreInstalled(verbose);
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
switch (command) {
|
|
@@ -116,3 +113,19 @@ async function handleCommands(argv: Record<string, unknown>, verbose: boolean) {
|
|
|
116
113
|
process.exit(0);
|
|
117
114
|
}
|
|
118
115
|
}
|
|
116
|
+
|
|
117
|
+
function ensureDepsAreInstalled(verbose: boolean) {
|
|
118
|
+
if (file.exists(YARN_LOCK_PATH, verbose)) {
|
|
119
|
+
console.log(
|
|
120
|
+
'Running "yarn" to ensure that the project\'s dependencies are installed correctly.',
|
|
121
|
+
);
|
|
122
|
+
execShell("yarn");
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// https://stackoverflow.com/questions/57016579/checking-if-package-json-dependencies-match-the-installed-dependencies
|
|
127
|
+
console.log(
|
|
128
|
+
'Running "npm install" to ensure that the project\'s dependencies are installed correctly.',
|
|
129
|
+
);
|
|
130
|
+
execShell("npm", ["install"], verbose);
|
|
131
|
+
}
|