bratislava / component-library

WIP - repo that should contain all the necessary parts of the future component library
0 stars 0 forks source link

#1 Project setup #2

Closed ValkovMirec closed 7 months ago

ValkovMirec commented 7 months ago

This pull request set up foundation for development of component library.

daksas303 commented 7 months ago

Code looks good but importing into other projects does not seem work following the guide in README, screenshot from trying to use in konto.bratislava

Screenshot 2023-11-15 at 12 06 00

Sidenote - README can contain the exact command wihtout the placeholder. I'm not sure if yalc link is enough when adding for the first time, perhaps it should be yalc add ? But honesltly I don't know, would like to learn.

Thats weird. I made slight changes for the build right now, which should allow the dependent app to see the types of our library components. Also, I changed the name from the testing one to the actual one.

I assume you have built the app first before running yalc publish? I tried it now with a clean environment and what I did was: npm run build in component library yalc push --sig after building in the component library which results in component-library-bratislava@0.0.1+2a2f9058 published in store.

Then in the dependent app, I ran yalc link component-library-bratislava which resulted in Package component-library-bratislava@0.0.1+2a2f9058 linked ==> /Users/dominik.kalamar/Documents/projects/konto.bratislava.sk/next/node_modules/component-library-bratislava

At this point, I was able to import any component from our library.

image

Maybe there was some mismatch with the build which should be now fixed, or perhaps the naming difference was the issue. Could you kindly try it again and if the issue persists we can look into it deeper to resolve what might be the issue.

Yalc link and add should be doing a similar thing for us but one or the other should be enough. The difference is that add also adds a local path to our library into package.json, which I don't believe is something we want for the testing environment.