🍣 CLI to handle Private Git Submodules in your Vercel Project

Overview

Vercel Submodules

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!

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

npx vercel-submodules --token 7777777141f111cf9f0308a63dbd9d0cad3010c4

FYI, that's my Ethereum address 💎

The default value is $GITHUB_TOKEN.

Comments
  • [cli] Adopt GitHub fine-graned token

    [cli] Adopt GitHub fine-graned token

    Hello, I'm also using vercel and trying to include git submodule in build time.

    This script is using classic Personal Access Token, but I wanna use new fine-graned PAT because I work for a company and it's more suitable for access management for organization private repo.

    It seems to need some fix to URL to use fine-grained token. (like this) So I added --fg-token flag, and fix code to add oauth2: before token in Github URL if fine-grained token is given.

    I would appreciate if you could review 🙏.

    opened by harumaxy 2
  • Docs: additional steps for private submodules

    Docs: additional steps for private submodules

    Thank you @junhoyeo for this awesome tool! 🙏

    It just took me a while before understanding that in order to work (at least with private submodules) one has to:

    1. generate an access token,
    2. add it as an environment variable in Vercel (GITHUB_TOKEN).

    I can open a PR to add the steps above in the README if you want.

    documentation 
    opened by AchrafAsh 1
  • [docs] Optimize images

    [docs] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 20% 🎉

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /docs/images/usage-information.jpg | 687.15kb | 546.26kb | 20.50% |


    📝 docs | :octocat: repo | 🙋🏾 issues | 🏪 marketplace

    ~Imgbot - Part of Optimole family

    opened by imgbot[bot] 0
  • [docs] Optimize images

    [docs] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 20% 🎉

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /docs/images/usage-information.jpg | 677.53kb | 537.65kb | 20.65% | | /docs/images/vercel-submodules.svg | 14.48kb | 14.47kb | 0.09% | | | | | | | Total : | 692.01kb | 552.11kb | 20.22% |


    📝 docs | :octocat: repo | 🙋🏾 issues | 🏪 marketplace

    ~Imgbot - Part of Optimole family

    opened by imgbot[bot] 0
  • [cli] Only fetch specific submodules if `paths` option is given

    [cli] Only fetch specific submodules if `paths` option is given

    ░▒▓ ~/vercel-submodules  on junhoyeo/only-clone-specific *5 +3 !2  yarn build && yarn start --all                                                                              ✔  at 07:50:11 ▓▒░
    yarn run v1.22.19
    $ tsc
    ✨  Done in 1.46s.
    yarn run v1.22.19
    $ node lib/index.js --all
    Clone Success Submodule src/juno@e0cfea7
    Clone Success Submodule test@170a609
    ✨  Done in 2.56s.
    
    ░▒▓ ~/vercel-submodules  on junhoyeo/only-clone-specific *5 +3 !2  yarn build && yarn start --paths test                                                             ✔  took 4s  at 07:50:18 ▓▒░
    yarn run v1.22.19
    $ tsc
    ✨  Done in 1.48s.
    yarn run v1.22.19
    $ node lib/index.js --paths test
    Clone Success Submodule test@170a609
    ✨  Done in 4.25s.
    
    ░▒▓ ~/vercel-submodules  on junhoyeo/only-clone-specific *5 +3 !2  yarn build && yarn start --paths ./test                                                           ✔  took 6s  at 07:50:29 ▓▒░
    yarn run v1.22.19
    $ tsc
    ✨  Done in 1.67s.
    yarn run v1.22.19
    $ node lib/index.js --paths ./test
    Clone Success Submodule test@170a609
    ✨  Done in 1.44s.
    
    ░▒▓ ~/vercel-submodules  on junhoyeo/only-clone-specific *5 +3 !2  yarn build && yarn start --paths ./src/juno                                                       ✔  took 3s  at 07:50:34 ▓▒░
    yarn run v1.22.19
    $ tsc
    ✨  Done in 1.50s.
    yarn run v1.22.19
    $ node lib/index.js --paths ./src/juno
    Clone Success Submodule src/juno@e0cfea7
    ✨  Done in 1.48s.
    
    ░▒▓ ~/vercel-submodules  on junhoyeo/only-clone-specific *5 +3 !2  yarn build && yarn start --paths ./src/juno src/juno test                                         ✔  took 3s  at 07:50:45 ▓▒░
    yarn run v1.22.19
    $ tsc
    ✨  Done in 1.49s.
    yarn run v1.22.19
    $ node lib/index.js --paths ./src/juno src/juno test
    Clone Success Submodule src/juno@e0cfea7
    Clone Success Submodule test@170a609
    ✨  Done in 3.50s.
    
    opened by junhoyeo 0
  • Refactor: simplify `convertToAuthURL` with single object parameter

    Refactor: simplify `convertToAuthURL` with single object parameter

        Nice! Would love rewrite this by making the params into an single object soon.
    

    Originally posted by @junhoyeo in https://github.com/junhoyeo/vercel-submodules/pull/8#discussion_r1054839229

    opened by junhoyeo 0
Releases(v1.0.7)
  • v1.0.7(Dec 22, 2022)

    What's Changed

    • [cli] Adopt GitHub fine-graned token by @harumaxy in https://github.com/junhoyeo/vercel-submodules/pull/8

    New Contributors

    • @harumaxy made their first contribution in https://github.com/junhoyeo/vercel-submodules/pull/8

    Full Changelog: https://github.com/junhoyeo/vercel-submodules/compare/v1.0.6...v1.0.7

    Source code(tar.gz)
    Source code(zip)
  • v1.0.6(Sep 15, 2022)

    What's Changed

    • Fixed typo in usage information: Submodules -> submodules

    Full Changelog: https://github.com/junhoyeo/vercel-submodules/compare/v1.0.5...v1.0.6

    Source code(tar.gz)
    Source code(zip)
  • v1.0.5(Sep 14, 2022)

    What's Changed

    • [docs] Fix typo: Build Command -> Install Command by @junhoyeo in https://github.com/junhoyeo/vercel-submodules/pull/4
    • [cli] Resolve correct submodule key inside monorepos by @junhoyeo in https://github.com/junhoyeo/vercel-submodules/pull/5

    Full Changelog: https://github.com/junhoyeo/vercel-submodules/compare/v1.0.4...v1.0.5

    Source code(tar.gz)
    Source code(zip)
  • v1.0.4(Sep 13, 2022)

    vercel-submodules:
    The CLI to handle
    Private Git Submodules
    in your Vercel Project

    Changelog

    • [docs] Tidy up sentences & structures by @anaclumos in https://github.com/junhoyeo/vercel-submodules/pull/1
    • [cli] Use githubToken to clone submodules if provided by @junhoyeo in https://github.com/junhoyeo/vercel-submodules/pull/2
    • [cli] Only fetch specific submodules if paths option is given by @junhoyeo in https://github.com/junhoyeo/vercel-submodules/pull/3

    Full Changelog: https://github.com/junhoyeo/vercel-submodules/commits/v1.0.4

    Source code(tar.gz)
    Source code(zip)
Owner
Juno
🦄⚡️🌎 19-yo developer in Seoul, shaping the 2nd/3rd web. Sometimes a designer and dreamer, I just like to build things
Juno
A developer directory built on Next.js and MongoDB Atlas, deployed on Vercel with the Vercel + MongoDB integration.

MongoDB Starter – Developer Directory A developer directory built on Next.js and MongoDB Atlas, deployed on Vercel with the Vercel + MongoDB integrati

Vercel 246 Dec 20, 2022
Simple Git (Github) CLI made in Node.js

nagit Simple Git (Github) CLI made in Node.js Quickstart The CLI is self-documented, just follow the steps to perform a commit. npm install -g nagit n

Nacho Aldama 8 Nov 10, 2022
Git Frameworker is a CLI tool for quickly bootstrapping custom framework configurations.

Git Frameworker Git Frameworker is a tool that allows you to quickly bootstrap a project using a framework from GitHub. If the repository you clone co

Guilherme Marcondes 6 May 3, 2023
A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and configure Typescript on it.

CTSP- Create TS Project A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and conf

Jean Rodríguez 7 Sep 13, 2022
An itty library to handle common time-related things for your API needs.

Tiny (~500 bytes) time math library for making date handling and TTLs within your APIs beautiful. Features Tiny @ ~500 bytes gzipped total, and tree-s

Kevin R. Whitley 8 Jan 2, 2023
Whatsapp-web-clone MERN project deployed on vercel and heruku

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Shreyansh Singh 3 Dec 17, 2022
Downloads & formats all of your Roblox private messages.

Roblox Message Downloader This tool was created due to the recent news sent out by Roblox. On April 22nd, 2022, all private messages sent by Roblox be

Raincoat Games 2 Apr 7, 2022
Some process handle JavaScript function parameter.

Function parameter handle or paremeter error control Example 1: Just checking if all arguments were passed / defined. const required = (name) => {

Md. Nazmul Islam 4 Mar 14, 2022
A set of useful helper methods for writing functions to handle Cloudflare Pub/Sub messages (https://developers.cloudflare.com/pub-sub/)

pubsub A set of useful helper methods for writing functions to handle Cloudflare Pub/Sub messages. This includes: A isValidBrokerRequest helper for au

Cloudflare 18 Dec 4, 2022
A Discord.JS Command Handler to handle commands eaiser

TABLE OF CONTENTS Installation Setup Changing Default Prefix Creating a Command Usage of minArgs and maxArgs Syntax Errors Global Syntax Errors Per Co

AaTherf 3 Jun 8, 2022
Handle errors like it's 2022 🔮

Handle errors like it's 2022 ?? Error handling framework that is minimalist yet featureful. Features Minimalist API Custom error types Wrap any error'

ehmicky 637 Jan 7, 2023
Helper package to handle requests to a jschan api instance.

jschan-api-sdk Helper package to handle requests to a jschan api instance. How to use npm install ussaohelcim/jschan-api-sdk const { jschan } = requir

Michell 3 Jun 30, 2022
Small TS library to type and safely handle `serde` JSON serializations of Rust enums.

rustie-ts TypeScript library with helper types and functions to type-safely handle Rust's serde JSON serialization of Enums. It can also be used stand

Kelvin Steiner Santos 4 Jul 17, 2022
This is just a script I put together to check and notify me via email (MailGun) when there's an earlier date before my initial appointment date. It doesn't handle rescheduling.

US-visa-appointment-notifier This is just a script I put together to check and notify me via email (MailGun) when there's an earlier date before my in

Theophilus Omoregbee 13 Jan 4, 2023
Angular JWT refresh token with Interceptor, handle token expiration in Angular 14 - Refresh token before expiration example

Angular 14 JWT Refresh Token example with Http Interceptor Implementing Angular 14 Refresh Token before Expiration with Http Interceptor and JWT. You

null 8 Nov 30, 2022
A simple handle tap and hold action for Svelte/SvelteKit.

Svelte Tap Hold Minimalistic tap and hold component for Svelte/SvelteKit, see demo here. Installation // Using Yarn to install yarn add --dev svelte-t

Binsar Dwi Jasuma 9 Dec 8, 2022
ish.ninja is a free online platform to allocate a unique ish.ninja sub handle name for a BlueSky account.

ish.ninja ish.ninja is a free online platform to allocate a unique ish.ninja sub handle name for a BlueSky account. It is built using Next.js, Xata, T

Ishaan Bedi 6 May 9, 2023
Get a diff view of your Obsidian Sync, File Recovery and Git version history

Version History Diff (for Sync and File Recovery Core plugins and Git) Note This plugin uses private APIs, so it may break at any time. Use at your ow

null 39 Dec 26, 2022
🏏 GitHub action to split your Git release tag into SemVer 2.0 parts

?? Git Tag Action GitHub action to split your Git release tag into SemVer 2.0 parts This is a simple action to split your git tag, usually for release

Noel 5 Oct 31, 2022