OriginProtocol / origin

Monorepo for our developer tools and decentralized marketplace application
https://www.originprotocol.com/developers
MIT License
652 stars 196 forks source link

Monorepo directory structure #1624

Closed tomlinton closed 5 years ago

tomlinton commented 5 years ago

Following on from a bit of a discussion we had in Discord:

Monorepos like react and babel typically put all their packages in a packages/ dir. This makes management via lerna easy because you can just define your packages as packages/** in lerna.json and it makes things look nice.

Our setup is a little tricky because we have both packages we want to publish to npm and packages we don't, so it might makes sense to have directories other than packages/.

We also may want to remove the origin- prefixes from all the package names although I noticed react and babel keep them.

@nick came up with a proposal here with separate directories for backend (stuff we run), packages (stuff that gets published to npm) and dapps. Here is what it looks like without the prefixes and a few tweaks. Here is another variant where the root names all get prefixed with packages- to make it clear that everything in those directories is a js package.

nick commented 5 years ago

I prefer without the packages- prefix. I like calling the main dapp marketplace.

So the root and sub-dirs would look something like this

nick commented 5 years ago

Could we combine deployment and development into devops?

tomlinton commented 5 years ago

Looks nice, and yep we can do that.

nick commented 5 years ago

Pasting the proposal here so it's easy to see:

dapps
devops
docs
infra
mobile
packages
scripts
CONTRIBUTING.md
DEVELOPMENT.md
Dockerfile
LICENSE
README.md
TESTING.md
crowdin.yml
docker-compose.test.yml
docker-compose.yml
lerna.json
package.json

dapps
  admin
  graphql-simple-demo
  marketplace

infra
  bridge
  cron
  dapp-creator-client
  dapp-creator-server
  discovery
  faucet
  growth
  identity
  ipfs-proxy
  linking
  messaging
  notifications
  tests
  token-transfer
  token-transfer-client
  token-transfer-server

packages
  contracts
  eventsource
  graphql
  ipfs
  linker-client
  messaging-client
  origin-js
  services
  token
  validator
franckc commented 5 years ago

How about we discuss this during eng weekly tomorrow if time permits ? I added it to the agenda.

franckc commented 5 years ago

haha. @tomlinton already added it to the agenda. I'm always a step behind...