AdmSysV2【公共组件库】@前端(For Git Submodule)
Tevin
3 days ago d0acdd3baa0338aaaefc0cf6dbeb00455307ea03
refactor: 重组项目结构 - 创建 test/ 和 example/ 目录

将测试从 src/test/ 迁移到根目录 test/。
创建 example/ 目录用于组件展示案例。
创建 src/types.ts 占位文件。
更新 STRUCTURE.md 反映新结构。

Co-Authored-By: ClaudeCode
1 files modified
4 files added
45 ■■■■ changed files
STRUCTURE.md 24 ●●●● patch | view | raw | blame | history
example/App.tsx 10 ●●●●● patch | view | raw | blame | history
example/index.css 5 ●●●●● patch | view | raw | blame | history
example/main.tsx 5 ●●●●● patch | view | raw | blame | history
src/types.ts 1 ●●●● patch | view | raw | blame | history
STRUCTURE.md
@@ -13,7 +13,8 @@
│   ├── plugins/            # 高级组件 - 复杂功能
│   ├── bases/              # 业务组件 - 领域特定
│   └── assets/             # 静态资源
├── test/                   # 测试案例(待补充)
├── test/                   # Vitest 测试配置和案例
├── example/                # 组件展示案例
├── public/                 # 公共资源
├── openspec/               # 变更管理
├── README.md               # 项目概述
@@ -119,18 +120,31 @@
└── ...
```
## test/ - 测试案例
## test/ - 测试目录
测试目录,待测试框架确定后补充结构。
Vitest 测试配置和测试案例。
初步规划:
```
test/
├── setup.ts       # Jest DOM 全局断言配置
├── unit/          # 单元测试
├── integration/   # 集成测试
└── e2e/           # 端到端测试
└── e2e/           # 端到端测试(Playwright)
```
## example/ - 组件展示案例
用于独立展示和调试组件的示例页面,是项目的入口点。
```
example/
├── App.tsx       # 演示应用入口
├── main.tsx      # 渲染入口
└── index.css    # 全局样式
```
**入口文件**: `index.html` 引用 `/example/main.tsx` 作为模块入口。
## 文件命名规范
### 组件文件
example/App.tsx
New file
@@ -0,0 +1,10 @@
function App() {
  return (
    <div style={{ padding: '20px' }}>
      <h1>admin2-components</h1>
      <p>组件展示示例(待开发)</p>
    </div>
  );
}
export default App;
example/index.css
New file
@@ -0,0 +1,5 @@
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
example/main.tsx
New file
@@ -0,0 +1,5 @@
import { createRoot } from 'react-dom/client';
import './index.css';
import App from './App';
createRoot(document.getElementById('root')!).render(<App />);
src/types.ts
New file
@@ -0,0 +1 @@
// 组件类型定义(待实现)