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

feat: added ability to pass a custom message #19

Merged
merged 9 commits into from
Feb 20, 2019

Conversation

Aghassi
Copy link
Contributor

@Aghassi Aghassi commented Jan 25, 2019

Currently, this warning just display line that says "You are outdated, please update". However, a user may not know what to do if this is their first time using your CLI. It may be useful to provide the user some context on how to update.

For example, we use brew as our install method of choice. A user may assume they should run brew upgrade to get the latest (not the case). To make it more obvious, we can hint to the user by saying "Please run my-cli update to update". This change adds that ability.

@salesforce-cla
Copy link

Thanks for the contribution! Unfortunately we can't verify the commit author(s): David Aghassi <d***@i***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce.com Contributor License Agreement and this Pull Request will be revalidated.

@jdx
Copy link
Contributor

jdx commented Jan 25, 2019

this is a good change, but I would prefer we use a lodash template so it can be overridden entirely instead of just appended to

@Aghassi
Copy link
Contributor Author

Aghassi commented Jan 25, 2019

@jdxcode Can you provide me an example of what you mean by "lodash template"? I'm happy to update the PR once I understand 😄

EDIT: I assume you mean this?
https://lodash.com/docs#template

@Aghassi
Copy link
Contributor Author

Aghassi commented Jan 27, 2019

@jdxcode Ok I refactored it. I think that is what you meant. Also, this is my first jump into TypeScript, so if I messed the syntax up I apologize.

@Aghassi Aghassi force-pushed the feat/custom-update-message branch from e4475a8 to daca495 Compare January 27, 2019 20:06
@Aghassi
Copy link
Contributor Author

Aghassi commented Jan 27, 2019

@jdxcode Does this repo support any CI for PRs? I want to make sure that my changes aren't going to break anything. I've run yarn test and yarn lint locally by hand to validate changes, but I wanted to know if I should do anything else.

Also, would you be opposed to me adding husky in a separate PR so that certain checks running before commit and push locally?

As an aside, can this change be squash merged? I know it is a bit messy as I figure things out.

README.md Outdated
@@ -61,6 +64,7 @@ any of the following configuration properties:
],
"warn-if-update-available": {
"timeoutInDays": 7,
"message": "Run @scope/my-cli update to update to the latest"
Copy link

Choose a reason for hiding this comment

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

Missing a comma here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Running yarn lint locally passes 😞

Copy link

Choose a reason for hiding this comment

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

It's just in the readme :)

@Aghassi
Copy link
Contributor Author

Aghassi commented Feb 9, 2019

@jdxcode Anything else you need on my end to get this merged in?

@Aghassi
Copy link
Contributor Author

Aghassi commented Feb 10, 2019 via email

.npmrc Outdated
@@ -0,0 +1 @@
registry=https://registry.yarnpkg.com/
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. I was trying to handle work from my work laptop and it was using our internal registry. I will remove this.

package.json Outdated
@@ -8,10 +8,12 @@
"@oclif/command": "^1.5.3",
"@oclif/config": "^1.8.7",
"@oclif/errors": "^1.2.2",
"@types/lodash.template": "4.4.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be a dev dependency

@@ -2,6 +2,7 @@ import {Hook} from '@oclif/config'
import Chalk from 'chalk'
import {spawn} from 'child_process'
import * as fs from 'fs-extra'
import template = require('lodash.template')
Copy link
Contributor

Choose a reason for hiding this comment

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

this import could be moved down lower

@Aghassi
Copy link
Contributor Author

Aghassi commented Feb 20, 2019

@jdxcode Addressed comments

@jdx jdx merged commit 77efd5a into oclif:master Feb 20, 2019
@Aghassi Aghassi deleted the feat/custom-update-message branch February 21, 2019 17:01
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