Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
react-server-docs | 0356ee3 | Mar 06 2026, 07:09 AM |
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
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.
This PR adds a comprehensive configuration system for
@lazarv/react-serverthat validates configs at dev/build time, provides full TypeScript IntelliSense for JS/TS config files viadefineConfig(), and generates a JSON Schema for editor autocompletion in JSON config files.Previously,
ReactServerConfigwas typed asanyand invalid config options were silently ignored. Now every config property is validated with actionable error messages (including did-you-mean suggestions and inline examples), and developers get rich autocompletion regardless of their config file format.Runtime config validation
A zero-dependency validation module that checks every config property against a declarative schema of predicate functions. Integrated into both the dev server (
lib/dev/action.mjs) and production build (lib/build/action.mjs) pipelines.Features:
picocolorsError output example:
TypeScript type definitions
A complete
ReactServerConfiginterface with JSDoc descriptions and@exampletags on every property. Replaces the previousReactServerConfig = anytype.Sub-interfaces:
ServerConfig,ResolveConfig,BuildConfig,SsrConfig,CssConfig,OptimizeDepsConfig,CacheConfig,ServerFunctionsConfig,MdxConfig,RollupOptionsHelper types:
PluginOption,AliasEntry,KnownAdapter,AdapterOption,ExportPathDescriptor,FileRouterConfigValueJSON Schema generator
Runtime module exporting:
DESCRIPTIONS— human-readable descriptions for 100+ config properties (dot-notation keyed)generateJsonSchema()— produces a JSON Schema (draft-07) object with descriptions, type constraints, enums, and nested sub-schemasStatic JSON Schema
Pre-generated JSON Schema file. JSON config files can reference it for editor validation and autocompletion:
{ "$schema": "https://react-server.dev/schema.json" }or locally:
{ "$schema": "node_modules/@lazarv/react-server/config/schema.json" }defineConfig()typed helperThe existing
defineConfig()identity function now returns the fully-typedReactServerConfiginstead ofany, providing IntelliSense in JS/TS configs:Docs site schema endpoint (SSG)
The JSON Schema is served from
https://react-server.dev/schema.jsonvia an SSG API route, following the same pattern assitemap.xml:docs/src/pages/GET.{schema.json}.server.mjs— API route handlerexport()config for static generationDocumentation updates
Added a "Typed configuration" section to both the English and Japanese configuration pages documenting
defineConfig()and$schemausage.Design decisions
picocolors(already a dependency). No Zod, Ajv, or similar libraries.schema.d.tsdrives TypeScript IntelliSense,schema.mjsdrives JSON Schema generation and descriptions,validate.mjsdrives runtime validation. All three cover the same property set.