Skip to content

Maintenance: remove test folder from packaged utilities #443

@dreamorosi

Description

@dreamorosi

Bug description

This was reported by @michaelbrewer first on Slack, then in this comment.

At the moment when we package the utilities before publishing we are including potentially unnecessary files like the content of the tests folder, example for Tracer but that applies also to the other utils:

~/Codes/aws-lambda-powertools-typescript/packages/tracing
❯ npm pack
npm notice 
npm notice 📦  @aws-lambda-powertools/[email protected]
npm notice === Tarball Contents === 
npm notice 4.4kB  README.md                                                                       
npm notice 598B   lib/config/ConfigService.d.ts                                                   
npm notice 483B   lib/config/ConfigService.d.ts.map                                               
npm notice 992B   lib/config/ConfigService.js                                                     
npm notice 297B   lib/config/ConfigServiceInterface.d.ts                                          
npm notice 359B   lib/config/ConfigServiceInterface.d.ts.map                                      
npm notice 323B   lib/config/ConfigServiceInterface.js                                            
npm notice 557B   lib/config/EnvironmentVariablesService.d.ts                                     
npm notice 545B   lib/config/EnvironmentVariablesService.d.ts.map                                 
npm notice 2.6kB  lib/config/EnvironmentVariablesService.js                                       
npm notice 157B   lib/config/index.d.ts                                                           
npm notice 181B   lib/config/index.d.ts.map                                                       
npm notice 1.0kB  lib/config/index.js                                                             
npm notice 196B   lib/helpers.d.ts                                                                
npm notice 266B   lib/helpers.d.ts.map                                                            
npm notice 571B   lib/helpers.js                                                                  
npm notice 159B   lib/index.d.ts                                                                  
npm notice 190B   lib/index.d.ts.map                                                              
npm notice 1.1kB  lib/index.js                                                                    
npm notice 1.1kB  lib/middleware/middy.d.ts                                                       
npm notice 309B   lib/middleware/middy.d.ts.map                                                   
npm notice 4.2kB  lib/middleware/middy.js                                                         
npm notice 56B    lib/packages/tracing/examples/capture-clients.d.ts                              
npm notice 138B   lib/packages/tracing/examples/capture-clients.d.ts.map                          
npm notice 3.0kB  lib/packages/tracing/examples/capture-clients.js                                
npm notice 79B    lib/packages/tracing/examples/capture-lambda-handler-error-decorator.d.ts       
npm notice 184B   lib/packages/tracing/examples/capture-lambda-handler-error-decorator.d.ts.map   
npm notice 2.7kB  lib/packages/tracing/examples/capture-lambda-handler-error-decorator.js         
npm notice 82B    lib/packages/tracing/examples/capture-lambda-handler-response-decorator.d.ts    
npm notice 190B   lib/packages/tracing/examples/capture-lambda-handler-response-decorator.d.ts.map
npm notice 2.9kB  lib/packages/tracing/examples/capture-lambda-handler-response-decorator.js      
npm notice 52B    lib/packages/tracing/examples/hello-world.d.ts                                  
npm notice 130B   lib/packages/tracing/examples/hello-world.d.ts.map                              
npm notice 2.3kB  lib/packages/tracing/examples/hello-world.js                                    
npm notice 70B    lib/packages/tracing/examples/utils/lambda/index.d.ts                           
npm notice 158B   lib/packages/tracing/examples/utils/lambda/index.d.ts.map                       
npm notice 904B   lib/packages/tracing/examples/utils/lambda/index.js                             
npm notice 163B   lib/packages/tracing/examples/utils/lambda/LambdaInterface.d.ts                 
npm notice 275B   lib/packages/tracing/examples/utils/lambda/LambdaInterface.d.ts.map             
npm notice 335B   lib/packages/tracing/examples/utils/lambda/LambdaInterface.js                   
npm notice 182B   lib/packages/tracing/examples/utils/namespaces/hello-world.d.ts                 
npm notice 289B   lib/packages/tracing/examples/utils/namespaces/hello-world.d.ts.map             
npm notice 1.3kB  lib/packages/tracing/examples/utils/namespaces/hello-world.js                   
npm notice 598B   lib/packages/tracing/src/config/ConfigService.d.ts                              
npm notice 492B   lib/packages/tracing/src/config/ConfigService.d.ts.map                          
npm notice 1.0kB  lib/packages/tracing/src/config/ConfigService.js                                
npm notice 297B   lib/packages/tracing/src/config/ConfigServiceInterface.d.ts                     
npm notice 368B   lib/packages/tracing/src/config/ConfigServiceInterface.d.ts.map                 
npm notice 335B   lib/packages/tracing/src/config/ConfigServiceInterface.js                       
npm notice 557B   lib/packages/tracing/src/config/EnvironmentVariablesService.d.ts                
npm notice 554B   lib/packages/tracing/src/config/EnvironmentVariablesService.d.ts.map            
npm notice 2.6kB  lib/packages/tracing/src/config/EnvironmentVariablesService.js                  
npm notice 157B   lib/packages/tracing/src/config/index.d.ts                                      
npm notice 190B   lib/packages/tracing/src/config/index.d.ts.map                                  
npm notice 1.0kB  lib/packages/tracing/src/config/index.js                                        
npm notice 197B   lib/packages/tracing/src/helpers.d.ts                                           
npm notice 275B   lib/packages/tracing/src/helpers.d.ts.map                                       
npm notice 583B   lib/packages/tracing/src/helpers.js                                             
npm notice 123B   lib/packages/tracing/src/index.d.ts                                             
npm notice 176B   lib/packages/tracing/src/index.d.ts.map                                         
npm notice 997B   lib/packages/tracing/src/index.js                                               
npm notice 215B   lib/packages/tracing/src/middleware/middy.d.ts                                  
npm notice 285B   lib/packages/tracing/src/middleware/middy.d.ts.map                              
npm notice 2.4kB  lib/packages/tracing/src/middleware/middy.js                                    
npm notice 114B   lib/packages/tracing/src/provider/index.d.ts                                    
npm notice 169B   lib/packages/tracing/src/provider/index.d.ts.map                                
npm notice 966B   lib/packages/tracing/src/provider/index.js                                      
npm notice 911B   lib/packages/tracing/src/provider/ProviderService.d.ts                          
npm notice 999B   lib/packages/tracing/src/provider/ProviderService.d.ts.map                      
npm notice 2.8kB  lib/packages/tracing/src/provider/ProviderService.js                            
npm notice 860B   lib/packages/tracing/src/provider/ProviderServiceInterface.d.ts                 
npm notice 1.0kB  lib/packages/tracing/src/provider/ProviderServiceInterface.d.ts.map             
npm notice 343B   lib/packages/tracing/src/provider/ProviderServiceInterface.js                   
npm notice 1.6kB  lib/packages/tracing/src/Tracer.d.ts                                            
npm notice 1.5kB  lib/packages/tracing/src/Tracer.d.ts.map                                        
npm notice 18.3kB lib/packages/tracing/src/Tracer.js                                              
npm notice 720B   lib/packages/tracing/src/TracerInterface.d.ts                                   
npm notice 847B   lib/packages/tracing/src/TracerInterface.d.ts.map                               
npm notice 303B   lib/packages/tracing/src/TracerInterface.js                                     
npm notice 58B    lib/packages/tracing/tests/helpers/populateEnvironmentVariables.d.ts            
npm notice 172B   lib/packages/tracing/tests/helpers/populateEnvironmentVariables.d.ts.map        
npm notice 1.2kB  lib/packages/tracing/tests/helpers/populateEnvironmentVariables.js              
npm notice 73B    lib/packages/tracing/tests/unit/config/EnvironmentVariablesService.test.d.ts    
npm notice 187B   lib/packages/tracing/tests/unit/config/EnvironmentVariablesService.test.d.ts.map
npm notice 9.3kB  lib/packages/tracing/tests/unit/config/EnvironmentVariablesService.test.js      
npm notice 53B    lib/packages/tracing/tests/unit/helpers.test.d.ts                               
npm notice 137B   lib/packages/tracing/tests/unit/helpers.test.d.ts.map                           
npm notice 16.8kB lib/packages/tracing/tests/unit/helpers.test.js                                 
npm notice 51B    lib/packages/tracing/tests/unit/middy.test.d.ts                                 
npm notice 133B   lib/packages/tracing/tests/unit/middy.test.d.ts.map                             
npm notice 5.1kB  lib/packages/tracing/tests/unit/middy.test.js                                   
npm notice 61B    lib/packages/tracing/tests/unit/ProviderService.test.d.ts                       
npm notice 153B   lib/packages/tracing/tests/unit/ProviderService.test.d.ts.map                   
npm notice 13.8kB lib/packages/tracing/tests/unit/ProviderService.test.js                         
npm notice 52B    lib/packages/tracing/tests/unit/Tracer.test.d.ts                                
npm notice 135B   lib/packages/tracing/tests/unit/Tracer.test.d.ts.map                            
npm notice 60.3kB lib/packages/tracing/tests/unit/Tracer.test.js                                  
npm notice 61B    lib/packages/tracing/types/index.d.ts                                           
npm notice 134B   lib/packages/tracing/types/index.d.ts.map                                       
npm notice 867B   lib/packages/tracing/types/index.js                                             
npm notice 699B   lib/packages/tracing/types/Tracer.d.ts                                          
npm notice 700B   lib/packages/tracing/types/Tracer.d.ts.map                                      
npm notice 283B   lib/packages/tracing/types/Tracer.js                                            
npm notice 114B   lib/provider/index.d.ts                                                         
npm notice 160B   lib/provider/index.d.ts.map                                                     
npm notice 954B   lib/provider/index.js                                                           
npm notice 911B   lib/provider/ProviderService.d.ts                                               
npm notice 990B   lib/provider/ProviderService.d.ts.map                                           
npm notice 2.9kB  lib/provider/ProviderService.js                                                 
npm notice 860B   lib/provider/ProviderServiceInterface.d.ts                                      
npm notice 1.0kB  lib/provider/ProviderServiceInterface.d.ts.map                                  
npm notice 331B   lib/provider/ProviderServiceInterface.js                                        
npm notice 598B   lib/src/config/ConfigService.d.ts                                               
npm notice 486B   lib/src/config/ConfigService.d.ts.map                                           
npm notice 996B   lib/src/config/ConfigService.js                                                 
npm notice 297B   lib/src/config/ConfigServiceInterface.d.ts                                      
npm notice 362B   lib/src/config/ConfigServiceInterface.d.ts.map                                  
npm notice 327B   lib/src/config/ConfigServiceInterface.js                                        
npm notice 557B   lib/src/config/EnvironmentVariablesService.d.ts                                 
npm notice 548B   lib/src/config/EnvironmentVariablesService.d.ts.map                             
npm notice 2.6kB  lib/src/config/EnvironmentVariablesService.js                                   
npm notice 157B   lib/src/config/index.d.ts                                                       
npm notice 184B   lib/src/config/index.d.ts.map                                                   
npm notice 1.0kB  lib/src/config/index.js                                                         
npm notice 196B   lib/src/helpers.d.ts                                                            
npm notice 269B   lib/src/helpers.d.ts.map                                                        
npm notice 575B   lib/src/helpers.js                                                              
npm notice 159B   lib/src/index.d.ts                                                              
npm notice 193B   lib/src/index.d.ts.map                                                          
npm notice 1.1kB  lib/src/index.js                                                                
npm notice 1.1kB  lib/src/middleware/middy.d.ts                                                   
npm notice 312B   lib/src/middleware/middy.d.ts.map                                               
npm notice 4.2kB  lib/src/middleware/middy.js                                                     
npm notice 114B   lib/src/provider/index.d.ts                                                     
npm notice 163B   lib/src/provider/index.d.ts.map                                                 
npm notice 958B   lib/src/provider/index.js                                                       
npm notice 911B   lib/src/provider/ProviderService.d.ts                                           
npm notice 993B   lib/src/provider/ProviderService.d.ts.map                                       
npm notice 2.9kB  lib/src/provider/ProviderService.js                                             
npm notice 860B   lib/src/provider/ProviderServiceInterface.d.ts                                  
npm notice 1.0kB  lib/src/provider/ProviderServiceInterface.d.ts.map                              
npm notice 335B   lib/src/provider/ProviderServiceInterface.js                                    
npm notice 17.2kB lib/src/Tracer.d.ts                                                             
npm notice 2.2kB  lib/src/Tracer.d.ts.map                                                         
npm notice 35.6kB lib/src/Tracer.js                                                               
npm notice 719B   lib/src/TracerInterface.d.ts                                                    
npm notice 841B   lib/src/TracerInterface.d.ts.map                                                
npm notice 295B   lib/src/TracerInterface.js                                                      
npm notice 61B    lib/src/types/index.d.ts                                                        
npm notice 135B   lib/src/types/index.d.ts.map                                                    
npm notice 867B   lib/src/types/index.js                                                          
npm notice 1.1kB  lib/src/types/Tracer.d.ts                                                       
npm notice 725B   lib/src/types/Tracer.d.ts.map                                                   
npm notice 283B   lib/src/types/Tracer.js                                                         
npm notice 63B    lib/tests/e2e/standardFunctions.test.d.ts                                       
npm notice 150B   lib/tests/e2e/standardFunctions.test.d.ts.map                                   
npm notice 10.3kB lib/tests/e2e/standardFunctions.test.js                                         
npm notice 246B   lib/tests/e2e/standardFunctions.test.MyFunction.d.ts                            
npm notice 326B   lib/tests/e2e/standardFunctions.test.MyFunction.d.ts.map                        
npm notice 3.9kB  lib/tests/e2e/standardFunctions.test.MyFunction.js                              
npm notice 45B    lib/tests/e2e/test.d.ts                                                         
npm notice 114B   lib/tests/e2e/test.d.ts.map                                                     
npm notice 1.6kB  lib/tests/e2e/test.js                                                           
npm notice 58B    lib/tests/helpers/populateEnvironmentVariables.d.ts                             
npm notice 166B   lib/tests/helpers/populateEnvironmentVariables.d.ts.map                         
npm notice 1.3kB  lib/tests/helpers/populateEnvironmentVariables.js                               
npm notice 131B   lib/tests/resources/contexts/hello-world.d.ts                                   
npm notice 257B   lib/tests/resources/contexts/hello-world.d.ts.map                               
npm notice 1.6kB  lib/tests/resources/contexts/hello-world.js                                     
npm notice 69B    lib/tests/resources/events/custom/hello-world.json                              
npm notice 73B    lib/tests/unit/config/EnvironmentVariablesService.test.d.ts                     
npm notice 181B   lib/tests/unit/config/EnvironmentVariablesService.test.d.ts.map                 
npm notice 9.3kB  lib/tests/unit/config/EnvironmentVariablesService.test.js                       
npm notice 53B    lib/tests/unit/helpers.test.d.ts                                                
npm notice 131B   lib/tests/unit/helpers.test.d.ts.map                                            
npm notice 16.1kB lib/tests/unit/helpers.test.js                                                  
npm notice 51B    lib/tests/unit/middy.test.d.ts                                                  
npm notice 127B   lib/tests/unit/middy.test.d.ts.map                                              
npm notice 26.9kB lib/tests/unit/middy.test.js                                                    
npm notice 61B    lib/tests/unit/ProviderService.test.d.ts                                        
npm notice 147B   lib/tests/unit/ProviderService.test.d.ts.map                                    
npm notice 13.8kB lib/tests/unit/ProviderService.test.js                                          
npm notice 52B    lib/tests/unit/Tracer.test.d.ts                                                 
npm notice 129B   lib/tests/unit/Tracer.test.d.ts.map                                             
npm notice 79.3kB lib/tests/unit/Tracer.test.js                                                   
npm notice 17.2kB lib/Tracer.d.ts                                                                 
npm notice 2.2kB  lib/Tracer.d.ts.map                                                             
npm notice 35.6kB lib/Tracer.js                                                                   
npm notice 719B   lib/TracerInterface.d.ts                                                        
npm notice 838B   lib/TracerInterface.d.ts.map                                                    
npm notice 291B   lib/TracerInterface.js                                                          
npm notice 61B    lib/types/index.d.ts                                                            
npm notice 132B   lib/types/index.d.ts.map                                                        
npm notice 863B   lib/types/index.js                                                              
npm notice 1.2kB  lib/types/Tracer.d.ts                                                           
npm notice 775B   lib/types/Tracer.d.ts.map                                                       
npm notice 279B   lib/types/Tracer.js                                                             
npm notice 2.2kB  package.json                                                                    
npm notice === Tarball Details === 
npm notice name:          @aws-lambda-powertools/tracer           
npm notice version:       0.2.0                                   
npm notice filename:      @aws-lambda-powertools/tracer-0.2.0.tgz 
npm notice package size:  70.1 kB                                 
npm notice unpacked size: 513.2 kB                                
npm notice shasum:        0f5758f7b4f377ea192dfb76dbe9b4e29fa5007f
npm notice integrity:     sha512-fhFsEmwzMgT2l[...]MB4bJH43dZi9w==
npm notice total files:   198                                     
npm notice 
aws-lambda-powertools-tracer-0.2.0.tgz

Expected Behavior

Packaged utility shouldn't have tests shipped.

Current Behavior

tests folder is included in the packaged tarball.

Possible Solution

Possibly modify bundling configs & apply it to all packages.

Steps to Reproduce

  1. Run npm pack in any of the utilities packages/tracer, etc.
  2. Observe output to see what files are included.

Environment

  • Powertools version used: <=0.2.0
  • Packaging format (Layers, npm): N/A
  • AWS Lambda function runtime: N/A
  • Debugging logs: N/A

Related issues, RFCs

#419

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippeddependenciesChanges that touch dependencies, e.g. Dependabot, etc.internalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions