-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
Show files added since the last release and not part of the package #456
Conversation
Is anyone interested to review this pull-request? @sindresorhus @itaisteinherz |
the last release and not part of package according to pull-request comments from @fregante Pull-Request 456
@bunysae Thanks so much for this PR! Sorry for only reviewing it now, I was very busy for a while 😅 I left some comments for you to take look at (please don't be overwhelmed by the amount of them, they're mostly about renaming methods and rephrasing comments). |
…ge Iteration 3 1. Moved .npmignore exitence check into separate function 2. According to npm-docs files-attribute has a higher priority than .npmignore-file in the package-root-directory 3. Exclude the files ignored by default (http://npm.github.io/publishing-pkgs-docs/publishing/the-npmignore-file.html) from the comparison 4. Refactoring: naming of variables
…ge Iteration 3 1. Refactorings 2. UI-Improvement
@itaisteinherz I created an failing unit-test in commit 4a75e6d for this issue and fixed it with the latest commit. |
Please review again. |
Is this done? |
The unit-tests in test/npmignore.js contains all edge-cases.
The integration-tests in submodule integration-test covers the git-
commands as well.
|
This is not fixed: #456 (comment) Please ensure you fix all the things mentioned in the review and that you also do some manual QA testing (test running |
It's fixed. If no files were added, the process was exited to early. I did the following manual QA testing (all passed):
By the way i found one small bug, which is fixed in commit 3bb2783. Dot-files weren't correctly recognized. |
readme.md
Outdated
@@ -123,6 +123,15 @@ module.exports = { | |||
|
|||
_**Note:** The global config only applies when using the global `np` binary, and is never inherited when using a local binary._ | |||
|
|||
### Select published files |
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 think this was meant to be in the Tips
section.
readme.md
Outdated
@@ -123,6 +123,15 @@ module.exports = { | |||
|
|||
_**Note:** The global config only applies when using the global `np` binary, and is never inherited when using a local binary._ | |||
|
|||
### Select published files | |||
You can select the published files with the `files` property in `package.json` | |||
or you can use the `.npmignore`-file, to exclude unnecessary stuff. |
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.
Don't hard-wrap.
readme.md
Outdated
To avoid these mistakes, `np` reports all new files added to git, which are not published. | ||
Test files and other [obvious stuff](https://docs.npmjs.com/files/package.json#files) is excluded by default from this report. | ||
`np` assumes either a standard directory layout or a customized layout | ||
depict in the `directories` property (`package.json`). |
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.
This whole text could be better written.
readme.md
Outdated
### Ignore strategy | ||
The [ignore strategy](https://docs.npmjs.com/files/package.json#files) either maintained in the `files`-property (`package.json`) or in the `.npmignore`-file should minify your packages. | ||
To ensure package consistency `np` reports all new files added to git, which are not published. Test files and other [obvious stuff](https://docs.npmjs.com/files/package.json#files) isn't considered. | ||
`np` assumes either a standard directory layout or a customized layout depict in the `directories` property (`package.json`). |
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 still don't think this text is good enough. Also, please run text through something like https://app.grammarly.com/.
readme.md
Outdated
@@ -255,6 +255,11 @@ Host * | |||
|
|||
If you're running into other issues when using SSH, please consult [GitHub's support article](https://help.github.com/articles/connecting-to-github-with-ssh/). | |||
|
|||
### Ignore strategy | |||
The [ignore strategy](https://docs.npmjs.com/files/package.json#files) either maintained in the `files`-property (`package.json`) or in the `.npmignore`-file should minify your packages. | |||
To ensure package consistency `np` reports all new files added to git, which are not published. Test files and other [obvious stuff](https://docs.npmjs.com/files/package.json#files) isn't considered. |
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 don't show new files to ensure package consistency. We show them to prevent publishing a broken package.
readme.md
Outdated
@@ -255,6 +255,11 @@ Host * | |||
|
|||
If you're running into other issues when using SSH, please consult [GitHub's support article](https://help.github.com/articles/connecting-to-github-with-ssh/). | |||
|
|||
### Ignore strategy | |||
The [ignore strategy](https://docs.npmjs.com/files/package.json#files) either maintained in the `files`-property (`package.json`) or in the `.npmignore`-file should minify your packages. |
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.
"minify" means something else. It's more about "reducing" the size of the package.
According to your issue-comment, i implemented a check for files, which were added since the last release and which are not part of file-attribute in
package.json
or which are ignored by.npmignore
.A unit-test for the new function is implemented mocking the the git command and the package-directory. Therefore i added the directory
test/fixtures
.Fixes #103
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
IssueHunt has been backed by the following sponsors. Become a sponsor