@layertwo/cdk-constructs 0.0.0-stage → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +11085 -0
- package/AGENTS.md +153 -0
- package/API.md +8057 -0
- package/LICENSE +202 -0
- package/README.md +156 -2
- package/docs/plans/2026-02-18-github-packages-npm.md +120 -0
- package/lib/acm.d.ts +23 -0
- package/lib/acm.js +20 -0
- package/lib/dynamodb.d.ts +18 -0
- package/lib/dynamodb.js +22 -0
- package/lib/iam.d.ts +44 -0
- package/lib/iam.js +61 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +23 -0
- package/lib/lambda.d.ts +31 -0
- package/lib/lambda.js +53 -0
- package/lib/s3.d.ts +20 -0
- package/lib/s3.js +26 -0
- package/lib/uv-bundling.d.ts +78 -0
- package/lib/uv-bundling.js +193 -0
- package/package.json +127 -4
- package/renovate.json5 +45 -0
- package/resources/Dockerfile +16 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Agent Context: layertwo-cdk-constructs
|
|
2
|
+
|
|
3
|
+
## Product Overview
|
|
4
|
+
|
|
5
|
+
**@layertwo/cdk-constructs** is an AWS CDK construct library providing reusable TypeScript constructs for infrastructure as code. This library simplifies AWS infrastructure deployment by providing well-tested, composable CDK constructs that follow AWS best practices.
|
|
6
|
+
|
|
7
|
+
Published to npm (`https://registry.npmjs.org`) as a JSII library. Only the TypeScript/JS package is published today — no Python, Java, C#, or Go targets are configured in `.projenrc.ts`.
|
|
8
|
+
|
|
9
|
+
## Technology Stack
|
|
10
|
+
|
|
11
|
+
### Build System
|
|
12
|
+
This project uses **Projen** for project configuration and build management. Projen generates configuration files and build scripts from `.projenrc.ts`.
|
|
13
|
+
|
|
14
|
+
**Critical Rule**: Never manually edit generated files marked with `~~ Generated by projen`. Instead, modify `.projenrc.ts` and run `npx projen` to regenerate.
|
|
15
|
+
|
|
16
|
+
### Tech Stack
|
|
17
|
+
- **Language**: TypeScript 5.9+
|
|
18
|
+
- **Framework**: AWS CDK 2.200.0
|
|
19
|
+
- **Package Manager**: Yarn
|
|
20
|
+
- **Testing**: Jest 30+ with ts-jest and CDK assertions
|
|
21
|
+
- **Linting**: ESLint 9 with TypeScript and stylistic plugins
|
|
22
|
+
- **Publishing**: JSII for multi-language package generation
|
|
23
|
+
|
|
24
|
+
### TypeScript Configuration
|
|
25
|
+
- Target: ES2020
|
|
26
|
+
- Strict mode enabled with all strict checks
|
|
27
|
+
- CommonJS module system for compatibility
|
|
28
|
+
- Source maps inlined for debugging
|
|
29
|
+
- Configured via `tsconfig.dev.json` (generated)
|
|
30
|
+
|
|
31
|
+
## Project Structure
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
.
|
|
35
|
+
├── src/ # Source code for CDK constructs
|
|
36
|
+
│ ├── index.ts # Main entry point, exports public API
|
|
37
|
+
│ └── *.ts # Individual construct implementations
|
|
38
|
+
├── test/ # Jest test files
|
|
39
|
+
│ └── *.test.ts # Test files matching src structure
|
|
40
|
+
├── docs/ # Dated design and implementation plan docs
|
|
41
|
+
│ └── plans/ # e.g. 2026-02-18-new-constructs-design.md
|
|
42
|
+
├── lib/ # Compiled JavaScript output (generated)
|
|
43
|
+
├── dist/ # JSII package output (generated)
|
|
44
|
+
├── coverage/ # Test coverage reports (generated)
|
|
45
|
+
├── test-reports/ # JUnit test reports (generated)
|
|
46
|
+
├── .projen/ # Projen metadata (generated)
|
|
47
|
+
├── .github/ # GitHub workflows and configuration
|
|
48
|
+
├── node_modules/ # Dependencies (not committed)
|
|
49
|
+
├── .projenrc.ts # Projen configuration (source of truth)
|
|
50
|
+
└── API.md # Auto-generated API documentation
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Key Files
|
|
54
|
+
- **`.projenrc.ts`**: Project configuration source. Modify this to change build settings, dependencies, or project metadata.
|
|
55
|
+
- **`package.json`**: Generated by Projen. Contains scripts, dependencies, and package metadata.
|
|
56
|
+
- **`tsconfig.dev.json`**: TypeScript configuration for development (generated).
|
|
57
|
+
- **`src/index.ts`**: Main entry point. All public exports must be declared here.
|
|
58
|
+
- **`API.md`**: Auto-generated API documentation from JSDoc comments.
|
|
59
|
+
|
|
60
|
+
### Generated Files (Do Not Edit)
|
|
61
|
+
Files with the header `~~ Generated by projen` are automatically generated:
|
|
62
|
+
- `package.json`
|
|
63
|
+
- `tsconfig.dev.json`
|
|
64
|
+
- `tsconfig.json`
|
|
65
|
+
- `.eslintrc.json`
|
|
66
|
+
- `.gitignore`
|
|
67
|
+
- `.npmignore`
|
|
68
|
+
- GitHub workflow files in `.github/`
|
|
69
|
+
|
|
70
|
+
To modify these, update `.projenrc.ts` and run `npx projen`.
|
|
71
|
+
|
|
72
|
+
### Build Artifacts (Ignored by Git)
|
|
73
|
+
- `lib/` - Compiled JavaScript and type definitions
|
|
74
|
+
- `dist/` - JSII packages for all target languages
|
|
75
|
+
- `coverage/` - Test coverage reports
|
|
76
|
+
- `test-reports/` - JUnit XML test reports
|
|
77
|
+
- `node_modules/` - Dependencies
|
|
78
|
+
|
|
79
|
+
## Development Patterns
|
|
80
|
+
|
|
81
|
+
### Code Organization
|
|
82
|
+
|
|
83
|
+
#### Source Code
|
|
84
|
+
- Place all construct implementations in `src/`
|
|
85
|
+
- One construct per file (e.g., `iam.ts`)
|
|
86
|
+
- Export all public APIs through `src/index.ts`
|
|
87
|
+
- Use clear, descriptive names for constructs and files
|
|
88
|
+
|
|
89
|
+
#### Testing
|
|
90
|
+
- Mirror source structure in `test/` directory
|
|
91
|
+
- Name test files with `.test.ts` suffix (e.g., `iam.test.ts`)
|
|
92
|
+
- Use CDK assertions library for infrastructure testing
|
|
93
|
+
- Group related tests with `describe()` blocks
|
|
94
|
+
- Keep tests focused and composable
|
|
95
|
+
|
|
96
|
+
#### Construct Development Patterns
|
|
97
|
+
- Extend appropriate CDK base classes (e.g., `Role`, `Construct`)
|
|
98
|
+
- Define props interfaces with JSDoc comments
|
|
99
|
+
- Use `readonly` for all props
|
|
100
|
+
- Provide sensible defaults where appropriate
|
|
101
|
+
- Document all public APIs with JSDoc
|
|
102
|
+
|
|
103
|
+
## Common Commands
|
|
104
|
+
|
|
105
|
+
### Development Workflow
|
|
106
|
+
```bash
|
|
107
|
+
# Install dependencies
|
|
108
|
+
yarn install
|
|
109
|
+
|
|
110
|
+
# Full build (compile + test + package)
|
|
111
|
+
npm run build
|
|
112
|
+
|
|
113
|
+
# Compile TypeScript only
|
|
114
|
+
npm run compile
|
|
115
|
+
|
|
116
|
+
# Watch mode for development
|
|
117
|
+
npm run watch
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Testing
|
|
121
|
+
```bash
|
|
122
|
+
# Run all tests with coverage
|
|
123
|
+
npm test
|
|
124
|
+
|
|
125
|
+
# Run tests in watch mode
|
|
126
|
+
npm run test:watch
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Code Quality
|
|
130
|
+
```bash
|
|
131
|
+
# Run linter
|
|
132
|
+
npm run eslint
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Package Management
|
|
136
|
+
```bash
|
|
137
|
+
# Generate distributable packages
|
|
138
|
+
npm run package
|
|
139
|
+
|
|
140
|
+
# Package for all target languages
|
|
141
|
+
npm run package-all
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Projen Management
|
|
145
|
+
```bash
|
|
146
|
+
# Regenerate project files from .projenrc.ts
|
|
147
|
+
npx projen
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Dependency upgrades arrive as Renovate PRs (`renovate.json5`); there is no local upgrade task.
|
|
151
|
+
|
|
152
|
+
### Releasing
|
|
153
|
+
`mainline` is the release branch. Merging conventional-commit messages there triggers `release.yml`, which bumps the version and publishes.
|