Skip to content

fix(dev): stop dev from racing the kit build against docs props generation - #160

Closed
fabiobaglione wants to merge 1 commit into
riccardoperra:mainfrom
fabiobaglione:worktree-fix-dev-race
Closed

fabiobaglione wants to merge 1 commit into
riccardoperra:mainfrom
fabiobaglione:worktree-fix-dev-race

Conversation

@fabiobaglione

Copy link
Copy Markdown

Problem

pnpm run dev crashed in apps/docs with TypeError: Reduce of empty array with no initial value at generate-props.mjs.

packages/kit/rollup.config.js deleted packages/kit/dist on every start, including watch mode. turbo run dev --parallel starts the docs props generator at the same moment, so it read an empty dist, resolved no types and crashed.

Changes

  • Keep dist when rollup runs with -w.
  • Root dev builds the kit first: pnpm build:kit && turbo run dev --parallel.
  • generate-props.mjs stops with "run pnpm build:kit first" when dist is missing, and the reduce throws a readable error naming the prop.

Verification

pnpm run dev in a fresh worktree: generate-props now writes 222 props tables. Storybook and the examples app start.

Not covered: the docs dev task still stops at copy-examples until the examples are built once (pnpm turbo run build --filter=@codeui/examples...). That is a separate gap and is not changed here.

🤖 Generated with Claude Code

…ation

Rollup removed packages/kit/dist on every start, including watch mode, while
the docs generate-props script read it in parallel, crashing on an empty reduce.

- keep dist when rollup runs with -w
- build the kit before starting the parallel dev tasks
- fail generate-props with a clear message when the kit is not built

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bf606b7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@fabiobaglione

Copy link
Copy Markdown
Author

Superseded by a PR from a branch that follows the repo naming.

@fabiobaglione
fabiobaglione deleted the worktree-fix-dev-race branch November 30, 2026 20:33
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