mirror of
https://fastgit.cc/github.com/openclaw/openclaw
synced 2026-04-20 21:02:10 +08:00
build: split tsgo core and extension graphs
This commit is contained in:
@@ -127,7 +127,14 @@
|
||||
- Node remains supported for running built output (`dist/*`) and production installs.
|
||||
- Mac packaging (dev): `scripts/package-mac-app.sh` defaults to current arch.
|
||||
- Type-check/build: `pnpm build`
|
||||
- TypeScript checks: `pnpm tsgo` (prod graph), `pnpm tsgo:test` (full colocated-test graph), `pnpm tsgo:all` (both; used by `pnpm check`). Targeted test graphs: `pnpm tsgo:test:src`, `pnpm tsgo:test:extensions`, `pnpm tsgo:test:ui`, `pnpm tsgo:test:packages`.
|
||||
- TypeScript checks are split by architecture boundary:
|
||||
- `pnpm tsgo` / `pnpm tsgo:core`: core production graph (`src/`, `ui/`, `packages/`; no `extensions/`).
|
||||
- `pnpm tsgo:core:test`: core colocated tests.
|
||||
- `pnpm tsgo:extensions`: bundled extension production graph.
|
||||
- `pnpm tsgo:extensions:test`: bundled extension colocated tests.
|
||||
- `pnpm tsgo:all`: every TypeScript graph above; this is what `pnpm check` runs.
|
||||
- Narrow aliases remain for local loops: `pnpm tsgo:test:src`, `pnpm tsgo:test:ui`, `pnpm tsgo:test:packages`.
|
||||
- Boundary rule: core must not know extension implementation details. Extensions hook into core through manifests, registries, capabilities, and public `openclaw/plugin-sdk/*` contracts. If you find core production code naming a specific extension, or a core test that is really testing extension-owned behavior, call it out and prefer moving coverage/logic to the owning extension or a generic contract test.
|
||||
- Lint/format: `pnpm check`
|
||||
- Local agent/dev shells default to host-aware `OPENCLAW_LOCAL_CHECK=1` behavior for `pnpm tsgo` and `pnpm lint`; set `OPENCLAW_LOCAL_CHECK_MODE=throttled` to force the lower-memory profile, `OPENCLAW_LOCAL_CHECK_MODE=full` to keep lock-only behavior, or `OPENCLAW_LOCAL_CHECK=0` in CI/shared runs.
|
||||
- Format check: `pnpm format:check` (oxfmt --check)
|
||||
|
||||
14
package.json
14
package.json
@@ -1465,11 +1465,15 @@
|
||||
"tool-display:check": "node --import tsx scripts/tool-display.ts --check",
|
||||
"tool-display:write": "node --import tsx scripts/tool-display.ts --write",
|
||||
"ts-topology": "node --import tsx scripts/ts-topology.ts",
|
||||
"tsgo": "pnpm tsgo:prod",
|
||||
"tsgo:all": "pnpm tsgo:prod && pnpm tsgo:test",
|
||||
"tsgo:prod": "node scripts/run-tsgo.mjs -p tsconfig.prod.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/prod.tsbuildinfo",
|
||||
"tsgo:test": "node scripts/run-tsgo.mjs -p tsconfig.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test.tsbuildinfo",
|
||||
"tsgo:test:extensions": "node scripts/run-tsgo.mjs -p tsconfig.test.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-extensions.tsbuildinfo",
|
||||
"tsgo": "pnpm tsgo:core",
|
||||
"tsgo:all": "pnpm tsgo:core && pnpm tsgo:core:test && pnpm tsgo:extensions && pnpm tsgo:extensions:test",
|
||||
"tsgo:core": "node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo",
|
||||
"tsgo:core:test": "node scripts/run-tsgo.mjs -p tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo",
|
||||
"tsgo:extensions": "node scripts/run-tsgo.mjs -p tsconfig.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions.tsbuildinfo",
|
||||
"tsgo:extensions:test": "node scripts/run-tsgo.mjs -p tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfo",
|
||||
"tsgo:prod": "pnpm tsgo:core && pnpm tsgo:extensions",
|
||||
"tsgo:test": "pnpm tsgo:core:test && pnpm tsgo:extensions:test",
|
||||
"tsgo:test:extensions": "pnpm tsgo:extensions:test",
|
||||
"tsgo:test:packages": "node scripts/run-tsgo.mjs -p tsconfig.test.packages.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-packages.tsbuildinfo",
|
||||
"tsgo:test:src": "node scripts/run-tsgo.mjs -p tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfo",
|
||||
"tsgo:test:ui": "node scripts/run-tsgo.mjs -p tsconfig.test.ui.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-ui.tsbuildinfo",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src/**/*", "ui/**/*", "packages/**/*"],
|
||||
"exclude": ["node_modules", "dist", "**/dist/**", "**/*.test.ts", "**/*.test.tsx", "test/**"]
|
||||
}
|
||||
15
tsconfig.core.test.json
Normal file
15
tsconfig.core.test.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "./tsconfig.test.json",
|
||||
"include": [
|
||||
"src/**/*.d.ts",
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.test.tsx",
|
||||
"ui/**/*.d.ts",
|
||||
"ui/src/ui/app.ts",
|
||||
"ui/**/*.test.ts",
|
||||
"ui/**/*.test.tsx",
|
||||
"packages/**/*.d.ts",
|
||||
"packages/**/*.test.ts",
|
||||
"packages/**/*.test.tsx"
|
||||
]
|
||||
}
|
||||
5
tsconfig.extensions.json
Normal file
5
tsconfig.extensions.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src/**/*.d.ts", "ui/src/**/*.d.ts", "extensions/**/*"],
|
||||
"exclude": ["node_modules", "dist", "**/dist/**", "**/*.test.ts", "**/*.test.tsx", "test/**"]
|
||||
}
|
||||
Reference in New Issue
Block a user