mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 05:49:32 +02:00
Applied kev's reviews
This commit is contained in:
parent
44b0b8dcd0
commit
8ea5121b72
@ -14,7 +14,7 @@
|
||||
"test:watch": "vitest watch --coverage --no-isolate",
|
||||
"test:silent": "vitest run --silent --no-isolate",
|
||||
"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",
|
||||
"eslint": "eslint --fix .",
|
||||
"eslint-ci": "eslint .",
|
||||
|
@ -2,7 +2,7 @@ import chalk from "chalk";
|
||||
|
||||
export function showHelpText() {
|
||||
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 only a file path, assumes ${chalk.blue("\`--file\`")}.
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This script accepts a CSV value or file path as input, parses the egg moves,
|
||||
* and writes the output to a TypeScript file.
|
||||
* It can be run interactively or with command line arguments.
|
||||
* Usage: `pnpm eggMove:parse`
|
||||
* Usage: `pnpm eggMoves:parse`
|
||||
*/
|
||||
|
||||
import fs from "node:fs";
|
||||
@ -13,7 +13,7 @@ import { showHelpText } from "./help-message.js";
|
||||
import { runInteractive } from "./interactive.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
|
||||
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");
|
||||
|
||||
/**
|
||||
* Runs the interactive eggMove:parse CLI.
|
||||
* Runs the interactive eggMoves:parse CLI.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function start() {
|
||||
@ -41,7 +41,6 @@ async function start() {
|
||||
return;
|
||||
}
|
||||
|
||||
/** @type {string} */
|
||||
let csv = "";
|
||||
const inputType = await parseArguments();
|
||||
if (process.exitCode) {
|
||||
@ -93,7 +92,7 @@ async function parseArguments() {
|
||||
default:
|
||||
// If no arguments are found, check if it's a file path
|
||||
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 };
|
||||
}
|
||||
badArgs();
|
||||
|
@ -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]>>";
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user