Skip to content

fix(plugins): Align discovery with withJunior package config#78

Merged
dcramer merged 6 commits intomainfrom
fix/plugin-discovery-withjunior-config
Mar 8, 2026
Merged

fix(plugins): Align discovery with withJunior package config#78
dcramer merged 6 commits intomainfrom
fix/plugin-discovery-withjunior-config

Conversation

@dcramer
Copy link
Member

@dcramer dcramer commented Mar 8, 2026

Make withJunior explicit and deterministic for plugin discovery in Next.js deployments.

This changes the wrapper contract to an options-first API and makes plugin package resolution explicit:

  • withJunior(options, nextConfig) is now the canonical and required order (breaking change)
  • pluginPackages is authoritative for plugin package discovery and tracing
  • unresolved pluginPackages now fail fast during config evaluation
  • no env-variable handoff is used for plugin package selection

I removed implicit/ambient discovery paths that depended on runtime process context, since those made plugin loading differ between build and runtime in production environments.

I also removed the wrapper-level sentry boolean. Sentry integration now follows normal @sentry/nextjs env/DSN configuration instead of a separate wrapper flag.

Align plugin package tracing and runtime discovery around the same resolution\nstrategy so CWD shifts no longer cause plugin skills to disappear.\n\nAdd a withJunior pluginPackages option for explicit package-name resolution\nand remove env-based package propagation from runtime behavior.\n\nHarden app root discovery to avoid unrelated workspace app selection and\ncover shifted-CWD regressions with focused tests.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
@vercel
Copy link

vercel bot commented Mar 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Mar 8, 2026 4:52pm

Request Review

Make withJunior use a Junior-first contract by taking options as the first argument and Next config second. This removes ambiguous object-based inference and keeps plugin package selection explicit at the wrapper boundary.

Also remove the wrapper-level sentry toggle and always wrap via @sentry/nextjs so enablement is controlled by standard Sentry env configuration.

BREAKING CHANGE: withJunior now expects options first and Next config second.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Migrate the example app to the options-first withJunior call order so Next config is not accidentally treated as Junior options.

Share filesystem stat helpers across discovery modules and rename local dedupe helpers to avoid semantic ambiguity between path-normalized and string-only variants.

Gate @sentry/nextjs wrapping on DSN presence so consumers without Sentry config do not hard-fail while keeping Sentry enablement environment-driven.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Align user-facing docs with the breaking options-first withJunior signature and explicit plugin package registration.

Remove stale sentry option references and document pluginPackages in quickstart, plugin overview, README, and API reference pages.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Update the example app to pass pluginPackages explicitly so npm plugin discovery matches the documented options-first contract.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
@dcramer dcramer marked this pull request as ready for review March 8, 2026 16:47
Differentiate unresolved plugin packages from installed packages that do not contain Junior plugin content, and surface an explicit validation error for the latter case.

Add coverage for installed-but-invalid plugin packages in next-config tests.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
@dcramer dcramer merged commit c915a9a into main Mar 8, 2026
11 checks passed
@dcramer dcramer deleted the fix/plugin-discovery-withjunior-config branch March 8, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant