Install tools necessary
Install Dependencies
yarn
For simple UI component development, you can use the Storybook app in the root directory by typing:
yarn storybook
This will boot generate stories from the different packages and surface them in a React Native app on an iPhone Simulator
For simple API deployment, you can use a copy of our api template repo. Start by running
yarn api
You'll need to have the secret key for the .env file handy. You can pull down specific branches by running yarn api branch-name
. Be careful not to make any changes in the ApollosApi
folder, since that folder is wiped out on every run to yarn api
.
For more advanced development, you will need to use our templates repo. This will allow you to spin a local version of the API and app.
Get Postgres running locally
brew install postgresql
Register the packages with linkemon
yarn link-packages
yarn start
Clone down the templates repo and run through the quickstart to add all necessary environment variables.
Add reference in the app .env
file. This step is necessary for wml
to locate packages.
APOLLOS_APPS_LOCATION=../../apollos-apps
Link packages with linkemon
yarn link-packages
Run simply run yarn start
to start up the server and app. If you need to unlink the local packages in the templates repo to test that NPM dependencies are working properly, run yarn unlink-packages
from both the apps
and templates
repos.
We use the Angular Conventional Commits preset for pull requests and commits. Squash merges should be in this form:
fix|feat|perf|chore: lower case title
BREAKING CHANGE: line describing any breaking changes
We publish to both the standard NPM registry and Github Packages. Follow these steps.
Push a preliminary package version to Github for aesthetic purposes. We won't tag or push the actual code yet. First add an .npmrc file to the root of this directory that looks like this:
//npm.pkg.github.com/:_authToken=TOKEN
Get the TOKEN
from creating a Personal Access Token in your Github settings and give it read/write access to packages.
Now run the same yarn release:<XXX>
command you will run for NPM (from below) but add --registry "https://npm.pkg.github.com" --no-git-tag-version"
Change your .npmrc file to this:
//registry.npmjs.org/:_authToken=TOKEN
Replace TOKEN
with an access token with publish rights from your NPM settings.
You can do a release three different ways:
yarn release:canary
Will publish a patch prerelease version without committing. Can be installed via:
yarn add @apollosproject/package@canary
yarn release:next
Will publish a major prerelease version without committing. Can be installed via:
yarn add @apollosproject/package@next
GH_TOKEN=<personal github token> yarn release
Will publish a version based on the commits according to conventional commits standards. Will automatically create a Github release and push commit and tags. Can be installed via:
yarn add @apollosproject/package