-
Notifications
You must be signed in to change notification settings - Fork 340
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
CB-12242 : Use yarn instead of npm #292
Conversation
Tests are failing because of a code style problem:
Could you please fix that so the actual tests can run an this can possibly be merged? Thanks. |
Any updates on this? Would love for this to get merged in. Thanks! |
I've just fixed the code style issue. Could you merge it @janpio ? |
Nope sorry, I don't know anything about the |
Does this also depend on apache/cordova-fetch#14 ? |
It depends on both apache/cordova-fetch#14 and apache/cordova-lib#610 |
is there anyone that can help with progressing this item further? |
@@ -486,7 +492,8 @@ function cli (inputArgs) { | |||
save_exact: args['save-exact'] || false, | |||
shrinkwrap: args.shrinkwrap || false, | |||
force: args.force || false, | |||
production: args.production | |||
production: args.production, | |||
manager: args.manager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just args.manager || 'npm'
?
Can anyone move forward with this PR please? It would be really appreciated to have this merged. |
Not speaking for anyone else here, but I'm not especially in favour of adding additional complexity and maintenance burden to several layers of Cordova libraries for very little benefit. Cordova made the decision to use npm, and with the improvements in npm 5 and 6 it's arguable whether there's any advantage to yarn (especially in this limited use case). We know that there are some issues with how cordova-fetch is using npm, but I'd rather fix those as opposed to doubling the amount of testing everyone needs to do to support two package managers with different command syntaxes. |
I'm not familiar with any recent changes to npm w.r.t. offline support, but we have internally standardized on yarn for offline mirror support during building (also for not-cordova related projects). I can imagine that might also be the case for other people/companies? I'd be interested in thoughts about resolving that in a nice way |
Fully agree with @dpogue. Personally I think it's OK to provide some parameter to call external managers or scripts to do tasks, but without any support. This pull request do it wrong. |
Not sure what do you mean here guys... |
@qkdreyer I can understand your desire to use your package manager of choice with cordova. But with how Cordova currently uses npm, adding support for additional package managers is just not feasible. I just recently completely refactored My long term goal is to get to a point where Cordova does not have to do any package management at all. But that's still a long way to go, if we will ever get there. Until then, I would like to avoid any additional complexity introduced to the whole package management process. I'll play the bad guy here and close this and the other related PRs. I'm under the impression that this reflects the general stance among the Cordova tooling team. Please note that my decision is not authoritative in any respect. If someone disagrees, they should just reopen. I'm sorry that this did not come up during discussion in the issue before you created your PRs. 🙇♂️ |
fwiw, I was able to get yarn working with cordova@8 and a very basic yarn wrapper (below) and a symlink #!/bin/bash
args="$@"
arg2="$2"
if [ "$1" = "install" ] && [ -n "$arg2" ] && [ "${arg2/--//}" = "$arg2" ] ; then
args="${args/install/add}"
fi
yarn $args A better version of the wrapper is needed to get And No doubt this wouldnt cover all possible usages, and shouldnt be supportable by the core team, but it seems reasonable that cordova-fetch can use other package managers used by the project (e.g. detected via apache/cordova-fetch#46 , or an explicit and non-friendly option ), and include a warning that only npm is supported. |
(Best create a new issue so this doesn't get lost @jayvdb as a possible starting point) |
I think apache/cordova-fetch#46 is a reasonable starting point, as the work would need to be done in cordova-fetch first, and that is where the complexity of tight integration with npm exists. |
Hi @marckassay! |
Hi @jayvdb
|
Platforms affected
All
What does this PR do?
Allows user to select his package manager used by cordova-fetch, possible values are "npm" or "yarn", defaulting to "npm"
What testing has been done on this change?
None, since we're just adding cordova arguments here
Checklist