README
GrowFlow Javascript Style Guide
Shareable configuration to apply consistent syntax and styling rules across GrowFlow JavaScript/TypeScript projects.
Usage
Checkout the instructions for each individual package:
Protip: to bootstrap a new project with all of this already configured, make use of GrowFlow's CRA Template.
Developing
Clone this repo and run yarn
from the repository's root to install dependencies.
Creating a new package
- First create a new folder within the
packages
directory. - Copy one of the existing package's
package.json
to your new folder and tweak the values.
Develop locally against an external app
In order for a local copy of an external frontend to use a local copy of one of these packages (e.g. @growflow/eslint-config), we have to "link" them locally.
Normally we would use yarn link
to achieve this, but there are known issues that cause errors with React.
The best alternative solution is to use the utility yalc.
The below examples use @growflow/eslint-config
and wholesale-frontend
as an example.
First, make sure to install yalc
globally on your machine:
yarn global add yalc
or
npm i yalc -g
Then,
- Inside the
eslint
folder, runyalc publish
. - Inside
wholesale-frontend
, inside the rootpackage.json
file, under theworkspaces
property, add a new entry.yalc/@*/*
(this only needs to be done one time) - Inside
wholesale-frontend
, runyalc link "@growflow/eslint-config"
andyarn install
- That should be it. If something isn't right, run
yarn clean
and re-runyarn install
- When you are done developing, and before you push any changes, make sure you run
yalc remove --all
. This preventsyarn.lock
from incorrectly thinking there is a local copy of@growflow/eslint-config
instead of pulling from npm.
Publishing
This repository uses lerna to manage its packages.
Don't manage version numbers within package.json
by hand. Instead, after you have made and pushed your changes, run:
yarn release
which will guide you in bumping the version and confirm what packages are about to be published. It will also auto-create tags. You can then create a release in GitHub on the generated tag to create a changelog.