Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/teambit/bit into module-f…
Browse files Browse the repository at this point in the history
…ederation

# Conflicts:
#	scopes/preview/preview/preview.main.runtime.tsx
#	scopes/preview/preview/preview.task.ts
#	scopes/react/react/mount.tsx
#	scopes/react/react/webpack/webpack.config.base.preview.ts
  • Loading branch information
GiladShoham committed Jun 14, 2021
2 parents 95ac060 + 963865b commit 7e2dd15
Show file tree
Hide file tree
Showing 297 changed files with 6,037 additions and 4,493 deletions.
490 changes: 254 additions & 236 deletions .bitmap

Large diffs are not rendered by default.

111 changes: 89 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ commands: # reusable commands
- # add the id_rsa to ssh_agent to make sure we authenticate with the correct user
run: 'chmod 400 ~/.ssh/id_rsa'
- run: 'ssh-add ~/.ssh/id_rsa'
install_bvm:
steps:
- run: npm i -g @teambit/bvm
- run: "echo 'export PATH=~/.npm-global/bin:$PATH' >> $BASH_ENV"

set_git_credentials:
steps:
Expand Down Expand Up @@ -149,17 +153,39 @@ jobs:
paths:
- bit

symphony_docker_build:
machine: true
steps:
- attach_workspace:
at: ./
- run: echo "$DOCKER_PASS" | docker login --username $DOCKER_USER --password-stdin
- run: cd bit/scripts && docker build -f ./docker-teambit-bit/Dockerfile-symphony -t bitcli/bit-symphony:`npm show @teambit/bit version` .
- run: cd bit/scripts && docker build -f ./docker-teambit-bit/Dockerfile-symphony -t bitcli/bit-symphony:latest .
- run: cd bit && docker push bitcli/bit-symphony:`npm show @teambit/bit version`
- run: cd bit && docker push bitcli/bit-symphony:latest

docker_build:
machine: true
steps:
- attach_workspace:
at: ./
- run: echo "$DOCKER_PASS" | docker login --username $DOCKER_USER --password-stdin
- run: cd bit/scripts && docker build -f ./docker-teambit-bit/Dockerfile -t bitcli/bit:`npm show @teambit/bit version` .
- run: cd bit/scripts && docker build -f ./docker-teambit-bit/Dockerfile -t bitcli/bit:latest .
- run: cd bit/scripts && docker build -f ./docker-teambit-bit/Dockerfile-bit -t bitcli/bit:`npm show @teambit/bit version` .
- run: cd bit/scripts && docker build -f ./docker-teambit-bit/Dockerfile-bit -t bitcli/bit:latest .
- run: cd bit && docker push bitcli/bit:`npm show @teambit/bit version`
- run: cd bit && docker push bitcli/bit:latest

server_docker_build:
machine: true
steps:
- attach_workspace:
at: ./
- run: echo "$DOCKER_PASS" | docker login --username $DOCKER_USER --password-stdin
- run: cd bit/scripts && docker build -f ./docker-teambit-bit/Dockerfile-bit-server -t --build-arg BIT_VERSION=`npm show @teambit/bit version` bitcli/bit-server:`npm show @teambit/bit version` .
- run: cd bit/scripts && docker build -f ./docker-teambit-bit/Dockerfile-bit-server -t bitcli/bit-server:latest .
- run: cd bit && docker push bitcli/bit-server:`npm show @teambit/bit version`
- run: cd bit && docker push bitcli/bit-server:latest

set_ssh_key:
<<: *defaults
working_directory: ~/.ssh
Expand Down Expand Up @@ -467,6 +493,9 @@ jobs:
setup_harmony:
resource_class: large
<<: *defaults
environment:
# change the npm config to avoid using sudo
NPM_CONFIG_PREFIX: ~/.npm-global
steps:
- attach_workspace:
at: ./
Expand All @@ -475,19 +504,33 @@ jobs:
- run:
name: 'install husky globally'
command: 'sudo npm i -g husky'
- run:
name: 'install harmony'
command: 'cd bit && npm run install-harmony'

- install_bvm
- run: npm view @teambit/bit version > ./version.txt
- restore_cache:
key: v2-linux-bvm-folder-{{ checksum "version.txt" }}
- run: bvm config set DEFAULT_LINK bbit
- run: bvm upgrade
- run: bvm link --verbose
- run: bbit
- save_cache:
key: v2-linux-bvm-folder-{{ checksum "version.txt" }}
paths:
- /home/circleci/.bvm
- run: cd bit && bbit install
- run: cd bit && npm run link-bit-legacy
- run: cd bit && bbit compile

