/cavendish-tests

Repository to push cavendish generated projects for testing purposes

Primary LanguageJavaScript

Sample-project

This is a React Native + Expo application, initially generated using Cavendish by Platanus.

Instalation and development

Assuming you've cloned the repo and that you have Node and Yarn, the first thing you need to install is the Expo CLI:

yarn global add expo-cli@4.12.x

Then install the project dependencies in your local machine:

yarn install

And you're ready to go! You can now run the project with yarn start and scan the QR shown in console with the Expo Go App. Remember that your phone and laptop have to be connected to the same wi-fi network in order for this to work!

Continuous Integration and deployment

The project has a setup to run tests and style guides in CircleCI. You can also run the test locally simulating the production environment using CircleCI's method.

The CI workflow also takes care of deploying and publishing your application to Expo. In order for this to work, you need to:

  1. Create a new account in Expo
  2. [Optional] Create an organization and add the owner key to the app.json file
  3. Create an access token
  4. Configure the token as a CircleCI environment variable

And you are done! Each time there is a commit in master, the pipeline will try to deploy the application.

If it succeeds, you will be able to scan and share the app QR code through https://expo.io/@organization-or-user-name/sample-project.

Style Guides

Style guides are enforced through a CircleCI job with reviewdog as a reporter, using per-project dependencies and style configurations.

Please note that this reviewdog implementation requires a GitHub user token to comment on pull requests. A token can be generated here, and it should have at least the repo option checked.

The included config.yml assumes your CircleCI organization has a context named org-global with the required token under the environment variable REVIEWDOG_GITHUB_API_TOKEN.

The project comes bundled with configuration files available in this repository. You can add or modify rules by editing the .eslintrc.json file.

You can (and should) use linter integrations for your text editor of choice, using the project's configuration.

Internal Dependencies

Tailwind RN

We use the TailwindCSS adaptation for React Native: tailwind-rn, in order to reduce the friction in mobile apps styling.

If you need to add custom styles, make sure you follow the instructions given in the package's README.

React Navigation

We use React Navigation@6.x to handle the shown screens and navigation interactions of the application.

Testing

We use Jest and Enzyme in order to test the components of this app.