Conversation
- Created `package.json` for VitePress documentation setup. - Added documentation for various prompt types: - `Bind`: Model-based prompts using data annotations. - `Confirm`: Yes/No confirmation prompts. - `Input`: Generic input prompts with type conversion. - `List`: Interactive multi-item input prompts. - `MultiSelect`: Multiple item selection using checkboxes. - `Password`: Masked input for passwords. - `Select`: Single item selection from a list. - Added `icon.png` for documentation branding. - Created `validators.md` to document built-in and custom validators.
There was a problem hiding this comment.
Pull request overview
Adds a VitePress-based documentation site for Sharprompt, including pages covering supported prompt types and validation, plus GitHub Pages deployment automation.
Changes:
- Introduces a VitePress docs site (
docs/) with prompt-type and validator reference pages. - Adds GitHub Pages workflow to build and deploy docs from the
docs/directory. - Adds docs branding assets (icon) and basic theme customization.
Reviewed changes
Copilot reviewed 17 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
docs/package.json |
Defines the VitePress tooling/scripts for building the docs site. |
docs/package-lock.json |
Locks VitePress/Vite dependencies for reproducible docs builds. |
docs/.vitepress/config.mts |
Configures site metadata, base path, nav/sidebar, and favicon/logo. |
docs/.vitepress/theme/index.ts |
Enables theme customization by importing custom CSS. |
docs/.vitepress/theme/custom.css |
Adds brand colors and hero styling for the docs site. |
docs/index.md |
Adds the home/landing page content and hero configuration. |
docs/getting-started.md |
Adds installation and quick start guide content. |
docs/configuration.md |
Documents global configuration options and behaviors. |
docs/advanced.md |
Documents advanced features like enum support, unicode, pagination, etc. |
docs/validators.md |
Documents built-in validators and how to author custom validators. |
docs/prompt-types/*.md |
Adds per-prompt reference pages (Input/Confirm/Password/Select/MultiSelect/List/Bind). |
docs/public/icon.png |
Adds a docs-site icon used for branding/favicon/logo. |
.github/workflows/docs.yml |
Adds CI workflow to build and deploy docs to GitHub Pages. |
.gitignore |
Ignores VitePress build output and cache directories. |
Files not reviewed (1)
- docs/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | ||
| with: | ||
| node-version-file: docs/package.json |
There was a problem hiding this comment.
actions/setup-node is configured with node-version-file: docs/package.json, but that file doesn't define an engines.node field (it only has a volta section). setup-node typically reads Node version from .nvmrc/.node-version or package.json#engines.node, so this is likely to fail or pick an unintended Node version, which can break the docs build (Vite/VitePress have Node minimums). Consider either adding an engines.node entry, adding a .nvmrc/.node-version file and pointing node-version-file to it, or setting node-version explicitly in the workflow.
| node-version-file: docs/package.json | |
| node-version: 20 |
| base: '/Sharprompt/', | ||
| cleanUrls: true, | ||
| head: [ | ||
| ['link', { rel: 'icon', href: '/Sharprompt/icon.png' }] |
There was a problem hiding this comment.
The head favicon URL is hard-coded as /Sharprompt/icon.png while base is already set to /Sharprompt/. VitePress typically applies base to absolute asset URLs, so this can result in a doubled path (e.g., /Sharprompt/Sharprompt/icon.png) and a broken favicon. Use /icon.png here (or construct the path using the configured base) to keep it consistent with themeConfig.logo and the home hero image.
| ['link', { rel: 'icon', href: '/Sharprompt/icon.png' }] | |
| ['link', { rel: 'icon', href: '/icon.png' }] |
|
|
||
| ## Cancellation Support | ||
|
|
||
| By default, pressing `Ctrl+C` returns the default value. You can change this behavior to throw an exception: |
There was a problem hiding this comment.
The cancellation behavior described here doesn't match the current implementation. DefaultConsoleDriver invokes the cancellation callback on Ctrl+C, and FormBase.CancellationHandler() calls Environment.Exit(1) unless Prompt.ThrowExceptionOnCancel is true. The docs currently say Ctrl+C returns the default value, but it actually terminates the process by default.
| By default, pressing `Ctrl+C` returns the default value. You can change this behavior to throw an exception: | |
| By default, pressing `Ctrl+C` cancels the prompt and terminates the process (for example with exit code `1`). You can change this behavior to throw an exception instead of exiting: |
package.jsonfor VitePress documentation setup.Bind: Model-based prompts using data annotations.Confirm: Yes/No confirmation prompts.Input: Generic input prompts with type conversion.List: Interactive multi-item input prompts.MultiSelect: Multiple item selection using checkboxes.Password: Masked input for passwords.Select: Single item selection from a list.icon.pngfor documentation branding.validators.mdto document built-in and custom validators.