Skip to content

layertwo/cdk-constructs

Repository files navigation

layertwo-cdk-constructs

A reusable AWS CDK construct library providing TypeScript constructs for infrastructure as code.

Installation

npm install layertwo-cdk-constructs

Usage

import { Hello } from 'layertwo-cdk-constructs';

const hello = new Hello();
console.log(hello.sayHello()); // Output: hello, world!

Development

This project uses Projen for project configuration and build management. All configuration is defined in .projenrc.ts.

Prerequisites

  • Node.js 18+
  • Yarn package manager

Setup

# Install dependencies
yarn install

# Generate project files from .projenrc.ts
npx projen

Common Commands

# Build the project (compile + test + package)
npm run build

# Compile TypeScript only
npm run compile

# Run tests with coverage
npm test

# Run tests in watch mode
npm run test:watch

# Run linter
npm run eslint

# Watch mode for development
npm run watch

# Generate distributable packages
npm run package

# Upgrade dependencies
npm run upgrade

Project Structure

.
├── src/                    # Source code for CDK constructs
│   └── index.ts           # Main entry point, exports public API
├── test/                   # Jest test files
├── lib/                    # Compiled JavaScript output (generated)
├── dist/                   # JSII package output (generated)
├── .projenrc.ts           # Projen configuration (source of truth)
└── package.json           # Generated by Projen

Making Changes

  1. Modify source code in src/
  2. Add tests in test/
  3. Run npm run build to compile and test
  4. For project configuration changes, edit .projenrc.ts and run npx projen

Important: Do not manually edit files marked with ~~ Generated by projen. Instead, modify .projenrc.ts and regenerate.

Technology Stack

  • Language: TypeScript 5.9+
  • Framework: AWS CDK 2.200.0
  • Testing: Jest 30+ with ts-jest
  • Linting: ESLint 9
  • Publishing: JSII for multi-language package generation

Contributing

Contributions are welcome! Please ensure all tests pass and code follows the project's linting rules before submitting.

License

Apache-2.0

Author

Lucas Messenger (1335960+layertwo@users.noreply.github.com)

Repository

https://github.com/lcmessen/cdk-constructs

About

cdk constructs package

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors