-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Docs: Extend guidelines for managing packages and publishing them to npm #8768
Conversation
Problem: Publishing modules to npm can be difficult because it is not always clear at the time of publishing to what version the package should be updated. The individual performing the publish is not always the same as the contributors who had proposed changes to the package. Options:
Decision: Encourage developers to introduce changelog entries and evaluate success in a future meeting. |
@hypest feel free to include |
It occurred to me: Maybe it shouldn't be the releaser who touches the version, but instead the developer who proposes a change. If, for example, a current changelog appears as:
Thoughts? In retrospect, this is my workflow for how I manage my own personal projects. |
That’s a really good idea. We can almost copy and paste what you described. I would also encourage grouping by:
And skip everything else from the changelog. This is what popular repositories do usually. |
A correction to my previous comment, which is worth clarifying as it's a potential point of confusion:
In my above example, since the existing "1.2.2" version is marked unreleased, I shouldn't change the version at all. Similarly, if the version was "1.3.0 (Unreleased)" and I was adding a new feature, I wouldn't change the version. The version bump is only necessary if (a) there are no other unreleased changes or (b) the type of change I'm introducing is incompatible (more severe) than the other unreleased changes. |
a9889dd
to
3f52844
Compare
This is ready for a final check. I included all suggestions shared by @aduth. Thanks for help 💯 |
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.
LGTM
@ntwb, thanks for your verbiage tweaks 🙇 |
CONTRIBUTING.md
Outdated
} | ||
} | ||
``` | ||
It assumes that code is goind to be located in `src` folder and will be transpiled with `Babel`. |
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.
Typo: "goind" -> "going"
CONTRIBUTING.md
Outdated
``` | ||
3. `README.md` file containing at least: | ||
- Package name. | ||
- Package description. |
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.
Same as in package.json
? (Should we mention this?)
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.
It isn't always the case. Not sure to be honest.
CONTRIBUTING.md
Outdated
- Package description. | ||
- Installation details. | ||
- Usage example. | ||
- `Code is Poetry` logo. |
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.
Where does one find this?
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.
We should include the snippet. It's copy and paste anyways.
CONTRIBUTING.md
Outdated
|
||
### Maintaining changelogs | ||
|
||
It isn't easy task to maintain dozens of npm packages. That's why we decided to introduce `CHANGELOG.md` files for all packages to simplify the release process. |
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.
Grammar: "It isn't an easy"
CONTRIBUTING.md
Outdated
```md | ||
## v1.2.2 (Unreleased) | ||
|
||
#### Bug Fix |
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.
Based on document structure, why would this be an H4
following an H2
?
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.
I blame Babel
, will update :)
CONTRIBUTING.md
Outdated
|
||
- If you need to add something considered a bug fix, you add the item to `Bug Fix`section and leave the version as 1.2.2. | ||
- If it's a new feature you add the item to `New Feature` section and change version to 1.3.0. | ||
- If it's a breaking change you want to introduce, you add the item to `Breaking Change` section and bump the version to 2.0.0. |
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.
Are there any other changes which wouldn't fall neatly under one of these classifications? I've personally observed some "Internal" / "Housekeeping" type changes which don't necessarily contribute to public-facing consumer, though I suppose could have some place in the SemVer hierarchy. These are also items it's not entirely clear we'd need to include at all.
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.
These are also items it's not entirely clear we'd need to include at all.
It might get tricky because Lerna will bump version anyways. We probably should skip them as they aren't that important but we still will have a new version released. It might sometimes happen only because one of the packages maintained by Lerna listed in dependencies has version bump.
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.
Sorry this took me ages to get to, I got distracted with some other PRs! 😓
I made a few tweaks and tidied up some of the docs based on @aduth's comments. The rest looks good to me. 👍
CONTRIBUTING.md
Outdated
|
||
### Maintaining changelogs | ||
|
||
Maintaining dozens of npm packages is difficult–it can be tough to keep track of changes. That's why we use `CHANGELOG.md` files for each package to simplify the release process. All packages should follow the [Semantic Versioning (`semver`) specification](https://semver.org/). |
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.
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.
Omg you’re totally right and I’m often the one to comment on that. I have no excuse!
Sorry about my rubbish commit message, I made it from my iPad and fat-fingered the return key. |
Added @aduth suggestion from the core JS chat: https://make.wordpress.org/core/2018/08/21/javascript-chat-summary-august-21/.
Description
As discussed during the JavaScript weekly chat earlier this week, I opened pull request to extend our guidelines for managing and publishing npm packages with Lerna.
TODO