Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
standard-version-expo-2
Advanced tools
Automatic Expo versioning with Standard Version
npm i -D standard-version@next standard-version-expo-2
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 yourpackage.json
has a startingversion
.
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('standard-version-expo-2'),
},
{
filename: 'app.json',
updater: require.resolve('standard-version-expo-2/android'),
},
{
filename: 'app.json',
updater: require.resolve('standard-version-expo-2/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
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.
updater | example | description |
---|---|---|
<root> | 3.2.1 | alias of manifest/version |
manifest | 3.2.1 | alias of manifest/version |
manifest/version | 3.2.1 | Replace expo.version with the exact calculated semver. (recommended) |
android | 360030201 | alias of android/code |
android/code | 350010000 | Replace expo.android.versionCode with the method described by Maxi Rosson. |
android/code-with-prerelease | 30201000 | Replace expo.android.versionCode with the method described by Maxi Rosson. (recommended) |
android/timestamp | 1642622748128 | Replace expo.android.versionCode with the result of Date.now() . |
android/increment | 8 | Replace expo.android.versionCode with an incremental version. |
ios | 3.2.1 | alias of ios/version |
ios/code | 360030201 | Replace expo.ios.buildNumber with the method described by Maxi Rosson. |
ios/code-with-prerelease | 30201000 | Replace expo.ios.buildNumber with the method described by Maxi Rosson. |
ios/timestamp | 1642622748128 | Replace expo.ios.buildNumber with the result of Date.now() . |
ios/increment | 9 | Replace expo.ios.buildNumber with an incremental version. |
ios/version | 3.2.1 | Replace expo.ios.buildNumber with the exact calculated semver. (recommended) |
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.
Allows to obtain the version code of a target version taking into account the pre-release.
It is designed for Android inspired by Maxi Rosson's approach and to solve this problem
This method takes into account pre-release tags and defines an equivalence in integer value. (alpha:1; beta:2; rc:3)
FAQs
Automatic Expo versioning with Standard Version
The npm package standard-version-expo-2 receives a total of 1 weekly downloads. As such, standard-version-expo-2 popularity was classified as not popular.
We found that standard-version-expo-2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.