# - run:
# name: 'import objects'
# command: 'cd bit && npm run import-harmony'
- run:
name: 'build harmony'
command: 'cd bit && npm run build-harmony'
no_output_timeout: '20m'
- run:
name: 'status harmony'
command: 'cd bit && npm run status-harmony'
# name: 'install harmony'
# command: 'cd bit && npm run install-harmony'
# - run:
# name: 'build harmony'
# command: 'cd bit && npm run build-harmony'
# no_output_timeout: '20m'
# - run:
# name: 'status harmony'
# command: 'cd bit && npm run status-harmony'
- run:
name: 'Build bit source code'
command: 'cd bit && npm run build'
Expand Down Expand Up @@ -543,6 +586,10 @@ jobs:
- attach_workspace:
at: ./
- bit_global_for_npm
- install_bvm
- run: npm view @teambit/bit version > ./version.txt
- restore_cache:
key: v2-linux-bvm-folder-{{ checksum "version.txt" }}
- bit_config:
env: "hub"
- restore_cache:
Expand All @@ -555,17 +602,24 @@ jobs:
name: setting npmjs registry with publishing permission
command: echo "//registry.npmjs.org/:_authToken=${npmjsRegistryToken}" >> ~/.npmrc
- run: cd bit && node scripts/bump-bit-legacy-ver.js
- run: cd bit && build-harmony/node_modules/.bin/bbit status
- run: bvm link
# - run: cd bit && build-harmony/node_modules/.bin/bbit status
- run: cd bit && bbit status
# temporarily. otherwise it fails on bit-checkout during Yarn installation with "Error: ENOENT: no such file or directory, chmod '/home/******ci/bit/bit/node_modules/@teambit/legacy/node_modules/@babel/core/node_modules/semver/bin/semver'""
- run: cd bit && rm -rf node_modules
- run: cd bit && build-harmony/node_modules/.bin/bbit checkout latest --all --skip-npm-install
- run: cd bit && bbit checkout latest --all --skip-npm-install
# - run: cd bit && build-harmony/node_modules/.bin/bbit checkout latest --all --skip-npm-install
# - run: cd bit && rm -rf node_modules/@teambit/legacy
# - run: cd bit && bbit checkout latest --all
# - run: cd bit && build-harmony/node_modules/.bin/bbit checkout latest --all
# - run: cd bit && npm run link-bit-legacy
# since we removed the node_modules we need to make sure we compile, install and link everything again
- run:
name: 'build harmony'
command: 'cd bit && npm run build-harmony-skip-import'
- run: cd bit && bbit install --skip-import
- run: cd bit && bbit compile
- run: cd bit && npm run link-bit-legacy
# - run:
# name: 'build harmony'
# command: 'cd bit && npm run build-harmony-skip-import'
# - run: cd bit && node scripts/soft-tag-scope-teambit.js
- run:
name: tag persist
Expand Down Expand Up @@ -1475,9 +1529,15 @@ workflows:
<<: *master_only_filter
requires:
- bit_tag
- docker_build:
- symphony_docker_build:
requires:
- bit_tag
- docker_build:
requires:
- harmony_publish_to_gcloud
- server_docker_build:
requires:
- docker_build

windows-nightly:
triggers:
Expand Down Expand Up @@ -1580,8 +1640,15 @@ workflows:
requires:
- bit_tag
- harmony_deploy_approval_job
- docker_build:
<<: *master_only_filter
- symphony_docker_build:
requires:
- harmony_deploy_approval_job
- bit_tag
- docker_build:
requires:
- harmony_deploy_approval_job
- harmony_publish_to_gcloud
- server_docker_build:
requires:
- harmony_deploy_approval_job
- docker_build
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ The bootstrap process (in Harmony) in general is as follows:
2. Bit builds a graph of all core-aspects and aspects entered in the workspace.jsonc file.
3. Once the graph is ready, it loads them all (calls their provider), so then all aspects instances are ready in-memory.
4. An aspect can register to the CLI slot (`cli.register()`) and pass `Command` instances. (that's the main reason why all aspects must be loaded before anything else happen. Otherwise, commands won't be registered and the user will get an error about a non-exist command)
5. `commander` package is used for parsing the commands. All `Command` instances are registered by `Commander`. It finds the currently entered command and runs either `report()` to return a result to the CLI as plain text or `render()` to paint the output as a React component using `Ink`.
5. `yargs` package is used for parsing the commands. All `Command` instances are registered by `yargs`. It finds the currently entered command and runs either `report()` to return a result to the CLI as plain text or `render()` to paint the output as a React component using `Ink`.

### Workspace

Expand Down
114 changes: 85 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,116 @@
# Bit
<p align="center">
<img src="https://storage.googleapis.com/static.bit.dev/harmony-docs/readme-logo%20(2).png"/>
</p>

Bit is a tool for composing modern applications of independent components.  
<p align="center">
<a href="https://harmony-docs.bit.dev/">Documentation</a> |
<a href="https://bit.dev/">Platform</a> |
<a href="https://www.youtube.com/channel/UCuNkM3qIO79Q3-VrkcDiXfw">Learn</a>
</p>

It extends the benefits of micro-services to everything you build, front and back. With Bit teams can autonomously develop, build, and release components, while continuously collaborating and integrating to compose larger applications together.  
<h3 align="center">
Build components first.
</h3>

Bit's extendible toolset (and visual development UI) creates a simple yet powerful experience for every developer, while larger teams can smoothly scale to build many developers and projects in the [component cloud](https://bit.dev/).

Modularity benefits almost every part of the development process, from [speeding up releases](https://www.youtube.com/watch?v=yDjTcBKXKDE) to making debugging or refactoring much simpler. You can start enjoying Bit through one of many popular [use-cases](https://blog.bitsrc.io/4-bit-use-cases-build-like-the-best-teams-1c36560c7c6e) such as **Micro Frontends**, **Design Systems**, **Development Speed**, and **Collaboration on components**.

[![Bit](https://storage.googleapis.com/static.bit.dev/harmony-docs/homepage-components-micro-frontends.png)](https://bit.dev/)
<p align="center">
Open infrastructure for component-driven applications to speed and scale development.
</p>

<p align="center">
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a>
<a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
<a href="https://circleci.com/gh/teambit/bit/tree/master"><img alt="Circle Status" src="https://circleci.com/gh/teambit/bit/tree/master.svg?style=shield&circle-token=d9fc5b19b90fb7e0655d941a5d7f21b61174c4e7">
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
<a href="https://github.com/prettier/prettier"><img alt ="Styled with Prettier" src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg">
<a href="https://join.slack.com/t/bit-dev-community/shared_invite/zt-o2tim18y-UzwOCFdTafmFKEqm2tXE4w" ><img alt="Join Slack" src="https://img.shields.io/badge/Slack-Join%20Bit%20Slack-blueviolet"/></a>
[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Share%20code%20components%20as%20a%20team%20@bitdev_&url=https://bit.dev&hashtags=opensource,javascript,programming,reactjs,webdev,vuejs,angularjs)

[Docs](https://harmony-docs.bit.dev/)[Bit Cloud](https://bit.dev/)[Slack](https://join.slack.com/t/bit-dev-community/shared_invite/zt-o2tim18y-UzwOCFdTafmFKEqm2tXE4w)[Twitter](https://twitter.com/bitdev_)[YouTube](https://www.youtube.com/channel/UCuNkM3qIO79Q3-VrkcDiXfw)[Blog](https://blog.bitsrc.io/tagged/bit)[Resources](https://harmony-docs.bit.dev/resources/conference-talks/)
## What is Bit?

## Install Bit
<p align="center">
<a href="https://harmony-docs.bit.dev/">
<img alt="Bit Workspace" src="https://storage.googleapis.com/static.bit.dev/harmony-docs/CleanShot%202021-05-28%20at%2021.01.49%402x.png" />
</a>
</p>
<p align="left">
Bit is an OSS Infrastructure for building and composing components. It is an extensible toolchain for component-driven applications / systems which are faster to develop, simpler to understand, test, and maintain, more resilient and performant, and easier to collaborate on.

Install Bit Version Manager:
Instead of building an application that has many components, Bit lets you develop components outside of any application and use them to compose many applications from the bottom up. An application is just a deployed composition of components. You can add and remove components from applications to extend or change their functionality. All components can be reused in many different applications.

```
npm i -g @teambit/bvm
</p>

# or
### Key Features

<p align="left">

- **Workspace** is the foundation of Bit. It is where you develop and compose components. It lets you build fully distributed projects with a simple monolithic-like dev experience. Open the workspace UI to visually develop and manage your components with ease.

- **Scope** is where you push, version, and organize your components. It’s a component store.

- **Remote Hosting**: Remote Scopes let you use components across projects. You can setup and host remote Scopes on any servers. [Bit.dev](https://bit.dev) is an optional enterprise-grade platform for hosting and connecting all scopes and components to give teams a streamlined cross-project collaboration experience. It is highly secure and trusted by Fortune-50 teams.</p>

### How to Start?

<p align="center">
<a href="https://www.youtube.com/watch?v=7afMBwj5fR4">
<img alt="Bit Workspace" src="https://storage.googleapis.com/static.bit.dev/harmony-docs/build%20with%20bit%20youtube.png" />
</a>
</p>

To get started follow the [quick-start guide](https://harmony-docs.bit.dev/getting-started/installing-bit) or try the official [Bit for React tutorial](https://harmony-docs.bit.dev/tutorials/react/create-and-consume-components).

Install [Bit Version Manager](https://harmony-docs.bit.dev/getting-started/installing-bit):

```bash
npm i -g @teambit/bvm
# or
yarn global add @teambit/bvm
```

Install Bit:

```
```bash
bvm install
```

Init a Bit Workspace:
Start a [Bit workspace](https://harmony-docs.bit.dev/getting-started/initializing-workspace):

```bash
bit new react-workspace <my-workspace-name>
```

Install dependencies:

```bash
cd <my-workspace-name>
bit install
```
bit init --harmony

Create a component:

```bash
bit create react-component ui/button # TypeScript
bit create react-component-js ui/button # JavaScript
```

Install dependencies for test files:

### Getting Started
```bash
bit install @testing-library/react
```

- [Getting started](https://harmony-docs.bit.dev/getting-started/installing-bit)
- [What is Bit?](https://harmony-docs.bit.dev/essentials/what-is-bit)
- [Thinking in Components](https://harmony-docs.bit.dev/component-architecture/thinking-in-components)
Start the dev server

```bash
bit start
```

Open-up your browser on localhost:3000, or any other available port, and display your workspace with your components.

### Popular Onboarding Use-Cases

- Micro Frontends
- Design Systems (Component Marketplace)
- Shared Logic and Backend Functionality
- Rapid Application Development

### Resources & Community

Expand All @@ -60,12 +122,6 @@ bit init --harmony
- [Articles](https://harmony-docs.bit.dev/resources/articles)
- [Community](https://harmony-docs.bit.dev/resources/community)

## Large scale example of building with Bit

Bit is 100% built with Bit! Every feature in Bit, from the [Bit Version Manager](https://bit.dev/teambit/bvm) to the workspace UI and even [supporting MDX](https://bit.dev/teambit/mdx), are just scopes of components developed with Bit.

Explore [dozens of OSS scopes and hundreds of OSS components](https://bit.dev/teambit) on Bit's cloud platform.

## Contributing 🎗️

Contributions are always welcome, no matter how large or small. Before contributing, please read the [code of conduct](CODE_OF_CONDUCT.md).
Expand Down
3 changes: 2 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = function (api) {
],
];
const plugins = [
'ramda',
[
'@babel/plugin-transform-modules-commonjs',
{
Expand All @@ -32,7 +33,7 @@ module.exports = function (api) {
return {
presets,
plugins,
only: ['**/*.ts', '**/*.tsx', 'src/extensions/flows/task/container-script.js'],
only: ['**/*.ts', '**/*.tsx'],
ignore: ['components/*'],
};
};
4 changes: 2 additions & 2 deletions e2e/commands/import2.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ console.log(barFoo.default());`;
const RelativeCompClass = IssuesClasses.relativeComponents;
expect(output).to.have.string('error: issues found with the following component dependencies');
expect(output).to.have.string(`${helper.scopes.remote}/utils/[email protected]`);
expect(output).to.have.string(new RelativeCompClass().description);
expect(output).to.have.string(new RelativeCompClass().descriptionWithSolution);
expect(output).to.have.string('is-string.js -> utils/is-type');
});
});
Expand Down Expand Up @@ -372,7 +372,7 @@ console.log(barFoo.default());`;
});
it('should not allow tagging the component', () => {
const RelativeCompClass = IssuesClasses.relativeComponents;
expect(output).to.have.string(new RelativeCompClass().description);
expect(output).to.have.string(new RelativeCompClass().descriptionWithSolution);
});
});

Expand Down
Loading

0 comments on commit 7e2dd15

Please sign in to comment.