Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 77b6a3e0d5 | |||
| 4fb551106a | |||
| 7ee9be8e11 | |||
| f4b1f61bc2 | |||
| 7a7624866f | |||
| e5948cd346 | |||
| 929b838e0f | |||
| 1f8b539b68 | |||
| ce72892dc8 | |||
| 45b149ad58 | |||
| 1564d2dd30 | |||
| 1ea483016f | |||
| 4c6aeb3e6c | |||
| 13abfc1e52 | |||
| 13d0d7707a | |||
| 6ae9f49b4c | |||
| ea23f6264c | |||
| d0ba581184 | |||
| 5c956c195b | |||
| 4578116a30 | |||
| 45177e9fad | |||
| 2ca790abf9 | |||
| 2bce9a59c6 | |||
| 180f7a9baa | |||
| 019436507e | |||
| 63298d6827 | |||
| 3a7c67bb88 | |||
| 5d88ac783b | |||
| c98adb3051 | |||
| c48e16a977 | |||
| 661788ae75 | |||
| ecf0d9ff03 | |||
| de1db459c2 | |||
| 0c496c6ba6 | |||
| 8dff555db4 | |||
| a2d1840e47 | |||
| 73e0f1312c | |||
| 8ef7c75948 | |||
| fab72906c9 | |||
| 5d71f3b527 | |||
| 60dbd1be9d | |||
| bb0a09d627 | |||
| b106d91f8a | |||
| 8b5af6e172 | |||
| aff645bc5d | |||
| e8dd85ee65 | |||
| eeee62c4e8 | |||
| f7069fe07d | |||
| e4c2095004 | |||
| 95c10eca77 | |||
| 25857abf26 | |||
| 352b3c1b3c | |||
| ec1a4f7478 | |||
| 7192cda20f | |||
| aae03b6b0d | |||
| 48b69793ce | |||
| 4b47d3bda7 | |||
| fe4f7909e3 | |||
| 579d63d39d | |||
| d7f27eaf1e | |||
| 99e5622234 | |||
| e84bef07b4 | |||
| 3a9b5fb000 | |||
| 32022c1437 | |||
| bd3241504f | |||
| 8f6ff38a32 | |||
| 62b0514da7 | |||
| 485fe43140 | |||
| 074942fab4 | |||
| efe55fdc2f | |||
| 5d650e00f6 | |||
| 9bd5474401 | |||
| 011fa1f301 | |||
| 96cbb8ab30 | |||
| ae70bd2d75 | |||
| fba9443a30 | |||
| be15494ecd |
@@ -1,66 +0,0 @@
|
||||
name: API Docker Image
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
paths:
|
||||
- "apps/api/**"
|
||||
- ".github/workflows/api-docker-image.yml"
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "apps/api/**"
|
||||
- ".github/workflows/api-docker-image.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: api-docker-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
name: Build API Docker Image
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check Dockerfile
|
||||
id: dockerfile
|
||||
run: |
|
||||
if [ -f apps/api/Dockerfile ]; then
|
||||
echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "exists=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
if: steps.dockerfile.outputs.exists == 'true'
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
if: steps.dockerfile.outputs.exists == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build (PR/manual) or Build and Push (main)
|
||||
if: steps.dockerfile.outputs.exists == 'true'
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./apps/api
|
||||
file: ./apps/api/Dockerfile
|
||||
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}/api:${{ github.sha }}
|
||||
ghcr.io/${{ github.repository }}/api:latest
|
||||
|
||||
- name: Skip notice
|
||||
if: steps.dockerfile.outputs.exists != 'true'
|
||||
run: echo "apps/api/Dockerfile not found, skip docker build."
|
||||
@@ -1,59 +0,0 @@
|
||||
name: Deploy Admin
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "apps/admin/**"
|
||||
- "packages/shared-types/**"
|
||||
- "packages/ui/**"
|
||||
- ".github/workflows/deploy-admin.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: deploy-admin-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Admin
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.15.2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build workspace
|
||||
run: pnpm run build
|
||||
|
||||
deploy:
|
||||
name: Deploy Admin (Template)
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- name: Trigger deployment webhook
|
||||
env:
|
||||
ADMIN_DEPLOY_WEBHOOK_URL: ${{ secrets.ADMIN_DEPLOY_WEBHOOK_URL }}
|
||||
run: |
|
||||
if [ -z "$ADMIN_DEPLOY_WEBHOOK_URL" ]; then
|
||||
echo "ADMIN_DEPLOY_WEBHOOK_URL is not configured. Skipping deploy."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
curl -X POST "$ADMIN_DEPLOY_WEBHOOK_URL"
|
||||
echo "Admin deployment webhook triggered."
|
||||
@@ -1,59 +0,0 @@
|
||||
name: Deploy Web
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "apps/web/**"
|
||||
- "packages/shared-types/**"
|
||||
- "packages/ui/**"
|
||||
- ".github/workflows/deploy-web.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: deploy-web-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Web
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.15.2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build workspace
|
||||
run: pnpm run build
|
||||
|
||||
deploy:
|
||||
name: Deploy Web (Template)
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- name: Trigger deployment webhook
|
||||
env:
|
||||
WEB_DEPLOY_WEBHOOK_URL: ${{ secrets.WEB_DEPLOY_WEBHOOK_URL }}
|
||||
run: |
|
||||
if [ -z "$WEB_DEPLOY_WEBHOOK_URL" ]; then
|
||||
echo "WEB_DEPLOY_WEBHOOK_URL is not configured. Skipping deploy."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
curl -X POST "$WEB_DEPLOY_WEBHOOK_URL"
|
||||
echo "Web deployment webhook triggered."
|
||||
@@ -1,46 +0,0 @@
|
||||
name: PR Quality
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches: [main, develop]
|
||||
|
||||
concurrency:
|
||||
group: pr-quality-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
name: Lint, Typecheck, Test, Build
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.draft == false
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.15.2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Lint
|
||||
run: pnpm run lint
|
||||
|
||||
- name: Typecheck
|
||||
run: pnpm run typecheck
|
||||
|
||||
- name: Test
|
||||
run: pnpm run test
|
||||
|
||||
- name: Build
|
||||
run: pnpm run build
|
||||
@@ -1,6 +1,2 @@
|
||||
develop.md
|
||||
node_modules/
|
||||
.turbo/
|
||||
.idea/
|
||||
.eslintcache
|
||||
/.husky/_
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
pnpm lint:staged
|
||||
@@ -1,2 +0,0 @@
|
||||
pnpm typecheck
|
||||
pnpm test
|
||||
@@ -1,4 +0,0 @@
|
||||
module.exports = {
|
||||
"*.{js,mjs,cjs,ts,tsx}": ["eslint --fix", "prettier --write"],
|
||||
"*.{json,md,yml,yaml}": ["prettier --write"]
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
node_modules
|
||||
.turbo
|
||||
.idea
|
||||
dist
|
||||
build
|
||||
coverage
|
||||
*.png
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 100
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
# 贡献指南(Contributing)
|
||||
|
||||
本文档定义 TodoList 仓库的协作规范,所有贡献者提交代码前请先阅读。
|
||||
|
||||
## 1. 分支模型
|
||||
|
||||
- 长期分支:
|
||||
- `main`:生产稳定分支
|
||||
- `develop`:开发集成分支
|
||||
- 功能分支:
|
||||
- 命名:`feature/<phase>-<name>`
|
||||
- 示例:`feature/p1-code-quality-hooks`
|
||||
- 其他分支:
|
||||
- `release/<version>`
|
||||
- `hotfix/<issue-id>-<short-desc>`
|
||||
|
||||
## 2. 提交流程
|
||||
|
||||
1. 从目标基线分支切出功能分支。
|
||||
2. 每完成一个小功能,提交一个最小 commit。
|
||||
3. 完成后推送分支并创建 PR。
|
||||
4. 通过 Code Review 后再合并到目标分支。
|
||||
|
||||
## 3. Commit 规范
|
||||
|
||||
- 使用 Conventional Commits:
|
||||
- `feat(scope): ...`
|
||||
- `fix(scope): ...`
|
||||
- `chore(scope): ...`
|
||||
- `docs(scope): ...`
|
||||
- `test(scope): ...`
|
||||
- `ci(scope): ...`
|
||||
- 要求:
|
||||
- commit 粒度最小化,不要把多个不相关改动塞进一个提交。
|
||||
- commit 必须可回滚、可解释。
|
||||
- 默认使用 GPG 签名提交:`git commit -S`。
|
||||
|
||||
## 4. PR 规范
|
||||
|
||||
- PR 标题简明描述变更目标。
|
||||
- PR 描述至少包含:
|
||||
- 变更概述
|
||||
- 具体改动
|
||||
- 测试结果
|
||||
- 风险评估
|
||||
- 回滚方案
|
||||
- 一个 PR 只解决一类问题,避免“超大 PR”。
|
||||
|
||||
## 5. 代码质量检查
|
||||
|
||||
提交前建议至少执行:
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
pnpm run lint
|
||||
pnpm run typecheck
|
||||
pnpm run test
|
||||
```
|
||||
|
||||
说明:
|
||||
|
||||
- `pre-commit` 会自动执行 `lint-staged`。
|
||||
- `pre-push` 会自动执行 `typecheck + test`。
|
||||
|
||||
## 6. 变更边界要求
|
||||
|
||||
- 不要提交无关文件(例如本地 IDE 缓存、临时导出文件)。
|
||||
- 不要随意修改与当前任务无关的历史代码。
|
||||
- 如发现仓库出现非本人预期改动,先暂停并和维护者确认。
|
||||
@@ -1,62 +0,0 @@
|
||||
# ADR-XXXX:<决策标题>
|
||||
|
||||
- 状态:Proposed | Accepted | Deprecated | Superseded
|
||||
- 日期:YYYY-MM-DD
|
||||
- 决策人:<团队/人员>
|
||||
- 关联需求:<Issue/PR/文档链接>
|
||||
|
||||
## 背景
|
||||
|
||||
描述当前问题、约束条件,以及为什么现在必须做出这项决策。
|
||||
|
||||
## 决策驱动因素
|
||||
|
||||
- <驱动因素 1>
|
||||
- <驱动因素 2>
|
||||
- <驱动因素 3>
|
||||
|
||||
## 可选方案
|
||||
|
||||
1. <方案 A>
|
||||
2. <方案 B>
|
||||
3. <方案 C>
|
||||
|
||||
## 最终决策
|
||||
|
||||
选择方案:**<方案 X>**
|
||||
|
||||
说明选择该方案的理由,以及未选择其他方案的原因。
|
||||
|
||||
## 影响评估
|
||||
|
||||
### 正向影响
|
||||
|
||||
- <收益 1>
|
||||
- <收益 2>
|
||||
|
||||
### 负向影响 / 取舍
|
||||
|
||||
- <代价 1>
|
||||
- <代价 2>
|
||||
|
||||
## 实施计划
|
||||
|
||||
1. <步骤 1>
|
||||
2. <步骤 2>
|
||||
3. <步骤 3>
|
||||
|
||||
## 回滚方案
|
||||
|
||||
说明当风险发生时,如何撤销或回退这项决策。
|
||||
|
||||
## 验证清单
|
||||
|
||||
- [ ] 单元测试
|
||||
- [ ] 集成测试
|
||||
- [ ] 性能检查
|
||||
- [ ] 安全检查
|
||||
|
||||
## 参考资料
|
||||
|
||||
- <参考资料 1>
|
||||
- <参考资料 2>
|
||||
@@ -1,29 +0,0 @@
|
||||
import js from "@eslint/js";
|
||||
import globals from "globals";
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: ["**/node_modules/**", "**/.turbo/**", "**/dist/**", "**/build/**"]
|
||||
},
|
||||
js.configs.recommended,
|
||||
{
|
||||
files: ["**/*.{js,mjs}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
globals: {
|
||||
...globals.node
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ["**/*.cjs"],
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "commonjs",
|
||||
globals: {
|
||||
...globals.node
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "todolist",
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "turbo run test",
|
||||
"dev": "turbo run dev --parallel",
|
||||
"build": "turbo run build",
|
||||
"lint": "turbo run lint && eslint .",
|
||||
"typecheck": "turbo run typecheck",
|
||||
"format": "prettier --write .",
|
||||
"lint:staged": "lint-staged",
|
||||
"prepare": "husky"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.15.2",
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"eslint": "^10.2.0",
|
||||
"globals": "^17.4.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.4.0",
|
||||
"prettier": "^3.8.1",
|
||||
"turbo": "^2.9.3"
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
es2022: true,
|
||||
node: true
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module"
|
||||
},
|
||||
rules: {
|
||||
"no-console": "warn",
|
||||
"no-debugger": "error"
|
||||
}
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "@todolist/eslint-config",
|
||||
"version": "0.1.0",
|
||||
"description": "Shared ESLint config presets for TodoList",
|
||||
"main": "base.cjs",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"private": true,
|
||||
"files": [
|
||||
"base.cjs"
|
||||
]
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"strict": true,
|
||||
"noImplicitOverride": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "./base.json",
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "Node",
|
||||
"lib": ["ES2022"],
|
||||
"types": ["node"],
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"sourceMap": true
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"name": "@todolist/tsconfig",
|
||||
"version": "0.1.0",
|
||||
"description": "Shared TypeScript config presets for TodoList",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"private": true,
|
||||
"files": [
|
||||
"base.json",
|
||||
"react-app.json",
|
||||
"nest-app.json"
|
||||
]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "./base.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"jsx": "react-jsx",
|
||||
"types": ["vite/client"]
|
||||
}
|
||||
}
|
||||
Generated
-1215
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
packages:
|
||||
- "apps/*"
|
||||
- "packages/*"
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"tasks": {
|
||||
"dev": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"build": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["dist/**", "build/**"]
|
||||
},
|
||||
"lint": {
|
||||
"dependsOn": ["^lint"],
|
||||
"outputs": []
|
||||
},
|
||||
"test": {
|
||||
"dependsOn": ["^test"],
|
||||
"outputs": ["coverage/**"]
|
||||
},
|
||||
"typecheck": {
|
||||
"dependsOn": ["^typecheck"],
|
||||
"outputs": []
|
||||
},
|
||||
"format": {
|
||||
"outputs": []
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user