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

chore: add test for V2 pattern #1641

Closed eduardoboucas closed 1 year ago

eduardoboucas commented 1 year ago

Summary

Adds a test case asserting that a specific pattern is detected as a V2 function.

Closes https://github.com/netlify/pod-dev-foundations/issues/606.

github-actions[bot] commented 1 year ago

⏱ Benchmark results

Comparing with cacee3f27337b6876f19648fb4f9101fdffc85fd

largeDepsEsbuild: 1.4s

⬇️ 85.73% decrease vs. cacee3f27337b6876f19648fb4f9101fdffc85fd

^                           3.4s                                            3.4s                          
│   3.2s            3.1s    ┌──┐                                    3.1s    ┌──┐                          
│   ┌──┐            ┌──┐    |  |            3.1s                    ┌──┐    |  |                          
│   |  |            |  |    |  |            ┌──┐                    |  |    |  |                          
│   |  |            |  |    |  |            |  |    2.7s            |  |    |  |            2.7s          
│ ──┼──┼────2.5s────┼──┼────┼──┼────2.6s────┼──┼────┌──┐────2.5s────┼──┼────┼──┼────────────┌──┐──────────
│   |  |    ┌──┐    |  |    |  |    ┌──┐    |  |    |  |    ┌──┐    |  |    |  |            |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |            |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |            |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |            |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |            |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    1.5s    |  |    1.4s  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    ┌──┐  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend - T-30 (58c83442fd6e88b931c33c40309495b79560087f): 3.3s - T-29 (9efef2f12593f66a220bce9c2ce940d78b9e8229): 2.8s - T-28 (84ff0f8de591f283570b723928bb001764576c8d): 2.5s - T-27 (7eafe9537935bca0b8c3ed4f3a1f4d4e262e27e9): 2.5s - T-26 (57c38e3fee419f4b65c04e45094ed3212113ba63): 3.2s - T-25 (7898a4bbbf09989ceec19accdb835065ed0b5c25): 3.5s - T-24 (d15abd9ac2cc525bb32b97bf1d7b0c61dc6f3109): 3.5s - T-23 (efa8ddc3ce75b888d32e809617708bc9267f223b): 2.6s - T-22 (600dbf7c6f6c1d7673aeb03074f32dd21bd77a91): 3.1s - T-21 (6051e01ca1034de9382d759255df098645920fc5): 3s - T-20 (57d30ec0fe95cb5d5fcaf7a36c4cb08b192ca371): 3s - T-19 (28b658a20a8557549545e6b8ac2d1e38f52e80b7): 3.2s - T-18 (d7a0d5086725f7f390ae91ae8787869f28634744): 3.5s - T-17 (1618df80c56c91b8622992f0fd45edf4fea69962): 3.1s - T-16 (0297aa17ec1d9082450a13bac5c33840c9d1d22d): 2.7s - T-15 (3092e010ce7fc47cdd0bee843528d13291a40acf): 3.3s - T-14 (cb23207e0c520f207df84e6d6509f24eefc9680e): 3.3s - T-13 (070a7c95020e1730d327c8bb4ec69a51ef10cabc): 2.7s - T-12 (37bea386468e7aa67974eda9a1a8fbb87c8d48ec): 3.2s - T-11 (4b0f947b315ac43d126e652881467f619c323cd7): 2.5s - T-10 (a7b997238fc578a2c83b921cb2d4c1eab1f93325): 3.1s - T-9 (0381be519b6fff91a86bdcd19ac3a196a3480515): 3.4s - T-8 (af0e46cdbadd228d2cc4876e0cc861e8af14ebef): 2.6s - T-7 (b7fc0822d55c26daee4afbd7f4041ee0d034decb): 3.1s - T-6 (afaa4efdccf011d985f82719b4dc71ce7f051346): 2.7s - T-5 (390820e5a45277d4233cab6a3dae20079959421a): 2.5s - T-4 (a01ecdb7e4b348d7fa71d576ae02f918b897a2df): 3.1s - T-3 (97992ee4384e445302377c0ee35281abc8079daf): 3.4s - T-2 (d70673a431723619961dd38778d72ccadc0b0f02): 1.5s - T-1 (cacee3f27337b6876f19648fb4f9101fdffc85fd): 2.7s - **T (current commit): 1.4s**

