Skip to content

Commit

Permalink
Merge refactor/project-structure: Resolve NotEnoughUpdates-REPO conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckySoLucky committed Dec 6, 2024
2 parents c57d563 + 71f13f7 commit 0a4cd63
Show file tree
Hide file tree
Showing 159 changed files with 570 additions and 580 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: NotEnoughUpdates/NotEnoughUpdates-REPO
path: src/lib/constants/NotEnoughUpdates-REPO/items
path: src/lib/server/constants/NotEnoughUpdates-REPO/
token: ${{ secrets.GITHUB_TOKEN }}

- name: PNPM Install
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "src/lib/constants/NotEnoughUpdates-REPO"]
path = src/lib/constants/NotEnoughUpdates-REPO
[submodule "src/lib/constants/server/NotEnoughUpdates-REPO"]
path = src/lib/constants/server/NotEnoughUpdates-REPO
url = https://github.com/NotEnoughUpdates/NotEnoughUpdates-REPO
12 changes: 6 additions & 6 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { startMongo } from "./lib/server/db/mongo";
import { startRedis } from "./lib/server/db/redis";
import { init } from "$lib/custom_resources";
import { parseNEURepository } from "$lib/scripts/parseNEURepository";
import { updateNotEnoughUpdatesRepository } from "$lib/scripts/updateNEURepository";
import { getPrices } from "skyhelper-networth";
import { updateItems } from "$lib/server/constants/update-items";
import { updateCollections } from "$lib/server/constants/update-collections";
import { updateItems } from "$lib/server/constants/update-items";
import { parseNEURepository } from "$lib/server/helper/NotEnoughUpdates/parseNEURepository";
import { updateNotEnoughUpdatesRepository } from "$lib/server/helper/NotEnoughUpdates/updateNEURepository";
import { getPrices } from "skyhelper-networth";
import { startMongo } from "./lib/server/db/mongo";
import { startRedis } from "./lib/server/db/redis";

init();

Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/AdditionStat.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { RARITY_COLORS } from "$constants/items";
import { cn, flyAndScale } from "$lib/utils";
import { RARITY_COLORS } from "$lib/shared/constants/items";
import { cn, flyAndScale } from "$lib/shared/utils";
import { Tooltip } from "bits-ui";
export let text: string;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/Bonus.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { STATS_DATA } from "$constants/stats";
import { cn } from "$lib/utils";
import { STATS_DATA } from "$lib/shared/constants/stats";
import { cn } from "$lib/shared/utils";
export let stats;
export let title = "Bonus:";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Chip.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { cn, flyAndScale } from "$lib/utils";
import { cn, flyAndScale } from "$lib/shared/utils";
import { Avatar, Tooltip } from "bits-ui";
import Image from "lucide-svelte/icons/image";
import { fade } from "svelte/transition";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Header.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { flyAndScale } from "$lib/utils";
import { flyAndScale } from "$lib/shared/utils";
import { Button, Popover } from "bits-ui";
import PackageOpen from "lucide-svelte/icons/package-open";
import PaintBucket from "lucide-svelte/icons/paint-bucket";
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/Item.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { page } from "$app/stores";
import { getRarityClass, isEnchanted, removeFormatting, renderLore } from "$lib/tools";
import { cn, flyAndScale } from "$lib/utils";
import type { ProcessedItem, ProcessedPet } from "$types/global";
import { getRarityClass, isEnchanted, removeFormatting, renderLore } from "$lib/shared/helper";
import { cn, flyAndScale } from "$lib/shared/utils";
import type { ProcessedItem, ProcessedPet } from "$lib/types/global";
import { Avatar, Tooltip } from "bits-ui";
import Image from "lucide-svelte/icons/image";
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/Skillbar.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { formatNumber } from "$lib/tools";
import { cn, flyAndScale } from "$lib/utils";
import type { Skill } from "$types/global";
import { formatNumber } from "$lib/shared/helper";
import { cn, flyAndScale } from "$lib/shared/utils";
import type { Skill } from "$lib/types/global";
import { Avatar, Progress, Tooltip } from "bits-ui";
import BarChartHorizontal from "lucide-svelte/icons/bar-chart-horizontal";
import { format } from "numerable";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Stat.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { cn, flyAndScale } from "$lib/utils";
import { cn, flyAndScale } from "$lib/shared/utils";
import { Tooltip } from "bits-ui";
import { format } from "numerable";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Wardrobe.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import Item from "$lib/components/Item.svelte";
import type { ProcessedItem } from "$types/global";
import type { ProcessedItem } from "$lib/types/global";
import { Collapsible } from "bits-ui";
import { writable } from "svelte/store";
import { slide } from "svelte/transition";
Expand Down
1 change: 0 additions & 1 deletion src/lib/constants/NotEnoughUpdates-REPO
Submodule NotEnoughUpdates-REPO deleted from a3a654
22 changes: 0 additions & 22 deletions src/lib/constants/constants.ts

This file was deleted.

