Draft
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add SchemaMain as optional dependency to LaneDiffGenerator to compute API diff between component versions. Renders API changes (added, removed, modified exports) in CLI output after file diffs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allows bit schema diff <component> --lane [lane-name] to compare a component API on a lane against its main version. When no lane name is given, uses the current lane. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
LanesMain is injected into SchemaDiffCommand by the lanes provider, avoiding direct legacyScope access and circular aspect dependencies.
Will re-implement as a clean lane subcommand.
Cleanly instantiated in LanesMain provider with all dependencies (LanesMain, SchemaMain, ComponentMain, Workspace, ScopeMain). Usage: bit lane api-diff <component> (current lane vs main) bit lane api-diff <component> --lane X (specified lane vs main)
Will implement as --lane flag on schema diff instead.
SchemaDiffCommand defines the --lane flag and exports a laneDiffHandler
callback. LanesMain registers the handler via cli.getCommand('schema'),
following the same pattern used for subcommands (e.g. envs set/unset).
Usage:
bit schema diff <component> --lane (current lane vs main)
bit schema diff <component> --lane scope/x (specified lane vs main)
SchemaMain exposes registerLaneDiffHandler() API. LanesMain registers the handler in its provider, providing lane resolution logic. This follows the same pattern as subcommand registration (e.g. envs set/unset) but for flag handlers. Usage: bit schema diff <component> --lane (current lane vs main) bit schema diff <component> --lane scope/x (specified lane vs main)
… diff --lane Follows the same pattern as LaneDiffGenerator.generate() which calls importWithoutDeps for both lane and main versions before loading. The main version is imported without a lane context, and the lane version is imported with the lane object so the importer knows which remote scope to fetch from.
Use ComponentID.fromString() instead of host.idsByPattern() so the component doesn't need to be in the workspace. Use scope.getMany() instead of host.getMany() to load from scope after importing.
…hema diff --lane For fully remote components, the ModelComponent object doesn't exist locally. Import the component from main first so getModelComponent can find it and resolve the main head.
When base-version and compare-version are given alongside --lane, use them instead of auto-resolving from lane/main heads. This allows: bit schema diff comp v1 v2 --lane my-lane (explicit versions) bit schema diff comp --lane my-lane (auto-resolve from heads)
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.
Proposed Changes