Skip to content

fix(repo): set proper turbo deps for test tasks#4

Merged
zrosenbauer merged 4 commits intomainfrom
fix/turbo-test-deps
Mar 4, 2026
Merged

fix(repo): set proper turbo deps for test tasks#4
zrosenbauer merged 4 commits intomainfrom
fix/turbo-test-deps

Conversation

@zrosenbauer
Copy link
Copy Markdown
Member

@zrosenbauer zrosenbauer commented Mar 4, 2026

Summary

  • Root test scripts bypassed turbo entirely (vitest run), so workspace packages were never built before their dependents' tests tried to import from dist/
  • test.dependsOn used ^build (deps only) instead of build (self + deps), so packages with self-referencing integration tests (e.g. @kidd-cli/core examples) failed
  • examples/* used workspace:* deps but were not in the pnpm workspace

Changes

  • Route root test script through turbo run test
  • Route root test:coverage and test:watch through turbo run build before vitest
  • Change turbo.json test.dependsOn from ["^build"] to ["build"]
  • Add examples/* to pnpm-workspace.yaml

Test plan

  • CI passes (build + test pipeline)
  • pnpm test resolves all workspace package imports correctly

Summary by CodeRabbit

  • Chores

    • Tests and build now run through Turbo with package-scoped filters; added a consolidated validate script for typecheck, tests, lint, and format.
    • Workspace includes example projects and new developer tooling/coverage dependencies; added a reusable clean task.
  • Documentation

    • Many docs and templates reformatted and clarified; init templates updated to scaffold a new config filename.
  • Examples

    • Adjusted logging levels and example UI markup for improved clarity (no behavior changes).

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 4, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Root scripts now route tests/build through Turbo with package filters; pnpm workspace adds examples/*; lauf tooling and a clean task were introduced; many docs/tests were reformatted and small example logging level changes applied.

Changes

Cohort / File(s) Summary
Root manifest & scripts
package.json
Build/test scripts now run via turbo with --filter='./packages/*'; added validate script; new devDependencies: @vitest/coverage-v8, laufen, rimraf, ts-pattern.
Monorepo config
pnpm-workspace.yaml, turbo.json
Workspace now includes examples/*; turbo test task dependsOn changed from ["^build"]["build"].
Lauf tooling & clean task
lauf.config.ts, scripts/clean.lauf.ts
Added lauf.config.ts; new scripts/clean.lauf.ts defines a Lauf task to delete build/cache/coverage/deps (and --nuke) using rimraf and flags.
Removed tooling script
scripts/oxc-lint-split.sh
Deleted legacy lint-splitting shell script.
Example manifests & UI
examples/authenticated-service/package.json, examples/authenticated-service/ui/index.html, examples/authenticated-service/ui/app.js
Added @types/node devDependency; large HTML/CSS reformat and minor JS formatting changes (no behavior change).
Example middleware logging
examples/advanced/src/middleware/telemetry.ts, .../timing.ts
Logging level for completion messages changed to info (was trace/debug).
CLI templates & scaffolding
packages/cli/src/lib/templates/project/package.json.liquid, .../kidd.config.ts.liquid, .../tsdown.config.ts.liquid
Template build script changed tsdownkidd build; added kidd.config.ts.liquid; removed tsdown config template and replaced devDependency with @kidd-cli/cli.
Package dependency consolidation
packages/cli/package.json
Consolidated duplicate @kidd-cli/core entries into a single workspace:* dependency.
Code formatting & tests
packages/**/src/**/*.test.ts, packages/core/test/integration/*, packages/**/src/**/*.ts
Numerous import reorderings, duplicate-import removals, and formatting-only changes across tests and source files; no behavioral changes.
Docs & READMEs
docs/**, contributing/**, packages/core/**/README.md, .changeset/*
Widespread markdown table/header/spacing normalizations, minor wording tweaks, and changesets updated (package renames and scaffolding changes).
Templates added
packages/cli/src/lib/templates/project/kidd.config.ts.liquid
New project config template exporting default defineConfig({ entry: './src/index.ts', commands: './src/commands' }).

Sequence Diagram(s)

mermaid
sequenceDiagram
participant User
participant Lauf as rgba(34,139,34,0.5)
participant Rimraf as rgba(220,20,60,0.5)
participant FS as rgba(30,144,255,0.5)

User->>Lauf: run clean task with flags (--build/--cache/--nuke/...)
Lauf->>Lauf: parse flags, build glob list
Lauf->>Rimraf: invoke rimraf with globs
Rimraf->>FS: delete matching files/dirs
Rimraf-->>Lauf: return success/failure
Lauf-->>User: log result and exit

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped the monorepo, tidy and spry,
Turbo marched tests with a curious eye,
A clean little script swept crumbs from the floor,
Templates shifted, examples explored,
I twitch my whiskers — all neat in the sky.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 54.55% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: fixing Turborepo dependencies for test tasks to ensure proper build ordering.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/turbo-test-deps

Comment @coderabbitai help to get the list of available commands and usage tips.

@zrosenbauer zrosenbauer force-pushed the fix/turbo-test-deps branch from d25ccfe to 6e569dc Compare March 4, 2026 21:00
Root test scripts bypassed turbo entirely (vitest run), so workspace
packages were never built before their dependents' tests tried to import
from dist/. Additionally, examples/ used workspace:* deps but were not
in the pnpm workspace.

- Route root test scripts through turbo run test
- Change test.dependsOn from ^build to build so each package builds
  itself before running tests
- Add examples/* to pnpm-workspace.yaml
- Fix CliLogger method calls in advanced example (trace/debug -> info)
- Add missing @types/node to authenticated-service example

Co-Authored-By: Claude <noreply@anthropic.com>
@zrosenbauer zrosenbauer force-pushed the fix/turbo-test-deps branch from 228e4fe to b3dfed9 Compare March 4, 2026 21:05
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/concepts/authentication.md`:
- Around line 57-60: The documentation table shows incorrect token storage
paths: update the paths `./<cli-name>/auth.json` and `~/<cli-name>/auth.json` to
include the leading dot so they match the documented `dirName` (i.e. change to
`./.<cli-name>/auth.json` and `~/.<cli-name>/auth.json`), ensuring the Local and
Global "Path" entries in the table reflect the dot-prefixed directory used by
the code/config.

In `@packages/cli/src/lib/templates/project/package.json.liquid`:
- Line 25: The package template currently pins the dependency version ranges to
"^0.0.0" which only allows 0.0.0; update the dependency entries for
"@kidd-cli/cli" and the corresponding "@kidd-cli/core" in the
package.json.liquid template to use the correct caret range "^0.1.0" so
published 0.1.0+ versions can be installed; locate the lines containing the
dependency keys "@kidd-cli/cli" and "@kidd-cli/core" and replace their version
strings from "^0.0.0" to "^0.1.0".

In `@scripts/clean.lauf.ts`:
- Line 8: COVERAGE_GLOBS currently only includes the root 'coverage' folder
which misses per-package coverage directories; update the COVERAGE_GLOBS
constant to include recursive globs such as '**/coverage' (and/or
'**/coverage/**' if your deletion utility requires matching contents) so
package-level coverage folders are matched and removed; locate the
COVERAGE_GLOBS symbol and replace its value with the recursive glob patterns
used elsewhere in the project to ensure all coverage dirs in the monorepo are
cleaned.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4dfde732-7805-40a5-869e-83c679c2b585

📥 Commits

Reviewing files that changed from the base of the PR and between b3dfed9 and 751f745.

📒 Files selected for processing (51)
  • .changeset/rename-packages.md
  • .changeset/scaffold-kidd-config.md
  • .vscode/settings.json
  • contributing/concepts/architecture.md
  • docs/README.md
  • docs/concepts/authentication.md
  • docs/concepts/configuration.md
  • docs/concepts/context.md
  • docs/concepts/lifecycle.md
  • docs/guides/add-authentication.md
  • docs/reference/cli.md
  • docs/reference/kidd.md
  • examples/authenticated-service/api/server.ts
  • examples/authenticated-service/cli/src/commands/repos.ts
  • examples/authenticated-service/cli/src/index.ts
  • examples/authenticated-service/ui/app.js
  • examples/authenticated-service/ui/index.html
  • lauf.config.ts
  • packages/cli/package.json
  • packages/cli/src/commands/build.test.ts
  • packages/cli/src/commands/commands.test.ts
  • packages/cli/src/commands/dev.test.ts
  • packages/cli/src/commands/doctor.test.ts
  • packages/cli/src/commands/doctor.ts
  • packages/cli/src/lib/checks.test.ts
  • packages/cli/src/lib/checks.ts
  • packages/cli/src/lib/templates/project/kidd.config.ts.liquid
  • packages/cli/src/lib/templates/project/package.json.liquid
  • packages/cli/src/lib/templates/project/tsdown.config.ts.liquid
  • packages/core/src/lib/store/create-store.ts
  • packages/core/src/lib/store/index.test.ts
  • packages/core/src/lib/store/types.ts
  • packages/core/src/middleware/auth/README.md
  • packages/core/src/middleware/auth/auth.test.ts
  • packages/core/src/middleware/auth/create-auth-context.test.ts
  • packages/core/src/middleware/auth/create-auth-context.ts
  • packages/core/src/middleware/auth/index.ts
  • packages/core/src/middleware/auth/resolve-credentials.test.ts
  • packages/core/src/middleware/auth/resolve-oauth.test.ts
  • packages/core/src/middleware/auth/types.ts
  • packages/core/src/middleware/http/README.md
  • packages/core/src/middleware/http/create-http-client.test.ts
  • packages/core/src/middleware/http/http.test.ts
  • packages/core/src/runtime/runtime.test.ts
  • packages/core/test/integration/advanced-deploy.test.ts
  • packages/core/test/integration/advanced-status.test.ts
  • packages/core/test/integration/simple-greet.test.ts
  • packages/core/test/integration/simple-init.test.ts
  • packages/core/test/integration/simple-list.test.ts
  • scripts/clean.lauf.ts
  • scripts/oxc-lint-split.sh
💤 Files with no reviewable changes (4)
  • scripts/oxc-lint-split.sh
  • packages/cli/src/lib/templates/project/tsdown.config.ts.liquid
  • packages/core/src/middleware/auth/types.ts
  • examples/authenticated-service/cli/src/index.ts
✅ Files skipped from review due to trivial changes (25)
  • packages/cli/src/commands/dev.test.ts
  • .changeset/rename-packages.md
  • docs/reference/cli.md
  • packages/core/src/runtime/runtime.test.ts
  • packages/core/src/lib/store/create-store.ts
  • packages/core/test/integration/simple-list.test.ts
  • examples/authenticated-service/ui/app.js
  • packages/core/src/middleware/auth/create-auth-context.ts
  • packages/core/src/middleware/auth/resolve-credentials.test.ts
  • docs/concepts/configuration.md
  • packages/core/src/lib/store/index.test.ts
  • packages/core/src/middleware/auth/create-auth-context.test.ts
  • packages/cli/src/lib/checks.ts
  • packages/cli/src/commands/build.test.ts
  • packages/core/src/middleware/http/http.test.ts
  • docs/reference/kidd.md
  • packages/core/test/integration/advanced-deploy.test.ts
  • packages/core/src/middleware/auth/index.ts
  • .vscode/settings.json
  • packages/cli/src/commands/doctor.ts
  • contributing/concepts/architecture.md
  • packages/cli/src/commands/doctor.test.ts
  • examples/authenticated-service/api/server.ts
  • docs/README.md
  • packages/cli/src/commands/commands.test.ts

@zrosenbauer zrosenbauer force-pushed the fix/turbo-test-deps branch from 751f745 to 3711fdd Compare March 4, 2026 21:48
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Around line 14-21: The root package.json scripts "build", "test:coverage",
"test:watch", and "validate" currently pass --filter='./packages/*' which
excludes examples; remove the --filter='./packages/*' fragment from each of
those script values so the commands (scripts "build", "test:coverage",
"test:watch", and "validate") run across the whole workspace (including
examples) per pnpm-workspace.yaml; keep the same command structure (e.g., "turbo
run build", "turbo run test" / "vitest ..." and the chained checks) but without
the --filter argument so examples are included.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ffb21da3-61cc-4e50-8b7c-45fae2def902

📥 Commits

Reviewing files that changed from the base of the PR and between 751f745 and 3711fdd.

📒 Files selected for processing (2)
  • package.json
  • packages/cli/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/cli/package.json

@zrosenbauer zrosenbauer force-pushed the fix/turbo-test-deps branch from 3711fdd to 13049b3 Compare March 4, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant