react-native-version icon indicating copy to clipboard operation
react-native-version copied to clipboard

Adds two CLI options: --is-bare-expo-workflow and --is-self-hosting-bundles

Open zibs opened this issue 5 years ago • 9 comments

I've got a semi-specific use case for a Bare Workflow Expo app, and thought I'd try to upstream these changes in to see if others may also find it useful.

This adds two new CLI options:

  1. --is-bare-expo-workflow Bare workflow expo apps potentially want to update everything. This includes the app.json, the ios stuff and the android stuff. Currently, this library only supports updating the app.json vs. native code depending on it's awkward definition of an "expo" app. Some of the pathways in the library don't allow both, where this argument will go out of it's way to update both.

  2. --is-self-hosting-bundles This one is a bit more esoteric, but it's meant for bare workflow apps using sentry-expo to upload their source-maps in a postExport hook, where it's essential to keep the release/dist versions aligned with the build/release versions. If it's passed in, it will look in the hooks inside the app.json file to update these values as needed to their newly bumped versions.

Combined, these two flags allow us to have a workflow where we can run npm version patch, which then updates the package.json, the app.json, the /android values, the /ios values, as well as updates our postExport hook in the app.json.

Thanks for the library! Hope you'll consider these changes. All tests still pass.

zibs avatar Nov 12 '20 04:11 zibs

Thoughts :) ?

zibs avatar Dec 14 '20 17:12 zibs

@zibs Sorry for the late reply. This looks pretty great. Gonna have to catch up on these issues and align at least with #150 and #105. I'll try to get to it by Friday.

stovmascript avatar Jan 06 '21 09:01 stovmascript

@stovmascript can we get this merged, urgently need this for my bare flow react-native project.

summerkiflain avatar Mar 10 '21 07:03 summerkiflain

Any updates on this?

kledk avatar Jun 14 '21 11:06 kledk

Is there any progress on this feature?

I had to patch it locally as otherwise react-native-version does not work with Expo Bare Workflow.

agape-apps avatar Jul 16 '21 20:07 agape-apps

This looks great. Can we have it merged?

liemdo avatar Aug 06 '21 18:08 liemdo

I am currently using the other PR (--ignore-expo cli option by killerchip · Pull Request #150) via patch-package, while the maintainers take time to decide if the other PR or this PR has the superior logic.

The current Expo bare-workflow bug needs a "logic fix" and it has been more than a year without such a fix. Either of these two solutions seem to do the job.

patch-package lets app authors instantly make and keep fixes to npm dependencies. It's a vital band-aid for those of us living on the bleeding edge.

# fix a bug in one of your dependencies vim node_modules/some-package/brokenFile.js # run patch-package to create a .patch file npx patch-package some-package # commit the patch file to share the fix with your team git add patches/some-package+3.14.15.patch git commit -m "fix brokenFile.js in some-package"

Patches created by patch-package are automatically and gracefully applied when you use npm(>=5) or yarn. No more waiting around for pull requests to be merged and published. No more forking repos just to fix that one tiny thing preventing your app from working.

agape-apps avatar Aug 07 '21 10:08 agape-apps

There is anyone maintaining this repo? @stovmascript could you merge it? I am currently using this from a forked branch and is working pretty well.

robsonbbs avatar Aug 15 '22 14:08 robsonbbs

@stovmascript do you have any blockers with merging this pr? if so, I think, a lot of us can help you with solving problems

ruslan-hontar avatar Sep 20 '22 16:09 ruslan-hontar