Skip to content

refactor: replace custom picker and build scripts with slidev-decks#13

Open
afonsojramos wants to merge 7 commits intoantfu:mainfrom
afonsojramos:replace-custom-scripts-with-slidev-decks
Open

refactor: replace custom picker and build scripts with slidev-decks#13
afonsojramos wants to merge 7 commits intoantfu:mainfrom
afonsojramos:replace-custom-scripts-with-slidev-decks

Conversation

@afonsojramos
Copy link
Copy Markdown

@afonsojramos afonsojramos commented Apr 9, 2026

Summary

Replaces the custom picker.ts and build.ts scripts with slidev-decks — a lean CLI for managing multiple Slidev presentations. This was actually inspired by this repo (mentioned in Prior Art), so it felt right to bring it full circle.

What changes:

  • pnpm dev now uses slidev-decks interactive picker (fuzzy matching, sorted by date, title display)
  • pnpm build uses slidev-decks build --all --continue-on-error (progress tracking, incremental builds)
  • Per-deck build scripts simplified from tsx ../../scripts/build.ts <base> to slidev build --out <dir> --base <base>
  • Removed 4 deps only needed for custom scripts: execa, prompts, @types/prompts, tinyexec

What stays the same:

  • All deck source code, components, styles, configs
  • scripts/redirects.ts (still parses base paths from per-deck build scripts — verified all 35 work)
  • netlify.toml deployment, dist-stale caching strategy
  • pnpm workspace setup, per-deck dev/export scripts
  • All Slidev features (glow effect, graph addon, magic links, custom components)

Net change: 40 lines added, 138 lines removed across 39 files (mostly simplified per-deck package.json build scripts).

What slidev-decks provides over the custom scripts

  • Interactive picker with fuzzy matching (substring, word-boundary, subsequence scoring)
  • Auto-discovery of slides.md in both flat (<name>/slides.md) and nested (<name>/src/slides.md) layouts
  • --continue-on-error for resilient batch builds
  • --filter for building subsets (slidev-decks build --all -f "2024-*")
  • Incremental builds (skips unchanged decks based on file mtime)
  • Progress counter ([3/35]) during batch builds
  • Package manager auto-detection (pnpm, bun, npm, yarn)
  • slidev-decks list for a quick overview of all decks

Test plan

  • slidev-decks list discovers all 35 Slidev decks (2 pre-Slidev PDF-only talks correctly excluded)
  • redirects.ts base path extraction still works for all 35 decks (regex matches new build script format)
  • pnpm dev launches interactive picker and starts a deck
  • pnpm build builds all decks with correct base paths
  • Netlify deploy produces working URLs at existing paths

Note: Obviously this is a PR which was opened against, what I would consider, a source-available repo that is not commonly open for PRs, so feel free to close if you want, no hurt feelings! 😁

@afonsojramos
Copy link
Copy Markdown
Author

Another note: The per-deck package.json files could be eliminated entirely if the folder structure matched the semantic URL paths, i.e., renaming 2024-12-07/ to 2024/feday/ (or nesting as 2024/feday/).

With that change:

slidev-decks build --all would use the folder name as the base path automatically — no per-deck build scripts needed
redirects.ts could derive paths from the folder structure instead of parsing build scripts
The pnpm workspace config (*/src) and all 35 per-deck package.json files could be dropped
The repo would go from a pnpm monorepo to a flat multi-deck setup managed entirely by slidev-decks

The trade-off is a one-time rename of all 37 folders + updating netlify.toml redirects. The date-based redirects (/2024-12-07 → /2024/feday/) would still work since redirects.ts can generate those from folder names.

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