largeDepsNft: 5.8s

⬇️ 50.72% decrease vs. cacee3f27337b6876f19648fb4f9101fdffc85fd

^                          10.7s                                           10.8s                          
│                           ┌──┐                                            ┌──┐                          
│   10s             9.8s    |  |            9.5s                    9.8s    |  |                          
│   ┌──┐            ┌──┐    |  |            ┌──┐                    ┌──┐    |  |                          
│   |  |            |  |    |  |            |  |    8.5s            |  |    |  |            8.7s          
│ ──┼──┼────────────┼──┼────┼──┼────8.1s────┼──┼────┌──┐────────────┼──┼────┼──┼────────────┌──┐──────────
│   |  |    7.6s    |  |    |  |    ┌──┐    |  |    |  |    7.4s    |  |    |  |            |  |          
│   |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    |  |            |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |            |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |            |  |    5.8s  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    5.5s    |  |    ┌──┐  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend - T-30 (58c83442fd6e88b931c33c40309495b79560087f): 11s - T-29 (9efef2f12593f66a220bce9c2ce940d78b9e8229): 8.8s - T-28 (84ff0f8de591f283570b723928bb001764576c8d): 7.7s - T-27 (7eafe9537935bca0b8c3ed4f3a1f4d4e262e27e9): 7.6s - T-26 (57c38e3fee419f4b65c04e45094ed3212113ba63): 9.8s - T-25 (7898a4bbbf09989ceec19accdb835065ed0b5c25): 10.7s - T-24 (d15abd9ac2cc525bb32b97bf1d7b0c61dc6f3109): 11.3s - T-23 (efa8ddc3ce75b888d32e809617708bc9267f223b): 7.8s - T-22 (600dbf7c6f6c1d7673aeb03074f32dd21bd77a91): 10.4s - T-21 (6051e01ca1034de9382d759255df098645920fc5): 9.4s - T-20 (57d30ec0fe95cb5d5fcaf7a36c4cb08b192ca371): 9.3s - T-19 (28b658a20a8557549545e6b8ac2d1e38f52e80b7): 10.1s - T-18 (d7a0d5086725f7f390ae91ae8787869f28634744): 11.3s - T-17 (1618df80c56c91b8622992f0fd45edf4fea69962): 10.5s - T-16 (0297aa17ec1d9082450a13bac5c33840c9d1d22d): 8.3s - T-15 (3092e010ce7fc47cdd0bee843528d13291a40acf): 11.2s - T-14 (cb23207e0c520f207df84e6d6509f24eefc9680e): 10.1s - T-13 (070a7c95020e1730d327c8bb4ec69a51ef10cabc): 8.4s - T-12 (37bea386468e7aa67974eda9a1a8fbb87c8d48ec): 10s - T-11 (4b0f947b315ac43d126e652881467f619c323cd7): 7.6s - T-10 (a7b997238fc578a2c83b921cb2d4c1eab1f93325): 9.8s - T-9 (0381be519b6fff91a86bdcd19ac3a196a3480515): 10.7s - T-8 (af0e46cdbadd228d2cc4876e0cc861e8af14ebef): 8.1s - T-7 (b7fc0822d55c26daee4afbd7f4041ee0d034decb): 9.5s - T-6 (afaa4efdccf011d985f82719b4dc71ce7f051346): 8.5s - T-5 (390820e5a45277d4233cab6a3dae20079959421a): 7.4s - T-4 (a01ecdb7e4b348d7fa71d576ae02f918b897a2df): 9.8s - T-3 (97992ee4384e445302377c0ee35281abc8079daf): 10.8s - T-2 (d70673a431723619961dd38778d72ccadc0b0f02): 5.5s - T-1 (cacee3f27337b6876f19648fb4f9101fdffc85fd): 8.7s - **T (current commit): 5.8s**

