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/create-artifact

v2.0.8

Published

[![npm version](https://badge.fury.io/js/@cats-cradle%2Fcreate-artifact.svg)](https://badge.fury.io/js/@cats-cradle%2Fcreate-artifact) [![License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](LICENSE) [![GitHub Stars](https://img.shields.io/

Downloads

15

Readme

@cats-cradle/create-artifact

npm version License GitHub Stars

create-artifact is a tool for bundling a single package into an artifact. It was designed to help create small fast deployable projects.

How it Works

create-artifact creates a copy of the workspace, replaces any dynamic package.json workspace:* references with the actual versions, and compresses the project as a ZIP file.

Note In CI/CD pipelines make sure to publish each workspace dependency prior to services that use it being deployed.

Usage

Example in RushJS

For each project that needs an artifact, add create-artifact as a dev dependency:

# example of how to add dev dependency in RushJS
rush add --package @cats-cradle/create-artifact --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": {
    "artifact": "create-artifact my-package-name"
  }
}

Run the script to bundle the project.

rushx artifact

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 variations between microservices when deploying multi service changes, which can cause system errors.
  • This exponentially increases disaster recovery time, as pipelines take longer to ship code.

Instead create-artifact 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