pleb icon indicating copy to clipboard operation
pleb copied to clipboard

pleb doesn't support monorepos with nested package structure

Open RomanYar opened this issue 2 years ago • 4 comments

We tried implementing pleb for publishing our packages, and we saw that in our structure, which is not a flat packages structure, pleb fails locating the packages.

steps to reproduce:

git clone [email protected]:wixplosives/sample-monorepo.git ./test-pleb
cd test-pleb
# now we need to change the root package.json's workspaces field to "packages/**/*".
# after done that: 
rm -rf packages
mkdir -p packages/test/test-package
cd packages/test/test-package
npm init -y
echo "console.log('hello world')">index.js

# this will locate that the package was never published
npx pleb publish --dry-run
cd ../../../

# this will not find the package
npx pleb publish --dry-run

RomanYar avatar Nov 08 '22 11:11 RomanYar

Need to update the workspaces field in root package.json?

AviVahl avatar Nov 08 '22 12:11 AviVahl

no sure it's a mandatory step, I am not sure on how pleb locates the packages in the repo

RomanYar avatar Nov 08 '22 13:11 RomanYar

It looks the packages up using the "workspaces" field, just like npm or yarn would. It needs to point to the packages.

AviVahl avatar Nov 08 '22 17:11 AviVahl

oh, just noticed the comment saying packages/**/*. that worked on npm/yarn, but not pleb?

AviVahl avatar Nov 08 '22 20:11 AviVahl