• This repository has been archived on 13/Apr/2021
  • Stars
    star
    102
  • Rank 323,886 (Top 7 %)
  • Language
    JavaScript
  • License
    Other
  • Created about 6 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

react application deconstructed to Bit components, to be a shared-library https://bit.dev/bit/movie-app

Tracking Bit Components - Movie App Example

This repository was exported as Bit components.

This is how we did it:

$ bit init
successfully initialized a bit workspace.
$ npm install

The bit init command has initialized a local Bit scope and created a bit.json file.

Next, we want to track the project's components as Bit components, and let Bit know which files are the test files.

$ bit add src/components/* -t 'src/components/{PARENT}/*.spec.js'
tracking 8 new components

After tracking, checking the status will prompt the following result:

$ bit status
new components
(use "bit tag --all [version]" to lock a version with all your changes)

     > hero ...  missing dependencies
       untracked file dependencies (use "bit add <file>" to track untracked files as components):
          src/components/hero/Hero.js -> src/global.css

     > hero-button ...  missing dependencies
       untracked file dependencies (use "bit add <file>" to track untracked files as components):
          src/components/hero-button/HeroButton.js -> src/global.css

     > item ...  missing dependencies
       untracked file dependencies (use "bit add <file>" to track untracked files as components):
          src/components/item/Item.js -> src/global.css

     > list-toggle ...  missing dependencies
       untracked file dependencies (use "bit add <file>" to track untracked files as components):
          src/components/list-toggle/ListToggle.js -> src/global.css

     > logo ...  missing dependencies
       untracked file dependencies (use "bit add <file>" to track untracked files as components):
          src/components/logo/index.js -> src/global.css

     > navigation ...  missing dependencies
       untracked file dependencies (use "bit add <file>" to track untracked files as components):
          src/components/navigation/Navigation.js -> src/global.css

     > title-list ...  missing dependencies
       untracked file dependencies (use "bit add <file>" to track untracked files as components):
          src/components/title-list/TitleList.js -> src/global.css

     > user-profile ...  missing dependencies
       untracked file dependencies (use "bit add <file>" to track untracked files as components):
          src/components/user-profile/UserProfile.js -> src/global.css

Bit warns us that all the components has an untracked file dependency - this means that the component requires another file that is not tracked by Bit. We can either track the file as part of the existing component, or decide to track a new component, which is what we would do:

$ bit add src/global.css --id style/global
tracking component style/global:
added src/global.css

If we check the status, we can see all is well:

$ bit status
new components
(use "bit tag --all [version]" to lock a version with all your changes)

     > hero ... ok
     > hero-button ... ok
     > item ... ok
     > list-toggle ... ok
     > logo ... ok
     > navigation ... ok
     > title-list ... ok
     > user-profile ... ok
     > style/global ... ok

Next, we'll import a build environment and a test environment, so the components will be built and tested properly:

$ bit import bit.envs/compilers/react --compiler
the following component environments were installed
- bit.envs/compilers/[email protected]

$ bit import bit.envs/testers/mocha --tester
the following component environments were installed
- bit.envs/testers/[email protected]

Now let's test the components!

$ bit test

We can see all the tests are β€˜passed’. Sounds like a good time to tag and export the components to your scope on bit.dev.

$ bit tag --all 1.0.0
...9 components tagged | 9 added, 0 changed, 0 auto-tagged
added components:  style/[email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]

$ bit export <user-name>.movie-app-example
exported 9 components to scope <user-name>.movie-app-example

That's it, it's now possible to consume the components from any other project as individual components! Check out your scope on bit.dev.

More Repositories

1

bit

A build system for development of composable software.
TypeScript
17,450
star
2

bit-docker

A dockerfile setup to run your own Bit server.
Dockerfile
89
star
3

envs

Component development environments for the Bit community
TypeScript
63
star
4

base-ui

The basic bit.dev React component design system.
TypeScript
59
star
5

bvm

Bit version manager
TypeScript
38
star
6

bit-javascript

A javascript driver for bit
TypeScript
38
star
7

evangelist

React components used to build the bit.dev marketing website.
TypeScript
37
star
8

bit-angular

Angular support for bit harmony
TypeScript
28
star
9

bit-dev

Bit's website.
TypeScript
28
star
10

cleargraph

A library for modeling and traversing graphs
TypeScript
24
star
11

bit.envs

DEPRECATED - Bit compilers and testers were moved to https://github.com/teambit/envs
JavaScript
23
star
12

bit-vue-tutorial

Demo Vue app for the official Bit with Vue components tutorial.
Vue
12
star
13

bit-with-github-actions

A Bit integration with GitHub Actions CI.
JavaScript
12
star
14

react-demo-app

A React TODO app with some UI components -> Shared as a reusable collection:
JavaScript
10
star
15

bit-react-tutorial

Official React tutorial for Bit.
JavaScript
9
star
16

react-tailwind-env

An example of a custom react env with basic support for tailwindcss
TypeScript
9
star
17

relsym

Converts absolute symlinks to relative ones
JavaScript
9
star
18

docs

Bit documentation website
JavaScript
8
star
19

bit-lit

Lit element support for Bit Harmony
TypeScript
7
star
20

demo-react-component-lib

A Bit workspace demonstrating best practices to structuring design systems with Bit.
TypeScript
6
star
21

harmony-base-ui

TypeScript
6
star
22

documenter

TypeScript
5
star
23

vue-demo-app

A VueJS todo app
Vue
4
star
24

harmony-with-github-actions

A demo project: Component collaboration using Bit, Bit.dev, git, and Github.
TypeScript
4
star
25

harmony-evangelist

TypeScript
4
star
26

bit.utils

JavaScript
4
star
27

try-bit

A Bit Harmony demo workspace.
TypeScript
3
star
28

bit-angular-tutorial

TypeScript
3
star
29

bit-foundations

Concrete component-driven implementations for integrating workflows and tech stacks with bit
TypeScript
3
star
30

design

Teambit's Design System components
TypeScript
2
star
31

custom-prettier-config

An example repo for customizing prettier config in a custom env
TypeScript
2
star
32

any-fs

anyfs is a composable and extendible file-system and fully compatible with the node `fs` module.
TypeScript
2
star
33

examples-workspace-internal

Internal version of the Harmony beta project, where we'll add numerous use cases and tests to ensure that nightly changes dont break workflows
TypeScript
2
star
34

bit-with-azure-devops

A Bit integration with Azure.
JavaScript
2
star
35

example-templates

Automatic templates for bit.dev's examples
TypeScript
1
star
36

detective-vue

JavaScript
1
star
37

remote-teams

Repo for https://medium.com/@JonathanSaring/739625e7069d
JavaScript
1
star
38

bit-websites

Components for Bit Websites
1
star
39

explorer

TypeScript
1
star
40

onboarding-docs

Docs for onboarding to Bit
TypeScript
1
star
41

vue-lookup

JavaScript
1
star
42

harmony-demos-handlebars

Demo for using Handlebars with Bit Harmony
TypeScript
1
star
43

examples

Examples of using and extending Bit.
TypeScript
1
star
44

harmony-jsx-less

JavaScript
1
star
45

styled-jsx

Harmony repo with added support for styled-jsx
TypeScript
1
star
46

templates

a list of templates for bit
TypeScript
1
star
47

custom-eslint-config

An example of how to customize eslint config
TypeScript
1
star
48

github-ci-example

Example of setting up Bit's git-first flow using Github
TypeScript
1
star
49

figma-bit-design-tokens-sync

TypeScript
1
star
50

dependabot-bit

1
star
51

.github

Adds a readme file to the orgs overview tab
1
star
52

envs-health-status

basic e2e runs for default envs created and maintained by bit
1
star
53

custom-preview-example

a workspace showcasing a custom preview aspect
TypeScript
1
star
54

nimble-demo

A demo of how multiple teams can work together in Bit to combine their work into a single, cohesive application.
TypeScript
1
star