npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dsm-vercel-submodules

v1.0.11

Published

The CLI to handle Private Git Submodules in your Vercel Project

Downloads

59

Readme

Vercel Submodules

This project is community-driven and not affiliated with Vercel in any way. However, I'd love to contribute!

The Status Quo

@vercel Support for private Git Submodules #44

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.

📦 Installation and Usage

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!

Usage information for vercel-submodules

Clone all Submodules

npx vercel-submodules --all

This command clones all submodules inside the repository.

Clone only specific Submodules

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

Configure clone depth

npx vercel-submodules --depth 10

The default value is 1.

Set GitHub Token

You'll need to configure your GitHub token in order to clone private repositories in Vercel. Follow these steps:

  1. Go to your GitHub Developer settings > Personal access tokens.
  2. Click "Generate new token".
  3. Give the token a name and select the repo (Full control of private repositories) permission.
  4. Click "Generate token". You will then be presented with a token that you can use to authenticate with GitHub.
  5. Add the resulting token as an Environment Variable in Vercel called GITHUB_TOKEN.

Alternatively, you can explicitly set the token argument:

npx vercel-submodules --token 7777777141f111cf9f0308a63dbd9d0cad3010c4

FYI, that's my Ethereum address 💎

If the GITHUB_TOKEN environment variable is not set, the CLI will attempt to use the default value of $GITHUB_TOKEN.

You can also use the new fine-graned PAT using the --fg-token flag, too.

npx vercel-submodules --fg-token 7777777141f111cf9f0308a63dbd9d0cad3010c4