cospace

Setup a CoSpace to link multiple (mono)repos together!

Usage no npm install needed!

<script type="module">
  import cospace from 'https://cdn.skypack.dev/cospace';
</script>

README

CoSpace

Setup a CoSpace to link multiple (mono)repos together!

Getting Started

Pre-requisites

  • pnpm
    • If you're using Node.js version ^14.19 or ^16.9 you just need to enable pnpm via corepack.

Create a new CoSpace

Initialize

npx cospace@latest init my-cospace

Link your (mono)repos

cd my-cospace
  1. Clone all the repos you want to link together under the repos sub directory.

  2. Update the pnpm-workspace.yaml file with all the packages you want to add to your CoSpace. By default all packages under the repos directory will be added to your CoSpace, but you probably want to be more specific.

  3. Update the cospace.code-workspace file with all the repos you want to add to your vscode multi-root workspace.

  4. Run pnpm install to install all the packages you've added to your CoSpace.

  5. Run pnpm build to build all the packages you've added to your CoSpace using your monorepo task runner. By default we use lage, but turborepo should work as well.

Advanced Usage

override

npx cospace@latest override
  • Automatically update the pnpm.overrides section of the CoSpace's package.json, to ignore semver and always use the local package version from the workspace. Useful for when you have pre-release versions of packages in your workspace.

purge

npx cospace@latest purge
  • Recursievely delete all node_modules from the CoSpace.