🧱 @c2fo/components
C2FO's shared TypeScript and React component library based on Material-UI
👋 If you’re new to TypeScript and React, checkout this cheatsheet
Using
Install via npm
$ npm i @c2fo/components --save
Import in your react and typescript app
import React, { FC } from 'react'
import { Button } from '@c2fo/components'
interface TextButtonProps {
text: string;
}
export const TextButton: FC<TextButtonProps> = props => {
return <Button>{props.text}</Button>
}
Developing alongside your app
Alongside development is convenient, but requires you to edit dependencies in both @c2fo/components
and your app.
🧠 Remember you'll have to restore each project with the commands below to release or build your app remotely
Setup
$ npm un react react-dom --save-dev
$ npm link
$ cd ../my-app
$ npm un @c2fo/components --save
$ npm link @c2fo/components
Restore
$ npm unlink
$ npm i react react-dom --save-dev
$ cd ../my-app
$ npm unlink @c2fo/components
$ npm i @c2fo/components --save
Developing standalone
Start the storybook to develop components without your app
$ npm run storybook
IDE Setup
If you're developing in Visual Studio Code, copy the contents of .vscode/settings.suggested.json
to .vscode/settings.json
Releasing
Please see the documentation under the doc
folder.
Publishing
Publishing to npm happens automatically with Github Actions. See .github/workflows/publish.yml
Maintaining
🥾 This library was bootstrapped with TSDX
TODO: Document responsible teams/people and a process