feat(CLI): add output-metro-dir option to copy Metro output files#144
Merged
feat(CLI): add output-metro-dir option to copy Metro output files#144
Conversation
1eaf7b0 to
958eb4d
Compare
958eb4d to
ca43e77
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes: #71
Background
Tools like Sentry and Datadog use Debug IDs to match runtime errors back to source maps. In a Hermes setup, the Debug ID written into the JS bundle also needs to be inserted into the Hermes bytecode source map.
To do that, we need access to the Metro bundle and source map before Hermes compilation runs. The
npx code-pushCLI currently sends Metro output straight intohermesc, so there isn't a clean way to copy or post-process those pre-Hermes artifacts.Changes
Adds
--output-metro-dir <path>tobundleandreleasecommand.When this option is set, the CLI copies the Metro JS bundle and source map to the specified directory before Hermes compilation. It keeps the original bundle filename, including platform defaults and custom names.