Skip to content
forked from teambit/bit

A lightweight and highly extendible Polyrepo for component-driven development.

License

Notifications You must be signed in to change notification settings

priyankukonar/bit

Repository files navigation

bit - the reusable code component manager

Today, finding small code components means searching the web (e.g. googling stack overflow...) and copy-pasting them across multiple repositories. We all do it, and we all know it's bad: it creates an unmaintainable, hard to update code base with an ever growing technological debt.

The alternative, treating few lines of code as entire packages, means creating a heavy dependency tree while relying on external sources. We all remember the left pad story. We also know that a bigger dependency tree equals a slower build and a heavier app.

Bit is a distributed code component manager that saves the need to copy-paste code components or to install entire packages for a few lines of code. Each code component can be easily published, found or injected into your code in seconds and without effort.

A simple code component like this:

  function padLeft (str, len, ch) {
    str = String(str);
    var i = -1;
    if (!ch && ch !== 0) ch = ' ';
    len = len - str.length;
    while (++i < len) {
      str = ch + str;
    }
    return str;
  }
  
  module.exports = padLeft;

Simply becomes:

  const padLeft = bit('pad-left');
  padLeft(str, len, ch);

It allows you to design lighter applications with super fast installation and a duplication-free and easy-to-maintain code base which does not depend on external sources.

install

  npm -g bit-bin (not supported yet)

development

installation

  • install dependencies using yarn
  $ yarn
  • you can use npm instead
  $ npm i
  • install command globally and link (in order to use the "bit" command globaly and always use the latest development build)
  npm install -g
  npm link

Flow

npm install -g flow-bin flow-typed
  • install type definitions using flow-typed
  flow-typed install

build

  • build legacy and modern distributions:
  npm run build
  • use with watch, to run the build on every code modification
  npm run watch

test

  • run the unit tests
  npm  test

lint

  • run eslint
  npm run lint

About

A lightweight and highly extendible Polyrepo for component-driven development.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 96.2%
  • JavaScript 1.6%
  • SCSS 1.5%
  • Vue 0.4%
  • Shell 0.2%
  • PowerShell 0.1%