You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(pluginkit/wire): write an app's plugin frontend dependencies from the manifests - #89
wire.Config gains an optional PackageJSONPath. When it is set, wire.Run writes every plugin frontend into that package.json as a workspace:* dependency and records the names it wrote under a top-level pluginwire key.
On the next run it drops only recorded names that no manifest names any more. A dependency the app added by hand is never touched, whatever its name or value.
The dependencies come out sorted, every other key keeps its place and value, the file uses tabs and a final newline, and a file that is already right stays byte for byte the same.
A malformed or missing package.json stops Run before it writes any file. An empty PackageJSONPath changes nothing.
Run now renders every file first and writes them in one loop, so a refusal still writes nothing.
The CHANGELOG also records the Go 1.27.2 floor the module already needs.
Why
An app lists every plugin frontend in its package.json by hand, although each manifest already names it. A new plugin directory should need no edit anywhere else.
Testing Instructions
cd pluginkit && GOWORK=off go test -race ./...
cd pluginkit && GOWORK=off go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0 run ./...
Read TestSyncPackageJSONKeepsACanonicalFileOnTheFirstRun and TestSyncPackageJSONDropsARecordedPluginNoManifestNames for the two rules that matter most.
Summary by CodeRabbit
New Features
The wiring generator can optionally synchronize frontend packages in package.json, adding configured workspace dependencies and removing stale ones it previously recorded.
Unrelated dependencies and other package manifest content are preserved.
Package synchronization is optional; when not configured, existing behavior is unchanged.
Documentation
Updated the changelog with the Go 1.27.2 requirement and the optional package manifest setting.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 1594865a-55bf-48a6-a7d3-63cf27887683
📥 Commits
Reviewing files that changed from the base of the PR and between 4560112 and c284ac5.
📒 Files selected for processing: 5
pluginkit/CHANGELOG.md
pluginkit/wire/packagejson.go
pluginkit/wire/packagejson_test.go
pluginkit/wire/wire.go
pluginkit/wire/wire_test.go
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Walkthrough
wire.Run can optionally synchronize plugin frontend dependencies in package.json. The synchronization records managed names, removes stale recorded entries, and preserves unrelated dependencies. Run assembles and writes the synchronized file with its other generated outputs.
The synchronizer validates package JSON, updates and sorts frontend dependencies, records managed names, and removes stale recorded entries. Tests cover validation, preservation, formatting, and idempotence.
Configuration and output assembly pluginkit/wire/wire.go, pluginkit/wire/wire_test.go, pluginkit/CHANGELOG.md
Config adds PackageJSONPath. Output assembly includes synchronized package JSON when configured. Tests cover unset paths, errors before writes, and frontends from multiple roots.
Writing outputs and reporting failures pluginkit/wire/wire.go, pluginkit/wire/wire_test.go, pluginkit/CHANGELOG.md
Run writes the assembled outputs and returns errors from generation or writing. Tests check path-qualified package JSON errors. The changelog records the optional path and Go version requirement.
sequenceDiagram
participant Run as wire.Run
participant Outputs as outputs
participant Sync as syncedPackageJSON
participant PackageJSON as package.json
Run->>Outputs: Assemble output paths and data
Outputs->>Sync: Synchronize configured package JSON
Sync->>PackageJSON: Read current file
PackageJSON-->>Sync: Return file bytes
Sync-->>Outputs: Return synchronized bytes
Outputs-->>Run: Return assembled outputs
Run->>PackageJSON: Write synchronized output
Loading
Merge Risk:⚪ Minimal · up to c284a
The identified concerns do not block merging; normal checks can proceed.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 51.02% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 49 functions across 4 files. (1 skipped: …
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly describes the main change: writing plugin frontend dependencies to an application package.json from manifests. It is specific and concise.
Linked Issues check
Issue #87 requirements are implemented. Config.PackageJSONPath enables package synchronization. frontendPackages collects sorted, unique frontend names across all loaded roots. syncPackageJSON w…
Out of Scope Changes check
The changed implementation, tests, documentation, and changelog support issue #87. The changes do not modify a lock file or add unrelated product behavior. No unrelated change is demonstrated by the r…
Full details: Docstring Coverage
Explanation
Docstring coverage is 51.02% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 49 functions across 4 files. (1 skipped: 1 unsupported.)
Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
[Medium impact] Safe to merge based on the checked behavior; no blocking concerns were found.
Summary
Adds optional PackageJSONPath support to wire.Config.
Plugin manifests now keep app frontend dependencies in sync.
Tests cover dependency ownership, formatting, repeated runs, multiple plugin roots, and refusal before writing. Executed race-enabled tests and filesystem checks confirmed that unrelated dependencies survive cleanup, shared frontend dependencies remain until their last manifest is removed, and repeated runs preserve canonical bytes. Missing and malformed configured files left existing wiring and registry files unchanged. Leaving PackageJSONPath unset neither changed nor created a package.json.
No actionable issues were found. The checked behavior is safe to merge.
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
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.
Closes #87
What
wire.Configgains an optionalPackageJSONPath. When it is set,wire.Runwrites every plugin frontend into that package.json as aworkspace:*dependency and records the names it wrote under a top-levelpluginwirekey.Runbefore it writes any file. An emptyPackageJSONPathchanges nothing.Runnow renders every file first and writes them in one loop, so a refusal still writes nothing.Why
An app lists every plugin frontend in its package.json by hand, although each manifest already names it. A new plugin directory should need no edit anywhere else.
Testing Instructions
cd pluginkit && GOWORK=off go test -race ./...cd pluginkit && GOWORK=off go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0 run ./...TestSyncPackageJSONKeepsACanonicalFileOnTheFirstRunandTestSyncPackageJSONDropsARecordedPluginNoManifestNamesfor the two rules that matter most.Summary by CodeRabbit
package.json, adding configured workspace dependencies and removing stale ones it previously recorded.