Local Package Linking

Link Cubitt packages locally to other projects like Mobius for development.

This guide explains how to develop Cubitt Components locally (inside the Cubitt monorepo) while having Mobius automatically use your local changes.

Cubitt uses Bun while Mobius uses pnpm. Since each package manager has its own link registry, we use path-based overrides instead of link commands.

Instructions

Add override in Mobius

Add a pnpm override to the Mobius root package.json:

package.json
{
  "pnpm": {
    "overrides": {
      "@tilt-legal/cubitt-components": "link:../cubitt/packages/components"
    }
  }
}

Then install:

Mobius repo
cd ~/tilt-legal/mobius
pnpm install

This override forces every package in Mobius to use your local Cubitt Components package, even if they reference it via catalog:.

Enable live updates

Cubitt exports TypeScript source files during development. To get live updates without rebuilding, add Cubitt to the transpilePackages array in Mobius's Next.js config:

apps/app/next.config.ts
const nextConfig: NextConfig = {
  transpilePackages: [
    "@mobius/queries",
    "@mobius/collections",
    "@tilt-legal/cubitt-components", // Add for live updates
  ],
};

This config can stay permanently. When Cubitt is installed normally (pre-built from npm), Next.js simply passes the compiled JS through without issue.

Run both in dev mode

Start Cubitt:

Cubitt repo
cd ~/tilt-legal/cubitt
turbo dev

Start Mobius:

Mobius repo
cd ~/tilt-legal/mobius
turbo dev

With transpilePackages configured, changes to Cubitt components will be picked up by Mobius automatically.

Check resolution

pnpm why @tilt-legal/cubitt-components

Should show:

link:../cubitt/packages/components

Inspect node_modules

ls -la node_modules/@tilt-legal/cubitt-components

Should be a symlink pointing to your local Cubitt directory.

To revert to the published npm version via catalog, remove the override from Mobius root package.json, then reinstall:

Mobius repo
cd ~/tilt-legal/mobius
pnpm install

On this page