Skip to content
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

[BUG] directories declared with "/" at end in package.json's files property aren't resolved or published #2007

Closed
VitorLuizC opened this issue Oct 21, 2020 · 2 comments
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@VitorLuizC
Copy link

VitorLuizC commented Oct 21, 2020

Current Behavior:

When "files" property in package.json contains a path of a directory with "/" at end, it doesn't resolve generated paths for directory's contents. An seems like they aren't published into npm's registry.

npm pack output
➜  brazilian-values git:(master) npm pack
npm notice 
npm notice 📦  brazilian-values@0.10.0
npm notice === Tarball Contents === 
npm notice 1.1kB  LICENSE                                    
npm notice 9.9kB  README.en.md                               
npm notice 10.7kB README.md                                  
npm notice 21.6kB dist//brazilian-values.esm.js              
npm notice 22.2kB dist//brazilian-values.js                  
npm notice 24.0kB dist//brazilian-values.umd.js              
npm notice 5.8kB  dist//brazilian-values.umd.min.js          
npm notice 108B   dist//brazilian-values.umd.min.js.map      
npm notice 22.2kB dist/brazilian-values.js                   
npm notice 1.5kB  package.json                               
npm notice 90B    types//brazilian-values.d.ts               
npm notice 365B   types//formatters/formatToBRL.d.ts         
npm notice 1.2kB  types//formatters/formatToCapitalized.d.ts 
npm notice 317B   types//formatters/formatToCEP.d.ts         
npm notice 416B   types//formatters/formatToCNPJ.d.ts        
npm notice 396B   types//formatters/formatToCPF.d.ts         
npm notice 536B   types//formatters/formatToCPFOrCNPJ.d.ts   
npm notice 335B   types//formatters/formatToDate.d.ts        
npm notice 329B   types//formatters/formatToDateTime.d.ts    
npm notice 615B   types//formatters/formatToGenericPhone.d.ts
npm notice 451B   types//formatters/formatToList.d.ts        
npm notice 400B   types//formatters/formatToNumber.d.ts      
npm notice 367B   types//formatters/formatToPhone.d.ts       
npm notice 495B   types//formatters/formatToRG.d.ts          
npm notice 811B   types//formatters/index.d.ts               
npm notice 178B   types//helpers/addPeriods.d.ts             
npm notice 178B   types//helpers/capitalizeWord.d.ts         
npm notice 388B   types//helpers/comparePiecesToDate.d.ts    
npm notice 246B   types//helpers/fillWithZeros.d.ts          
npm notice 528B   types//helpers/generateCheckSums.d.ts      
npm notice 185B   types//helpers/getRemainig.d.ts            
npm notice 178B   types//helpers/isRepeatedValue.d.ts        
npm notice 198B   types//helpers/mapToNumbers.d.ts           
npm notice 197B   types//helpers/mapToNumeric.d.ts           
npm notice 362B   types//helpers/mapToPieces.d.ts            
npm notice 210B   types//helpers/normalizeWhiteSpaces.d.ts   
npm notice 256B   types//helpers/parsePiecesToDate.d.ts      
npm notice 185B   types//helpers/splitIntoWords.d.ts         
npm notice 213B   types//helpers/splitOnLast.d.ts            
npm notice 177B   types//parsers/index.d.ts                  
npm notice 500B   types//parsers/parseToArray.d.ts           
npm notice 384B   types//parsers/parseToDate.d.ts            
npm notice 383B   types//parsers/parseToNumber.d.ts          
npm notice 335B   types//validators/index.d.ts               
npm notice 394B   types//validators/isCEP.d.ts               
npm notice 508B   types//validators/isCNPJ.d.ts              
npm notice 531B   types//validators/isCPF.d.ts               
npm notice 682B   types//validators/isCPFOrCNPJ.d.ts         
npm notice 372B   types//validators/isDate.d.ts              
npm notice 260B   types//validators/isDDD.d.ts               
npm notice 567B   types//validators/isPhone.d.ts             
npm notice === Tarball Details === 
npm notice name:          brazilian-values                        
npm notice version:       0.10.0                                  
npm notice filename:      brazilian-values-0.10.0.tgz             
npm notice package size:  20.4 kB                                 
npm notice unpacked size: 134.7 kB                                
npm notice shasum:        28f156c7e2eae54e032518d10a4e5caabd2fc20b
npm notice integrity:     sha512-gO9+Bl1qT/uF9[...]XsFCxguWAFRKw==
npm notice total files:   51                                      
npm notice 
brazilian-values-0.10.0.tgz

Expected Behavior:

When "files" property in package.json contains a path of a directory with the character with "/" at end, it should resolve generated paths for directory's contents. An published them into npm's registry like before.

npm pack output after removing "/" from directories in package.json's files array
➜  brazilian-values git:(master) ✗ npm pack
npm notice 
npm notice 📦  brazilian-values@0.10.0
npm notice === Tarball Contents === 
npm notice 1.1kB  LICENSE                                   
npm notice 9.9kB  README.en.md                              
npm notice 10.7kB README.md                                 
npm notice 21.6kB dist/brazilian-values.esm.js              
npm notice 22.2kB dist/brazilian-values.js                  
npm notice 24.0kB dist/brazilian-values.umd.js              
npm notice 5.8kB  dist/brazilian-values.umd.min.js          
npm notice 108B   dist/brazilian-values.umd.min.js.map      
npm notice 1.5kB  package.json                              
npm notice 90B    types/brazilian-values.d.ts               
npm notice 365B   types/formatters/formatToBRL.d.ts         
npm notice 1.2kB  types/formatters/formatToCapitalized.d.ts 
npm notice 317B   types/formatters/formatToCEP.d.ts         
npm notice 416B   types/formatters/formatToCNPJ.d.ts        
npm notice 396B   types/formatters/formatToCPF.d.ts         
npm notice 536B   types/formatters/formatToCPFOrCNPJ.d.ts   
npm notice 335B   types/formatters/formatToDate.d.ts        
npm notice 329B   types/formatters/formatToDateTime.d.ts    
npm notice 615B   types/formatters/formatToGenericPhone.d.ts
npm notice 451B   types/formatters/formatToList.d.ts        
npm notice 400B   types/formatters/formatToNumber.d.ts      
npm notice 367B   types/formatters/formatToPhone.d.ts       
npm notice 495B   types/formatters/formatToRG.d.ts          
npm notice 811B   types/formatters/index.d.ts               
npm notice 178B   types/helpers/addPeriods.d.ts             
npm notice 178B   types/helpers/capitalizeWord.d.ts         
npm notice 388B   types/helpers/comparePiecesToDate.d.ts    
npm notice 246B   types/helpers/fillWithZeros.d.ts          
npm notice 528B   types/helpers/generateCheckSums.d.ts      
npm notice 185B   types/helpers/getRemainig.d.ts            
npm notice 178B   types/helpers/isRepeatedValue.d.ts        
npm notice 198B   types/helpers/mapToNumbers.d.ts           
npm notice 197B   types/helpers/mapToNumeric.d.ts           
npm notice 362B   types/helpers/mapToPieces.d.ts            
npm notice 210B   types/helpers/normalizeWhiteSpaces.d.ts   
npm notice 256B   types/helpers/parsePiecesToDate.d.ts      
npm notice 185B   types/helpers/splitIntoWords.d.ts         
npm notice 213B   types/helpers/splitOnLast.d.ts            
npm notice 177B   types/parsers/index.d.ts                  
npm notice 500B   types/parsers/parseToArray.d.ts           
npm notice 384B   types/parsers/parseToDate.d.ts            
npm notice 383B   types/parsers/parseToNumber.d.ts          
npm notice 335B   types/validators/index.d.ts               
npm notice 394B   types/validators/isCEP.d.ts               
npm notice 508B   types/validators/isCNPJ.d.ts              
npm notice 531B   types/validators/isCPF.d.ts               
npm notice 682B   types/validators/isCPFOrCNPJ.d.ts         
npm notice 372B   types/validators/isDate.d.ts              
npm notice 260B   types/validators/isDDD.d.ts               
npm notice 567B   types/validators/isPhone.d.ts             
npm notice === Tarball Details === 
npm notice name:          brazilian-values                        
npm notice version:       0.10.0                                  
npm notice filename:      brazilian-values-0.10.0.tgz             
npm notice package size:  20.2 kB                                 
npm notice unpacked size: 112.5 kB                                
npm notice shasum:        eca8c68f58d1e16900c6a224e2e0b5465438c4a5
npm notice integrity:     sha512-TExlZFX4wkLoQ[...]ZmG0sbfkCSmlQ==
npm notice total files:   50                                      
npm notice 
brazilian-values-0.10.0.tgz

Steps To Reproduce:

  1. Create some files in dist/ directory.
  2. Add "dist/" in package.json's files array.
    {
      "files": ["dist/"]
    }
  3. Execute npm pack or npm publish.
    npm pack
    # Or
    npm publish
  4. The paths of dist's contents will be broken.
    Ex. types//formatters/formatToBRL.d.ts

Environment:

  • OS: Ubuntu 20.04.1 LTS (Windows 10 WSL)
  • Node: 14.14.0
  • npm: 7.0.2
@VitorLuizC VitorLuizC added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Oct 21, 2020
@VitorLuizC
Copy link
Author

Maybe related to #1873.

VitorLuizC added a commit to VitorLuizC/brazilian-values that referenced this issue Oct 21, 2020
I've removed "/" from directories in package.json's files array due to npm/cli#2007.
@isaacs
Copy link
Contributor

isaacs commented Oct 21, 2020

This will be fixed in the next v7 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

2 participants