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

@yendisng/cdk-pipeline-lib

v0.1.21

Published

This construct library is meant to help create a CDK pipeline that accepts multiple sources. For now the default is that there is a corresponding CodeBuild Project created for each input source. The library also creates a corresponding Pipeline Stage that

Downloads

2

Readme

CDK Pipeline Lib

This construct library is meant to help create a CDK pipeline that accepts multiple sources. For now the default is that there is a corresponding CodeBuild Project created for each input source. The library also creates a corresponding Pipeline Stage that uses a single CodeBuild Action for each input source.

Getting Started

Setup the local repo to pull the package from GitHub packages

Installing

Setup the registry for the @masterofthebus scope. Add the following to an .npmrc file at the root of the project.

@masterofthebus:registry=https://npm.pkg.github.com

In order to allow pulling from the GitHub packages registry, you will need to authenticate to GitHub packages. Create a file in the user directory ~/.npmrc and add the following. To generate a personal access token see this link. For more on authenticating with a PAT see the docs

//npm.pkg.github.com/:_authToken=<GitHub Personal Access Token>

After setting up the .npmrc install the package into dependencies by running

npm install @masterofthebus/[email protected]

Setting up an Artifact Bucket

If you want to setup an S3 bucket to store build artifacts to be used by the app, the bucket needs to be created ahead of time.

Usage

See https://github.com/MasterOfTheBus/cdk-pipeline-example for an example.

Setup the CloudFormation stack for the pipeline by creating a Stack class that instantiates the CodePipelineConstruct class.

export class CdkPipelineExampleStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    // Defines the information for the pipeline source. This is the repo where this class is defined.
    const pipelineSource = new CodeStarConnectionDef({
      // A CodeStar Connection ARN
      codeStarConnection: "arn:aws:codestar-connections:us-east-1:025257542471:connection/b53232ef-36cd-40e2-90ce-4bed059aed57",
      repo: "cdk-pipeline-example",
      repoOwner: "MasterOfTheBus",
      branch: "main"
    });

    // Defines the information for the source code of you app. It can be any other repo.
    const codeSource = new CodeStarConnectionDef({
      // A CodeStar Connection ARN
      codeStarConnection: "arn:aws:codestar-connections:us-east-1:025257542471:connection/b53232ef-36cd-40e2-90ce-4bed059aed57",
      repo: "test_lambda_deploy",
      repoOwner: "MasterOfTheBus",
      branch: "main"
    });

    // The bucket ARN that stores build artifacts used by the lambda
    const bucketArn = 'arn:aws:s3:::sng-lambda-deployments-bucket';
    // The S3 object key for the build artifact 
    const artifactKey = 'artifacts.zip';

    // Instantiates the CodePipeline
    const pipeline = new CodePipelineConstruct(this, 'CodePipeline', {
      pipelineSource: pipelineSource,
      source: codeSource,
      artifactBucketArn: bucketArn,
      artifactKey: artifactKey,
      githubUser: 'masterofthebus',
      githubEmail: '[email protected]'
    });

    // Use the pipeline property to add stages.
    pipeline.pipeline.addStage(
      new MyPipelineAppStage(this ,'TestLambda', bucketArn, `${codeSource.repo}/${artifactKey}`, {
        env: { account: '025257542471', region: 'us-east-1' }
      })
    )
  }
}

Developer

Local Setup

  • See the AWS CDK Docs to set up working with the CDK
    • aws configure to setup AWS configuration
    • npm -g install typescript to install TypeScript
    • npm install -g aws-cdk to install the CDK CLI tool
    • cdk bootstrap aws://ACCOUNT-NUMBER/REGION to bootstrap the CDK

Building

Run npx projen to build

Run npx projen build to run a production build