diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cdd38ef..a9da0969 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,13 @@ jobs: steps: - uses: actions/checkout@v4 - - run: corepack enable - - uses: actions/setup-node@v4 + # workaround for npm registry key change + # ref. `pnpm@10.1.0` / `pnpm@9.15.4` cannot be installed due to key id mismatch · Issue #612 · nodejs/corepack + # - https://github.com/nodejs/corepack/issues/612#issuecomment-2629496091 + - run: npm i -g corepack@latest && corepack enable + - uses: actions/setup-node@v4.4.0 with: - node-version: 20 - cache: pnpm + node-version-file: .nvmrc - name: 📦 Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b99de717..b733190d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - name: Set node uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .nvmrc - run: npx changelogithub env: diff --git a/.nvmrc b/.nvmrc index 2edeafb0..8fdd954d 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20 \ No newline at end of file +22 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d14790f7..5e2f3b32 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,19 +6,13 @@ Refer also to https://github.com/antfu/contribute. For guidelines on contributing to the documentation, refer to the [docs README](./docs/README.md). -### Online - -You can use [StackBlitz Codeflow](https://stackblitz.com/codeflow) to fix bugs or implement features. You'll also see a Codeflow button on PRs to review them without a local setup. Once the elk repo has been cloned in Codeflow, the dev server will start automatically and print the URL to open the App. You should receive a prompt in the bottom-right suggesting to open it in the Editor or in another Tab. To learn more, check out the [Codeflow docs](https://developer.stackblitz.com/codeflow/what-is-codeflow). - -[![Open in Codeflow](https://developer.stackblitz.com/img/open_in_codeflow.svg)](https://pr.new/elk-zone/elk) - ### Local Setup To develop and test the Elk package: 1. Fork the Elk repository to your own GitHub account and then clone it to your local device. -2. Ensure using the latest Node.js (20.x). +2. Ensure using the LTS version of Node.js. If you have [nvm](https://github.com/nvm-sh/nvm), you can run `nvm i` to install the required version. 3. The package manager used to install and link dependencies must be [pnpm](https://pnpm.io/) v9. To use it you must first enable [Corepack](https://github.com/nodejs/corepack) by running `corepack enable`. (Note: on Linux in a standard Node 20+ environment, you should follow the instructions to install via Node's `corepack` rather than using the `curl` command) @@ -92,7 +86,7 @@ We've added some `UnoCSS` utilities styles to help you with that: We are using [vue-i18n](https://vue-i18n.intlify.dev/) via [nuxt-i18n](https://i18n.nuxtjs.org/) to handle internationalization. -You can check the current [translation status](https://docs.elk.zone/docs/guide/contributing#translation-status): more instructions on the table caption. +You can check the current [translation status](https://docs.elk.zone/guide/contributing#translation-status): more instructions on the table caption. If you are updating a translation in your local environment, you can run the following commands to check the status: - from root folder: `nr prepare-translation-status` diff --git a/Dockerfile b/Dockerfile index dee00724..64974e1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,10 @@ WORKDIR /elk FROM base AS builder # Prepare pnpm https://pnpm.io/installation#using-corepack -RUN corepack enable +# workaround for npm registry key change +# ref. `pnpm@10.1.0` / `pnpm@9.15.4` cannot be installed due to key id mismatch · Issue #612 · nodejs/corepack +# - https://github.com/nodejs/corepack/issues/612#issuecomment-2629496091 +RUN npm i -g corepack@latest && corepack enable # Prepare deps RUN apk update diff --git a/README.md b/README.md index 3519538c..3d90a5da 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ A nimble Mastodon web client

discord chat - Start new PR in StackBlitz Codeflow Open board on Volta


@@ -56,6 +55,7 @@ One could put Elk behind popular reverse proxies with SSL Handling like Traefik, These are known deployments using Elk as an alternative Web client for Mastodon servers or as a base for other projects in the fediverse: - [elk.fedified.com](https://elk.fedified.com) - Use Elk to log into any compatible instance +- [elk.mastodon.com.pl](https://elk.mastodon.com.pl) - Use Elk for the `mastodon.com.pl` Server - [elk.me.uk](https://elk.me.uk) - Use Elk to log into any compatible instance, hosted on Google Cloud Run with no Cloudflare proxy - [elk.h4.io](https://elk.h4.io) - Use Elk for the `h4.io` Server - [elk.universeodon.com](https://elk.universeodon.com) - Use Elk for the Universeodon Server @@ -104,12 +104,6 @@ We would also appreciate sponsoring other contributors to the Elk project. If so We're really excited that you're interested in contributing to Elk! Before submitting your contribution, please read through the following guide. -### Online - -You can use [StackBlitz Codeflow](https://stackblitz.com/codeflow) to fix bugs or implement features. You'll also see a Codeflow button on PRs to review them without a local setup. Once the elk repo has been cloned in Codeflow, the dev server will start automatically and print the URL to open the App. You should receive a prompt in the bottom-right suggesting to open it in the Editor or in another Tab. To learn more, check out the [Codeflow docs](https://developer.stackblitz.com/codeflow/what-is-codeflow). - -[![Open in Codeflow](https://developer.stackblitz.com/img/open_in_codeflow.svg)](https://pr.new/elk-zone/elk) - ### Local Setup Clone the repository and run on the root folder: diff --git a/components/account/AccountAvatar.vue b/components/account/AccountAvatar.vue index 823411ac..195a9d44 100644 --- a/components/account/AccountAvatar.vue +++ b/components/account/AccountAvatar.vue @@ -1,7 +1,7 @@ diff --git a/components/status/StatusPreviewCardNormal.vue b/components/status/StatusPreviewCardNormal.vue index 98edce20..c79b3817 100644 --- a/components/status/StatusPreviewCardNormal.vue +++ b/components/status/StatusPreviewCardNormal.vue @@ -1,7 +1,7 @@ diff --git a/components/status/edit/StatusEditPreview.vue b/components/status/edit/StatusEditPreview.vue index c0bc3496..f16fe76c 100644 --- a/components/status/edit/StatusEditPreview.vue +++ b/components/status/edit/StatusEditPreview.vue @@ -1,7 +1,7 @@ diff --git a/components/tag/TagCardPaginator.vue b/components/tag/TagCardPaginator.vue index a00a6bb6..fe0988da 100644 --- a/components/tag/TagCardPaginator.vue +++ b/components/tag/TagCardPaginator.vue @@ -1,7 +1,7 @@ diff --git a/components/timeline/TimelineHome.vue b/components/timeline/TimelineHome.vue index a3a4cf46..2c35fcf8 100644 --- a/components/timeline/TimelineHome.vue +++ b/components/timeline/TimelineHome.vue @@ -10,12 +10,17 @@ const stream = useStreaming(client => client.user.subscribe()) function reorderAndFilter(items: mastodon.v1.Status[]) { return reorderedTimeline(items, 'home') } + +let followedTags: mastodon.v1.Tag[] | undefined +if (currentUser.value !== undefined) { + followedTags = (await useMasto().client.value.v1.followedTags.list({ limit: 0 })) +} diff --git a/components/timeline/TimelinePaginator.vue b/components/timeline/TimelinePaginator.vue index c9a400a8..cdb9a05d 100644 --- a/components/timeline/TimelinePaginator.vue +++ b/components/timeline/TimelinePaginator.vue @@ -4,11 +4,12 @@ import type { mastodon } from 'masto' import { DynamicScrollerItem } from 'vue-virtual-scroller' import 'vue-virtual-scroller/dist/vue-virtual-scroller.css' -const { paginator, stream, account, buffer = 10, endMessage = true } = defineProps<{ +const { account, buffer = 10, endMessage = true, followedTags = [] } = defineProps<{ paginator: mastodon.Paginator stream?: mastodon.streaming.Subscription context?: mastodon.v2.FilterContext account?: mastodon.v1.Account + followedTags?: mastodon.v1.Tag[] preprocess?: (items: mastodon.v1.Status[]) => mastodon.v1.Status[] buffer?: number endMessage?: boolean | string @@ -20,6 +21,12 @@ const virtualScroller = usePreferences('experimentalVirtualScroller') const showOriginSite = computed(() => account && account.id !== currentUser.value?.account.id && getServerName(account) !== currentServer.value, ) + +function getFollowedTag(status: mastodon.v1.Status): string | null { + const followedTagNames = followedTags.map(tag => tag.name) + const followedStatusTags = status.tags.filter(tag => followedTagNames.includes(tag.name)) + return followedStatusTags.length > 0 ? followedStatusTags[0]?.name : null +}