-
Notifications
You must be signed in to change notification settings - Fork 36
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
Simplify build process and published packages #4
Conversation
Thank you for submitting this pull request. Your interest has motivated me to spend time wrapping up #2, on which I began work a year ago!
Thanks to #3 it's no longer necessary to update
As mentioned above, this is handled by the current release process.
I'm very much in agreement on this. I'd love to see a standalone pull request which adds an .npmignore. |
Why does Auto-committing it on publishing is definitely better than syncing by hand, but still most of the time Not in the repo ═ no need for any auto-committing hacks at all. After all, As a bonus, it would become possible to replace
There is no real need for the last lines in |
Good point.
I find this line of reasoning compelling. You're winning me over. :) Now that I think I'm on board with your proposal I'll review the pull request in detail. |
@@ -1 +1,2 @@ | |||
/node_modules/ | |||
lib/ |
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.
Please include a leading slash, to anchor this to the repository root. I realize that in practice it won't make a difference, but /foo/bar/baz/lib/quux.js
should not be ignored.
This is looking good. Would you mind squashing all these changes into a single commit? |
2a00589
to
12a6917
Compare
Squashed! |
Thanks! Now to make sure I understand all the things that'll happen when I run
node_modules/.bin/xyz --message X.Y.Z --tag X.Y.Z --repo git@github.com:davidchambers/string-format.git --script scripts/prepublish --increment patch
Is this correct, @eush77? While we're at it, I suggest we remove the version string from src/string-format.coffee. We can then remove the prepublish script, which will reduce the cognitive load. :) |
Yeah, that seems to be the way it will work.
OR we can include the version from String::format.version = format.version = require('../package.json').version |
That would work in Node, but not in the browser. Also, there's a universally applicable way to get the version string in Node: > require('string-format/package.json').version
'0.2.1' I've convinced myself. Let's remove the version property. Mind making the necessary changes? |
ce8ae20
to
d6e4934
Compare
Sorry, I forgot to remove |
Or should I squash it again? |
@@ -1 +1,2 @@ | |||
/node_modules/ | |||
/lib/ |
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.
Let's alphabetize these. :)
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.
Sure!
This patch is looking very nice. Yes, please squash once more. I also pointed out one incredibly minor issue you could address at the same time. |
d6e4934
to
dfc9085
Compare
@@ -5,6 +5,10 @@ | |||
"author": "David Chambers <dc@davidchambers.me>", | |||
"keywords": ["string", "formatting", "language", "util"], | |||
"main": "./lib/string-format", | |||
"scripts": { | |||
"prepublish": "make", |
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.
One last change: let's "make clean && make"
so we recreate the JavaScript file even if for some reason its modification time is later than that of the source file.
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.
Done!
dfc9085
to
7efc471
Compare
Lovely work! Merging. |
Simplify build process and published packages
This will eliminate the need for synchronizing
src/
andlib/
directories by hand and lead to the cleaner git history.These scripts are standard interfaces NPM provides. "Prepublish" will fire any
npm publish
ornpm install
. Of coursexyz
is still managing the publishing, but it would be still better if NPM keptlib/
in sync automatically for you.Leave CoffeeScript for development and publish the compiled JS only. Users don't need any CoffeeScript.
The package itself becomes tighter:
What do you think?