diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index ee7f948a..1ec53288 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -1,7 +1,7 @@ name: ๐Ÿ’œ Pull request on: pull_request: - branches: ['main', 'develop', 'develop/*'] + branches: ["main", "develop", "develop/*"] jobs: linting: @@ -13,11 +13,13 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: ".nvmrc" + cache: "npm" - name: Install dependencies run: npm install - name: Run eslint run: npm run lint + typechecking: name: ๐Ÿ•ต Typechecking needs: linting @@ -28,11 +30,13 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: ".nvmrc" + cache: "npm" - name: Install dependencies run: npm install - name: Run typechecking run: npm run typecheck + testing: name: ๐Ÿงช Testing needs: linting @@ -43,9 +47,9 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: ".nvmrc" + cache: "npm" - name: Install dependencies run: npm install - name: Run tests run: npm run test - \ No newline at end of file diff --git a/app/assets/css/global.css b/app/assets/css/global.css index 865669e4..a3cacbe5 100644 --- a/app/assets/css/global.css +++ b/app/assets/css/global.css @@ -1,7 +1,7 @@ @import 'tailwindcss'; @import 'tw-animate-css'; -@custom-variant dark (&:is(.dark-mode *)); +@custom-variant dark (&:is(.dark *)); @theme inline { --font-geist: "Geist", sans-serif; @@ -119,7 +119,7 @@ --chart-5: hsl(27 87% 67%); } -.dark-mode { +.dark { --background: hsl(240 10% 3.9%); --foreground: hsl(0 0% 98%); --muted: hsl(240 3.7% 15.9%); diff --git a/app/components/animation/Blob.vue b/app/components/animation/Blob.vue deleted file mode 100644 index cb674864..00000000 --- a/app/components/animation/Blob.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/app/components/atoms/Dragon.vue b/app/components/atoms/Dragon.vue index df7e3640..a49c34ff 100644 --- a/app/components/atoms/Dragon.vue +++ b/app/components/atoms/Dragon.vue @@ -33,7 +33,7 @@ function angle(cx: number, cy: number, ex: number, ey: number): number { diff --git a/app/components/atoms/TitleText.vue b/app/components/atoms/TitleText.vue index 20d2b4c4..3effc8f1 100644 --- a/app/components/atoms/TitleText.vue +++ b/app/components/atoms/TitleText.vue @@ -27,7 +27,7 @@ withDefaults( @@ -38,7 +38,7 @@ withDefaults( data-test-button as="div" :initial="{ transform: 'translateX(-50px)', opacity: 0 }" - :in-view="{ transform: 'translateX(0px)', opacity: 1 }" + :while-in-view="{ transform: 'translateX(0px)', opacity: 1 }" :transition="{ delay: 0.2 }" :class="[center ? 'justify-center' : 'justify-start']" class="flex mt-6" diff --git a/app/components/atoms/YbugButton.vue b/app/components/atoms/YbugButton.vue index eecb81a7..ff964bdf 100644 --- a/app/components/atoms/YbugButton.vue +++ b/app/components/atoms/YbugButton.vue @@ -8,7 +8,7 @@ defineProps<{ type: 'menu' | 'footer' }>() :class="{ 'gap-2 w-full cursor-pointer': type === 'menu', }" - @click="($ybug as any)?.open('feedback')" + @click="$ybug?.open('feedback')" > & { type: SupportedActionType } + +function isSupportedActionType(type: Action['type']): type is SupportedActionType { + return (actionType as readonly Action['type'][]).includes(type) +} + +function filterSupportedActions(actions?: Action[] | null): SupportedAction[] { + if (!actions) return [] + + return actions.filter((a): a is SupportedAction => isSupportedActionType(a.type)) +} + const actionInputs = z.array(z.object({ type: z.enum(actionType), name: z.string().min(3).max(30), @@ -69,10 +82,10 @@ const form = useForm({ ac: props.item?.ac || undefined, health: props.item?.health || undefined, link: props.item?.link || '', - actions: props.item?.actions || [], - reactions: props.item?.reactions || [], - legendary_actions: props.item?.legendary_actions || [], - special_abilities: props.item?.special_abilities || [], + actions: filterSupportedActions(props.item?.actions), + reactions: filterSupportedActions(props.item?.reactions), + legendary_actions: filterSupportedActions(props.item?.legendary_actions), + special_abilities: filterSupportedActions(props.item?.special_abilities), }, }) diff --git a/app/components/ui/blur-reveal/BlurReveal.vue b/app/components/ui/blur-reveal/BlurReveal.vue index 44a317a9..36714bfc 100644 --- a/app/components/ui/blur-reveal/BlurReveal.vue +++ b/app/components/ui/blur-reveal/BlurReveal.vue @@ -9,11 +9,11 @@ ref="childElements" as="div" :initial="getInitial()" - :in-view="getAnimate()" + :while-in-view="getAnimate()" :transition="{ duration: props.duration, ease: 'easeInOut', - delay: props.delay * index, + delay: props.delay * Number(index), }" > diff --git a/app/pages/index.vue b/app/pages/index.vue index 50fc3ad0..f897a02b 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -8,7 +8,6 @@ const dragon = ref>()