Skip to content

Commit 75cb87a

Browse files
Update Dependencies to latest versions (#168)
* 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 <[email protected]>
1 parent 5e1efa3 commit 75cb87a

30 files changed

+3948
-4631
lines changed

.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
DIRECTUS_URL="https://your-instance.directus.app"
22
DIRECTUS_TV_URL="https://your-instance.directus.app"
3-
GOOGLE_TAG_MANAGER_ID="GTM-PTLT3GH"
3+
NUXT_PUBLIC_SCRIPTS_GOOGLE_TAG_MANAGER_ID="GTM-PTLT3GH"
44
NUXT_PUBLIC_SITE_URL=https://directus.io
55
POSTHOG_API_KEY="phc_project_api_key"
66
POSTHOG_API_HOST="https://us.i.posthog.com"

.eslintignore

-2
This file was deleted.

.eslintrc.js

-93
This file was deleted.

components/Base/FormGroup.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface Props {
66
hideLabel?: boolean;
77
}
88
9-
const props = withDefaults(defineProps<Props>(), {
9+
withDefaults(defineProps<Props>(), {
1010
required: false,
1111
hideLabel: false,
1212
});

components/Base/HsForm.vue

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const { formId } = toRefs(props);
1818
const { $directus, $readSingleton, $posthog } = useNuxtApp();
1919
2020
declare global {
21+
// eslint-disable-next-line no-var
2122
var hbspt: any;
2223
}
2324

components/Base/Icon.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<script setup lang="ts">
2-
import 'iconify-icon';
3-
42
export interface BaseIconProps {
53
/**
64
* Name of the Material Symbol to use.
@@ -100,8 +98,8 @@ const iconName = computed(() => {
10098
</script>
10199

102100
<template>
103-
<span class="base-icon" :class="size">
104-
<iconify-icon :icon="iconName"></iconify-icon>
101+
<span v-if="iconName" class="base-icon" :class="size">
102+
<Icon :name="iconName" />
105103
</span>
106104
</template>
107105

components/Base/Input.vue

-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ const inputClasses = computed(() => ({
3333
'has-prepend-icon': !!props.prependIcon,
3434
'has-append-icon': !!props.appendIcon,
3535
}));
36-
37-
const { theme } = useTheme();
3836
</script>
3937

4038
<template>

components/Block/Card.vue

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<script setup lang="ts">
22
import type { BlockProps } from './types';
3+
import type { BlockCard, Resource, Page, Team } from '~/types/schema';
4+
import { resourcePermalink } from '~/utils/resourcePermalink';
35
46
const { $directus, $readItem } = useNuxtApp();
57
@@ -20,14 +22,19 @@ interface BlockCardProps extends BlockProps {
2022
iconSize?: 'medium' | 'large';
2123
}
2224
25+
interface ExtendedBlockCard extends BlockCard {
26+
page: Page | null;
27+
resource: Resource | null;
28+
}
29+
2330
const props = withDefaults(defineProps<BlockCardProps>(), {
2431
direction: 'vertical',
2532
mediaStyle: 'image-fill-16-9',
2633
titleSize: 'medium',
2734
iconSize: 'large',
2835
});
2936
30-
const { data: block } = useAsyncData(props.uuid, () =>
37+
const { data: block }: { data: Ref<ExtendedBlockCard> } = useAsyncData(props.uuid, () =>
3138
$directus.request(
3239
$readItem('block_card', props.uuid, {
3340
fields: [
@@ -69,12 +76,12 @@ const { data: block } = useAsyncData(props.uuid, () =>
6976
(block.resource?.date_published
7077
? new Intl.DateTimeFormat('en-US', { dateStyle: 'medium' }).format(
7178
new Date(block.resource!.date_published as string),
72-
)
79+
)
7380
: undefined) ??
7481
undefined
7582
"
76-
:description-avatar="(block.resource?.author?.image as string) ?? undefined"
77-
:to="block.external_url ?? block.page?.permalink ?? resourcePermalink(block.resource as any) ?? undefined"
83+
:description-avatar="((block.resource?.author as Team)?.image as string) ?? undefined"
84+
:to="block.external_url ?? block.page?.permalink ?? resourcePermalink(block.resource as Resource) ?? undefined"
7885
:layout="direction"
7986
:badge="block.badge ?? block.resource?.category ?? undefined"
8087
:title-size="titleSize"

components/Block/CardGroupDynamic.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const { data: cards, pending } = await useAsyncData(
136136
description: start_time
137137
? new Intl.DateTimeFormat('en-US', {
138138
dateStyle: 'medium',
139-
}).format(new Date(start_time))
139+
}).format(new Date(start_time))
140140
: '',
141141
href: link_url ?? undefined,
142142
badge: location?.includes('Online') ? 'Online' : 'In Person',

components/Block/Media.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const { data: block } = useAsyncData(props.uuid, () =>
2929
<BaseMedia
3030
v-if="block"
3131
class="block-media"
32-
:aspect="block.type === 'arcade' ? 'auto' : block.aspect_ratio ?? undefined"
32+
:aspect="block.type === 'arcade' ? 'auto' : (block.aspect_ratio ?? undefined)"
3333
:border="block.border"
3434
:radius="block.border_radius"
3535
:caption="block.caption ?? undefined"

components/Block/Metric.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import type { BlockProps } from './types';
3+
import { resourcePermalink } from '~/utils/resourcePermalink';
34
45
interface BlockMetricGroupProps extends BlockProps {
56
background: 'transparent' | 'pristine-white' | 'simple-gray';
@@ -38,7 +39,7 @@ const component = computed(() => {
3839
:class="`background-${background}`"
3940
:href="
4041
hasLink
41-
? block.external_url ?? block.page?.permalink ?? resourcePermalink(block.resource) ?? undefined
42+
? (block.external_url ?? block.page?.permalink ?? resourcePermalink(block.resource) ?? undefined)
4243
: undefined
4344
"
4445
>

components/Block/Table.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,12 @@ tr {
7878
align-items: baseline;
7979
font-size: 0.6rem;
8080
line-height: 0.6rem;
81+
padding-block: var(--space-2);
8182
8283
@container (width > 20rem) {
8384
font-size: var(--font-size-sm);
8485
line-height: var(--line-height-sm);
8586
}
86-
87-
padding-block: var(--space-2);
8887
}
8988
9089
td,

components/LogoTitle.vue

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import type { File } from '~/types/schema';
3+
import { resourcePermalink } from '~/utils/resourcePermalink';
34
45
export interface LogoTitleProps {
56
logos: {

components/Nav/Footer.vue

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import type { Query } from '@directus/sdk';
33
import type { Navigation, Schema } from '~/types/schema';
4+
import { dynamicAsset } from '~/utils/dynamicAsset';
45
56
const { $directus, $readItem, $readSingleton } = useNuxtApp();
67

components/Nav/Header.vue

+5-6
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,11 @@ watch(() => route.fullPath, resetNavState);
6767
onClickOutside(headerContainer, resetNavState);
6868
6969
const activeSectionTitle = computed(() => {
70-
return unref(menu)?.items?.find(
71-
(item) =>
72-
item.children?.some(
73-
// @TODO remove as {}
74-
(child) => (child.page as { permalink: string })?.permalink === route.path || child.url === route.path,
75-
),
70+
return unref(menu)?.items?.find((item) =>
71+
item.children?.some(
72+
// @TODO remove as {}
73+
(child) => (child.page as { permalink: string })?.permalink === route.path || child.url === route.path,
74+
),
7675
)?.id;
7776
});
7877

components/Tv/TVByline.vue

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import { dynamicAsset } from '~/utils/dynamicAsset';
3+
24
interface BaseBylineProps {
35
name?: string;
46
title?: string;

components/Tv/TVReactions.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,12 @@ onKeyStroke('Escape', () => {
162162
border: none;
163163
cursor: pointer;
164164
padding: var(--space-2);
165+
border-radius: var(--rounded-full);
166+
165167
&:hover {
166168
background: var(--gray-200);
167169
}
168-
border-radius: var(--rounded-full);
170+
169171
&[aria-pressed='true'] {
170172
background: var(--primary-500);
171173
color: var(--white);

0 commit comments

Comments
 (0)