From cdbd3e1092474ae65fcd6064966a3bb8c297f907 Mon Sep 17 00:00:00 2001 From: Yaosanqi137 Date: Sat, 4 Apr 2026 11:43:36 +0800 Subject: [PATCH 1/4] chore(repo): initialize pnpm workspace and turbo pipeline --- .gitignore | 4 ++- package.json | 22 +++++++++++++ pnpm-lock.yaml | 78 +++++++++++++++++++++++++++++++++++++++++++++ pnpm-workspace.yaml | 3 ++ turbo.json | 28 ++++++++++++++++ 5 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 turbo.json diff --git a/.gitignore b/.gitignore index 5fcdc0a..5074169 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ develop.md -.idea/ \ No newline at end of file +node_modules/ +.turbo/ +.idea/ diff --git a/package.json b/package.json new file mode 100644 index 0000000..58df56e --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "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", + "typecheck": "turbo run typecheck", + "format": "turbo run format" + }, + "keywords": [], + "author": "", + "license": "GPL-3.0-or-later", + "private": true, + "packageManager": "pnpm@9.15.2", + "devDependencies": { + "turbo": "^2.9.3" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..91f5927 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,78 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + turbo: + specifier: ^2.9.3 + version: 2.9.3 + +packages: + + '@turbo/darwin-64@2.9.3': + resolution: {integrity: sha512-P8foouaP+y/p+hhEGBoZpzMbpVvUMwPjDpcy6wN7EYfvvyISD1USuV27qWkczecihwuPJzQ1lDBuL8ERcavTyg==} + cpu: [x64] + os: [darwin] + + '@turbo/darwin-arm64@2.9.3': + resolution: {integrity: sha512-SIzEkvtNdzdI50FJDaIQ6kQGqgSSdFPcdn0wqmmONN6iGKjy6hsT+EH99GP65FsfV7DLZTh2NmtTIRl2kdoz5Q==} + cpu: [arm64] + os: [darwin] + + '@turbo/linux-64@2.9.3': + resolution: {integrity: sha512-pLRwFmcHHNBvsCySLS6OFabr/07kDT2pxEt/k6eBf/3asiVQZKJ7Rk88AafQx2aYA641qek4RsXvYO3JYpiBug==} + cpu: [x64] + os: [linux] + + '@turbo/linux-arm64@2.9.3': + resolution: {integrity: sha512-gy6ApUroC2Nzv+qjGtE/uPNkhHAFU4c8God+zd5Aiv9L9uBgHlxVJpHT3XWl5xwlJZ2KWuMrlHTaS5kmNB+q1Q==} + cpu: [arm64] + os: [linux] + + '@turbo/windows-64@2.9.3': + resolution: {integrity: sha512-d0YelTX6hAsB7kIEtGB3PzIzSfAg3yDoUlHwuwJc3adBXUsyUIs0YLG+1NNtuhcDOUGnWQeKUoJ2pGWvbpRj7w==} + cpu: [x64] + os: [win32] + + '@turbo/windows-arm64@2.9.3': + resolution: {integrity: sha512-/08CwpKJl3oRY8nOlh2YgilZVJDHsr60XTNxRhuDeuFXONpUZ5X+Nv65izbG/xBew9qxcJFbDX9/sAmAX+ITcQ==} + cpu: [arm64] + os: [win32] + + turbo@2.9.3: + resolution: {integrity: sha512-J/VUvsGRykPb9R8Kh8dHVBOqioDexLk9BhLCU/ZybRR+HN9UR3cURdazFvNgMDt9zPP8TF6K73Z+tplfmi0PqQ==} + hasBin: true + +snapshots: + + '@turbo/darwin-64@2.9.3': + optional: true + + '@turbo/darwin-arm64@2.9.3': + optional: true + + '@turbo/linux-64@2.9.3': + optional: true + + '@turbo/linux-arm64@2.9.3': + optional: true + + '@turbo/windows-64@2.9.3': + optional: true + + '@turbo/windows-arm64@2.9.3': + optional: true + + turbo@2.9.3: + optionalDependencies: + '@turbo/darwin-64': 2.9.3 + '@turbo/darwin-arm64': 2.9.3 + '@turbo/linux-64': 2.9.3 + '@turbo/linux-arm64': 2.9.3 + '@turbo/windows-64': 2.9.3 + '@turbo/windows-arm64': 2.9.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..3ff5faa --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - "apps/*" + - "packages/*" diff --git a/turbo.json b/turbo.json new file mode 100644 index 0000000..9bdd423 --- /dev/null +++ b/turbo.json @@ -0,0 +1,28 @@ +{ + "$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": [] + } + } +} From 80cc9827004e69e56e3dad4bfd6260f70f53057b Mon Sep 17 00:00:00 2001 From: Yaosanqi137 Date: Sat, 4 Apr 2026 11:57:31 +0800 Subject: [PATCH 2/4] chore(config): add shared tsconfig and eslint packages --- packages/eslint-config/base.cjs | 16 ++++++++++++++++ packages/eslint-config/package.json | 11 +++++++++++ packages/tsconfig/base.json | 17 +++++++++++++++++ packages/tsconfig/nest-app.json | 13 +++++++++++++ packages/tsconfig/package.json | 12 ++++++++++++ packages/tsconfig/react-app.json | 9 +++++++++ pnpm-lock.yaml | 4 ++++ 7 files changed, 82 insertions(+) create mode 100644 packages/eslint-config/base.cjs create mode 100644 packages/eslint-config/package.json create mode 100644 packages/tsconfig/base.json create mode 100644 packages/tsconfig/nest-app.json create mode 100644 packages/tsconfig/package.json create mode 100644 packages/tsconfig/react-app.json diff --git a/packages/eslint-config/base.cjs b/packages/eslint-config/base.cjs new file mode 100644 index 0000000..6ff0a72 --- /dev/null +++ b/packages/eslint-config/base.cjs @@ -0,0 +1,16 @@ +/** @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" + } +}; diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json new file mode 100644 index 0000000..1d92afd --- /dev/null +++ b/packages/eslint-config/package.json @@ -0,0 +1,11 @@ +{ + "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" + ] +} diff --git a/packages/tsconfig/base.json b/packages/tsconfig/base.json new file mode 100644 index 0000000..d204bc0 --- /dev/null +++ b/packages/tsconfig/base.json @@ -0,0 +1,17 @@ +{ + "$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 + } +} diff --git a/packages/tsconfig/nest-app.json b/packages/tsconfig/nest-app.json new file mode 100644 index 0000000..e6c45a9 --- /dev/null +++ b/packages/tsconfig/nest-app.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./base.json", + "compilerOptions": { + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2022"], + "types": ["node"], + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "sourceMap": true + } +} diff --git a/packages/tsconfig/package.json b/packages/tsconfig/package.json new file mode 100644 index 0000000..d34f6cb --- /dev/null +++ b/packages/tsconfig/package.json @@ -0,0 +1,12 @@ +{ + "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" + ] +} diff --git a/packages/tsconfig/react-app.json b/packages/tsconfig/react-app.json new file mode 100644 index 0000000..a785dfb --- /dev/null +++ b/packages/tsconfig/react-app.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./base.json", + "compilerOptions": { + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "jsx": "react-jsx", + "types": ["vite/client"] + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 91f5927..00cebb6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,6 +12,10 @@ importers: specifier: ^2.9.3 version: 2.9.3 + packages/eslint-config: {} + + packages/tsconfig: {} + packages: '@turbo/darwin-64@2.9.3': From 31dbb70bfb59a7783652c734fae9a6be99bdc44c Mon Sep 17 00:00:00 2001 From: Yaosanqi137 Date: Sat, 4 Apr 2026 12:00:42 +0800 Subject: [PATCH 3/4] chore(repo): scaffold apps and packages directories --- apps/admin/.gitkeep | 0 apps/api/.gitkeep | 0 apps/web/.gitkeep | 0 packages/sdk/.gitkeep | 0 packages/shared-types/.gitkeep | 0 packages/ui/.gitkeep | 0 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/admin/.gitkeep create mode 100644 apps/api/.gitkeep create mode 100644 apps/web/.gitkeep create mode 100644 packages/sdk/.gitkeep create mode 100644 packages/shared-types/.gitkeep create mode 100644 packages/ui/.gitkeep diff --git a/apps/admin/.gitkeep b/apps/admin/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/api/.gitkeep b/apps/api/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/web/.gitkeep b/apps/web/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/sdk/.gitkeep b/packages/sdk/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/shared-types/.gitkeep b/packages/shared-types/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/ui/.gitkeep b/packages/ui/.gitkeep new file mode 100644 index 0000000..e69de29 From 91ce1afdfc13004468bd018f8b1fe344a8524e00 Mon Sep 17 00:00:00 2001 From: Yaosanqi137 Date: Sat, 4 Apr 2026 12:04:16 +0800 Subject: [PATCH 4/4] docs(architecture): add ADR template --- docs/architecture/ADR-template.md | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 docs/architecture/ADR-template.md diff --git a/docs/architecture/ADR-template.md b/docs/architecture/ADR-template.md new file mode 100644 index 0000000..150cc1b --- /dev/null +++ b/docs/architecture/ADR-template.md @@ -0,0 +1,62 @@ +# ADR-XXXX:<决策标题> + +- 状态:Proposed | Accepted | Deprecated | Superseded +- 日期:YYYY-MM-DD +- 决策人:<团队/人员> +- 关联需求: + +## 背景 + +描述当前问题、约束条件,以及为什么现在必须做出这项决策。 + +## 决策驱动因素 + +- <驱动因素 1> +- <驱动因素 2> +- <驱动因素 3> + +## 可选方案 + +1. <方案 A> +2. <方案 B> +3. <方案 C> + +## 最终决策 + +选择方案:**<方案 X>** + +说明选择该方案的理由,以及未选择其他方案的原因。 + +## 影响评估 + +### 正向影响 + +- <收益 1> +- <收益 2> + +### 负向影响 / 取舍 + +- <代价 1> +- <代价 2> + +## 实施计划 + +1. <步骤 1> +2. <步骤 2> +3. <步骤 3> + +## 回滚方案 + +说明当风险发生时,如何撤销或回退这项决策。 + +## 验证清单 + +- [ ] 单元测试 +- [ ] 集成测试 +- [ ] 性能检查 +- [ ] 安全检查 + +## 参考资料 + +- <参考资料 1> +- <参考资料 2>