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

@kikoda/cdk-constructs

v0.6.1

Published

Collection of useful platform constructs for modern applications deployed with AWS CDK

Downloads

9,732

Readme

Kikoda CDK Constructs Library

License npm version NuGet version

Use this Kikoda CDK Constructs Library to architect and model modern applications deployed with AWS CDK.

Install from NPM:

yarn add --dev @kikoda/cdk-constructs

# or

npm install @kikoda/cdk-constructs --save-dev

Usage

AWS CDK

The Kikoda Constructs library currently only supports AWS CDK v2.

Add this to your CDK stack to create a new Cloudfront/S3 backed website:

import { Website } from '@kikoda/cdk-constructs';

const website = new Website(this, 'Website', {
  stage: <DEPLOYMENT_STAGE_NAME>,
  appDir: resolve(__dirname, <RELATIVE_PATH_TO_WEB_ASSETS>),
  buildDir: <BUILD_DIR_RELATIVE_TO_APP_DIR>,
  buildCommand: <CMD_TO_BUILD_APP>,
  domainName: <DOMAIN_NAME>,
});

Configured Stages

With the ConfiguredStage construct you can pass arbitrary environmental configuration to your CDK App. This is useful when you want to define and use a configuration object in your nested Stacks and Constructs.

import { CodePipeline } from 'aws-cdk-lib/pipeines';
import { ConfiguredStage } from '@kikoda/cdk-constructs';

interface Config {
  foo: string;
}

class MyStack extends Stack {
  constructor(scope: Construct, id: string) {
    super(scope, id);

    /*
     * Get a config value in a child stack or construct
     */
    const stage = ConfiguredStage.extOf(this) as ConfiguredStage<Config>;

    const new MyConstruct(this, 'MyConstruct', {
      foo: stage.config.foo,
    });
  }
}

class MyStage<T> extends ConfiguredStage<T> {
  constructor(scope: Construct, id: string, props: ConfiguredStageProps<T>) {
    super(scope, id, props);

    new MyStack(this, 'MyStack');
  }
}

/*
 * Use the stage with CDK Pipelines
 */
const stage = new MyStage<Config>(this, 'DevStage', {
  stageName: 'dev',
  config: {
    foo: 'bar',
  },
});

const pipeline = new CodePipeline(this, 'Pipeline', {
  synth: new ShellStep('Synth', {
    input: CodePipelineSource.gitHub('owner/repo', 'main'),
    commands: [
      'yarn install',
      'yarn build',
      'npx cdk synth',
    ],
  }),
});

pipeline.addStage(stage);

Opening Issues

If you encounter a bug with this package, we want to hear about it. Before opening a new issue, search the existing issues to avoid duplicates.

When opening an issue, include the Kikoda Construct Library version, Node version, and stack trace if available. In addition, include the steps to reproduce when appropriate.

You can also open an issue for a feature request.

Contributing

If you find an issue with this package and have a fix, please feel free to open a pull request following the procedures.

Testing

If you contribute to this package you can run the tests using yarn test.

License

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.

This product includes software developed at Kikoda (https://www.kikoda.com). Copyright 2022 Kikoda, LLC.