Skip to content

♻️ Cross-platform pages commands and unify workspace config#859

Merged
usagizmo merged 7 commits into
mainfrom
feat/optimize-pages-commands
Jun 13, 2026
Merged

♻️ Cross-platform pages commands and unify workspace config#859
usagizmo merged 7 commits into
mainfrom
feat/optimize-pages-commands

Conversation

@usagizmo

@usagizmo usagizmo commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Overview

Replace apps/pages shell scripts with Node-standard .js versions so the commands work on every platform Bun supports. While we're touching the toolchain, also reorganize the monorepo's turbo config, adopt the catalog protocol, and clean up the CI workflow so each layer owns its own concerns.

Changes

Cross-platform pages commands

  • commands/clean-images.shclean-images.js
  • commands/deploy.js (replaces deploy.sh)
  • commands/update-snapshots.jsbun test --update-snapshots strips the flag from process.argv, so the update signal is forwarded through UPDATE_SNAPSHOTS=1
  • tests/path.test.js — replace execSync('find ...') with recursive readdir
  • External-link snapshot test now fails explicitly when tests/external-links.txt is missing (previously it silently wrote the file and passed). Run bun run test:update to create the snapshot.

Turbo config relocation

  • Move package-specific overrides (api#generate, pages#build, web#build, web#lint, pages#test) into each package's own turbo.json
  • Root turbo.json keeps only the task-graph skeleton (build / check / dev / preview / test / lint / format)
  • Rename lint:checkcheck (svelte-check is type-checking, not lint)

Catalog protocol

  • Move shared versions (Svelte, Tailwind, bits-ui, ESLint, Valibot, …) to root package.json workspaces.catalog
  • Prevents version drift across packages

CI

  • bun turbo buildbun turbo run build (bare turbo shorthand clashes with generate)
  • Add a new check step so type errors are caught in CI
  • Drop the now-unused PUBLIC_GA4_MEASUREMENT_ID secret reference

Docs

  • Extract CHANGELOG.md from the root README
  • Trim per-package READMEs — commands live in the root README, each app's README keeps only what is unique to it
  • bun run clean-images --dry-run replaces the -n short flag (dropped for CLI consistency) in the README and public/index.html
  • Switch the code snippet in public/index.html from bun to bun run

Compatibility

  • No breaking changes to the user-facing workflow
  • The external-link snapshot test now fails (instead of silently writing) when the snapshot is missing. First run of bun run test will need bun run test:update; CI may also need one re-run.
  • clean-images -n is gone; use clean-images --dry-run

usagizmo added 6 commits June 13, 2026 08:12
- Replace shell command wrappers with Bun scripts
- Add safer clean-images reference checks and dry-run support
- Document deploy target setup and image cleanup preview
- Wire Bun snapshot updates into external link tracking
- Replace shell find usage in pages path tests
- Document test:update for refreshing external-links.txt
- Add missing `preview` task to turbo.json (root `bun preview` was failing with "Could not find task")
- Split per-package turbo settings into Package Configurations with `extends: ["//"]` so `web#build` inherits `^build` and avoids future internal-dep drift
- Move build dependency from `lint` to the type-aware `check` task; rename `lint:check` to `check` and pair with `check:watch`
- Make `test` cacheable by default, keeping `cache: false` only for state-dependent `api#test`
- Replace broad `globalDependencies: [".env"]` with per-task `env` keys on web build/check
- Centralize shared dependency versions via bun catalog (SSOT)
- Add lint/format scripts to api, `format:js` to eslint-config, consolidate `engines` to root
- Remove dead test scripts from @repo/shared
- Make bun test:update work via UPDATE_SNAPSHOTS env wrapper (bun strips test flags from argv)
- Add bun turbo check step to CI and drop stale GA4 env var
- Restore .env to turbo globalDependencies so local builds invalidate cache on env change
- Exclude generated types from api generate inputs to stabilize cache key
- Drop dead outputs from pages test task (validation no longer writes the snapshot)
- Harden deploy: drop rsync -u and use cwd + relative source for cross-platform
- Guard clean-images run() against spawn failure and match srcset comma references
- Align add-size-to-img entrypoint error handling and update stale pages README
- Move the Breaking changes log out of the root README into CHANGELOG.md (curated highlights; GitHub Releases holds the full history), linked from the README
- Consolidate root commands into cross-cutting aggregators plus a --filter note, and complete each app command list (add bun format and :watch variants)
- Add a command-oriented Workflow to the pages README (dev -> size images -> validate -> clean -> deploy)
- Replace the duplicated shared-imports block in the root README with a pointer to packages/shared
- Trim per-package READMEs to package-specific content and drop command lists duplicated in the root README
- Keep package-unique docs (pages QA details, api CLI/test notes, shared usage examples, web architecture/layer rules)
- Fix stale apps/web link in the shared README (../apps/web -> ../../apps/web)
…or cached graph tasks

- Present `bun --filter <pkg> <script>` as the primary day-to-day form; demote Turbo to dependency-aware/cached graph tasks (generate via bun --filter, Turbo version kept as the cached option)
- Use `bun run <script>` (not bare `bun <script>`) for root scripts: bare `bun build`/`bun test` launch Bun's built-in bundler/test runner instead of the package script
- Document scoped graph tasks as `bun turbo run <task> --filter <pkg>` (bare `turbo <task>` clashes with built-ins like `generate`)
- Switch CI build/check/test to `turbo run`; standardize --filter on the space form
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webapp-template-pages Ready Ready Preview, Comment Jun 13, 2026 5:29pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
webapp-template-web Ignored Ignored Preview Jun 13, 2026 5:29pm

Request Review

- Replace `bun run clean-images -n` with `--dry-run` everywhere; drop the short alias for CLI consistency
- Switch the docs snippet in public/index.html from `bun` to `bun run` to match the standard form
@usagizmo usagizmo merged commit bf2eec5 into main Jun 13, 2026
4 checks passed
@usagizmo usagizmo deleted the feat/optimize-pages-commands branch June 13, 2026 17:30
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