frontend-cookie-cutter
scaffolding for new frontend components
Features
- Automatic ES6 transpilation via Babel
- Automatic linting via eslint with Airbnb style guide
- Automatic testing via Jest
- Pre-commit hooks for testing, security checks, and outdated components
Conventions
Start
- Clone this repo
- Edit package.json to match your new component.
- Edit src/component.js to create your new compoent.
- Edit src/component.test.js to match your new component.
Developing
-
yarn dev
ornpm run dev
- Go to
http://localhost:9000/
to view your component. - Edit
example/index.jsx
if you need to alter the entry point in some way during development. - Edit
config/webpack.config.dev.js
to change the webpack dev config.
Testing
-
yarn test
ornpm test
- View the Jest output.
Building
-
yarn build_production
ornpm run build_production
to build the production artifacts. - Output is in
dist/
. - Edit
config/webpack.config.prod.js
to change the webpack prod config.
Publishing
- Make sure your code passes all tests and pre-commit hooks.
- run
npm version (patch|minor|major)
depending on the type of change. - Push your changes to
origin/master
via a Pull Request - When your change has been merged to master, run
npm publish
.