Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

More flexible workspace detection #121

Merged
merged 3 commits into from
Sep 9, 2024
Merged

More flexible workspace detection #121

merged 3 commits into from
Sep 9, 2024

Conversation

theoephraim
Copy link
Member

Previously we relied completely on (js) package managers to get the workspace package/project globs, for example pnpm-workspace.yaml (pnpm) or the workspaces key in package.json files (npm, yarn, bun).

This creates problems in a monorepo that is not only using one of these package manager or using it to manage the monorepo. For example, one can imagine a monorepo that has several child "monorepos" managed by pnpm within it, or a polyglot case where there is no central package manager handling everything.

Now instead we will walk up from the current directory to the git root (if applicable), and if we ever find a .dmno/dmno-workspace.yaml file, it will be considered the root and override everything else. Otherwise we'll rely on the js package managers, or fallback to the git root if nothing else is found.

Copy link

changeset-bot bot commented Aug 14, 2024

🦋 Changeset detected

Latest commit: 1a4cd5d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
dmno Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the maintainer Created by an official project maintainer label Aug 14, 2024
Copy link

netlify bot commented Aug 14, 2024

Deploy Preview for #-api canceled.

Name Link
🔨 Latest commit 1a4cd5d
🔍 Latest deploy log https://app.netlify.com/sites/#-api/deploys/66bce0c8ca254e0008d19b83

Copy link

netlify bot commented Aug 14, 2024

Deploy Preview for dmno ready!

Name Link
🔨 Latest commit 1a4cd5d
🔍 Latest deploy log https://app.netlify.com/sites/dmno/deploys/66bce0c879b9280008e6b74c
😎 Deploy Preview https://deploy-preview-121--dmno.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -0,0 +1,3 @@
projects:
Copy link
Member Author

Choose a reason for hiding this comment

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

not sure about this name...

  • "packages" feels a bit too javascript-y
  • "services" is our current nomenclature, although technically here we are saying where folders are that might be dmno services, they still need a .dmno folder to be considered a dmno service
  • "workspaces" (npm, bun) is just confusing
  • "projects" (moonrepo) feels fairly reasonable in a polyglot world

We could replace the term "service" with "project" everywhere?

@@ -0,0 +1,3 @@
projects:
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that our example repo now needs this file, since otherwise we keep scanning upwards and find the root pnpm-workspace.yaml file. While I hadn't planned on that, it makes sense and is more explicit.

Copy link

pkg-pr-new bot commented Aug 14, 2024

commit: 1a4cd5d

pnpm add https://pkg.pr.new/dmno@121

Open in Stackblitz

@theoephraim theoephraim merged commit 0bb9f81 into main Sep 9, 2024
12 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
maintainer Created by an official project maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant