This repository has been archived by the owner on Oct 10, 2022. It is now read-only.
Add JS workspaces information #8
Labels
init/monorepo-support
proj/yarn-workspaces-caching
theme/js-dependency-mgmt
theme/monorepos
type: feature
code contributing to the implementation of a feature and/or user facing functionality
As a follow up for the discussion started in - netlify/build-image#526 - with netlify/build-image#526 (comment) CC @verythorough. Just wanted to capture it so that it doesn't get lost in the GitHub void 😄
Which problem is this feature request solving?
JS workspaces have become the de facto way to manage JS monorepo projects. For reference see:
As per @verythorough's comment, It could be instersting for our
framework-info
to pickup this information and convey it to our remaining systems.Describe the solution you'd like
npm 7
makes use of the sameworksapces
field in thepackage.json
asyarn
did so far. This makes thepackage.json
as the source of truth for this case, and I believe it makes sense for us to use that directly instead of relying in anycli
to do so.However, this isn't a trivial problem to solve. To illustrate it, consider the following project tree:
Usually
framework-info
is called with a project directory, for the case above it would be eitherproject-1
orproject-2
. For us to have access to the workspace info, we would also need to provide the root directory of the project (if there's one or if it's different from thebase
directory) in order to access the rootpackage.json
and extract the required information. This would requireframework-info
to be able to receive that information and also to make tools such as thecli
andbuildbot
to send the root directory of the project (something I believenetlify/config
is already providing?)Describe alternatives you've considered
Relying on cli's such as
yarn
to extract such data (e.g. https://github.com/netlify/build-image/pull/526/files#diff-6ad81dc23c4c92a6e6193db3b05e306293aa75ee25d48ae952c6259c601e8b23R115)The text was updated successfully, but these errors were encountered: