bug: in a monorepo capacitor cannot find any plugins if installed in the root package.json
See original GitHub issueBug Report
It is currently not possible to use Capacitor in a monorepo properly without adding any plugin to each apps package.json. This is super inefficient and can lead to different versions between apps that share the same core (ofc the compiler would catch some bugs but maybe not all).
I have some ideas to fix this:
- Since capacitor is a standalone framework I would not like it do depend on other frameworks “workspace” features like Angular or Ionic but what about a new section in the capacitor.config.json that explicitly requires plugins to be included. This would add another benefit by not including plugins that one just installed to test something and forgot do uninstall later.
- Search through all code for “@capacitor/*” 🤪
- also search by “peerDependencies” so something like this will work
"peerDependencies": { "@capacitor/app": "*" }
Capacitor Version
Latest Dependencies:
@capacitor/cli: 3.2.2
@capacitor/core: 3.2.2
@capacitor/android: 3.2.2
@capacitor/ios: 3.2.2
Installed Dependencies:
@capacitor/cli: 3.2.2
@capacitor/core: 3.2.2
@capacitor/android: 3.2.2
@capacitor/ios: 3.2.2
Platform(s)
All
Current Behavior
No plugins added to Podfile e.g.
Expected Behavior
Include them in some way
Code Reproduction
Create an ionic multi app following this guide: https://openforge.io/mobile-academy/guides/mobile-app-development/how-to-create-a-monorepo-with-ionic-angular-appflow/
Other Technical Details
npm --version
output: 6.x
node --version
output: 14.x
pod --version
output (iOS issues only):
Additional Context
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Capacitor 3.0 Upgrade Plugins "not implemented" Exception ...
I have installed every plugin for the whole app (the root) and for the nx-capacitor app (the capacitor app added with @nxtend-capacitor) as ......
Read more >[Capacitor 3] Custom plugin doesn't have dist folder after ...
Hi,. I migrated my app and a custom plugin to Capacitor 3 and facing one last problem. When installing the custom plugin from...
Read more >How to run ionic capacitor app from nx monorerepo in live ...
First of, it's not necessary to use @nxtend/capacitor at all. Within nx monorepo it's possible to configure app's project.json (apps/awesome-app/project.json) ...
Read more >11 Great Tools for a Monorepo in 2021 | Bits and Pieces
In this roundup, I've gathered some of the best tools in the world to ... import a library that was missing from your...
Read more >patch-package - npm
json. If it's a transitive dependency patch-package can't detect that it is safe to ignore and will throw an error. To fix this,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am trying to sell the idea of using Ionic where I work at, but we use nx monorepos. It makes it hard to sell 😕
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.