Skip to content

Latest commit

 

History

History
3933 lines (2483 loc) · 141 KB

API.md

File metadata and controls

3933 lines (2483 loc) · 141 KB

API Reference

Constructs

AwsCdkApp

Initializers

import { AwsCdkApp } from '@nikovirtala/projen-aws-cdk-app'

new AwsCdkApp(options: AwsCdkAppOptions)
Name Type Description
options AwsCdkAppOptions No description.

optionsRequired

Methods

Name Description
toString Returns a string representation of this construct.
addExcludeFromCleanup Exclude the matching files from pre-synth cleanup.
addGitIgnore Adds a .gitignore pattern.
addPackageIgnore Adds patterns to be ignored by npm.
addTask Adds a new task to this project.
addTip Prints a "tip" message during synthesis.
annotateGenerated Marks the provided file(s) as being generated.
postSynthesize Called after all components are synthesized.
preSynthesize Called before all components are synthesized.
removeTask Removes a task from a project.
runTaskCommand Returns the shell command to execute in order to run a task.
synth Synthesize all project files into outdir.
tryFindFile Finds a file at the specified relative path within this project and all its subprojects.
tryFindJsonFile Finds a json file by name.
tryFindObjectFile Finds an object file (like JsonFile, YamlFile, etc.) by name.
tryRemoveFile Finds a file at the specified relative path within this project and removes it.
addBins No description.
addBundledDeps Defines bundled dependencies.
addCompileCommand DEPRECATED.
addDeps Defines normal dependencies.
addDevDeps Defines development/test dependencies.
addFields Directly set fields in package.json.
addKeywords Adds keywords to package.json (deduplicated).
addPeerDeps Defines peer dependencies.
addScripts Replaces the contents of multiple npm package.json scripts.
addTestCommand DEPRECATED.
hasScript Indicates if a script by the name name is defined.
removeScript Removes the npm script (always successful).
renderWorkflowSetup Returns the set of workflow steps which should be executed to bootstrap a workflow.
setScript Replaces the contents of an npm package.json script.
addCdkDependency Adds an AWS CDK module dependencies.

toString
public toString(): string

Returns a string representation of this construct.

addExcludeFromCleanup
public addExcludeFromCleanup(globs: ...string[]): void

Exclude the matching files from pre-synth cleanup.

Can be used when, for example, some source files include the projen marker and we don't want them to be erased during synth.

globsRequired
  • Type: ...string[]

The glob patterns to match.


addGitIgnore
public addGitIgnore(pattern: string): void

Adds a .gitignore pattern.

patternRequired
  • Type: string

The glob pattern to ignore.


addPackageIgnore
public addPackageIgnore(pattern: string): void

Adds patterns to be ignored by npm.

patternRequired
  • Type: string

The pattern to ignore.


addTask
public addTask(name: string, props?: TaskOptions): Task

Adds a new task to this project.

This will fail if the project already has a task with this name.

nameRequired
  • Type: string

The task name to add.


propsOptional
  • Type: projen.TaskOptions

Task properties.


addTip
public addTip(message: string): void

Prints a "tip" message during synthesis.

messageRequired
  • Type: string

The message.


annotateGenerated
public annotateGenerated(glob: string): void

Marks the provided file(s) as being generated.

This is achieved using the github-linguist attributes. Generated files do not count against the repository statistics and language breakdown.

https://github.com/github/linguist/blob/master/docs/overrides.md

globRequired
  • Type: string

the glob pattern to match (could be a file path).


postSynthesize
public postSynthesize(): void

Called after all components are synthesized.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before all components are synthesized.

removeTask
public removeTask(name: string): Task

Removes a task from a project.

nameRequired
  • Type: string

The name of the task to remove.


runTaskCommand
public runTaskCommand(task: Task): string

Returns the shell command to execute in order to run a task.

This will typically be npx projen TASK.

taskRequired
  • Type: projen.Task

The task for which the command is required.


synth
public synth(): void

Synthesize all project files into outdir.

  1. Call "this.preSynthesize()"
  2. Delete all generated files
  3. Synthesize all subprojects
  4. Synthesize all components of this project
  5. Call "postSynthesize()" for all components of this project
  6. Call "this.postSynthesize()"
tryFindFile
public tryFindFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and all its subprojects.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile

Finds a json file by name.

filePathRequired
  • Type: string

The file path.


tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile

Finds an object file (like JsonFile, YamlFile, etc.) by name.

filePathRequired
  • Type: string

The file path.


tryRemoveFile
public tryRemoveFile(filePath: string): FileBase

Finds a file at the specified relative path within this project and removes it.

filePathRequired
  • Type: string

The file path.

If this path is relative, it will be resolved from the root of this project.


addBins
public addBins(bins: {[ key: string ]: string}): void
binsRequired
  • Type: {[ key: string ]: string}

addBundledDeps
public addBundledDeps(deps: ...string[]): void

Defines bundled dependencies.

Bundled dependencies will be added as normal dependencies as well as to the bundledDependencies section of your package.json.

depsRequired
  • Type: ...string[]

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addCompileCommand
public addCompileCommand(commands: ...string[]): void

DEPRECATED.

commandsRequired
  • Type: ...string[]

addDeps
public addDeps(deps: ...string[]): void

Defines normal dependencies.

depsRequired
  • Type: ...string[]

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addDevDeps
public addDevDeps(deps: ...string[]): void

Defines development/test dependencies.

depsRequired
  • Type: ...string[]

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addFields
public addFields(fields: {[ key: string ]: any}): void

Directly set fields in package.json.

fieldsRequired
  • Type: {[ key: string ]: any}

The fields to set.


addKeywords
public addKeywords(keywords: ...string[]): void

Adds keywords to package.json (deduplicated).

keywordsRequired
  • Type: ...string[]

The keywords to add.


addPeerDeps
public addPeerDeps(deps: ...string[]): void

Defines peer dependencies.

When adding peer dependencies, a devDependency will also be added on the pinned version of the declared peer. This will ensure that you are testing your code against the minimum version required from your consumers.

depsRequired
  • Type: ...string[]

Names modules to install.

By default, the the dependency will be installed in the next npx projen run and the version will be recorded in your package.json file. You can upgrade manually or using yarn add/upgrade. If you wish to specify a version range use this syntax: module@^7.


addScripts
public addScripts(scripts: {[ key: string ]: string}): void

Replaces the contents of multiple npm package.json scripts.

scriptsRequired
  • Type: {[ key: string ]: string}

The scripts to set.


addTestCommand
public addTestCommand(commands: ...string[]): void

DEPRECATED.

commandsRequired
  • Type: ...string[]

hasScript
public hasScript(name: string): boolean

Indicates if a script by the name name is defined.

nameRequired
  • Type: string

The name of the script.


removeScript
public removeScript(name: string): void

Removes the npm script (always successful).

nameRequired
  • Type: string

The name of the script.


renderWorkflowSetup
public renderWorkflowSetup(options?: RenderWorkflowSetupOptions): JobStep[]

Returns the set of workflow steps which should be executed to bootstrap a workflow.

optionsOptional
  • Type: projen.javascript.RenderWorkflowSetupOptions

Options.


setScript
public setScript(name: string, command: string): void

Replaces the contents of an npm package.json script.

nameRequired
  • Type: string

The script name.


commandRequired
  • Type: string

The command to execute.


addCdkDependency
public addCdkDependency(modules: ...string[]): void

Adds an AWS CDK module dependencies.

modulesRequired
  • Type: ...string[]

The list of modules to depend on.


Static Functions

Name Description
isConstruct Checks if x is a construct.
isProject Test whether the given construct is a project.
of Find the closest ancestor project for given construct.

isConstruct
import { AwsCdkApp } from '@nikovirtala/projen-aws-cdk-app'

AwsCdkApp.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isProject
import { AwsCdkApp } from '@nikovirtala/projen-aws-cdk-app'

AwsCdkApp.isProject(x: any)

Test whether the given construct is a project.

xRequired
  • Type: any

of
import { AwsCdkApp } from '@nikovirtala/projen-aws-cdk-app'

AwsCdkApp.of(construct: IConstruct)

Find the closest ancestor project for given construct.

When given a project, this it the project itself.

constructRequired
  • Type: constructs.IConstruct

Properties

Name Type Description
node constructs.Node The tree node.
buildTask projen.Task No description.
commitGenerated boolean Whether to commit the managed files by default.
compileTask projen.Task No description.
components projen.Component[] Returns all the components within this project.
deps projen.Dependencies Project dependencies.
ejected boolean Whether or not the project is being ejected.
files projen.FileBase[] All files in this project.
gitattributes projen.GitAttributesFile The .gitattributes file for this repository.
gitignore projen.IgnoreFile .gitignore.
logger projen.Logger Logging utilities.
name string Project name.
outdir string Absolute output directory of this project.
packageTask projen.Task No description.
postCompileTask projen.Task No description.
preCompileTask projen.Task No description.
projectBuild projen.ProjectBuild Manages the build process of the project.
projenCommand string The command to use in order to run the projen CLI.
root projen.Project The root project.
subprojects projen.Project[] Returns all the subprojects within this project.
tasks projen.Tasks Project tasks.
testTask projen.Task No description.
defaultTask projen.Task This is the "default" task, the one that executes "projen".
initProject projen.InitProject The options used when this project is bootstrapped via projen new.
parent projen.Project A parent project.
projectType projen.ProjectType No description.
autoApprove projen.github.AutoApprove Auto approve set up for this project.
devContainer projen.vscode.DevContainer Access for .devcontainer.json (used for GitHub Codespaces).
github projen.github.GitHub Access all github components.
gitpod projen.Gitpod Access for Gitpod.
vscode projen.vscode.VsCode Access all VSCode components.
allowLibraryDependencies boolean No description.
artifactsDirectory string The build output directory.
artifactsJavascriptDirectory string The location of the npm tarball after build (${artifactsDirectory}/js).
bundler projen.javascript.Bundler No description.
entrypoint string No description.
manifest any No description.
npmrc projen.javascript.NpmConfig The .npmrc file.
package projen.javascript.NodePackage API for managing the node package.
packageManager projen.javascript.NodePackageManager The package manager to use.
runScriptCommand string The command to use to run scripts (e.g. yarn run or npm run depends on the package manager).
autoMerge projen.github.AutoMerge Component that sets up mergify for merging approved pull requests.
buildWorkflow projen.build.BuildWorkflow The PR build GitHub workflow.
buildWorkflowJobId string The job ID of the build workflow.
jest projen.javascript.Jest The Jest configuration (if enabled).
maxNodeVersion string Maximum node version supported by this package.
minNodeVersion string The minimum node version required by this package to function.
npmignore projen.IgnoreFile The .npmignore file.
prettier projen.javascript.Prettier No description.
publisher projen.release.Publisher Package publisher.
release projen.release.Release Release management.
upgradeWorkflow projen.javascript.UpgradeDependencies The upgrade workflow.
docsDirectory string No description.
libdir string The directory in which compiled .js files reside.
srcdir string The directory in which the .ts sources reside.
testdir string The directory in which tests reside.
tsconfigDev projen.javascript.TypescriptConfig A typescript configuration file which covers all files (sources, tests, projen).
watchTask projen.Task The "watch" task.
docgen boolean No description.
eslint projen.javascript.Eslint No description.
tsconfig projen.javascript.TypescriptConfig No description.
tsconfigEslint projen.javascript.TypescriptConfig No description.
appEntrypoint string The CDK app entrypoint.
cdkConfig projen.awscdk.CdkConfig cdk.json configuration.
cdkDeps projen.awscdk.AwsCdkDeps No description.
cdkTasks projen.awscdk.CdkTasks Common CDK tasks.
cdkVersion string The CDK version this app is using.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


buildTaskRequired
public readonly buildTask: Task;
  • Type: projen.Task

commitGeneratedRequired
public readonly commitGenerated: boolean;
  • Type: boolean

Whether to commit the managed files by default.


compileTaskRequired
public readonly compileTask: Task;
  • Type: projen.Task

componentsRequired
public readonly components: Component[];
  • Type: projen.Component[]

Returns all the components within this project.


depsRequired
public readonly deps: Dependencies;
  • Type: projen.Dependencies

Project dependencies.


ejectedRequired
public readonly ejected: boolean;
  • Type: boolean

Whether or not the project is being ejected.


filesRequired
public readonly files: FileBase[];
  • Type: projen.FileBase[]

All files in this project.


gitattributesRequired
public readonly gitattributes: GitAttributesFile;
  • Type: projen.GitAttributesFile

The .gitattributes file for this repository.


gitignoreRequired
public readonly gitignore: IgnoreFile;
  • Type: projen.IgnoreFile

.gitignore.


loggerRequired
public readonly logger: Logger;
  • Type: projen.Logger

Logging utilities.


nameRequired
public readonly name: string;
  • Type: string

Project name.


outdirRequired
public readonly outdir: string;
  • Type: string

Absolute output directory of this project.


packageTaskRequired
public readonly packageTask: Task;
  • Type: projen.Task

postCompileTaskRequired
public readonly postCompileTask: Task;
  • Type: projen.Task

preCompileTaskRequired
public readonly preCompileTask: Task;
  • Type: projen.Task

projectBuildRequired
public readonly projectBuild: ProjectBuild;
  • Type: projen.ProjectBuild

Manages the build process of the project.


projenCommandRequired
public readonly projenCommand: string;
  • Type: string

The command to use in order to run the projen CLI.


rootRequired
public readonly root: Project;
  • Type: projen.Project

The root project.


subprojectsRequired
public readonly subprojects: Project[];
  • Type: projen.Project[]

Returns all the subprojects within this project.


tasksRequired
public readonly tasks: Tasks;
  • Type: projen.Tasks

Project tasks.


testTaskRequired
public readonly testTask: Task;
  • Type: projen.Task

defaultTaskOptional
public readonly defaultTask: Task;
  • Type: projen.Task

This is the "default" task, the one that executes "projen".

Undefined if the project is being ejected.


initProjectOptional
public readonly initProject: InitProject;
  • Type: projen.InitProject

The options used when this project is bootstrapped via projen new.

It includes the original set of options passed to the CLI and also the JSII FQN of the project type.


parentOptional
public readonly parent: Project;
  • Type: projen.Project

A parent project.

If undefined, this is the root project.


projectTypeRequired
public readonly projectType: ProjectType;
  • Type: projen.ProjectType

autoApproveOptional
public readonly autoApprove: AutoApprove;
  • Type: projen.github.AutoApprove

Auto approve set up for this project.


devContainerOptional
public readonly devContainer: DevContainer;
  • Type: projen.vscode.DevContainer

Access for .devcontainer.json (used for GitHub Codespaces).

This will be undefined if devContainer boolean is false


githubOptional
public readonly github: GitHub;
  • Type: projen.github.GitHub

Access all github components.

This will be undefined for subprojects.


gitpodOptional
public readonly gitpod: Gitpod;
  • Type: projen.Gitpod

Access for Gitpod.

This will be undefined if gitpod boolean is false


vscodeOptional
public readonly vscode: VsCode;
  • Type: projen.vscode.VsCode

Access all VSCode components.

This will be undefined for subprojects.


allowLibraryDependenciesRequired
  • Deprecated: use package.allowLibraryDependencies
public readonly allowLibraryDependencies: boolean;
  • Type: boolean

artifactsDirectoryRequired
public readonly artifactsDirectory: string;
  • Type: string

The build output directory.

An npm tarball will be created under the js subdirectory. For example, if this is set to dist (the default), the npm tarball will be placed under dist/js/boom-boom-1.2.3.tg.


artifactsJavascriptDirectoryRequired
public readonly artifactsJavascriptDirectory: string;
  • Type: string

The location of the npm tarball after build (${artifactsDirectory}/js).


bundlerRequired
public readonly bundler: Bundler;
  • Type: projen.javascript.Bundler

entrypointRequired
  • Deprecated: use package.entrypoint
public readonly entrypoint: string;
  • Type: string

manifestRequired
  • Deprecated: use package.addField(x, y)
public readonly manifest: any;
  • Type: any

npmrcRequired
public readonly npmrc: NpmConfig;
  • Type: projen.javascript.NpmConfig

The .npmrc file.


packageRequired
public readonly package: NodePackage;
  • Type: projen.javascript.NodePackage

API for managing the node package.


packageManagerRequired
  • Deprecated: use package.packageManager
public readonly packageManager: NodePackageManager;
  • Type: projen.javascript.NodePackageManager

The package manager to use.


runScriptCommandRequired
public readonly runScriptCommand: string;
  • Type: string

The command to use to run scripts (e.g. yarn run or npm run depends on the package manager).


autoMergeOptional
public readonly autoMerge: AutoMerge;
  • Type: projen.github.AutoMerge

Component that sets up mergify for merging approved pull requests.


buildWorkflowOptional
public readonly buildWorkflow: BuildWorkflow;
  • Type: projen.build.BuildWorkflow

The PR build GitHub workflow.

undefined if buildWorkflow is disabled.


buildWorkflowJobIdOptional
public readonly buildWorkflowJobId: string;
  • Type: string

The job ID of the build workflow.


jestOptional
public readonly jest: Jest;
  • Type: projen.javascript.Jest

The Jest configuration (if enabled).


maxNodeVersionOptional
public readonly maxNodeVersion: string;
  • Type: string

Maximum node version supported by this package.

The value indicates the package is incompatible with newer versions.


minNodeVersionOptional
public readonly minNodeVersion: string;
  • Type: string

The minimum node version required by this package to function.

This value indicates the package is incompatible with older versions.


npmignoreOptional
public readonly npmignore: IgnoreFile;
  • Type: projen.IgnoreFile

The .npmignore file.


prettierOptional
public readonly prettier: Prettier;
  • Type: projen.javascript.Prettier

publisherOptional
  • Deprecated: use release.publisher.
public readonly publisher: Publisher;
  • Type: projen.release.Publisher

Package publisher.

This will be undefined if the project does not have a release workflow.


releaseOptional
public readonly release: Release;
  • Type: projen.release.Release

Release management.


upgradeWorkflowOptional
public readonly upgradeWorkflow: UpgradeDependencies;
  • Type: projen.javascript.UpgradeDependencies

The upgrade workflow.


docsDirectoryRequired
public readonly docsDirectory: string;
  • Type: string

libdirRequired
public readonly libdir: string;
  • Type: string

The directory in which compiled .js files reside.


srcdirRequired
public readonly srcdir: string;
  • Type: string

The directory in which the .ts sources reside.


testdirRequired
public readonly testdir: string;
  • Type: string

The directory in which tests reside.


tsconfigDevRequired
public readonly tsconfigDev: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

A typescript configuration file which covers all files (sources, tests, projen).


watchTaskRequired
public readonly watchTask: Task;
  • Type: projen.Task

The "watch" task.


docgenOptional
public readonly docgen: boolean;
  • Type: boolean

eslintOptional
public readonly eslint: Eslint;
  • Type: projen.javascript.Eslint

tsconfigOptional
public readonly tsconfig: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

tsconfigEslintOptional
public readonly tsconfigEslint: TypescriptConfig;
  • Type: projen.javascript.TypescriptConfig

appEntrypointRequired
public readonly appEntrypoint: string;
  • Type: string

The CDK app entrypoint.


cdkConfigRequired
public readonly cdkConfig: CdkConfig;
  • Type: projen.awscdk.CdkConfig

cdk.json configuration.


cdkDepsRequired
public readonly cdkDeps: AwsCdkDeps;
  • Type: projen.awscdk.AwsCdkDeps

cdkTasksRequired
public readonly cdkTasks: CdkTasks;
  • Type: projen.awscdk.CdkTasks

Common CDK tasks.


cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string

The CDK version this app is using.


Constants

Name Type Description
DEFAULT_TASK string The name of the default task (the task executed when projen is run without arguments).
DEFAULT_TS_JEST_TRANFORM_PATTERN string No description.

DEFAULT_TASKRequired
public readonly DEFAULT_TASK: string;
  • Type: string

The name of the default task (the task executed when projen is run without arguments).

Normally this task should synthesize the project files.


DEFAULT_TS_JEST_TRANFORM_PATTERNRequired
public readonly DEFAULT_TS_JEST_TRANFORM_PATTERN: string;
  • Type: string

Structs

AwsCdkAppOptions

AwsCdkAppOptions.

Initializer

import { AwsCdkAppOptions } from '@nikovirtala/projen-aws-cdk-app'

const awsCdkAppOptions: AwsCdkAppOptions = { ... }

