Skip to content

Commit

Permalink
Update Dependencies to latest versions (#168)
Browse files Browse the repository at this point in the history
* reorder css declarations per sass rules

* fix operator

* move to nuxt-icon with v1 release

* explictly import utils to appease TS

* explicitly type clients

* more util imports

* css changes

* Update Google Tag Manager ID in .env.example

* Refactor code-highlighter.post.ts to use createHighlighter instead of getHighlighter

* update dependencies to latest versions

* add back vue to package.json

* bump typescript and eslint back

* flat config test

* lint ignore

* fix ignore settings

* lint fixes

* fix hsform

---------

Co-authored-by: Alexandre Chopin <contact@alexchopin.com>
  • Loading branch information
bryantgillespie and alexchopin authored Sep 12, 2024
1 parent 5e1efa3 commit 75cb87a
Show file tree
Hide file tree
Showing 30 changed files with 3,948 additions and 4,631 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DIRECTUS_URL="https://your-instance.directus.app"
DIRECTUS_TV_URL="https://your-instance.directus.app"
GOOGLE_TAG_MANAGER_ID="GTM-PTLT3GH"
NUXT_PUBLIC_SCRIPTS_GOOGLE_TAG_MANAGER_ID="GTM-PTLT3GH"
NUXT_PUBLIC_SITE_URL=https://directus.io
POSTHOG_API_KEY="phc_project_api_key"
POSTHOG_API_HOST="https://us.i.posthog.com"
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

93 changes: 0 additions & 93 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion components/Base/FormGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Props {
hideLabel?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
withDefaults(defineProps<Props>(), {
required: false,
hideLabel: false,
});
Expand Down
1 change: 1 addition & 0 deletions components/Base/HsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const { formId } = toRefs(props);
const { $directus, $readSingleton, $posthog } = useNuxtApp();
declare global {
// eslint-disable-next-line no-var
var hbspt: any;
}
Expand Down
6 changes: 2 additions & 4 deletions components/Base/Icon.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import 'iconify-icon';
export interface BaseIconProps {
/**
* Name of the Material Symbol to use.
Expand Down Expand Up @@ -100,8 +98,8 @@ const iconName = computed(() => {
</script>

<template>
<span class="base-icon" :class="size">
<iconify-icon :icon="iconName"></iconify-icon>
<span v-if="iconName" class="base-icon" :class="size">
<Icon :name="iconName" />
</span>
</template>

Expand Down
2 changes: 0 additions & 2 deletions components/Base/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ const inputClasses = computed(() => ({
'has-prepend-icon': !!props.prependIcon,
'has-append-icon': !!props.appendIcon,
}));
const { theme } = useTheme();
</script>

<template>
Expand Down
15 changes: 11 additions & 4 deletions components/Block/Card.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script setup lang="ts">
import type { BlockProps } from './types';
import type { BlockCard, Resource, Page, Team } from '~/types/schema';
import { resourcePermalink } from '~/utils/resourcePermalink';
const { $directus, $readItem } = useNuxtApp();
Expand All @@ -20,14 +22,19 @@ interface BlockCardProps extends BlockProps {
iconSize?: 'medium' | 'large';
}
interface ExtendedBlockCard extends BlockCard {
page: Page | null;
resource: Resource | null;
}
const props = withDefaults(defineProps<BlockCardProps>(), {
direction: 'vertical',
mediaStyle: 'image-fill-16-9',
titleSize: 'medium',
iconSize: 'large',
});
const { data: block } = useAsyncData(props.uuid, () =>
const { data: block }: { data: Ref<ExtendedBlockCard> } = useAsyncData(props.uuid, () =>
$directus.request(
$readItem('block_card', props.uuid, {
fields: [
Expand Down Expand Up @@ -69,12 +76,12 @@ const { data: block } = useAsyncData(props.uuid, () =>
(block.resource?.date_published
? new Intl.DateTimeFormat('en-US', { dateStyle: 'medium' }).format(
new Date(block.resource!.date_published as string),
)
)
: undefined) ??
undefined
"
:description-avatar="(block.resource?.author?.image as string) ?? undefined"
:to="block.external_url ?? block.page?.permalink ?? resourcePermalink(block.resource as any) ?? undefined"
:description-avatar="((block.resource?.author as Team)?.image as string) ?? undefined"
:to="block.external_url ?? block.page?.permalink ?? resourcePermalink(block.resource as Resource) ?? undefined"
:layout="direction"
:badge="block.badge ?? block.resource?.category ?? undefined"
:title-size="titleSize"
Expand Down
2 changes: 1 addition & 1 deletion components/Block/CardGroupDynamic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const { data: cards, pending } = await useAsyncData(
description: start_time
? new Intl.DateTimeFormat('en-US', {
dateStyle: 'medium',
}).format(new Date(start_time))
}).format(new Date(start_time))
: '',
href: link_url ?? undefined,
badge: location?.includes('Online') ? 'Online' : 'In Person',
Expand Down
2 changes: 1 addition & 1 deletion components/Block/Media.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const { data: block } = useAsyncData(props.uuid, () =>
<BaseMedia
v-if="block"
class="block-media"
:aspect="block.type === 'arcade' ? 'auto' : block.aspect_ratio ?? undefined"
:aspect="block.type === 'arcade' ? 'auto' : (block.aspect_ratio ?? undefined)"
:border="block.border"
:radius="block.border_radius"
:caption="block.caption ?? undefined"
Expand Down
3 changes: 2 additions & 1 deletion components/Block/Metric.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { BlockProps } from './types';
import { resourcePermalink } from '~/utils/resourcePermalink';
interface BlockMetricGroupProps extends BlockProps {
background: 'transparent' | 'pristine-white' | 'simple-gray';
Expand Down Expand Up @@ -38,7 +39,7 @@ const component = computed(() => {
:class="`background-${background}`"
:href="
hasLink
? block.external_url ?? block.page?.permalink ?? resourcePermalink(block.resource) ?? undefined
? (block.external_url ?? block.page?.permalink ?? resourcePermalink(block.resource) ?? undefined)
: undefined
"
>
Expand Down
3 changes: 1 addition & 2 deletions components/Block/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@ tr {
align-items: baseline;
font-size: 0.6rem;
line-height: 0.6rem;
padding-block: var(--space-2);
@container (width > 20rem) {
font-size: var(--font-size-sm);
line-height: var(--line-height-sm);
}
padding-block: var(--space-2);
}
td,
Expand Down
1 change: 1 addition & 0 deletions components/LogoTitle.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { File } from '~/types/schema';
import { resourcePermalink } from '~/utils/resourcePermalink';
export interface LogoTitleProps {
logos: {
Expand Down
1 change: 1 addition & 0 deletions components/Nav/Footer.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { Query } from '@directus/sdk';
import type { Navigation, Schema } from '~/types/schema';
import { dynamicAsset } from '~/utils/dynamicAsset';
const { $directus, $readItem, $readSingleton } = useNuxtApp();
Expand Down
11 changes: 5 additions & 6 deletions components/Nav/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ watch(() => route.fullPath, resetNavState);
onClickOutside(headerContainer, resetNavState);
const activeSectionTitle = computed(() => {
return unref(menu)?.items?.find(
(item) =>
item.children?.some(
// @TODO remove as {}
(child) => (child.page as { permalink: string })?.permalink === route.path || child.url === route.path,
),
return unref(menu)?.items?.find((item) =>
item.children?.some(
// @TODO remove as {}
(child) => (child.page as { permalink: string })?.permalink === route.path || child.url === route.path,
),
)?.id;
});
Expand Down
2 changes: 2 additions & 0 deletions components/Tv/TVByline.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup lang="ts">
import { dynamicAsset } from '~/utils/dynamicAsset';
interface BaseBylineProps {
name?: string;
title?: string;
Expand Down
4 changes: 3 additions & 1 deletion components/Tv/TVReactions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,12 @@ onKeyStroke('Escape', () => {
border: none;
cursor: pointer;
padding: var(--space-2);
border-radius: var(--rounded-full);
&:hover {
background: var(--gray-200);
}
border-radius: var(--rounded-full);
&[aria-pressed='true'] {
background: var(--primary-500);
color: var(--white);
Expand Down
Loading

0 comments on commit 75cb87a

Please sign in to comment.