Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

zibs
Copy link

@zibs zibs commented Nov 12, 2020

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 added 9 commits October 28, 2020 16:09
This lib thinks we're an "expo" app just because we have the package + an app.json, which is outdated now.

This let's us write the app.json, android, and iOS all together.

It also will update the versions of our postExport hooks, if they exist.
1. --is-bare-expo-workflow
Bare workflow expo apps want to update *everything*. This will update the app.json values and the /android and the /ios values.

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 sourcemaps in a postExport hook, where it's essential to keep the release/dist versions align 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.
@zibs
Copy link
Author

zibs commented Dec 14, 2020

Thoughts :) ?

@stovmascript
Copy link
Owner

@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.

@summerkiflain
Copy link

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

@kledk
Copy link

kledk commented Jun 14, 2021

Any updates on this?

@agape-apps
Copy link

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.

@liemdo
Copy link

liemdo commented Aug 6, 2021

This looks great. Can we have it merged?

@agape-apps
Copy link

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.

@robsonbbs
Copy link

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.

@ruslan-hontar
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants