vercel-submodules
:
The CLI to handle
Private Git Submodules
in your
Vercel Project
This project is community-driven and not affiliated with Vercel in any way. However, I'd love to contribute!
With Git Submodules, you can add other repositories as a subdirectory of another repository. The experimental.externalDir
option in Next.js makes it even more magical by directly transpiling external libraries.
However, Vercel does not support private Git Submodules for now. There have been many community-made workarounds, like calling Vercel CLI inside GitHub Actions (not a fundamental solution) or using shell scripts (it works, but it cannot fit general needs like cloning multiple repositories, auto-response for newly added submodules), having their own set of limitations.
yarn add -D vercel-submodules
Go to the Build & Development Settings section and override Install Command with vercel-submodules --all && (...)
. Such as vercel-submodules --all && yarn install
.
Once configured, vercel-submodules
take care of everything. It detects the indicated commit hashes with all or configured submodules; you don't have to update anything again!
npx vercel-submodules --all
This command clones all submodules inside the repository.
npx vercel-submodules --paths packages/module-a ./packages/module-b docs
This command above will clone submodules with the following path
:
./packages/module-a
./packages/module-b
./docs
npx vercel-submodules --depth 10
The default value is 1
.
npx vercel-submodules --token 7777777141f111cf9f0308a63dbd9d0cad3010c4
FYI, that's my Ethereum address 💎
The default value is $GITHUB_TOKEN
.