cli icon indicating copy to clipboard operation
cli copied to clipboard

fix: use heuristics for build and deploy command as well

Open lukasholzer opened this issue 1 year ago โ€ข 1 comments

๐ŸŽ‰ Thanks for submitting a pull request! ๐ŸŽ‰

Summary

Depends on: https://github.com/netlify/build/pull/5735

Fixes https://linear.app/netlify/issue/CPLA-738/sites-created-in-the-cli-should-use-framework-detection

Run the framework detection before ntl build and ntl deploy --build as well to not need a netlify.toml in simple cases. (ntl dev already supported this)


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)

lukasholzer avatar Jun 24 '24 10:06 lukasholzer

๐Ÿ“Š Benchmark results

Comparing with e45d378ac157b878d5437ffe2166e88aeefe9815

  • Dependency count: 1,212 (no change)
  • Package size: 313 MB (no change)
  • Number of ts-expect-error directives: 977 โฌ†๏ธ 0.10% increase vs. e45d378ac157b878d5437ffe2166e88aeefe9815

github-actions[bot] avatar Jun 24 '24 10:06 github-actions[bot]

@eduardoboucas I'm going to add an integration test to it as well :)

lukasholzer avatar Jul 15 '24 10:07 lukasholzer

This is great! Should it be working for serve as well? I ask because I tried creating a new astro site and then ran ntl serve and it gave me a 404.

ascorbic avatar Jul 17 '24 06:07 ascorbic

Is there a way to overwrite or turn off this heuristic framework detection for the build and deploy commands? This new behavior breaks our current monorepo setup, because we have both Next.js and Vite based React apps in it, and the heuristic detects next as the framework, even for the Vite based React app. The dev command has an option to specify the framework, but neither build nor deploy seem to have it, if I see it correctly.

flore2003 avatar Jul 30 '24 04:07 flore2003