Skip to content

Latest commit

 

History

History
2528 lines (1422 loc) · 78.7 KB

API.md

File metadata and controls

2528 lines (1422 loc) · 78.7 KB

API Reference

Structs

AwsCdkClosedSourceTypeScriptAppOptions

Initializer

import { AwsCdkClosedSourceTypeScriptAppOptions } from '@cloudgnosis/aws-cdk-app-templates'

const awsCdkClosedSourceTypeScriptAppOptions: AwsCdkClosedSourceTypeScriptAppOptions = { ... }
nameRequired
  • Type: string
  • Default: $BASEDIR

This is the name of your project.


loggingOptional

Configure logging options such as verbosity.


outdirOptional
  • 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 sub-projects.


parentOptional

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


projenrcJsonOptional
  • Type: boolean
  • Default: false

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


projenrcJsonOptionsOptional

Options for .projenrc.json.


autoApproveOptionsOptional

Enable and configure the 'auto approve' workflow.


autoMergeOptionsOptional

Configure options for automatic merging on GitHub.

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


clobberOptional
  • Type: boolean
  • Default: true

Add a clobber task which resets the repo to origin.


devContainerOptional
  • Type: boolean
  • Default: false

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


githubOptional
  • Type: boolean
  • Default: true

Enable GitHub integration.

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


githubOptionsOptional

Options for GitHub integration.


gitpodOptional
  • Type: boolean
  • Default: false

Add a Gitpod development environment.


mergifyOptional
  • Deprecated: use githubOptions.mergify instead

  • Type: boolean

  • Default: true

Whether mergify should be enabled on this repository or not.


projectTypeOptional
  • Deprecated: no longer supported at the base project level

  • Type: projen.ProjectType

  • Default: ProjectType.UNKNOWN

Which type of project this is (library/app).


readmeOptional

The README setup.


staleOptional
  • Type: boolean
  • Default: true

Auto-close of stale issues and pull request.

See staleOptions for options.


staleOptionsOptional

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
  • Type: boolean
  • Default: true

Enable VSCode integration.

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


allowLibraryDependenciesOptional
  • 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.


authorEmailOptional
  • Type: string

Author's e-mail.


authorNameOptional
  • Type: string

Author's name.


authorOrganizationOptional
  • Type: boolean

Author's Organization.


authorUrlOptional
  • Type: string

Author's URL / Website.


autoDetectBinOptional
  • Type: boolean
  • Default: true

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


binOptional
  • 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.


bundledDepsOptional
  • Type: string[]

List of dependencies to bundle into this module.

These modules will be added both to the dependencies section and peerDependencies 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.


depsOptional
  • 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.


descriptionOptional
  • 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


devDepsOptional
  • 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.


entrypointOptional
  • 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


homepageOptional
  • Type: string

Package's Homepage / Website.


keywordsOptional
  • Type: string[]

Keywords to include in package.json.


licenseOptional
  • Type: string
  • Default: "Apache-2.0"

License's SPDX identifier.

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


licensedOptional
  • Type: boolean
  • Default: true

Indicates if a license should be added.


maxNodeVersionOptional
  • Type: string
  • Default: no max

Minimum node.js version to require via engines (inclusive).


minNodeVersionOptional
  • Type: string
  • Default: no "engines" specified

Minimum Node.js version to require via package.json engines (inclusive).


npmAccessOptional
  • Type: projen.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
  • Type: string
  • Default: "latest"

Tags can be used to provide an alias instead of version numbers.

For example, a project might choose to have multiple streams of development and use a different tag for each stream, e.g., stable, beta, dev, canary.

By default, the latest tag is used by npm to identify the current version of a package, and npm install <pkg> (without any @<version> or @<tag> specifier) installs the latest tag. Typically, projects only use the latest tag for stable release versions, and use other tags for unstable versions such as prereleases.

The next tag is used by some projects to identify the upcoming version.


npmRegistryOptional
  • Deprecated: use npmRegistryUrl instead

  • Type: string

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npmRegistryUrlOptional

The base URL of the npm package registry.

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


npmTokenSecretOptional
  • Type: string
  • Default: "NPM_TOKEN"

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


packageManagerOptional

The Node Package Manager used to execute scripts.


packageNameOptional
  • Type: string
  • Default: defaults to project name

The "name" in package.json.


peerDependencyOptionsOptional

Options for peerDeps.


peerDepsOptional
  • 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.


projenCommandOptional
  • 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.


repositoryOptional
  • 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
  • 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.


scriptsOptional
  • Type: {[ key: string ]: string}
  • Default: {}

npm scripts to include.

If a script has the same name as a standard script, the standard script will be overwritten.


stabilityOptional
  • Type: string

Package's Stability.


antitamperOptional
  • Type: boolean
  • Default: true

Checks that after build there are no modified files on git.


artifactsDirectoryOptional
  • Type: string
  • Default: "dist"

A directory which will contain artifacts to be published to npm.


jsiiReleaseVersionOptional
  • Type: string
  • Default: "latest"

Version requirement of jsii-release which is used to publish modules to npm.


majorVersionOptional
  • 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.


postBuildStepsOptional

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


prereleaseOptional
  • Type: string
  • Default: normal semantic versions

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


releaseBranchesOptional
  • 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.


releaseEveryCommitOptional
  • Type: boolean
  • Default: true

Automatically release new versions every commit to one of branches in releaseBranches.


releaseFailureIssueOptional
  • Type: boolean
  • Default: false

Create a github issue on every failed publishing task.


releaseFailureIssueLabelOptional
  • Type: string
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


releaseScheduleOptional
  • Type: string
  • Default: no scheduled releases

CRON schedule to trigger new releases.


releaseWorkflowNameOptional
  • Type: string
  • Default: "Release"

The name of the default release workflow.


releaseWorkflowSetupStepsOptional

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


workflowContainerImageOptional
  • Type: string
  • Default: default image

Container image to use for GitHub workflows.


defaultReleaseBranchRequired
  • Type: string
  • Default: "main"

The name of the main release branch.


autoApproveProjenUpgradesOptional
  • Type: boolean
  • Default: false

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

Throw if set to true but autoApproveOptions are not defined.


autoApproveUpgradesOptional
  • 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.


buildWorkflowOptional
  • Type: boolean
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


codeCovOptional
  • Type: boolean
  • Default: false

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


codeCovTokenSecretOptional
  • 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.


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

License copyright owner.


copyrightPeriodOptional
  • Type: string
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
  • Deprecated: - use depsUpgrade: DependenciesUpgradeMechanism.dependabot()

  • Type: boolean

  • Default: false

Include dependabot configuration.


dependabotOptionsOptional

Options for dependabot.


depsUpgradeOptional
  • Type: projen.DependenciesUpgradeMechanism
  • Default: DependenciesUpgradeMechanism.dependabot if dependabot is true, otherwise a DependenciesUpgradeMechanism.githubWorkflow configured from other passed-in NodeProjectOptions

How to handle dependency upgrades.


gitignoreOptional
  • Type: string[]

Additional entries to .gitignore.


jestOptional
  • Type: boolean
  • Default: true

Setup jest unit tests.


jestOptionsOptional

Jest options.


mergifyOptionsOptional

Options for mergify.


mutableBuildOptional
  • Type: boolean
  • Default: true

Automatically update files modified during builds to pull-request branches.

This means that any files synthesized by projen or e.g. test snapshots will always be up-to-date before a PR is merged.

Implies that PR builds do not have anti-tamper checks.


npmignoreOptional
  • Deprecated: - use project.addPackageIgnore

  • Type: string[]

Additional entries to .npmignore.


npmignoreEnabledOptional
  • Type: boolean
  • Default: true

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


projenDevDependencyOptional
  • Type: boolean
  • Default: true

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


projenDuringBuildOptional
  • Type: boolean
  • Default: true

Execute projen as the first step of the build task to synthesize project files.

This applies both to local builds and to CI builds.

Disabling this feature is NOT RECOMMENDED and means that manual changes to synthesized project files will be persisted.


projenrcJsOptional
  • Type: boolean
  • Default: true if projenrcJson is false

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


projenrcJsOptionsOptional

Options for .projenrc.js.


projenUpgradeAutoMergeOptional
  • Deprecated: use autoApproveProjenUpgrades.

  • Type: boolean

  • Default: false

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

Throw if set to true but autoApproveOptions are not defined.


projenUpgradeScheduleOptional
  • Type: string[]
  • Default: [ "0 6 * * *" ]

Customize the projenUpgrade schedule in cron expression.


projenUpgradeSecretOptional
  • Type: string
  • Default: no automatic projen upgrade pull requests

Periodically submits a pull request for projen upgrades (executes yarn projen:upgrade).

This setting is a GitHub secret name which contains a GitHub Access Token with repo and workflow permissions.

This token is used to submit the upgrade pull request, which will likely include workflow updates.

To create a personal access token see https://github.com/settings/tokens


projenVersionOptional
  • Type: string
  • Default: Defaults to the latest version.

Version of projen to install.


pullRequestTemplateOptional
  • Type: boolean
  • Default: true

Include a GitHub pull request template.


pullRequestTemplateContentsOptional
  • Type: string
  • Default: default content

The contents of the pull request template.


releaseOptional
  • Type: boolean
  • Default: true (false for subprojects)

Add release management to this project.


releaseToNpmOptional
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


releaseWorkflowOptional
  • Deprecated: see release.

  • Type: boolean

  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflowBootstrapStepsOptional
  • Type: any[]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflowNodeVersionOptional
  • Type: string
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


