fix: workspace build fails on fresh clone (#1252)#1280
Conversation
…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.
|
@danditomaso is attempting to deploy a commit to the Meshtastic Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe 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. ChangesBuild workflow and UI package
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
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-copyconfiguration sodefault.cssis copied todist/theme/default.css(matchingpackage.jsonexports) instead of preserving the source directory structure. - Update README build instructions to exclude
@meshtastic/protobufsfrom 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. |
| pnpm --filter @meshtastic/web dev | ||
| ``` | ||
|
|
||
| ### Build everything |
Closes #1252.
Two root causes prevented
pnpm -r buildfrom working on a fresh clone:1.
packages/uiviteStaticCopy misconfiguredThe copy target for
src/lib/theme/default.csspreserved the source path structure, producingdist/theme/src/lib/theme/default.cssinstead ofdist/theme/default.css. publint then failed on the missingexports["./theme/default.css"]file.Fixed by adding
rename: { stripBase: true }so the copy flattens ontodist/theme/.2. README build step invokes
bufwithout saying so@meshtastic/protobufshas abuildscript that runsbuf generate, which needs the Buf CLI installed. The README suggestedpnpm -r buildand 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:@meshtastic/protobufsout of the default workspace build.Test plan
pnpm --filter @meshtastic/ui build— publint passes,dist/theme/default.cssexists at expected pathpnpm --filter '!@meshtastic/protobufs' -r build— full workspace builds green without Buf installedSummary by CodeRabbit
@meshtastic/protobufs.@meshtastic/uilibrary README with component overview, stylesheet location, and usage instructions.