chore: configure pnpm monorepo workspace
Signed-off-by: baizhi958216 <1475289190@qq.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
node_modules/
|
||||
.DS_Store
|
||||
.turbo/
|
||||
dist/
|
||||
*.tsbuildinfo
|
||||
@@ -0,0 +1,34 @@
|
||||
# Infiplot Monorepo
|
||||
|
||||
This workspace coordinates the Infiplot web and app codebases plus shared packages.
|
||||
|
||||
## Layout
|
||||
|
||||
- `infiplot-web`: existing open-source Next.js project. Treat this directory as read-only from the monorepo layer so it can continue to be maintained as its own repository.
|
||||
- `infiplot-app`: Expo / React Native app.
|
||||
- `packages/types`: shared TypeScript contracts and DTOs.
|
||||
- `packages/core`: shared framework-agnostic business logic.
|
||||
- `packages/api-client`: typed client for the web API surface.
|
||||
- `packages/ui`: cross-platform UI entry points. Keep platform-specific code behind `.web.tsx` / `.native.tsx` files.
|
||||
|
||||
## Commands
|
||||
|
||||
```sh
|
||||
pnpm dev:web
|
||||
pnpm dev:app
|
||||
pnpm build:web
|
||||
pnpm check
|
||||
```
|
||||
|
||||
## Design Rules
|
||||
|
||||
The monorepo owns orchestration, shared packages, and app integration. It should not rewrite files inside `infiplot-web`; any future web changes should happen in the upstream web repository and be pulled back here.
|
||||
|
||||
Shared code should move in this order:
|
||||
|
||||
1. Types and API contracts into `packages/types`.
|
||||
2. Pure business logic into `packages/core`.
|
||||
3. HTTP/API access into `packages/api-client`.
|
||||
4. UI primitives into `packages/ui`, with separate platform entry points when necessary.
|
||||
|
||||
Avoid importing directly from `infiplot-web/lib/*` in the app. Promote stable contracts into `packages/*` first, then consume those packages from both sides when the web repository is ready to adopt them upstream.
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "infiplot-monorepo",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.12.0",
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
},
|
||||
"scripts": {
|
||||
"dev:web": "pnpm --filter infiplot dev",
|
||||
"dev:ios": "pnpm --filter infiplot-app ios",
|
||||
"build:web": "pnpm --filter infiplot build",
|
||||
"lint": "pnpm --recursive --if-present lint",
|
||||
"typecheck": "pnpm --recursive --if-present typecheck",
|
||||
"check": "pnpm lint && pnpm typecheck"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^6.0.3"
|
||||
}
|
||||
}
|
||||
Generated
+10359
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,16 @@
|
||||
packages:
|
||||
- "infiplot-web"
|
||||
- "infiplot-app"
|
||||
- "packages/*"
|
||||
|
||||
allowBuilds:
|
||||
'@fortawesome/fontawesome-free': true
|
||||
esbuild: true
|
||||
sharp: true
|
||||
workerd: true
|
||||
|
||||
onlyBuiltDependencies:
|
||||
- "@fortawesome/fontawesome-free"
|
||||
- "esbuild"
|
||||
- "sharp"
|
||||
- "workerd"
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"verbatimModuleSyntax": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user