Properties

Name Type Description
cdkVersion string Minimum version of the AWS CDK to depend on.
defaultReleaseBranch string The name of the main release branch.
name string This is the name of your project.
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
appEntrypoint string The CDK app's entrypoint (relative to the source directory, which is "src" by default).
artifactsDirectory string A directory which will contain build artifacts.
authorEmail string Author's e-mail.
authorName string Author's name.
authorOrganization boolean Is the author an organization.
authorUrl string Author's URL / Website.
autoApproveOptions projen.github.AutoApproveOptions Enable and configure the 'auto approve' workflow.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
autoDetectBin boolean Automatically add all executables under the bin directory to your package.json file under the bin section.
autoMerge boolean Enable automatic merging on GitHub.
autoMergeOptions projen.github.AutoMergeOptions Configure options for automatic merging on GitHub.
bin {[ key: string ]: string} Binary programs vended with your module.
bugsEmail string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
buildCommand string A command to execute before synthesis.
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowOptions projen.javascript.BuildWorkflowOptions Options for PR build workflow.
bumpPackage string The commit-and-tag-version compatible package used to bump the package version, as a dependency string.
bundledDeps string[] List of dependencies to bundle into this module.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
bunVersion string The version of Bun to use if using Bun as a package manager.
cdkAssertions boolean Install the assertions library?
cdkCliVersion string Version range of the AWS CDK CLI to depend on.
cdkout string cdk.out directory.
cdkVersionPinning boolean Use pinned version instead of caret version for CDK.
checkLicenses projen.javascript.LicenseCheckerOptions Configure which licenses should be deemed acceptable for use by dependencies.
clobber boolean Add a clobber task which resets the repo to origin.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
codeCov boolean Define a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v4 A secret is required for private repos. Configured with @codeCovTokenSecret.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
commitGenerated boolean Whether to commit the managed files by default.
constructsVersion string Minimum version of the constructs library to depend on.
context {[ key: string ]: any} Additional context to include in cdk.json.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
deps string[] Runtime dependencies of this module.
depsUpgrade boolean Use tasks and github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
description string The description is just a string that helps people understand the purpose of the package.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
devDeps string[] Build dependencies for this module.
disableTsconfig boolean Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
disableTsconfigDev boolean Do not generate a tsconfig.dev.json file.
docgen boolean Docgen by Typedoc.
docsDirectory string Docs directory.
edgeLambdaAutoDiscover boolean Automatically adds an cloudfront.experimental.EdgeFunction for each .edge-lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.
entrypoint string Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.
entrypointTypes string The .d.ts file that includes the type declarations for this module.
eslint boolean Setup eslint.
eslintOptions projen.javascript.EslintOptions Eslint options.
experimentalIntegRunner boolean Enable experimental support for the AWS CDK integ-runner.
featureFlags boolean Include all feature flags in cdk.json.
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitignore string[] Additional entries to .gitignore.
gitIgnoreOptions projen.IgnoreFileOptions Configuration options for .gitignore file.
gitOptions projen.GitOptions Configuration options for git.
gitpod boolean Add a Gitpod development environment.
homepage string Package's Homepage / Website.
integrationTestAutoDiscover boolean Automatically discovers and creates integration tests for each .integ.ts file in under your test directory.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
keywords string[] Keywords to include in package.json.
lambdaAutoDiscover boolean Automatically adds an awscdk.LambdaFunction for each .lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.
lambdaExtensionAutoDiscover boolean Automatically adds an awscdk.LambdaExtension for each .lambda-extension.ts entrypoint in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.
lambdaOptions projen.awscdk.LambdaFunctionCommonOptions Common options for all AWS Lambda functions.
libdir string Typescript artifacts output directory.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
logging projen.LoggerOptions Configure logging options such as verbosity.
majorVersion number Major version to release from the default branch.
maxNodeVersion string The maximum node version supported by this package.
minMajorVersion number Minimal Major version to release.
minNodeVersion string The minimum node version required by this package to function.
nextVersionCommand string A shell command to control the next version to release.
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmDistTag string The npmDistTag to use when publishing from the default branch.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions projen.IgnoreFileOptions Configuration options for .npmignore file.
npmProvenance boolean Should provenance statements be generated when the package is published.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
outdir string The root directory of the project. Relative to this directory, all files are synthesized.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
parent projen.Project The parent project, if this project is part of a bigger project.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
pnpmVersion string The version of PNPM to use if using PNPM as a package manager.
postBuildSteps projen.github.workflows.JobStep[] Steps to execute after build as part of the release workflow.
prerelease string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projenCommand string The shell command to use in order to run the projen CLI.
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcJsonOptions Options for .projenrc.json.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenrcTs boolean Use TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions projen.typescript.ProjenrcOptions Options for .projenrc.ts.
projenVersion string Version of projen to install.
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
readme projen.SampleReadmeProps The README setup.
releasableCommits projen.ReleasableCommits Find commits that should be considered releasable Used to decide if a release is required.
release boolean Add release management to this project.
releaseBranches {[ key: string ]: projen.release.BranchOptions} Defines additional release branches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseTagPrefix string Automatically add the given prefix to release tags.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflowName string The name of the default release workflow.
releaseWorkflowSetupSteps projen.github.workflows.JobStep[] A set of workflow steps to execute in order to setup the workflow container.
renovatebot boolean Use renovatebot to handle dependency upgrades.
renovatebotOptions projen.RenovatebotOptions Options for renovatebot.
repository string The repository is the location where the actual code for your package lives.
repositoryDirectory string If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.
requireApproval projen.awscdk.ApprovalLevel To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.
sampleCode boolean Generate one-time sample in src/ and test/ if there are no files there.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
srcdir string Typescript sources directory.
stability string Package's Stability.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
testdir string Jest tests directory.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfigDev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile string The name of the development tsconfig.json file.
typescriptVersion string TypeScript version to use.
versionrcOptions {[ key: string ]: any} Custom configuration used when creating changelog with commit-and-tag-version package.
vitest boolean Enable testing with Vitest.
vitestOptions @nikovirtala/projen-vitest.VitestOptions The Vitest configuration (when enabled).
vscode boolean Enable VSCode integration.
watchExcludes string[] Glob patterns to exclude from cdk watch.
watchIncludes string[] Glob patterns to include in cdk watch.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowContainerImage string Container image to use for GitHub workflows.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version used in GitHub Actions workflows.
workflowPackageCache boolean Enable Node.js package cache in GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
workflowRunsOnGroup projen.GroupRunnerOptions Github Runner Group selection options.
yarnBerryOptions projen.javascript.YarnBerryOptions Options for Yarn Berry.

cdkVersionRequired
public readonly cdkVersion: string;
  • Type: string
  • Default: "2.1.0"

Minimum version of the AWS CDK to depend on.


defaultReleaseBranchRequired
public readonly defaultReleaseBranch: string;
  • Type: string
  • Default: "main"

The name of the main release branch.


