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
Merged
Merged
Changes from 36 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
f7473d8
retrieve the files, which were added since the last release
bunysae 5507f54
Checks for new files added since the last release implemented
bunysae 7278c44
test-passes
bunysae 9f3a1c3
integration ignored files in ui
bunysae d02e183
Merge branch 'master' into issue_103
bunysae 5bb7561
Refactorings for new function show files since
bunysae c43f900
Resolved merge-conflict in ui.js
bunysae 71d179a
Merge branch 'master' into issue_103
bunysae 12a16f0
Show files added since the last release not part of the release packa…
bunysae 73b86f7
Show files added since the last release not part of the release packa…
bunysae 7cef7cb
Show files added since the last release not part of the release packa…
bunysae 4a75e6d
Merge branch 'master' into issue_103
bunysae 2827f81
Show files added since the last release not part of the release packa…
bunysae 4a8f2e4
Merge branch 'issue_103' of https://github.com/bunysae/np into issue_103
bunysae da3f187
Show files added since the last release not part of the release packa…
bunysae 5db79e4
Show files added since the last release not part of the release packa…
bunysae 76e6a80
Merge branch 'master' into issue_103
bunysae 786187d
Show files added since last release refactoring testclass
bunysae 32d0d47
Refactoring ui
bunysae 71d410f
Simplify tests
bunysae 3634a96
Merge branch 'issue_103' of https://github.com/bunysae/np into issue_103
bunysae ddcaebf
Merge branch 'master' into issue_103
bunysae d86bf7d
Update npmignore.js
sindresorhus c445ff6
Apply suggestions from code review
bunysae 239c61f
1. Ingore test files
bunysae fba3ab4
Add submodule integration test
bunysae 2fa3cf5
New files since last release: additional test cases
bunysae 22b242a
exclude linting submodules
bunysae dd5353b
Updating submodule
bunysae a082606
Exclude integration-test from direct invocation
bunysae f8a5507
Adjust submodule integration-test
bunysae bd12ee8
integration-test: cleanup task
bunysae fa5c3c2
Tweak integration-test
bunysae aa73b47
Add published file check to readme
bunysae 3bb2783
fix for dot-files
bunysae 546aebb
Fix early exit
bunysae c0a7b4c
Rewriting readme
bunysae 7f383bf
Fix grammar and meaning in readme
bunysae db59d35
Update readme.md
sindresorhus d75573f
Merge branch 'master' into issue_103
sindresorhus d784837
Update source/ui.js
sindresorhus File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "integration-test"] | ||
path = integration-test | ||
url = https://github.com/bunysae/np_integration_test |
Submodule integration-test
added at
ad5e6e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Don't hard-wrap. |
||
The selection may exclude some necessary files or vice versa. | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. This whole text could be better written. |
||
|
||
## Tips | ||
|
||
### npm hooks | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
should be ignored by default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ignore.txt | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File is always included in package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File is always included in package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Ignore this file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File is excluded from .npmignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ignore this file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
should be ignored by default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"files": ["pay_attention.txt"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File is excluded from package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File in included in package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The directory is for the resources | ||
in the script npmignore.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const test = require('ava'); | ||
const execa = require('execa'); | ||
|
||
test.after.always(async () => { | ||
await execa('git', ['submodule', 'update', '--remote']); | ||
}); | ||
|
||
test('Integration tests', async t => { | ||
await execa('ava', {cwd: 'integration-test'}); | ||
t.pass(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import path from 'path'; | ||
import test from 'ava'; | ||
import proxyquire from 'proxyquire'; | ||
|
||
const newFiles = [ | ||
'source/ignore.txt', | ||
'source/pay_attention.txt', | ||
'.hg', | ||
'test/file.txt', | ||
'readme.md', | ||
'README.txt' | ||
]; | ||
|
||
test('ignored files using file-attribute in package.json with one file', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'package') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({files: ['pay_attention.txt']}, newFiles), ['source/ignore.txt']); | ||
}); | ||
|
||
test('ignored file using file-attribute in package.json with directory', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'package') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({files: ['source']}, newFiles), []); | ||
}); | ||
|
||
test('ignored test files using files attribute and directory structure in package.json', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'package') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({files: ['source'], directories: {test: 'test-tap'}}, newFiles), ['test/file.txt']); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({files: ['source'], directories: {test: ['test-tap']}}, newFiles), ['test/file.txt']); | ||
}); | ||
|
||
test('ignored files using .npmignore', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'npmignore') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({name: 'npmignore'}, newFiles), ['source/ignore.txt']); | ||
}); | ||
|
||
test('ignored test files using files attribute and .npmignore', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'npmignore') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({directories: {test: 'test-tap'}}, newFiles), ['source/ignore.txt', 'test/file.txt']); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({directories: {test: ['test-tap']}}, newFiles), ['source/ignore.txt', 'test/file.txt']); | ||
}); | ||
|
||
test('dot files using files attribute', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'package') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({files: ['source']}, ['test/.dotfile']), []); | ||
}); | ||
|
||
test('dot files using .npmignore', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'npmignore') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({}, ['test/.dot']), []); | ||
}); | ||
|
||
test('ignore strategy is not used', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures') | ||
} | ||
}); | ||
t.is(await testedModule.getNewAndUnpublishedFiles({name: 'no ignore strategy'}, newFiles), undefined); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.