Projen Projects
Opinionated projen project types for AWS CDK construct libraries, jsii libraries, and TypeScript packages.
Features
ProjenCdkConstructLibrary— anAwsCdkConstructLibrarywrapper with shared defaultsProjenJsiiProject— aJsiiProjectwrapper with the same shared defaultsProjenTypeScriptProject— aTypeScriptProjectwrapper with the same shared defaults- Requires only
nameandrepositoryUrlto get started (cdkVersionis also required for CDK libraries) - Shared author, Node (
>= 20), TypeScript (6.0.x), and jsii (6.0.x, jsii / CDK libraries) settings - GitHub App credentials for workflow authentication
- Weekly dependency upgrades with auto-approve / auto-merge labels
- Generates a consistent
.editorconfigand sets ESLintmax-lento 160 - Runs Jest with
--silentso test logs stay quiet - Enables TypeScript
strictin the development tsconfig - Defaults discovered AWS Lambda handlers to Node.js 24, with
@aws-sdk/*external and source maps - Generates
.devcontainer/devcontainer.jsonon Node 24, aligned with workflow Node24.x
Installation
npm
npm install @gammarers/projen-projects
yarn
yarn add @gammarers/projen-projects
pnpm
pnpm add @gammarers/projen-projects
Usage
Create a .projenrc.ts that uses ProjenCdkConstructLibrary:
import { ProjenCdkConstructLibrary } from '@gammarers/projen-projects';
const project = new ProjenCdkConstructLibrary({
name: '@example/my-cdk-construct',
repositoryUrl: 'https://github.com/example/my-cdk-construct.git',
cdkVersion: '2.170.0',
});
project.synth();
Or use ProjenJsiiProject for a multi-language jsii library:
import { ProjenJsiiProject } from '@gammarers/projen-projects';
const project = new ProjenJsiiProject({
name: '@example/my-jsii-library',
repositoryUrl: 'https://github.com/example/my-jsii-library.git',
});
project.synth();
Or use ProjenTypeScriptProject for a TypeScript package:
import { ProjenTypeScriptProject } from '@gammarers/projen-projects';
const project = new ProjenTypeScriptProject({
name: '@example/my-typescript-project',
repositoryUrl: 'https://github.com/example/my-typescript-project.git',
});
project.synth();
Then generate the project files:
npx projen
Options
ProjenCdkConstructLibrary accepts ProjenCdkConstructLibraryOptions, which extends
AwsCdkConstructLibraryOptions (most fields optional) while requiring the following:
| Option | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Package name |
repositoryUrl | string | Yes | Git repository URL (jsii derives repository from this value) |
cdkVersion | string | Yes | AWS CDK version |
Optional highlights:
| Option | Description |
|---|---|
Other AwsCdkConstructLibrary options | Passed through and can override the built-in defaults, including lambdaOptions. devContainer stays false |
Built-in defaults include author yicr, npm as the package manager, releaseToNpm: false,
public npm access, workflow Node 24.x, and GitHub App-based projen credentials.
Discovered Lambda handlers use Node.js 24, exclude @aws-sdk/* from the bundle, and emit source maps.
Passing lambdaOptions replaces that default. A library with no Lambda handler is unchanged.
ProjenJsiiProject accepts ProjenJsiiProjectOptions, which extends
JsiiProjectOptions (most fields optional) while requiring the following:
| Option | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Package name |
repositoryUrl | string | Yes | Git repository URL (jsii derives repository from this value) |
Other JsiiProject options are passed through and can override the built-in defaults.
devContainer stays false. The same author, Node, TypeScript, jsii (6.0.x), npm, and
GitHub App defaults as ProjenCdkConstructLibrary apply (without CDK / Lambda settings).
ProjenTypeScriptProject accepts ProjenTypeScriptProjectOptions, which extends
TypeScriptProjectOptions (most fields optional) while requiring the following:
| Option | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Package name |
repositoryUrl | string | Yes | Git repository URL (passed through as projen's repository) |
Other TypeScriptProject options are passed through and can override the built-in defaults.
devContainer stays false. The same author, Node, TypeScript, npm, and GitHub App defaults
as ProjenCdkConstructLibrary apply (jsiiVersion is not set because this type is not a jsii project).
All three types write .devcontainer/devcontainer.json and add /.devcontainer to .npmignore.
jsii projects (including CDK construct libraries) also install the .NET, Python, and Java
Dev Container features. After the container is created, it fixes ownership of the
node_modules volume, marks the workspace as a Git safe directory, and runs the project's
immutable install command (npm ci with the default package manager).
Requirements
- Node.js
>= 20.0.0
License
This project is licensed under the Apache-2.0 License.