compileBeforeTestOptional
  • Type: boolean
  • Default: if testdir is under src/**, the default is true, otherwise the default is `false.

Compile the code before running tests.


disableTsconfigOptional
  • Type: boolean
  • Default: false

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


docgenOptional
  • Type: boolean
  • Default: false

Docgen by Typedoc.


docsDirectoryOptional
  • Type: string
  • Default: "docs"

Docs directory.


entrypointTypesOptional
  • 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
  • Type: boolean
  • Default: true

Setup eslint.


eslintOptionsOptional

Eslint options.


libdirOptional
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


packageOptional
  • Type: boolean
  • Default: true

Defines a yarn package command that will produce a tarball and place it under dist/js.


projenrcTsOptional
  • Type: boolean
  • Default: false

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


projenrcTsOptionsOptional

Options for .projenrc.ts.


sampleCodeOptional
  • Type: boolean
  • Default: true

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


srcdirOptional
  • Type: string
  • Default: "src"

Typescript sources directory.


testdirOptional
  • 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

Custom TSConfig.


typescriptVersionOptional
  • 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).


cdkVersionRequired
  • Type: string
  • Default: "1.95.2"

AWS CDK version to use.


appEntrypointOptional
  • Type: string
  • Default: "main.ts"

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


cdkDependenciesOptional
  • Type: string[]

Which AWS CDK modules (those that start with "@aws-cdk/") this app uses.


cdkVersionPinningOptional
  • Type: boolean
  • Default: false

Use pinned version instead of caret version for CDK.

You can use this to prevent yarn to mix 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.


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

Additional context to include in cdk.json.


requireApprovalOptional

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.


closedSourceOptional
  • Type: boolean
  • Default: true

If set to true, some default values are modified compared to the settings for AwsCdkTypeScriptApp Specifically, the following default values are changed: - licensed is false by default - githubOptions.mergify is false by default.


AwsCdkTsLambdaRestApiAppOptions

Initializer

import { AwsCdkTsLambdaRestApiAppOptions } from '@cloudgnosis/aws-cdk-app-templates'

const awsCdkTsLambdaRestApiAppOptions: AwsCdkTsLambdaRestApiAppOptions = { ... }
nameRequired
  • Type: string
  • Default: $BASEDIR

This is the name of your project.


loggingOptional

Configure logging options such as verbosity.


outdirOptional
  • 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 sub-projects.


parentOptional

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


projenrcJsonOptional
  • Type: boolean
  • Default: false

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


projenrcJsonOptionsOptional

Options for .projenrc.json.


autoApproveOptionsOptional

Enable and configure the 'auto approve' workflow.


autoMergeOptionsOptional

Configure options for automatic merging on GitHub.

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


clobberOptional
  • Type: boolean
  • Default: true

Add a clobber task which resets the repo to origin.


devContainerOptional
  • Type: boolean
  • Default: false

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


githubOptional
  • Type: boolean
  • Default: true

Enable GitHub integration.

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


githubOptionsOptional

Options for GitHub integration.


gitpodOptional
  • Type: boolean
  • Default: false

Add a Gitpod development environment.


mergifyOptional
  • Deprecated: use githubOptions.mergify instead

  • Type: boolean

  • Default: true

Whether mergify should be enabled on this repository or not.


projectTypeOptional
  • Deprecated: no longer supported at the base project level

  • Type: projen.ProjectType

  • Default: ProjectType.UNKNOWN

Which type of project this is (library/app).


readmeOptional

The README setup.


staleOptional
  • Type: boolean
  • Default: true

Auto-close of stale issues and pull request.

See staleOptions for options.


staleOptionsOptional

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
  • Type: boolean
  • Default: true

Enable VSCode integration.

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


allowLibraryDependenciesOptional
  • 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.


authorEmailOptional
  • Type: string

Author's e-mail.


authorNameOptional
  • Type: string

Author's name.


authorOrganizationOptional
  • Type: boolean

Author's Organization.


authorUrlOptional
  • Type: string

Author's URL / Website.


autoDetectBinOptional
  • Type: boolean
  • Default: true

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


binOptional
  • 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.


bundledDepsOptional
  • Type: string[]

List of dependencies to bundle into this module.

These modules will be added both to the dependencies section and peerDependencies 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.


depsOptional
  • 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.


descriptionOptional
  • 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


devDepsOptional
  • 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.


entrypointOptional
  • 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


homepageOptional
  • Type: string

Package's Homepage / Website.


keywordsOptional
  • Type: string[]

Keywords to include in package.json.


licenseOptional
  • Type: string
  • Default: "Apache-2.0"

License's SPDX identifier.

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


licensedOptional
  • Type: boolean
  • Default: true

Indicates if a license should be added.


maxNodeVersionOptional
  • Type: string
  • Default: no max

Minimum node.js version to require via engines (inclusive).


minNodeVersionOptional
  • Type: string
  • Default: no "engines" specified

Minimum Node.js version to require via package.json engines (inclusive).


npmAccessOptional
  • Type: projen.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
  • Type: string
  • Default: "latest"

Tags can be used to provide an alias instead of version numbers.

For example, a project might choose to have multiple streams of development and use a different tag for each stream, e.g., stable, beta, dev, canary.

By default, the latest tag is used by npm to identify the current version of a package, and npm install <pkg> (without any @<version> or @<tag> specifier) installs the latest tag. Typically, projects only use the latest tag for stable release versions, and use other tags for unstable versions such as prereleases.

The next tag is used by some projects to identify the upcoming version.


npmRegistryOptional
  • Deprecated: use npmRegistryUrl instead

  • Type: string

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npmRegistryUrlOptional

The base URL of the npm package registry.

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


npmTokenSecretOptional
  • Type: string
  • Default: "NPM_TOKEN"

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


packageManagerOptional

The Node Package Manager used to execute scripts.


packageNameOptional
  • Type: string
  • Default: defaults to project name

The "name" in package.json.


peerDependencyOptionsOptional

Options for peerDeps.


peerDepsOptional
  • 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.


projenCommandOptional
  • 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.


repositoryOptional
  • 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
  • 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.


scriptsOptional
  • Type: {[ key: string ]: string}
  • Default: {}

npm scripts to include.

If a script has the same name as a standard script, the standard script will be overwritten.


stabilityOptional
  • Type: string

Package's Stability.


antitamperOptional
  • Type: boolean
  • Default: true

Checks that after build there are no modified files on git.


artifactsDirectoryOptional
  • Type: string
  • Default: "dist"

A directory which will contain artifacts to be published to npm.


jsiiReleaseVersionOptional
  • Type: string
  • Default: "latest"

Version requirement of jsii-release which is used to publish modules to npm.


majorVersionOptional
  • 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.


postBuildStepsOptional

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


prereleaseOptional
  • Type: string
  • Default: normal semantic versions

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


releaseBranchesOptional
  • 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.


releaseEveryCommitOptional
  • Type: boolean
  • Default: true

Automatically release new versions every commit to one of branches in releaseBranches.


releaseFailureIssueOptional
  • Type: boolean
  • Default: false

Create a github issue on every failed publishing task.


releaseFailureIssueLabelOptional
  • Type: string
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


releaseScheduleOptional
  • Type: string
  • Default: no scheduled releases

CRON schedule to trigger new releases.


releaseWorkflowNameOptional
  • Type: string
  • Default: "Release"

The name of the default release workflow.


releaseWorkflowSetupStepsOptional

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


workflowContainerImageOptional
  • Type: string
  • Default: default image

Container image to use for GitHub workflows.


defaultReleaseBranchRequired
  • Type: string
  • Default: "main"

The name of the main release branch.


autoApproveProjenUpgradesOptional
  • Type: boolean
  • Default: false

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

Throw if set to true but autoApproveOptions are not defined.


autoApproveUpgradesOptional
  • 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.


buildWorkflowOptional
  • Type: boolean
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


codeCovOptional
  • Type: boolean
  • Default: false

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


codeCovTokenSecretOptional
  • 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.


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

License copyright owner.


copyrightPeriodOptional
  • Type: string
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
  • Deprecated: - use depsUpgrade: DependenciesUpgradeMechanism.dependabot()

  • Type: boolean

  • Default: false

Include dependabot configuration.


dependabotOptionsOptional

Options for dependabot.


depsUpgradeOptional
  • Type: projen.DependenciesUpgradeMechanism
  • Default: DependenciesUpgradeMechanism.dependabot if dependabot is true, otherwise a DependenciesUpgradeMechanism.githubWorkflow configured from other passed-in NodeProjectOptions

How to handle dependency upgrades.


gitignoreOptional
  • Type: string[]

Additional entries to .gitignore.


jestOptional
  • Type: boolean
  • Default: true

Setup jest unit tests.


jestOptionsOptional

Jest options.


mergifyOptionsOptional

Options for mergify.


mutableBuildOptional
  • Type: boolean
  • Default: true

Automatically update files modified during builds to pull-request branches.

This means that any files synthesized by projen or e.g. test snapshots will always be up-to-date before a PR is merged.

Implies that PR builds do not have anti-tamper checks.


npmignoreOptional
  • Deprecated: - use project.addPackageIgnore

  • Type: string[]

Additional entries to .npmignore.


npmignoreEnabledOptional
  • Type: boolean
  • Default: true

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


projenDevDependencyOptional
  • Type: boolean
  • Default: true

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


projenDuringBuildOptional
  • Type: boolean
  • Default: true

Execute projen as the first step of the build task to synthesize project files.

This applies both to local builds and to CI builds.

Disabling this feature is NOT RECOMMENDED and means that manual changes to synthesized project files will be persisted.


projenrcJsOptional
  • Type: boolean
  • Default: true if projenrcJson is false

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


projenrcJsOptionsOptional

Options for .projenrc.js.


projenUpgradeAutoMergeOptional
  • Deprecated: use autoApproveProjenUpgrades.

  • Type: boolean

  • Default: false

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

Throw if set to true but autoApproveOptions are not defined.


projenUpgradeScheduleOptional
  • Type: string[]
  • Default: [ "0 6 * * *" ]

Customize the projenUpgrade schedule in cron expression.


projenUpgradeSecretOptional
  • Type: string
  • Default: no automatic projen upgrade pull requests

Periodically submits a pull request for projen upgrades (executes yarn projen:upgrade).

This setting is a GitHub secret name which contains a GitHub Access Token with repo and workflow permissions.

This token is used to submit the upgrade pull request, which will likely include workflow updates.

To create a personal access token see https://github.com/settings/tokens


projenVersionOptional
  • Type: string
  • Default: Defaults to the latest version.

Version of projen to install.


pullRequestTemplateOptional
  • Type: boolean
  • Default: true

Include a GitHub pull request template.


pullRequestTemplateContentsOptional
  • Type: string
  • Default: default content

The contents of the pull request template.


releaseOptional
  • Type: boolean
  • Default: true (false for subprojects)

Add release management to this project.


releaseToNpmOptional
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


releaseWorkflowOptional
  • Deprecated: see release.

  • Type: boolean

  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflowBootstrapStepsOptional
  • Type: any[]
  • Default: "yarn install --frozen-lockfile && yarn projen"

Workflow steps to use in order to bootstrap this repo.


workflowNodeVersionOptional
  • Type: string
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


compileBeforeTestOptional
  • Type: boolean
  • Default: if testdir is under src/**, the default is true, otherwise the default is `false.

Compile the code before running tests.


disableTsconfigOptional
  • Type: boolean
  • Default: false

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


docgenOptional
  • Type: boolean
  • Default: false

Docgen by Typedoc.


docsDirectoryOptional
  • Type: string
  • Default: "docs"

Docs directory.


entrypointTypesOptional
  • 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
  • Type: boolean
  • Default: true

Setup eslint.


eslintOptionsOptional

Eslint options.


libdirOptional
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


packageOptional
  • Type: boolean
  • Default: true

Defines a yarn package command that will produce a tarball and place it under dist/js.


projenrcTsOptional
  • Type: boolean
  • Default: false

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


projenrcTsOptionsOptional

Options for .projenrc.ts.


sampleCodeOptional
  • Type: boolean
  • Default: true

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


srcdirOptional
  • Type: string
  • Default: "src"

Typescript sources directory.


testdirOptional
  • 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

Custom TSConfig.


typescriptVersionOptional
  • 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).


cdkVersionRequired
  • Type: string
  • Default: "1.116.0"

AWS CDK version to use.


appEntrypointOptional
  • Type: string
  • Default: "main.ts"

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


cdkDependenciesOptional
  • Type: string[]

Which AWS CDK modules (those that start with "@aws-cdk/") this app uses.


cdkVersionPinningOptional
  • Type: boolean
  • Default: false

Use pinned version instead of caret version for CDK.

You can use this to prevent yarn to mix 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.


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

Additional context to include in cdk.json.


requireApprovalOptional

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.


Classes

AwsCdkClosedSourceTypeScriptApp

Closed source CDK App, Typescript.

Initializers

import { AwsCdkClosedSourceTypeScriptApp } from '@cloudgnosis/aws-cdk-app-templates'

new AwsCdkClosedSourceTypeScriptApp(options: AwsCdkClosedSourceTypeScriptAppOptions)
optionsRequired

AwsCdkTsLambdaRestApiApp

Project type that provides the same features as [[AwsCdkTypeScriptApp]].

Includes sample code for a REST API solution using AWS Gateway and AWS Lambda. Provides two versions of the sample app - with and without deployment pipeline.

Initializers

import { AwsCdkTsLambdaRestApiApp } from '@cloudgnosis/aws-cdk-app-templates'

new AwsCdkTsLambdaRestApiApp(options: AwsCdkTsLambdaRestApiAppOptions)
optionsRequired