expo-community / standard-version-expo Goto Github PK
View Code? Open in Web Editor NEWAutomatic Expo versioning with Standard Version
License: MIT License
Automatic Expo versioning with Standard Version
License: MIT License
See #10
npx standard-version --release-as prerelease
Android increments to be +1
Something like 1.1.0-0
.
It's probably related to the semver parsing, but I'll have to investigate.
How would you summarise and scope the issue?
I've upgraded to Expo SDK 44 and have converted all of my changes inside the /ios
and /android
folders of my Expo Bare project over to using config plugins. I do commit my /ios
and /android
folders to source, but I only make changes to them using the new expo prebuild
command.
My release workflow is:
// Increment a patch version
% npx standard-version
// Undo standard version's commit and delete the GIT tag
% git reset --soft HEAD^
% git tag -d $TAG
// Re-run rebuild, carrying the versions in app.json into native code
% expo prebuild
// Re-stage latest GIT changes
% git add ...
% git commit
% git tag $TAG
% git push --follow-tags origin master
Why should we have this discussion?
standard-version
that skips the commit step, so I don't have to undo it?expo prebuild
into account? Should I use native bumpers, or continue using prebuild?Can you further explain the purpose of this discussion? E.g., screenshots or real-world examples.
See release workflow example above
Add version bumpers for bare projects to update e.g. versionCode
in Gradle.
It would be awesome if bare users can use this tool too!
The package depends on"@expo/config": ^3.1.2
which leads to the follow warning when running expo doctor
(on a Expo 45 project).
Expected package @expo/config-plugins@^4.1.0
Found invalid:
@expo/[email protected]
No error when running expo doctor
.
Next to app.json
and app.config.json
, this library should support having a dynamic config.
It's new and paves the path to a new set of tools to use for managing expo manifests.
An example could be something like:
import * as versions from 'standard-version-expo';
import pkg from './package.json';
export default {
name: 'awesomeapp',
version: pkg.version,
ios: {
bundleIdentifier: 'com.acme.awesomeapp',
buildNumber: versions.ios(pkg.version),
},
android: {
package: 'com.acme.awesomeapp',
versionCode: versions.android(pkg.version),
}
}
This only works with deterministic methods, for incremental updates this would not work (which is kind of the reason why increments are not that great ๐ )
After upgrading to Expo 38.0.8, errors where thrown when leveling up.
The errors mention not being able to find getenv
module.
Installing that module fixes the issue, but I thought I'd let you know in case you needed/wanted to update this package.
Android version is bumped to semver instead of default android method.
iOS version does not respect leading zeros.
installed and configured per documentation using 1.0.3
configure
// .versionrc.js
module.exports = {
bumpFiles: [
{
filename: 'package.json',
},
{
filename: 'app.json',
updater: require.resolve('standard-version-expo'),
},
{
filename: 'app.json',
updater: require.resolve('standard-version-expo/android'),
},
{
filename: 'app.json',
updater: require.resolve('standard-version-expo/ios'),
}
]
};
run
% npx standard-version --dry-run
โ bumping version in package.json from 2.2.4 to 2.2.5
โ bumping version in app.json from 2.2.4 to 2.2.5
โ bumping version in app.json from 380020204 to 2.2.5
โ bumping version in app.json from 2.2.04 to 2.2.5
โ outputting changes to CHANGELOG.md
---
### 2.2.5 (2020-09-21)
---
โ committing app.json and package.json and CHANGELOG.md
โ tagging release v2.2.5
โน Run `git push --follow-tags origin CU-buh9bc-trunk-based-ci-cd` to publish
android would bump to 380020204
iOS would bump to 2.2.05
android bumpe to 2.2.5
iOS bumped to 2.2.5
There are a couple of issues regarding prereleases (like #11) and I think it would be great to discuss how handle prerelease
or versions that will get to TestFlight but NO to published to the store.
I would love to create a PR, I just want to be sure what would be the standard.
Example:
expo build:ios --release-channel stage
expo build:ios --release-channel prod
So we try to use standard-version-expo
.
standard-version
to increment the build number of both platforms and the versions (We can't use pre-releases because of #11 and is not working for iOS either)expo build:ios --release-channel prod
standard-version
as a patch? Change only the builds manually? What is the best option here?versionCode
(android) and versionBuild
(iOS) NOT the version on app.json and package.json (Since package.json.version is the source of truth, this can be a problem)A solution that I found online was create a second app with a second bundle id (have an app that would never get to the stores) but I think this is a overkill.
What approach to you use? I would love to hear what can be improved or what is the flow the you use!
Thanks!
PD: standard-version-expo/ios/code
is not possible to use because is not allowed by AppStore.
@byCedric would you be able to merge some or all of the dependabot PRs? There are a lot of critical security bugs that would be fixed by accepting these updates. Then release a new version.
It would be a huge help to everyone that is using this module
Expo has deprecated putting sdkVersion in app.json
in favor of using the version defined by node_modules/expo/package.json
's version
field. Would be great if this plugin started using that as the source as well.
expo upgrade
)properly detects sdkVersion
doesnt bump android version because of missing sdkVersion in app.json
When dry running standard-version for native application, it tries to bump app.json version, android and ios version to the version in package.json
What steps did you perform which led to this issue?
npm i -D standard-version@next standard-version-expo
.versionrc.js
module.exports = { bumpFiles: [ { filename: 'package.json', }, { filename: 'app.json', updater: require.resolve('standard-version-expo'), }, { filename: 'app.json', updater: require.resolve('standard-version-expo/android'), }, { filename: 'app.json', updater: require.resolve('standard-version-expo/ios'), } ], releaseCommitMessageFormat: "chore(release): Release {{currentTag}}\n\n[ci skip]" };
I also tried
... updater: require.resolve('standard-version-expo/android/increment'), ... updater: require.resolve('standard-version-expo/ios/ios-increment'), ...
Documentation was wrong for ios resolver. Is /increment, but should be /ios-increment for v1.0.0
app.json
{ ... "version": "2.2.1", ... "ios": { ... "buildNumber": "1", ... }, ... "android": { ... "versionCode": 20033, ... }, ... }
Output of npx standard-version --dry-run
โ bumping version in package.json from 1.24.0 to 1.25.0
โ bumping version in app.json from 2.2.1 to 1.25.0
โ bumping version in app.json from 20033 to 1.25.0
โ bumping version in app.json from 1 to 1.25.0
โ outputting changes to CHANGELOG.md
Unable to get version bumping for app.config.js
files - getting the subject's message to the console.
To understand if a flexible, dynamic configuration is currently possible.
In my .versionrc.js
I have the following:
/*
* From https://gist.github.com/gregfenton/b81ec014e8488dc5576f8444cbf7bcd4
*/
let fs = require('fs');
let bumps = [
{filename: 'package.json'},
];
let CONFIGS_DIR = './customer-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}/${entry.name}/app.config.js`;
if (entry?.isDirectory()) {ame:
if (fs.existsSync(confFile)) {
// updates `expo.version`
bumps.push({
filename: confFile,
updater: require.resolve('standard-version-expo'),
});
// updates `expo.android.versionCode`
bumps.push({
filename: confFile,
updater: require.resolve('standard-version-expo/android'),
});
// updates `expo.ios.buildNumber`
bumps.push({
filename: confFile,
updater: require.resolve('standard-version-expo/ios'),
});
}
}
}
} catch (ex) {
console.log(`EXCEPTION with readdir: ${ex.message}`);
throw ex;
}
module.exports = {
bumpFiles: [...bumps],
};
When I run npx standard-version --dry-run
I get the following output:
$ npx standard-version --dry-run
โ bumping version in package.json from 0.2.17 to 0.2.18
Manifest must include a JSON object.
Manifest must include a JSON object.
Manifest must include a JSON object.
Manifest must include a JSON object.
Manifest must include a JSON object.
Manifest must include a JSON object.
โ outputting changes to CHANGELOG.md
---
### [0.2.18](https://github.com/gregfenton/rn_tick8s/compare/v0.2.17...v0.2.18) (2020-10-17)
---
โ committing package.json and CHANGELOG.md
โ tagging release v0.2.18
โน Run `git push --follow-tags origin main` to publish
and my app.config.js
files do not update. I have 2 app.config.js files (I have 2 customer-configs), and I'm quite certain that the 6 instances of "Manifest must include a JSON object." are coming from (2 customer-configs * 3 updaters).
Looking at the code in standard-version-expo/build/expo.js
, it seems that the code to parseJsonString()
is failing with the exception message ending with:
โโ Cause: SyntaxError: JSON5: invalid character 'i' at 1:1
> 1 | import fs from 'fs';
| ^
2 |
3 | const APP_NAME = 'tick8s';
4 | const FB_PROJECT_NAME = 't8s-CUSTOMER-DETAILS-HERE';
So it is blowing up simply trying to read in the app.config.js.
Any thoughts on what I could try next? It clearly finds the config files, but fails to parse them
standard-version --dry-run
โ bumping version in package.json from 1.0.0 to 1.1.0
โ bumping version in app.json from 1.0.0 to 1.1.0
โ bumping version in app.json from 1.0.2 to 1.1.0
โ bumping version in app.json from 3 to 1.1.0
โ created CHANGELOG.md
โ outputting changes to CHANGELOG.md
Shouldn't this go from 3 to 4?
https://dev.to/bycedric/simplify-expo-releases-with-standard-version-2f4o
For it to go from 3 to 4
It went from 3 to 1.1.0
I know issue is quite empty but... I tried ๐
Firstly, just want to say love the package! Really pleased to get it in my Expo workflow :)
Would like to be able to tag beta versions in expo. Currently you can run standard-version -p beta -n
to tag a release a beta, and you'll get this output:
โ bumping version in package.json from 0.8.6 to 0.8.6-beta.0
โ bumping version in app.json from 0.8.6 to 0.8.6-beta.0
โ bumping version in app.json from 370000806 to 0.8.6-beta.0
โ bumping version in app.json from 0.8.6 to 0.8.6-beta.0
However inside app.json
, the android version code does not updated, and the ios build number gets updated to "0.8.7-beta.0" which is an invalid build code for ios:
โข Field: ios.buildNumber - 'ios.buildNumber' should match pattern "^[A-Za-z0-9.]+$".
Would be helpful to release beta versions of my app onto internal release tracks in the play store.
Also happy to revisit my workflow. This is my first RN app so maybe there is a better way to release betas?
Not matched value between console and execute result.
What steps did you perform which led to this issue?
standard-version
โ bumping version in package.json from 0.0.0 to 0.0.1
โ bumping version in app.json from 1 to 0.0.1
โ bumping version in app.json from 1.0.0 to 0.0.1
buildNumber
in app.json
is incremented like below.Before
{
~~~~~~
"ios": {
"supportsTablet": true,
"buildNumber": "1"
},
~~~~~~
}
After
{
~~~~~~
"ios": {
"supportsTablet": true,
"buildNumber": "2"
},
~~~~~~
}
โ bumping version in package.json from 0.0.0 to 0.0.1
โ bumping version in app.json from 1 to 2
โ bumping version in app.json from 1.0.0 to 1.0.1
โ bumping version in package.json from 0.0.0 to 0.0.1
โ bumping version in app.json from 1 to 0.0.1
โ bumping version in app.json from 1.0.0 to 1.0.1
.versionrc.js
module.exports = {
bumpFiles: [
{
filename: 'package.json',
},
{
filename: 'app.json',
updater: require.resolve('standard-version-expo/ios/increment'),
},
{
filename: 'app.json',
updater: require.resolve('standard-version-expo'),
}
]
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.