equinor / mad-expo-core

MIT License
0 stars 0 forks source link

Note: We are slowly transitioning to the new monorepo

Please do not make any new changes to this repository unless it is critical.

mad-expo-core

Background

This package contains core functionality for development of Equinors Mobile Applications like authentication, feedback and typography. This package is used by our React Native Expo template.

Links

Availability

Currently you can only find this package on GitHub.

Prerequisites

To be able to use this package you need to have expo-cli installed. Follow the installation guide.

Installation

Add the main branch to your project

If using npm, run:

npm install git+https://github.com/equinor/mad-expo-core

If using yarn, run:

yarn add git+https://github.com/equinor/mad-expo-core

Add a specific version(branch, commit, release or tag) to your project

Replace {commithash-or-tag-or-branch} with a commit hash, tag or branch name. For npm, run:

npm install git+https://github.com/equinor/mad-expo-core#{commit-hash-or-tag-or-branch-name}

or if using yarn, run:

yarn add git+https://github.com/equinor/mad-expo-core#{commit-hash-or-tag-or-branch-name}

Development of this package

  1. Clone mad-expo-core into the same folder containing your React Native Expo project. We suggest using our React Native Expo template:
git clone https://github.com/equinor/mad-expo-core

The folder structure could look like this:

/Users/Adam/mad-expo-core
/Users/Adam/mad-react-native-expo-template
  1. To have a smooth developer experience we use yalc to link mad-expo-core to the project. To install yalc in your project follow the installation guide.
  2. Add the refresh-core-script to package.jsonin your React Native Expo project. Remember to replace the {projectName} with your project name:
{
  scripts: {
    'refresh-core': 'cd ../mad-expo-core && yalc publish && cd ../{projectName} && yalc add mad-expo-core && expo start',
  },
}
  1. Make changes to mad-expo-core. Make sure to update documentation too!
  2. If you added the refresh-core-script you can skip step 6 and 7. Run the following in your project to refresh mad-expo-core, for npm run:
npm run refresh-core

or if using yarn, run:

yarn run refresh-core
  1. If you didn't add the refresh-core-script you need to publish mad-expo-core to yalc. Run the following in mad-expo-core:
yalc publish
  1. You then need to add mad-expo-core to your project, run the following in your project folder:
yalc add mad-expo-core

After each change of mad-expo-core you either have to follow step 5 or 6 and 7 to be able to test while you develop this package.

Usage

import MadExpoCore from 'mad-expo-core';

// ...

const result = await MadExpoCore.multiply(3, 7);

Automatic generation of changelog

We use standard-version, a utility for versioning using semver and CHANGELOG generation powered by Conventional Commits.

Semantic Commit Messages

Copied from https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716 See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

feat: add hat wobble
^--^  ^------------^
|     |
|     +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.

More Examples:

References:

Release

We use standard-version to:

by running the following if you use npm:

npm run release

or if using yarn, run:

yarn run release

License

MIT