Skip to content

feat(internalize): add bit internalize to hide components by default in the UI#10397

Merged
davidfirst merged 8 commits into
masterfrom
feat/internalize-components
May 29, 2026
Merged

feat(internalize): add bit internalize to hide components by default in the UI#10397
davidfirst merged 8 commits into
masterfrom
feat/internalize-components

Conversation

@davidfirst
Copy link
Copy Markdown
Member

Adds a new teambit.component/internalize aspect for marking components as internal. Internal components are still versioned and exported (unlike local-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 as deprecation. Bit Cloud hides internal components by default via the new Component.internal GraphQL field.

Usage

bit internalize "ui/**"        # mark matching components as internal (pattern supported)
bit internalize button --revert  # remove the internal mark
bit internalize --list           # list components currently marked internal

Changes

  • New aspect under scopes/component/internalize/ (main runtime, CLI command, GraphQL schema, bit show fragment).
  • Single command with --revert / --list / --json; supports component patterns.
  • Component.internal GraphQL field for Cloud/UI consumption.
  • Added internal workspace state filter and $internal pattern support.
  • isInternal() on the model-component and bitmap entry; registered as a core aspect.

…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
Copilot AI review requested due to automatic review settings May 27, 2026 15:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/internalize aspect with CLI command, bit show fragment, and GraphQL schema (Component.internal).
  • Added workspace state filtering for internal and model/bitmap helpers to detect internal status.
  • Registered the new aspect as a core aspect (manifests + legacy Extensions enum) 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.

Comment thread scopes/workspace/workspace/filter.ts
Comment thread scopes/component/internalize/internalize-cmd.ts Outdated
Comment thread scopes/component/internalize/internalize-cmd.ts
- 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
Copilot AI review requested due to automatic review settings May 27, 2026 16:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Comment thread scopes/component/internalize/internalize.main.runtime.ts Outdated
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.
Copilot AI review requested due to automatic review settings May 28, 2026 20:40
@davidfirst davidfirst enabled auto-merge (squash) May 28, 2026 20:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Comment thread scopes/harmony/bit/manifests.ts
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.
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.
Copilot AI review requested due to automatic review settings May 29, 2026 19:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

@davidfirst davidfirst merged commit 60c9d1d into master May 29, 2026
13 checks passed
@davidfirst davidfirst deleted the feat/internalize-components branch May 29, 2026 19:50
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.

3 participants