Retrieve build and dev server settings from build-info
Closed this issue · 0 comments
Currently, we can perform the framework detection independently from the build system detection. We use the build system detection only for data-gathering purposes.
Currently, when we perform the build-info framework detection on a monorepo, for example, Nx
or turborepo
or even npm/yarn/pnpm workspaces
we only know which framework is installed in which package.
This results in having wrong or poor commands inside the CLI as we can only detect a framework run command like vue-cli-service serve
.
nx serve
is wrong as it always serves the default applications specified inside the nx.json
instead it should have specific commands for each application
The correct commands would be nx run my-app:serve
or turbo run build --scope docs
and for workspaces like pnpm run build --filter @evilcorp/blog
.
The Goal
The goal is to have the build info exposing so-called build settings that can be consumed by the react-ui – see issue https://github.com/netlify/netlify-react-ui/issues/15349 and inside the CLI when it comes to suggesting the correct build settings for the dev command if nothing is configured inside the netlify.toml
.
Furthermore, good detection is needed to know which core plugins to install like the next.js runtime.
To accomplish that, we should provide a function in @netlify/build-info
that does that by leveraging the parts of the detection and checking if a build system has a dev or build command.