Repository navigation
Conversation
Reorganize the plugin into feature-oriented source directories, trim the README back to introduction-first usage guidance, and align the package version with the current pre-1.0 release stage.\n\nAlso remove unused browser automation devDependencies while keeping the verified build, lint, and test flows intact.\n\nCo-Authored-By: Mastra Code (openai/gpt-5.4) <noreply@mastra.ai>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR merges develop into main, substantially expanding vite-plugin-slidev-manager with a dev “bridge” server (stable URL + deck switching), a more structured selector/invocation flow, and a broader test/fixture/doc/tooling update.
Changes:
- Add a dev-server bridge that proxies Slidev dev servers and supports in-page deck switching via a generated
custom-nav-controls.vue. - Refactor presentation discovery/selection/invocation into dedicated modules (
presentation/*,selector/*,invocation/*) and add extensive Vitest coverage undertests/. - Update tooling and repo scaffolding (bun + oxlint/oxfmt, fixtures, docs, CI workflow, package metadata).
Reviewed changes
Copilot reviewed 43 out of 48 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
vitest.config.ts |
Switch Vitest include glob to tests/**/*.test.ts. |
tsconfig.json |
Set rootDir and normalize include formatting. |
tests/presentation-runner.test.ts |
Adds tests for spawn specs, workspace actions, and HTTP readiness. |
tests/presentation-helpers.test.ts |
Adds tests for slug/label/key/manifest helper behavior. |
tests/metadata-loader.test.ts |
Adds tests for metadata discovery, scripts, and relative path handling. |
tests/invocation.test.ts |
Adds tests for CLI passthrough and browser-export switching. |
tests/index.test.ts |
Adds tests for selector behavior (single option, preselect, non-interactive). |
tests/generated-switcher-template.test.ts |
Adds tests for generated Vue SFC and escaping/behavior. |
tests/flow.test.ts |
Adds tests for presentationsDir resolution logic. |
tests/dev-switcher.test.ts |
Adds tests for writing and cleanup of generated switcher files. |
tests/dev-server-bridge.test.ts |
Adds integration-style tests for bridge proxying and switching. |
src/utils/process-utils.ts |
Adds terminal input restoration and safe error-message extraction. |
src/selector/ui-copy.ts |
Centralizes action-specific UI copy. |
src/selector/selection.ts |
Centralizes selection resolution and error messaging. |
src/selector/presentation-selector.tsx |
Refactors selector to use new metadata/helpers and adds preselect/non-interactive handling. |
src/selector/flow.ts |
Implements dev/build flows using invocation + bridge runner. |
src/selector/bridge-shutdown.ts |
Adds SIGINT/SIGTERM shutdown handling for the bridge. |
src/presentation/presentation-runner.ts |
Adds process spawning utilities, package-manager detection, port/base parsing, browser opening, and readiness checks. |
src/presentation/presentation-helpers.ts |
Adds slug/label/key helpers and manifest conversion. |
src/presentation/metadata-loader.ts |
Replaces old loader with richer metadata (actions, scripts, presentationDir) and improved parsing. |
src/metadata-loader.ts |
Removes legacy metadata loader. |
src/metadata-loader.test.ts |
Removes legacy tests for old loader. |
src/invocation/index.ts |
Adds invocation resolution + arg merging + browser-export switching. |
src/index.ts |
Replaces inline logic with structured invocation + selector flows; adds build/export configuration options. |
src/bridge/generated-switcher-template.ts |
Adds HTML-escaped, deterministic Vue SFC generator for deck switch UI. |
src/bridge/dev-switcher.ts |
Adds generation/cleanup for custom-nav-controls.vue with ownership detection. |
src/bridge/dev-server-bridge.ts |
Adds stable bridge server, proxying, switching endpoint, and dev-session lifecycle management. |
package.json |
Bumps version, updates deps/tooling/scripts, updates peer ranges, sets bun packageManager. |
fixture/workspace/vite.config.ts |
Adds runnable workspace fixture Vite config. |
fixture/workspace/presentations/team-update/slides.md |
Adds workspace fixture deck content. |
fixture/workspace/presentations/product-intro/slides.md |
Adds workspace fixture deck content. |
fixture/workspace/package.json |
Adds workspace fixture package setup and scripts. |
fixture/normal/vite.config.ts |
Adds runnable “normal” fixture Vite config. |
fixture/normal/presentations/team-update/slides.md |
Adds normal fixture deck content. |
fixture/normal/presentations/product-intro/slides.md |
Adds normal fixture deck content. |
fixture/normal/package.json |
Adds normal fixture package setup and scripts. |
fixture/README.md |
Documents how to run fixtures locally. |
docs/ja/README.md |
Adds Japanese documentation for new flows/features. |
biome.json |
Removes Biome config (tooling migration). |
README.md |
Updates main README to match new features/usage/fixtures. |
CHANGELOG.md |
Minor formatting cleanup. |
.oxlintrc.json |
Adds oxlint configuration. |
.oxfmtrc.json |
Adds oxfmt configuration. |
.github/workflows/release-manager.yml |
Updates CI to bun-based install/lint/test/build and adjusts publish steps. |
Comments suppressed due to low confidence (1)
src/selector/presentation-selector.tsx:197
- For
devactions,createOptionFromMetadataalways prefersslidesmode whenslidesPathexists (even if the presentation has a workspacedevscript). That prevents workspace presentations that also ship aslides.mdfrom running via their configured package manager script. If workspace support is intended, the workspace branch should likely take precedence whenmeta.workspace && meta.scripts.dev(or generallymeta.scripts[action]) before falling back to direct Slidev CLI.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+34
to
+44
| const { options, selected, cancelled } = selection; | ||
| if (options.length === 0) { | ||
| console.error( | ||
| `No Slidev presentations with a ${invocation.action} entrypoint were found.`, | ||
| ); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| if (cancelled || !selected) { | ||
| process.exit(0); | ||
| } |
Comment on lines
+207
to
+224
| export async function openBrowser(url: string): Promise<void> { | ||
| const command = | ||
| process.platform === 'win32' | ||
| ? { file: 'cmd', args: ['/c', 'start', '', url] } | ||
| : process.platform === 'darwin' | ||
| ? { file: 'open', args: [url] } | ||
| : { file: 'xdg-open', args: [url] }; | ||
|
|
||
| await new Promise<void>((resolve, reject) => { | ||
| const child = spawn(command.file, command.args, { | ||
| stdio: 'ignore', | ||
| detached: true, | ||
| }); | ||
|
|
||
| child.on('error', reject); | ||
| child.unref(); | ||
| resolve(); | ||
| }); |
Comment on lines
+383
to
+385
| const body = await readRequestBody(req); | ||
|
|
||
| await proxyHttpRequestWithHosts(req, res, upstreamPort, body, ['127.0.0.1', 'localhost']); |
Comment on lines
+48
to
+54
| <summary class="smgr-trigger" title="Switch deck"> | ||
| <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> | ||
| <rect x="3" y="4" width="18" height="13" rx="2" /> | ||
| <path d="M8 20h8" /> | ||
| <path d="M12 17v3" /> | ||
| </svg> | ||
| </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes