Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Role of Examples and Packages folders, #76

Closed
cloudcompute opened this issue Jun 22, 2021 · 3 comments
Closed

Question: Role of Examples and Packages folders, #76

cloudcompute opened this issue Jun 22, 2021 · 3 comments

Comments

@cloudcompute
Copy link

cloudcompute commented Jun 22, 2021

I do not know much about lerna. But I have seen that the packages directory typically consists of sub-directories whose names are something like: frontend (or web), backend (or api), shared.)

Could you pl. answer these:

a. What exactly is the role of foo, bar, and components directories residing in the packages directory.
b. Why do the cra and nest appear in the examples directory.

Thanks

@cloudcompute cloudcompute changed the title Question: Examples Question: Role of Examples and Packages folders, Jun 22, 2021
@NiGhTTraX
Copy link
Owner

Hey @Ramandhingra, packages is conventionally the folder that keeps all of the different projects inside a monorepo. You can have more than one such folder and the names are for you to choose and configure through pkg.workspaces.

In this repo, I have 2 folders, packages and examples. packages contain simpler projects that don't depend on any framework, and are meant to illustrate publishing to npm from within a monorepo. examples contain projects that use a framework and need a bit of config to work inside a monorepo. In a typical repo you could have all of them inside 1 folder, but here I wanted a clear separation between them for educational purposes.

TL;DR: the folders only mean something if you want them to mean something. Putting everything in one place is perfectly fine.

Hope that answers your question!

@cloudcompute
Copy link
Author

cloudcompute commented Jun 23, 2021

Hi @NiGhTTraX
Great. The answer is perfect. Thanks.

In lerna.json, I have seen that you are using yarn/workspaces. But I do not want 'yarn' at all in my project. The npm v7 has started implementing the concept of 'workspaces'. So if I replace 'yarn' with 'npm workspaces' (example below) will it work fine.

This project is using the npm workspaces and a bit of lerna.

In other words, what changes do I need to make in your project that supports 'npm' (and not yarn at all)

@NiGhTTraX
Copy link
Owner

@Ramandhingra the npm branch is set up with npm 7 :) The only difference is switching yarn for npm in commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants