feat(internalize): add bit internalize to hide components by default in the UI#10397
Merged
Conversation
…in the UI Introduces a new teambit.component/internalize aspect. Internal components are still versioned and exported, but marked so they're hidden by default in the UI (workspace, scope and Bit Cloud, which reads the new Component.internal GraphQL field). - single command `bit internalize [pattern]` with --revert and --list - persists as aspect config in .bitmap, baked into the Version on tag/snap - adds `internal` workspace state filter and `` pattern support
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new teambit.component/internalize aspect and bit internalize command to mark components as internal (still versioned/exported) so they can be hidden by default in Bit’s UI/Cloud, using the same “aspect config baked into Version” approach as deprecation.
Changes:
- Added
@teambit/internalizeaspect with CLI command,bit showfragment, and GraphQL schema (Component.internal). - Added workspace state filtering for
internaland model/bitmap helpers to detect internal status. - Registered the new aspect as a core aspect (manifests + legacy
Extensionsenum) and added the component to.bitmap.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scopes/workspace/workspace/filter.ts | Adds internal to workspace state filtering and implements byInternal() using bitmap overrides + model lookup. |
| scopes/scope/objects/models/model-component.ts | Adds ModelComponent.isInternal() to detect internal status from the head Version’s core extension config. |
| scopes/harmony/bit/manifests.ts | Registers InternalizeAspect as a core manifest so it’s available system-wide. |
| scopes/component/internalize/internalize.main.runtime.ts | Implements Internalize aspect runtime: read internal flag, apply/revert, list internal components, register CLI/show/graphql. |
| scopes/component/internalize/internalize.graphql.ts | Extends GraphQL Component with internal: InternalInfo. |
| scopes/component/internalize/internalize.fragment.ts | Adds bit show output for internal status. |
| scopes/component/internalize/internalize.aspect.ts | Declares the teambit.component/internalize aspect. |
| scopes/component/internalize/internalize-cmd.ts | Implements bit internalize command with --revert/--list/--json. |
| scopes/component/internalize/index.ts | Public exports for the new aspect/runtime types. |
| scopes/component/internalize/esm.mjs | ESM bridge entry for the internalize component. |
| components/legacy/constants/constants.ts | Adds Extensions.internalize core extension ID. |
| components/legacy/bit-map/component-map.ts | Adds bitmap helpers isInternal() / isUninternalized() for local overrides. |
| .bitmap | Adds the new internalize component entry to the workspace map. |
- assign teambit.harmony/envs/core-aspect-env to the internalize aspect, matching the other core aspects - add e2e coverage: mark/list/show, pattern, modified status, config removal after tag, export+import (remote), --revert, pattern, and checkout reset - add internalize/uninternalize/list helpers to the e2e command helper
…reshold - correct the --json option description to match actual behavior (works for --list and for the mark/revert operation) - raise MAX_FILES_READ in the filesystem-read perf test to account for the new core aspect loaded at bootstrap
avoid listing every changed component-id in the .bitmap write reason (which bloats bitmap-history-metadata.txt for large patterns like "**"); use a component count instead when more than one component changed.
GiladShoham
approved these changes
May 27, 2026
ran "npm run generate-core-aspects-ids" so the load-aspect helper recognizes teambit.component/internalize as a core aspect (as instructed by the comment above manifestsMap). This also resolves the bit_pr lane-merge failure that couldn't locate the component.
2 tasks
davidfirst
added a commit
that referenced
this pull request
May 29, 2026
## Summary Surfaced by #10397's `bit_pr` failure. When `--keep-lane` (from #10388) found the lane on the remote, it called `switchToLane` and assumed that landed us on the lane. If the stored lane was stale relative to the current PR — typically referencing a `ModelComponent` the PR has since removed/renamed, surfaced as `unable to merge lane …, the component … was not found` — the switch failed (`switchToLane` logs-and-swallows the underlying error), the post-switch guard then threw, and every subsequent `bit ci pr --keep-lane` on that branch wedged the same way until the lane was manually deleted on the remote. ## Fix When we observe that we did not land on the requested lane after switching, delete the stale remote lane and create a fresh one (same name) — the same shape the `else` branch already takes when the lane doesn't exist on the remote. Lane history for the contested run is lost, but the next run preserves history again and CI is no longer blocked.
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.
Adds a new
teambit.component/internalizeaspect for marking components as internal. Internal components are still versioned and exported (unlikelocal-only) — they're only hidden by default in the UI (workspace, scope, and Bit Cloud).The marker is stored as aspect config in
.bitmap, baked into the Version on tag/snap, and travels with export — the same mechanism asdeprecation. Bit Cloud hides internal components by default via the newComponent.internalGraphQL field.Usage
Changes
scopes/component/internalize/(main runtime, CLI command, GraphQL schema,bit showfragment).--revert/--list/--json; supports component patterns.Component.internalGraphQL field for Cloud/UI consumption.internalworkspace state filter and$internalpattern support.isInternal()on the model-component and bitmap entry; registered as a core aspect.