nameRequired
public readonly name: string;
  • Type: string
  • Default: $BASEDIR

This is the name of your project.


allowLibraryDependenciesOptional
public readonly allowLibraryDependencies: boolean;
  • Type: boolean
  • Default: true

Allow the project to include peerDependencies and bundledDependencies.

This is normally only allowed for libraries. For apps, there's no meaning for specifying these.


appEntrypointOptional
public readonly appEntrypoint: string;
  • Type: string
  • Default: "main.ts"

The CDK app's entrypoint (relative to the source directory, which is "src" by default).


artifactsDirectoryOptional
public readonly artifactsDirectory: string;
  • Type: string
  • Default: "dist"

A directory which will contain build artifacts.


authorEmailOptional
public readonly authorEmail: string;
  • Type: string

Author's e-mail.


authorNameOptional
public readonly authorName: string;
  • Type: string

Author's name.


authorOrganizationOptional
public readonly authorOrganization: boolean;
  • Type: boolean

Is the author an organization.


authorUrlOptional
public readonly authorUrl: string;
  • Type: string

Author's URL / Website.


autoApproveOptionsOptional
public readonly autoApproveOptions: AutoApproveOptions;
  • Type: projen.github.AutoApproveOptions
  • Default: auto approve is disabled

Enable and configure the 'auto approve' workflow.


autoApproveUpgradesOptional
public readonly autoApproveUpgrades: boolean;
  • Type: boolean
  • Default: true

Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).

Throw if set to true but autoApproveOptions are not defined.


autoDetectBinOptional
public readonly autoDetectBin: boolean;
  • Type: boolean
  • Default: true

Automatically add all executables under the bin directory to your package.json file under the bin section.


autoMergeOptional
public readonly autoMerge: boolean;
  • Type: boolean
  • Default: true

Enable automatic merging on GitHub.

Has no effect if github.mergify is set to false.


autoMergeOptionsOptional
public readonly autoMergeOptions: AutoMergeOptions;
  • Type: projen.github.AutoMergeOptions
  • Default: see defaults in AutoMergeOptions

Configure options for automatic merging on GitHub.

Has no effect if github.mergify or autoMerge is set to false.


binOptional
public readonly bin: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Binary programs vended with your module.

You can use this option to add/customize how binaries are represented in your package.json, but unless autoDetectBin is false, every executable file under bin will automatically be added to this section.


bugsEmailOptional
public readonly bugsEmail: string;
  • Type: string

The email address to which issues should be reported.


bugsUrlOptional
public readonly bugsUrl: string;
  • Type: string

The url to your project's issue tracker.


buildCommandOptional
public readonly buildCommand: string;
  • Type: string
  • Default: no build command

A command to execute before synthesis.

This command will be called when running cdk synth or when cdk watch identifies a change in your source code before redeployment.


buildWorkflowOptional
public readonly buildWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


buildWorkflowOptionsOptional
public readonly buildWorkflowOptions: BuildWorkflowOptions;
  • Type: projen.javascript.BuildWorkflowOptions

Options for PR build workflow.


bumpPackageOptional
public readonly bumpPackage: string;
  • Type: string
  • Default: A recent version of "commit-and-tag-version"

The commit-and-tag-version compatible package used to bump the package version, as a dependency string.

This can be any compatible package version, including the deprecated standard-version@9.


bundledDepsOptional
public readonly bundledDeps: string[];
  • Type: string[]

List of dependencies to bundle into this module.

These modules will be added both to the dependencies section and bundledDependencies section of your package.json.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


bundlerOptionsOptional
public readonly bundlerOptions: BundlerOptions;
  • Type: projen.javascript.BundlerOptions

Options for Bundler.


bunVersionOptional
public readonly bunVersion: string;
  • Type: string
  • Default: "latest"

The version of Bun to use if using Bun as a package manager.


cdkAssertionsOptional
public readonly cdkAssertions: boolean;
  • Type: boolean
  • Default: will be included by default for AWS CDK >= 1.111.0 < 2.0.0

Install the assertions library?

Only needed for CDK 1.x. If using CDK 2.x then assertions is already included in 'aws-cdk-lib'


cdkCliVersionOptional
public readonly cdkCliVersion: string;
  • Type: string
  • Default: "^2"

Version range of the AWS CDK CLI to depend on.

Can be either a specific version, or an NPM version range.

By default, the latest 2.x version will be installed; you can use this option to restrict it to a specific version or version range.


cdkoutOptional
public readonly cdkout: string;
  • Type: string
  • Default: "cdk.out"

cdk.out directory.


cdkVersionPinningOptional
public readonly cdkVersionPinning: boolean;
  • Type: boolean

Use pinned version instead of caret version for CDK.

You can use this to prevent mixed versions for your CDK dependencies and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.


checkLicensesOptional
public readonly checkLicenses: LicenseCheckerOptions;
  • Type: projen.javascript.LicenseCheckerOptions
  • Default: no license checks are run during the build and all licenses will be accepted

Configure which licenses should be deemed acceptable for use by dependencies.

This setting will cause the build to fail, if any prohibited or not allowed licenses ares encountered.


clobberOptional
public readonly clobber: boolean;
  • Type: boolean
  • Default: true, but false for subprojects

Add a clobber task which resets the repo to origin.


codeArtifactOptionsOptional
public readonly codeArtifactOptions: CodeArtifactOptions;
  • Type: projen.javascript.CodeArtifactOptions
  • Default: undefined

Options for npm packages using AWS CodeArtifact.

This is required if publishing packages to, or installing scoped packages from AWS CodeArtifact


codeCovOptional
public readonly codeCov: boolean;
  • Type: boolean
  • Default: false

Define a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v4 A secret is required for private repos. Configured with @codeCovTokenSecret.


codeCovTokenSecretOptional
public readonly codeCovTokenSecret: string;
  • Type: string
  • Default: if this option is not specified, only public repositories are supported

Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.


commitGeneratedOptional
public readonly commitGenerated: boolean;
  • Type: boolean
  • Default: true

Whether to commit the managed files by default.


constructsVersionOptional
public readonly constructsVersion: string;
  • Type: string
  • Default: for CDK 1.x the default is "3.2.27", for CDK 2.x the default is "10.0.5".

Minimum version of the constructs library to depend on.


contextOptional
public readonly context: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: no additional context

Additional context to include in cdk.json.


copyrightOwnerOptional
public readonly copyrightOwner: string;
  • Type: string
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyrightPeriodOptional
public readonly copyrightPeriod: string;
  • Type: string
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
public readonly dependabot: boolean;
  • Type: boolean
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabotOptionsOptional
public readonly dependabotOptions: DependabotOptions;
  • Type: projen.github.DependabotOptions
  • Default: default options

Options for dependabot.


depsOptional
public readonly deps: string[];
  • Type: string[]
  • Default: []

Runtime dependencies of this module.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


depsUpgradeOptional
public readonly depsUpgrade: boolean;
  • Type: boolean
  • Default: true

Use tasks and github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


depsUpgradeOptionsOptional
public readonly depsUpgradeOptions: UpgradeDependenciesOptions;
  • Type: projen.javascript.UpgradeDependenciesOptions
  • Default: default options

Options for UpgradeDependencies.


descriptionOptional
public readonly description: string;
  • Type: string

The description is just a string that helps people understand the purpose of the package.

It can be used when searching for packages in a package manager as well. See https://classic.yarnpkg.com/en/docs/package-json/#toc-description


devContainerOptional
public readonly devContainer: boolean;
  • Type: boolean
  • Default: false

Add a VSCode development environment (used for GitHub Codespaces).


devDepsOptional
public readonly devDeps: string[];
  • Type: string[]
  • Default: []

Build dependencies for this module.

These dependencies will only be available in your build environment but will not be fetched when this module is consumed.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


disableTsconfigOptional
public readonly disableTsconfig: boolean;
  • Type: boolean
  • Default: false

Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).


disableTsconfigDevOptional
public readonly disableTsconfigDev: boolean;
  • Type: boolean
  • Default: false

Do not generate a tsconfig.dev.json file.


docgenOptional
public readonly docgen: boolean;
  • Type: boolean
  • Default: false

Docgen by Typedoc.


docsDirectoryOptional
public readonly docsDirectory: string;
  • Type: string
  • Default: "docs"

Docs directory.


edgeLambdaAutoDiscoverOptional
public readonly edgeLambdaAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an cloudfront.experimental.EdgeFunction for each .edge-lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.


entrypointOptional
public readonly entrypoint: string;
  • Type: string
  • Default: "lib/index.js"

Module entrypoint (main in package.json). Set to an empty string to not include main in your package.json.


entrypointTypesOptional
public readonly entrypointTypes: string;
  • Type: string
  • Default: .d.ts file derived from the project's entrypoint (usually lib/index.d.ts)

The .d.ts file that includes the type declarations for this module.


eslintOptional
public readonly eslint: boolean;
  • Type: boolean
  • Default: true

Setup eslint.


eslintOptionsOptional
public readonly eslintOptions: EslintOptions;
  • Type: projen.javascript.EslintOptions
  • Default: opinionated default options

Eslint options.


experimentalIntegRunnerOptional
public readonly experimentalIntegRunner: boolean;
  • Type: boolean
  • Default: false

Enable experimental support for the AWS CDK integ-runner.


featureFlagsOptional
public readonly featureFlags: boolean;
  • Type: boolean
  • Default: true

Include all feature flags in cdk.json.


githubOptional
public readonly github: boolean;
  • Type: boolean
  • Default: true

Enable GitHub integration.

Enabled by default for root projects. Disabled for non-root projects.


githubOptionsOptional
public readonly githubOptions: GitHubOptions;
  • Type: projen.github.GitHubOptions
  • Default: see GitHubOptions

Options for GitHub integration.


gitignoreOptional
public readonly gitignore: string[];
  • Type: string[]

Additional entries to .gitignore.


gitIgnoreOptionsOptional
public readonly gitIgnoreOptions: IgnoreFileOptions;
  • Type: projen.IgnoreFileOptions

Configuration options for .gitignore file.


gitOptionsOptional
public readonly gitOptions: GitOptions;
  • Type: projen.GitOptions

Configuration options for git.


gitpodOptional
public readonly gitpod: boolean;
  • Type: boolean
  • Default: false

Add a Gitpod development environment.


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


integrationTestAutoDiscoverOptional
public readonly integrationTestAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically discovers and creates integration tests for each .integ.ts file in under your test directory.


jsiiReleaseVersionOptional
public readonly jsiiReleaseVersion: string;
  • Type: string
  • Default: "latest"

Version requirement of publib which is used to publish modules to npm.


keywordsOptional
public readonly keywords: string[];
  • Type: string[]

Keywords to include in package.json.


lambdaAutoDiscoverOptional
public readonly lambdaAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an awscdk.LambdaFunction for each .lambda.ts handler in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.


lambdaExtensionAutoDiscoverOptional
public readonly lambdaExtensionAutoDiscover: boolean;
  • Type: boolean
  • Default: true

Automatically adds an awscdk.LambdaExtension for each .lambda-extension.ts entrypoint in your source tree. If this is disabled, you can manually add an awscdk.AutoDiscover component to your project.


lambdaOptionsOptional
public readonly lambdaOptions: LambdaFunctionCommonOptions;
  • Type: projen.awscdk.LambdaFunctionCommonOptions
  • Default: default options

Common options for all AWS Lambda functions.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


licenseOptional
public readonly license: string;
  • Type: string
  • Default: "Apache-2.0"

License's SPDX identifier.

See https://github.com/projen/projen/tree/main/license-text for a list of supported licenses. Use the licensed option if you want to no license to be specified.


licensedOptional
public readonly licensed: boolean;
  • Type: boolean
  • Default: true

Indicates if a license should be added.


loggingOptional
public readonly logging: LoggerOptions;
  • Type: projen.LoggerOptions
  • Default: {}

Configure logging options such as verbosity.


majorVersionOptional
public readonly majorVersion: number;
  • Type: number
  • Default: Major version is not enforced.

Major version to release from the default branch.

If this is specified, we bump the latest version of this major version line. If not specified, we bump the global latest version.


maxNodeVersionOptional
public readonly maxNodeVersion: string;
  • Type: string
  • Default: no maximum version is enforced

The maximum node version supported by this package.

Most projects should not use this option. The value indicates that the package is incompatible with any newer versions of node. This requirement is enforced via the engines field.

You will normally not need to set this option. Consider this option only if your package is known to not function with newer versions of node.


minMajorVersionOptional
public readonly minMajorVersion: number;
  • Type: number
  • Default: No minimum version is being enforced

Minimal Major version to release.

This can be useful to set to 1, as breaking changes before the 1.x major release are not incrementing the major version number.

Can not be set together with majorVersion.


minNodeVersionOptional
public readonly minNodeVersion: string;
  • Type: string
  • Default: no minimum version is enforced

The minimum node version required by this package to function.

Most projects should not use this option. The value indicates that the package is incompatible with any older versions of node. This requirement is enforced via the engines field.

You will normally not need to set this option, even if your package is incompatible with EOL versions of node. Consider this option only if your package depends on a specific feature, that is not available in other LTS versions. Setting this option has very high impact on the consumers of your package, as package managers will actively prevent usage with node versions you have marked as incompatible.

To change the node version of your CI/CD workflows, use workflowNodeVersion.


nextVersionCommandOptional
public readonly nextVersionCommand: string;
  • Type: string
  • Default: The next version will be determined based on the commit history and project settings.

A shell command to control the next version to release.

If present, this shell command will be run before the bump is executed, and it determines what version to release. It will be executed in the following environment:

  • Working directory: the project directory.
  • $VERSION: the current version. Looks like 1.2.3.
  • $LATEST_TAG: the most recent tag. Looks like prefix-v1.2.3, or may be unset.

