jelhan / create-github-actions-setup-for-ember-addon

Setup GitHub Actions for an Ember Addon
MIT License
19 stars 2 forks source link

npm/yarn detection not working? #37

Closed simonihmig closed 3 years ago

simonihmig commented 3 years ago

I ran this tool on https://github.com/kaliber5/ember-responsive-image, and it created the npm-based workflow, although there is a yarn.lock! 🤔 Haven't looked further into it yet...

jelhan commented 3 years ago

I guess you run the script on the state before this merge request: https://github.com/kaliber5/ember-responsive-image/pull/77

As the repository had a .travis.yml at that time the script migrates that one. It does not calculate defaults in that case.

The TravisCI configuration of the repository was using npm: https://github.com/kaliber5/ember-responsive-image/blob/4db6f8d0c8a3aa2435e193e187aa45f75fa14056/.travis.yml#L38-L39 So this was as expected.

Wondering if using NPM in TravisCI even though the repository uses yarn is a common mistake. In that case we might want to warn the user about it.

simonihmig commented 3 years ago

I guess you run the script on the state before this merge request: kaliber5/ember-responsive-image#77

Yes, the PR was the result of running the script + some manual tweaks.

The TravisCI configuration of the repository was using npm... So this was as expected.

Hm, ok. I was looking at this line, so thought the "switch" for yarn vs npm was made based on the existance of yarn.lock in the repo, not what's inside .travis.yml: https://github.com/jelhan/create-github-actions-setup-for-ember-addon/blob/d8bbc44453299627c3c259b59d2fdb4e02ca4e71/src/parser/defaults.ts#L48

What am I missing? 🤔

jelhan commented 3 years ago

The TravisCI configuration of the repository was using npm... So this was as expected.

Hm, ok. I was looking at this line, so thought the "switch" for yarn vs npm was made based on the existance of yarn.lock in the repo, not what's inside .travis.yml:

https://github.com/jelhan/create-github-actions-setup-for-ember-addon/blob/d8bbc44453299627c3c259b59d2fdb4e02ca4e71/src/parser/defaults.ts#L48

What am I missing? thinking

The script supports different parser. Which ever is able to return meaningful configuration is used. It first looks for configuration stored by a previous run. Afterwards it looks for a .travis.yml. Only if both is not available it takes the defaults.

I plan to support an interactive mode, which allows the user to pick the parser and makes this less magical. See #35 for details.

simonihmig commented 3 years ago

Ok, got it. Thanks!