-
-
Notifications
You must be signed in to change notification settings - Fork 46
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 display flags for version helper #36
Conversation
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.
Everything looks good to me; the only thing I might change would be exporting the two regular expressions in app/helpers/app-version.js
as constants, and then importing them in the tests files where they're used again, rather than repeating them.
Sounds good to me. UPDATE: Went ahead an added to a util. Let me know what you think! |
app/utils/regexp.js
Outdated
@@ -0,0 +1 @@ | |||
export { default } from 'ember-cli-app-version/utils/regexp'; |
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.
Is it necessary to re-export these utilities in the app
tree? I think that the util
generator probably just created this file by default, but keeping this file here would define
import regexp from 'consuming-app/utils/regexp';
Which is probably not desired.
addon/utils/regexp.js
Outdated
const versionRegExp = /\d[.]\d[.]\d/; | ||
const shaRegExp = /[a-z\d]{8}/; | ||
|
||
export default { |
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.
Any reason for exporting as a single object, rather than two named exports? Since all of the places that the file is imported destructures both properties anyway, it seems marginally easier to instead do:
import { shaRegExp, versionRegExp } from 'ember-cli-app-version/utils/regexp';
instead.
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.
Not really, it was moreso if this was ever needed to be exported as an object... but I guess when that case arises, it can be added.
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.
Gotcha. If you ever wanted them both as one object, you could also do
import * as regExpObject from 'ember-cli-app-version/utils/regexp';
too.
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.
Ah! So much better.
tests/unit/utils/regexp-test.js
Outdated
@@ -0,0 +1,24 @@ | |||
import { module, test } from 'qunit'; | |||
import regexp from 'dummy/utils/regexp'; |
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.
Just a note: if you remove the export of the utilities from the app
tree, this will have to be updated to import from the addon, too.
I pinged @taras to see if he wants to review; if he doesn't get back to me soon I'll merge your PR (and keep my fingers crossed that he doesn't mind). |
@alexlafrosia I still don't have my computer. Can you publish this? |
I can't publish this on NPM, I don't have the permissions for it 😦 NPM says I'm part of "0 organizations" on there, and the package is published under your username. Maybe we can:
So we can reduce the bus-factor of this addon (and your other EmberSherpa ones) in the future. |
@alexlafroscia @taras Any idea when this will be published? |
I unfortunately can't publish it, even though I'd love to 😦 @taras has the keys and he's been traveling a lot lately. I'll try to get in touch with him and see if we can transfer this repo on NPM in a way that I can help with updating going forward. |
+1 for publishing this :-) |
Published 2.0.2 (sorry for the delay, finally got my computer back) |
Adds ability to remove parts of app version with flags on Helper. Defaults to displaying both app version on
package.json
and most recent git SHA.Addresses #35.
Usage:
// => 2.0.1
// => <git SHA>
TODO: