From 529b5182e0e71a63ad6a9d95875dc442100e1972 Mon Sep 17 00:00:00 2001 From: taskylizard <75871323+taskylizard@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:40:49 +0530 Subject: [PATCH] fix build issues --- .vitepress/config.mts | 30 +- .vitepress/constants.ts | 21 +- .vitepress/theme/components/Feedback.vue | 22 +- .vitepress/theme/components/Feedback2.vue | 132 ++ DEVTools.md | 4 +- eslint.config.js | 6 + package.json | 3 + pnpm-lock.yaml | 2223 ++++++++++++++++++++- 8 files changed, 2363 insertions(+), 78 deletions(-) create mode 100644 .vitepress/theme/components/Feedback2.vue create mode 100644 eslint.config.js diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 48b16335b..14328b7a7 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -1,10 +1,10 @@ +import { fileURLToPath } from "node:url"; import { defineConfig } from "vitepress"; import { withPwa } from "@vite-pwa/vitepress"; import UnoCSS from "unocss/vite"; import { presetUno, presetAttributify, presetIcons } from "unocss"; -import { commitRef, meta } from "./constants"; +import { commitRef, meta, socials } from "./constants"; import { pwa } from "./pwa"; -import { fileURLToPath } from "url"; import { generateImages, generateMeta } from "./hooks"; import { toggleStarredPlugin } from "./markdown/toggleStarred"; import { base64DecodePlugin } from "./markdown/base64"; @@ -43,6 +43,17 @@ export default defineConfig({ vite: { plugins: [ UnoCSS({ + theme: { + colors: { + primary: "var(--vp-c-brand-1)", + bg: "var(--vp-c-bg)", + "bg-alt": "var(--vp-c-bg-alt)", + "bg-elv": "var(--vp-c-bg-elv)", + text: "var(--vp-c-text-1)", + "text-2": "var(--vp-c-text-2)", + div: "var(--vp-c-divider)", + }, + }, presets: [ presetUno(), presetAttributify(), @@ -58,7 +69,7 @@ export default defineConfig({ ], build: { // Shut the fuck up - chunkSizeWarningLimit: Infinity, + chunkSizeWarningLimit: Number.POSITIVE_INFINITY, }, resolve: { alias: [ @@ -80,7 +91,7 @@ export default defineConfig({ themeConfig: { search: { options: { - miniSearch: { searchOptions: {combineWith: "AND"} }, + miniSearch: { searchOptions: { combineWith: "AND" } }, detailedView: true, }, provider: "local", @@ -119,16 +130,7 @@ export default defineConfig({ { text: "🔑 Base64", link: "/base64" }, { text: "📦 Storage", link: "/storage" }, ], - socialLinks: [ - { icon: "github", link: "https://github.com/fmhy/FMHYEdit" }, - { icon: "discord", link: "https://discord.gg/Stz6y6NgNg" }, - { - icon: { - svg: '', - }, - link: "https://reddit.com/r/FREEMEDIAHECKYEAH", - }, - ], + socialLinks: socials, ...pwa, }, }); diff --git a/.vitepress/constants.ts b/.vitepress/constants.ts index 655f9dc96..f4b15cb3f 100644 --- a/.vitepress/constants.ts +++ b/.vitepress/constants.ts @@ -1,8 +1,9 @@ +import type { DefaultTheme } from "vitepress"; + export const meta = { name: "FreeMediaHeckYeah", - description: - "The largest collection of free stuff on the internet!", - hostname: process.env.COMMIT_REF ? "https://fmhy.netlify.app" : "https://fmhy.pages.dev", + description: "The largest collection of free stuff on the internet!", + hostname: process.env.CF_PAGES ? "https://fmhy.pages.dev" : "https://fmhy.netlify.app", keywords: ["stream", "movies", "gaming", "reading", "anime"], }; @@ -10,7 +11,19 @@ export const meta = { export const commitRef = process.env.COMMIT_REF ? `${process.env.COMMIT_REF.slice(0, 8)}` - : process.env.CF_PAGES_COMMIT_SHA + : process.env.CF_PAGES ? `${process.env.CF_PAGES_COMMIT_SHA.slice(0, 8)}` : "dev"; + +export const socials: DefaultTheme.SocialLink[] = [ + { icon: "github", link: "https://github.com/fmhy/FMHYEdit" }, + { icon: "discord", link: "https://discord.gg/Stz6y6NgNg" }, + { + icon: { + svg: '', + }, + ariaLabel: "Reddit", + link: "https://reddit.com/r/FREEMEDIAHECKYEAH", + }, +]; diff --git a/.vitepress/theme/components/Feedback.vue b/.vitepress/theme/components/Feedback.vue index 6891807c4..50680c870 100644 --- a/.vitepress/theme/components/Feedback.vue +++ b/.vitepress/theme/components/Feedback.vue @@ -2,6 +2,7 @@ import { reactive, ref } from "vue"; import { useRoute } from "vitepress"; import type { FeedbackType } from "../../types/Feedback"; +import { fetcher } from "itty-fetcher"; const loading = ref(false); const error = ref(null); @@ -69,18 +70,21 @@ async function handleSubmit(type?: FeedbackType["type"]) {
-
+

Feedback

- +
-
+

The wiki is... • {{ path }}

@@ -88,12 +92,16 @@ async function handleSubmit(type?: FeedbackType["type"]) { -
+