refactor: 只保留 Web,移除 Capacitor 原生壳
删除 android/、ios/ 两个 Capacitor 原生工程与 capacitor.config.ts、 ionic.config.json,以及 scripts/android、scripts/ios.sh 构建脚本; 根与 apps/web 的 @capacitor/* 依赖和相关 npm scripts 一并移除。 Web 侧去掉原生分支:登录只走云乐坊容器授权面板或顶层重定向, 暗色模式不再改原生状态栏,移除 Android 物理返回键处理。 保留 @nuxtjs/ionic(Web UI 框架)、云乐坊 window.ylf 桥接与 PWA。 决策记录见 docs/decisions/0004-web-only.md。
This commit is contained in:
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
## Project Overview
|
||||
|
||||
Cook (食用手册) is a Chinese recipe web/mobile app for finding recipes based on available ingredients. Built with Nuxt 4 (Vue 3, CSR-only), Ionic UI, and Capacitor for native iOS/Android apps. The UI and content are in Chinese.
|
||||
Cook (食用手册) is a Chinese recipe web app for finding recipes based on available ingredients. Built with Nuxt 4 (Vue 3, CSR-only) and Ionic UI, shipped as a Web app only (browser + YunLeFun container). The UI and content are in Chinese.
|
||||
|
||||
## Common Commands
|
||||
|
||||
@@ -14,7 +14,7 @@ pnpm convert # Convert CSV recipe data → JSON (required before fi
|
||||
pnpm validate # Validate recipe.csv (ids, ingredient/tool dictionary, values, video ids)
|
||||
pnpm feedback:pull # Pull in-app feedback + search signals from CloudBase (needs .env)
|
||||
pnpm eval:search # Evaluate recommendation ranking against real search signals
|
||||
pnpm fixtures # Regenerate shared Web/iOS recommendation fixtures (after data, alias or ranking changes)
|
||||
pnpm fixtures # Regenerate shared recommendation fixtures (after data, alias or ranking changes)
|
||||
pnpm dev # Dev server on http://localhost:3333
|
||||
pnpm lint # ESLint check (uses @antfu/eslint-config flat config)
|
||||
pnpm lint --fix # Auto-fix lint issues
|
||||
@@ -24,15 +24,6 @@ pnpm test -- --run # Run tests once without watch
|
||||
pnpm build # Full production build (convert + nuxt generate)
|
||||
```
|
||||
|
||||
### Mobile Development
|
||||
|
||||
```bash
|
||||
pnpm dev:ios # iOS with live reload (cap run ios -l)
|
||||
pnpm dev:android # Android dev
|
||||
pnpm ios # Open in Xcode
|
||||
pnpm android # Open in Android Studio
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
### Data Pipeline
|
||||
@@ -43,14 +34,14 @@ Project decisions are recorded in `docs/decisions/` — read the relevant one be
|
||||
|
||||
### Monorepo Structure (pnpm workspaces)
|
||||
|
||||
Layout follows `docs/decisions/0003-native-ios-monorepo.md`; the plan is in `docs/dev/ios-roadmap.md`.
|
||||
Layout follows `docs/decisions/0004-web-only.md`.
|
||||
|
||||
- **apps/web** — Nuxt app (main application). Root scripts (`pnpm dev`, `pnpm build`, `pnpm typecheck`) proxy to it; `pnpm build` copies `apps/web/dist` to the root `dist/` that deploy targets and Capacitor read
|
||||
- **packages/data** — Data shared by Web and iOS: recipe CSV sources and the JSON generated from them (imported in the web app as `@cook/data/*`), the food dictionary (`food.json`), pantry defaults (`pantry.json`), ingredient aliases (`aliases.json`), and recommendation fixtures (`fixtures/recommend.json`, regenerate with `pnpm fixtures`)
|
||||
- **packages/cook** — Types, recommendation/search logic (the TS core the iOS CookCore mirrors), and the CLI (`convert`, `search`)
|
||||
- **apps/web** — Nuxt app (main application). Root scripts (`pnpm dev`, `pnpm build`, `pnpm typecheck`) proxy to it; `pnpm build` copies `apps/web/dist` to the root `dist/` that deploy targets read
|
||||
- **packages/data** — Recipe CSV sources and the JSON generated from them (imported in the web app as `@cook/data/*`), the food dictionary (`food.json`), pantry defaults (`pantry.json`), ingredient aliases (`aliases.json`), and recommendation fixtures (`fixtures/recommend.json`, regenerate with `pnpm fixtures`)
|
||||
- **packages/cook** — Types, recommendation/search logic, and the CLI (`convert`, `search`)
|
||||
- **docs** — VitePress documentation site
|
||||
- **scripts** — Build/utility scripts
|
||||
- **Root** — Workspace tooling, tests (`test/`), Capacitor shell (`capacitor.config.ts`, `ios/`, `android/`), `cloudfunctions/`
|
||||
- **Root** — Workspace tooling, tests (`test/`), `cloudfunctions/`
|
||||
|
||||
### App Source (`apps/web/app/`)
|
||||
|
||||
@@ -84,13 +75,14 @@ pnpm test -- test/recipe.test.ts
|
||||
|
||||
## Code Style
|
||||
|
||||
Uses `@antfu/eslint-config` (flat config) with UnoCSS and formatters enabled. Pre-commit hook runs `lint-staged` via `simple-git-hooks`. Ignored paths include `packages/data/**/*.json`, `ios/`, `android/`, `dist/`.
|
||||
Uses `@antfu/eslint-config` (flat config) with UnoCSS and formatters enabled. Pre-commit hook runs `lint-staged` via `simple-git-hooks`. Ignored paths include `packages/data/**/*.json`, `dist/`.
|
||||
|
||||
## Environment Variables
|
||||
|
||||
See `.env.example`:
|
||||
|
||||
- `APPLE_DEVELOPMENT_TEAM` — iOS signing
|
||||
- `NUXT_PUBLIC_CLARITY_PROJECT_ID` / `NUXT_PUBLIC_CLARITY_DOMAINS` — Microsoft Clarity statistics (leave the project ID empty to disable)
|
||||
- `COOK_FEEDBACK_URL` / `COOK_FEEDBACK_TOKEN` — feedback export endpoint and its token (used by `pnpm feedback:pull`)
|
||||
|
||||
## Node/Package Manager
|
||||
|
||||
|
||||
Reference in New Issue
Block a user