From f2092d0f060b60f73a07b5ff34f13d0b30f1d5c0 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:21:05 +0200 Subject: [PATCH 01/24] feat(build): add gh actions --- .github/actions/pnpm-install/action.yml | 86 +++++++++++++++++++++++++ .github/workflows/clean_cache.yml | 36 +++++++++++ .github/workflows/webiste.yml | 78 ++++++++++++++++++++++ 3 files changed, 200 insertions(+) create mode 100644 .github/actions/pnpm-install/action.yml create mode 100644 .github/workflows/clean_cache.yml create mode 100644 .github/workflows/webiste.yml diff --git a/.github/actions/pnpm-install/action.yml b/.github/actions/pnpm-install/action.yml new file mode 100644 index 00000000..5f7fa03e --- /dev/null +++ b/.github/actions/pnpm-install/action.yml @@ -0,0 +1,86 @@ +######################################################################################## +# "pnpm install" composite action for pnpm 7/8+ # +#--------------------------------------------------------------------------------------# +# Requirement: @setup/node should be run before # +# # +# Usage in workflows steps: # +# # +# - name: 📥 Monorepo install # +# uses: ./.github/actions/pnpm-install # +# with: # +# enable-corepack: false # (default) # +# cwd: ${{ github.workspace }}/apps/my-app # (default = '.') # +# # +# Reference: # +# - latest: https://gist.github.com/belgattitude/838b2eba30c324f1f0033a797bab2e31 # +# # +# Versions: # +# - 1.1.0 - 15-07-2023 - Add project custom directory support. # +######################################################################################## + +name: "PNPM install" +description: "Run pnpm install with cache enabled" + +inputs: + enable-corepack: + description: "Enable corepack" + required: false + default: "false" + cwd: + description: "Changes node's process.cwd() if the project is not located on the root. Default to process.cwd()" + required: false + default: "." + +runs: + using: "composite" + + steps: + - name: ⚙️ Enable Corepack + if: ${{ inputs.enable-corepack == 'true' }} + shell: bash + working-directory: ${{ inputs.cwd }} + run: | + corepack enable + echo "corepack enabled" + + - uses: pnpm/action-setup@v2.2.4 + if: ${{ inputs.enable-corepack == 'false' }} + with: + run_install: false + # If you're not setting the packageManager field in package.json, add the version here + version: 8.6.11 + + - name: Expose pnpm config(s) through "$GITHUB_OUTPUT" + id: pnpm-config + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + + - name: Cache rotation keys + id: cache-rotation + shell: bash + run: | + echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-config.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}- + + # Prevent store to grow over time (not needed with yarn) + # Note: not perfect as it prune too much in monorepos so the idea + # is to use cache-rotation as above. In the future this might work better. + #- name: Prune pnpm store + # shell: bash + # run: pnpm prune store + + - name: Install dependencies + shell: bash + working-directory: ${{ inputs.cwd }} + run: pnpm install --frozen-lockfile --prefer-offline + env: + # Other environment variables + HUSKY: "0" # By default do not run HUSKY install diff --git a/.github/workflows/clean_cache.yml b/.github/workflows/clean_cache.yml new file mode 100644 index 00000000..bc596eae --- /dev/null +++ b/.github/workflows/clean_cache.yml @@ -0,0 +1,36 @@ +# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries +name: Cleanup caches for closed branches + +on: + pull_request: + types: + - closed + workflow_dispatch: + +jobs: + cleanup: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Cleanup + run: | + gh extension install actions/gh-actions-cache + + REPO=${{ github.repository }} + BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" + + echo "Fetching list of cache key" + cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) + + ## Setting this to not fail the workflow while deleting cache keys. + set +e + echo "Deleting caches..." + for cacheKey in $cacheKeysForPR + do + gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm + done + echo "Done" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/webiste.yml b/.github/workflows/webiste.yml new file mode 100644 index 00000000..a8f0d19b --- /dev/null +++ b/.github/workflows/webiste.yml @@ -0,0 +1,78 @@ +name: Website + +on: + push: + paths: ["src/**", ".github/workflows/website.yml"] + + pull_request: + paths: ["src/**", ".github/workflows/website.yml"] + +env: + NODE_VERSION: "19" + CONTAINER_REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + es-lint: + name: Check linting (es-lint) + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v3 + + - name: PNPM Install + uses: ./.github/actions/pnpm-install + + - name: Check ESlint + run: pnpm lint + + prettier: + name: Check formatting (prettier) + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v3 + + - name: PNPM Install + uses: ./.github/actions/pnpm-install + + - name: Check Prettier + run: pnpm prettier --check . + + sveltecheck: + name: Svelte Check + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v3 + + - name: PNPM Install + uses: ./.github/actions/pnpm-install + + - name: Make dummy env for types + run: | + echo "ls -a ." + ls -a . + mv .env.example .env + + - name: Check Svelte + run: pnpm run check + + build: + name: Svelte Build + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v3 + + - name: PNPM Install + uses: ./.github/actions/pnpm-install + + - name: Make dummy env for types + run: | + echo "ls -a ." + ls -a . + mv .env.example .env + + - name: Svelte Build + run: pnpm run build From 9cfb8eb66288e325ae4e0e171e33fa99f871efc7 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:35:13 +0200 Subject: [PATCH 02/24] fix(stats): types and some other things for svelte-check --- .github/workflows/webiste.yml | 2 +- src/lib/components/Item.svelte | 6 +++--- src/lib/constants/NotEnoughUpdates-REPO | 2 +- src/lib/sections/stats/Accessories.svelte | 4 ++-- src/lib/stats/items/stats.ts | 5 ++--- src/lib/stats/missing.ts | 4 ++++ src/lib/stats/player_stats.ts | 4 ++-- src/lib/stats/slayer.ts | 5 ++--- src/types/processed/profile/items.d.ts | 4 ++++ src/types/stats.d.ts | 2 +- 10 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/webiste.yml b/.github/workflows/webiste.yml index a8f0d19b..d38d00df 100644 --- a/.github/workflows/webiste.yml +++ b/.github/workflows/webiste.yml @@ -8,7 +8,7 @@ on: paths: ["src/**", ".github/workflows/website.yml"] env: - NODE_VERSION: "19" + NODE_VERSION: "21" CONTAINER_REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} diff --git a/src/lib/components/Item.svelte b/src/lib/components/Item.svelte index 2b161301..b20950cf 100644 --- a/src/lib/components/Item.svelte +++ b/src/lib/components/Item.svelte @@ -6,7 +6,7 @@ import { Avatar, Tooltip } from "bits-ui"; import Image from "lucide-svelte/icons/image"; - export let piece: ProcessedItem; + export let piece: ProcessedItem | ProcessedPet; export let isInventory = false; export let showCount = true; @@ -16,7 +16,7 @@ const bgColor = piece.rarity ? getRarityClass(piece.rarity.toLowerCase() as string, "bg") : "bg-background"; const enchanted = isEnchanted(piece as ProcessedItem); - const showNumbers = showCount && piece.Count > 1; + const showNumbers = showCount && (piece as ProcessedItem).Count > 1; const processedItem = piece as ProcessedItem; const processedPet = piece as unknown as ProcessedPet; @@ -33,7 +33,7 @@ {#if showNumbers}
- {piece.Count} + {processedItem.Count}
{/if} diff --git a/src/lib/constants/NotEnoughUpdates-REPO b/src/lib/constants/NotEnoughUpdates-REPO index f73d9d05..e3bdcf63 160000 --- a/src/lib/constants/NotEnoughUpdates-REPO +++ b/src/lib/constants/NotEnoughUpdates-REPO @@ -1 +1 @@ -Subproject commit f73d9d055f133e93ccd7af162be74c529c8b7bfa +Subproject commit e3bdcf63a01b1123598edc901a9ab2c4621c3d68 diff --git a/src/lib/sections/stats/Accessories.svelte b/src/lib/sections/stats/Accessories.svelte index abc567c7..98b82657 100644 --- a/src/lib/sections/stats/Accessories.svelte +++ b/src/lib/sections/stats/Accessories.svelte @@ -102,9 +102,9 @@ +{accessories.magicalPower.riftPrism} MP {/if} - {#if accessories.magicalPower.hegemony > 0} + {#if accessories.magicalPower.hegemony.amount > 0 && accessories.magicalPower.hegemony.rarity !== null}
  • - Hegemony Artifact: + Hegemony Artifact: = +{accessories.magicalPower.hegemony} MP
  • diff --git a/src/lib/stats/items/stats.ts b/src/lib/stats/items/stats.ts index af71ff50..3bbf26a2 100644 --- a/src/lib/stats/items/stats.ts +++ b/src/lib/stats/items/stats.ts @@ -1,7 +1,7 @@ -import { getRawLore } from "$lib/helper"; -import type { ProcessedItem } from "$types/stats"; import * as constants from "$constants/constants"; +import { getRawLore } from "$lib/helper"; import type { ItemStats } from "$types/processed/profile/stats"; +import type { ProcessedItem } from "$types/stats"; export function getStatsFromItem(item: ProcessedItem) { const regex = /^([A-Za-z ]+): ([+-]([0-9]+(?:,[0-9]{3})*(?:\.[0-9]{0,2})?))/; @@ -25,7 +25,6 @@ export function getStatsFromItem(item: ProcessedItem) { if (statName) { stats[statName] = 0; - // @ts-expect-error: Object is possibly 'null'. stats[statName] += statValue; } } diff --git a/src/lib/stats/missing.ts b/src/lib/stats/missing.ts index 2c78e84a..d5f2477e 100644 --- a/src/lib/stats/missing.ts +++ b/src/lib/stats/missing.ts @@ -186,6 +186,10 @@ export async function getMissingAccessories(items: Accessories, userProfile: Mem accessories: activeAccessories.reduce((a, b) => a + helper.getMagicalPower(b.rarity, helper.getId(b)), 0), abiphone: abiphoneContacts ? Math.floor(abiphoneContacts / 2) : 0, riftPrism: riftPrism ? 11 : 0, + hegemony: { + rarity: activeAccessories.find((a) => helper.getId(a) === "HEGEMONY")?.rarity ?? null, + amount: helper.getMagicalPower(activeAccessories.find((a) => helper.getId(a) === "HEGEMONY")?.rarity ?? "", "HEGEMONY_ARTIFACT") + }, rarities: {} }; diff --git a/src/lib/stats/player_stats.ts b/src/lib/stats/player_stats.ts index 5e105b23..bdc92b14 100644 --- a/src/lib/stats/player_stats.ts +++ b/src/lib/stats/player_stats.ts @@ -91,7 +91,7 @@ export function getPlayerStats(profile: Stats) { } } - if (profile.slayer.data) { + if (profile.slayer?.data) { for (const [slayer, data] of Object.entries(profile.slayer.data)) { const bonusStats = getBonusStat(data.level.level, `slayer_${slayer}`, data.level.maxLevel); @@ -106,7 +106,7 @@ export function getPlayerStats(profile: Stats) { } } - if (profile.dungeons.level.level > 0) { + if (profile.dungeons?.level?.level !== undefined) { const bonusStats = getBonusStat(profile.dungeons.level.level, "skill_dungeoneering", 50); for (const [name, value] of Object.entries(bonusStats)) { diff --git a/src/lib/stats/slayer.ts b/src/lib/stats/slayer.ts index 0d7476a7..b76e85aa 100644 --- a/src/lib/stats/slayer.ts +++ b/src/lib/stats/slayer.ts @@ -1,6 +1,5 @@ -import type { Member, SlayerBoss } from "$types/global"; import * as constants from "$constants/constants"; -import type { Slayer } from "$types/processed/profile/slayer"; +import type { Member, SlayerBoss, SlayerData } from "$types/global"; function getKills(slayer: SlayerBoss) { if (slayer === undefined) { @@ -64,7 +63,7 @@ export function getSlayer(userProfile: Member) { return null; } - const output = { data: {} } as Slayer; + const output = { data: {} } as SlayerData; for (const id of constants.SLAYERS) { const data = slayerData[id]; output.data[id] = { diff --git a/src/types/processed/profile/items.d.ts b/src/types/processed/profile/items.d.ts index 07d23265..ecc8fb2f 100644 --- a/src/types/processed/profile/items.d.ts +++ b/src/types/processed/profile/items.d.ts @@ -242,6 +242,10 @@ export type AccessoriesOutput = { accessories: number; abiphone: number; riftPrism: number; + hegemony: { + rarity: string | null; + amount: number; + }; rarities: Record; }; }; diff --git a/src/types/stats.d.ts b/src/types/stats.d.ts index fb1f2eaa..423a7fc1 100644 --- a/src/types/stats.d.ts +++ b/src/types/stats.d.ts @@ -39,7 +39,7 @@ export type Stats = { mining: MiningStats; farming: Farming; fishing: Fishing; - slayer: SlayerData; + slayer: SlayerData | null; dungeons: DungeonsStats | null; minions: Minions; bestiary: BestiaryStats; From 387cbbd87cbd12712bb8f6556704ffb2de251218 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:38:39 +0200 Subject: [PATCH 03/24] fix(build): if u fail ur gay --- src/lib/sections/stats/Inventory.svelte | 4 ++-- tailwind.config.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/sections/stats/Inventory.svelte b/src/lib/sections/stats/Inventory.svelte index 327e7cda..759d2447 100644 --- a/src/lib/sections/stats/Inventory.svelte +++ b/src/lib/sections/stats/Inventory.svelte @@ -77,7 +77,7 @@ }); - + {#each tabs as tab} {@const isActive = $openTab === tab.id} @@ -101,7 +101,7 @@ {#each tabs as tab} {#if $openTab === tab.id} -
    +
    {#each tab.items as item, index} {#if tab.hr === index}
    diff --git a/tailwind.config.ts b/tailwind.config.ts index 91220f8a..b8589f9e 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -83,6 +83,6 @@ export default { { values: theme("textShadow") } ); }), - require('@tailwindcss/container-queries'), + require("@tailwindcss/container-queries") ] } satisfies Config; From 28be27157523ccb1184489b5a2dbb3b38d03b70a Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:41:23 +0200 Subject: [PATCH 04/24] fix(build): pro dev --- .github/actions/pnpm-install/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/pnpm-install/action.yml b/.github/actions/pnpm-install/action.yml index 5f7fa03e..9143f700 100644 --- a/.github/actions/pnpm-install/action.yml +++ b/.github/actions/pnpm-install/action.yml @@ -80,7 +80,7 @@ runs: - name: Install dependencies shell: bash working-directory: ${{ inputs.cwd }} - run: pnpm install --frozen-lockfile --prefer-offline + run: pnpm install env: # Other environment variables HUSKY: "0" # By default do not run HUSKY install From 69d518170be00cd794444fd8c0e3f38eb237756a Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:45:19 +0200 Subject: [PATCH 05/24] fix(build): yes --- .github/actions/pnpm-install/action.yml | 49 ++++--------------------- 1 file changed, 8 insertions(+), 41 deletions(-) diff --git a/.github/actions/pnpm-install/action.yml b/.github/actions/pnpm-install/action.yml index 9143f700..bd3bb0e6 100644 --- a/.github/actions/pnpm-install/action.yml +++ b/.github/actions/pnpm-install/action.yml @@ -35,52 +35,19 @@ runs: using: "composite" steps: - - name: ⚙️ Enable Corepack - if: ${{ inputs.enable-corepack == 'true' }} - shell: bash - working-directory: ${{ inputs.cwd }} - run: | - corepack enable - echo "corepack enabled" - - - uses: pnpm/action-setup@v2.2.4 - if: ${{ inputs.enable-corepack == 'false' }} + - name: Setup Node.js + uses: actions/setup-node@v3 with: - run_install: false - # If you're not setting the packageManager field in package.json, add the version here - version: 8.6.11 - - - name: Expose pnpm config(s) through "$GITHUB_OUTPUT" - id: pnpm-config - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + node-version: '20' # Specify the required Node.js version - - name: Cache rotation keys - id: cache-rotation - shell: bash - run: | - echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT - - - uses: actions/cache@v3 - name: Setup pnpm cache + - name: Setup pnpm + uses: pnpm/action-setup@v2.2.4 with: - path: ${{ steps.pnpm-config.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}- - - # Prevent store to grow over time (not needed with yarn) - # Note: not perfect as it prune too much in monorepos so the idea - # is to use cache-rotation as above. In the future this might work better. - #- name: Prune pnpm store - # shell: bash - # run: pnpm prune store + version: '9.4' # Specify the required pnpm version - name: Install dependencies + run: pnpm install shell: bash working-directory: ${{ inputs.cwd }} - run: pnpm install env: - # Other environment variables - HUSKY: "0" # By default do not run HUSKY install + HUSKY: "0" From bb23b53c2b362c076c42404b6473b4a2a934e8dd Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:46:17 +0200 Subject: [PATCH 06/24] fix(style): prettier --- .github/actions/pnpm-install/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/pnpm-install/action.yml b/.github/actions/pnpm-install/action.yml index bd3bb0e6..2ea1a928 100644 --- a/.github/actions/pnpm-install/action.yml +++ b/.github/actions/pnpm-install/action.yml @@ -38,12 +38,12 @@ runs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '20' # Specify the required Node.js version + node-version: "20" # Specify the required Node.js version - name: Setup pnpm uses: pnpm/action-setup@v2.2.4 with: - version: '9.4' # Specify the required pnpm version + version: "9.4" # Specify the required pnpm version - name: Install dependencies run: pnpm install From b772d525036c12d1f0b584c69422567189cbed8e Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:46:42 +0200 Subject: [PATCH 07/24] fix(yes): yes --- .github/actions/pnpm-install/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/pnpm-install/action.yml b/.github/actions/pnpm-install/action.yml index 2ea1a928..f74b2fed 100644 --- a/.github/actions/pnpm-install/action.yml +++ b/.github/actions/pnpm-install/action.yml @@ -38,12 +38,12 @@ runs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: "20" # Specify the required Node.js version + node-version: "20" - name: Setup pnpm uses: pnpm/action-setup@v2.2.4 with: - version: "9.4" # Specify the required pnpm version + version: "9.4" - name: Install dependencies run: pnpm install From e1870e5064a15ca8a5d0ae63823afdbaf25c3622 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:48:05 +0200 Subject: [PATCH 08/24] fix(gitignore): add cache folder --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2f4ea2cb..259da4f6 100644 --- a/.gitignore +++ b/.gitignore @@ -102,7 +102,7 @@ $RECYCLE.BIN/ build/ package/ -cache/ +cache/* node_modules/ vite.config.js.timestamp-* vite.config.ts.timestamp-* From d86a92b061db47227369a67659ebbd7abaa82966 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:51:14 +0200 Subject: [PATCH 09/24] fix(yes): yes --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 259da4f6..465f83c3 100644 --- a/.gitignore +++ b/.gitignore @@ -102,7 +102,10 @@ $RECYCLE.BIN/ build/ package/ -cache/* +cache/head/* +cache/json/* +cache/leather/* +cache/potion/* node_modules/ vite.config.js.timestamp-* vite.config.ts.timestamp-* From 70e1504d048818cd79ee008e028691406f5dc83b Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:53:26 +0200 Subject: [PATCH 10/24] yes --- cache/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 cache/.gitkeep diff --git a/cache/.gitkeep b/cache/.gitkeep new file mode 100644 index 00000000..e69de29b From d828796707a8cea171864c85fd01f80c0421b78d Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:55:20 +0200 Subject: [PATCH 11/24] yes --- .gitignore | 2 +- cache/json/.gitkeep | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 cache/json/.gitkeep diff --git a/.gitignore b/.gitignore index 465f83c3..c3e8ecd2 100644 --- a/.gitignore +++ b/.gitignore @@ -103,7 +103,7 @@ $RECYCLE.BIN/ build/ package/ cache/head/* -cache/json/* +cache/json/*.json cache/leather/* cache/potion/* node_modules/ diff --git a/cache/json/.gitkeep b/cache/json/.gitkeep new file mode 100644 index 00000000..e69de29b From f324e56f5c937f525efd2314b551fae632fa609a Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:58:00 +0200 Subject: [PATCH 12/24] fix: yes --- cache/.gitkeep | 0 cache/json/.gitkeep | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 cache/.gitkeep delete mode 100644 cache/json/.gitkeep diff --git a/cache/.gitkeep b/cache/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/cache/json/.gitkeep b/cache/json/.gitkeep deleted file mode 100644 index e69de29b..00000000 From 34b6b49e736f6398a39f46cc6167d5098baff347 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 01:59:19 +0200 Subject: [PATCH 13/24] fix(cli): git clone neu repo --- .github/workflows/webiste.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/webiste.yml b/.github/workflows/webiste.yml index d38d00df..86a75783 100644 --- a/.github/workflows/webiste.yml +++ b/.github/workflows/webiste.yml @@ -65,6 +65,13 @@ jobs: - name: Git checkout uses: actions/checkout@v3 + - name: Clone NotEnoughUpdates-REPO + uses: actions/checkout@v3 + with: + repository: NotEnoughUpdates/NotEnoughUpdates-REPO + path: src/lib/constants/NotEnoughUpdates-REPO/items + token: ${{ secrets.GITHUB_TOKEN }} + - name: PNPM Install uses: ./.github/actions/pnpm-install From 0912ed55a2342d6bef7420db2f759e6469950170 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 02:00:32 +0200 Subject: [PATCH 14/24] fix yes --- cache/json/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 cache/json/.gitkeep diff --git a/cache/json/.gitkeep b/cache/json/.gitkeep new file mode 100644 index 00000000..e69de29b From 9daae1c816c39c4ac7f6bd3cc39d73eade646932 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 02:06:05 +0200 Subject: [PATCH 15/24] fix: yes --- src/lib/scripts/parseNEURepository.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/scripts/parseNEURepository.ts b/src/lib/scripts/parseNEURepository.ts index b23f615a..3ed285eb 100644 --- a/src/lib/scripts/parseNEURepository.ts +++ b/src/lib/scripts/parseNEURepository.ts @@ -7,6 +7,9 @@ export const NEU_CONSTANTS = new Map(); export async function parseNEURepository() { const timeNow = performance.now(); + if (fs.statSync("src/lib/constants/NotEnoughUpdates-REPO/items").isDirectory()) { + return; + } const items = fs.readdirSync("src/lib/constants/NotEnoughUpdates-REPO/items"); for (const item of items) { From 484ce059e0ddda79c9994484aea097b3c0dceea6 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 02:13:16 +0200 Subject: [PATCH 16/24] feat(build): add conflcits && codeql-analysis yml --- .github/workflows/codeql-analysis.yml | 25 +++++++++++++++++++++++++ .github/workflows/conflicts.yml | 16 ++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/conflicts.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..98f6fa0d --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,25 @@ +name: "CodeQL" + +on: + schedule: + - cron: "30 1 * * *" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + permissions: + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: javascript + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/conflicts.yml b/.github/workflows/conflicts.yml new file mode 100644 index 00000000..5205c74c --- /dev/null +++ b/.github/workflows/conflicts.yml @@ -0,0 +1,16 @@ +name: "Mark Conflicts" + +on: + push: + pull_request_target: + types: [synchronize] + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Check for PR conflicts + uses: eps1lon/actions-label-merge-conflict@releases/2.x + with: + dirtyLabel: "has conflicts" + repoToken: "${{ secrets.GITHUB_TOKEN }}" From 6ad1f2e60dbbff7b37a917f7ae3223351f295422 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 02:15:55 +0200 Subject: [PATCH 17/24] yes --- .github/workflows/conflicts.yml | 16 ---------------- .github/workflows/webiste.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 16 deletions(-) delete mode 100644 .github/workflows/conflicts.yml diff --git a/.github/workflows/conflicts.yml b/.github/workflows/conflicts.yml deleted file mode 100644 index 5205c74c..00000000 --- a/.github/workflows/conflicts.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: "Mark Conflicts" - -on: - push: - pull_request_target: - types: [synchronize] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Check for PR conflicts - uses: eps1lon/actions-label-merge-conflict@releases/2.x - with: - dirtyLabel: "has conflicts" - repoToken: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/webiste.yml b/.github/workflows/webiste.yml index 86a75783..60b97cfc 100644 --- a/.github/workflows/webiste.yml +++ b/.github/workflows/webiste.yml @@ -13,6 +13,34 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: + conflicts: + runs-on: ubuntu-latest + steps: + - name: Check for PR conflicts + uses: eps1lon/actions-label-merge-conflict@releases/2.x + with: + dirtyLabel: "has conflicts" + repoToken: "${{ secrets.GITHUB_TOKEN }}" + + analyze: + name: Analyze + runs-on: ubuntu-latest + + permissions: + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: javascript + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + es-lint: name: Check linting (es-lint) runs-on: ubuntu-latest From 34ebc89717aeb468f0879125c9484628e2d7b594 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 02:16:30 +0200 Subject: [PATCH 18/24] fix: oops --- .github/workflows/codeql-analysis.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 98f6fa0d..00000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "CodeQL" - -on: - schedule: - - cron: "30 1 * * *" - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - permissions: - security-events: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: javascript - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 From 7f7db8f88fb091dee440af6e71af0f67553143d0 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 16:06:10 +0200 Subject: [PATCH 19/24] fix: yes --- .gitignore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c3e8ecd2..2f4ea2cb 100644 --- a/.gitignore +++ b/.gitignore @@ -102,10 +102,7 @@ $RECYCLE.BIN/ build/ package/ -cache/head/* -cache/json/*.json -cache/leather/* -cache/potion/* +cache/ node_modules/ vite.config.js.timestamp-* vite.config.ts.timestamp-* From 0b9b81f965332dc67db3e236446833feb6399917 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 16:24:23 +0200 Subject: [PATCH 20/24] fix --- cache/json/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 cache/json/.gitkeep diff --git a/cache/json/.gitkeep b/cache/json/.gitkeep deleted file mode 100644 index e69de29b..00000000 From 75dadab1b91dbf7a27e8c51284a027d37ec3e7e6 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 16:28:55 +0200 Subject: [PATCH 21/24] fix: yes --- src/lib/helper/cache.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/helper/cache.ts b/src/lib/helper/cache.ts index 9ea3bef8..d5f609c3 100644 --- a/src/lib/helper/cache.ts +++ b/src/lib/helper/cache.ts @@ -7,6 +7,10 @@ export function getFolderPath() { } export function getCacheFolderPath() { + if (!fs.pathExistsSync(path.resolve(base, "cache"))) { + fs.mkdirSync(path.resolve(base, "cache")) + } + return path.resolve(base, "cache"); } From 031761b77dbddd2b9bb47556ed66d84fbe7fbfeb Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 16:30:09 +0200 Subject: [PATCH 22/24] fix(style): prettier --- src/lib/helper/cache.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/helper/cache.ts b/src/lib/helper/cache.ts index d5f609c3..a279f81d 100644 --- a/src/lib/helper/cache.ts +++ b/src/lib/helper/cache.ts @@ -1,6 +1,6 @@ -import path from "path"; -import fs from "fs-extra"; import { base } from "$app/paths"; +import fs from "fs-extra"; +import path from "path"; export function getFolderPath() { return path.resolve(base); @@ -8,7 +8,7 @@ export function getFolderPath() { export function getCacheFolderPath() { if (!fs.pathExistsSync(path.resolve(base, "cache"))) { - fs.mkdirSync(path.resolve(base, "cache")) + fs.mkdirSync(path.resolve(base, "cache")); } return path.resolve(base, "cache"); From 3b83cacf08aa050ea503c9833771c76ad5d2a54f Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 16:30:52 +0200 Subject: [PATCH 23/24] fix(gh-actions): typo --- .github/workflows/{webiste.yml => website.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{webiste.yml => website.yml} (100%) diff --git a/.github/workflows/webiste.yml b/.github/workflows/website.yml similarity index 100% rename from .github/workflows/webiste.yml rename to .github/workflows/website.yml From b834eb04a0753457ed91c3bca3cc7c4d658a9d56 Mon Sep 17 00:00:00 2001 From: DuckySoLucky Date: Wed, 26 Jun 2024 19:09:03 +0200 Subject: [PATCH 24/24] fix(stats): DarthGIgi's things --- src/lib/components/Item.svelte | 4 ++-- src/lib/sections/stats/Accessories.svelte | 2 +- src/lib/stats/player_stats.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/Item.svelte b/src/lib/components/Item.svelte index b20950cf..ee68895f 100644 --- a/src/lib/components/Item.svelte +++ b/src/lib/components/Item.svelte @@ -16,10 +16,10 @@ const bgColor = piece.rarity ? getRarityClass(piece.rarity.toLowerCase() as string, "bg") : "bg-background"; const enchanted = isEnchanted(piece as ProcessedItem); - const showNumbers = showCount && (piece as ProcessedItem).Count > 1; - const processedItem = piece as ProcessedItem; const processedPet = piece as unknown as ProcessedPet; + + const showNumbers = showCount && processedItem.Count > 1;
    diff --git a/src/lib/sections/stats/Accessories.svelte b/src/lib/sections/stats/Accessories.svelte index 98b82657..ed557b98 100644 --- a/src/lib/sections/stats/Accessories.svelte +++ b/src/lib/sections/stats/Accessories.svelte @@ -102,7 +102,7 @@ +{accessories.magicalPower.riftPrism} MP {/if} - {#if accessories.magicalPower.hegemony.amount > 0 && accessories.magicalPower.hegemony.rarity !== null} + {#if accessories.magicalPower.hegemony.amount > 0 && accessories.magicalPower.hegemony.rarity}
  • Hegemony Artifact: = diff --git a/src/lib/stats/player_stats.ts b/src/lib/stats/player_stats.ts index bdc92b14..45990bba 100644 --- a/src/lib/stats/player_stats.ts +++ b/src/lib/stats/player_stats.ts @@ -106,7 +106,7 @@ export function getPlayerStats(profile: Stats) { } } - if (profile.dungeons?.level?.level !== undefined) { + if (profile.dungeons?.level?.level) { const bonusStats = getBonusStat(profile.dungeons.level.level, "skill_dungeoneering", 50); for (const [name, value] of Object.entries(bonusStats)) {