chore: reformat entire project with prettier, add prettierignore

This commit is contained in:
2025-07-16 13:10:28 -05:00
parent 3f2e0fb889
commit 75e5373fd2
31 changed files with 5583 additions and 2055 deletions
+3
View File
@@ -0,0 +1,3 @@
data/
public/img/
public/json/
+20 -20
View File
@@ -10,11 +10,11 @@ A Vue.js and Flask Web Application designed to provide a quick way to search for
## Features ## Features
- Vue.js based, providing fast SPA functionality - Vue.js based, providing fast SPA functionality
- Setup via Vue CLI - Setup via Vue CLI
- Vue Router - Vue Router
- Vue Bootstrap - Vue Bootstrap
- Axios - Axios
- Vue Instantsearch (Algolia) - Vue Instantsearch (Algolia)
- Backend API provided by Flask - Backend API provided by Flask
- Instant Search provided Algolia - Instant Search provided Algolia
- Sleek, responsive design that is easy on the eyes - Sleek, responsive design that is easy on the eyes
@@ -162,11 +162,11 @@ them.
### Running ### Running
- Vue.js can be ran via `npm run serve`. - Vue.js can be ran via `npm run serve`.
- Run this in `./client/`. - Run this in `./client/`.
- Flask can be ran via `flask run`. - Flask can be ran via `flask run`.
- Run this in `./server/`. - Run this in `./server/`.
- Add `--host=0.0.0.0` to the end to allow connections from LAN. - Add `--host=0.0.0.0` to the end to allow connections from LAN.
Note: Readying this application for Production and wider-development is still in progress. Note: Readying this application for Production and wider-development is still in progress.
## Descriptions, Images, Summaries ## Descriptions, Images, Summaries
@@ -204,28 +204,28 @@ be viewed.
Small to-do list to complete. Small to-do list to complete.
- Font Awesome Icons - Font Awesome Icons
- SeasonList Chevron - SeasonList Chevron
- Quote Permalink - Quote Permalink
- Attempt Algolia Query Suggestions - Attempt Algolia Query Suggestions
- Redirect to SearchResults page on Enter press - Redirect to SearchResults page on Enter press
- Process all quote data - Process all quote data
- Site Meta Tags - Site Meta Tags
- Better Mobile Season List - Better Mobile Season List
- Smaller, collapsible? - Smaller, collapsible?
- Heroku Production Deployment - Heroku Production Deployment
- Possible solution via Docker - Possible solution via Docker
- Axios 'Fetch' Error Handling - Axios 'Fetch' Error Handling
- Navigation Bar - Navigation Bar
- Navbar Logo (?) - Navbar Logo (?)
- Overall Responsiveness Improvements - Overall Responsiveness Improvements
- Algolia Clickthrough Events - Algolia Clickthrough Events
- Search Results Page - Search Results Page
- Character List - Character List
- Quote Permalink - Quote Permalink
- Deleted Scenes Marker - Deleted Scenes Marker
- Possible 'Flashback' Scene Marker - Possible 'Flashback' Scene Marker
- Season List Episode Modal Popover - Season List Episode Modal Popover
- Preview Image, Description, Episode Stats - Preview Image, Description, Episode Stats
- Quote Likes Database - Quote Likes Database
- Requires difficult implementation of Flask controlled Postgres database - Requires difficult implementation of Flask controlled Postgres database
- Requires funding, longterm free hosting not possible with database requirements - Requires funding, longterm free hosting not possible with database requirements
+8 -9
View File
@@ -1,24 +1,23 @@
<template> <template>
<div class="image-skeleton" /> <div class="image-skeleton" />
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
export default defineComponent({ export default defineComponent({
name: "ImageSkeleton", name: 'ImageSkeleton',
}); });
</script> </script>
<style lang="scss"> <style lang="scss">
@use "@/scss/_variables.scss" as *; @use '@/scss/_variables.scss' as *;
.image-skeleton { .image-skeleton {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: $gray-400; background-color: $gray-400;
display: block; display: block;
border-radius: 3px; border-radius: 3px;
} }
</style> </style>
+4 -4
View File
@@ -5,7 +5,7 @@
:id="`character-${character_id}`" :id="`character-${character_id}`"
:key="character.name" :key="character.name"
squared squared
class="mx-2 my-1 character-button" class="character-button mx-2 my-1"
size="sm" size="sm"
:title="`${character.appearances} Quote${character.appearances > 1 ? 's' : ''}`" :title="`${character.appearances} Quote${character.appearances > 1 ? 's' : ''}`"
:to="{ name: 'Character', params: { character: character_id } }" :to="{ name: 'Character', params: { character: character_id } }"
@@ -19,8 +19,8 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue' import { defineComponent } from 'vue';
import { BButton, BBadge } from 'bootstrap-vue-next' import { BButton, BBadge } from 'bootstrap-vue-next';
export default defineComponent({ export default defineComponent({
components: { components: {
@@ -34,5 +34,5 @@ export default defineComponent({
required: true, required: true,
}, },
}, },
}) });
</script> </script>
+6 -6
View File
@@ -15,7 +15,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue' import { defineComponent } from 'vue';
export default defineComponent({ export default defineComponent({
name: 'DynamicSpeaker', name: 'DynamicSpeaker',
@@ -28,7 +28,7 @@ export default defineComponent({
computed: { computed: {
texts() { texts() {
return this.text.split(/({[^}]+})/).map((item) => { return this.text.split(/({[^}]+})/).map((item) => {
const id = item.substring(1, item.length - 1) const id = item.substring(1, item.length - 1);
if (item.startsWith('{')) if (item.startsWith('{'))
return { return {
text: this.characters[id], text: this.characters[id],
@@ -36,12 +36,12 @@ export default defineComponent({
name: 'Character', name: 'Character',
params: { character: id }, params: { character: id },
}, },
} };
else return item else return item;
}) });
}, },
}, },
}) });
</script> </script>
<style scoped></style> <style scoped></style>
+20 -20
View File
@@ -8,8 +8,8 @@
@mouseleave="hoverOff" @mouseleave="hoverOff"
@click="toggleExpansion" @click="toggleExpansion"
> >
<BCardText class="mu-2 py-1 mb-1"> <BCardText class="mu-2 mb-1 py-1">
<table v-if="expanded" class="quote-list px-3 py-1 w-100"> <table v-if="expanded" class="quote-list w-100 px-3 py-1">
<tr v-for="(quote, index) in above" :key="`quote-a-${index}`" class="secondary"> <tr v-for="(quote, index) in above" :key="`quote-a-${index}`" class="secondary">
<td class="quote-speaker my-3 pl-3"> <td class="quote-speaker my-3 pl-3">
<div>{{ quote.speaker }}</div> <div>{{ quote.speaker }}</div>
@@ -31,7 +31,7 @@
</td> </td>
</tr> </tr>
</table> </table>
<table v-else class="quote-list px-3 py-1 w-100"> <table v-else class="quote-list w-100 px-3 py-1">
<tr> <tr>
<td class="quote-speaker my-3 pl-3" v-html="item._highlightResult.speaker.value" /> <td class="quote-speaker my-3 pl-3" v-html="item._highlightResult.speaker.value" />
<td class="quote-text w-100 pr-3" v-html="item._highlightResult.text.value" /> <td class="quote-text w-100 pr-3" v-html="item._highlightResult.text.value" />
@@ -39,7 +39,7 @@
</table> </table>
<RouterLink <RouterLink
v-if="expanded" v-if="expanded"
class="no-link search-result-link w-100 text-muted mb-2 ml-2" class="no-link search-result-link text-muted mb-2 ml-2 w-100"
:to="{ :to="{
name: 'Episode', name: 'Episode',
params: { season: item.season, episode: item.episode_rel }, params: { season: item.season, episode: item.episode_rel },
@@ -92,9 +92,9 @@
</style> </style>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue' import { defineComponent } from 'vue';
import axios from 'axios' import axios from 'axios';
export default defineComponent({ export default defineComponent({
props: ['item'], props: ['item'],
@@ -106,29 +106,29 @@ export default defineComponent({
above: null, above: null,
below: null, below: null,
timeoutID: null, timeoutID: null,
} };
}, },
computed: { computed: {
fetched() { fetched() {
return this.above !== null || this.below !== null return this.above !== null || this.below !== null;
}, },
}, },
methods: { methods: {
toggleExpansion() { toggleExpansion() {
this.expanded = !this.expanded this.expanded = !this.expanded;
// if first time expanding, fetch quotes // if first time expanding, fetch quotes
if (!this.fetchQuotes()) { if (!this.fetchQuotes()) {
this.hasExpanded = true this.hasExpanded = true;
// this.fetchQuotes(); // this.fetchQuotes();
} }
}, },
hoverFetch() { hoverFetch() {
if (!this.fetched && !this.fetching) { if (!this.fetched && !this.fetching) {
this.fetching = true this.fetching = true;
this.fetchQuotes() this.fetchQuotes();
this.fetching = false this.fetching = false;
} }
}, },
hoverOn() { hoverOn() {
@@ -137,20 +137,20 @@ export default defineComponent({
}, },
hoverOff() { hoverOff() {
// Hover is off. Unschedule event if it has not already fetched. // Hover is off. Unschedule event if it has not already fetched.
if (this.timeoutID !== null) clearTimeout(this.timeoutID) if (this.timeoutID !== null) clearTimeout(this.timeoutID);
}, },
fetchQuotes() { fetchQuotes() {
const path = `/api/surrounding?season=${this.item.season}&episode=${this.item.episode_rel}&scene=${this.item.section_rel}&quote=${this.item.quote_rel}` const path = `/api/surrounding?season=${this.item.season}&episode=${this.item.episode_rel}&scene=${this.item.section_rel}&quote=${this.item.quote_rel}`;
axios axios
.get(path) .get(path)
.then((res) => { .then((res) => {
this.above = res.data.above this.above = res.data.above;
this.below = res.data.below this.below = res.data.below;
}) })
.catch((error) => { .catch((error) => {
console.error(error) console.error(error);
}) });
}, },
}, },
}) });
</script> </script>
+6 -6
View File
@@ -27,8 +27,8 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { BContainer, BRow } from 'bootstrap-vue-next' import { BContainer, BRow } from 'bootstrap-vue-next';
import { defineComponent } from 'vue' import { defineComponent } from 'vue';
export default defineComponent({ export default defineComponent({
name: 'FooterComponent', name: 'FooterComponent',
@@ -44,16 +44,16 @@ export default defineComponent({
computed: { computed: {
buildTimeString() { buildTimeString() {
return this.buildMoment.format('MMM Do, YYYY [at] h:mm A zz') return this.buildMoment.format('MMM Do, YYYY [at] h:mm A zz');
}, },
buildISOString() { buildISOString() {
return this.buildMoment.toISOString() return this.buildMoment.toISOString();
}, },
latestCommitUrl() { latestCommitUrl() {
return `https://github.com/Xevion/the-office/commit/${import.meta.env.VUE_APP_GIT_HASH}` return `https://github.com/Xevion/the-office/commit/${import.meta.env.VUE_APP_GIT_HASH}`;
}, },
}, },
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
+4 -4
View File
@@ -4,12 +4,12 @@ import {
type AccordionRootEmits, type AccordionRootEmits,
type AccordionRootProps, type AccordionRootProps,
useForwardPropsEmits, useForwardPropsEmits,
} from 'reka-ui' } from 'reka-ui';
const props = defineProps<AccordionRootProps>() const props = defineProps<AccordionRootProps>();
const emits = defineEmits<AccordionRootEmits>() const emits = defineEmits<AccordionRootEmits>();
const forwarded = useForwardPropsEmits(props, emits) const forwarded = useForwardPropsEmits(props, emits);
</script> </script>
<template> <template>
@@ -1,12 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HTMLAttributes } from 'vue' import type { HTMLAttributes } from 'vue';
import { reactiveOmit } from '@vueuse/core' import { reactiveOmit } from '@vueuse/core';
import { AccordionContent, type AccordionContentProps } from 'reka-ui' import { AccordionContent, type AccordionContentProps } from 'reka-ui';
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils';
const props = defineProps<AccordionContentProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<AccordionContentProps & { class?: HTMLAttributes['class'] }>();
const delegatedProps = reactiveOmit(props, 'class') const delegatedProps = reactiveOmit(props, 'class');
</script> </script>
<template> <template>
@@ -1,14 +1,14 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HTMLAttributes } from 'vue' import type { HTMLAttributes } from 'vue';
import { reactiveOmit } from '@vueuse/core' import { reactiveOmit } from '@vueuse/core';
import { AccordionItem, type AccordionItemProps, useForwardProps } from 'reka-ui' import { AccordionItem, type AccordionItemProps, useForwardProps } from 'reka-ui';
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils';
const props = defineProps<AccordionItemProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<AccordionItemProps & { class?: HTMLAttributes['class'] }>();
const delegatedProps = reactiveOmit(props, 'class') const delegatedProps = reactiveOmit(props, 'class');
const forwardedProps = useForwardProps(delegatedProps) const forwardedProps = useForwardProps(delegatedProps);
</script> </script>
<template> <template>
+4 -4
View File
@@ -1,4 +1,4 @@
export { default as Accordion } from './Accordion.vue' export { default as Accordion } from './Accordion.vue';
export { default as AccordionContent } from './AccordionContent.vue' export { default as AccordionContent } from './AccordionContent.vue';
export { default as AccordionItem } from './AccordionItem.vue' export { default as AccordionItem } from './AccordionItem.vue';
export { default as AccordionTrigger } from './AccordionTrigger.vue' export { default as AccordionTrigger } from './AccordionTrigger.vue';
+4 -8
View File
@@ -1,17 +1,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from 'vue' import type { HTMLAttributes } from 'vue';
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes['class'];
}>() }>();
</script> </script>
<template> <template>
<nav <nav aria-label="breadcrumb" data-slot="breadcrumb" :class="props.class">
aria-label="breadcrumb"
data-slot="breadcrumb"
:class="props.class"
>
<slot /> <slot />
</nav> </nav>
</template> </template>
@@ -1,11 +1,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from 'vue' import type { HTMLAttributes } from 'vue';
import { MoreHorizontal } from 'lucide-vue-next' import { MoreHorizontal } from 'lucide-vue-next';
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils';
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes['class'];
}>() }>();
</script> </script>
<template> <template>
@@ -1,17 +1,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from 'vue' import type { HTMLAttributes } from 'vue';
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils';
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes['class'];
}>() }>();
</script> </script>
<template> <template>
<li <li data-slot="breadcrumb-item" :class="cn('inline-flex items-center gap-1.5', props.class)">
data-slot="breadcrumb-item"
:class="cn('inline-flex items-center gap-1.5', props.class)"
>
<slot /> <slot />
</li> </li>
</template> </template>
@@ -1,11 +1,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from 'vue' import type { HTMLAttributes } from 'vue';
import { Primitive, type PrimitiveProps } from 'reka-ui' import { Primitive, type PrimitiveProps } from 'reka-ui';
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils';
const props = withDefaults(defineProps<PrimitiveProps & { class?: HTMLAttributes['class'] }>(), { const props = withDefaults(defineProps<PrimitiveProps & { class?: HTMLAttributes['class'] }>(), {
as: 'a', as: 'a',
}) });
</script> </script>
<template> <template>
@@ -1,16 +1,21 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from 'vue' import type { HTMLAttributes } from 'vue';
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils';
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes['class'];
}>() }>();
</script> </script>
<template> <template>
<ol <ol
data-slot="breadcrumb-list" data-slot="breadcrumb-list"
:class="cn('text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5', props.class)" :class="
cn(
'text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5',
props.class,
)
"
> >
<slot /> <slot />
</ol> </ol>
@@ -1,10 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from 'vue' import type { HTMLAttributes } from 'vue';
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils';
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes['class'];
}>() }>();
</script> </script>
<template> <template>
@@ -1,11 +1,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from 'vue' import type { HTMLAttributes } from 'vue';
import { ChevronRight } from 'lucide-vue-next' import { ChevronRight } from 'lucide-vue-next';
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils';
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes['class'];
}>() }>();
</script> </script>
<template> <template>
+7 -7
View File
@@ -1,7 +1,7 @@
export { default as Breadcrumb } from './Breadcrumb.vue' export { default as Breadcrumb } from './Breadcrumb.vue';
export { default as BreadcrumbEllipsis } from './BreadcrumbEllipsis.vue' export { default as BreadcrumbEllipsis } from './BreadcrumbEllipsis.vue';
export { default as BreadcrumbItem } from './BreadcrumbItem.vue' export { default as BreadcrumbItem } from './BreadcrumbItem.vue';
export { default as BreadcrumbLink } from './BreadcrumbLink.vue' export { default as BreadcrumbLink } from './BreadcrumbLink.vue';
export { default as BreadcrumbList } from './BreadcrumbList.vue' export { default as BreadcrumbList } from './BreadcrumbList.vue';
export { default as BreadcrumbPage } from './BreadcrumbPage.vue' export { default as BreadcrumbPage } from './BreadcrumbPage.vue';
export { default as BreadcrumbSeparator } from './BreadcrumbSeparator.vue' export { default as BreadcrumbSeparator } from './BreadcrumbSeparator.vue';
+3 -3
View File
@@ -1,6 +1,6 @@
import { type ClassValue, clsx } from 'clsx' import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge' import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) { export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs)) return twMerge(clsx(inputs));
} }
-1
View File
@@ -54,7 +54,6 @@ export default defineComponent({
<style scoped></style> --> <style scoped></style> -->
<script setup lang="ts"></script> <script setup lang="ts"></script>
<template> <template>
<div> <div>
-1
View File
@@ -106,7 +106,6 @@ export default defineComponent({
}); });
</script> --> </script> -->
<script setup lang="ts"></script> <script setup lang="ts"></script>
<template> <template>
<div> <div>
-1
View File
@@ -137,7 +137,6 @@ export default defineComponent({
</script> </script>
--> -->
<script setup lang="ts"></script> <script setup lang="ts"></script>
<template> <template>
<div> <div>
-1
View File
@@ -104,7 +104,6 @@ export default defineComponent({
}) })
</script> --> </script> -->
<script setup lang="ts"></script> <script setup lang="ts"></script>
<template> <template>
<div> <div>
-1
View File
@@ -5,7 +5,6 @@
// @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap"); // @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap");
// @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap"); // @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap");
// $grid-breakpoints: ( // $grid-breakpoints: (
// xs: 0, // xs: 0,
// sm: 456px, // sm: 456px,
+1 -1
View File
@@ -17,4 +17,4 @@
"lib": "@/lib" "lib": "@/lib"
}, },
"iconLibrary": "lucide" "iconLibrary": "lucide"
} }
+4 -4
View File
@@ -1,4 +1,4 @@
import tailwindcss from "@tailwindcss/vite"; import tailwindcss from '@tailwindcss/vite';
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
@@ -14,7 +14,7 @@ export default defineNuxtConfig({
'@nuxt/eslint', '@nuxt/eslint',
'@nuxt/image', '@nuxt/image',
'shadcn-nuxt', 'shadcn-nuxt',
'@pinia/nuxt' '@pinia/nuxt',
], ],
shadcn: { shadcn: {
prefix: '', prefix: '',
@@ -22,5 +22,5 @@ export default defineNuxtConfig({
}, },
typescript: { typescript: {
typeCheck: true, typeCheck: true,
} },
}) });
+3 -1
View File
@@ -9,7 +9,9 @@
"dev": "nuxt dev", "dev": "nuxt dev",
"generate": "nuxt generate", "generate": "nuxt generate",
"preview": "nuxt preview", "preview": "nuxt preview",
"postinstall": "nuxt prepare" "postinstall": "nuxt prepare",
"format": "prettier --write .",
"lint": "eslint --fix ."
}, },
"dependencies": { "dependencies": {
"@fontsource-variable/roboto-slab": "^5.2.6", "@fontsource-variable/roboto-slab": "^5.2.6",
+5433 -1902
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1,6 +1,6 @@
import { type ClassValue, clsx } from 'clsx' import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge' import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) { export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs)) return twMerge(clsx(inputs));
} }
+4 -4
View File
@@ -1,6 +1,6 @@
import { fileURLToPath } from 'node:url' import { fileURLToPath } from 'node:url';
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config' import { mergeConfig, defineConfig, configDefaults } from 'vitest/config';
import viteConfig from './vite.config' import viteConfig from './vite.config';
export default mergeConfig( export default mergeConfig(
viteConfig, viteConfig,
@@ -11,4 +11,4 @@ export default mergeConfig(
root: fileURLToPath(new URL('./', import.meta.url)), root: fileURLToPath(new URL('./', import.meta.url)),
}, },
}), }),
) );