File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,7 @@ class PackWalker extends IgnoreWalker {
298298 '!/package.json' ,
299299 '/.git' ,
300300 '/node_modules' ,
301+ '.npmrc' ,
301302 '/package-lock.json' ,
302303 '/yarn.lock' ,
303304 '/pnpm-lock.yaml' ,
Original file line number Diff line number Diff line change @@ -4,9 +4,45 @@ const Arborist = require('@npmcli/arborist')
44const t = require ( 'tap' )
55const packlist = require ( '../' )
66
7+ t . test ( 'exclude certain files always' , async t => {
8+ const path = t . testdir ( {
9+ '.npmrc' : 'secrets=true' ,
10+ '.git' : {
11+ HEAD : 'empty' ,
12+ } ,
13+ node_modules : {
14+ foo : {
15+ 'index.js' : '' ,
16+ } ,
17+ } ,
18+ subdir : {
19+ 'other.js' : '' ,
20+ '.npmrc' : 'sneaky=true' ,
21+ } ,
22+ 'index.js' : '' ,
23+ 'glorp.txt' : '' ,
24+ 'package.json' : JSON . stringify ( {
25+ name : '@npmcli/globstar-test' ,
26+ version : '1.0.0' ,
27+ files : [ '*' ] ,
28+ } ) ,
29+ 'package-lock.json' : '{}' ,
30+ 'yarn.lock' : '{}' ,
31+ 'pnpm-lock.yaml' : '{}' ,
32+ } )
33+ const arborist = new Arborist ( { path } )
34+ const tree = await arborist . loadActual ( )
35+ const files = await packlist ( tree )
36+ t . same ( files , [
37+ 'index.js' ,
38+ 'subdir/other.js' ,
39+ 'package.json' ,
40+ 'glorp.txt' ,
41+ ] )
42+ } )
43+
744t . test ( 'include a globstar, then exclude one of them' , async ( t ) => {
845 const path = t . testdir ( {
9- 'foo.js' : '' ,
1046 'bar.js' : '' ,
1147 bar : {
1248 'bar.js' : '' ,
You can’t perform that action at this time.
0 commit comments