The command should print one of the following to stdout:

  • Nothing: the next version number will be determined based on commit history.
  • x.y.z: the next version number will be x.y.z.
  • major|minor|patch: the next version number will be the current version number with the indicated component bumped.

This setting cannot be specified together with minMajorVersion; the invoked script can be used to achieve the effects of minMajorVersion.


npmAccessOptional
public readonly npmAccess: NpmAccess;
  • Type: projen.javascript.NpmAccess
  • Default: for scoped packages (e.g. foo@bar), the default is NpmAccess.RESTRICTED, for non-scoped packages, the default is NpmAccess.PUBLIC.

Access level of the npm package.


npmDistTagOptional
public readonly npmDistTag: string;
  • Type: string
  • Default: "latest"

The npmDistTag to use when publishing from the default branch.

To set the npm dist-tag for release branches, set the npmDistTag property for each branch.


npmignoreEnabledOptional
public readonly npmignoreEnabled: boolean;
  • Type: boolean
  • Default: true

Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.


npmIgnoreOptionsOptional
public readonly npmIgnoreOptions: IgnoreFileOptions;
  • Type: projen.IgnoreFileOptions

Configuration options for .npmignore file.


npmProvenanceOptional
public readonly npmProvenance: boolean;
  • Type: boolean
  • Default: true for public packages, false otherwise

Should provenance statements be generated when the package is published.

A supported package manager is required to publish a package with npm provenance statements and you will need to use a supported CI/CD provider.

Note that the projen Release and Publisher components are using publib to publish packages, which is using npm internally and supports provenance statements independently of the package manager used.


npmRegistryUrlOptional
public readonly npmRegistryUrl: string;

The base URL of the npm package registry.

Must be a URL (e.g. start with "https://" or "http://")


npmTokenSecretOptional
public readonly npmTokenSecret: string;
  • Type: string
  • Default: "NPM_TOKEN"

GitHub secret which contains the NPM token to use when publishing packages.


outdirOptional
public readonly outdir: string;
  • Type: string
  • Default: "."

The root directory of the project. Relative to this directory, all files are synthesized.

If this project has a parent, this directory is relative to the parent directory and it cannot be the same as the parent or any of it's other subprojects.


packageOptional
public readonly package: boolean;
  • Type: boolean
  • Default: true

Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).


packageManagerOptional
public readonly packageManager: NodePackageManager;
  • Type: projen.javascript.NodePackageManager
  • Default: NodePackageManager.YARN_CLASSIC

The Node Package Manager used to execute scripts.


packageNameOptional
public readonly packageName: string;
  • Type: string
  • Default: defaults to project name

The "name" in package.json.


parentOptional
public readonly parent: Project;
  • Type: projen.Project

The parent project, if this project is part of a bigger project.


peerDependencyOptionsOptional
public readonly peerDependencyOptions: PeerDependencyOptions;
  • Type: projen.javascript.PeerDependencyOptions

Options for peerDeps.


peerDepsOptional
public readonly peerDeps: string[];
  • Type: string[]
  • Default: []

Peer dependencies for this module.

Dependencies listed here are required to be installed (and satisfied) by the consumer of this library. Using peer dependencies allows you to ensure that only a single module of a certain library exists in the node_modules tree of your consumers.

Note that prior to npm@7, peer dependencies are not automatically installed, which means that adding peer dependencies to a library will be a breaking change for your customers.

Unless peerDependencyOptions.pinnedDevDependency is disabled (it is enabled by default), projen will automatically add a dev dependency with a pinned version for each peer dependency. This will ensure that you build & test your module against the lowest peer version required.


pnpmVersionOptional
public readonly pnpmVersion: string;
  • Type: string
  • Default: "9"

The version of PNPM to use if using PNPM as a package manager.


postBuildStepsOptional
public readonly postBuildSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]
  • Default: []

Steps to execute after build as part of the release workflow.


prereleaseOptional
public readonly prerelease: string;
  • Type: string
  • Default: normal semantic versions

Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").


prettierOptional
public readonly prettier: boolean;
  • Type: boolean
  • Default: false

Setup prettier.


prettierOptionsOptional
public readonly prettierOptions: PrettierOptions;
  • Type: projen.javascript.PrettierOptions
  • Default: default options

Prettier options.


projenCommandOptional
public readonly projenCommand: string;
  • Type: string
  • Default: "npx projen"

The shell command to use in order to run the projen CLI.

Can be used to customize in special environments.


projenCredentialsOptional
public readonly projenCredentials: GithubCredentials;
  • Type: projen.github.GithubCredentials
  • Default: use a personal access token named PROJEN_GITHUB_TOKEN

Choose a method of providing GitHub API access for projen workflows.


projenDevDependencyOptional
public readonly projenDevDependency: boolean;
  • Type: boolean
  • Default: true if not a subproject

Indicates of "projen" should be installed as a devDependency.


projenrcJsOptional
public readonly projenrcJs: boolean;
  • Type: boolean
  • Default: true if projenrcJson is false

Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.


projenrcJsonOptional
public readonly projenrcJson: boolean;
  • Type: boolean
  • Default: false

Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.


projenrcJsonOptionsOptional
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
  • Type: projen.ProjenrcJsonOptions
  • Default: default options

Options for .projenrc.json.


projenrcJsOptionsOptional
public readonly projenrcJsOptions: ProjenrcOptions;
  • Type: projen.javascript.ProjenrcOptions
  • Default: default options

Options for .projenrc.js.


projenrcTsOptional
public readonly projenrcTs: boolean;
  • Type: boolean
  • Default: false

Use TypeScript for your projenrc file (.projenrc.ts).


projenrcTsOptionsOptional
public readonly projenrcTsOptions: ProjenrcOptions;
  • Type: projen.typescript.ProjenrcOptions

Options for .projenrc.ts.


projenVersionOptional
public readonly projenVersion: string;
  • Type: string
  • Default: Defaults to the latest version.

Version of projen to install.


publishDryRunOptional
public readonly publishDryRun: boolean;
  • Type: boolean
  • Default: false

Instead of actually publishing to package managers, just print the publishing command.


publishTasksOptional
public readonly publishTasks: boolean;
  • Type: boolean
  • Default: false

Define publishing tasks that can be executed manually as well as workflows.

Normally, publishing only happens within automated workflows. Enable this in order to create a publishing task for each publishing activity.


pullRequestTemplateOptional
public readonly pullRequestTemplate: boolean;
  • Type: boolean
  • Default: true

Include a GitHub pull request template.


pullRequestTemplateContentsOptional
public readonly pullRequestTemplateContents: string[];
  • Type: string[]
  • Default: default content

The contents of the pull request template.


readmeOptional
public readonly readme: SampleReadmeProps;
  • Type: projen.SampleReadmeProps
  • Default: { filename: 'README.md', contents: '# replace this' }

The README setup.


