Skip to content

Latest commit

 

History

History
56 lines (43 loc) · 2.42 KB

README.md

File metadata and controls

56 lines (43 loc) · 2.42 KB

apache prs Circle Status

Example Templates

This repository contains the boilerplates used by bit.dev's playground for creating new examples.

screenshot

Templates

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:

Template APIs

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();
`)

Contributing

Contributions are welcome on this repository, and will be published to the collection and to bit.dev.

  1. Clone the repository
  2. Install bit
  3. Run bit import to sync components.
  4. Update code in a new branch.
  5. Run bit build (or yarn build)
  6. Test the components: bit test (or yarn test)
  7. 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.