This repository contains the boilerplates used by bit.dev's playground for creating new examples.
The templates are located under the components/template folder in thie repo, and also published as public Bit components here. Here is the list of existing templates:
A template component should export the following interface
(Currently components use different names for exports, but they will be unified in the future)
mainFile: string;
makeTemplate: ({ npmId: string }) => {
files: { [filepath: string]: string };
mainFile: string;
};
Example:
export const mainFile = "index.js";
export const makeTemplate = ({npmId}) => (`
import Component from ${npmId}
export default () => Component();
`)
Contributions are welcome on this repository, and will be published to the collection and to bit.dev.
- Clone the repository
- Install bit
- Run
bit import
to sync components. - Update code in a new branch.
- Run
bit build
(oryarn build
) - Test the components:
bit test
(oryarn test
) - Create a pull request with your changes
After approving the PR, changes will be exported to the collection, and deployed to bit.dev.
Note:
We are in a process of unifying all components to use the same tester.