Prechádzať zdrojové kódy

docs(story): 为006.002故事添加多租户模块适配器参考

- 添加多租户模块适配器写法的具体文件路径参考
- 在任务列表中包含具体的代码示例
- 提供完整的适配器模式实现指导
- 确保开发者可以参照现有模式进行实现

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 3 týždňov pred
rodič
commit
e013aa68fb

+ 81 - 0
docs/stories/006.002.convert-independent-modules-to-adapter-pattern.story.md

@@ -24,17 +24,59 @@ Draft
 - [ ] 将 `user-module` 改为适配器模式 (AC: 1, 2, 3)
   - [ ] 清空现有 `packages/user-module/src` 目录中的完整代码
   - [ ] 创建适配器文件:`packages/user-module/src/index.ts`,重新导出 `@d8d/core-module/user-module`
+    - 参考多租户模块写法:`packages/user-module-mt/src/index.mt.ts`
+    - 代码示例:
+      ```typescript
+      // User Module Adapter Package
+      // 适配器包,从核心包重新导出所有接口
+      export * from '@d8d/core-module/user-module'
+      ```
   - [ ] 创建 `packages/user-module/src/schemas/index.ts`,重新导出 `@d8d/core-module/user-module/schemas`
+    - 参考多租户模块写法:`packages/user-module-mt/src/schemas/index.mt.ts`
+    - 代码示例:
+      ```typescript
+      // User Module Schemas Adapter
+      // 适配器包,从核心包重新导出schemas接口
+      export * from '@d8d/core-module/user-module/schemas'
+      ```
   - [ ] 更新 `packages/user-module/package.json`:简化依赖关系,只依赖 `@d8d/core-module`
 - [ ] 将 `auth-module` 改为适配器模式 (AC: 1, 2, 3)
   - [ ] 清空现有 `packages/auth-module/src` 目录中的完整代码
   - [ ] 创建适配器文件:`packages/auth-module/src/index.ts`,重新导出 `@d8d/core-module/auth-module`
+    - 参考多租户模块写法:`packages/auth-module-mt/src/index.mt.ts`
+    - 代码示例:
+      ```typescript
+      // Auth Module Adapter Package
+      // 适配器包,从核心包重新导出所有接口
+      export * from '@d8d/core-module/auth-module'
+      ```
   - [ ] 创建 `packages/auth-module/src/schemas/index.ts`,重新导出 `@d8d/core-module/auth-module/schemas`
+    - 参考多租户模块写法:`packages/auth-module-mt/src/schemas/index.mt.ts`
+    - 代码示例:
+      ```typescript
+      // Auth Module Schemas Adapter
+      // 适配器包,从核心包重新导出schemas接口
+      export * from '@d8d/core-module/auth-module/schemas'
+      ```
   - [ ] 更新 `packages/auth-module/package.json`:简化依赖关系,只依赖 `@d8d/core-module`
 - [ ] 将 `file-module` 改为适配器模式 (AC: 1, 2, 3)
   - [ ] 清空现有 `packages/file-module/src` 目录中的完整代码
   - [ ] 创建适配器文件:`packages/file-module/src/index.ts`,重新导出 `@d8d/core-module/file-module`
+    - 参考多租户模块写法:`packages/file-module-mt/src/index.ts`
+    - 代码示例:
+      ```typescript
+      // File Module Adapter Package
+      // 适配器包,从核心包重新导出所有接口
+      export * from '@d8d/core-module/file-module'
+      ```
   - [ ] 创建 `packages/file-module/src/schemas/index.ts`,重新导出 `@d8d/core-module/file-module/schemas`
+    - 参考多租户模块写法:`packages/file-module-mt/src/schemas/index.ts`
+    - 代码示例:
+      ```typescript
+      // File Module Schemas Adapter
+      // 适配器包,从核心包重新导出schemas接口
+      export * from '@d8d/core-module/file-module/schemas'
+      ```
   - [ ] 更新 `packages/file-module/package.json`:简化依赖关系,只依赖 `@d8d/core-module`
 - [ ] 验证适配器模式功能正常 (AC: 4, 5)
   - [ ] 确保所有导出都正确重定向到 `core-module`
@@ -109,6 +151,7 @@ Draft
    - 简化依赖关系,统一代码管理
 
 ### 文件路径参考
+#### Core-module 中的模块路径
 - `packages/core-module/user-module/src/index.ts` - core-module 中的用户模块入口
 - `packages/core-module/auth-module/src/index.ts` - core-module 中的认证模块入口
 - `packages/core-module/file-module/src/index.ts` - core-module 中的文件模块入口
@@ -116,6 +159,44 @@ Draft
 - `packages/core-module/auth-module/src/schemas/index.ts` - core-module 中的认证模式
 - `packages/core-module/file-module/src/schemas/index.ts` - core-module 中的文件模式
 
+#### 多租户模块适配器写法参考
+- `packages/user-module-mt/src/index.mt.ts` - 用户模块适配器入口(参考写法)
+  ```typescript
+  // User Module MT Adapter Package
+  // 适配器包,从核心包重新导出所有接口
+  export * from '@d8d/core-module-mt/user-module-mt'
+  ```
+- `packages/user-module-mt/src/schemas/index.mt.ts` - 用户模式适配器(参考写法)
+  ```typescript
+  // User Module MT Schemas Adapter
+  // 适配器包,从核心包重新导出schemas接口
+  export * from '@d8d/core-module-mt/user-module-mt/schemas'
+  ```
+- `packages/auth-module-mt/src/index.mt.ts` - 认证模块适配器入口(参考写法)
+  ```typescript
+  // Auth Module MT Adapter Package
+  // 适配器包,从核心包重新导出所有接口
+  export * from '@d8d/core-module-mt/auth-module-mt'
+  ```
+- `packages/auth-module-mt/src/schemas/index.mt.ts` - 认证模式适配器(参考写法)
+  ```typescript
+  // Auth Module MT Schemas Adapter
+  // 适配器包,从核心包重新导出schemas接口
+  export * from '@d8d/core-module-mt/auth-module-mt/schemas'
+  ```
+- `packages/file-module-mt/src/index.ts` - 文件模块适配器入口(参考写法)
+  ```typescript
+  // File Module MT Adapter Package
+  // 适配器包,从核心包重新导出所有接口
+  export * from '@d8d/core-module-mt/file-module-mt'
+  ```
+- `packages/file-module-mt/src/schemas/index.ts` - 文件模式适配器(参考写法)
+  ```typescript
+  // File Module MT Schemas Adapter
+  // 适配器包,从核心包重新导出schemas接口
+  export * from '@d8d/core-module-mt/file-module-mt/schemas'
+  ```
+
 ### 依赖关系简化
 当前独立模块依赖多个包:
 - `@d8d/shared-types`