2.0.5 • Published 5 months ago

@mccraveiro/standard-version-expo v2.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

What's inside?

Standard version is a tool to automate the versioning of your project using semver and conventional commits. This package includes some helpful bumpers to update the Expo manifest automatically. With these bumpers you can automate updating the version, Android versionCode, and/or iOS buildNumber. You should be able to automate versioning of your app by using a single command, like:

$ npx standard-version --release-as minor

If you receive an error like Invalid Version: undefined, make sure your package.json has a starting version.

Getting started

It's recommended to install both Standard Version and this package as devDependency. You can do this with the npm command listed at the top of this read me. After you installed the packages, we need to configure Standard Version using any of the configuration methods listed here. Here is an example configuration that updates the version, Android versionCode, and iOS buildNumber using the recommended approaches.

// .versionrc.js
module.exports = {
  bumpFiles: [
    {
      filename: 'package.json',
    },
    {
      filename: 'app.json',
      updater: require.resolve('@mccraveiro/standard-version-expo'),
    },
    {
      filename: 'app.json',
      updater: require.resolve('@mccraveiro/standard-version-expo/android'),
    },
    {
      filename: 'app.json',
      updater: require.resolve('@mccraveiro/standard-version-expo/ios'),
    },
  ],
};

To test if your configuration works as expected, you can run standard version in dry mode. This shows you what will happen, without actually applying the versions and tags.

$ npx standard-version --dry-run

Usage

Standard Version's version bumpers are pretty simple; each bump only updates a single file using a single updater. This package exposes multiple kinds of updaters, for different areas of the manifest. You can "compose" your own set of bumpFiles entries to suit your needs.

updaterexampledescription
<root>3.2.1alias of manifest/version
manifest3.2.1alias of manifest/version
manifest/version3.2.1Replace expo.version with the exact calculated semver. (recommended)
android360030201alias of android/code
android/code350010000Replace expo.android.versionCode with the method described by Maxi Rosson. (recommended)
android/increment8Replace expo.android.versionCode with an incremental version.
ios3.2.1alias of ios/version
ios/code360030201Replace expo.ios.buildNumber with the method described by Maxi Rosson.
ios/increment9Replace expo.ios.buildNumber with an incremental version.
ios/version3.2.1Replace expo.ios.buildNumber with the exact calculated semver. (recommended)

Version code

Semver is one of the most popular versioning methods; it generates a string with a syntax that even humans can read. Unfortunately, in Android, we are limited to use a numeric versionCode as version. The version code uses an approach from Maxi Rosson to calculate a numeric value from semver. It's a deterministic solution that removes some of the ambiguity of incremental build numbers, like security-patching old versions.

The method initially uses the Android minimum API level. For Expo, we replaced this with the major Expo SDK version.

2.0.5

5 months ago

2.0.4

5 months ago

2.0.3

11 months ago

2.0.2

11 months ago

2.0.1

11 months ago

2.0.0

11 months ago