Skip to content

Commit ec62362

Browse files
committed
Never include /.git in the package. It creates packages that, once installed, can not be easily removed. Prevent .DS_Store files from being picked up if they are files rather than folders. (Note that a .DS_Store file in a specifically included dir _will_ still be included.) Don't bother walking node_modules in the root if no packages are bundled. (Saves thousands of lstat calls on npm publish in normal cases.) Sort package file lists in the tarball to optimize for gzip compression.
1 parent f101d44 commit ec62362

File tree

6 files changed

+58
-33
lines changed

6 files changed

+58
-33
lines changed

node_modules/npm-packlist/index.js

+33-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/npm-packlist/package.json

+16-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"npm-install-checks": "~3.0.0",
9797
"npm-lifecycle": "^2.1.0",
9898
"npm-package-arg": "^6.1.0",
99-
"npm-packlist": "^1.4.1",
99+
"npm-packlist": "^1.4.4",
100100
"npm-pick-manifest": "^2.2.3",
101101
"npm-registry-fetch": "^3.9.0",
102102
"npm-user-validate": "~1.0.0",

test/tap/pack-files-and-ignores.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ test('default-ignored files can be explicitly included', function (t) {
484484
})
485485
)
486486
withFixture(t, fixture, function (done) {
487-
t.ok(fileExists('.git'), '.git included')
487+
t.notOk(fileExists('.git'), '.git should never be included')
488488
t.ok(fileExists('.svn'), '.svn included')
489489
t.ok(fileExists('CVS'), 'CVS included')
490490
t.ok(fileExists('.hg'), '.hg included')

test/tap/publish.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ test('npm publish --json', (t) => {
125125
name: 'publish-organized',
126126
version: '1.2.5',
127127
files: [
128-
{path: 'package.json'},
129-
{path: 'index.js'}
128+
{path: 'index.js'},
129+
{path: 'package.json'}
130130
],
131131
entryCount: 2
132132
}, 'JSON output reflects package contents')
@@ -154,8 +154,8 @@ test('npm publish --dry-run --json', (t) => {
154154
name: 'publish-organized',
155155
version: '1.2.5',
156156
files: [
157-
{path: 'package.json'},
158-
{path: 'index.js'}
157+
{path: 'index.js'},
158+
{path: 'package.json'}
159159
],
160160
entryCount: 2
161161
}, 'JSON output reflects package contents')

0 commit comments

Comments
 (0)