What folders do we recommend packages go in?
See original GitHub issueMinor decision we should have an opinion on. Start of a conversation around folder structure.
My base assumption for the package-containing folder every monorepo will have:
/packages
- has packages designed to be consumed by other packages
Some other folders that make sense to me:
/apps
- has node apps designed to be deployed/websites
- has websites designed to be deployed
Other option maybe?
/tools
or/build
- has node or bash or other scripts designed to be run in the repository, but not consumed by other packages.
NB: Assumption is you have 1 or more of these, not that every monorepo should have all 4.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Packages vs Folders – What's the Best Way to Save Your ...
Packages are self-contained Project Files. Everything you need for your Project is saved inside the Package. Which makes it easy to share.
Read more >How to Write Go Code - The Go Programming Language
Go programs are organized into packages. A package is a collection of source files in the same directory that are compiled together.
Read more >Relationship between a package statement and the directory ...
The go tool mandates that all (there are special cases, I know) your source files of a package reside in one file system...
Read more >Package vs Folder - What's the Best Way to Save Your Logic ...
**Enjoy this video on Packages vs Folders ? ... Should you save your Logic Projects as Packages or Folders ? ... Does it...
Read more >Standard Go Project Layout - GitHub
This workspace includes the top level /pkg , /bin and /src directories. Your actual project ends up being a sub-directory under /src ,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Decision:
For a design system being built alongside an app, you should put the
design system
packages inside a folderdesign-system
that mirrors the above structure (as needed) except without apackage.json
in thedesign-system
folder.I think the answer is that apps is for front-end things and services is for back-end things. That of course gets blurry with things like Keystone so I’m not totally sure if it’s the ideal way to split things but as an example, in the two client projects I referred to, there is a Next site in
/apps
and a GraphQL API in/services
.I think that because it makes sense for library monorepos, we should document it. Also, I think there is a chance that we might want it for product monorepos if there are a bunch of products so that we can have packages for a particular product(e.g.
["/products/*/app", "/products/*/packages/*"]
). (Let’s not document this now, It’s just an idea, this might be something I explore with the client project I’m about to be on a lot more)I’m happy to go with
/scripts
.Agreed.