GlueStick is an open source project sponsored by TrueCar that uses it to speed up the development process internally in truecar.com and also help a larger audience reduce the time needed to build apps. It allows the developer to create and deploy enterprise-grade React and Redux application right from your command line.
In order to contribute, you need to setup the monorepo locally.
To minimize problems with symlinks, please use Yarn.
git clone https://github.com/TrueCar/gluestick.git
cd gluestick
yarn run install:yarn
yarn global add file:$PWD/packages/gluestick-cli
(If you haven't done it already)
Now, you're ready to go.
If your contribution requires a GlueStick project to test it, run:
gluestick new <AppName> --dev <path/to/gluestick/monorepo>
For example, if you want to create a project named TestApp
next to gluestick
monorepo the command should look:
gluestick new TestApp --dev ./gluestick
If you would like to use a local copy of GlueStick with an existing project:
- Update your project's package.json file to point to your local copy of GlueStick. This should point to the "gluestick" subpackage within the GlueStick repo, not the
"gluestick": "file:../path/to/gluestick/packages/gluestick"
. - Remove the node_modules folder with
rm -rf node_modules
. - Run
yarn
. Note that yarn is required, as npm's symlinks cause a variety of errors. If you see the error, "It looks like you've installed thegluestick
package globally", you will need to repeat these instructions and useyarn
.
Now, from within the project you can run gluestick watch
to automatically watch for changes in gluestick
monorepo and apply them to the project.
Tip: If you reinstalled node_modules
, but doesn't see your changes in gluestick
reflected, it is likely that the old gluestick
package is cached.
In this case run the following commands:
yarn cache clean gluestick
rm -rf node_modules
yarn install
GlueStick consist of multiple separate packages inside single monorepo, which is handled by Lerna.
Here's the outline of the most important packages:
./packages/gluestick/
- Main gluestick package, which is installed locally as a project dependency../packages/gluestick-cli/
- Global CLI wrapper overgluestick
, used to create a new project and spawn internal commands fromgluestick
.
All of the source code lives under src/
directory of each package, which later is transpiled to build/
folder.
You can trigger the build by running yarn run build
in monorepo directory.
Before making a PR, run the following commands to ensure that there are not lint/flow errors and the tests are passing:
yarn run lint
yarn run flow
yarn run test
All of the documentation lives inside docs/
directory, which later is processed by GitBook.
You can run development GitBook server by running yarn run docs:watch
, then open http://localhost:4000
.
You can submit your pull request to the develop
branch.
Before submitting a pull request, please make sure the following is done…
- Fork the repo and create your branch from
develop
. - Describe your test plan in your commit. If you've added code that should be tested, add tests!
- If you've changed APIs, update the documentation (
docs
folder). - Ensure tests, lints and flow-check pass on Circle CI.
- Squash your commits (
git rebase -i
). One intent along with one commit makes it clearer for people to review and easier to understand your intention.
In your fist PR you will be asked to sing our CLA.
- Most important: Look around. Match the style you see used in the rest of the project. For the formatting we use Prettier integrated into ESLint.
- We are using extended
eslint-config-airbnb
- make sure your code doesn't result in any lint errors. - We are also using FlowType for static type checking - make sure your code doesn't produce any flow errors.
- No
Object
,Function
andany | *
types are allowed (except for edge cases) - make sure all types have detailed description. - When writing CLI we use
CommonJS
to handle import/export - please do not mix them with ES6 imports. The only exception are Flow types where we use ES6 imports.
- Do not wrap lines at 80 characters - configure your editor to soft-wrap when editing documentation.
We are using GitHub Issues for our public bugs. We keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new task, try to make sure your problem doesn't already exist.
develop
-> staging
- All new features, enhancements and contributions go to
develop
- We cut release candidates using git tags from
staging
- QA and testing are done on
staging
- High priority bugs are worked on
staging
. Once the PR is reviewed and merged, then we open another PR thatcherry-pick
those changes intodevelop
- QA and testing are done on