提交 a496cc2f authored 作者: 王鹏飞's avatar 王鹏飞

docs: make learning scaffold independently verifiable

上级 74e84745
......@@ -475,6 +475,7 @@ Do not add generated `dist` contents.
- Create: `apps/learning/.eslintrc.cjs`
- Create: `apps/learning/vite.config.ts`
- Create: `apps/learning/src/vite-env.d.ts`
- Create: `apps/learning/src/test/setup.ts`
- Create: `apps/learning/src/main.tsx`
- Create: `apps/learning/src/router/RootLayout.tsx`
- Create: `apps/learning/src/router/routes.tsx`
......@@ -482,6 +483,7 @@ Do not add generated `dist` contents.
- Create: `apps/learning/src/modules/library/routes.tsx`
- Create: `apps/learning/src/modules/library/views/LibraryView.tsx`
- Modify: root `package.json`
- Modify: root `AGENTS.md`
**Interfaces:**
- Produces: package `@ebook/learning`, port 5173, output `dist/learning`.
......@@ -501,7 +503,7 @@ Create `apps/learning/package.json`:
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --max-warnings 0",
"test": "vitest run",
"test": "vitest run --passWithNoTests",
"test:watch": "vitest"
},
"dependencies": {
......@@ -619,6 +621,12 @@ Create `apps/learning/src/vite-env.d.ts`:
/// <reference types="vite/client" />
```
Create `apps/learning/src/test/setup.ts`:
```ts
import '@testing-library/jest-dom/vitest'
```
Create `apps/learning/.eslintrc.cjs`:
```js
......@@ -816,9 +824,11 @@ Run:
```bash
pnpm install
pnpm build:learning
pnpm test:learning
pnpm lint:learning
```
Expected: dependency installation and the placeholder learning build both exit 0.
Expected: dependency installation, the placeholder learning build, the no-tests test command, and lint all exit 0 without compatibility warnings. Update the root `AGENTS.md` command section so the newly created learning and combined workspace commands are listed as available rather than planned.
- [ ] **Step 6: Commit the learning toolchain foundation**
......@@ -832,7 +842,6 @@ git commit -m "feat: scaffold learning application foundation"
### Task 4: Prove URL-restorable state and React Query boundaries
**Files:**
- Create: `apps/learning/src/test/setup.ts`
- Create: `apps/learning/src/modules/library/api.ts`
- Create: `apps/learning/src/modules/library/query.ts`
- Create: `apps/learning/src/modules/library/query-state.ts`
......@@ -849,12 +858,6 @@ git commit -m "feat: scaffold learning application foundation"
- [ ] **Step 1: Write failing nuqs state tests**
Create `apps/learning/src/test/setup.ts`:
```ts
import '@testing-library/jest-dom/vitest'
```
Create `apps/learning/src/modules/library/query-state.test.tsx` using `renderHook`, `act`, and `withNuqsTestingAdapter` to assert:
```tsx
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论