Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix frontend build #509

Merged
merged 5 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Frontend checks"

on:
merge_group:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
name: Build frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Build frontend
working-directory: ./kitsune-fe
run: nix develop ..#frontend --command bash -c "yarn && yarn build"

lints:
name: Check lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Run linter
working-directory: ./kitsune-fe
run: nix develop ..#frontend --command bash -c "yarn && yarn lint"
2 changes: 1 addition & 1 deletion kitsune-fe/src/components/BaseTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import { ref } from 'vue';
import { DynamicScroller, DynamicScrollerItem } from 'vue-virtual-scroller';

import Post, { Post as PostType } from './Post.vue';
import Post, { Post as PostType } from './PostComponent.vue';

const props = defineProps<{
posts: PostType[];
Expand Down
6 changes: 0 additions & 6 deletions kitsune-fe/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@ import { FluentBundle } from '@fluent/bundle';

import { createFluentVue } from 'fluent-vue';

import enCyberpunkMessages from './locales/en-cyberpunk.ftl';
import enMessages from './locales/en.ftl';

const enBundle = new FluentBundle('en');
enBundle.addResource(enMessages);

const enCyberpunkBundle = new FluentBundle('en-cyberpunk');
enCyberpunkBundle.addResource(enCyberpunkMessages);

const fluent = createFluentVue({
bundles: [enBundle],
Expand Down
4 changes: 3 additions & 1 deletion kitsune-fe/src/views/MessagePage.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<template></template>
<template>
<div class="messages"></div>
</template>

<script lang="ts" setup></script>
4 changes: 3 additions & 1 deletion kitsune-fe/src/views/NotificationPage.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<template></template>
<template>
<div class="notifications"></div>
</template>

<script lang="ts" setup></script>
2 changes: 1 addition & 1 deletion kitsune-fe/src/views/PostPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script lang="ts" setup>
import { useRoute } from 'vue-router';

import Post from '../components/Post.vue';
import Post from '../components/PostComponent.vue';
import { getPostById } from '../graphql/post';

const route = useRoute();
Expand Down
2 changes: 1 addition & 1 deletion kitsune-fe/src/views/timeline/FederatedPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { ref, watch } from 'vue';

import BaseTimeline from '../../components/BaseTimeline.vue';
import { Post } from '../../components/Post.vue';
import { Post } from '../../components/PostComponent.vue';
import { MAX_UUID } from '../../consts';
import { getPublic } from '../../graphql/timeline';

Expand Down
2 changes: 1 addition & 1 deletion kitsune-fe/src/views/timeline/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { ref, watch } from 'vue';

import BaseTimeline from '../../components/BaseTimeline.vue';
import { Post } from '../../components/Post.vue';
import { Post } from '../../components/PostComponent.vue';
import { MAX_UUID } from '../../consts';
import { getHome } from '../../graphql/timeline';

Expand Down
2 changes: 1 addition & 1 deletion kitsune-fe/src/views/timeline/LocalPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { ref, watch } from 'vue';

import BaseTimeline from '../../components/BaseTimeline.vue';
import { Post } from '../../components/Post.vue';
import { Post } from '../../components/PostComponent.vue';
import { MAX_UUID } from '../../consts';
import { getPublic } from '../../graphql/timeline';

Expand Down
4 changes: 4 additions & 0 deletions kitsune-fe/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export default defineConfig({

baseDir: path.resolve('src'),
ftlDir: path.resolve('src/locales'),

getFtlPath(locale) {
return path.join('src/locales', `${locale}.ftl`);
},
}),
],
});
Loading