Create a new component forked from an existing one (copies source files and configs)
$bit fork <source-component-id> [target-component-name]
Arguments
Argument | Description | Required |
---|---|---|
source-component-id | the component id of the source component | ✅ |
target-component-name | the name for the new component (component name without scope, e.g. name/spaces/my-button). to set a different scope, use the '--scope' flag |
Options
Option | Option Alias | Description | Value Type |
---|---|---|---|
--scope | -s | default scope for the new component | string |
--path | -p | relative path in the workspace for the new component. by default the path is `<scope>/<namespace>/<name>` | string |
--refactor | -r | update the import/require statements in all dependent components (in the same workspace) | boolean |
--skip-dependency-installation | -x | do not install packages of the imported components | boolean |
--env | -e | set the environment for the new component | string |
--skip-config | - | do not copy the config (aspects-config, env, etc) to the new component. helpful when it fails during aspect loading | boolean |
--preserve | - | avoid refactoring file and variable/class names according to the new component name | boolean |
--no-link | - | avoid saving a reference to the original component | boolean |
--ast | - | EXPERIMENTAL. use ast to transform files instead of regex | boolean |