largeDepsZisi: 10.7s

⬇️ 60.23% decrease vs. cacee3f27337b6876f19648fb4f9101fdffc85fd

^                          21.1s                                           21.1s                          
│  19.7s           20.1s    ┌──┐                                    20s     ┌──┐                          
│   ┌──┐            ┌──┐    |  |           19.4s                    ┌──┐    |  |                          
│   |  |            |  |    |  |            ┌──┐                    |  |    |  |                          
│   |  |            |  |    |  |            |  |                    |  |    |  |           17.2s          
│ ──┼──┼────────────┼──┼────┼──┼───16.1s────┼──┼───16.2s────────────┼──┼────┼──┼────────────┌──┐──────────
│   |  |   15.1s    |  |    |  |    ┌──┐    |  |    ┌──┐   15.1s    |  |    |  |            |  |          
│   |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    |  |            |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |            |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |            |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |   10.4s    |  |   10.7s  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    ┌──┐  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend - T-30 (58c83442fd6e88b931c33c40309495b79560087f): 20.7s - T-29 (9efef2f12593f66a220bce9c2ce940d78b9e8229): 16.9s - T-28 (84ff0f8de591f283570b723928bb001764576c8d): 15.2s - T-27 (7eafe9537935bca0b8c3ed4f3a1f4d4e262e27e9): 15.2s - T-26 (57c38e3fee419f4b65c04e45094ed3212113ba63): 19.6s - T-25 (7898a4bbbf09989ceec19accdb835065ed0b5c25): 21.5s - T-24 (d15abd9ac2cc525bb32b97bf1d7b0c61dc6f3109): 22.1s - T-23 (efa8ddc3ce75b888d32e809617708bc9267f223b): 16s - T-22 (600dbf7c6f6c1d7673aeb03074f32dd21bd77a91): 20.6s - T-21 (6051e01ca1034de9382d759255df098645920fc5): 18.8s - T-20 (57d30ec0fe95cb5d5fcaf7a36c4cb08b192ca371): 19.2s - T-19 (28b658a20a8557549545e6b8ac2d1e38f52e80b7): 19.2s - T-18 (d7a0d5086725f7f390ae91ae8787869f28634744): 21.4s - T-17 (1618df80c56c91b8622992f0fd45edf4fea69962): 20.6s - T-16 (0297aa17ec1d9082450a13bac5c33840c9d1d22d): 16.3s - T-15 (3092e010ce7fc47cdd0bee843528d13291a40acf): 20.9s - T-14 (cb23207e0c520f207df84e6d6509f24eefc9680e): 19.9s - T-13 (070a7c95020e1730d327c8bb4ec69a51ef10cabc): 16.5s - T-12 (37bea386468e7aa67974eda9a1a8fbb87c8d48ec): 19.7s - T-11 (4b0f947b315ac43d126e652881467f619c323cd7): 15.1s - T-10 (a7b997238fc578a2c83b921cb2d4c1eab1f93325): 20.1s - T-9 (0381be519b6fff91a86bdcd19ac3a196a3480515): 21.1s - T-8 (af0e46cdbadd228d2cc4876e0cc861e8af14ebef): 16.1s - T-7 (b7fc0822d55c26daee4afbd7f4041ee0d034decb): 19.4s - T-6 (afaa4efdccf011d985f82719b4dc71ce7f051346): 16.2s - T-5 (390820e5a45277d4233cab6a3dae20079959421a): 15.1s - T-4 (a01ecdb7e4b348d7fa71d576ae02f918b897a2df): 20s - T-3 (97992ee4384e445302377c0ee35281abc8079daf): 21.1s - T-2 (d70673a431723619961dd38778d72ccadc0b0f02): 10.4s - T-1 (cacee3f27337b6876f19648fb4f9101fdffc85fd): 17.2s - **T (current commit): 10.7s**