ChangelogGetting StartedReadme🚀 Getting started✨ Developer experience💅 Style management
Components
Icons
Styling
Wrappers
⚛️ Mattress Firm Component Library ⚛️
🚀 Getting started
- Install NodeJS. Use a node version manager such as nvm. Currently this repo targets Node 18.15.0
- Install yarn.
- Run
yarn
to install dependencies - Run
yarn dev
to start development mode
Documentation
Checkout the component library in action!
Installation
- Follow the steps in the wiki to learn how to setup and install this package
- If you've already setup your machine to install this package, then run
yarn add @mfrm/mfcl
in your terminal
👾 Usage
import React, { Component } from 'react'import MyComponent from '@mfrm/mfcl/MyComponent'...<MyComponent prop="yes please" />
- Note - webpack should automatically treeshake the components not used.
✨ Developer experience
yarn start
oryarn dev
- Starts the documentation at http://localhost:4000/yarn watch
- rollup watches any changes (not really needed)yarn package
- builds the component libraryyarn build:docz
- builds the docsyarn test
- runs any testsyarn plop
- see below
💅 Style management
CSS Modules
Docz
The docs are built with ❤️ from docz
Create a new component with Plop Component Generator
yarn plop
and follow the prompt oryarn plop MyComponent
will generateMyComponent.jsx
,myComponent.module.scss
,MyComponent.test.js
, andMyComponent.mdx
- Update
package.json
according to semver. - Give a description of what changed in
CHANGELOG.mdx
followed by who made the changes. - Profit 💰
Automatic code formatting
prettier is an opinionated code formatter aiming to provide codebase consistency when multiple developers work on the same project. The main reason behind adopting Prettier is to stop all the on-going debates over coding styles.
Linting
Linters are tools that analyze source code to flag programming errors, bugs, stylistic errors, and suspicious constructs.
- JavaScript is linted by ESLint, enforcing the Airbnb JavaScript Style Guide through an overridable set of rules provided by eslint-config-airbnb-base.
- Styles are linted by stylelint, adhering to the rules specified in stylelint-config-recommended.