fix(config): Fail fast on plugin build config#409
Draft
dcramer wants to merge 9 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
e92f3e1 to
474eefd
Compare
474eefd to
d85d6dd
Compare
d85d6dd to
d0a226c
Compare
d0a226c to
b657633
Compare
b657633 to
faa1e8b
Compare
Do not silently ignore malformed JUNIOR_PLUGIN_PACKAGES when createApp falls back from the missing Nitro virtual config module. Fail configured plugin package discovery when a package is missing or contains no plugin content. A typo in plugins.packages should break startup or build, not quietly load without the requested provider. Resolve configured plugin packages through the app cwd when direct node_modules lookup misses, and copy resolved package content into server node_modules even when the physical package lives in an ancestor workspace node_modules directory. Fail configured includeFiles entries when the package, source directory, file pattern, or matched source file cannot be copied. Resolve those packages from the app cwd so user-provided build includes do not accidentally depend on Junior's own module graph. Remove the hidden JUNIOR_EXTRA_PLUGIN_ROOTS discovery hook. Tests and evals now install plugin fixtures through temporary app/plugins roots so they exercise the normal local plugin path. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Share package-root resolution across plugin discovery and build copying so configured packages do not need a JS entry point to load or copy plugin content. Validate configured package names before filesystem resolution so plugin package config and includeFiles cannot be interpreted as path-shaped package names. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Return a fresh defaults object so callers cannot mutate install-wide config defaults outside the validation path. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Clean up partial plugin fixture setup when eval harness initialization fails so later evals do not inherit a changed working directory. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Remove the package-only plugin global and make PluginConfig the single source for package discovery. This avoids package/config drift between app startup, eval setup, diagnostics, and registry loading. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Restore the previous plugin config if createApp fails while validating install-wide defaults. This keeps failed startup attempts from leaving partial process-global plugin state behind. Co-Authored-By: GPT-5 Codex <codex@openai.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2a20894. Configure here.
Return undefined when Node package resolution setup cannot be created from an app cwd. This keeps configured plugin package failures on the explicit resolver error path instead of leaking lower-level module setup errors. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Force configured plugin packages and manifest overrides through catalog loading during app startup. Roll back plugin config and install defaults when startup validation fails so a bad app creation attempt cannot leak partial process-global state. Also validate array-valued plugin and build config at runtime so malformed JavaScript or virtual config fails clearly instead of being iterated as strings. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Clone install-wide config defaults on write and read so nested values cannot mutate process-global defaults outside the validation path. Reject null and array defaults instead of treating malformed config as a clear operation. Co-Authored-By: GPT-5 Codex <codex@openai.com>
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.

Tighten plugin and build configuration loading so malformed, unresolved, or misspelled explicit config fails at startup/build instead of being silently ignored.
This keeps the build-time Nitro virtual config path as the primary source, but only falls back to
JUNIOR_PLUGIN_PACKAGESwhen the virtual module is genuinely absent. Other import errors now propagate instead of being mistaken for missing config.Configured
plugins.packagesentries now fail if the package list is malformed, the package name is malformed, the package cannot be resolved, or the package has no plugin content. A typo should break loudly, not produce a runtime that simply lacks the requested provider. App startup now forces catalog validation for explicit plugin package/config/defaults input and rolls both plugin config and install defaults back if validation fails, so a bad startup attempt cannot leak partial process-global state. Package discovery uses a shared package-root resolver that preserves visible and ancestornode_modulespaths and can resolve content-only packages throughpackage.json, so plugin packages do not need a JS entry point just to loadplugin.yamlorskills. Resolver setup failures also return through the same explicit configured-package error path instead of leaking lower-level module setup errors.The runtime now has one plugin configuration source. The old package-only plugin global is gone, so app startup, eval setup, diagnostics, and registry loading all read package configuration from the same
PluginConfigstate instead of keeping package names and manifest overrides in separate mutable slots.Build copying uses the same resolver for
includeFilesand rejects malformed package names before touching filesystem paths.includeFilesitself must be an array of package subpath patterns, and entries still fail if the package, source directory, file pattern, or matched source file cannot be resolved/copied. These entries are explicit build contracts for files the bundler cannot trace, so skipping them would produce a misleadingly successful build.Install-wide config defaults now reject malformed shapes, deep-clone values on write and read, and only treat
undefinedas a clear operation. That keeps nested values from mutating process-global defaults outside the validation path.This also removes the hidden
JUNIOR_EXTRA_PLUGIN_ROOTSdiscovery path. Tests and evals now install fixture plugins through a temporaryapp/pluginsroot and exercise the same local plugin discovery path as production apps; the eval harness also cleans up partial plugin fixture setup if later setup validation fails, socwdis restored for subsequent evals.