slidev-migrate
Migrate a single Slidev project to a slidev-workspace structure.
What the migration does
Before:
my-talk/
├── slides.md
├── package.json (@slidev/cli dependency)
├── components/
└── ...
After:
my-talk-workspace/
├── slides/
│ └── my-talk/ ← original project moved here
│ ├── slides.md
│ ├── package.json (dev script updated with --base)
│ └── ...
├── package.json ← new root (slidev-workspace scripts)
├── pnpm-workspace.yaml
└── slidev-workspace.yaml ← hero/baseUrl config
Automated migration (recommended)
Run the migration script:
python3 .claude/skills/slidev-migrate/scripts/migrate.py \
--slides-dir <path-to-single-slidev-project> \
--workspace-name <new-workspace-folder-name> \
--base-url /<repo-name>
The script:
- Validates a Slidev project exists (
slides.md+@slidev/cliinpackage.json) - Creates
slides/<project-name>/with the project files (excludingnode_modules,dist,.git) - Updates the slide's
devscript to add--base /<folder-name>/ - Generates root
package.json,pnpm-workspace.yaml, andslidev-workspace.yaml
After running:
cd <workspace-name>
pnpm install
pnpm dev # starts slidev-workspace preview
Manual migration steps
If the script doesn't fit (e.g., monorepo, in-place migration):
- Move the project into
slides/<project-name>/ - Update the dev script in the slide's
package.json:"dev": "slidev --base /<project-name>/" - Create
pnpm-workspace.yamlat workspace root:packages: - "slides/*" - Create
slidev-workspace.yamlat workspace root:hero: title: "My Slide Collection" description: "Browse all available slide decks" baseUrl: "/<repo-name>" - Create root
package.json:{ "name": "my-workspace", "private": true, "type": "module", "scripts": { "dev": "slidev-workspace preview", "build": "slidev-workspace build" }, "devDependencies": { "slidev-workspace": "latest" } } - Run
pnpm installandpnpm dev
Adding more slides after migration
Add more presentations by placing subdirectories inside slides/. Each needs a slides.md and a package.json with a dev script that includes --base /<folder-name>/.
Key configuration options
slidev-workspace.yaml:
baseUrl— URL base path; must match GitHub repo name for GitHub Pageshero.title/hero.description— workspace landing page textsidebar.title/sidebar.githubUrl— sidebar brandingoutputDir— build output directory (default:./dist)exclude— folder names to skip
Caveats
- pnpm catalog: If the slide's
package.jsonusescatalog:versions, the workspace root needs acatalog:section inpnpm-workspace.yaml. Ask the user if they use pnpm catalogs. - In-place migration: If the user wants to convert the current directory (not create a parent workspace), create a
slides/subfolder, move files in, and add the config files at the same root. - Already a workspace: If a
pnpm-workspace.yamlorslidev-workspace.yamlalready exists, skip workspace creation and only add/update the config files.
Source: leochiu-a/slidev-workspace — distributed by TomeVault.