Skip to content

Is there a way to depend on a subpackage of a monorepo via a git url? #8148

Answered by jclaveau
jclaveau asked this question in Q&A
Discussion options

You must be logged in to vote

Digging more I found a much better workaround:

  • Even if I can't find it in the docs, we can target a specific path of a git dependency version: b13d2dc
  • Using this doesn't work with monorepos as worspace:* deps are not handled but this can be handle in .pnpmfile.cjs

Here is the working result:
In a package.json

{
  "name": "...",
  "devDependencies": {
    "@directus/extensions-sdk": "github:jclaveau/directus#my_branch&path:packages/extensions-sdk",
  },
  "dependencies": {
    "@directus/errors": "github:jclaveau/directus#my_branch&path:packages/errors",
    "@directus/sdk": "github:jclaveau/directus#my_branch&path:packages/sdk",
    "//": "..."
  }
}

In .pnpmfile.cjs

const directusBranch =

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jclaveau
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant