Skip to content

aruniverse/cospace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoSpace

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

Powered by

Getting started

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 sub directory will be added to your CoSpace; you will probably want to be more specific and build/link only what you need.

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

  4. Run pnpm exec cospace override to automatically update the pnpm.overrides section of the CoSpace's package.json, to link all the dependencies together with the copy found in the workspace. This will ignore semver and always use the local package version from the workspace, very useful for when you have pre-release versions of packages in your workspace.

  5. Run pnpm install to install all dependecies in your workspace and link all the packages you've added to your CoSpace.

  6. 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.

For more information visit the docs site.

example usage

  • itwin-cospace, an example of a CoSpace to help develop with the iTwin Platform.

Notes

Additional Reading

sparse-checkouts

git clone --filter=blob:none --no-checkout {repo}
cd {repo}
git checkout {branchName}
git sparse-checkout init --cone
git sparse-checkout set [...allSubDirs]