8 changes: 6 additions & 2 deletions src/lib/custom_resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from "path";
import RJSON from "relaxed-json";
import UPNG from "upng-js";
import util from "util";
import { getCacheFilePath, getCacheFolderPath, getFolderPath, getId, getPath, getTextureValue, hasPath } from "./helper";
import { getCacheFilePath, getCacheFolderPath, getFolderPath, getId, getPath, getTextureValue, hasPath } from "./server/helper";
const mcData = minecraftData("1.8.9");

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand All @@ -18,7 +18,7 @@ import apng2gif from "apng2gif-bin";
// @ts-ignore
import sharp from "sharp";

import { getFileHash } from "$lib/hashes";
import { getFileHash } from "$lib/server/helper/hashes";
import type { ItemTexture, OutputResourcePack, OutputTexture, ResourcePack, TextureAnimation, TextureModel } from "$types/custom-resources";
import type { Item, ProcessedItem, getTextureParams } from "$types/processed/profile/items";
import child_process from "child_process";
Expand Down Expand Up @@ -327,6 +327,8 @@ async function loadResourcePacks() {
continue;
}

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
const decode = UPNG.decode(imageData);
if (decode == null) {
continue;
Expand Down Expand Up @@ -511,6 +513,8 @@ async function loadResourcePacks() {
}

if (pngFrames.length > 0) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
const apng = UPNG.encode(pngFrames, NORMALIZED_SIZE, NORMALIZED_SIZE, 0, pngDelays);

await fs.writeFile(textureFile, Buffer.from(apng));
Expand Down
1 change: 0 additions & 1 deletion src/lib/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/lib/layouts/stats/AdditionalStats.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import AdditionStat from "$lib/components/AdditionStat.svelte";
import { formatNumber } from "$lib/tools";
import type { Stats as StatsType } from "$types/stats";
import { formatNumber } from "$lib/shared/helper";
import type { Stats as StatsType } from "$lib/types/stats";
import { format as dateFormat, formatDistanceToNowStrict } from "date-fns";
import { format as numberFormat } from "numerable";
import { getContext } from "svelte";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/layouts/stats/Items.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { cn } from "$lib/utils";
import { cn } from "$lib/shared/utils";
export let title: string | undefined = undefined;
export let subtitle: string | undefined = undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/layouts/stats/Main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import SkillsSection from "$lib/sections/stats/SkillsSection.svelte";
import Slayer from "$lib/sections/stats/Slayer.svelte";
import Weapons from "$lib/sections/stats/Weapons.svelte";
import type { Stats as StatsType } from "$types/stats";
import type { Stats as StatsType } from "$lib/types/stats";
import { setContext } from "svelte";
export let profile;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/layouts/stats/PlayerProfile.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { Stats as StatsType } from "$types/stats";
import { flyAndScale } from "$lib/utils";
import { flyAndScale } from "$lib/shared/utils";
import type { Stats as StatsType } from "$lib/types/stats";
import { Button, DropdownMenu } from "bits-ui";
import ChevronRight from "lucide-svelte/icons/chevron-right";
import ExternalLink from "lucide-svelte/icons/external-link";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/layouts/stats/Skills.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import Skillbar from "$lib/components/Skillbar.svelte";
import type { Stats as StatsType } from "$types/stats";
import type { Stats as StatsType } from "$lib/types/stats";
import { getContext } from "svelte";
const profile = getContext<StatsType>("profile");
Expand Down
4 changes: 2 additions & 2 deletions src/lib/layouts/stats/Stats.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import Stat from "$lib/components/Stat.svelte";
import { getPlayerStats } from "$lib/stats/player_stats";
import type { Stats as StatsType } from "$types/stats";
import { getPlayerStats } from "$lib/shared/player_stats";
import type { Stats as StatsType } from "$lib/types/stats";
import { getContext } from "svelte";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import path from "path";

import type { ItemQuery } from "$types/global";
import minecraftData from "minecraft-data";
import * as helper from "./helper";
import { getItemData } from "./helper/item";
import * as helper from "./server/helper";
import { getItemData } from "./server/helper/item";
const mcData = minecraftData("1.8.9");

const skewA = 26 / 45;
Expand Down
46 changes: 0 additions & 46 deletions src/lib/scripts/parseNEURepository.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/lib/sections/stats/Accessories.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import { RARITY_COLORS } from "$constants/items";
import { RARITY_COLORS } from "$lib/shared/constants/items";
import AdditionStat from "$lib/components/AdditionStat.svelte";
import Bonus from "$lib/components/Bonus.svelte";
import Item from "$lib/components/Item.svelte";
import Items from "$lib/layouts/stats/Items.svelte";
import type { Stats as StatsType } from "$types/stats";
import type { Stats as StatsType } from "$lib/types/stats";
import { Collapsible } from "bits-ui";
import { getContext } from "svelte";
Expand Down
6 changes: 3 additions & 3 deletions src/lib/sections/stats/Armor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import Item from "$lib/components/Item.svelte";
import Wardrobe from "$lib/components/Wardrobe.svelte";
import Items from "$lib/layouts/stats/Items.svelte";
import { getRarityClass } from "$lib/tools";
import { cn } from "$lib/utils";
import type { Stats as StatsType } from "$types/stats";
import { getRarityClass } from "$lib/shared/helper";
import { cn } from "$lib/shared/utils";
import type { Stats as StatsType } from "$lib/types/stats";
import { getContext } from "svelte";
const profile = getContext<StatsType>("profile");
Expand Down
4 changes: 2 additions & 2 deletions src/lib/sections/stats/Bestiary.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import AdditionStat from "$lib/components/AdditionStat.svelte";
import Chip from "$lib/components/Chip.svelte";
import Items from "$lib/layouts/stats/Items.svelte";
import { cn } from "$lib/utils";
import type { Stats as StatsType } from "$types/stats";
import { cn } from "$lib/shared/utils";
import type { Stats as StatsType } from "$lib/types/stats";
import { format } from "numerable";
import { getContext } from "svelte";
Expand Down
5 changes: 3 additions & 2 deletions src/lib/sections/stats/Collections.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
import AdditionStat from "$lib/components/AdditionStat.svelte";
import Chip from "$lib/components/Chip.svelte";
import Items from "$lib/layouts/stats/Items.svelte";
import { cn } from "$lib/utils";
import type { Stats as StatsType } from "$types/stats";
import { cn } from "$lib/shared/utils";
import type { Stats as StatsType } from "$lib/types/stats";
import { format } from "numerable";
import { getContext } from "svelte";
Expand Down
7 changes: 4 additions & 3 deletions src/lib/sections/stats/CrimsonIsle.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
import AdditionStat from "$lib/components/AdditionStat.svelte";
import Chip from "$lib/components/Chip.svelte";
import Items from "$lib/layouts/stats/Items.svelte";
import { cn } from "$lib/utils";
import type { Stats as StatsType } from "$types/stats";
import { formatTime } from "$lib/shared/helper";
import { cn } from "$lib/shared/utils";
import type { Stats as StatsType } from "$lib/types/stats";
import { format } from "numerable";
import { getContext } from "svelte";
Expand Down Expand Up @@ -68,7 +69,7 @@
</div>
<div class="text-sm">
<span class="opacity-60">Time:</span>
<span class="text-text">{challenge.formattedTime}</span>
<span class="text-text">{formatTime(challenge.time)}</span>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/sections/stats/Dungeons.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import AdditionStat from "$lib/components/AdditionStat.svelte";
import Skillbar from "$lib/components/Skillbar.svelte";
import { formatNumber } from "$lib/tools";
import type { Stats as StatsType } from "$types/stats";
import { formatNumber } from "$lib/shared/helper";
import type { Stats as StatsType } from "$lib/types/stats";
import { Avatar, Collapsible } from "bits-ui";
import { formatDate, formatDistanceToNowStrict } from "date-fns";
import ChevronDown from "lucide-svelte/icons/chevron-down";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sections/stats/Inventory.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import Item from "$lib/components/Item.svelte";
import type { Stats as StatsType } from "$types/stats";
import type { Stats as StatsType } from "$lib/types/stats";
import { Avatar, Tabs } from "bits-ui";
import Image from "lucide-svelte/icons/image";
import { getContext } from "svelte";
Expand Down
6 changes: 3 additions & 3 deletions src/lib/sections/stats/Minions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import AdditionStat from "$lib/components/AdditionStat.svelte";
import Chip from "$lib/components/Chip.svelte";
import Items from "$lib/layouts/stats/Items.svelte";
import { cn } from "$lib/utils";
import type { Stats as StatsType } from "$types/stats";
import { cn } from "$lib/shared/utils";
import type { Stats as StatsType } from "$lib/types/stats";
import { getContext } from "svelte";
const profile = getContext<StatsType>("profile");
Expand All @@ -16,7 +16,7 @@

<Items title="Minions" class="flex-col">
<div slot="text">
<AdditionStat text="Unique Minions" data="{minions.maxedTiers} / {minions.totalTiers}" subData="({((100 * minions.maxedTiers) / minions.totalTiers).toFixed(0)}%)" />
<AdditionStat text="Unique Minions" data="{minions.maxedTiers} / {minions.totalTiers}" subData="({((100 * minions.maxedTiers) / minions.totalTiers).toFixed(0)}%)" maxed={minions.maxedTiers === minions.totalTiers} />
<AdditionStat text="Minion Slots" data={minions.minionsSlots.current} subData="({minions.minionsSlots.next} to next slot)" />
<AdditionStat text="Bonus Minion Slots" data="{minions.minionsSlots.bonusSlots} / 5" maxed={minions.minionsSlots.bonusSlots === 5} />
<AdditionStat text="Maxed Minions" data="{minions.maxedMinions} / {minions.totalMinions}" />
Expand Down
Loading

0 comments on commit 0a4cd63

Please sign in to comment.