Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Add CLI #42

Merged
merged 5 commits into from
May 22, 2019
Merged

Add CLI #42

merged 5 commits into from
May 22, 2019

Conversation

honzajavorek
Copy link
Contributor

@honzajavorek honzajavorek commented May 15, 2019

Adding CLI to streamline the workflow with the template. Also adding extensive docs on the topic. Addressing several issues here:

This is a part of the plan outlined here: apiaryio/dredd#917 (comment)

Note that the upgrade command isn't tested as the package isn't published here yet and the npm view call would just fail now. I'll test the upgrade command somehow as one of the next steps. Filed as #43

I suggest the reviewer to see the README first and learn about how the thing is supposed to work, then dive in to the changes to the code.

@honzajavorek honzajavorek marked this pull request as ready for review May 16, 2019 14:37
Close #20, close #4, close #3, close #19
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved

### Add the features to your project
It upgrades the package to the latest version and copies the latest feature files to the project's `./features/` directory. It won't overwrite the existing files as the names of the new files get suffixed with version. Then it's up to you to compare the old and new files, spot changes, and update the project's test suite.

Choose a reason for hiding this comment

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

We can also use postinstall npm hook for copying the files, so users could upgrade the package version using a default flow (npm outdated/npm install ...), and the hook would handle additional logic.

Also account on the scenario that a user will upgrade the package as usual. I think we should ensure the package would contain expected files in any way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's an interesting idea which didn't occur to me. One concern I'd have is that it would implicitly, without asking the user, copy some files over from the package to their code. I'm not sure whether it's not too invasive. I kind of like the explicit step user takes - they know what they're doing, they're doing it willingly, they can easily retry, etc.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
cli/copyFeatures.js Show resolved Hide resolved
cli/index.js Show resolved Hide resolved
scripts/smoke-test.js Show resolved Hide resolved
@honzajavorek
Copy link
Contributor Author

@artem-zakharchenko I replied to some of your comments and addressed the others in comments. Could you please re-review?

@artem-zakharchenko artem-zakharchenko self-requested a review May 22, 2019 13:22
@honzajavorek honzajavorek merged commit 3943e16 into master May 22, 2019
@honzajavorek honzajavorek deleted the honzajavorek/cli branch May 22, 2019 13:34
@ApiaryBot
Copy link
Collaborator

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants