1

I have a fork of the expo monorepo that has changes in only one of the sub-packages (e.g. expo-speech). I want to import only that sub-package in my application. Given these parameters:

  • GitHub organization: my-org
  • Repo: expo
  • Branch: main
  • Sub-package: expo-speech
  • Sub-directory: packages/expo-speech

how would I add this package to my application using yarn?

Commands I have tried:

# with yarn 1.22.19
yarn add expo-speech@my-org/expo#workspace=expo-speech # fails with git error: "Could not read from remote repository."
yarn add expo-speech@my-org/expo#workspace=packages/expo-speech # fails with git error: "Could not read from remote repository."
yarn add expo-speech@my-org/expo#workspace=packages/@expo/expo-speech # fails with git error: "Could not read from remote repository."

# using https://gitpkg.vercel.app/
yarn add 'https://gitpkg.now.sh/my-org/expo/expo-speech?main' # fails with 500 or 504, no message

# with yarn 3.3.1
yarn add expo-speech@my-org/expo#workspace=expo-speech # never finishes
yarn add expo-speech@my-org/expo#workspace=packages/expo-speech # never finishes
yarn add expo-speech@my-org/expo#workspace=packages/@expo/expo-speech # never finishes

Most of the attempts above are from this GitHub comment. I can find very little about importing from sub-directories or yarn workspaces of monorepos.

gabe
  • 1,873
  • 2
  • 20
  • 36

1 Answers1

0

Based on the following comment from github this should solve your issue with yarn v3:

yarn add expo-speech@https://gitpkg.now.sh/api/pkg.tgz?url=my-org%2expo%2Fpackages%2Fexpo-speech&commit=main

Original comment: https://github.com/EqualMa/gitpkg/issues/22#issuecomment-834171060

Mike
  • 738
  • 8
  • 12