isaacs/npm — Issue #2144: .npmignore problem: it is picking up *some* files under an ignored dir
Author: trentm
Created: 2012-02-10 22:22:38+00:00
State: open

- module: bunyan
- repo: https://github.com/trentm/node-bunyan

```
[trentm@banana:~/tm/node-bunyan]$ npm unpublish bunyan@0.6.2
npm http GET https://registry.npmjs.org/bunyan
npm http 304 https://registry.npmjs.org/bunyan
- bunyan@0.6.2

[trentm@banana:~/tm/node-bunyan]$ cat .gitignore
/tmp
/npm-debug.log
/node_modules
*.log

[trentm@banana:~/tm/node-bunyan]$ cat .npmignore
/tmp

[trentm@banana:~/tm/node-bunyan]$ ls -alF tmp
total 1440
drwxr-xr-x 8 trentm staff 272B Feb 10 14:04 ./
drwxr-xr-x 20 trentm staff 680B Feb 10 13:59 ../
drwxr-xr-x 5 trentm staff 170B Feb 10 13:53 build/
-rw-r--r-- 1 trentm staff 363B Feb 3 23:34 error.log
-rw-r--r-- 1 trentm staff 329B Feb 6 23:16 notes.txt
drwxr-xr-x 20 trentm staff 680B Feb 6 23:11 pycairo-1.10.0/
-rw-r--r-- 1 trentm staff 241K Apr 18 2011 pycairo-1.10.0.tar.bz2
-rw-r--r-- 1 trentm staff 465K Aug 26 2009 pycairo-1.8.8.tar.gz

[trentm@banana:~/tm/node-bunyan]$ npm --loglevel=silly publish > publish.log 2>&1
```

That "publish.log": https://gist.github.com/1793437#file_publish.log

No "package.json" files under "tmp/" so this isn't issue #1097:

```
[trentm@banana:~/tm/node-bunyan]$ find tmp -name package.json
[trentm@banana:~/tm/node-bunyan]$
```

Download the published package to take a look:

```
[trentm@banana:~/tmp/checkpublish]$ wget http://registry.npmjs.org/bunyan/-/bunyan-0.6.2.tgz
--2012-02-10 14:15:55-- http://registry.npmjs.org/bunyan/-/bunyan-0.6.2.tgz
Resolving registry.npmjs.org... 107.20.159.167
Connecting to registry.npmjs.org|107.20.159.167|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 670767 (655K) [application/octet-stream]
Saving to: `bunyan-0.6.2.tgz'

100%[======================================>] 670,767 254K/s in 2.6s

2012-02-10 14:15:58 (254 KB/s) - `bunyan-0.6.2.tgz' saved [670767/670767]

[trentm@banana:~/tmp/checkpublish]$ tar xf bunyan-0.6.2.tgz
[trentm@banana:~/tmp/checkpublish]$ ls -alF package/tmp
total 0
drwxr-xr-x 4 trentm staff 136B Feb 10 14:09 ./
drwxr-xr-x 17 trentm staff 578B Feb 10 14:16 ../
drwxr-xr-x 3 trentm staff 102B Feb 10 14:09 build/
drwxr-xr-x 7 trentm staff 238B Feb 10 14:09 pycairo-1.10.0/
```

*Some* of the content under "tmp/" is included. Furthermore, it is only *some* of the files under those directories:

in original "tmp/": https://gist.github.com/1793437#file_tmp+files+in+original
in "tmp/" in published package: https://gist.github.com/1793437#file_tmp+files+in+published+package

From what I could see there isn't any info in the silly-log about how and what "ignore"'ing is being done.

Ideas what is going on here? Is this just a bug with "$ignoredDir/**/.blah", i.e. *dot*-files and dirs under and otherwise meant-to-be-ignored dir?