Skip to content

Commit dd4cfb5

Browse files
OXeuSittymindependabot[bot]nekomoyiAntigoneSemioticsClub
authored
chore: merge trunk (#421)
* feat: Add adjacent feeds feature (Closes #202) (#293) * style: Add placeholder div style: Fixed FeedCard width fix: Can't delete cache chore: Adding clear adjacent feed cache refactor: Adjacent feeds API feat: Adding some cache function style: Change flex direction on mobile screens feat: Adding adjacent feeds to the frontend feat: Adding adjacent feeds API to the backend * style: 调整上一篇/下一篇样式 Signed-off-by: Xeu <thankrain@qq.com> --------- Signed-off-by: Xeu <thankrain@qq.com> Co-authored-by: Sittymin <mail@sittymin.top> * fix: change adjacent sort strategy by created time Signed-off-by: Xeu <thankrain@qq.com> * style: adjust margin Signed-off-by: Xeu <thankrain@qq.com> * feat: Add additional translations and improve favicon update logic (#308) * fix: move getEnv into function for proper initialization (#309) * chore(deps-dev): bump vitest from 1.3.0 to 1.6.1 (#310) Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 1.3.0 to 1.6.1. - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v1.6.1/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: locked version * feat: Add sorting for friend list (#341) * feat: add Moments feature (#356) * fix(footer): update copyright year to be dynamic * feat(editor): add reusable markdown editor component * feat(db): add moments table and relations * feat(moments): add moments service with CRUD operations * feat(moments): add moments feature frontend * chore: remove unused import * fix: writing page layout * style(moments): adjust moments style & remove font cdn * feat: add error page and router permission handling (#358) * feat: Implement automatic UI scaling for high-DPI displays (#370) On high-resolution monitors (e.g., QHD, 4K), the UI elements and fonts appear too small, requiring users to manually zoom the browser for comfortable viewing. This commit introduces an automatic scaling mechanism to improve readability and user experience on these large displays. * docs: update documentation url * docs: update documentation url * Add cursor pointer to Table of Contents links (#385) * Add cursor pointer to Table of Contents links * Set cursor pointer opacity to 50 * fix Bun version (#389) * fix: 浏览器 无法显示 时间轴的问题 (#391) * Update DEPLOY.md (#408) * fix monaco editor IME problem (#407) * feat: implement AI summary feature with extensive model support (#411) This commit adds comprehensive AI summary functionality for articles with support for multiple AI providers and models. **Frontend:** - Add AI configuration UI in settings with manual save button - AI enable/disable toggle auto-saves immediately - Change provider/model inputs from text to select dropdowns for better UX - Provider/model selection dynamically updates available options - Add storage event listener to sync AI enabled state across pages - Add disabled prop support to Button component **Backend:** - Add AI configuration table (ai_config) with provider, model, API key, and URL - Add /ai-config API endpoint for CRUD operations - Integrate AI summary generation in feed service - Include AI enabled status in client config response **AI Providers Supported (5 providers, 70+ models):** - OpenAI: GPT-5/4/3.5 series (22 models) - Claude: 4.5/3 series (10 models) - Gemini: 3/2.5/2.0/1.5 series (14 models) - DeepSeek: chat/reasoner (2 models) - Zhipu: GLM-4 series (20 models) **Performance:** - Optimize config loading by including AI status in client config - Reduce API requests per page load from 2 to 1 **i18n:** - Add translations for AI configuration UI (zh-CN, en, ja, zh-TW) **Database:** - Migration 0005.sql adds ai_config table Co-authored-by: Claude <noreply@anthropic.com> * feat: support custom models * fix: custom apiUrl does not work * refactor: Simplifies the configuration of the local development environment (#417) * chore: update bun.lockb * chore: bump bun to 1.3.6 * ci: add pr check workflow * feat(release): implement automated release workflow with commit-based changelog generation (#418) Add automated release notes generation from conventional commits Create commit message convention documentation Enhance release script to auto-generate CHANGELOG templates Update release workflow to categorize commits (features, fixes, etc.) Improve CHANGELOG.md structure with detailed migration guides Update RELEASE.md documentation with new workflow The release process now: Extracts and categorizes commits by type (feat, fix, perf, etc.) Generates GitHub Release notes automatically Maintains detailed CHANGELOG.md for migration guides Enforces conventional commit format through documentation Refs: improved release mechanism design * docs: migrate documentation from standalone repo to main repository (#419) Move all docs from https://github.com/openRin/docs to docs/ directory Set up Rspress documentation site with bilingual support (zh/en) Include deploy guides, SEO/RSS configuration, changelog, and contribution guidelines Update README files to reference the new docs location Ensure code and documentation are now in sync within the same repository * docs: migrate remaining documentation to Rspress documentation site (#420) * docs: migrate remaining docs to documentation site - Move DEVELOPMENT.md to docs/docs/zh/guide/development.md - Move COMMIT_CONVENTION.md to docs/docs/zh/guide/commit-convention.md (translated to Chinese) - Move RELEASE.md to docs/docs/zh/guide/release.md (translated to Chinese) - Update _meta.json and _nav.json to include new pages - Remove legacy markdown files from docs/ root * docs: add English documentation for development, commit convention and release - Add docs/docs/en/guide/development.md (local development guide) - Add docs/docs/en/guide/commit-convention.md (commit message convention) - Add docs/docs/en/guide/release.md (release process) - Update en/_meta.json and en/_nav.json to include new pages This completes the bilingual documentation migration for all guide pages. * docs: update logo for docs & readme --------- Signed-off-by: Xeu <thankrain@qq.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Sittymin <mail@sittymin.top> Co-authored-by: Sittymin <45896075+Sittymin@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: nekomoyi <funny_mo_yi@foxmail.com> Co-authored-by: Antigone Semiotics Club <115871032+AntigoneSemioticsClub@users.noreply.github.com> Co-authored-by: Zhedong Cen <cenzhedong2@126.com> Co-authored-by: Zhipeng Luo <2830942138@qq.com> Co-authored-by: Mao Chenyu <chenyumao815@outlook.com> Co-authored-by: nicad <36125594+PBnicad@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 37205bc commit dd4cfb5

98 files changed

Lines changed: 6881 additions & 452 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Rin 本地开发配置
2+
# 复制此文件为 .env.local 并填入你的实际配置
3+
4+
# ============================================
5+
# 前端配置 (client/.env)
6+
# ============================================
7+
# 后端 API 地址
8+
API_URL=http://localhost:11498
9+
10+
# 网站基本信息
11+
NAME=YourName
12+
DESCRIPTION=Your Description
13+
AVATAR=https://avatars.githubusercontent.com/u/your-id
14+
15+
# 分页设置
16+
PAGE_SIZE=5
17+
18+
# RSS 设置
19+
RSS_ENABLE=false
20+
21+
# ============================================
22+
# 后端配置 (wrangler.toml 中的 vars)
23+
# ============================================
24+
# 前端地址(用于 Webhook 等)
25+
FRONTEND_URL=http://localhost:5173
26+
27+
# S3/R2 存储配置
28+
S3_FOLDER=images/
29+
S3_CACHE_FOLDER=cache/
30+
S3_REGION=auto
31+
S3_ENDPOINT=https://your-account.r2.cloudflarestorage.com
32+
S3_ACCESS_HOST=https://your-image-domain.com
33+
S3_BUCKET=your-bucket-name
34+
S3_FORCE_PATH_STYLE=false
35+
36+
# Webhook 通知地址(可选)
37+
WEBHOOK_URL=
38+
39+
# RSS 标题和描述
40+
RSS_TITLE=Rin Development
41+
RSS_DESCRIPTION=Development Environment
42+
43+
# ============================================
44+
# 敏感配置(会被加密存储)
45+
# ============================================
46+
# GitHub OAuth 配置
47+
RIN_GITHUB_CLIENT_ID=your-github-client-id
48+
RIN_GITHUB_CLIENT_SECRET=your-github-client-secret
49+
50+
# JWT 密钥
51+
JWT_SECRET=your-jwt-secret-key
52+
53+
# S3 访问密钥
54+
S3_ACCESS_KEY_ID=your-s3-access-key
55+
S3_SECRET_ACCESS_KEY=your-s3-secret-key
56+
57+
# ============================================
58+
# 数据库配置
59+
# ============================================
60+
DB_NAME=rin

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- trunk
8+
pull_request:
9+
branches:
10+
- main
11+
- trunk
12+
13+
jobs:
14+
check:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
26+
- name: Set up Bun
27+
uses: oven-sh/setup-bun@v1
28+
with:
29+
bun-version: 1.3.6
30+
31+
- name: Install dependencies
32+
run: bun install --frozen-lockfile
33+
34+
- name: Validate version consistency
35+
run: |
36+
# Check if all package.json files have the same version
37+
ROOT_VERSION=$(cat package.json | grep '"version"' | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
38+
39+
CLIENT_VERSION=$(cat client/package.json | grep '"version"' | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
40+
41+
SERVER_VERSION=""
42+
if [ -f server/package.json ]; then
43+
SERVER_VERSION=$(cat server/package.json | grep '"version"' | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
44+
fi
45+
46+
echo "Root version: $ROOT_VERSION"
47+
echo "Client version: $CLIENT_VERSION"
48+
echo "Server version: ${SERVER_VERSION:-N/A}"
49+
50+
if [ "$ROOT_VERSION" != "$CLIENT_VERSION" ]; then
51+
echo "❌ Version mismatch: root ($ROOT_VERSION) != client ($CLIENT_VERSION)"
52+
exit 1
53+
fi
54+
55+
if [ -n "$SERVER_VERSION" ] && [ "$ROOT_VERSION" != "$SERVER_VERSION" ]; then
56+
echo "❌ Version mismatch: root ($ROOT_VERSION) != server ($SERVER_VERSION)"
57+
exit 1
58+
fi
59+
60+
echo "✅ Version consistency check passed"
61+
62+
- name: Run typecheck
63+
run: bun run typecheck
64+
65+
- name: Run format check
66+
run: bun run format:check
67+
68+
- name: Run build
69+
run: bun run build

.github/workflows/deploy.yaml

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@ name: Deploy
22

33
on:
44
push:
5-
branches:
6-
- dev
7-
- main
8-
- fix/*
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
97
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version to deploy (e.g., v1.0.0)'
11+
required: false
12+
type: string
1013

1114
jobs:
1215
deploy:
1316
runs-on: ubuntu-latest
17+
# Only run on the main repository, not on forks by default
18+
# Forks can still manually trigger deployments
19+
if: github.repository == 'openRin/Rin' || github.event_name == 'workflow_dispatch'
1420

1521
steps:
1622
- name: Set up Node.js
@@ -22,12 +28,42 @@ jobs:
2228
uses: actions/checkout@v4
2329
with:
2430
path: Rin
31+
# If triggered by tag, checkout the tag
32+
ref: ${{ github.ref }}
2533

2634
- name: Set up Bun
2735
uses: oven-sh/setup-bun@v1
36+
with:
37+
bun-version: 1.3.6
38+
39+
- name: Validate deployment version
40+
run: |
41+
cd Rin/
42+
43+
# Get the version being deployed
44+
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ github.event.inputs.version }}" ]; then
45+
DEPLOY_VERSION="${{ github.event.inputs.version }}"
46+
# Remove 'v' prefix if present
47+
DEPLOY_VERSION=${DEPLOY_VERSION#v}
48+
else
49+
DEPLOY_VERSION=${GITHUB_REF#refs/tags/v}
50+
fi
51+
52+
# Get version from package.json
53+
PKG_VERSION=$(cat package.json | grep '"version"' | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
54+
55+
echo "Deploy version: $DEPLOY_VERSION"
56+
echo "Package version: $PKG_VERSION"
57+
58+
if [ "$DEPLOY_VERSION" != "$PKG_VERSION" ]; then
59+
echo "❌ Version mismatch: deploying $DEPLOY_VERSION but package.json is $PKG_VERSION"
60+
exit 1
61+
fi
62+
63+
echo "✅ Version validation passed"
2864
2965
- name: Deploy
30-
env: # Or as an environment variable
66+
env:
3167
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3268
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
3369
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
@@ -52,4 +88,12 @@ jobs:
5288
run: |
5389
cd Rin/
5490
bun install --frozen-lockfile
55-
bun scripts/migrator.ts
91+
bun scripts/deploy-cf.ts
92+
93+
- name: Notify deployment success
94+
if: success()
95+
run: |
96+
VERSION=${GITHUB_REF#refs/tags/v}
97+
echo "✅ Successfully deployed version $VERSION"
98+
echo ""
99+
echo "Deployment completed at $(date)"

.github/workflows/docs.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Deploy Rspress site to Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/docs.yml'
9+
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: false
20+
21+
jobs:
22+
# Build job
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
30+
31+
- name: Set up Bun
32+
uses: oven-sh/setup-bun@v1
33+
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v5
36+
37+
- name: Install dependencies
38+
working-directory: ./docs
39+
run: bun install
40+
41+
- name: Build with Rspress
42+
working-directory: ./docs
43+
run: bun run build
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: docs/doc_build
49+
50+
# Deployment job
51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
needs: build
56+
runs-on: ubuntu-latest
57+
name: Deploy
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)