cli
cli copied to clipboard
fix: use heuristics for build and deploy command as well
๐ 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)
๐ 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
@eduardoboucas I'm going to add an integration test to it as well :)
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.
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.