generate example with symlink by default#309
Merged
brody2consult merged 5 commits intomasterfrom Apr 8, 2020
Merged
Conversation
5 tasks
Owner
Author
|
/merge master |
by the following shell command:
yarn add link:../
as suggested in #232 by @sunnylqm
fix and update the description of --generate-example option
previous example file linkage behavior (`yarn add file:../`)
may be enabled by using the new --example-file-linkage option
(`exampleFileLinkage: true` in the library API)
which is already deprecated at this point
omit postinstall scripts entry in example package.json unless
the deprecated --example-file-linkage option is used
(with minor console logging updates)
overwrite the example metro.config.js with quick workaround
for an issue with symlinked modules, unless
the deprecated --example-file-linkage option is used
(with thanks to @johnryan for the pointer)
*tested* with React Native 0.60
(known issue with React Native 0.61 & 0.62 at this point)
update the following test cases to test with the deprecated
`exampleFileLinkage: true` setting:
- json-eacces-error.test.js
- json-enoent-error.test.js
- recover-from-missing-package-scripts.test.js
- create-with-example-with-options.test.js
- create-with-example-with-options.test.js
Co-authored-by: Christopher J. Brody <chris.brody+brodybits@gmail.com>
Co-authored-by: Sunny Luo <sunnylqm@qq.com>
(postinstall workaround script) add the postinstall workaround script *only* if the deprecated --example-file-linkage option is enabled
and update the test snapshots
9e1b6e8 to
db24dea
Compare
Owner
Author
|
/merge brodybits-generate-example-with-symlink-by-default |
for an issue with symlinks encountered starting with metro@0.55 / React Native 0.61 (not needed for React Native 0.60 / metro@0.54) add and update descriptive comments in example metro.config.js *tested* generated example with: - native view on React Native 0.62 on Android & iOS - native module on React Native 0.62 on Android & iOS - native view on react-native-tvos@0.61 on Android, iOS, & tvOS - native module on react-native-tvos@0.61 on Android, iOS, & tvOS - native view on React Native 0.61 on Android & iOS - native module on React Native 0.61 on Android & iOS - native view on react-native-tvos@0.60.4-6 on Android, iOS, & tvOS - native module on react-native-tvos@0.60.4-6 on Android, iOS, & tvOS - native view on React Native 0.60 on Android & iOS - native module on React Native 0.60 on Android & iOS
7cad734 to
8fcda63
Compare
|
Hi @brodybits , I use option am I missing something? Please help, thank you |
|
After a morning deep dive into the problem, I ended up with a simple solution:
After this every changes from library with get effected into example project Sorry for commenting directly here |
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.
As suggested by @sunnylqm in #232 (resolves #232):
Uses the following command to link the example as the default behavior:
From #232: This symlink behavior should enable the user to "
directlymodify the library code and test [...] in the example project ".The previous file linkage behavior (
yarn add file:../) may be enabled by using the new, deprecated--example-file-linkageoption.No example postinstall workaround script will be added unless the deprecated
--example-file-linkageoption is used.Assuming the deprecated
--example-file-linkageoption is not used, this update will overwrite the examplemetro.config.jswith the following workaround config code, as needed for Metro to work with the symlink:This symlink behavior is more consistent with the new, interactive
brodybits/react-native-module-initCLI tool that I made around this one.Due credit belongs to the following:
Now tested generated example with: