-
Notifications
You must be signed in to change notification settings - Fork 52
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
Use symbol link for example #232
Comments
Thanks @sunnylqm for both the suggestion and the information. I will likely need some time to investigate. |
I tried this in my work area, seems to work if I would add the following entry to the end of the watchFolders: ['.', '../'] (Maybe I should |
I just published |
by the following shell command: yarn add link:../ as suggested in #232 by @sunnylqm Previous 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. Omit postinstall scripts entry in example package.json unless the deprecated --example-file-linkage option is used. Overwrite the example metro.config.js with quick workaround for an issue with symlinked modules, unless the deprecated --example-file-linkage option is used. *tested* with React Native 0.60 (known issue with React Native 0.61 & 0.62 at this point) update the following test cases to use 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>
by the following shell command: yarn add link:../ as suggested in #232 by @sunnylqm 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>
Adding The following resolver: {
extraNodeModules: new Proxy(
{},
{ get: (_, name) => path.resolve('.', 'node_modules', name) }
)
} I think @johnryan deserves credit for the pointers to both workarounds in facebook/metro#1 (comment). I am working on a new PR with this functionality, which should be ready within the next couple of days or so. |
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>
With I ended up using |
as suggested by this comment: brodycj/create-react-native-module#232 (comment)
* resolve absolute paths in example metro watchFolders as suggested by this comment: brodycj/create-react-native-module#232 (comment) * update test snapshots
(update test snapshots) ref: - brodycj/react-native-module-init#66 - #232 (comment)
hey @brodybits I need to use it but my example app is not inside the folder of the library, mono-repo folder in my example app, I tried to link to my library but I got an error in my
I see in my
I got error
how I can fix it to work with my module with |
There is some workaround to let metro bundler support symbol link, so that we can
directly
modify the library code and test them in the example project .The text was updated successfully, but these errors were encountered: