Skip to content

Conversation

@davidfirst
Copy link
Member

Changes

Implements support for specifying the scope directly in the component name when using bit create, eliminating the need for the separate --scope flag in many cases.

New Syntax

bit create react my-org.my-scope/hooks/use-session

Instead of:

bit create react hooks/use-session --scope my-org.my-scope

Implementation Details

  • Added parseScopeFromComponentIdStr() method to extract scope from component name
  • Only works for bit.cloud scopes (containing a dot), e.g., my-org.my-scope
  • Falls back to --scope flag or workspace defaultScope if no scope is found in the name
  • Each component can have its own scope when creating multiple components
  • Local bare-scopes without dots are unaffected

Testing

  • Added comprehensive e2e test covering the new functionality
  • All existing tests pass
Allow specifying scope as part of the component name for bit.cloud scopes:
- bit create react my-org.my-scope/hooks/use-session
- Eliminates need for separate --scope flag in many cases
- Only works for bit.cloud scopes (containing a dot)
- Falls back to --scope flag or defaultScope if no scope in name
- Each component can have its own scope when creating multiple components
@davidfirst davidfirst enabled auto-merge (squash) November 24, 2025 19:10
@davidfirst davidfirst merged commit f937e00 into master Nov 24, 2025
12 checks passed
@davidfirst davidfirst deleted the feat/create-with-scope-in-component-name branch November 24, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants