Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
workflow_dispatch:

env:
node-version: "20"
path: "KoLmafia" # The directory where your assets are generated, should match build.mjs
node-version: "22"
path: "dist" # The directory where your assets are generated, should match build.mjs

jobs:
lint:
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
node_modules
.DS_Store
KoLmafia
dist

.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

16 changes: 0 additions & 16 deletions babel.config.cjs

This file was deleted.

24 changes: 0 additions & 24 deletions build.mjs

This file was deleted.

15 changes: 1 addition & 14 deletions eslint.config.mjs → eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ export default defineConfig(
js.configs.recommended,
...tseslint.configs.recommended,
...libram.configs.recommended,
{
rules: {
"libram/verify-constants": [
"error",
{
data: {
items: [],
locations: [],
},
},
],
},
},
{
files: ["**/*.ts", "**/*.tsx"],
rules: {
Expand All @@ -48,5 +35,5 @@ export default defineConfig(
],
},
},
prettier
prettier,
);
2 changes: 0 additions & 2 deletions kolmafia-polyfill.js

This file was deleted.

53 changes: 28 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,40 @@
"main": "phredhccs.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "node build.mjs",
"lint": "eslint src && prettier --check src",
"watch": "webpack --watch --progress"
"build": "rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript",
"format": "eslint src --fix --ext .ts && NODE_OPTIONS=\"--experimental-strip-types\" prettier --write .",
"lint": "eslint src --ext .ts && NODE_OPTIONS=\"--experimental-strip-types\" prettier --check .",
"watch": "rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript --watch",
"install-mafia": "create-kolmafia-script --install"
},
"devDependencies": {
"@babel/core": "^7.18.10",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.18.9",
"@babel/preset-env": "^7.18.9",
"@babel/preset-typescript": "^7.18.6",
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
"@types/babel__core": "^7.1.19",
"@types/babel__preset-env": "^7.9.2",
"@types/node": "^18.6.3",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"esbuild": "^0.14.51",
"esbuild-plugin-babel": "^0.2.3",
"eslint": "9.39.2",
"eslint-config-prettier": "10.1.8",
"@babel/core": "^7.28.6",
"@babel/preset-env": "^7.28.6",
"@babel/preset-typescript": "^7.28.5",
"@eslint/js": "^9.39.2",
"@rollup/plugin-babel": "^6.1.0",
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-replace": "^6.0.3",
"@rollup/plugin-typescript": "^12.3.0",
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
"@types/babel__core": "^7.20.5",
"@types/babel__preset-env": "^7.10.0",
"@types/node": "^25.0.9",
"create-kolmafia-script": "^0.2.2",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-libram": "^0.5.3",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1",
"typescript": "5.9.3"
"jiti": "^2.6.1",
"prettier": "^3.8.0",
"rollup": "^4.55.3",
"typescript": "^5.9.3",
"typescript-eslint": "^8.53.1"
},
"dependencies": {
"grimoire-kolmafia": "^0.3.33",
"kolmafia": "^5.28893.0",
"libram": "^0.11.16",
"typescript-eslint": "8.50.0"
"kolmafia": "^5.28896.0",
"libram": "^0.11.16"
},
"author": "Phreddrickkv2",
"license": "ISC",
Expand Down
8 changes: 8 additions & 0 deletions pretter.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { type Config } from "prettier";

export default {
printWidth: 100,
plugins: ["@trivago/prettier-plugin-sort-imports"],
importOrder: ["<THIRD_PARTY_MODULES>", "^\\.\\./", "^\\./"],
importOrderSeparation: true,
} satisfies Config;
74 changes: 74 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import babel from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import type { RollupOptions } from "rollup";

const watch = process.argv.includes("--watch") || process.argv.includes("-w");

const baseSettings = {
output: {
dir: "dist/scripts/phccs",
format: "cjs",
exports: "auto",
chunkFileNames: "_[name].js",
},

external: ["kolmafia"],

plugins: [
replace({
preventAssignment: true,
values: {
"process.env.GITHUB_SHA": JSON.stringify(
process.env.GITHUB_SHA ?? "CustomBuild",
),
"process.env.GITHUB_REF_NAME": JSON.stringify(
process.env.GITHUB_REF_NAME ?? "CustomBuild",
),
"process.env.GITHUB_REPOSITORY": JSON.stringify(
process.env.GITHUB_REPOSITORY ?? "CustomBuild",
),
},
}),

resolve({
extensions: [".js", ".ts"],
}),

commonjs(),

babel({
babelHelpers: "bundled",
extensions: [".js", ".ts"],
babelrc: false,
presets: [
[
"@babel/preset-env",
{
targets: {
rhino: "1.8.0",
},
},
],
"@babel/preset-typescript",
],
}),
],

watch: watch
? {
clearScreen: false,
}
: undefined,
} satisfies RollupOptions;

export default [
{ phccs: "src/index.ts" },
{ phccs_gash: "src/gash/cs.ts" },
{ looph_gash: "src/gash/casual.ts" },
{ smol_butt: "src/gash/smolbutt.ts" },
].map((input) => ({
input,
...baseSettings,
}));
6 changes: 4 additions & 2 deletions src/boozedrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ const BoozeDrop: CSQuest = {
canAttack: false,
}),
combat: new CSStrategy(() =>
Macro.skill($skill`Become a Bat`).skill($skill`Throw Latte on Opponent`)
Macro.skill($skill`Become a Bat`).skill(
$skill`Throw Latte on Opponent`,
),
),
},
{
Expand Down Expand Up @@ -110,7 +112,7 @@ const BoozeDrop: CSQuest = {
do: () => cliExecute("barrelprayer buff"),
},
...$items`Salsa Caliente™ candle, lavender candy heart, bag of grain, emergency glowstick, autumn leaf`.map(
potionTask
potionTask,
),
{
name: "Steely-Eyed Squint",
Expand Down
2 changes: 1 addition & 1 deletion src/coilwire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const CoilWire: CSQuest = {
.trySkill($skill`Blow the Red Candle!`)
.skill($skill`Micrometeorite`)
.attack()
.repeat()
.repeat(),
),
},
{
Expand Down
16 changes: 8 additions & 8 deletions src/combat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ export class CSStrategy extends CombatStrategy {
}: {
fallthrough?: Delayed<Macro, [void]>;
fightHolidayWanderer?: boolean;
} = {}
} = {},
) {
super();
this.macro(
fightHolidayWanderer ? macro : Macro.skill($skill`Feel Hatred`),
getTodaysHolidayWanderers()
getTodaysHolidayWanderers(),
)
.autoattack(
fightHolidayWanderer ? macro : Macro.skill($skill`Feel Hatred`),
getTodaysHolidayWanderers()
getTodaysHolidayWanderers(),
)
.autoattack(macro)
.macro(fallthrough ?? macro);
Expand All @@ -41,10 +41,10 @@ export class Macro extends StrictMacro {
tryBowl(): Macro {
return this.ifNot(
$item`cosmic bowling ball`,
Macro.item($item`Time-Spinner`)
Macro.item($item`Time-Spinner`),
).if_(
$item`cosmic bowling ball`,
Macro.item([$item`Time-Spinner`, $item`cosmic bowling ball`])
Macro.item([$item`Time-Spinner`, $item`cosmic bowling ball`]),
);
}
static tryBowl(): Macro {
Expand All @@ -67,8 +67,8 @@ export class Macro extends StrictMacro {
have($skill`Candyblast`),
Macro.while_(
'!match "Hey, some of it is even intact afterwards!"',
Macro.trySkill($skill`Candyblast`)
)
Macro.trySkill($skill`Candyblast`),
),
);
}
static candyblast(): Macro {
Expand All @@ -88,7 +88,7 @@ export class Macro extends StrictMacro {
.externalIf(
myClass() === $class`Sauceror`,
Macro.skill($skill`Saucegeyser`).repeat(),
Macro.attack().repeat()
Macro.attack().repeat(),
);
}
static defaultKill(): Macro {
Expand Down
Loading