Skip to content

feat: add pnpm run play playground picker#453

Merged
antfu merged 2 commits into
mainfrom
feat/playground-picker-script
Jul 22, 2026
Merged

feat: add pnpm run play playground picker#453
antfu merged 2 commits into
mainfrom
feat/playground-picker-script

Conversation

@antfubot

@antfubot antfubot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds pnpm run play — an autocomplete prompt to pick and launch any playground in the repo (packages, examples, docs, storybook), instead of remembering each one's directory and script name by hand.

  • scripts/play.ts discovers playgrounds by expanding the same workspace globs pnpm-workspace.yaml's packages: list already declares (packages/*, examples/*, docs, e2e, storybook), keeping only entries whose package.json has a play:dev/play/dev/docs/start script.
  • Presents them via prompts' autocomplete type — type to filter, arrow keys + Enter to pick, with a description line showing the package name and command — then runs pnpm run build followed by pnpm run <script> in the chosen directory, with output streamed through.
  • New packages/examples are picked up automatically; nothing to update in this script when one is added.
  • Added prompts/@types/prompts as catalog devDependencies.

This overrides the previous fixed pnpm run play (pnpm run build && pnpm -C packages/core run play), keeping its build-first behavior but extending it to every playground in the picker, not just packages/core. play:debug and play:standalone are unchanged.

Linked Issues

Additional context

Similar to devframes/devframe#118.


Created with the help of an agent.

antfubot added 2 commits July 22, 2026 04:36
Adds scripts/play.ts, an autocomplete prompt (via `prompts`) that
discovers every runnable playground under packages/*, examples/*,
docs, e2e, and storybook — mirroring the workspace glob list in
pnpm-workspace.yaml — and launches its play:dev/play/dev/docs/start
script in place. New playgrounds are picked up automatically with no
change to this script.

Overrides the previous fixed `pnpm run play` (which always built
everything then launched packages/core's playground); pick
packages/core from the list to reach the same target.
Runs `pnpm run build` before spawning the selected playground's
script, restoring the previous fixed `play` script's build-first
behavior for every entry in the picker (not just packages/core).
@antfu
antfu merged commit 14f51a3 into main Jul 22, 2026
2 of 9 checks passed
@antfu
antfu deleted the feat/playground-picker-script branch July 22, 2026 04:43
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.

2 participants