diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fce33762e..076ed77a1 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,7 +4,7 @@ Thank you for contributing! Before submitting the PR, please make sure you do the following: -- Read the [Contributing Guide](https://github.com/antfu/contribute). +- Read the [Contributing Guide](/contribute). - Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate. - Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`). - Ideally, include relevant tests that fail without this PR but pass with it. @@ -15,8 +15,23 @@ Before submitting the PR, please make sure you do the following: +### PR Type + + + +- [ ] Feature +- [ ] Bugfix +- [ ] Hotfix +- [ ] Other (please describe): + ### Linked Issues ### Additional context + +### Changelog + + + +- [ ] I have updated the changelog/next.md with my changes. diff --git a/.github/workflows/build-web.yml b/.github/workflows/build-web.yml new file mode 100644 index 000000000..0e0d1516c --- /dev/null +++ b/.github/workflows/build-web.yml @@ -0,0 +1,45 @@ +on: + pull_request: + push: + branches: [main, dev] + +name: CI Build web and SSR server +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-ssr + cancel-in-progress: true +jobs: + build: + name: Build web and SSR server + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [lts/*] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + lfs: true + - name: Cache turbo build setup + uses: actions/cache@v4 + with: + path: .turbo + key: ${{ runner.os }}-turbo-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-turbo- + + - name: Checkout LFS objects + run: git lfs checkout + + - uses: pnpm/action-setup@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Build web and SSR server + run: | + npm exec turbo run //#build:web @follow/server#build diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22fbe2b57..510b2af9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ on: required: true # https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-build cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} env: VITE_WEB_URL: ${{ vars.VITE_WEB_URL }} @@ -106,7 +106,7 @@ jobs: - name: Build if: matrix.os != 'macos-latest' - run: pnpm build + run: npm exec turbo run //#build env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} @@ -117,7 +117,7 @@ jobs: APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} KEYCHAIN_PATH: ${{ runner.temp }}/app-signing.keychain-db - run: pnpm build:macos + run: npm exec turbo run //#build:macos - name: Upload file uses: actions/upload-artifact@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 084484a9e..d6ce8d45b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,7 +5,7 @@ on: name: CI Format, Typecheck and Lint concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-lint cancel-in-progress: true jobs: build: @@ -19,8 +19,15 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 0 lfs: true + - name: Cache turbo build setup + uses: actions/cache@v4 + with: + path: .turbo + key: ${{ runner.os }}-turbo-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-turbo- + - name: Checkout LFS objects run: git lfs checkout @@ -35,8 +42,6 @@ jobs: run: pnpm install - name: Format, Lint and Typecheck run: | - pnpm run format:check - pnpm run typecheck - pnpm run lint + npm exec turbo run format:check typecheck lint - name: Run test - run: pnpm test + run: npm exec turbo run test diff --git a/.gitignore b/.gitignore index 328735892..715c0bbde 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ vite.config.*.mjs # apps/server/**/index.template.ts .generated +.turbo diff --git a/CHANGELOG.md b/CHANGELOG.md index 641564817..b2bb95660 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,109 @@ # CHANGELOG -## [0.1.1-beta.0](https://github.com/RSSNext/follow/compare/v0.0.1-alpha.21...v0.1.1-beta.0) (2024-10-25) +## [0.1.2-beta.0](https://github.com/RSSNext/follow/compare/v0.1.1-beta.1...v0.1.2-beta.0) (2024-11-01) + + +### Bug Fixes + +* add missing event bus ([33b3ac4](https://github.com/RSSNext/follow/commit/33b3ac4c53faa617080cbcf3039cbee7fdeb1931)) +* add rsshub discover error boundary ([665c009](https://github.com/RSSNext/follow/commit/665c009bf8aec87ead601428410f56ba6756a8db)) +* add turbo build in ci ([7b848cd](https://github.com/RSSNext/follow/commit/7b848cd08aa4f97b1df35666166561d6fc30c5c9)) +* assets rewrite ([#1204](https://github.com/RSSNext/follow/issues/1204)) ([488e8ef](https://github.com/RSSNext/follow/commit/488e8effc6f00769df7dbf68d4e6d1e4e950b8e7)) +* auto load achieved entries when show achieved button is available ([074a60d](https://github.com/RSSNext/follow/commit/074a60d3cf93bcede88ea4d70b07cf7480be4229)) +* **boost:** card text align center ([632d5d4](https://github.com/RSSNext/follow/commit/632d5d42d67999523e602fb18f59ca72543b7d7a)) +* build pre script ([8bd2de8](https://github.com/RSSNext/follow/commit/8bd2de84b898ffc1a4863d29d7056a0b9e7a9e2f)) +* **ci:** concurrency group ([fb0152e](https://github.com/RSSNext/follow/commit/fb0152eaec76b28ed9fc26381917ca7ec2aecb0b)) +* **ci:** turbo not found ([c812bd7](https://github.com/RSSNext/follow/commit/c812bd71aabc63b5c9ebbe032f25aba5ac51bd64)) +* **ci:** windows build ([9f72c26](https://github.com/RSSNext/follow/commit/9f72c263a6945fe90899f85f732c0866c7f61b25)) +* css editor lazy and input composition handler ([5c6004a](https://github.com/RSSNext/follow/commit/5c6004a0905c6207c6119de0d37e9a5baf744dab)) +* detecting windows11 ([#1170](https://github.com/RSSNext/follow/issues/1170)) ([2813f1d](https://github.com/RSSNext/follow/commit/2813f1d6540fcb215287dd32cbc0f8cf87cb1cb0)) +* disable `pointerDownOutside` trigger `onDismiss` ([#1215](https://github.com/RSSNext/follow/issues/1215)) ([2bf5245](https://github.com/RSSNext/follow/commit/2bf5245126bc9ef890c06afe5a825d1e1ab4059c)) +* disable auto load archive for inbox and list ([7825e16](https://github.com/RSSNext/follow/commit/7825e16b6d1230ba2c13e5ef00474fc05cc510e5)) +* **discover:** card text truncate ([557e912](https://github.com/RSSNext/follow/commit/557e91228af27251663904dfd3211c535b5b5415)) +* entry thumbnail keep origin aspect ratio ([6e04e6e](https://github.com/RSSNext/follow/commit/6e04e6eacd6346bd2869c683ec417932a0d13807)) +* **entry-column:** pre-render cached entries ([5065c8e](https://github.com/RSSNext/follow/commit/5065c8e52dcba1a8d8f16ce3729b7c2eb7f5a192)) +* escape for seo meta tags ([9564257](https://github.com/RSSNext/follow/commit/9564257564e417e18bdeedded9397d469e6daf14)), closes [#1232](https://github.com/RSSNext/follow/issues/1232) +* **external:** add global 404 page ([5e49b81](https://github.com/RSSNext/follow/commit/5e49b8114e0446b734a54eea3291721d8f9656b3)) +* **external:** header logo href ([b867af9](https://github.com/RSSNext/follow/commit/b867af9b45de0124e04ee95ec4771b9f35903951)) +* **external:** remove duplicate border bottom ([32f68ee](https://github.com/RSSNext/follow/commit/32f68ee1987182271295292bff92f482c151b78b)) +* **external:** set auth config first ([ef46c70](https://github.com/RSSNext/follow/commit/ef46c70a9849c315cc8d827f4ad8a3c004003bac)) +* **external:** should hard go back to app home ([6786e20](https://github.com/RSSNext/follow/commit/6786e203031f18be0ca386dcaf1dddf4d05ae95b)) +* group date item z index ([8c5c62e](https://github.com/RSSNext/follow/commit/8c5c62e0d698f3a0d72a2ef0595e44986c95320b)) +* **i18n:** remove `external` ns in renderer ([229b3e1](https://github.com/RSSNext/follow/commit/229b3e18f50c81c916f877a2a65325e3dcaa783a)) +* initializeDayjs in server ([d408581](https://github.com/RSSNext/follow/commit/d408581a13ad78d5a871d98f3ff0ff9bb5e45ae5)), closes [#1198](https://github.com/RSSNext/follow/issues/1198) +* missing site url in feed selector ([ea677ac](https://github.com/RSSNext/follow/commit/ea677ac6a3a43489a9508a32ecb22fa38ecf4f27)) +* modal bottom buttons align ([#1216](https://github.com/RSSNext/follow/issues/1216)) ([b97096d](https://github.com/RSSNext/follow/commit/b97096dbd06bb7687b6c1313de45d8e91dee25af)) +* modal close button overlaps the select content ([#1166](https://github.com/RSSNext/follow/issues/1166)) ([3c103ed](https://github.com/RSSNext/follow/commit/3c103ed15daeb1f57a001d615c047c303087ba46)) +* **modal:** drawer modal layout symmetric padding ([7141e86](https://github.com/RSSNext/follow/commit/7141e869dfc9328e3eeeda909ea2ffc7e6dd0e34)) +* **modal:** fixed close modal button position ([78e9424](https://github.com/RSSNext/follow/commit/78e942473fff309e372708b56a59a9009d5bb0e9)) +* **modal:** modal dismiss action ([b05ff50](https://github.com/RSSNext/follow/commit/b05ff50f14660f20ed881f6aeabb732d80c9539c)) +* **modal:** repeat user profile dialog ([#1155](https://github.com/RSSNext/follow/issues/1155)) ([ad86372](https://github.com/RSSNext/follow/commit/ad86372bfb345b6f921da783c401be30cdbe4b89)) +* optimize some styles ([9b99bf4](https://github.com/RSSNext/follow/commit/9b99bf4428cf6f1ca3218a3074a944af4d014f57)) +* optimize the animation of the Follow button on the User Profile Modal ([#1156](https://github.com/RSSNext/follow/issues/1156)) ([87717d6](https://github.com/RSSNext/follow/commit/87717d642607cca4254f11d673a8a910fc6ab076)) +* pnpm lockfile ([fdc547a](https://github.com/RSSNext/follow/commit/fdc547a5aaeb11aa13d6321ea60f1d3a4e01a8b4)) +* power icon align ([11059f6](https://github.com/RSSNext/follow/commit/11059f639ee955a0f10cbd97cb6eed85e335fed7)) +* preferred title not working in entry column ([#1268](https://github.com/RSSNext/follow/issues/1268)) ([4bdf28e](https://github.com/RSSNext/follow/commit/4bdf28ea766242c74af051e36a9ef205f02eb874)) +* prevent default for cmd+k ([81d49f0](https://github.com/RSSNext/follow/commit/81d49f0893100de85a22d114765f76e7c9dea36c)) +* refetch wallet data on mount ([2d11eb2](https://github.com/RSSNext/follow/commit/2d11eb2d92fb57222b14df987b57a75eb9262fc5)) +* relogin ([80515f6](https://github.com/RSSNext/follow/commit/80515f67652a77fbdbe20a2a3298fd916515a8d7)) +* remove `useSingleton` ([d1d3fcf](https://github.com/RSSNext/follow/commit/d1d3fcf493bf26ce58cd33fedd7320cfcfe8ef5f)) +* remove cache-control header ([#1202](https://github.com/RSSNext/follow/issues/1202)) ([c683bda](https://github.com/RSSNext/follow/commit/c683bdaef63716659ca78875022ff38350e50b82)) +* remove gcore icon ([#1220](https://github.com/RSSNext/follow/issues/1220)) ([486fa20](https://github.com/RSSNext/follow/commit/486fa202ee9488981a733f235f95c90a073e7166)) +* scroll bar z index ([5057999](https://github.com/RSSNext/follow/commit/50579995367b871e84768c5983b3302f75f8e077)), closes [#1233](https://github.com/RSSNext/follow/issues/1233) +* **server:** serialize data ([2410b84](https://github.com/RSSNext/follow/commit/2410b843af3d16f77e88482d9c73f25c1dd3431a)) +* **server:** use `xss` to serialize data ([93f58ec](https://github.com/RSSNext/follow/commit/93f58ecfd8fadfa67f56ebfe629e73f44bb94a49)) +* set referer ([29557f3](https://github.com/RSSNext/follow/commit/29557f370f37f7f5c7d1f7ccd7157a4449f7e5ca)) +* set windows env ([1ea103b](https://github.com/RSSNext/follow/commit/1ea103b7ee1689ba9683c341a2afacacf2884fbd)) +* **share:** og image grid width and image align top to description ([14e37da](https://github.com/RSSNext/follow/commit/14e37da0cebbdb1b283c562c21acc2f8ba385bf9)) +* **shortcut:** add cmd+k to guide ([e9ab9b6](https://github.com/RSSNext/follow/commit/e9ab9b6f379abe426ac751961e3767c8aa20b663)) +* shouldLoadArchivedEntries condition ([94b097f](https://github.com/RSSNext/follow/commit/94b097fd25533b5d1437bf1054dbe44af7828099)) +* show scrollbar when list table overflows in settings menu ([#1266](https://github.com/RSSNext/follow/issues/1266)) ([47b200f](https://github.com/RSSNext/follow/commit/47b200f7f3340b5b262674c71e876328ec758192)) +* **store:** singleton store guard ([5a8725b](https://github.com/RSSNext/follow/commit/5a8725b50767bb6faddca6e0af6cef2cfb28da29)) +* theme cannot be switched ([#1157](https://github.com/RSSNext/follow/issues/1157)) ([d5be028](https://github.com/RSSNext/follow/commit/d5be0287ad03e47635be057222ca7155a033ae80)) +* **toc:** fix text truncate in title line ([f9b1a61](https://github.com/RSSNext/follow/commit/f9b1a61c0185b449184b34df5f3a3869a4e722a4)) +* **toc:** should focus when toc item clicked ([f51dfdd](https://github.com/RSSNext/follow/commit/f51dfddc9ef40f4a7f226f32f9357e03a04f6ee0)) +* translate form style ([6f3bb61](https://github.com/RSSNext/follow/commit/6f3bb61023dde1d58164425d8649c90bb4f680c6)), closes [#1184](https://github.com/RSSNext/follow/issues/1184) +* try fix dayjs init ([093f80d](https://github.com/RSSNext/follow/commit/093f80d9da223c567125285cc0f312f419bb4042)) +* ts import ([14311dd](https://github.com/RSSNext/follow/commit/14311dde0a9cb14e797e1a0f654a11f8502e58f8)) +* turbo build cmd ([0b9c279](https://github.com/RSSNext/follow/commit/0b9c279fccd25231b90810359125571f817b7f7c)) +* **ui:** use safe inset top to fix windows overlays, fixed [#1184](https://github.com/RSSNext/follow/issues/1184) ([dc85570](https://github.com/RSSNext/follow/commit/dc855703289ac98db76f4a57760fcd66047b8dd1)) +* **ui:** user profile follow button style ([d629215](https://github.com/RSSNext/follow/commit/d629215305a0ec9323dea0db929582e9609a82f6)) +* vercel rewrite config ([#1203](https://github.com/RSSNext/follow/issues/1203)) ([c954d61](https://github.com/RSSNext/follow/commit/c954d61f074e282a9a86cbf1d1546748871c20e7)) + + +### Features + +* add app skeleton to avoid blank page when js loaded ([e2ed162](https://github.com/RSSNext/follow/commit/e2ed162b67d53452af01fe3a7aad3d70c995ff8d)) +* add appearance to set thumbnail ratio ([1d3f6bc](https://github.com/RSSNext/follow/commit/1d3f6bc910e3878debca3a7576f3891e6947b443)) +* add follow user button in profile modal ([#1147](https://github.com/RSSNext/follow/issues/1147)) ([7c60d5e](https://github.com/RSSNext/follow/commit/7c60d5e91dd4a21872217427bd99fe8eae688ce1)) +* add random color for user fallback bg ([dcbae89](https://github.com/RSSNext/follow/commit/dcbae89020e88947be693c100c644ee603519e96)) +* add updatelog modal ([84228bc](https://github.com/RSSNext/follow/commit/84228bc5c8755c4b957bc901e6e552ef176ed00c)) +* adjust more ui ([08929ab](https://github.com/RSSNext/follow/commit/08929ab3ae15758850d04b82f7773358579c4a78)) +* **discover:** improve trending style and discover no image placeholer ([86be1a2](https://github.com/RSSNext/follow/commit/86be1a2e46d3298157cece0731e687a462f833d5)) +* **external:** move `login` and `redirect` route to external ([7916803](https://github.com/RSSNext/follow/commit/791680332d5e1c2c52eda792dd7ff69281f25adb)) +* **external:** new open by deeplink logic ([71fcf50](https://github.com/RSSNext/follow/commit/71fcf50d0fd3ac30f8e9c45db90314672904a615)) +* focusable ([eb01d03](https://github.com/RSSNext/follow/commit/eb01d030129f6196d6e9855be42a218be9d5668b)) +* **icon:** use gradient fallback background ([e827002](https://github.com/RSSNext/follow/commit/e8270025e469d9a0463d267d3da591a2991951bd)) +* List delete add secondary confirmation ([#1254](https://github.com/RSSNext/follow/issues/1254)) ([14f2bac](https://github.com/RSSNext/follow/commit/14f2bac8f3ba7e8f2dbd3958a4394c5b11ea2537)) +* load archived entries automatically ([5fe9e0c](https://github.com/RSSNext/follow/commit/5fe9e0c0e24460ca0fe435db03b753e9dcd3df17)) +* move hideExtraBadge ([2f14c30](https://github.com/RSSNext/follow/commit/2f14c30307a895bc866ac57989df1dc624eab4e6)) +* **obsidian:** use readability content when available ([b4a3197](https://github.com/RSSNext/follow/commit/b4a3197e6ebd39bb259a6bc67f408569354a205e)) +* prefer origin addresses for content images ([d4d4345](https://github.com/RSSNext/follow/commit/d4d43451dec839b64239e1835b2ac1a1aa2478be)) +* **reader:** support custom css, fixed [#256](https://github.com/RSSNext/follow/issues/256) ([b251fa9](https://github.com/RSSNext/follow/commit/b251fa9421417c75d71707c8f08850f2cc902e1a)) +* support zen mode sidebar entry timeline selector ([4ab132c](https://github.com/RSSNext/follow/commit/4ab132c593a7acce0167d02f6025030775a9fac5)) +* unified feed title ([b86afe5](https://github.com/RSSNext/follow/commit/b86afe5a9789ad13c5a026adf553d2c6bc333bff)) +* use FeedTitle ([73d2c30](https://github.com/RSSNext/follow/commit/73d2c30416ad3f2da626db003996c0fb036025ac)) +* **ux:** support native space key to page down, fixed [#1121](https://github.com/RSSNext/follow/issues/1121) ([baa66fe](https://github.com/RSSNext/follow/commit/baa66feaf19416d2b9e5efe6b79f6af1b3966404)) +* zen mode and hide extra badge ([7ba07ad](https://github.com/RSSNext/follow/commit/7ba07adff1e7cd3292cc308f3e70803fe11fb8ce)) + + +### Performance Improvements + +* resolve feed item select area performance problem ([f87c0ff](https://github.com/RSSNext/follow/commit/f87c0ff2abfc430719894765796ca457c3f8e7f0)) + + + +## [0.1.1-beta.1](https://github.com/RSSNext/follow/compare/v0.1.1-beta.0...v0.1.1-beta.1) (2024-10-27) ### Bug Fixes @@ -67,6 +170,7 @@ * app got deleted when auto update on windows ([965544b](https://github.com/RSSNext/follow/commit/965544beef41f9c6549c64cd4f53e1a3935259ad)) * app icon incorrect in Windows Control Panel ([#899](https://github.com/RSSNext/follow/issues/899)) ([719f1da](https://github.com/RSSNext/follow/commit/719f1dae0e9762218b9e3c24b0aec2ced7f382be)) * app width limit to 1024px ([09d7765](https://github.com/RSSNext/follow/commit/09d77657a07f81d69f80c3eea1620efe1ddb9da9)) +* **app:** throw error popup when close window ([#1144](https://github.com/RSSNext/follow/issues/1144)) ([2ade4ae](https://github.com/RSSNext/follow/commit/2ade4aed28db8c936a51f20a4cf9437f536f1815)) * audio player async logic and auto pause logic ([ba40b44](https://github.com/RSSNext/follow/commit/ba40b44ce91bb8acd118b9c6d846ed8d5b9b022c)) * audioCover animation and estimatedMins style ([#523](https://github.com/RSSNext/follow/issues/523)) ([11ff31b](https://github.com/RSSNext/follow/commit/11ff31bd40af1884a1760d0d1ca5b9a726f13620)) * auto completion can not open when focus in modal ([591f13b](https://github.com/RSSNext/follow/commit/591f13b17f8a22c0c39718d67a88b2024c57efb7)) @@ -104,6 +208,7 @@ * ci and tootip portal ([3729917](https://github.com/RSSNext/follow/commit/37299173c8fcaf88d44b1a54baf7ddc03aa20ca6)) * ci env `NODE_OPTIONS` max-old-space-size ([b4f9b1b](https://github.com/RSSNext/follow/commit/b4f9b1b8ea326b1613ca291ed5bbcd932c5e837a)) * **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([4a14738](https://github.com/RSSNext/follow/commit/4a14738a99c7fd26dbf22c8de968a6896cbdc28b)), closes [/github.com/actions/runner/issues/2958#issuecomment-2186602747](https://github.com//github.com/actions/runner/issues/2958/issues/issuecomment-2186602747) +* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([#1078](https://github.com/RSSNext/follow/issues/1078)) ([cd00a20](https://github.com/RSSNext/follow/commit/cd00a2064228890f4891f5b15825d1f5a0d681e9)), closes [/github.com/actions/runner/issues/2958#issuecomment-2186602747](https://github.com//github.com/actions/runner/issues/2958/issues/issuecomment-2186602747) * **ci:** fetch all depth ([a504a12](https://github.com/RSSNext/follow/commit/a504a127bca93a6675b3ff02bcea0b1eca6e9707)) * **ci:** nightly build ([a4ce7b1](https://github.com/RSSNext/follow/commit/a4ce7b16f476b8d72a0b1761709ec1ceba591242)) * **ci:** nightly linux build ([702b1d9](https://github.com/RSSNext/follow/commit/702b1d976d52c49647d0433f2dd162c034d0abb4)) @@ -583,8 +688,8 @@ * type error ([c7f11f9](https://github.com/RSSNext/follow/commit/c7f11f99f28bf918aaf8c03b74145b2f9b126a72)) * type error ([5cd41ad](https://github.com/RSSNext/follow/commit/5cd41ad10ccbd241083d6f951509eb0bafe6e25f)) * type error ([60f8347](https://github.com/RSSNext/follow/commit/60f8347eec118176681a9ad7fcab7f45e383fc1b)) -* types ([5e2856f](https://github.com/RSSNext/follow/commit/5e2856f579d7b9ed10b37f00dec89fb627d44f95)) * types ([ad9a606](https://github.com/RSSNext/follow/commit/ad9a606b6bde6fb1771546e46bddccf0f14a6e7f)) +* types ([5e2856f](https://github.com/RSSNext/follow/commit/5e2856f579d7b9ed10b37f00dec89fb627d44f95)) * types ([f0767e2](https://github.com/RSSNext/follow/commit/f0767e2ad93d29db9a82b283f1163e340167be68)) * types ([831f0f8](https://github.com/RSSNext/follow/commit/831f0f892ac32bdb2963267e94c3130805924b59)) * types ([a116dd4](https://github.com/RSSNext/follow/commit/a116dd4018f90886239f7583cbc82b511ff2a902)) @@ -1009,6 +1114,7 @@ * prefetch for entry list ([5c7a27d](https://github.com/RSSNext/follow/commit/5c7a27de7dedfaf1812f26823207331543dfcead)) * reduce re-render when ctx menu open ([96ff9f6](https://github.com/RSSNext/follow/commit/96ff9f660c0a469daafbb5f5cad47370bcd3a8f0)) * reduce vite alias length ([8bc4771](https://github.com/RSSNext/follow/commit/8bc477100b8e5d3532d09875eda32004762eacca)) +* resolve feed item select area performance problem ([#1176](https://github.com/RSSNext/follow/issues/1176)) ([e1816e1](https://github.com/RSSNext/follow/commit/e1816e1a12d8b4a8a2c46d2b758a3ce07ee90f0d)) * shadow dom css cache ([c1e3a02](https://github.com/RSSNext/follow/commit/c1e3a025f7ef8ff570399a44a95797c2c8261e42)) * speed up user profile modal data loading ([53a5bae](https://github.com/RSSNext/follow/commit/53a5bae316b406ff5c250c3e7772ce4071891bee)) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..fbe794de5 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at follow@rss3.io. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md new file mode 100644 index 000000000..8b5af1149 --- /dev/null +++ b/CONTRIBUTE.md @@ -0,0 +1,71 @@ +# Contributing to Follow + +Thank you for considering contributing to Follow! We welcome contributions from the community to help improve and expand the project. + +## Getting Started + +Before you start contributing, please ensure you have enabled [Corepack](https://nodejs.org/api/corepack.html). Corepack ensures you are using the correct version of the package manager specified in the `package.json`. + +```sh +corepack enable +``` + +### Installing Dependencies + +To install the necessary dependencies, run: + +```sh +pnpm install +``` + +## Development Setup + +### Develop in the Browser + +For a more convenient development experience, we recommend developing in the browser: + +```sh +pnpm run dev:web +``` + +This will open the browser at `https://app.follow.is/__debug_proxy`, allowing you to access the online API environment for development and debugging. + +### Develop in Electron + +If you prefer to develop in Electron, follow these steps: + +1. Copy the example environment variables file: + + ```sh + cp .env.example .env + ``` + +2. Set `VITE_API_URL` to `https://api.follow.is` in your `.env` file. + +3. Run the development server: + + ```sh + pnpm run dev + ``` + +> **Tip:** If you encounter login issues, copy the `authjs.session-token` from your browser's cookies into the app. + +## Contribution Guidelines + +- Ensure your code follows the project's coding standards and conventions. +- Write clear, concise commit messages. +- Include relevant tests for your changes. +- Update documentation as necessary. + +## Community + +Join our community to discuss ideas, ask questions, and share your contributions: + +- [Discord](https://discord.gg/followapp) +- [Twitter](https://x.com/intent/follow?screen_name=follow_app_) + +We look forward to your contributions! + +## License + +By contributing to Follow, you agree that your contributions will be licensed under the GNU General Public License version 3, with the special exceptions noted in the `README.md`. diff --git a/README.md b/README.md index 1288c448f..bf4ee443b 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ If you have access, you are welcome to use the following methods to download and - You can get the installation packages for each platform from the [Releases page](https://github.com/RSSNext/Follow/releases). - If you are using Arch Linux, you can install package [follow-appimage](https://aur.archlinux.org/packages/follow-appimage) that maintained by [timochan](https://github.com/ttimochan). - If you are using Nix, you can install package [follow](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/fo/follow/package.nix) that maintained by [iosmanthus](https://github.com/iosmanthus). -- If you are using macOS with [Homebrew](https://brew.sh), you can install package [follow](https://formulae.brew.sh/cask/follow) or [follow@nightly](https://formulae.brew.sh/cask/follow@nightly) that maintained by [realSunyz](https://github.com/realSunyz). +- If you are using macOS with [Homebrew](https://brew.sh), you can install cask [follow](https://formulae.brew.sh/cask/follow) (also [@alpha](https://formulae.brew.sh/cask/follow@alpha) and [@nightly](https://formulae.brew.sh/cask/follow@nightly)) that maintained by [realSunyz](https://github.com/realSunyz). ## Contributing diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..c9cdec0ab --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,9 @@ +# Security Policy + +## Supported Versions + +We always recommend using the latest version of Follow to ensure you get all security updates. + +## Reporting a Vulnerability + +Please report security vulnerabilities to follow@rss3.io. diff --git a/apps/main/package.json b/apps/main/package.json index c14d007c7..184ccf7a5 100644 --- a/apps/main/package.json +++ b/apps/main/package.json @@ -19,7 +19,7 @@ "scripts": { "build": "tsup", "test": "vitest", - "typecheck": "tsup && tsc --noEmit" + "typecheck": "tsc --noEmit" }, "dependencies": { "@egoist/tipc": "0.3.2", diff --git a/apps/main/preload/index.ts b/apps/main/preload/index.ts index 82b05883c..fad6d2b9b 100644 --- a/apps/main/preload/index.ts +++ b/apps/main/preload/index.ts @@ -9,7 +9,22 @@ export const isMacOS = platform === "darwin" export const isWindows = platform === "win32" export const isLinux = platform === "linux" -export const isWindows11 = isWindows && os.version().startsWith("Windows 11") + +/** + * @see https://learn.microsoft.com/en-us/windows/release-health/windows11-release-information + * Windows 11 buildNumber starts from 22000. + */ +const detectingWindows11 = () => { + if (!isWindows) return false + + const release = os.release() + const majorVersion = Number.parseInt(release.split(".")[0]) + const buildNumber = Number.parseInt(release.split(".")[2]) + + return majorVersion === 10 && buildNumber >= 22000 +} + +export const isWindows11 = detectingWindows11() // Custom APIs for renderer const api = { diff --git a/apps/main/src/env.ts b/apps/main/src/env.ts index b221a3b79..d76b5cf24 100644 --- a/apps/main/src/env.ts +++ b/apps/main/src/env.ts @@ -11,4 +11,19 @@ export const isMacOS = platform === "darwin" export const isWindows = platform === "win32" export const isLinux = platform === "linux" -export const isWindows11 = isWindows && os.version().startsWith("Windows 11") + +/** + * @see https://learn.microsoft.com/en-us/windows/release-health/windows11-release-information + * Windows 11 buildNumber starts from 22000. + */ +const detectingWindows11 = () => { + if (!isWindows) return false + + const release = os.release() + const majorVersion = Number.parseInt(release.split(".")[0]) + const buildNumber = Number.parseInt(release.split(".")[2]) + + return majorVersion === 10 && buildNumber >= 22000 +} + +export const isWindows11 = detectingWindows11() diff --git a/apps/main/src/index.ts b/apps/main/src/index.ts index 836a807f3..3788672f6 100644 --- a/apps/main/src/index.ts +++ b/apps/main/src/index.ts @@ -2,6 +2,7 @@ import { electronApp, optimizer } from "@electron-toolkit/utils" import { callWindowExpose } from "@follow/shared/bridge" import { APP_PROTOCOL } from "@follow/shared/constants" import { env } from "@follow/shared/env" +import { imageRefererMatches, selfRefererMatches } from "@follow/shared/image" import { app, BrowserWindow, session } from "electron" import squirrelStartup from "electron-squirrel-startup" @@ -65,17 +66,25 @@ function bootstrap() { updateProxy() registerUpdater() - //remove Electron, Follow from user agent session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => { + // remove Electron, Follow from user agent let userAgent = details.requestHeaders["User-Agent"] if (userAgent) { userAgent = userAgent.replace(/\s?Electron\/[\d.]+/, "") userAgent = userAgent.replace(/\s?Follow\/[\d.a-zA-Z-]+/, "") } - if (env.VITE_OPENPANEL_API_URL && details.url.startsWith(env.VITE_OPENPANEL_API_URL)) { - details.requestHeaders["Origin"] = "https://app.follow.is" - } details.requestHeaders["User-Agent"] = userAgent + + // set referer and origin + if (selfRefererMatches.some((item) => details.url.startsWith(item))) { + details.requestHeaders["Referer"] = "https://app.follow.is" + details.requestHeaders["Origin"] = "https://app.follow.is" + } else { + const refererMatch = imageRefererMatches.find((item) => item.url.test(details.url)) + const referer = refererMatch?.referer || details.url + details.requestHeaders["Referer"] = referer + } + callback({ cancel: false, requestHeaders: details.requestHeaders }) }) @@ -155,6 +164,15 @@ function bootstrap() { domain: new URL(apiURL).hostname, sameSite: "no_restriction", }) + mainWindow.webContents.session.cookies.set({ + url: apiURL, + name: "authjs.callback-url", + value: env.VITE_WEB_URL, + secure: true, + httpOnly: true, + domain: new URL(apiURL).hostname, + sameSite: "no_restriction", + }) userId && (await callWindowExpose(mainWindow).clearIfLoginOtherAccount(userId)) mainWindow.reload() diff --git a/apps/main/src/window.ts b/apps/main/src/window.ts index 9833ab2ff..ba11ee409 100644 --- a/apps/main/src/window.ts +++ b/apps/main/src/window.ts @@ -3,7 +3,6 @@ import { fileURLToPath } from "node:url" import { is } from "@electron-toolkit/utils" import { callWindowExpose } from "@follow/shared/bridge" -import { IMAGE_PROXY_URL, imageRefererMatches } from "@follow/shared/image" import type { BrowserWindowConstructorOptions } from "electron" import { BrowserWindow, screen, shell } from "electron" @@ -122,19 +121,6 @@ export function createWindow( }) } - window.webContents.session.webRequest.onBeforeSendHeaders((details, callback) => { - const trueUrl = details.url.startsWith(IMAGE_PROXY_URL) - ? new URL(details.url).searchParams.get("url") || details.url - : details.url - const refererMatch = imageRefererMatches.find((item) => item.url.test(trueUrl)) - callback({ - requestHeaders: { - ...details.requestHeaders, - Referer: refererMatch?.referer || trueUrl, - }, - }) - }) - if (isWindows) { // Change the default font-family and font-size of the devtools. // Make it consistent with Chrome on Windows, instead of SimSun. diff --git a/apps/renderer/index.html b/apps/renderer/index.html index c0898a4c5..6758d0fc6 100644 --- a/apps/renderer/index.html +++ b/apps/renderer/index.html @@ -18,11 +18,12 @@ - + + - +
-+ + RSSHub has a temporary problem, please contact the our team. +
+
+ {attachOpenInEditor(stack)}
+
+ ) : null}
+
+ {t("achievement.nft_coming_soon")}
+
{item.value * monthlyBoostCost}
diff --git a/apps/renderer/src/modules/debug/registry.ts b/apps/renderer/src/modules/debug/registry.ts new file mode 100644 index 000000000..a84dea881 --- /dev/null +++ b/apps/renderer/src/modules/debug/registry.ts @@ -0,0 +1,25 @@ +class Registry { + private actions: Record{t.app("new_user_guide.step.shortcuts.description1")}