fix(types): add missing properties to SolidStartOptions and expose them via Vite plugin configuration - #2236
Conversation
Expose the appRoot configuration option in the SolidStartOptions interface to match the runtime implementation. Also add missing devOverlay and experimental options that are supported by the plugin defaults.
🦋 Changeset detectedLatest commit: 7a5f033 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
✅ Deploy Preview for solid-start-landing-page ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
Added missing properties to `SolidStartOptions` and exposed them through Vite plugin configuration.
There was a problem hiding this comment.
Pull request overview
This PR updates the public @solidjs/start/config TypeScript surface so SolidStartOptions accurately represents the options accepted by the solidStart() Vite plugin (notably appRoot), and adds inline JSDoc to improve discoverability and prevent future drift between defaults and types.
Changes:
- Expand
SolidStartOptionsto include previously-missing options (e.g.appRoot,devOverlay,experimental) and add JSDoc describing purpose/defaults. - Constrain the internal default
startconfig object withsatisfies SolidStartOptionsto keep defaults and the interface in sync. - Minor formatting change to
this.error(...)calls in the boundary-modules resolver.
Comments suppressed due to low confidence (2)
packages/start/src/config/index.ts:53
devOverlayis required inSolidStartOptions, butsolidStart()supplies a default (true). Making it required forces callers who only want to override a different option (e.g.appRoot) to also specifydevOverlay, which is an unnecessary breaking change for the plugin config surface.
* Show the SolidStart development overlay (error overlay, etc.) in development.
*
* @default true
*/
devOverlay: boolean;
packages/start/src/config/index.ts:59
experimentalis currently required inSolidStartOptions, which makes any options object requireexperimental: { islands: false }even thoughsolidStart()provides a default. This is very awkward for consumers and turns partial configuration into a type error; make theexperimentalobject optional (and theislandsflag optional within it) so callers can omit it.
/**
* Experimental features.
*/
experimental: {
/**
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR Checklist
Please check if your PR fulfills the following requirements:
SolidStartOptionsdoes not correctly expose all configuration options #2235What is the current behavior?
SolidStartOptions (exported from @solidjs/start/config) does not correctly expose all of the configuration properties actually accepted by the solidStart() Vite plugin.
Because
appRootcannot be set, consumers are also unable to moveapp.{jsx,tsx}out of the default./srcdirectory (e.g. to mirror a Next.js-style /app structure), and doing so causes a build-time failure.What is the new behavior?
SolidStartOptionsnow correctly declares all configuration properties accepted by solidStart(), includingappRootanddevOverlay.appRootcan now be set by consumers to relocateapp.{jsx,tsx}(and, by extension,routeDirand other paths relative to it) away from the default./src.SolidStartOptionsproperties, documenting their purpose, accepted values, and defaults along with a links to documentation when relevant.startconfiguration dictionary is now constrained to theSolidStartOptionsinterface usingsatisfies, causing type errors when one does not match the shape of the other, in hopes to prevent future issues like this one.