support arrays in site options - #2910
Conversation
🦋 Changeset detectedLatest commit: 03a2821 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for template options that accept multiple values via a new multiple flag, including validation/coercion behavior and file-option resolution in site manifests.
Changes:
- Added
multiple?: booleantoTemplateOptionDefinitionand validated it in option-definition validation. - Updated
validateTemplateOptionto support list inputs (and scalar-to-list coercion) whenmultipleis enabled. - Updated site manifest file-option resolution to handle
fileoptions that validate to a list, plus added tests to cover these behaviors.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/myst-templates/src/validators.ts | Wraps option validation to support multiple via list validation/coercion and validates the multiple flag on definitions. |
| packages/myst-templates/src/validators.spec.ts | Adds unit tests for multiple option behavior across option validation, options objects, and option definitions. |
| packages/myst-templates/src/types.ts | Extends TemplateOptionDefinition with a documented multiple flag. |
| packages/myst-cli/src/build/site/manifest.ts | Resolves/copies file options that may now be arrays (when multiple is enabled). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
my recent move is only about rebasing on top of the current main |
a proposal to implement #2729 (whose focus is now restricted to arrays, not objects)