diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..fef4b2064 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,133 @@ +name: Nightly Release + +on: + schedule: + - cron: "0 22 * * *" # Runs at 10 PM UTC every day + +env: + VITE_WEB_URL: ${{ vars.VITE_WEB_URL }} + VITE_API_URL: ${{ vars.VITE_API_URL }} + VITE_IMGPROXY_URL: ${{ vars.VITE_IMGPROXY_URL }} + VITE_SENTRY_DSN: ${{ vars.VITE_SENTRY_DSN }} + VITE_POSTHOG_KEY: ${{ vars.VITE_POSTHOG_KEY }} + NODE_OPTIONS: --max-old-space-size=8192 + +jobs: + nightly-release: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + permissions: + id-token: write + contents: write + attestations: write + + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + lfs: true + + - name: Cache pnpm modules + uses: actions/cache@v4 + with: + path: ~/.pnpm-store + key: ${{ matrix.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ matrix.os }}- + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "pnpm" + + - name: Install appdmg + if: runner.os == 'macOS' + run: pnpm add -g appdmg + + # ... (macOS certificate and provisioning profile setup steps) ... + + - name: Install dependencies + run: pnpm i + + - name: Set nightly version + run: | + # Get the current version from package.json + 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 + sed -i.bak -e "s/\"version\": \".*\"/\"version\": \"$NIGHTLY_VERSION\"/" package.json + echo "Updated version to $NIGHTLY_VERSION" + + - name: Build + if: matrix.os != 'macos-latest' + run: pnpm build + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + + - name: Build (macOS) + if: matrix.os == 'macos-latest' + env: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + KEYCHAIN_PATH: ${{ runner.temp }}/app-signing.keychain-db + run: pnpm build:macos + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }}-nightly + path: | + out/make/**/*.zip + out/make/**/*.exe + out/make/**/*.AppImage + out/make/**/*.yml + out/make/**/*.dmg + retention-days: 7 + + - name: Generate artifact attestation + continue-on-error: true + uses: actions/attest-build-provenance@v1 + with: + subject-path: | + out/make/**/*.dmg + out/make/**/*.zip + out/make/**/*.exe + out/make/**/*.AppImage + out/make/**/*.yml + + - name: Create Nightly Release + uses: softprops/action-gh-release@v2 + with: + name: Nightly ${{ env.NIGHTLY_VERSION }} + draft: false + prerelease: true + tag_name: nightly-${{ env.NIGHTLY_VERSION }} + files: | + out/make/**/*.dmg + out/make/**/*.zip + out/make/**/*.exe + out/make/**/*.AppImage + out/make/**/*.yml + body: | + This is an automated nightly release for testing purposes. + Version: 0.0.0-nightly.${{ env.NIGHTLY_VERSION }} + + **Warning:** This build may be unstable and is not recommended for production use. + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index fd9114d0d..b465d468c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## [0.0.1-alpha.15](https://github.com/RSSNext/follow/compare/v0.0.1-alpha.3...v0.0.1-alpha.15) (2024-09-22) +## [0.0.1-alpha.16](https://github.com/RSSNext/follow/compare/v0.0.1-alpha.3...v0.0.1-alpha.16) (2024-09-22) ### Bug Fixes @@ -25,6 +25,7 @@ * add hover bg color when context menu opened ([6ceb263](https://github.com/RSSNext/follow/commit/6ceb263b777ccc9681cd086a28e019ce9bda3a43)) * add language selector loading lock map ([2d14c1e](https://github.com/RSSNext/follow/commit/2d14c1e5b5ad086b3556dd9a8862a6ce00368c4d)) * add link ([d9168c0](https://github.com/RSSNext/follow/commit/d9168c01b3f2a16fbfeadb722173e819dd3feb80)) +* add lock when login button click ([539f3bc](https://github.com/RSSNext/follow/commit/539f3bc599f4df9784662ca2bf972a94edf556c4)) * add nonce id for temp feed ([8f81d99](https://github.com/RSSNext/follow/commit/8f81d99f1dd48e60f9861d69c840c77fa70bde93)) * add page error boundary ([86d366d](https://github.com/RSSNext/follow/commit/86d366db76add0ad07eb921290b9444b211e2c4f)) * add show readability tip condition ([208e404](https://github.com/RSSNext/follow/commit/208e4040cea5d3485acf5750e7120fb5f715e30f)) @@ -54,6 +55,7 @@ * button transition ([f731d1e](https://github.com/RSSNext/follow/commit/f731d1e34e151828b6fa9553361f476da9d7e39b)) * calc toc scroller range when entry content changed ([66035fe](https://github.com/RSSNext/follow/commit/66035fea72e3ce0c6fbcd8380fbdef612e052cb4)) * can use under window blur ([9b2656e](https://github.com/RSSNext/follow/commit/9b2656ec53f3865378b7f2392d59a6828b31149c)) +* catch access stylesheet error ([bbc2bef](https://github.com/RSSNext/follow/commit/bbc2bef800c5b01669742bb004e2656c9087f82f)) * category in route should encodeURLComponent ([d5b79cb](https://github.com/RSSNext/follow/commit/d5b79cba8a5d6d8fe18efee5d58da5610fc3ce68)) * check undefined view ([71712f4](https://github.com/RSSNext/follow/commit/71712f464d2ab3043b602d4d2c311e4cc851e046)) * ci and tootip portal ([3729917](https://github.com/RSSNext/follow/commit/37299173c8fcaf88d44b1a54baf7ddc03aa20ca6)) @@ -100,6 +102,7 @@ * electron window type ([909d692](https://github.com/RSSNext/follow/commit/909d6929da5bd3930a6e1d8aa3342c46d00e5c7d)) * empty default font on electron app ([#481](https://github.com/RSSNext/follow/issues/481)) ([4f9d4f2](https://github.com/RSSNext/follow/commit/4f9d4f26f22ac86cce64bb9f1582c2be2b3361c3)) * empty entry list will throw not found feed error, fixed [#224](https://github.com/RSSNext/follow/issues/224) ([c41756d](https://github.com/RSSNext/follow/commit/c41756d2b91173a753e09f5de988b71a27daa9ba)) +* empty title break ([fbbb2a9](https://github.com/RSSNext/follow/commit/fbbb2a98b204ff17d80f1826134b713854a0f40d)) * ensure unique keys for search items ([#500](https://github.com/RSSNext/follow/issues/500)) ([6c6b082](https://github.com/RSSNext/follow/commit/6c6b0828b83ff62d95c56417dcb0ebc1faed9535)) * entries hasNext ([4cb5678](https://github.com/RSSNext/follow/commit/4cb56784acfb46516a4320f0088c294eafb32fcf)) * entry bar action ([ba23dcf](https://github.com/RSSNext/follow/commit/ba23dcf46ff7569562d0a786ab85d46093b8abe8)) @@ -279,6 +282,7 @@ * style ([#359](https://github.com/RSSNext/follow/issues/359)) ([3d39308](https://github.com/RSSNext/follow/commit/3d393086966826f194ae660b43bcb0cb33b3d6f3)) * style center ([a5e3311](https://github.com/RSSNext/follow/commit/a5e33112ff2782cdbca316ff1d4dd6fd78116a1c)) * **style:** button align center and ([38a5cb6](https://github.com/RSSNext/follow/commit/38a5cb682dc0c3082664a2192686ad16f68ecec3)) +* **styles:** add gap for received button ([f1b86b3](https://github.com/RSSNext/follow/commit/f1b86b3068eaebee1d123a7c1b5cedb4b4ebef4f)) * **style:** video play button align center ([465f1a6](https://github.com/RSSNext/follow/commit/465f1a6acf6a1d96a28e724f071f8a68a327a56d)) * subcription status & category empty, input value null ([#263](https://github.com/RSSNext/follow/issues/263)) ([93e2ccf](https://github.com/RSSNext/follow/commit/93e2ccfd5831f8a7f43932acd2976785e3adfbff)) * subview layout ([36a34de](https://github.com/RSSNext/follow/commit/36a34de26caf2ff00847827635eedd3771faadc0)) @@ -333,6 +337,7 @@ * upload sentry sourcemap ([b23365f](https://github.com/RSSNext/follow/commit/b23365faad9927826140948b642c0caca542f135)) * use feed enabled condition ([9726d43](https://github.com/RSSNext/follow/commit/9726d4396673e2be02c60ce049ed07c5bf978380)) * use official embed player in bilibili video when use web ([#219](https://github.com/RSSNext/follow/issues/219)) ([9177a34](https://github.com/RSSNext/follow/commit/9177a349e087cdc60b22e2338146caaefd377694)) +* user avatar use profile data if userId passed, fixed [#550](https://github.com/RSSNext/follow/issues/550) ([176afa7](https://github.com/RSSNext/follow/commit/176afa72ba1e0801ac383982f826cc19b215b242)) * user button color in dark mode ([04e3c38](https://github.com/RSSNext/follow/commit/04e3c386c5699e6b0907de2a98701668fc7f278b)) * user modal list padding ([992ea15](https://github.com/RSSNext/follow/commit/992ea1594af02e3815adae2fe99de4f205543239)) * user profile can not scroll by scrollbar ([eac1965](https://github.com/RSSNext/follow/commit/eac1965cfc3d2bc86e11f256237322f15892b897)) @@ -389,6 +394,7 @@ * ai daily in article content column ([a625d04](https://github.com/RSSNext/follow/commit/a625d04328ea209ead68ce0391a7108cbb2c4e6a)) * ai daily modal ([67d9559](https://github.com/RSSNext/follow/commit/67d9559229baca34aa3328ba711d0e29def5bb8e)) * apm ([602f50a](https://github.com/RSSNext/follow/commit/602f50aa1a2b1ad9559ae22c92c599907df0b8cc)) +* **app:** clear all data ([be7e87c](https://github.com/RSSNext/follow/commit/be7e87c192d3c863b3df2439287054682c69a221)) * **audio-view:** seek circle indicator ([94b9535](https://github.com/RSSNext/follow/commit/94b9535d28292dbc209e251e3b0cb18d480d6a3b)) * auto claim daily `POWER`, and update table style ([ca381ce](https://github.com/RSSNext/follow/commit/ca381cebf81cc745e56fe35811004d89b55609ba)) * auto enable readability if no content ([27ecfc4](https://github.com/RSSNext/follow/commit/27ecfc4a86f3e35f245c1bca2d1dba57ff7364f2)) @@ -456,6 +462,7 @@ * improve shiki code block renderer and show language ([590d9cb](https://github.com/RSSNext/follow/commit/590d9cbb94a63f843d00bf54848bba40157d2452)) * integration settings page ([f9f1938](https://github.com/RSSNext/follow/commit/f9f19386b28e853eb03b3ca5bae629d4f6542cb3)) * invitation limitation message ([fa37a0c](https://github.com/RSSNext/follow/commit/fa37a0ca2c8235fb5fd47f96c26de7fdcd762ad8)) +* **invitation:** add signout button ([3c0f4e7](https://github.com/RSSNext/follow/commit/3c0f4e779c68a933d57e232d62774fca1c0b86ed)) * invitations page ([0fc1110](https://github.com/RSSNext/follow/commit/0fc1110e3b1e067a02a65ba7afe5b1456bb76815)) * invitations page tips ([18de381](https://github.com/RSSNext/follow/commit/18de381343d58f19a36fa6e681711fe06c07b1c1)) * invitations tips and confirm modal ([c919e59](https://github.com/RSSNext/follow/commit/c919e5907bae4303b667d6cff39c19ebbf6a4dc6)) @@ -563,6 +570,11 @@ * speed up user profile modal data loading ([53a5bae](https://github.com/RSSNext/follow/commit/53a5bae316b406ff5c250c3e7772ce4071891bee)) +### Reverts + +* Revert "refactor: migrate to webp" ([e7081cf](https://github.com/RSSNext/follow/commit/e7081cf48592bfcc24308df19a372a80dc324632)) + + ## [0.0.1-alpha.1](https://github.com/RSSNext/follow/compare/v0.0.1-internal.1...v0.0.1-alpha.1) (2024-07-30) diff --git a/apps/main/package.json b/apps/main/package.json index 018ce7f19..5b2376d30 100644 --- a/apps/main/package.json +++ b/apps/main/package.json @@ -17,6 +17,7 @@ }, "main": "./src/index.ts", "scripts": { + "build": "tsup", "typecheck": "tsup && tsc --noEmit" }, "dependencies": { diff --git a/apps/main/src/lib/cleaner.ts b/apps/main/src/lib/cleaner.ts new file mode 100644 index 000000000..190aecaf9 --- /dev/null +++ b/apps/main/src/lib/cleaner.ts @@ -0,0 +1,46 @@ +import { callGlobalContextMethod } from "@follow/shared/bridge" +import { dialog } from "electron" + +import { getMainWindow } from "~/window" + +import { t } from "./i18n" + +export const clearAllData = async () => { + const win = getMainWindow() + if (!win) return + const ses = win.webContents.session + + // Dialog to confirm + const result = await dialog.showMessageBox({ + type: "warning", + + message: t("dialog.clearAllData"), + buttons: [t("dialog.yes"), t("dialog.no")], + }) + + if (result.response === 1) { + return + } + try { + await ses.clearCache() + + await ses.clearStorageData({ + storages: [ + "websql", + "filesystem", + "indexdb", + "localstorage", + "shadercache", + "websql", + "serviceworkers", + "cookies", + ], + }) + callGlobalContextMethod(win, "toast.success", ["App data reset successfully"]) + + // reload the app + win.reload() + } catch (error: any) { + callGlobalContextMethod(win, "toast.error", [`Error resetting app data: ${error.message}`]) + } +} diff --git a/apps/main/src/menu.ts b/apps/main/src/menu.ts index 3a8339b23..5217438a1 100644 --- a/apps/main/src/menu.ts +++ b/apps/main/src/menu.ts @@ -4,6 +4,7 @@ import type { BrowserWindow, MenuItem, MenuItemConstructorOptions } from "electr import { Menu } from "electron" import { isDev, isMacOS } from "./env" +import { clearAllData } from "./lib/cleaner" import { t } from "./lib/i18n" import { revealLogFile } from "./logger" import { checkForUpdates, quitAndInstall } from "./updater" @@ -35,6 +36,10 @@ export const registerAppMenu = () => { { role: "hide", label: t("menu.hide", { name }) }, { role: "hideOthers", label: t("menu.hideOthers") }, { type: "separator" }, + { + label: t("menu.clearAllData"), + click: clearAllData, + }, { role: "quit", label: t("menu.quit", { name }) }, ], }, diff --git a/apps/main/src/tipc/app.ts b/apps/main/src/tipc/app.ts index f66463891..ef6c4afaa 100644 --- a/apps/main/src/tipc/app.ts +++ b/apps/main/src/tipc/app.ts @@ -6,6 +6,7 @@ import type { BrowserWindow } from "electron" import { app, clipboard, dialog, screen } from "electron" import { registerMenuAndContextMenu } from "~/init" +import { clearAllData } from "~/lib/cleaner" import { isWindows11 } from "../env" import { downloadFile } from "../lib/download" @@ -218,6 +219,8 @@ export const appRoute = { app.commandLine.appendSwitch("lang", input) }), + + clearAllData: t.procedure.action(clearAllData), } interface Sender extends Electron.WebContents { diff --git a/apps/renderer/src/components/common/ShadowDOM.tsx b/apps/renderer/src/components/common/ShadowDOM.tsx index 42fe415b4..c59cd0110 100644 --- a/apps/renderer/src/components/common/ShadowDOM.tsx +++ b/apps/renderer/src/components/common/ShadowDOM.tsx @@ -155,13 +155,16 @@ function getLinkedStaticStyleSheets() { const hasCache = cacheCssTextMap[sheet.href] if (!hasCache) { if (!sheet.href) continue - const rules = sheet.cssRules || sheet.rules - let cssText = "" - for (const rule of rules) { - cssText += rule.cssText + try { + const rules = sheet.cssRules || sheet.rules + let cssText = "" + for (const rule of rules) { + cssText += rule.cssText + } + cacheCssTextMap[sheet.href] = cssText + } catch (err) { + console.error("Failed to get cssText for", sheet.href, err) } - - cacheCssTextMap[sheet.href] = cssText } cssArray.push({ diff --git a/apps/renderer/src/components/user-button.tsx b/apps/renderer/src/components/user-button.tsx index 1f941ab63..36642d2cd 100644 --- a/apps/renderer/src/components/user-button.tsx +++ b/apps/renderer/src/components/user-button.tsx @@ -186,6 +186,7 @@ export function UserAvatar({ return } + const renderUserData = userId ? profile.data : session?.user return (
- {(profile.data || session?.user)?.name?.slice(0, 2)} + {renderUserData?.name?.slice(0, 2)} - {!hideName &&
{(profile.data || session?.user)?.name}
} + {!hideName &&
{renderUserData?.name}
}
) } diff --git a/apps/renderer/src/lib/img-proxy.ts b/apps/renderer/src/lib/img-proxy.ts index bc4c9e802..91a5428bd 100644 --- a/apps/renderer/src/lib/img-proxy.ts +++ b/apps/renderer/src/lib/img-proxy.ts @@ -9,7 +9,7 @@ export const getImageProxyUrl = ({ url: string width: number height: number -}) => `${env.VITE_IMGPROXY_URL}?url=${encodeURIComponent(url)}&width=${width}&height=${height}` +}) => `${env.VITE_IMGPROXY_URL}/unsafe/fit-in/${width}x${height}/${encodeURIComponent(url)}` export const replaceImgUrlIfNeed = (url: string) => { for (const rule of imageRefererMatches) { diff --git a/apps/renderer/src/modules/achievement/hooks.tsx b/apps/renderer/src/modules/achievement/hooks.tsx index 97bcf1688..6e0489ce9 100644 --- a/apps/renderer/src/modules/achievement/hooks.tsx +++ b/apps/renderer/src/modules/achievement/hooks.tsx @@ -221,7 +221,7 @@ export const AchievementModalContent: FC = () => { className={styledButtonVariant({ variant: "outline", className: - "relative !bg-green-100/50 border-green-200 text-green-800 dark:text-foreground dark:!bg-green-100/5 dark:border-green-200/20", + "relative !bg-green-100/50 gap-1 border-green-200 text-green-800 dark:text-foreground dark:!bg-green-100/5 dark:border-green-200/20", })} > diff --git a/apps/renderer/src/modules/auth/LoginModalContent.tsx b/apps/renderer/src/modules/auth/LoginModalContent.tsx index 726bb6d21..7578b39c4 100644 --- a/apps/renderer/src/modules/auth/LoginModalContent.tsx +++ b/apps/renderer/src/modules/auth/LoginModalContent.tsx @@ -1,8 +1,11 @@ -import { m } from "framer-motion" +import clsx from "clsx" +import { AnimatePresence, m } from "framer-motion" +import { useState } from "react" import { useTranslation } from "react-i18next" import { FollowIcon } from "~/components/icons/follow" -import { Button } from "~/components/ui/button" +import { MotionButtonBase } from "~/components/ui/button" +import { LoadingCircle } from "~/components/ui/loading" import { useCurrentModal } from "~/components/ui/modal" import { modalMontionConfig } from "~/components/ui/modal/stacked/constants" import type { LoginRuntime } from "~/lib/auth" @@ -20,6 +23,8 @@ export const LoginModalContent = (props: LoginModalContentProps) => { const { t } = useTranslation() + const [loadingLockSet, setLoadingLockSet] = useState(false) + return (
{
- - + + + {t("signin.continue_with_google")} + +
) } + +const LoginButtonContent = (props: { children: React.ReactNode; isLoading: boolean }) => { + const { children, isLoading } = props + return ( + + {isLoading ? ( + + + + ) : ( + + {children} + + )} + + ) +} diff --git a/apps/renderer/src/pages/(external)/invitation.tsx b/apps/renderer/src/pages/(external)/invitation.tsx index 2b7cffae5..1122941ce 100644 --- a/apps/renderer/src/pages/(external)/invitation.tsx +++ b/apps/renderer/src/pages/(external)/invitation.tsx @@ -21,7 +21,9 @@ import { FormMessage, } from "~/components/ui/form" import { Input } from "~/components/ui/input" +import { Tooltip, TooltipContent, TooltipTrigger } from "~/components/ui/tooltip" import { SocialMediaLinks } from "~/constants/social" +import { useSignOut } from "~/hooks/biz/useSignOut" import { getFetchErrorMessage } from "~/lib/error-parser" import confettiUrl from "~/lottie/confetti.lottie?url" import { useInvitationMutation } from "~/queries/invitations" @@ -78,6 +80,8 @@ export function Component() { setDotLottie(dotLottie) } + const signOut = useSignOut() + return (
@@ -126,6 +130,24 @@ export function Component() { )} {t("invitation.activate")} + + + + + + {t("login.signOut")} +
diff --git a/locales/external/en.json b/locales/external/en.json index 6292cc41e..0d0253701 100644 --- a/locales/external/en.json +++ b/locales/external/en.json @@ -26,6 +26,7 @@ "login.logInTo": "Log in to ", "login.openApp": "Open App", "login.redirecting": "Redirecting", + "login.signOut": "Sign out", "login.welcomeTo": "Welcome to ", "redirect.continueInBrowser": "Continue in Browser", "redirect.instruction": "Now is the time to open {{APP_NAME}} and safely close this page.", diff --git a/locales/native/en.json b/locales/native/en.json index beb2b9ba6..683ae2ba4 100644 --- a/locales/native/en.json +++ b/locales/native/en.json @@ -19,10 +19,14 @@ "contextMenu.searchWithGoogle": "Search with Google", "contextMenu.selectAll": "Select All", "contextMenu.services": "Services", + "dialog.clearAllData": "Are you sure you want to clear all data?", + "dialog.no": "No", + "dialog.yes": "Yes", "menu.about": "About {{name}}", "menu.actualSize": "Actual Size", "menu.bringAllToFront": "Bring All to Front", "menu.checkForUpdates": "Check for Updates", + "menu.clearAllData": "Clear All Data", "menu.close": "Close", "menu.copy": "Copy", "menu.cut": "Cut", diff --git a/package.json b/package.json index 1e01bafc9..bf1d284d6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Follow", "type": "module", - "version": "0.0.1-alpha.15", + "version": "0.0.1-alpha.16", "private": true, "packageManager": "pnpm@9.11.0", "description": "Next generation information browser",