Skip to content

fix: workspace build fails on fresh clone (#1252)#1280

Open
danditomaso wants to merge 2 commits into
meshtastic:mainfrom
danditomaso:fix/readme-build-steps
Open

fix: workspace build fails on fresh clone (#1252)#1280
danditomaso wants to merge 2 commits into
meshtastic:mainfrom
danditomaso:fix/readme-build-steps

Conversation

@danditomaso

@danditomaso danditomaso commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Closes #1252.

Two root causes prevented pnpm -r build from working on a fresh clone:

1. packages/ui viteStaticCopy misconfigured

The copy target for src/lib/theme/default.css preserved the source path structure, producing dist/theme/src/lib/theme/default.css instead of dist/theme/default.css. publint then failed on the missing exports["./theme/default.css"] file.

Fixed by adding rename: { stripBase: true } so the copy flattens onto dist/theme/.

2. README build step invokes buf without saying so

@meshtastic/protobufs has a build script that runs buf generate, which needs the Buf CLI installed. The README suggested pnpm -r build and only mentioned Buf as optional for regenerating protobufs.

Generated stubs are already committed under packages/protobufs/packages/ts/dist/, so consumers don't need Buf. Updated the README to:

  • Filter @meshtastic/protobufs out of the default workspace build.
  • Move Buf into its own "Regenerate protobuf stubs" section.

Test plan

  • pnpm --filter @meshtastic/ui build — publint passes, dist/theme/default.css exists at expected path
  • pnpm --filter '!@meshtastic/protobufs' -r build — full workspace builds green without Buf installed

Summary by CodeRabbit

  • Documentation
    • Updated Getting Started guidance to clarify when Buf CLI is needed for regenerating protobuf TypeScript stubs.
    • Split instructions into distinct “build workspace” vs “regenerate protobuf stubs” flows, including the workspace build excluding @meshtastic/protobufs.
    • Added @meshtastic/ui library README with component overview, stylesheet location, and usage instructions.
  • Bug Fixes
    • Adjusted static asset copying behavior so copied UI assets resolve with correct base paths after build/rename.

…ic#1252)

Two bugs prevented `pnpm -r build` from working after a fresh clone:

1. `packages/ui` vite-plugin-static-copy config preserved the src path
   structure, producing `dist/theme/src/lib/theme/default.css` instead
   of `dist/theme/default.css`. publint then failed on the missing
   `exports["./theme/default.css"]` target. Add `rename: { stripBase: true }`
   to flatten the copy.

2. `packages/protobufs` build runs `buf generate`, which requires the
   Buf CLI. The README suggested `pnpm -r build` and only mentioned Buf
   as optional. Generated stubs are already committed, so update the
   README to filter out `@meshtastic/protobufs` from the workspace build
   and move Buf into its own regeneration section.
Copilot AI review requested due to automatic review settings July 12, 2026 02:54
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

@danditomaso is attempting to deploy a commit to the Meshtastic Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: db043cec-3033-4545-a028-546906432328

📥 Commits

Reviewing files that changed from the base of the PR and between 80025a6 and 4cb1feb.

📒 Files selected for processing (1)
  • packages/ui/README.md
✅ Files skipped from review due to trivial changes (1)
  • packages/ui/README.md

📝 Walkthrough

Walkthrough

The README separates workspace builds from protobuf stub regeneration. The UI Vite configuration adjusts copied asset paths, and the UI package README documents the shared React component library, styling, usage, development commands, dependencies, and license.

Changes

Build workflow and UI package

Layer / File(s) Summary
Build and protobuf regeneration instructions
README.md
Clarifies when Buf is required, excludes @meshtastic/protobufs from recursive builds, and adds a dedicated protobuf regeneration command.
Static asset path handling
packages/ui/vite.config.ts
Adds rename: { stripBase: true } to the viteStaticCopy target configuration.
UI package documentation
packages/ui/README.md
Documents the shared React component library, included components, stylesheet, usage, peer dependencies, development commands, and license.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: javascript

Suggested reviewers: Hunter275

Poem

A rabbit read the build guide bright,
“Skip protobufs unless stubs take flight!”
UI components hop in line,
Static paths now trim just fine.
Clear docs bloom across the room—
Carrots cheer the workspace zoom!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning packages/ui/README.md adds broad component-library documentation that is not needed for the build-fix scope in #1252. Move the new UI library documentation to a separate PR or trim it to changes directly related to the build-fix issue.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the workspace build failure on fresh clone and references the linked fix.
Description check ✅ Passed The description explains the bug, root causes, and testing, covering the required template sections well enough.
Linked Issues check ✅ Passed The changes address #1252 by fixing the UI asset path and updating build instructions to exclude protobufs and document Buf regeneration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes fresh-clone workspace build failures by correcting how @meshtastic/ui packages its theme CSS for publint and by updating the repo README to avoid requiring the Buf CLI for the default workspace build.

Changes:

  • Fix vite-plugin-static-copy configuration so default.css is copied to dist/theme/default.css (matching package.json exports) instead of preserving the source directory structure.
  • Update README build instructions to exclude @meshtastic/protobufs from the default workspace build, and add a dedicated section for regenerating protobuf stubs (Buf-required).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
README.md Adjusts build docs to avoid Buf dependency for the default workspace build and documents protobuf stub regeneration separately.
packages/ui/vite.config.ts Flattens the copied theme CSS path so publint can find ./dist/theme/default.css as exported.

Comment thread README.md
pnpm --filter @meshtastic/web dev
```

### Build everything
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.

[Bug]: Incorrect build steps in README

2 participants