releasableCommitsOptional
public readonly releasableCommits: ReleasableCommits;
  • Type: projen.ReleasableCommits
  • Default: ReleasableCommits.everyCommit()

Find commits that should be considered releasable Used to decide if a release is required.


releaseOptional
public readonly release: boolean;
  • Type: boolean
  • Default: true (false for subprojects)

Add release management to this project.


releaseBranchesOptional
public readonly releaseBranches: {[ key: string ]: BranchOptions};
  • Type: {[ key: string ]: projen.release.BranchOptions}
  • Default: no additional branches are used for release. you can use addBranch() to add additional branches.

Defines additional release branches.

A workflow will be created for each release branch which will publish releases from commits in this branch. Each release branch must be assigned a major version number which is used to enforce that versions published from that branch always use that major version. If multiple branches are used, the majorVersion field must also be provided for the default branch.


releaseFailureIssueOptional
public readonly releaseFailureIssue: boolean;
  • Type: boolean
  • Default: false

Create a github issue on every failed publishing task.


releaseFailureIssueLabelOptional
public readonly releaseFailureIssueLabel: string;
  • Type: string
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


releaseTagPrefixOptional
public readonly releaseTagPrefix: string;
  • Type: string
  • Default: "v"

Automatically add the given prefix to release tags.

Useful if you are releasing on multiple branches with overlapping version numbers. Note: this prefix is used to detect the latest tagged version when bumping, so if you change this on a project with an existing version history, you may need to manually tag your latest release with the new prefix.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


releaseTriggerOptional
public readonly releaseTrigger: ReleaseTrigger;
  • Type: projen.release.ReleaseTrigger
  • Default: Continuous releases (ReleaseTrigger.continuous())

The release trigger to use.


releaseWorkflowNameOptional
public readonly releaseWorkflowName: string;
  • Type: string
  • Default: "release"

The name of the default release workflow.


releaseWorkflowSetupStepsOptional
public readonly releaseWorkflowSetupSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]

A set of workflow steps to execute in order to setup the workflow container.


renovatebotOptional
public readonly renovatebot: boolean;
  • Type: boolean
  • Default: false

Use renovatebot to handle dependency upgrades.


renovatebotOptionsOptional
public readonly renovatebotOptions: RenovatebotOptions;
  • Type: projen.RenovatebotOptions
  • Default: default options

Options for renovatebot.


repositoryOptional
public readonly repository: string;
  • Type: string

The repository is the location where the actual code for your package lives.

See https://classic.yarnpkg.com/en/docs/package-json/#toc-repository


repositoryDirectoryOptional
public readonly repositoryDirectory: string;
  • Type: string

If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.


requireApprovalOptional
public readonly requireApproval: ApprovalLevel;
  • Type: projen.awscdk.ApprovalLevel
  • Default: ApprovalLevel.BROADENING

To protect you against unintended changes that affect your security posture, the AWS CDK Toolkit prompts you to approve security-related changes before deploying them.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

Generate one-time sample in src/ and test/ if there are no files there.


scopedPackagesOptionsOptional
public readonly scopedPackagesOptions: ScopedPackagesOptions[];
  • Type: projen.javascript.ScopedPackagesOptions[]
  • Default: fetch all scoped packages from the public npm registry

Options for privately hosted scoped packages.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


staleOptional
public readonly stale: boolean;
  • Type: boolean
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


staleOptionsOptional
public readonly staleOptions: StaleOptions;
  • Type: projen.github.StaleOptions
  • Default: see defaults in StaleOptions

Auto-close stale issues and pull requests.

To disable set stale to false.


testdirOptional
public readonly testdir: string;
  • Type: string
  • Default: "test"

Jest tests directory.

Tests files should be named xxx.test.ts. If this directory is under srcdir (e.g. src/test, src/__tests__), then tests are going to be compiled into lib/ and executed as javascript. If the test directory is outside of src, then we configure jest to compile the code in-memory.


tsconfigOptional
public readonly tsconfig: TypescriptConfigOptions;
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: default options

Custom TSConfig.


tsconfigDevOptional
public readonly tsconfigDev: TypescriptConfigOptions;
  • Type: projen.javascript.TypescriptConfigOptions
  • Default: use the production tsconfig options

Custom tsconfig options for the development tsconfig.json file (used for testing).


tsconfigDevFileOptional
public readonly tsconfigDevFile: string;
  • Type: string
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


typescriptVersionOptional
public readonly typescriptVersion: string;
  • Type: string
  • Default: "latest"

TypeScript version to use.

NOTE: Typescript is not semantically versioned and should remain on the same minor, so we recommend using a ~ dependency (e.g. ~1.2.3).


versionrcOptionsOptional
public readonly versionrcOptions: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: standard configuration applicable for GitHub repositories

Custom configuration used when creating changelog with commit-and-tag-version package.

Given values either append to default configuration or overwrite values in it.


vitestOptional
public readonly vitest: boolean;
  • Type: boolean
  • Default: true

Enable testing with Vitest.


vitestOptionsOptional
public readonly vitestOptions: VitestOptions;
  • Type: @nikovirtala/projen-vitest.VitestOptions
  • Default: @nikovirtala/projen-vitest defaults

The Vitest configuration (when enabled).


vscodeOptional
public readonly vscode: boolean;
  • Type: boolean
  • Default: true

Enable VSCode integration.

Enabled by default for root projects. Disabled for non-root projects.


watchExcludesOptional
public readonly watchExcludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to exclude from cdk watch.


watchIncludesOptional
public readonly watchIncludes: string[];
  • Type: string[]
  • Default: []

Glob patterns to include in cdk watch.


workflowBootstrapStepsOptional
public readonly workflowBootstrapSteps: JobStep[];
  • Type: projen.github.workflows.JobStep[]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflowContainerImageOptional
public readonly workflowContainerImage: string;
  • Type: string
  • Default: default image

Container image to use for GitHub workflows.


workflowGitIdentityOptional
public readonly workflowGitIdentity: GitIdentity;
  • Type: projen.github.GitIdentity
  • Default: GitHub Actions

The git identity to use in workflows.


workflowNodeVersionOptional
public readonly workflowNodeVersion: string;
  • Type: string
  • Default: minNodeVersion if set, otherwise lts/*.

The node version used in GitHub Actions workflows.

Always use this option if your GitHub Actions workflows require a specific to run.


workflowPackageCacheOptional
public readonly workflowPackageCache: boolean;
  • Type: boolean
  • Default: false

Enable Node.js package cache in GitHub workflows.


workflowRunsOnOptional
public readonly workflowRunsOn: string[];
  • Type: string[]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


workflowRunsOnGroupOptional
public readonly workflowRunsOnGroup: GroupRunnerOptions;
  • Type: projen.GroupRunnerOptions

Github Runner Group selection options.


yarnBerryOptionsOptional
public readonly yarnBerryOptions: YarnBerryOptions;
  • Type: projen.javascript.YarnBerryOptions
  • Default: Yarn Berry v4 with all default options

Options for Yarn Berry.