XUtils

Bit

Create, find and reuse components (React, Angular, Node etc.) across applications.


Install Bit

Use the Bit installer to install Bit to be available on your PATH.

npx @teambit/bvm install

Initialize Bit on a new folder or in an existing project by running the following command:

bit init --default-scope my-org.my-project

Make sure to create your scope on the Bit platform and use the right org and project name. After running the command, Bit is initialized on the chosen directory, and ready to be used via Bit commands, your editor or the Bit UI!

Create components

Start creating components using the default component generators, or create your own.

bit templates

The following command uses the React UI component template to create a new reusable React component:

bit create react hello-world

You can find simple guides for creating NodeJS modules, UI components and apps, backend services and more on the Create Component docs. Run the Bit UI to preview components using the following command:

bit start 

Use bit run to preview applications during development. To create an application, follow the Create App docs section.

Use components

After creating a new component, start using it by adding an import statement in one of your workspace components.

import { Button } from '@org/scope-name.buttons.button';

Once added, Bit will autodetect the dependency between these components. Use bit show or the VSCode plugin to view the list of dependencies Bit detected for your components.

Release components

You can either use hosted scopes on Bit Cloud or by hosting scopes on your own. Use the following command to create your Bit Cloud account and your first scope.

bit login

Use semantic versioning to version your components:

bit tag --message "my first release" --major

By default, Bit uses Ripple CI to build components. You can use the --build flag to build the components on the local machine. To tag and export from your CI of choice to automate the release process or use our official CI scripts.

After versioning, you can proceed to release your components:

bit export

Head over to your bit.cloud account to see your components build progress. Once the build process is completed, the components will be available for use using standard package managers:

npm install @my-org/my-project.hello-world

Next steps


Articles

  • coming soon...