Open distante opened 1 year ago
It took me longer than I care to admit to debug this while attempting to update to Capacitor 5...
In the end, I reverted back to plain nx:run-commands
in my executors:
"update": {
"executor": "nx:run-commands",
"options": {
"cwd": "apps/mobile",
"command": "cap update"
},
"configurations": {
"ios": {
"ios": {
"command": "cap update ios"
},
"android": {
"command": "cap update android"
}
}
}
},
I believe this plugin should do the same in fact, and not even invoke npx
. It should let Nx do its thing, and avoid forcing another version of users. We can expect quite some troubles when version 5 will be in general availability, and npx will default to that.
@borgoat how do you invoke the configuration? You nested ios.android because..?
Ok so we migrated to this and I think this is enough:
"capacitor": {
"executor": "nx:run-commands",
"options": {
"cwd": "apps/project",
"commands": [
{
"command": "capacitor",
"forwardAllArgs": true
}
]
}
}
pnpm nx run project:capacitor copy ios
@borgoat how do you invoke the configuration? You nested ios.android because..?
Sorry, you can ignore that part... a copy-paste mistake I guess. I think we wrongly copied it from other tasks such as "open" and "run" to do platform specific things, but for sync we always invoke just 1 command for both platforms: nx sync mobile
.
btw. if you dont want to run this long NX command, you can install npm-run-all and shorten it to just pnpm cap copy ios
with:
"cap": "npm-run-all \"nx run project:capacitor {@}\" --",
Describe the bug Running
@nxext/capacitor:cap:run
will try to installpackage=@capacitor/cli
instead of using the one found onnode_modules
To Reproduce call
@nxext/capacitor:cap run
Expected behavior Run should call the existing
@capacitor/cli
fromnode_modules
Additional context The problem was introduced by https://github.com/nxext/nx-extensions/pull/817