netlify / zip-it-and-ship-it

Intelligently prepare Node.js Lambda functions for deployment
https://www.npmjs.com/package/@netlify/zip-it-and-ship-it
MIT License
316 stars 35 forks source link

fix: parse `config` as JSON #1562

Closed Skn0tt closed 1 year ago

Skn0tt commented 1 year ago

Before this PR, the --config option was parsed as a string, and wasn't picked up correctly. This PR fixes that.

You can verify this by running node dist/bin.js functions dist --config '{ "*": { "nodeBundler": "nft" } }' before and after this PR.

github-actions[bot] commented 1 year ago

⏱ Benchmark results

Comparing with 0c76ba5d3ebfd00ce70b3bfd382bed28a6885017

largeDepsEsbuild: 2.9s

⬆️ 8.23% increase vs. 0c76ba5d3ebfd00ce70b3bfd382bed28a6885017

^                           3.5s                          
│                           ┌──┐                          
│                           |  |                          
│                           |  |                          
│           2.7s            |  |    2.8s            2.9s  
│ ──2.6s────┌──┐────2.7s────┼──┼────┌──┐────2.6s────┌──┐──
│   ┌──┐    |  |    ┌──┐    |  |    |  |    ┌──┐    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend - T-6 (38cde6efec37b5d60593c15810f756da8b5177e6): 2.6s - T-5 (2211f39741e1088a7c9cde0af57c9bc27108c606): 2.7s - T-4 (54b79e3c973805ed06c5ec4bc0259a122a880913): 2.7s - T-3 (87886247aa8acabd74cf76f13c3465a22bf63078): 3.5s - T-2 (27155874fa16fb54d0c00f71d1e98e2e856642c4): 2.8s - T-1 (0c76ba5d3ebfd00ce70b3bfd382bed28a6885017): 2.6s - **T (current commit): 2.9s**

largeDepsNft: 9.2s

⬆️ 9.96% increase vs. 0c76ba5d3ebfd00ce70b3bfd382bed28a6885017

^                          11.2s                          
│                           ┌──┐                          
│                           |  |                          
│                           |  |                          
│                           |  |    8.7s            9.2s  
│ ──8.2s────8.4s────8.4s────┼──┼────┌──┐────8.2s────┌──┐──
│   ┌──┐    ┌──┐    ┌──┐    |  |    |  |    ┌──┐    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend - T-6 (38cde6efec37b5d60593c15810f756da8b5177e6): 8.2s - T-5 (2211f39741e1088a7c9cde0af57c9bc27108c606): 8.4s - T-4 (54b79e3c973805ed06c5ec4bc0259a122a880913): 8.4s - T-3 (87886247aa8acabd74cf76f13c3465a22bf63078): 11.2s - T-2 (27155874fa16fb54d0c00f71d1e98e2e856642c4): 8.7s - T-1 (0c76ba5d3ebfd00ce70b3bfd382bed28a6885017): 8.2s - **T (current commit): 9.2s**

largeDepsZisi: 17.3s

⬆️ 6.76% increase vs. 0c76ba5d3ebfd00ce70b3bfd382bed28a6885017

^                           21s                           
│                           ┌──┐                          
│                           |  |                          
│                           |  |                   17.3s  
│                  16.4s    |  |   16.9s            ┌──┐  
│ ─15.8s───15.6s────┌──┐────┼──┼────┌──┐───16.2s────|▒▒|──
│   ┌──┐    ┌──┐    |  |    |  |    |  |    ┌──┐    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend - T-6 (38cde6efec37b5d60593c15810f756da8b5177e6): 15.8s - T-5 (2211f39741e1088a7c9cde0af57c9bc27108c606): 15.6s - T-4 (54b79e3c973805ed06c5ec4bc0259a122a880913): 16.4s - T-3 (87886247aa8acabd74cf76f13c3465a22bf63078): 21s - T-2 (27155874fa16fb54d0c00f71d1e98e2e856642c4): 16.9s - T-1 (0c76ba5d3ebfd00ce70b3bfd382bed28a6885017): 16.2s - **T (current commit): 17.3s**