Applied kev's reviews

This commit is contained in:
Bertie690 2025-07-21 13:37:12 -04:00
parent 44b0b8dcd0
commit 8ea5121b72
4 changed files with 8 additions and 8 deletions

View File

@ -14,7 +14,7 @@
"test:watch": "vitest watch --coverage --no-isolate", "test:watch": "vitest watch --coverage --no-isolate",
"test:silent": "vitest run --silent --no-isolate", "test:silent": "vitest run --silent --no-isolate",
"test:create": "node scripts/create-test/create-test.js", "test:create": "node scripts/create-test/create-test.js",
"eggMove:parse": "node scripts/parse-egg-moves/main.js", "eggMoves:parse": "node scripts/parse-egg-moves/main.js",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"eslint": "eslint --fix .", "eslint": "eslint --fix .",
"eslint-ci": "eslint .", "eslint-ci": "eslint .",

View File

@ -2,7 +2,7 @@ import chalk from "chalk";
export function showHelpText() { export function showHelpText() {
console.log(` console.log(`
Usage: ${chalk.cyan("pnpm eggMove:parse [options]")} Usage: ${chalk.cyan("pnpm eggMoves:parse [options]")}
If given no options, assumes ${chalk.blue("\`--interactive\`")}. If given no options, assumes ${chalk.blue("\`--interactive\`")}.
If given only a file path, assumes ${chalk.blue("\`--file\`")}. If given only a file path, assumes ${chalk.blue("\`--file\`")}.

View File

@ -2,7 +2,7 @@
* This script accepts a CSV value or file path as input, parses the egg moves, * This script accepts a CSV value or file path as input, parses the egg moves,
* and writes the output to a TypeScript file. * and writes the output to a TypeScript file.
* It can be run interactively or with command line arguments. * It can be run interactively or with command line arguments.
* Usage: `pnpm eggMove:parse` * Usage: `pnpm eggMoves:parse`
*/ */
import fs from "node:fs"; import fs from "node:fs";
@ -13,7 +13,7 @@ import { showHelpText } from "./help-message.js";
import { runInteractive } from "./interactive.js"; import { runInteractive } from "./interactive.js";
import { parseEggMoves } from "./parse.js"; import { parseEggMoves } from "./parse.js";
const version = "0.0.0"; // Replace with actual version if needed const version = "1.0.0";
// Get the directory name of the current module file // Get the directory name of the current module file
const __filename = fileURLToPath(import.meta.url); const __filename = fileURLToPath(import.meta.url);
@ -24,7 +24,7 @@ const templatePath = path.join(__dirname, "egg-move-template.ts");
const eggMoveTargetPath = path.join(projectRoot, "src/data/balance/egg-moves.ts"); const eggMoveTargetPath = path.join(projectRoot, "src/data/balance/egg-moves.ts");
/** /**
* Runs the interactive eggMove:parse CLI. * Runs the interactive eggMoves:parse CLI.
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async function start() { async function start() {
@ -41,7 +41,6 @@ async function start() {
return; return;
} }
/** @type {string} */
let csv = ""; let csv = "";
const inputType = await parseArguments(); const inputType = await parseArguments();
if (process.exitCode) { if (process.exitCode) {
@ -93,7 +92,7 @@ async function parseArguments() {
default: default:
// If no arguments are found, check if it's a file path // If no arguments are found, check if it's a file path
if (fs.existsSync(arg)) { if (fs.existsSync(arg)) {
console.log(chalk.green(`Using file path: ${chalk.blue(arg)}`)); console.log(chalk.green(`Using file path from stdin: ${chalk.blue(arg)}`));
return { type: "File", value: arg }; return { type: "File", value: arg };
} }
badArgs(); badArgs();

View File

@ -44,7 +44,8 @@ export function parseEggMoves(csv) {
} }
} }
return output + "} satisfies Partial<Record<SpeciesId, [MoveId, MoveId, MoveId, MoveId]>>;"; // NB: We omit the semicolon as it is contained in the template string itself
return output + "} satisfies Partial<Record<SpeciesId, [MoveId, MoveId, MoveId, MoveId]>>";
} }
/** /**