Giter VIP home page Giter VIP logo

Hollowverse Monorepo

This is a monorepo using npm workspaces. The workspaces are main-site, cms, and shared.

main-site

This is the code for the main website, hollowverse.com. It is a Next.js project.

cms

This is the code for the content management system, cms.hollowverse.com. It is a Sanity Studio project.

shared

This code is shared among the projects above.

How does code sharing work

After npm install, virtual copies of the shared folder get created inside main-site and cms. Meaning, you'll have main-site/shared, cms/shared, and the root shared. Any changes in any one of these is reflected in the other folders.

This is done by way of symlinking.

We do this because it's the most convenient way we know to share code between a Next.js project and Sanity Studio project in the same repo.

Notes about code sharing

  1. The original directory, shared, is added to the ignore list of VS Code. So you won't see it. But the symlinked versions are visible, main-site/shared and cms/shared. If you want to expose the root shared, edit .vscode/settings.json.
  2. The root package.json and shared/package.json should not have any dependencies because no npm install is run within these folders. Any dependencies that the shared code needs have to exist in both main-site/package.json and cms/package.json. That way, when shared is copied into those projects, the dependencies will be ready for it to consume.
  3. Files inside shared can only import from files also inside shared, nothing from outside. Import paths inside shared have to be relative.

Hollowverse's Projects

cms icon cms

CMS for Hollowverse

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.