Skip to content
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

Add Yarn option #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add Yarn option #105

wants to merge 2 commits into from

Conversation

trentmwillis
Copy link
Collaborator

Fixes #76. Provides a nice speed boost.

@simonihmig
Copy link
Collaborator

LGTM, thanks for pushing this @trentmwillis!

Tests are failing however, yarn complains about some version mismatch. I have the suspicion that it behaves differently than npm, by checking the npm registry for our my-addon test addon, though the symlinked addon already exists. So it finds this interesting piece of software: https://www.npmjs.com/package/my-addon, whose only version is 0.0.1, as opposed to our symlinked 0.0.0! 😝

Maybe renaming my-addon to something more unique, like ember-cli-addon-tests-test-addon or whatever could be enough to fix the tests?

@@ -91,7 +91,8 @@ function installPristineApp(appName, options) {
hasNodeModules,
hasBowerComponents,
emberVersion: options.emberVersion || 'canary',
emberDataVersion: options.emberDataVersion || 'emberjs/data#master'
emberDataVersion: options.emberDataVersion || 'emberjs/data#master',
yarn: options.yarn || false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am asking myself if it could make sense to not default to false, but instead check if the addon has a yarn.lock file, and default to true in this case? ember new needs the --yarn option to use yarn, because there is no app yet, but when running ember install it does a similar check afaik, assuming it should use yarn if the project uses it.

Maybe we could copy that behavior here? Fwiw, this could be a separate PR though...

Copy link
Collaborator

@kellyselden kellyselden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to assume yarn usage like ember-cli does? I created ember-cli/rfcs#107 to possibly help.

@@ -43,15 +43,16 @@ describe('Acceptance | application', function() {
promoteHtmlbars();

return app.create('dummy', {
fixturesPath: 'tests'
fixturesPath: 'tests',
yarn: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps we should leave this test intact and make a new one that tests yarn. Then both our npm and yarn code paths get tested.


cache:
- '%APPDATA%\npm-cache'
- "%LOCALAPPDATA%\\Yarn"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accidental double slash?

return runCommand('yarn');
} else {
return runCommand('npm', 'install');
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up on my comment https://github.com/tomdale/ember-cli-addon-tests/pull/105/files#r118477645 and I think also what @kellyselden was suggesting, if this addon knows which package manager to use, maybe we can abstract this and the yarn add thing above away into a reusable method and make it public (like app.install() and app.install('my-addon') ) which users of this addon can use to customize their test setup without having to care about which package manager shall be used (e.g. here https://github.com/kaliber5/ember-fastboot-addon-tests/blob/master/lib/util/app-manager.js#L41)?

Can be a separate PR as well, just wanted to mention my thoughts here...

@simonihmig
Copy link
Collaborator

@trentmwillis Just wondering, are you able to continue work on this? If you don't have time, maybe someone other can take this over? Would love to see this land...

Apart from the comments above and the failing test, there are now some merge conflicts that need to be addressed... (@kellyselden has been on fire lately 😉 )

@trentmwillis
Copy link
Collaborator Author

Yeah, sorry, I likely won't get to this any time soon, so if someone else would like to pick it up, go for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants