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

@cats-cradle/bundle-project

v1.1.2

Published

BundleProject is a tool for bundling a single PNPM workspace. It creates a copy of the workspace, replaces the package.json `workspace:*` with the actual versions, and compresses the project as a ZIP file.

Downloads

4

Readme

@cats-cradle/bundle-project

BundleProject is a tool for bundling a single PNPM workspace. It creates a copy of the workspace, replaces the package.json workspace:* with the actual versions, and compresses the project as a ZIP file.

It was designed for a monorepo that uses PNPM to help create small fast deployable projects using AWS CDK in AWS CodePipelines.

In order for this to work properly each workspace dependency must be published prior to services that use it being deployed.

Usage

Example in RushJS

For each project that will be compressed, add BundleProject as a dev dependency:

# example of how to add dev dependency in RushJS
rush add --package @cats-cradle/bundle-project --dev

Add a script command to bundle your package to the project's package.json. Make sure to replace my-package-name with the name of your package.

{
  "name": "my-package-name",
  "scripts": {
    "build:project": "bundle-project my-package-name"
  }
}

Run the script to bundle the project.

rushx build:project

Opinions

Originally, our RushJS monorepo CI/CD process started in Github CI and next went to AWS CodePipeline, Although it was quicker to get a mirror of the repository in AWS CodeCommit and trigger a CodePipeline build from pushes to main, that approach had several costly drawbacks:

  • In order for a pipeline to build from that source it must clone the entire monorepo within CodePipeline.
  • RushJS diffs to determine which projects changed are based on git histories. This meant the clone had to be a deep fetch (had to download all git histories) to work, which is an even larger file.
  • A step that built all applicable projects and download the dependencies was required.
  • It exponentially increases the amount of downloading and processing that needs to be done within a CodePipeline. This in turn can create prolonged contract varations between microservices when deploying multi service changes, which can cause system errors.
  • This expoententially increases disaster recovery time, as pipelines take longer to ship code.

Instead BundleProject was favored. It enables for a single dedicated Github CI build stage to individually bundle, compress each project changed (along with workspace and non-workspace dependencies), and put the compress object in a S3 bucket. A CodePipeline is then triggered on each object put to deploy the project. This prevents the need for a CodePipeline to fetch and process large amounts of code and drastically speeds up CI/CD pipelines, allowing engineers to ship code faster.

References