Skip to content

Commit

Permalink
Merge branch 'RSSNext:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdy-tech-com-gitub authored Oct 1, 2024
2 parents 401d0ec + 7881f23 commit a6bb37f
Show file tree
Hide file tree
Showing 178 changed files with 4,201 additions and 2,998 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ contact_links:
- name: 💬 Follow's Discord Server
url: https://discord.gg/tUDVZjEr
about: Want to discuss / chat with the community? Here you go!
- name: Discuss an issue
url: https://github.com/RSSNext/Follow/discussions
about: For general questions, ideas, or non-bug related discussions, please use GitHub Discussions.
4 changes: 0 additions & 4 deletions .github/workflows/auto-fix-lint-format-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ jobs:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: AutoCorrect
if: runner.os == 'Linux'
uses: huacnlee/autocorrect-action@main

- name: Setup pnpm
uses: pnpm/action-setup@v4

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ jobs:
fetch-depth: 1
lfs: true

- name: AutoCorrect
if: runner.os == 'Linux'
uses: huacnlee/autocorrect-action@main

- name: Setup pnpm
uses: pnpm/action-setup@v4

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ jobs:
- name: Checkout LFS objects
run: git lfs checkout

- name: AutoCorrect
if: runner.os == 'Linux'
uses: huacnlee/autocorrect-action@main

- uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
Expand Down
47 changes: 14 additions & 33 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,7 @@ env:
NODE_OPTIONS: --max-old-space-size=8192

jobs:
check-for-changes:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check.outputs.should_run }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for code changes
id: check
run: |
git diff --quiet @{1.day.ago} HEAD -- ':!.github' || echo "should_run=true" >> $GITHUB_OUTPUT
nightly-release:
needs: check-for-changes
if: needs.check-for-changes.outputs.should_run == 'true'
runs-on: ${{ matrix.os }}

strategy:
Expand Down Expand Up @@ -107,25 +92,20 @@ jobs:
shell: bash
run: |
# Get the current version from package.json
if [ -f package.json ]; then
CURRENT_VERSION=$(node -p "require('./package.json').version")
# Remove any existing prerelease identifier (e.g., -alpha.1)
BASE_VERSION=$(echo $CURRENT_VERSION | sed -E 's/(-[a-zA-Z]+\.[0-9]+)$//')
# Generate the nightly version
NIGHTLY_DATE=$(date +'%Y%m%d')
NIGHTLY_VERSION="${BASE_VERSION}-nightly.${NIGHTLY_DATE}"
echo "NIGHTLY_VERSION=$NIGHTLY_VERSION" >> $GITHUB_ENV
# Update version in package.json
if [[ "$RUNNER_OS" == "Windows" ]]; then
sed -i "s/\"version\": \".*\"/\"version\": \"$NIGHTLY_VERSION\"/" package.json
else
sed -i '' "s/\"version\": \".*\"/\"version\": \"$NIGHTLY_VERSION\"/" package.json
fi
echo "Updated version to $NIGHTLY_VERSION"
CURRENT_VERSION=$(node -p "require('./package.json').version")
# Remove any existing prerelease identifier (e.g., -alpha.1)
BASE_VERSION=$(echo $CURRENT_VERSION | sed -E 's/(-[a-zA-Z]+\.[0-9]+)$//')
# Generate the nightly version
NIGHTLY_DATE=$(date +'%Y%m%d')
NIGHTLY_VERSION="${BASE_VERSION}-nightly.${NIGHTLY_DATE}"
echo "NIGHTLY_VERSION=$NIGHTLY_VERSION" >> $GITHUB_ENV
# Update version in package.json
if [[ "$RUNNER_OS" == "Windows" ]]; then
sed -i "s/\"version\": \".*\"/\"version\": \"$NIGHTLY_VERSION\"/" package.json
else
echo "package.json not found"
exit 1
sed -i '' "s/\"version\": \".*\"/\"version\": \"$NIGHTLY_VERSION\"/" package.json
fi
echo "Updated version to $NIGHTLY_VERSION"
- name: Build
if: matrix.os != 'macos-latest'
Expand Down Expand Up @@ -171,6 +151,7 @@ jobs:
name: Nightly ${{ env.NIGHTLY_VERSION }}
draft: false
prerelease: true
tag_name: nightly-${{ env.NIGHTLY_VERSION }}
files: |
out/make/**/*.dmg
out/make/**/*.zip
Expand All @@ -179,7 +160,7 @@ jobs:
out/make/**/*.yml
body: |
This is an automated nightly release for testing purposes.
Version: ${{ env.NIGHTLY_VERSION }}
Version: 0.0.0-nightly.${{ env.NIGHTLY_VERSION }}
**Warning:** This build may be unstable and is not recommended for production use.
env:
Expand Down
65 changes: 64 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ If you have access, you are welcome to use the following methods to download and

If you are eligible to use Follow, you are welcome to join the open source community to build together.

Before you start, you need to install pnpm and then use it to install dependencies:
Before you start, make sure you have enabled [Corepack](https://nodejs.org/api/corepack.html). Corepack makes sure you are using the correct version (`packageManager` field in `package.json`) for package manager when you run corresponding commands.

```sh
corepack enable
```

Install dependencies.

```sh
pnpm install
Expand Down
7 changes: 3 additions & 4 deletions apps/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,16 @@
"msedge-tts": "1.3.4",
"nanoid": "5.0.7",
"ofetch": "1.4.0",
"posthog-js": "1.163.0",
"posthog-js": "1.165.0",
"posthog-node": "4.2.0",
"semver": "7.6.3",
"vscode-languagedetection": "npm:@vscode/vscode-languagedetection@^1.0.22"
},
"devDependencies": {
"@types/lodash-es": "4.17.12",
"@types/node": "^22.5.5",
"@types/node": "^22.7.4",
"electron": "32.1.2",
"electron-devtools-installer": "3.2.0",
"hono": "4.6.2",
"typescript": "^5.6.2"
"hono": "4.6.3"
}
}
7 changes: 4 additions & 3 deletions apps/main/src/lib/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ export const handleUrlRouting = (url: string) => {
mainWindow.focus()
const caller = callWindowExpose(mainWindow)

const id = searchParams.get("id")
const id = searchParams.get("id") ?? undefined
const isList = searchParams.get("type") === "list"
if (!id) return
caller.follow(id, { isList })
const urlParam = searchParams.get("url") ?? undefined
if (!id && !urlParam) return
caller.follow({ isList, id, url: urlParam })
return
}
default: {
Expand Down
4 changes: 4 additions & 0 deletions apps/main/src/tipc/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface ActionMenuItem {
shortcut?: string
icon?: string
submenu?: MenuItem[]
checked?: boolean
}
export const menuRoute = {
showContextMenu: t.procedure
Expand All @@ -28,10 +29,13 @@ export const menuRoute = {
type: "separator" as const,
}
}

return {
label: item.label,
enabled: item.enabled ?? true,
accelerator: item.shortcut?.replace("Meta", "CmdOrCtrl"),
checked: typeof item.checked === "boolean" ? item.checked : undefined,
type: typeof item.checked === "boolean" ? "checkbox" : undefined,
click() {
context.sender.send(
"menu-click",
Expand Down
35 changes: 18 additions & 17 deletions apps/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@headlessui/react": "2.1.8",
"@hono/auth-js": "1.0.10",
"@hookform/resolvers": "3.9.0",
"@iconify/tools": "4.0.6",
"@lottiefiles/dotlottie-react": "0.8.12",
"@iconify/tools": "4.0.7",
"@lottiefiles/dotlottie-react": "0.9.0",
"@microflash/remark-callout-directives": "4.3.1",
"@mozilla/readability": "^0.5.0",
"@radix-ui/react-alert-dialog": "1.1.1",
Expand All @@ -38,13 +38,13 @@
"@radix-ui/react-tabs": "1.1.0",
"@radix-ui/react-toast": "1.2.1",
"@radix-ui/react-tooltip": "1.1.2",
"@sentry/react": "8.30.0",
"@sentry/react": "8.32.0",
"@sentry/vite-plugin": "2.22.4",
"@shikijs/transformers": "1.18.0",
"@shikijs/transformers": "1.20.0",
"@t3-oss/env-core": "^0.11.1",
"@tanstack/query-sync-storage-persister": "5.56.2",
"@tanstack/react-query": "5.56.2",
"@tanstack/react-query-devtools": "5.56.2",
"@tanstack/react-query-devtools": "5.58.0",
"@tanstack/react-query-persist-client": "5.56.2",
"@use-gesture/react": "10.3.1",
"@yornaath/batshit": "0.10.1",
Expand All @@ -54,10 +54,10 @@
"cmdk": "1.0.0",
"dayjs": "1.11.13",
"dexie": "4.0.8",
"dnum": "^2.13.1",
"dnum": "^2.14.0",
"electron-log": "5.2.0",
"foxact": "0.2.38",
"framer-motion": "11.5.6",
"framer-motion": "11.9.0",
"franc-min": "6.2.0",
"fuse.js": "7.0.0",
"hast-util-to-jsx-runtime": "2.3.0",
Expand All @@ -73,9 +73,10 @@
"masonic": "4.0.1",
"nanoid": "5.0.7",
"ofetch": "1.4.0",
"path-to-regexp": "8.1.0",
"posthog-js": "1.163.0",
"re-resizable": "6.9.18",
"path-to-regexp": "8.2.0",
"posthog-js": "1.165.0",
"re-resizable": "6.10.0",
"react-blurhash": "^0.3.0",
"react-error-boundary": "4.0.13",
"react-fast-marquee": "1.6.5",
"react-hook-form": "7.53.0",
Expand All @@ -88,19 +89,19 @@
"react-shadow": "20.5.0",
"react-virtuoso": "4.10.4",
"rehype-infer-description-meta": "2.0.0",
"rehype-parse": "9.0.0",
"rehype-parse": "9.0.1",
"rehype-sanitize": "6.0.0",
"rehype-stringify": "10.0.0",
"rehype-stringify": "10.0.1",
"remark-directive": "3.0.0",
"remark-gfm": "4.0.0",
"remark-gh-alerts": "0.0.3",
"remark-parse": "11.0.0",
"remark-rehype": "11.1.1",
"shiki": "1.18.0",
"shiki": "1.20.0",
"sonner": "^1.5.0",
"swiper": "11.1.14",
"tailwind-merge": "2.5.2",
"tldts": "6.1.47",
"tldts": "6.1.48",
"unified": "11.0.5",
"use-context-selector": "2.0.0",
"usehooks-ts": "3.1.0",
Expand All @@ -112,12 +113,12 @@
"@babel/generator": "7.25.6",
"@hono/node-server": "1.13.1",
"@types/lodash-es": "4.17.12",
"@types/node": "^22.5.5",
"@types/react": "^18.3.8",
"@types/node": "^22.7.4",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"fake-indexeddb": "6.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.6.2"
"vitest": "2.0"
}
}
30 changes: 30 additions & 0 deletions apps/renderer/src/atoms/source-content.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { atom } from "jotai"
import { useCallback } from "react"

import { useModalStack } from "~/components/ui/modal"
import { createAtomHooks } from "~/lib/jotai"
import { SourceContentView } from "~/modules/entry-content/components/SourceContentView"

export const [, , useShowSourceContent, , getShowSourceContent, setShowSourceContent] =
createAtomHooks(atom<boolean>(false))

export const toggleShowSourceContent = () => setShowSourceContent(!getShowSourceContent())
export const resetShowSourceContent = () => setShowSourceContent(false)

export const useSourceContentModal = () => {
const { present } = useModalStack()

return useCallback(
({ title, src }: { title?: string; src: string }) => {
present({
id: src,
title,
content: () => <SourceContentView src={src} />,
resizeable: true,
clickOutsideToDismiss: true,
max: true,
})
},
[present],
)
}
5 changes: 4 additions & 1 deletion apps/renderer/src/components/feed-summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ export function FollowSummary({
href={!isList ? feed.url || docs : `${WEB_URL}/list/${feed.id}`}
target="_blank"
rel="noreferrer"
className="truncate"
>
{!isList ? feed.url || docs : `list:${feed.id}`}
<EllipsisHorizontalTextWithTooltip>
{`${!isList ? feed.url || docs : `list:${feed.id}`}`}
</EllipsisHorizontalTextWithTooltip>
</a>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export const ShikiHighLighter: FC<ShikiProps> = (props) => {

if (!loaded) {
return (
<pre className={className}>
<pre className={cn("bg-transparent", className)}>
<code>{code}</code>
</pre>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.shiki-wrapper {
@apply rounded-md overflow-hidden;

pre {
@apply bg-transparent;
}

&.transparent {
:global {
.shiki,
Expand Down
4 changes: 2 additions & 2 deletions apps/renderer/src/components/ui/context-menu/context-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ const ContextMenuCheckboxItem = React.forwardRef<
{...props}
>
<span className="absolute left-2 flex items-center justify-center">
<ContextMenuPrimitive.ItemIndicator>
<i className="i-mgc-check-filled size-4" />
<ContextMenuPrimitive.ItemIndicator asChild>
<i className="i-mgc-check-filled size-3" />
</ContextMenuPrimitive.ItemIndicator>
</span>
{children}
Expand Down
4 changes: 3 additions & 1 deletion apps/renderer/src/components/ui/datetime/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { stopPropagation } from "~/lib/dom"
import { Tooltip, TooltipContent, TooltipPortal, TooltipTrigger } from "../tooltip"

const formatTemplateString = "lll"
const formatTemplateStringShort = "ll"

const formatTime = (
date: string | Date,
relativeBeforeDay?: number,
Expand Down Expand Up @@ -141,7 +143,7 @@ export const RelativeDay = ({ date }: { date: Date }) => {
}
}, [date, language])

const formated = dayjs(date).format(formatTemplateString)
const formated = dayjs(date).format(formatTemplateStringShort)
if (formated === dateString) {
return <>{dateString}</>
}
Expand Down
4 changes: 2 additions & 2 deletions apps/renderer/src/components/ui/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export const Input = forwardRef<
ref={ref}
className={cn(
"min-w-0 flex-auto appearance-none rounded-lg text-sm",
"bg-theme-background px-3 py-[calc(theme(spacing.2)-1px)] placeholder:text-zinc-400 dark:bg-zinc-700/[0.15]",
"bg-theme-background px-3 py-[calc(theme(spacing.2)-1px)]",
"ring-accent/20 duration-200 focus:border-accent/80 focus:outline-none focus:ring-2",
"focus:!bg-accent/5",
"border border-border",
"dark:text-zinc-200 dark:placeholder:text-zinc-500",
"placeholder:text-theme-placeholder-text dark:bg-zinc-700/[0.15] dark:text-zinc-200",
"hover:border-accent/60",
props.type === "password" ? "font-mono placeholder:font-sans" : "font-sans",
"w-full",
Expand Down
Loading

0 comments on commit a6bb37f

Please sign in to comment.