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

shalo

v1.0.3

Published

Tool to optimize git operations in NX Monorepo, and reduce the checkout & clone size

Downloads

14

Readme

🎉 Shalo - Optimize Git Size for Nx Monorepo

Inspired by tiktok sparo for RushJS

A typical Nx Monorepo folder structure can be complex, especially when the number of applications and their dependencies on shared libraries grows. To address this, Shalo leverages Git's shallow clone and sparse checkout functionalities to streamline operations.

Monorepo Structure

Educating hundreds of engineers working in a monorepo about which shared packages and components their apps need can be challenging. Shalo is a CLI tool built with Node.js designed to simplify this process.


🚀 Install Shalo on Your Machine

  • You can install Shalo globally using the following command:
npm install -g shalo

⚠️ Note:

This can be used in your CI Pipelines as well

🛠️ Clone Your Repository

  • To clone your repository, run:
shalo clone <GITREPO_URL>
  • Alternatively, you can use:
npx shalo clone <GITREPO_URL>

📦 Install Dependencies in Your Repository

  • After cloning, navigate into your repository and install the dependencies:
npm install
# or
yarn install

📥 Checkout Required Apps in the Nx Monorepo

  • To checkout only the apps you need, use the following command. Shalo computes the dependencies within Nx and checks out all required dependent apps in the monorepo:
shalo checkout -a <NX-APP/NX-PROJECT_NAME>

❌ Exclude Dependent Apps

  • If necessary, you can exclude specific dependent apps. However, be cautious with this option, as it may break Nx builds or other Nx commands:
shalo checkout -a <APP/PROJECT_NAME> -e <NX-EXCLUDED_APP_NAME>

📂 Checkout Only Folders

  • If you need to checkout only specific folders without computing dependencies, you can use:
shalo checkout -f <FOLDER_NAME>

⚠️ Note:

After checking out the required apps, ensure that you use the shalo add command when adding more apps or folders.
Running shalo checkout again will overwrite the apps or folders you’ve already checked out.

➕ Adding Folders to Sparse Mode

  • To add additional folders (like mocks, tools, etc.) to your sparse mode monorepo, run:
shalo add -f <FOLDER_NAME>

➕ Add Apps and Dependencies

  • You can also add an Nx app along with its dependencies to the sparse repo using the following command:
shalo add -a <NX-APP/NX-PROJECT_NAME>

❌ Remove apps / folders

  • To remove any app with dependencies or just the folder from sparse-checkout list, use the following command:
shalo remove -f <FOLDER_NAME>
shalo remove -a <APP_NAME>

🔄 Disable Sparse Checkout

  • To exit sparse checkout mode or to disable it and revert to using the Git CLI, execute:
shalo clean

📜 Code of Conduct and Contributing

With Shalo, you can streamline your workflow in Nx Monorepos, reducing the complexity of managing multiple apps and their dependencies. If you encounter any issues or have suggestions, please feel free to open an issue or a pull request in the repository.

Happy coding! ✨