diff --git a/AGENTS.md b/AGENTS.md index 4f99bdecac..69b864ab7e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -50,13 +50,13 @@ - Node remains supported for running built output (`dist/*`) and production installs. - Mac packaging (dev): `scripts/package-mac-app.sh` defaults to current arch. Release checklist: `docs/platforms/mac/release.md`. - Type-check/build: `pnpm build` -- Lint/format: `pnpm lint` (oxlint), `pnpm format` (oxfmt) +- Lint/format: `pnpm check` - Tests: `pnpm test` (vitest); coverage: `pnpm test:coverage` ## Coding Style & Naming Conventions - Language: TypeScript (ESM). Prefer strict typing; avoid `any`. -- Formatting/linting via Oxlint and Oxfmt; run `pnpm lint` before commits. +- Formatting/linting via Oxlint and Oxfmt; run `pnpm check` before commits. - Add brief code comments for tricky or non-obvious logic. - Keep files concise; extract helpers instead of “V2” copies. Use existing patterns for CLI options and dependency injection via `createDefaultDeps`. - Aim to keep files under ~700 LOC; guideline only (not a hard guardrail). Split/refactor when it improves clarity or testability. @@ -105,7 +105,7 @@ ### PR Workflow (Review vs Land) - **Review mode (PR link only):** read `gh pr view/diff`; **do not** switch branches; **do not** change code. -- **Landing mode:** create an integration branch from `main`, bring in PR commits (**prefer rebase** for linear history; **merge allowed** when complexity/conflicts make it safer), apply fixes, add changelog (+ thanks + PR #), run full gate **locally before committing** (`pnpm lint && pnpm build && pnpm test`), commit, merge back to `main`, then `git switch main` (never stay on a topic branch after landing). Important: contributor needs to be in git graph after this! +- **Landing mode:** create an integration branch from `main`, bring in PR commits (**prefer rebase** for linear history; **merge allowed** when complexity/conflicts make it safer), apply fixes, add changelog (+ thanks + PR #), run full gate **locally before committing** (`pnpm build && pnpm check && pnpm test`), commit, merge back to `main`, then `git switch main` (never stay on a topic branch after landing). Important: contributor needs to be in git graph after this! ## Security & Configuration Tips diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1bf0c961c4..ffd628a75d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,9 @@ Welcome to the lobster tank! 🦞 - **Jos** - Telegram, API, Nix mode - GitHub: [@joshp123](https://github.com/joshp123) · X: [@jjpcodes](https://x.com/jjpcodes) +- **Christoph Nakazawa** - JS Infra + - GitHub: [@cpojer](https://github.com/cpojer) · X: [@cnakazawa](https://x.com/cnakazawa) + ## How to Contribute 1. **Bugs & small fixes** → Open a PR! @@ -28,7 +31,7 @@ Welcome to the lobster tank! 🦞 ## Before You PR - Test locally with your OpenClaw instance -- Run tests: `pnpm tsgo && pnpm format && pnpm lint && pnpm build && pnpm test` +- Run tests: `pnpm build && pnpm check && pnpm test` - Keep PRs focused (one thing per PR) - Describe what & why diff --git a/docs.acp.md b/docs.acp.md index 00950c9a5f..cfe7349c34 100644 --- a/docs.acp.md +++ b/docs.acp.md @@ -188,7 +188,7 @@ updates. Terminal Gateway states map to ACP `done` with stop reasons: ## Testing - Unit: `src/acp/session.test.ts` covers run id lifecycle. -- Full gate: `pnpm lint && pnpm build && pnpm test && pnpm docs:build`. +- Full gate: `pnpm build && pnpm check && pnpm test && pnpm docs:build`. ## Related Docs diff --git a/docs/reference/RELEASING.md b/docs/reference/RELEASING.md index de3a6be9d3..53ed5fb6fa 100644 --- a/docs/reference/RELEASING.md +++ b/docs/reference/RELEASING.md @@ -41,9 +41,9 @@ When the operator says “release”, immediately do this preflight (no extra qu 4. **Validation** -- [ ] `pnpm lint` +- [ ] `pnpm build` +- [ ] `pnpm check` - [ ] `pnpm test` (or `pnpm test:coverage` if you need coverage output) -- [ ] `pnpm run build` (last sanity check after tests) - [ ] `pnpm release:check` (verifies npm pack contents) - [ ] `OPENCLAW_INSTALL_SMOKE_SKIP_NONROOT=1 pnpm test:install:smoke` (Docker install smoke test, fast path; required before release) - If the immediate previous npm release is known broken, set `OPENCLAW_INSTALL_SMOKE_PREVIOUS=` or `OPENCLAW_INSTALL_SMOKE_SKIP_PREVIOUS=1` for the preinstall step. diff --git a/docs/testing.md b/docs/testing.md index cb2a06e367..75c2762529 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -22,7 +22,7 @@ This doc is a “how we test” guide: Most days: -- Full gate (expected before push): `pnpm lint && pnpm build && pnpm test` +- Full gate (expected before push): `pnpm build && pnpm check && pnpm test` When you touch tests or want extra confidence: diff --git a/package.json b/package.json index b3536cbef7..5364464922 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", "build": "pnpm canvas:a2ui:bundle && tsc -p tsconfig.json --noEmit false && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/write-build-info.ts", "canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh", + "check": "pnpm tsgo && pnpm lint && pnpm format", "check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500", "dev": "node scripts/run-node.mjs", "docs:bin": "node scripts/build-docs-list.mjs", @@ -104,7 +105,7 @@ "ios:gen": "cd apps/ios && xcodegen generate", "ios:open": "cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj", "ios:run": "bash -lc 'cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", - "lint": "oxlint --type-aware --tsconfig tsconfig.oxlint.json", + "lint": "oxlint --type-aware", "lint:all": "pnpm lint && pnpm lint:swift", "lint:fix": "oxlint --type-aware --fix && pnpm format:fix", "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", diff --git a/tsconfig.oxlint.json b/tsconfig.oxlint.json deleted file mode 100644 index 326b03df49..0000000000 --- a/tsconfig.oxlint.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "baseUrl": ".", - "paths": { - "openclaw": ["./src/index.ts"], - "openclaw/*": ["./src/*"] - } - }, - "include": ["src/**/*", "extensions/**/*", "packages/**/*"] -}