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

@rawrus-cdk/tester

v0.0.20

Published

## Table of Contents

Downloads

6

Readme

README

Table of Contents

Introduction

Buildkite pipeline: a-cloud-guru/infra-cdk-constructs

Quick Start

  • Using a construct:

    1. Add this package to your projects package.json:

      yarn add @a-cloud-guru/cdk-constructs

    2. Inside your CDK application you can now import constructs

      import { RdsCluster, Engine } from '@a-cloud-guru/cdk-constructs';
  • Adding a new construct:

    1. Create a file for the construct in ./lib/ with the naming convention <ConstructName>.ts. This will house the construct itself.
    2. Create tests for the construct in ./test/ with the naming convention <ConstructName>.test.ts. This will house jest tests for the construct.
    3. Update ./lib/index.ts to ensure that the new construct is being exported
    4. Update the package's version number in ./package.json
  • Building a new package:

    1. Update ./package.json to ensure a new version is being published

    2. Run available tests yarn test and fix any breakages

    3. Use npm to create a release candidate: npm run build

    4. Use npm to publish the package (requires an NPM_TOKEN env var): npm publish

      # Build package
      npm run build
      # Publish release
      NPM_TOKEN=<x>

Listener Priority Reservations

Each use of the ContainerizedApp pattern requires a unique listener priority to use in the shared Application Load Balancer listener rule. Because of this requiremet a list of the currently reserved priorities is being tracked within confluence.

List of Application Listener Priority Reservations

When using this pattern in staging or production ensure to use/update this list.

Repo Layout

These are some of the major landmarks inside this repo:

./lib               -- Contains each of the constructs being made available
./lib/index.ts      -- Main entrypoint, only meant to export availble constructs
./test              -- Contains jest tests for IaC constructs
./examples          -- Contains usage examples of available constructs
./package.json      -- Dependency management and versioning

Testing

This project is currently being tested using the jest framework as described by the CDK's getting started guide on testing.

All tests can be found in the ./test/ directory and must end with a prefix of .test.js. Ideally each construct has an accompanied test suite with the same name as the construct in ./lib/

To run all available IaC tests use the following:

yarn test

Default Opinions

Almost all of the opinions expressed below can be overriden at synth time

  • ALB:

    • Deletion protection enabled for "production" stage.
    • internetFacing: true
  • ECR:

  • ContainerizedApp:

    • Services are deployed to Fargate clusters
    • When desiredServiceCount is unspecified a default of 3 is used._
    • Container Image can be pinned to a specific commit using the COMMIT_HASH environment variable
    • LoadBalancer attached to services is publicly exposed
    • When registrationTimeout is unspecified a default of 300 is used
    • When circuitBreakerRollback is unspecified rollbacks are set to true
    • When containerInsights is unspecified containerInsights default to true.
  • RdsCluster:

    • When no databaseEngine is specified PostgreSQL is the default
    • Storage is encrypted with a kms_key, if no kms_key_arn is provided one is created.
    • When no backupRetention period is specified the default is 35 days (cdk enforces Retention period must be between 1 and 35.)
    • When no backupWindow is specified a default of 08:00-09:00 is used (this is UTC and must be at least 30 minutes long).
    • Due to limited support (Only Legacy Aurora MySQL) no support for backtrackWindow is provided.
    • All parameter groups, by default, have max_connections set to 16000
    • When enablePerformanceInsights is unspecified it defaults to true
    • When deletionProtection is unspecified it defaults to true
    • Serverless:
      • backupWindow has no effect on Serverless clusters
      • Serverless does not support backtrackWindow.
      • Serverless does not support enablePerformanceInsights
    • Legacy MySQL:
      • Performance insights requires a InstanceClass higher than t3, we default to r3.large.
    • Legacy PostgreSQL
      • Aurora PostgreSQL does not support a backtrackWindow.
  • RedisCluster:

    • One Redis cluster per application
    • When cacheNodeType is unspecified a size of cache.t2.small is used
    • When numCacheNodes is unspecified a size of 1 is used
  • Security Groups:

    • Default security groups whitelist the following
      • Internal: 0.0.0.0/0:0 => 0.0.0.0/0:(3306|5432) (RDS)
      • Internal: 0.0.0.0/0:0 => 0.0.0.0/0:6379 (Redis)
      • Public: 0.0.0.0/0:0 => 0.0.0.0/0:(80) (Expose ALB to internet traffic)

Useful commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npm run test perform the jest unit tests