Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

feat: expose entryFilename #1472

Merged
merged 3 commits into from
Jun 23, 2023
Merged

feat: expose entryFilename #1472

merged 3 commits into from
Jun 23, 2023

Conversation

Skn0tt
Copy link
Contributor

@Skn0tt Skn0tt commented Jun 23, 2023

🎉 Thanks for submitting a pull request! 🎉

Summary

As proposed by @eduardoboucas in netlify/cli#5804 (comment), this PR exposes the entryFilename for usage from the CLI.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻.
    This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing
    a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@Skn0tt Skn0tt requested a review from a team as a code owner June 23, 2023 07:41
@Skn0tt Skn0tt self-assigned this Jun 23, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2023

⏱ Benchmark results

Comparing with c079d56

largeDepsEsbuild: 2.4s

⬇️ 22.81% decrease vs. c079d56

^                                                                                   3.6s                  
│                                                                                   ┌──┐                  
│                                                                           3.2s    |  |                  
│                            3s                                             ┌──┐    |  |     3s           
│                           ┌──┐    2.8s                                    |  |    |  |    ┌──┐          
│ ──────────────────────────┼──┼────┌──┐────2.7s────────────────────2.6s────┼──┼────┼──┼────┼──┼──────────
│   2.6s    2.6s    2.5s    |  |    |  |    ┌──┐    2.4s    2.5s    ┌──┐    |  |    |  |    |  |    2.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

largeDepsNft: 7.8s

⬇️ 22.65% decrease vs. c079d56

^                                                                                  11.7s                  
│                                                                                   ┌──┐                  
│                                                                          10.6s    |  |                  
│                                                                           ┌──┐    |  |                  
│                           9.6s                                            |  |    |  |    9.5s          
│                           ┌──┐    8.8s    8.9s                            |  |    |  |    ┌──┐          
│ ───8s─────8.1s────8.1s────┼──┼────┌──┐────┌──┐────────────────────8.4s────┼──┼────┼──┼────┼──┼──────────
│   ┌──┐    ┌──┐    ┌──┐    |  |    |  |    |  |    7.7s    7.6s    ┌──┐    |  |    |  |    |  |    7.8s  
│   |  |    |  |    |  |    |  |    |  |    |  |    ┌──┐    ┌──┐    |  |    |  |    |  |    |  |    ┌──┐  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    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

largeDepsZisi: 14.5s

⬇️ 31.77% decrease vs. c079d56

^                                                                                  22.5s                  
│                                                                                   ┌──┐                  
│                                                                                   |  |                  
│                          18.7s                                           18.8s    |  |   19.1s          
│                           ┌──┐   17.8s                                    ┌──┐    |  |    ┌──┐          
│                           |  |    ┌──┐   16.5s                            |  |    |  |    |  |          
│ ──16s─────16s────16.2s────┼──┼────┼──┼────┌──┐───────────────────15.6s────┼──┼────┼──┼────┼──┼──────────
│   ┌──┐    ┌──┐    ┌──┐    |  |    |  |    |  |   14.8s   14.9s    ┌──┐    |  |    |  |    |  |   14.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

@@ -54,6 +54,7 @@ export interface ZipFunctionResult {
nodeModulesWithDynamicImports?: string[]
path: string
runtimeVersion?: string
entryFilename?: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should always be able to populate entryFilename. It should be either ___netlify-entry-point.mjs or <func name>.js. If we always populate it, I think consuming this in the CLI will be easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. done in 9e25e9a. I'm unsure about the entryFilename for Go and Rust functions - my assumption is that we output an executable binary, so I set entryFilename to "" - that way, join(path, entryFilename) will always point to the right file, independent of runtime.

Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@Skn0tt Skn0tt merged commit 0477b3e into main Jun 23, 2023
@Skn0tt Skn0tt deleted the expose-entryfilename branch June 23, 2023 09:37
Skn0tt added a commit to netlify/build that referenced this pull request May 21, 2024
* feat: expose entryFilename

* fix: always populate entryFilename

* fix: tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants