Skip to content

Instantly share code, notes, and snippets.

Last active Nov 10, 2021
What would you like to do?
EXPO: configuration of standard-version-expo for a code base that has multiple configuration files
/* What?
* A configuration for standard-version-expo that updates multiple config files
* by dynamically identifying them from a sub-directory when you bump the
* version using the `standard-version` tool
* How?
* Modelled from the post by @bycedric:
* Follow the setup instructions listed at the URL above or at
* Why?
* My expo app code is being used to generate different flavours of the app per corporate client - which means, in fact,
* generating different apps per client. To keep all of our clients' apps current, we force all app configs to update
* at the same time.
* Each client has their own configuration stored in <PROJECT_ROOT>/app-configs/<CLIENT_NAME>/app.config.js
* So this code is run by `standard-version` and dynamically identifies all of the `app.config.js` in the `app-configs`
* subdirectory.
let fs = require('fs');
let bumps = [{ filename: 'package.json' }]; // update the global project
let CONFIGS_DIR = './app-configs';
try {
let entries = fs.readdirSync(CONFIGS_DIR, { withFileTypes: true });
for (let i = 0; i < entries.length; i++) {
let entry = entries[i];
let confFile = `${CONFIGS_DIR}/${}/app.json`;
if (entry?.isDirectory()) {
if (fs.existsSync(confFile)) {
// updates `expo.version`
filename: confFile,
updater: require.resolve('standard-version-expo'),
// updates ``
// see:
filename: confFile,
updater: require.resolve('standard-version-expo/android'),
// updates `expo.ios.buildNumber`
// see:
filename: confFile,
updater: require.resolve('standard-version-expo/ios'),
} catch (ex) {
console.log(`EXCEPTION with readdir: ${ex.message}`);
throw ex;
module.exports = {
bumpFiles: [...bumps],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment