Skip to content

uib-ub/uib-ub-monorepo

Repository files navigation

UiB-UB Monorepo

This is a monorepo containing the web sites, APIs, and related packages created by UiB-UB.

What's inside?

This Turborepo uses npm as a packages manager. It contains Next.js v13, Nuxt v3, and Sanity Studio v3.

It includes the following packages/apps:

Apps

  • api: the API for the Special collection at the University of Bergen Library, a Next.js app
  • chc-web: the WIP Marcus website, a Next.js app and a Sanity Studio.
  • chc-exh-nt-web: the exhibition More than the humanitarian gaze, a Next.js app with a Sanity Studio.
  • docs: the documentation site, a Nextra app
  • link-shortener: WIP, a url redirect service with QR, a Next.js app
  • sps-termportal-web: Termportalen.no, a Nuxt.js app
  • sps-termportal-admin: termportalen-admin.vercel.app, a Nuxt.js app

Packages

  • eslint-preset-custom: ESLint preset
  • tailwind-config: shared tailwindcss config
  • tailwind-ui: React components with Tailwind CSS.
  • termportal-ui: Vue components with Tailwind CSS
  • tsconfig: shared tsconfig.jsons used throughout the monorepo
  • utils: shared utility functions

Each package/app is aims to react 100% TypeScript.

Utilities

This Turborepo has some additional tools already setup for you:

Setup

git clone ...
cd uib-ub-monorepo

Build

To build all apps and packages, run the following command:

npm run build

Develop

To develop all apps and packages, run the following command:

npm run dev

Useful commands

Examples here use npm, but this is easy to fudge up. Do not install packages directly in the apps or packages folders. Use the commands below. See Turborepo docs for more info.

  • npm install
  • npm install – Add package to root (mainly for devDependencies)
  • npm install --workspace=
  • npm install -w
  • npm uninstall --workspace=
  • npm update --workspace=
  • npm run build - Build all packages and apps
  • npm run dev - Develop all packages and apps
  • npm run lint - Lint all packages
  • npm run changeset - Generate a changeset
  • npm run clean - Clean up all node_modules and dist folders (runs each package's clean script)

Remote Caching

Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:

npx turbo login

This will authenticate the Turborepo CLI with your Vercel account.

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo:

npx turbo link

Useful Links

Learn more about the power of Turborepo: