Skip to content

Commit

Permalink
Merge branch 'master' into armouredZombie
Browse files Browse the repository at this point in the history
  • Loading branch information
nwjgit authored Sep 16, 2024
2 parents 8489b66 + f211cad commit 3bb31d3
Show file tree
Hide file tree
Showing 51 changed files with 5,131 additions and 590 deletions.
77 changes: 40 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
name: Unit Tests

on:
push:
branches:
- master
pull_request:
push:
branches:
- master
pull_request:

jobs:
test:
name: Tests
runs-on: ubuntu-latest

steps:
- name: Checkout Project
uses: actions/checkout@v4

- run: corepack enable
- run: corepack install

- name: Install NodeJS
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20

- name: Restore CI Cache
uses: actions/cache@v4
with:
path: node_modules
key: NODE-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install Dependencies
run: yarn --immutable

- name: Fix package.json
run: npx biome check --write package.json

- name: Test
run: |
yarn test
npm i -g dpdm && dpdm --exit-code circular:1 --progress=false --warning=false --tree=false ./dist/index.js
test:
name: Tests
runs-on: ubuntu-latest

steps:
- name: Checkout Project
uses: actions/checkout@v4

- run: corepack enable
- run: corepack install

- name: Install NodeJS
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20

- name: Restore CI Cache
uses: actions/cache@v4
with:
path: node_modules
key: NODE-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install Dependencies
run: yarn --immutable

- name: Fix package.json
run: npx biome check --write package.json

- name: Build
run: tsc -p src

- name: Test
run: |
yarn test
npm i -g dpdm && dpdm --exit-code circular:1 --progress=false --warning=false --tree=false ./dist/index.js
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oldschooljs",
"version": "2.5.14",
"version": "2.6.0",
"description": "Allows you to interact with the OSRS Hiscores, Wiki, Items, & more.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
15 changes: 10 additions & 5 deletions scripts/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import { Items, Monsters } from "../src";
import { USELESS_ITEMS } from "../src/structures/Items";
import { moidLink } from "./prepareItems";

export function safeItemName(itemName: string) {
let key = itemName;
key = key.replace("3rd", "third");
key = key.replace(/[^\w\s]|_/g, "");
key = key.replace(/\s+/g, "_");
key = key.toUpperCase();
return key;
}
const exitingKeys = new Set<string>();
const duplicates = new Set<number>();
let str = "export enum EItem {";
Expand Down Expand Up @@ -32,11 +40,8 @@ outer: for (const item of Items.values()) {
if (USELESS_ITEMS.includes(item.id)) {
continue;
}
let key = item.wiki_name ?? item.name;
key = key.replace("3rd", "third");
key = key.replace(/[^\w\s]|_/g, "");
key = key.replace(/\s+/g, "_");
key = key.toUpperCase();
const key = safeItemName(item.wiki_name ?? item.name);

if (exitingKeys.has(key)) {
duplicates.add(item.id);
continue;
Expand Down
61 changes: 61 additions & 0 deletions src/EItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5767,8 +5767,12 @@ export enum EItem {
FLOWER_CROWN_GENDERQUEER = 27151,
FLOWER_CROWN_LESBIAN = 27153,
FLOWER_CROWN_GAY = 27155,
GUTHIX_CHAPS_LAST_MAN_STANDING = 27180,
ZAMORAK_CHAPS_LAST_MAN_STANDING = 27181,
SARADOMIN_CHAPS_LAST_MAN_STANDING = 27182,
LIGHT_BALLISTA_LAST_MAN_STANDING = 27188,
VERACS_FLAIL_LAST_MAN_STANDING = 27189,
ANCESTRAL_ROBE_BOTTOM_LAST_MAN_STANDING = 27194,
MENAPHITE_REMEDY_4_DOSE = 27202,
MENAPHITE_REMEDY_3_DOSE = 27205,
MENAPHITE_REMEDY_2_DOSE = 27208,
Expand Down Expand Up @@ -6330,4 +6334,61 @@ export enum EItem {
BLIGHTED_OVERLOAD_1_DOSE = 29640,
CHITIN = 29643,
GUTHIXIAN_TEMPLE_TELEPORT = 29684,
DNI23_TORSO_LIGHTBUTTONS = 29686,
DNI23_TORSO_DARKBUTTONS_DARK_BUTTONS = 29688,
DNI23_TORSO_DARKBUTTONS_JACKET = 29690,
DNI23_TORSO_SHIRT = 29692,
DNI23_TORSO_STITCHING = 29694,
DNI23_TORSO_TWOTONED = 29696,
DNI23_TORSO_PRINCELY = 29698,
DNI23_TORSO_RIPPEDWESKIT_RIPPED_WESKIT = 29700,
DNI23_TORSO_RIPPEDWESKIT_TORN_WESKIT = 29702,
DNI23_TORSO_CROPTOPS = 29704,
DNI23_TORSO_POLONECK = 29706,
DNI23_TORSO_SIMPLE = 29708,
DNI23_TORSO_FRILLY = 29710,
DNI23_TORSO_CORSETRY = 29712,
DNI23_TORSO_BODICE = 29714,
DNI23_ARMS_THIN = 29716,
DNI23_ARMS_SHOULDERPADS = 29718,
DNI23_ARMS_THICKSTRIPE = 29720,
DNI23_ARMS_LOOSESLEEVES = 29722,
DNI23_ARMS_PRINCELY = 29724,
DNI23_ARMS_TATTYLONG = 29726,
DNI23_ARMS_RIPPED = 29728,
DNI23_ARMS_BARE = 29730,
DNI23_ARMS_FRILLY = 29732,
DNI23_ARMS_TATTYSHORT = 29734,
DNI23_ARMS_BARESHOULDERS = 29736,
DNI23_LEGS_SHORTS = 29738,
DNI23_LEGS_BEACH = 29740,
DNI23_LEGS_PRINCELY = 29742,
DNI23_LEGS_LEGGINGS = 29744,
DNI23_LEGS_SIDESTRIPES = 29746,
DNI23_LEGS_RIPPED = 29748,
DNI23_LEGS_PATCHED = 29750,
DNI23_LEGS_SKIRT = 29752,
DNI23_LEGS_LONGSKIRT = 29754,
DNI23_LEGS_LONGNARROWSKIRT = 29756,
DNI23_LEGS_SHORTSKIRT = 29758,
DNI23_LEGS_LAYERED = 29760,
DNI23_LEGS_SASHDOTS = 29762,
DNI23_LEGS_BIGHEM = 29764,
DNI23_LEGS_SASHTROUSERS = 29766,
DNI23_LEGS_PATTERNED = 29768,
DNI23_LEGS_TORNSKIRT = 29770,
DNI23_LEGS_PATCHEDSKIRT = 29772,
AMYS_SAW_OFFHAND = 29774,
IMCANDO_HAMMER_OFFHAND = 29775,
BRUMA_TORCH_OFFHAND = 29777,
SPIDER_CAVE_TELEPORT = 29782,
ARAXYTE_VENOM_SACK = 29784,
NOXIOUS_HALBERD = 29796,
AMULET_OF_RANCOUR = 29801,
AMULET_OF_RANCOUR_S = 29804,
ARANEA_BOOTS = 29806,
ARAXYTE_SLAYER_HELMET = 29816,
ARAXYTE_SLAYER_HELMET_I_NIGHTMARE_ZONE = 29818,
ARAXYTE_SLAYER_HELMET_I_SOUL_WARS = 29820,
ARAXYTE_SLAYER_HELMET_I_EMIRS_ARENA = 29822,
}
Loading

0 comments on commit 3bb31d3

Please sign in to comment.