react-workspaces / react-workspaces-playground

⚛️ 🐈 Zero Config Create-React-App Monorepos with Yarn Workspaces, Lerna and React Storybook.
https://react-workspaces.github.io/react-workspaces-playground/
764 stars 128 forks source link

How to create new component library? #7

Closed stclairdaniel closed 5 years ago

stclairdaniel commented 5 years ago

I figured it would be as simple as making another directory inside of packages, say componentsTwo, adding it to the root package.json under workspace/packages and then add it to the application package.json like "@project/componentsTwo": "*", but I get an error when trying to yarn install - error Couldn't find package "@project/helpers@*" required by "my-app" on the "npm" registry.

Is this some silly user error?

mpress commented 5 years ago

It needs to be another Create React App - so from the root run yarn create react-app packages /componentsTwo and you should be able to reference them from your apps.

F1LT3R commented 5 years ago

@stclairdaniel did you run yarn after updating your Workspaces?

stclairdaniel commented 5 years ago

I'm sorry, I should have commented earlier. I did not have a package.json in the second library - I thought some exported components and an index.js was sufficient. Thanks :)