awscdk
Submodule
Constructs
AutoDiscover
Discovers and creates integration tests and lambdas from code in the project's source and test trees.
Initializers
import { awscdk } from 'projen'
new awscdk.AutoDiscover(project: Project, options: AutoDiscoverOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
- Type: AutoDiscoverOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.AutoDiscover.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.AutoDiscover.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
AwsCdkConstructLibrary
AWS CDK construct library project.
A multi-language (jsii) construct library which vends constructs designed to use within the AWS CDK with a friendly workflow and automatic publishing to the construct catalog.
Initializers
import { awscdk } from 'projen'
new awscdk.AwsCdkConstructLibrary(options: AwsCdkConstructLibraryOptions)
Name | Type | Description |
---|---|---|
|
| No description. |
options
Required
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Exclude the matching files from pre-synth cleanup. |
| Adds a .gitignore pattern. |
| Adds patterns to be ignored by npm. |
| Adds a new task to this project. |
| Prints a "tip" message during synthesis. |
| Marks the provided file(s) as being generated. |
| Called after all components are synthesized. |
| Called before all components are synthesized. |
| Removes a task from a project. |
| Returns the shell command to execute in order to run a task. |
| Synthesize all project files into outdir . |
| Finds a file at the specified relative path within this project and all its subprojects. |
| Finds a json file by name. |
| Finds an object file (like JsonFile, YamlFile, etc.) by name. |
| Finds a file at the specified relative path within this project and removes it. |
| No description. |
| Defines bundled dependencies. |
| DEPRECATED. |
| Defines normal dependencies. |
| Defines development/test dependencies. |
| Directly set fields in package.json . |
| Adds keywords to package.json (deduplicated). |
| Defines peer dependencies. |
| Replaces the contents of multiple npm package.json scripts. |
| DEPRECATED. |
| Indicates if a script by the name name is defined. |
| Removes the npm script (always successful). |
| Returns the set of workflow steps which should be executed to bootstrap a workflow. |
| Replaces the contents of an npm package.json script. |
| Adds dependencies to AWS CDK modules. |
| Adds AWS CDK modules as dev 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.
globs
Required
- Type: ...string[]
The glob patterns to match.
addGitIgnore
public addGitIgnore(pattern: string): void
Adds a .gitignore pattern.
pattern
Required
- Type: string
The glob pattern to ignore.
addPackageIgnore
public addPackageIgnore(pattern: string): void
Adds patterns to be ignored by npm.
pattern
Required
- 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.
name
Required
- Type: string
The task name to add.
props
Optional
- Type: projen.TaskOptions
Task properties.
addTip
addTip
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- 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
glob
Required
- 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.
name
Required
- 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
.
task
Required
- Type: projen.Task
The task for which the command is required.
synth
public synth(): void
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- Call "this.postSynthesize()"
tryFindFile
public tryFindFile(filePath: string): FileBase
Finds a file at the specified relative path within this project and all its subprojects.
filePath
Required
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
tryFindJsonFile
tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile
Finds a json file by name.
filePath
Required
- Type: string
The file path.
tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
filePath
Required
- 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.
filePath
Required
- 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
bins
Required
- 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
.
deps
Required
- 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
addCompileCommand
public addCompileCommand(commands: ...string[]): void
DEPRECATED.
commands
Required
- Type: ...string[]
addDeps
public addDeps(deps: ...string[]): void
Defines normal dependencies.
deps
Required
- 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.
deps
Required
- 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
.
fields
Required
- Type: {[ key: string ]: any}
The fields to set.
addKeywords
public addKeywords(keywords: ...string[]): void
Adds keywords to package.json (deduplicated).
keywords
Required
- 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.
deps
Required
- 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.
scripts
Required
- Type: {[ key: string ]: string}
The scripts to set.
addTestCommand
addTestCommand
public addTestCommand(commands: ...string[]): void
DEPRECATED.
commands
Required
- Type: ...string[]
hasScript
hasScript
public hasScript(name: string): boolean
Indicates if a script by the name name is defined.
name
Required
- Type: string
The name of the script.
removeScript
public removeScript(name: string): void
Removes the npm script (always successful).
name
Required
- 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.
options
Optional
- Type: projen.javascript.RenderWorkflowSetupOptions
Options.
setScript
public setScript(name: string, command: string): void
Replaces the contents of an npm package.json script.
name
Required
- Type: string
The script name.
command
Required
- Type: string
The command to execute.
addCdkDependencies
addCdkDependencies
public addCdkDependencies(deps: ...string[]): void
Adds dependencies to AWS CDK modules.
Since this is a library project, dependencies will be added as peer dependencies.
deps
Required
- Type: ...string[]
names of cdk modules (e.g. @aws-cdk/aws-lambda
).
addCdkTestDependencies
addCdkTestDependencies
public addCdkTestDependencies(deps: ...string[]): void
Adds AWS CDK modules as dev dependencies.
deps
Required
- Type: ...string[]
names of cdk modules (e.g. @aws-cdk/aws-lambda
).
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a project. |
| Find the closest ancestor project for given construct. |
isConstruct
import { awscdk } from 'projen'
awscdk.AwsCdkConstructLibrary.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.
x
Required
- Type: any
Any object.
isProject
import { awscdk } from 'projen'
awscdk.AwsCdkConstructLibrary.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { awscdk } from 'projen'
awscdk.AwsCdkConstructLibrary.of(construct: IConstruct)
Find the closest ancestor project for given construct.
When given a project, this it the project itself.
construct
Required
- Type: constructs.IConstruct
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Task | No description. |
| boolean | Whether to commit the managed files by default. |
| projen.Task | No description. |
| projen.Component[] | Returns all the components within this project. |
| projen.Dependencies | Project dependencies. |
| boolean | Whether or not the project is being ejected. |
| projen.FileBase[] | All files in this project. |
| projen.GitAttributesFile | The .gitattributes file for this repository. |
| projen.IgnoreFile | .gitignore. |
| projen.Logger | Logging utilities. |
| string | Project name. |
| string | Absolute output directory of this project. |
| projen.Task | No description. |
| projen.Task | No description. |
| projen.Task | No description. |
| projen.ProjectBuild | Manages the build process of the project. |
| string | The command to use in order to run the projen CLI. |
| projen.Project | The root project. |
| projen.Project[] | Returns all the subprojects within this project. |
| projen.Tasks | Project tasks. |
| projen.Task | No description. |
| projen.Task | This is the "default" task, the one that executes "projen". |
| projen.InitProject | The options used when this project is bootstrapped via projen new . |
| projen.Project | A parent project. |
| projen.ProjectType | No description. |
| projen.github.AutoApprove | Auto approve set up for this project. |
| projen.vscode.DevContainer | Access for .devcontainer.json (used for GitHub Codespaces). |
| projen.github.GitHub | Access all github components. |
| projen.Gitpod | Access for Gitpod. |
| projen.vscode.VsCode | Access all VSCode components. |
| boolean | No description. |
| string | The build output directory. |
| string | The location of the npm tarball after build (${artifactsDirectory}/js ). |
| projen.javascript.Bundler | No description. |
| string | No description. |
| any | No description. |
| projen.javascript.NpmConfig | The .npmrc file. |
| projen.javascript.NodePackage | API for managing the node package. |
| projen.javascript.NodePackageManager | The package manager to use. |
| string | The command to use to run scripts (e.g. yarn run or npm run depends on the package manager). |
| projen.github.AutoMerge | Component that sets up mergify for merging approved pull requests. |
| projen.build.BuildWorkflow | The PR build GitHub workflow. |
| string | The job ID of the build workflow. |
| projen.javascript.Jest | The Jest configuration (if enabled). |
| string | Maximum node version supported by this package. |
| string | The minimum node version required by this package to function. |
| projen.IgnoreFile | The .npmignore file. |
| projen.javascript.Prettier | No description. |
| projen.release.Publisher | Package publisher. |
| projen.release.Release | Release management. |
| projen.javascript.UpgradeDependencies | The upgrade workflow. |
| string | No description. |
| string | The directory in which compiled .js files reside. |
| string | The directory in which the .ts sources reside. |
| string | The directory in which tests reside. |
| projen.javascript.TypescriptConfig | A typescript configuration file which covers all files (sources, tests, projen). |
| projen.Task | The "watch" task. |
| boolean | No description. |
| projen.javascript.Eslint | No description. |
| projen.javascript.TypescriptConfig | No description. |
| projen.javascript.TypescriptConfig | No description. |
|
| No description. |
| string | The target CDK version for this library. |
| string | No description. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
buildTask
Required
public readonly buildTask: Task;
- Type: projen.Task
commitGenerated
Required
public readonly commitGenerated: boolean;
- Type: boolean
Whether to commit the managed files by default.
compileTask
Required
public readonly compileTask: Task;
- Type: projen.Task
components
Required
public readonly components: Component[];
- Type: projen.Component[]
Returns all the components within this project.
deps
Required
public readonly deps: Dependencies;
- Type: projen.Dependencies
Project dependencies.
ejected
Required
public readonly ejected: boolean;
- Type: boolean
Whether or not the project is being ejected.
files
Required
public readonly files: FileBase[];
- Type: projen.FileBase[]
All files in this project.
gitattributes
Required
public readonly gitattributes: GitAttributesFile;
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
public readonly gitignore: IgnoreFile;
- Type: projen.IgnoreFile
.gitignore.
logger
Required
public readonly logger: Logger;
- Type: projen.Logger
Logging utilities.
name
Required
public readonly name: string;
- Type: string
Project name.
outdir
Required
public readonly outdir: string;
- Type: string
Absolute output directory of this project.
packageTask
Required
public readonly packageTask: Task;
- Type: projen.Task
postCompileTask
Required
public readonly postCompileTask: Task;
- Type: projen.Task
preCompileTask
Required
public readonly preCompileTask: Task;
- Type: projen.Task
projectBuild
Required
public readonly projectBuild: ProjectBuild;
- Type: projen.ProjectBuild
Manages the build process of the project.
projenCommand
Required
public readonly projenCommand: string;
- Type: string
The command to use in order to run the projen CLI.
root
Required
public readonly root: Project;
- Type: projen.Project
The root project.
subprojects
Required
public readonly subprojects: Project[];
- Type: projen.Project[]
Returns all the subprojects within this project.
tasks
Required
public readonly tasks: Tasks;
- Type: projen.Tasks
Project tasks.
testTask
Required
public readonly testTask: Task;
- Type: projen.Task
defaultTask
Optional
public readonly defaultTask: Task;
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
initProject
Optional
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.
parent
Optional
public readonly parent: Project;
- Type: projen.Project
A parent project.
If undefined, this is the root project.
projectType
Required
public readonly projectType: ProjectType;
- Type: projen.ProjectType
autoApprove
Optional
public readonly autoApprove: AutoApprove;
- Type: projen.github.AutoApprove
Auto approve set up for this project.
devContainer
Optional
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
github
Optional
public readonly github: GitHub;
- Type: projen.github.GitHub
Access all github components.
This will be undefined
for subprojects.
gitpod
Optional
public readonly gitpod: Gitpod;
- Type: projen.Gitpod
Access for Gitpod.
This will be undefined
if gitpod boolean is false
vscode
Optional
public readonly vscode: VsCode;
- Type: projen.vscode.VsCode
Access all VSCode components.
This will be undefined
for subprojects.
allowLibraryDependencies
Required
allowLibraryDependencies
- Deprecated: use
package.allowLibraryDependencies
public readonly allowLibraryDependencies: boolean;
- Type: boolean
artifactsDirectory
Required
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
.
artifactsJavascriptDirectory
Required
public readonly artifactsJavascriptDirectory: string;
- Type: string
The location of the npm tarball after build (${artifactsDirectory}/js
).
bundler
Required
public readonly bundler: Bundler;
- Type: projen.javascript.Bundler
entrypoint
Required
entrypoint
- Deprecated: use
package.entrypoint
public readonly entrypoint: string;
- Type: string
manifest
Required
manifest
- Deprecated: use
package.addField(x, y)
public readonly manifest: any;
- Type: any
npmrc
Required
public readonly npmrc: NpmConfig;
- Type: projen.javascript.NpmConfig
The .npmrc file.
package
Required
public readonly package: NodePackage;
- Type: projen.javascript.NodePackage
API for managing the node package.
packageManager
Required
packageManager
- Deprecated: use
package.packageManager
public readonly packageManager: NodePackageManager;
- Type: projen.javascript.NodePackageManager
The package manager to use.
runScriptCommand
Required
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).
autoMerge
Optional
public readonly autoMerge: AutoMerge;
- Type: projen.github.AutoMerge
Component that sets up mergify for merging approved pull requests.
buildWorkflow
Optional
public readonly buildWorkflow: BuildWorkflow;
- Type: projen.build.BuildWorkflow
The PR build GitHub workflow.
undefined
if buildWorkflow
is disabled.
buildWorkflowJobId
Optional
public readonly buildWorkflowJobId: string;
- Type: string
The job ID of the build workflow.
jest
Optional
public readonly jest: Jest;
- Type: projen.javascript.Jest
The Jest configuration (if enabled).
maxNodeVersion
Optional
public readonly maxNodeVersion: string;
- Type: string
Maximum node version supported by this package.
The value indicates the package is incompatible with newer versions.
minNodeVersion
Optional
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.
npmignore
Optional
public readonly npmignore: IgnoreFile;
- Type: projen.IgnoreFile
The .npmignore file.
prettier
Optional
public readonly prettier: Prettier;
- Type: projen.javascript.Prettier
publisher
Optional
publisher
- 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.
release
Optional
public readonly release: Release;
- Type: projen.release.Release
Release management.
upgradeWorkflow
Optional
public readonly upgradeWorkflow: UpgradeDependencies;
- Type: projen.javascript.UpgradeDependencies
The upgrade workflow.
docsDirectory
Required
public readonly docsDirectory: string;
- Type: string
libdir
Required
public readonly libdir: string;
- Type: string
The directory in which compiled .js files reside.
srcdir
Required
public readonly srcdir: string;
- Type: string
The directory in which the .ts sources reside.
testdir
Required
public readonly testdir: string;
- Type: string
The directory in which tests reside.
tsconfigDev
Required
public readonly tsconfigDev: TypescriptConfig;
- Type: projen.javascript.TypescriptConfig
A typescript configuration file which covers all files (sources, tests, projen).
watchTask
Required
public readonly watchTask: Task;
- Type: projen.Task
The "watch" task.
docgen
Optional
public readonly docgen: boolean;
- Type: boolean
eslint
Optional
public readonly eslint: Eslint;
- Type: projen.javascript.Eslint
tsconfig
Optional
public readonly tsconfig: TypescriptConfig;
- Type: projen.javascript.TypescriptConfig
tsconfigEslint
Optional
public readonly tsconfigEslint: TypescriptConfig;
- Type: projen.javascript.TypescriptConfig
cdkDeps
Required
public readonly cdkDeps: AwsCdkDeps;
- Type: AwsCdkDeps
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
The target CDK version for this library.
version
Required
version
- Deprecated: use
cdkVersion
public readonly version: string;
- Type: string
Constants
Name | Type | Description |
---|---|---|
| string | The name of the default task (the task executed when projen is run without arguments). |
| string | No description. |
DEFAULT_TASK
Required
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_PATTERN
Required
public readonly DEFAULT_TS_JEST_TRANFORM_PATTERN: string;
- Type: string
AwsCdkDeps
Manages dependencies on the AWS CDK.
Initializers
import { awscdk } from 'projen'
new awscdk.AwsCdkDeps(project: Project, options: AwsCdkDepsOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
- Type: AwsCdkDepsOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Adds dependencies to AWS CDK modules. |
| Adds AWS CDK modules as dev dependencies. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addV1Dependencies
public addV1Dependencies(deps: ...string[]): void
Adds dependencies to AWS CDK modules.
The type of dependency is determined by the dependencyType
option.
This method is not supported in CDK v2. Use project.addPeerDeps()
or
project.addDeps()
as appropriate.
deps
Required
- Type: ...string[]
names of cdk modules (e.g. @aws-cdk/aws-lambda
).
addV1DevDependencies
public addV1DevDependencies(deps: ...string[]): void
Adds AWS CDK modules as dev dependencies.
This method is not supported in CDK v2. Use project.addPeerDeps()
or
project.addDeps()
as appropriate.
deps
Required
- Type: ...string[]
fully qualified names of cdk modules (e.g. @aws-cdk/aws-lambda
).
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.AwsCdkDeps.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.AwsCdkDeps.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string | The dependency requirement for the CDK CLI (e.g. '^2.3.4'). |
| boolean | Whether CDK dependencies are added as normal dependencies (and peer dependencies). |
| number | The major version of the AWS CDK (e.g. 1, 2, ...). |
| string | The minimum version of the AWS CDK (e.g. 2.0.0 ). |
| string | The dependency requirement for AWS CDK (e.g. ^2.0.0 ). |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
cdkCliVersion
Required
public readonly cdkCliVersion: string;
- Type: string
The dependency requirement for the CDK CLI (e.g. '^2.3.4').
Will return ^2
if the version was unspecified by the user.
cdkDependenciesAsDeps
Required
cdkDependenciesAsDeps
- Deprecated: Not used for CDK 2.x
public readonly cdkDependenciesAsDeps: boolean;
- Type: boolean
Whether CDK dependencies are added as normal dependencies (and peer dependencies).
cdkMajorVersion
Required
public readonly cdkMajorVersion: number;
- Type: number
The major version of the AWS CDK (e.g. 1, 2, ...).
cdkMinimumVersion
Required
public readonly cdkMinimumVersion: string;
- Type: string
The minimum version of the AWS CDK (e.g. 2.0.0
).
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
The dependency requirement for AWS CDK (e.g. ^2.0.0
).
AwsCdkDepsJava
Manages dependencies on the AWS CDK for Java projects.
Initializers
import { awscdk } from 'projen'
new awscdk.AwsCdkDepsJava(project: Project, options: AwsCdkDepsOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
- Type: AwsCdkDepsOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Adds dependencies to AWS CDK modules. |
| Adds AWS CDK modules as dev dependencies. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addV1Dependencies
public addV1Dependencies(deps: ...string[]): void
Adds dependencies to AWS CDK modules.
The type of dependency is determined by the dependencyType
option.
This method is not supported in CDK v2. Use project.addPeerDeps()
or
project.addDeps()
as appropriate.
deps
Required
- Type: ...string[]
names of cdk modules (e.g. @aws-cdk/aws-lambda
).
addV1DevDependencies
public addV1DevDependencies(deps: ...string[]): void
Adds AWS CDK modules as dev dependencies.
This method is not supported in CDK v2. Use project.addPeerDeps()
or
project.addDeps()
as appropriate.
deps
Required
- Type: ...string[]
fully qualified names of cdk modules (e.g. @aws-cdk/aws-lambda
).
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.AwsCdkDepsJava.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.AwsCdkDepsJava.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string | The dependency requirement for the CDK CLI (e.g. '^2.3.4'). |
| boolean | Whether CDK dependencies are added as normal dependencies (and peer dependencies). |
| number | The major version of the AWS CDK (e.g. 1, 2, ...). |
| string | The minimum version of the AWS CDK (e.g. 2.0.0 ). |
| string | The dependency requirement for AWS CDK (e.g. ^2.0.0 ). |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
cdkCliVersion
Required
public readonly cdkCliVersion: string;
- Type: string
The dependency requirement for the CDK CLI (e.g. '^2.3.4').
Will return ^2
if the version was unspecified by the user.
cdkDependenciesAsDeps
Required
cdkDependenciesAsDeps
- Deprecated: Not used for CDK 2.x
public readonly cdkDependenciesAsDeps: boolean;
- Type: boolean
Whether CDK dependencies are added as normal dependencies (and peer dependencies).
cdkMajorVersion
Required
public readonly cdkMajorVersion: number;
- Type: number
The major version of the AWS CDK (e.g. 1, 2, ...).
cdkMinimumVersion
Required
public readonly cdkMinimumVersion: string;
- Type: string
The minimum version of the AWS CDK (e.g. 2.0.0
).
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
The dependency requirement for AWS CDK (e.g. ^2.0.0
).
AwsCdkDepsJs
Manages dependencies on the AWS CDK for Node.js projects.
Initializers
import { awscdk } from 'projen'
new awscdk.AwsCdkDepsJs(project: Project, options: AwsCdkDepsOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
- Type: AwsCdkDepsOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Adds dependencies to AWS CDK modules. |
| Adds AWS CDK modules as dev dependencies. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addV1Dependencies
public addV1Dependencies(deps: ...string[]): void
Adds dependencies to AWS CDK modules.
The type of dependency is determined by the dependencyType
option.
This method is not supported in CDK v2. Use project.addPeerDeps()
or
project.addDeps()
as appropriate.
deps
Required
- Type: ...string[]
names of cdk modules (e.g. @aws-cdk/aws-lambda
).
addV1DevDependencies
public addV1DevDependencies(deps: ...string[]): void
Adds AWS CDK modules as dev dependencies.
This method is not supported in CDK v2. Use project.addPeerDeps()
or
project.addDeps()
as appropriate.
deps
Required
- Type: ...string[]
fully qualified names of cdk modules (e.g. @aws-cdk/aws-lambda
).
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.AwsCdkDepsJs.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.AwsCdkDepsJs.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string | The dependency requirement for the CDK CLI (e.g. '^2.3.4'). |
| boolean | Whether CDK dependencies are added as normal dependencies (and peer dependencies). |
| number | The major version of the AWS CDK (e.g. 1, 2, ...). |
| string | The minimum version of the AWS CDK (e.g. 2.0.0 ). |
| string | The dependency requirement for AWS CDK (e.g. ^2.0.0 ). |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
cdkCliVersion
Required
public readonly cdkCliVersion: string;
- Type: string
The dependency requirement for the CDK CLI (e.g. '^2.3.4').
Will return ^2
if the version was unspecified by the user.
cdkDependenciesAsDeps
Required
cdkDependenciesAsDeps
- Deprecated: Not used for CDK 2.x
public readonly cdkDependenciesAsDeps: boolean;
- Type: boolean
Whether CDK dependencies are added as normal dependencies (and peer dependencies).
cdkMajorVersion
Required
public readonly cdkMajorVersion: number;
- Type: number
The major version of the AWS CDK (e.g. 1, 2, ...).
cdkMinimumVersion
Required
public readonly cdkMinimumVersion: string;
- Type: string
The minimum version of the AWS CDK (e.g. 2.0.0
).
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
The dependency requirement for AWS CDK (e.g. ^2.0.0
).
AwsCdkDepsPy
Manages dependencies on the AWS CDK for Python projects.
Initializers
import { awscdk } from 'projen'
new awscdk.AwsCdkDepsPy(project: Project, options: AwsCdkDepsOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
- Type: AwsCdkDepsOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Adds dependencies to AWS CDK modules. |
| Adds AWS CDK modules as dev dependencies. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addV1Dependencies
public addV1Dependencies(deps: ...string[]): void
Adds dependencies to AWS CDK modules.
The type of dependency is determined by the dependencyType
option.
This method is not supported in CDK v2. Use project.addPeerDeps()
or
project.addDeps()
as appropriate.
deps
Required
- Type: ...string[]
names of cdk modules (e.g. @aws-cdk/aws-lambda
).
addV1DevDependencies
public addV1DevDependencies(deps: ...string[]): void
Adds AWS CDK modules as dev dependencies.
This method is not supported in CDK v2. Use project.addPeerDeps()
or
project.addDeps()
as appropriate.
deps
Required
- Type: ...string[]
fully qualified names of cdk modules (e.g. @aws-cdk/aws-lambda
).
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.AwsCdkDepsPy.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.AwsCdkDepsPy.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string | The dependency requirement for the CDK CLI (e.g. '^2.3.4'). |
| boolean | Whether CDK dependencies are added as normal dependencies (and peer dependencies). |
| number | The major version of the AWS CDK (e.g. 1, 2, ...). |
| string | The minimum version of the AWS CDK (e.g. 2.0.0 ). |
| string | The dependency requirement for AWS CDK (e.g. ^2.0.0 ). |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
cdkCliVersion
Required
public readonly cdkCliVersion: string;
- Type: string
The dependency requirement for the CDK CLI (e.g. '^2.3.4').
Will return ^2
if the version was unspecified by the user.
cdkDependenciesAsDeps
Required
cdkDependenciesAsDeps
- Deprecated: Not used for CDK 2.x
public readonly cdkDependenciesAsDeps: boolean;
- Type: boolean
Whether CDK dependencies are added as normal dependencies (and peer dependencies).
cdkMajorVersion
Required
public readonly cdkMajorVersion: number;
- Type: number
The major version of the AWS CDK (e.g. 1, 2, ...).
cdkMinimumVersion
Required
public readonly cdkMinimumVersion: string;
- Type: string
The minimum version of the AWS CDK (e.g. 2.0.0
).
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
The dependency requirement for AWS CDK (e.g. ^2.0.0
).
AwsCdkJavaApp
AWS CDK app in Java.
Initializers
import { awscdk } from 'projen'
new awscdk.AwsCdkJavaApp(options: AwsCdkJavaAppOptions)
Name | Type | Description |
---|---|---|
|
| No description. |
options
Required
- Type: AwsCdkJavaAppOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Exclude the matching files from pre-synth cleanup. |
| Adds a .gitignore pattern. |
| Exclude these files from the bundled package. |
| Adds a new task to this project. |
| Prints a "tip" message during synthesis. |
| Marks the provided file(s) as being generated. |
| Called after all components are synthesized. |
| Called before all components are synthesized. |
| Removes a task from a project. |
| Returns the shell command to execute in order to run a task. |
| Synthesize all project files into outdir . |
| Finds a file at the specified relative path within this project and all its subprojects. |
| Finds a json file by name. |
| Finds an object file (like JsonFile, YamlFile, etc.) by name. |
| Finds a file at the specified relative path within this project and removes it. |
| Adds a runtime dependency. |
| Adds a build plugin to the pom. |
| Adds a test dependency. |
| 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.
globs
Required
- Type: ...string[]
The glob patterns to match.
addGitIgnore
public addGitIgnore(pattern: string): void
Adds a .gitignore pattern.
pattern
Required
- Type: string
The glob pattern to ignore.
addPackageIgnore
public addPackageIgnore(_pattern: string): void
Exclude these files from the bundled package.
Implemented by project types based on the
packaging mechanism. For example, NodeProject
delegates this to .npmignore
.
_pattern
Required
- Type: string
The glob pattern to exclude.
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.
name
Required
- Type: string
The task name to add.
props
Optional
- Type: projen.TaskOptions
Task properties.
addTip
addTip
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- 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
glob
Required
- 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.
name
Required
- 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.
By default, this is npx projen@<version> <task>
task
Required
- Type: projen.Task
The task for which the command is required.
synth
public synth(): void
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- Call "this.postSynthesize()"
tryFindFile
public tryFindFile(filePath: string): FileBase
Finds a file at the specified relative path within this project and all its subprojects.
filePath
Required
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
tryFindJsonFile
tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile
Finds a json file by name.
filePath
Required
- Type: string
The file path.
tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
filePath
Required
- 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.
filePath
Required
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
addDependency
public addDependency(spec: string): void
Adds a runtime dependency.
spec
Required
- Type: string
Format <groupId>/<artifactId>@<semver>
.
addPlugin
public addPlugin(spec: string, options?: PluginOptions): Dependency
Adds a build plugin to the pom.
The plug in is also added as a BUILD dep to the project.
spec
Required
- Type: string
dependency spec (group/artifact@version
).
options
Optional
- Type: projen.java.PluginOptions
plugin options.
addTestDependency
public addTestDependency(spec: string): void
Adds a test dependency.
spec
Required
- Type: string
Format <groupId>/<artifactId>@<semver>
.
addCdkDependency
addCdkDependency
public addCdkDependency(modules: ...string[]): void
Adds an AWS CDK module dependencies.
modules
Required
- Type: ...string[]
The list of modules to depend on (e.g. "software.amazon.awscdk/aws-lambda", "software.amazon.awscdk/aws-iam", etc).
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a project. |
| Find the closest ancestor project for given construct. |
isConstruct
import { awscdk } from 'projen'
awscdk.AwsCdkJavaApp.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.
x
Required
- Type: any
Any object.
isProject
import { awscdk } from 'projen'
awscdk.AwsCdkJavaApp.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { awscdk } from 'projen'
awscdk.AwsCdkJavaApp.of(construct: IConstruct)
Find the closest ancestor project for given construct.
When given a project, this it the project itself.
construct
Required
- Type: constructs.IConstruct
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Task | No description. |
| boolean | Whether to commit the managed files by default. |
| projen.Task | No description. |
| projen.Component[] | Returns all the components within this project. |
| projen.Dependencies | Project dependencies. |
| boolean | Whether or not the project is being ejected. |
| projen.FileBase[] | All files in this project. |
| projen.GitAttributesFile | The .gitattributes file for this repository. |
| projen.IgnoreFile | .gitignore. |
| projen.Logger | Logging utilities. |
| string | Project name. |
| string | Absolute output directory of this project. |
| projen.Task | No description. |
| projen.Task | No description. |
| projen.Task | No description. |
| projen.ProjectBuild | Manages the build process of the project. |
| string | The command to use in order to run the projen CLI. |
| projen.Project | The root project. |
| projen.Project[] | Returns all the subprojects within this project. |
| projen.Tasks | Project tasks. |
| projen.Task | No description. |
| projen.Task | This is the "default" task, the one that executes "projen". |
| projen.InitProject | The options used when this project is bootstrapped via projen new . |
| projen.Project | A parent project. |
| projen.ProjectType | No description. |
| projen.github.AutoApprove | Auto approve set up for this project. |
| projen.vscode.DevContainer | Access for .devcontainer.json (used for GitHub Codespaces). |
| projen.github.GitHub | Access all github components. |
| projen.Gitpod | Access for Gitpod. |
| projen.vscode.VsCode | Access all VSCode components. |
| projen.java.MavenCompile | Compile component. |
| string | Maven artifact output directory. |
| projen.java.MavenPackaging | Packaging component. |
| projen.java.Pom | API for managing pom.xml . |
| projen.java.Junit | JUnit component. |
| projen.java.Projenrc | Projenrc component. |
|
| The cdk.json file. |
|
| CDK dependency management helper class. |
|
| CDK tasks. |
| string | The full name of the main class of the java app (package.Class). |
| string | The name of the Java class with the static main() method. |
| string | The name of the Java package that includes the main class. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
buildTask
Required
public readonly buildTask: Task;
- Type: projen.Task
commitGenerated
Required
public readonly commitGenerated: boolean;
- Type: boolean
Whether to commit the managed files by default.
compileTask
Required
public readonly compileTask: Task;
- Type: projen.Task
components
Required
public readonly components: Component[];
- Type: projen.Component[]
Returns all the components within this project.
deps
Required
public readonly deps: Dependencies;
- Type: projen.Dependencies
Project dependencies.
ejected
Required
public readonly ejected: boolean;
- Type: boolean
Whether or not the project is being ejected.
files
Required
public readonly files: FileBase[];
- Type: projen.FileBase[]
All files in this project.
gitattributes
Required
public readonly gitattributes: GitAttributesFile;
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
public readonly gitignore: IgnoreFile;
- Type: projen.IgnoreFile
.gitignore.
logger
Required
public readonly logger: Logger;
- Type: projen.Logger
Logging utilities.
name
Required
public readonly name: string;
- Type: string
Project name.
outdir
Required
public readonly outdir: string;
- Type: string
Absolute output directory of this project.
packageTask
Required
public readonly packageTask: Task;
- Type: projen.Task
postCompileTask
Required
public readonly postCompileTask: Task;
- Type: projen.Task
preCompileTask
Required
public readonly preCompileTask: Task;
- Type: projen.Task
projectBuild
Required
public readonly projectBuild: ProjectBuild;
- Type: projen.ProjectBuild
Manages the build process of the project.
projenCommand
Required
public readonly projenCommand: string;
- Type: string
The command to use in order to run the projen CLI.
root
Required
public readonly root: Project;
- Type: projen.Project
The root project.
subprojects
Required
public readonly subprojects: Project[];
- Type: projen.Project[]
Returns all the subprojects within this project.
tasks
Required
public readonly tasks: Tasks;
- Type: projen.Tasks
Project tasks.
testTask
Required
public readonly testTask: Task;
- Type: projen.Task
defaultTask
Optional
public readonly defaultTask: Task;
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
initProject
Optional
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.
parent
Optional
public readonly parent: Project;
- Type: projen.Project
A parent project.
If undefined, this is the root project.
projectType
Required
public readonly projectType: ProjectType;
- Type: projen.ProjectType
autoApprove
Optional
public readonly autoApprove: AutoApprove;
- Type: projen.github.AutoApprove
Auto approve set up for this project.
devContainer
Optional
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
github
Optional
public readonly github: GitHub;
- Type: projen.github.GitHub
Access all github components.
This will be undefined
for subprojects.
gitpod
Optional
public readonly gitpod: Gitpod;
- Type: projen.Gitpod
Access for Gitpod.
This will be undefined
if gitpod boolean is false
vscode
Optional
public readonly vscode: VsCode;
- Type: projen.vscode.VsCode
Access all VSCode components.
This will be undefined
for subprojects.
compile
Required
public readonly compile: MavenCompile;
- Type: projen.java.MavenCompile
Compile component.
distdir
Required
public readonly distdir: string;
- Type: string
Maven artifact output directory.
packaging
Required
public readonly packaging: MavenPackaging;
- Type: projen.java.MavenPackaging
Packaging component.
pom
Required
public readonly pom: Pom;
- Type: projen.java.Pom
API for managing pom.xml
.
junit
Optional
public readonly junit: Junit;
- Type: projen.java.Junit
JUnit component.
projenrc
Optional
public readonly projenrc: Projenrc;
- Type: projen.java.Projenrc
Projenrc component.
cdkConfig
Required
public readonly cdkConfig: CdkConfig;
- Type: CdkConfig
The cdk.json
file.
cdkDeps
Required
public readonly cdkDeps: AwsCdkDeps;
- Type: AwsCdkDeps
CDK dependency management helper class.
cdkTasks
Required
public readonly cdkTasks: CdkTasks;
- Type: CdkTasks
CDK tasks.
mainClass
Required
public readonly mainClass: string;
- Type: string
The full name of the main class of the java app (package.Class).
mainClassName
Required
public readonly mainClassName: string;
- Type: string
The name of the Java class with the static main()
method.
mainPackage
Required
public readonly mainPackage: string;
- Type: string
The name of the Java package that includes the main class.
Constants
Name | Type | Description |
---|---|---|
| string | The name of the default task (the task executed when projen is run without arguments). |
DEFAULT_TASK
Required
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.
AwsCdkPythonApp
AWS CDK app in Python.
Initializers
import { awscdk } from 'projen'
new awscdk.AwsCdkPythonApp(options: AwsCdkPythonAppOptions)
Name | Type | Description |
---|---|---|
|
| No description. |
options
Required
- Type: AwsCdkPythonAppOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Exclude the matching files from pre-synth cleanup. |
| Adds a .gitignore pattern. |
| Exclude these files from the bundled package. |
| Adds a new task to this project. |
| Prints a "tip" message during synthesis. |
| Marks the provided file(s) as being generated. |
| Called after all components are synthesized. |
| Called before all components are synthesized. |
| Removes a task from a project. |
| Returns the shell command to execute in order to run a task. |
| Synthesize all project files into outdir . |
| Finds a file at the specified relative path within this project and all its subprojects. |
| Finds a json file by name. |
| Finds an object file (like JsonFile, YamlFile, etc.) by name. |
| Finds a file at the specified relative path within this project and removes it. |
| Adds a runtime dependency. |
| Adds a dev dependency. |
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.
globs
Required
- Type: ...string[]
The glob patterns to match.
addGitIgnore
public addGitIgnore(pattern: string): void
Adds a .gitignore pattern.
pattern
Required
- Type: string
The glob pattern to ignore.
addPackageIgnore
public addPackageIgnore(_pattern: string): void
Exclude these files from the bundled package.
Implemented by project types based on the
packaging mechanism. For example, NodeProject
delegates this to .npmignore
.
_pattern
Required
- Type: string
The glob pattern to exclude.
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.
name
Required
- Type: string
The task name to add.
props
Optional
- Type: projen.TaskOptions
Task properties.
addTip
addTip
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- 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
glob
Required
- 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.
name
Required
- 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.
By default, this is npx projen@<version> <task>
task
Required
- Type: projen.Task
The task for which the command is required.
synth
public synth(): void
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- Call "this.postSynthesize()"
tryFindFile
public tryFindFile(filePath: string): FileBase
Finds a file at the specified relative path within this project and all its subprojects.
filePath
Required
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
tryFindJsonFile
tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile
Finds a json file by name.
filePath
Required
- Type: string
The file path.
tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
filePath
Required
- 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.
filePath
Required
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
addDependency
public addDependency(spec: string): void
Adds a runtime dependency.
spec
Required
- Type: string
Format <module>@<semver>
.
addDevDependency
public addDevDependency(spec: string): void
Adds a dev dependency.
spec
Required
- Type: string
Format <module>@<semver>
.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a project. |
| Find the closest ancestor project for given construct. |
isConstruct
import { awscdk } from 'projen'
awscdk.AwsCdkPythonApp.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.
x
Required
- Type: any
Any object.
isProject
import { awscdk } from 'projen'
awscdk.AwsCdkPythonApp.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { awscdk } from 'projen'
awscdk.AwsCdkPythonApp.of(construct: IConstruct)
Find the closest ancestor project for given construct.
When given a project, this it the project itself.
construct
Required
- Type: constructs.IConstruct
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Task | No description. |
| boolean | Whether to commit the managed files by default. |
| projen.Task | No description. |
| projen.Component[] | Returns all the components within this project. |
| projen.Dependencies | Project dependencies. |
| boolean | Whether or not the project is being ejected. |
| projen.FileBase[] | All files in this project. |
| projen.GitAttributesFile | The .gitattributes file for this repository. |
| projen.IgnoreFile | .gitignore. |
| projen.Logger | Logging utilities. |
| string | Project name. |
| string | Absolute output directory of this project. |
| projen.Task | No description. |
| projen.Task | No description. |
| projen.Task | No description. |
| projen.ProjectBuild | Manages the build process of the project. |
| string | The command to use in order to run the projen CLI. |
| projen.Project | The root project. |
| projen.Project[] | Returns all the subprojects within this project. |
| projen.Tasks | Project tasks. |
| projen.Task | No description. |
| projen.Task | This is the "default" task, the one that executes "projen". |
| projen.InitProject | The options used when this project is bootstrapped via projen new . |
| projen.Project | A parent project. |
| projen.ProjectType | No description. |
| projen.github.AutoApprove | Auto approve set up for this project. |
| projen.vscode.DevContainer | Access for .devcontainer.json (used for GitHub Codespaces). |
| projen.github.GitHub | Access all github components. |
| projen.Gitpod | Access for Gitpod. |
| projen.vscode.VsCode | Access all VSCode components. |
| projen.python.IPythonDeps | API for managing dependencies. |
| projen.python.IPythonEnv | API for mangaging the Python runtime environment. |
| string | Python module name (the project name, with any hyphens or periods replaced with underscores). |
| string | The directory in which the python sample tests reside. |
| string | Version of the package for distribution (should follow semver). |
| projen.python.IPythonPackaging | API for managing packaging the project as a library. |
| projen.python.Pytest | Pytest component. |
| string | The CDK app entrypoint. |
|
| cdk.json configuration. |
|
| No description. |
|
| Common CDK tasks. |
| string | The CDK version this app is using. |
| string | The directory in which the python tests reside. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
buildTask
Required
public readonly buildTask: Task;
- Type: projen.Task
commitGenerated
Required
public readonly commitGenerated: boolean;
- Type: boolean
Whether to commit the managed files by default.
compileTask
Required
public readonly compileTask: Task;
- Type: projen.Task
components
Required
public readonly components: Component[];
- Type: projen.Component[]
Returns all the components within this project.
deps
Required
public readonly deps: Dependencies;
- Type: projen.Dependencies
Project dependencies.
ejected
Required
public readonly ejected: boolean;
- Type: boolean
Whether or not the project is being ejected.
files
Required
public readonly files: FileBase[];
- Type: projen.FileBase[]
All files in this project.
gitattributes
Required
public readonly gitattributes: GitAttributesFile;
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
public readonly gitignore: IgnoreFile;
- Type: projen.IgnoreFile
.gitignore.
logger
Required
public readonly logger: Logger;
- Type: projen.Logger
Logging utilities.
name
Required
public readonly name: string;
- Type: string
Project name.
outdir
Required
public readonly outdir: string;
- Type: string
Absolute output directory of this project.
packageTask
Required
public readonly packageTask: Task;
- Type: projen.Task
postCompileTask
Required
public readonly postCompileTask: Task;
- Type: projen.Task
preCompileTask
Required
public readonly preCompileTask: Task;
- Type: projen.Task
projectBuild
Required
public readonly projectBuild: ProjectBuild;
- Type: projen.ProjectBuild
Manages the build process of the project.
projenCommand
Required
public readonly projenCommand: string;
- Type: string
The command to use in order to run the projen CLI.
root
Required
public readonly root: Project;
- Type: projen.Project
The root project.
subprojects
Required
public readonly subprojects: Project[];
- Type: projen.Project[]
Returns all the subprojects within this project.
tasks
Required
public readonly tasks: Tasks;
- Type: projen.Tasks
Project tasks.
testTask
Required
public readonly testTask: Task;
- Type: projen.Task
defaultTask
Optional
public readonly defaultTask: Task;
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
initProject
Optional
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.
parent
Optional
public readonly parent: Project;
- Type: projen.Project
A parent project.
If undefined, this is the root project.
projectType
Required
public readonly projectType: ProjectType;
- Type: projen.ProjectType
autoApprove
Optional
public readonly autoApprove: AutoApprove;
- Type: projen.github.AutoApprove
Auto approve set up for this project.
devContainer
Optional
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
github
Optional
public readonly github: GitHub;
- Type: projen.github.GitHub
Access all github components.
This will be undefined
for subprojects.
gitpod
Optional
public readonly gitpod: Gitpod;
- Type: projen.Gitpod
Access for Gitpod.
This will be undefined
if gitpod boolean is false
vscode
Optional
public readonly vscode: VsCode;
- Type: projen.vscode.VsCode
Access all VSCode components.
This will be undefined
for subprojects.
depsManager
Required
public readonly depsManager: IPythonDeps;
- Type: projen.python.IPythonDeps
API for managing dependencies.
envManager
Required
public readonly envManager: IPythonEnv;
- Type: projen.python.IPythonEnv
API for mangaging the Python runtime environment.
moduleName
Required
public readonly moduleName: string;
- Type: string
Python module name (the project name, with any hyphens or periods replaced with underscores).
sampleTestdir
Required
public readonly sampleTestdir: string;
- Type: string
The directory in which the python sample tests reside.
version
Required
public readonly version: string;
- Type: string
Version of the package for distribution (should follow semver).
packagingManager
Optional
public readonly packagingManager: IPythonPackaging;
- Type: projen.python.IPythonPackaging
API for managing packaging the project as a library.
Only applies when the projectType
is LIB.
pytest
Optional
public readonly pytest: Pytest;
- Type: projen.python.Pytest
Pytest component.
appEntrypoint
Required
public readonly appEntrypoint: string;
- Type: string
The CDK app entrypoint.
cdkConfig
Required
public readonly cdkConfig: CdkConfig;
- Type: CdkConfig
cdk.json configuration.
cdkDeps
Required
public readonly cdkDeps: AwsCdkDeps;
- Type: AwsCdkDeps
cdkTasks
Required
public readonly cdkTasks: CdkTasks;
- Type: CdkTasks
Common CDK tasks.
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
The CDK version this app is using.
testdir
Required
testdir
- Deprecated: Use
sampleTestdir
instead.
public readonly testdir: string;
- Type: string
The directory in which the python tests reside.
Constants
Name | Type | Description |
---|---|---|
| string | The name of the default task (the task executed when projen is run without arguments). |
DEFAULT_TASK
Required
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.
AwsCdkTypeScriptApp
AWS CDK app in TypeScript.
Initializers
import { awscdk } from 'projen'
new awscdk.AwsCdkTypeScriptApp(options: AwsCdkTypeScriptAppOptions)
Name | Type | Description |
---|---|---|
|
| No description. |
options
Required
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Exclude the matching files from pre-synth cleanup. |
| Adds a .gitignore pattern. |
| Adds patterns to be ignored by npm. |
| Adds a new task to this project. |
| Prints a "tip" message during synthesis. |
| Marks the provided file(s) as being generated. |
| Called after all components are synthesized. |
| Called before all components are synthesized. |
| Removes a task from a project. |
| Returns the shell command to execute in order to run a task. |
| Synthesize all project files into outdir . |
| Finds a file at the specified relative path within this project and all its subprojects. |
| Finds a json file by name. |
| Finds an object file (like JsonFile, YamlFile, etc.) by name. |
| Finds a file at the specified relative path within this project and removes it. |
| No description. |
| Defines bundled dependencies. |
| DEPRECATED. |
| Defines normal dependencies. |
| Defines development/test dependencies. |
| Directly set fields in package.json . |
| Adds keywords to package.json (deduplicated). |
| Defines peer dependencies. |
| Replaces the contents of multiple npm package.json scripts. |
| DEPRECATED. |
| Indicates if a script by the name name is defined. |
| Removes the npm script (always successful). |
| Returns the set of workflow steps which should be executed to bootstrap a workflow. |
| Replaces the contents of an npm package.json script. |
| 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.
globs
Required
- Type: ...string[]
The glob patterns to match.
addGitIgnore
public addGitIgnore(pattern: string): void
Adds a .gitignore pattern.
pattern
Required
- Type: string
The glob pattern to ignore.
addPackageIgnore
public addPackageIgnore(pattern: string): void
Adds patterns to be ignored by npm.
pattern
Required
- 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.
name
Required
- Type: string
The task name to add.
props
Optional
- Type: projen.TaskOptions
Task properties.
addTip
addTip
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- 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
glob
Required
- 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.
name
Required
- 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
.
task
Required
- Type: projen.Task
The task for which the command is required.
synth
public synth(): void
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- Call "this.postSynthesize()"
tryFindFile
public tryFindFile(filePath: string): FileBase
Finds a file at the specified relative path within this project and all its subprojects.
filePath
Required
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
tryFindJsonFile
tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile
Finds a json file by name.
filePath
Required
- Type: string
The file path.
tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
filePath
Required
- 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.
filePath
Required
- 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
bins
Required
- 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
.
deps
Required
- 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
addCompileCommand
public addCompileCommand(commands: ...string[]): void
DEPRECATED.
commands
Required
- Type: ...string[]
addDeps
public addDeps(deps: ...string[]): void
Defines normal dependencies.
deps
Required
- 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.
deps
Required
- 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
.
fields
Required
- Type: {[ key: string ]: any}
The fields to set.
addKeywords
public addKeywords(keywords: ...string[]): void
Adds keywords to package.json (deduplicated).
keywords
Required
- 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.
deps
Required
- 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.
scripts
Required
- Type: {[ key: string ]: string}
The scripts to set.
addTestCommand
addTestCommand
public addTestCommand(commands: ...string[]): void
DEPRECATED.
commands
Required
- Type: ...string[]
hasScript
hasScript
public hasScript(name: string): boolean
Indicates if a script by the name name is defined.
name
Required
- Type: string
The name of the script.
removeScript
public removeScript(name: string): void
Removes the npm script (always successful).
name
Required
- 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.
options
Optional
- Type: projen.javascript.RenderWorkflowSetupOptions
Options.
setScript
public setScript(name: string, command: string): void
Replaces the contents of an npm package.json script.
name
Required
- Type: string
The script name.
command
Required
- Type: string
The command to execute.
addCdkDependency
public addCdkDependency(modules: ...string[]): void
Adds an AWS CDK module dependencies.
modules
Required
- Type: ...string[]
The list of modules to depend on.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a project. |
| Find the closest ancestor project for given construct. |
isConstruct
import { awscdk } from 'projen'
awscdk.AwsCdkTypeScriptApp.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.
x
Required
- Type: any
Any object.
isProject
import { awscdk } from 'projen'
awscdk.AwsCdkTypeScriptApp.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { awscdk } from 'projen'
awscdk.AwsCdkTypeScriptApp.of(construct: IConstruct)
Find the closest ancestor project for given construct.
When given a project, this it the project itself.
construct
Required
- Type: constructs.IConstruct
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Task | No description. |
| boolean | Whether to commit the managed files by default. |
| projen.Task | No description. |
| projen.Component[] | Returns all the components within this project. |
| projen.Dependencies | Project dependencies. |
| boolean | Whether or not the project is being ejected. |
| projen.FileBase[] | All files in this project. |
| projen.GitAttributesFile | The .gitattributes file for this repository. |
| projen.IgnoreFile | .gitignore. |
| projen.Logger | Logging utilities. |
| string | Project name. |
| string | Absolute output directory of this project. |
| projen.Task | No description. |
| projen.Task | No description. |
| projen.Task | No description. |
| projen.ProjectBuild | Manages the build process of the project. |
| string | The command to use in order to run the projen CLI. |
| projen.Project | The root project. |
| projen.Project[] | Returns all the subprojects within this project. |
| projen.Tasks | Project tasks. |
| projen.Task | No description. |
| projen.Task | This is the "default" task, the one that executes "projen". |
| projen.InitProject | The options used when this project is bootstrapped via projen new . |
| projen.Project | A parent project. |
| projen.ProjectType | No description. |
| projen.github.AutoApprove | Auto approve set up for this project. |
| projen.vscode.DevContainer | Access for .devcontainer.json (used for GitHub Codespaces). |
| projen.github.GitHub | Access all github components. |
| projen.Gitpod | Access for Gitpod. |
| projen.vscode.VsCode | Access all VSCode components. |
| boolean | No description. |
| string | The build output directory. |
| string | The location of the npm tarball after build (${artifactsDirectory}/js ). |
| projen.javascript.Bundler | No description. |
| string | No description. |
| any | No description. |
| projen.javascript.NpmConfig | The .npmrc file. |
| projen.javascript.NodePackage | API for managing the node package. |
| projen.javascript.NodePackageManager | The package manager to use. |
| string | The command to use to run scripts (e.g. yarn run or npm run depends on the package manager). |
| projen.github.AutoMerge | Component that sets up mergify for merging approved pull requests. |
| projen.build.BuildWorkflow | The PR build GitHub workflow. |
| string | The job ID of the build workflow. |
| projen.javascript.Jest | The Jest configuration (if enabled). |
| string | Maximum node version supported by this package. |
| string | The minimum node version required by this package to function. |
| projen.IgnoreFile | The .npmignore file. |
| projen.javascript.Prettier | No description. |
| projen.release.Publisher | Package publisher. |
| projen.release.Release | Release management. |
| projen.javascript.UpgradeDependencies | The upgrade workflow. |
| string | No description. |
| string | The directory in which compiled .js files reside. |
| string | The directory in which the .ts sources reside. |
| string | The directory in which tests reside. |
| projen.javascript.TypescriptConfig | A typescript configuration file which covers all files (sources, tests, projen). |
| projen.Task | The "watch" task. |
| boolean | No description. |
| projen.javascript.Eslint | No description. |
| projen.javascript.TypescriptConfig | No description. |
| projen.javascript.TypescriptConfig | No description. |
| string | The CDK app entrypoint. |
|
| cdk.json configuration. |
|
| No description. |
|
| Common CDK tasks. |
| string | The CDK version this app is using. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
buildTask
Required
public readonly buildTask: Task;
- Type: projen.Task
commitGenerated
Required
public readonly commitGenerated: boolean;
- Type: boolean
Whether to commit the managed files by default.
compileTask
Required
public readonly compileTask: Task;
- Type: projen.Task
components
Required
public readonly components: Component[];
- Type: projen.Component[]
Returns all the components within this project.
deps
Required
public readonly deps: Dependencies;
- Type: projen.Dependencies
Project dependencies.
ejected
Required
public readonly ejected: boolean;
- Type: boolean
Whether or not the project is being ejected.
files
Required
public readonly files: FileBase[];
- Type: projen.FileBase[]
All files in this project.
gitattributes
Required
public readonly gitattributes: GitAttributesFile;
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
public readonly gitignore: IgnoreFile;
- Type: projen.IgnoreFile
.gitignore.
logger
Required
public readonly logger: Logger;
- Type: projen.Logger
Logging utilities.
name
Required
public readonly name: string;
- Type: string
Project name.
outdir
Required
public readonly outdir: string;
- Type: string
Absolute output directory of this project.
packageTask
Required
public readonly packageTask: Task;
- Type: projen.Task
postCompileTask
Required
public readonly postCompileTask: Task;
- Type: projen.Task
preCompileTask
Required
public readonly preCompileTask: Task;
- Type: projen.Task
projectBuild
Required
public readonly projectBuild: ProjectBuild;
- Type: projen.ProjectBuild
Manages the build process of the project.
projenCommand
Required
public readonly projenCommand: string;
- Type: string
The command to use in order to run the projen CLI.
root
Required
public readonly root: Project;
- Type: projen.Project
The root project.
subprojects
Required
public readonly subprojects: Project[];
- Type: projen.Project[]
Returns all the subprojects within this project.
tasks
Required
public readonly tasks: Tasks;
- Type: projen.Tasks
Project tasks.
testTask
Required
public readonly testTask: Task;
- Type: projen.Task
defaultTask
Optional
public readonly defaultTask: Task;
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
initProject
Optional
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.
parent
Optional
public readonly parent: Project;
- Type: projen.Project
A parent project.
If undefined, this is the root project.
projectType
Required
public readonly projectType: ProjectType;
- Type: projen.ProjectType
autoApprove
Optional
public readonly autoApprove: AutoApprove;
- Type: projen.github.AutoApprove
Auto approve set up for this project.
devContainer
Optional
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
github
Optional
public readonly github: GitHub;
- Type: projen.github.GitHub
Access all github components.
This will be undefined
for subprojects.
gitpod
Optional
public readonly gitpod: Gitpod;
- Type: projen.Gitpod
Access for Gitpod.
This will be undefined
if gitpod boolean is false
vscode
Optional
public readonly vscode: VsCode;
- Type: projen.vscode.VsCode
Access all VSCode components.
This will be undefined
for subprojects.
allowLibraryDependencies
Required
allowLibraryDependencies
- Deprecated: use
package.allowLibraryDependencies
public readonly allowLibraryDependencies: boolean;
- Type: boolean
artifactsDirectory
Required
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
.
artifactsJavascriptDirectory
Required
public readonly artifactsJavascriptDirectory: string;
- Type: string
The location of the npm tarball after build (${artifactsDirectory}/js
).
bundler
Required
public readonly bundler: Bundler;
- Type: projen.javascript.Bundler
entrypoint
Required
entrypoint
- Deprecated: use
package.entrypoint
public readonly entrypoint: string;
- Type: string
manifest
Required
manifest
- Deprecated: use
package.addField(x, y)
public readonly manifest: any;
- Type: any
npmrc
Required
public readonly npmrc: NpmConfig;
- Type: projen.javascript.NpmConfig
The .npmrc file.
package
Required
public readonly package: NodePackage;
- Type: projen.javascript.NodePackage
API for managing the node package.
packageManager
Required
packageManager
- Deprecated: use
package.packageManager
public readonly packageManager: NodePackageManager;
- Type: projen.javascript.NodePackageManager
The package manager to use.
runScriptCommand
Required
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).
autoMerge
Optional
public readonly autoMerge: AutoMerge;
- Type: projen.github.AutoMerge
Component that sets up mergify for merging approved pull requests.
buildWorkflow
Optional
public readonly buildWorkflow: BuildWorkflow;
- Type: projen.build.BuildWorkflow
The PR build GitHub workflow.
undefined
if buildWorkflow
is disabled.
buildWorkflowJobId
Optional
public readonly buildWorkflowJobId: string;
- Type: string
The job ID of the build workflow.
jest
Optional
public readonly jest: Jest;
- Type: projen.javascript.Jest
The Jest configuration (if enabled).
maxNodeVersion
Optional
public readonly maxNodeVersion: string;
- Type: string
Maximum node version supported by this package.
The value indicates the package is incompatible with newer versions.
minNodeVersion
Optional
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.
npmignore
Optional
public readonly npmignore: IgnoreFile;
- Type: projen.IgnoreFile
The .npmignore file.
prettier
Optional
public readonly prettier: Prettier;
- Type: projen.javascript.Prettier
publisher
Optional
publisher
- 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.
release
Optional
public readonly release: Release;
- Type: projen.release.Release
Release management.
upgradeWorkflow
Optional
public readonly upgradeWorkflow: UpgradeDependencies;
- Type: projen.javascript.UpgradeDependencies
The upgrade workflow.
docsDirectory
Required
public readonly docsDirectory: string;
- Type: string
libdir
Required
public readonly libdir: string;
- Type: string
The directory in which compiled .js files reside.
srcdir
Required
public readonly srcdir: string;
- Type: string
The directory in which the .ts sources reside.
testdir
Required
public readonly testdir: string;
- Type: string
The directory in which tests reside.
tsconfigDev
Required
public readonly tsconfigDev: TypescriptConfig;
- Type: projen.javascript.TypescriptConfig
A typescript configuration file which covers all files (sources, tests, projen).
watchTask
Required
public readonly watchTask: Task;
- Type: projen.Task
The "watch" task.
docgen
Optional
public readonly docgen: boolean;
- Type: boolean
eslint
Optional
public readonly eslint: Eslint;
- Type: projen.javascript.Eslint
tsconfig
Optional
public readonly tsconfig: TypescriptConfig;
- Type: projen.javascript.TypescriptConfig
tsconfigEslint
Optional
public readonly tsconfigEslint: TypescriptConfig;
- Type: projen.javascript.TypescriptConfig
appEntrypoint
Required
public readonly appEntrypoint: string;
- Type: string
The CDK app entrypoint.
cdkConfig
Required
public readonly cdkConfig: CdkConfig;
- Type: CdkConfig
cdk.json configuration.
cdkDeps
Required
public readonly cdkDeps: AwsCdkDeps;
- Type: AwsCdkDeps
cdkTasks
Required
public readonly cdkTasks: CdkTasks;
- Type: CdkTasks
Common CDK tasks.
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
The CDK version this app is using.
Constants
Name | Type | Description |
---|---|---|
| string | The name of the default task (the task executed when projen is run without arguments). |
| string | No description. |
DEFAULT_TASK
Required
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_PATTERN
Required
public readonly DEFAULT_TS_JEST_TRANFORM_PATTERN: string;
- Type: string
CdkConfig
Represents cdk.json file.
Initializers
import { awscdk } from 'projen'
new awscdk.CdkConfig(project: Project, options: CdkConfigOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
- Type: CdkConfigOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Add excludes to cdk.json . |
| Add includes to cdk.json . |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addExcludes
public addExcludes(patterns: ...string[]): void
Add excludes to cdk.json
.
patterns
Required
- Type: ...string[]
The excludes to add.
addIncludes
public addIncludes(patterns: ...string[]): void
Add includes to cdk.json
.
patterns
Required
- Type: ...string[]
The includes to add.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.CdkConfig.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.CdkConfig.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string | Name of the cdk.out directory. |
| string[] | List of glob patterns to be excluded by CDK. |
| string[] | List of glob patterns to be included by CDK. |
| projen.JsonFile | Represents the JSON file. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
cdkout
Required
public readonly cdkout: string;
- Type: string
Name of the cdk.out directory.
exclude
Required
public readonly exclude: string[];
- Type: string[]
List of glob patterns to be excluded by CDK.
include
Required
public readonly include: string[];
- Type: string[]
List of glob patterns to be included by CDK.
json
Required
public readonly json: JsonFile;
- Type: projen.JsonFile
Represents the JSON file.
CdkTasks
Adds standard AWS CDK tasks to your project.
Initializers
import { awscdk } from 'projen'
new awscdk.CdkTasks(project: Project)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
project
Required
- Type: projen.Project
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.CdkTasks.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.CdkTasks.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| projen.Task | Deploys your app. |
| projen.Task | Destroys all the stacks. |
| projen.Task | Diff against production. |
| projen.Task | Synthesizes your app. |
| projen.Task | Synthesizes your app and suppresses stdout. |
| projen.Task | Watch task. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
deploy
Required
public readonly deploy: Task;
- Type: projen.Task
Deploys your app.
destroy
Required
public readonly destroy: Task;
- Type: projen.Task
Destroys all the stacks.
diff
Required
public readonly diff: Task;
- Type: projen.Task
Diff against production.
synth
Required
public readonly synth: Task;
- Type: projen.Task
Synthesizes your app.
synthSilent
Required
public readonly synthSilent: Task;
- Type: projen.Task
Synthesizes your app and suppresses stdout.
watch
Required
public readonly watch: Task;
- Type: projen.Task
Watch task.
ConstructLibraryAws
Initializers
import { awscdk } from 'projen'
new awscdk.ConstructLibraryAws(options: AwsCdkConstructLibraryOptions)
Name | Type | Description |
---|---|---|
|
| No description. |
options
Required
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Exclude the matching files from pre-synth cleanup. |
| Adds a .gitignore pattern. |
| Adds patterns to be ignored by npm. |
| Adds a new task to this project. |
| Prints a "tip" message during synthesis. |
| Marks the provided file(s) as being generated. |
| Called after all components are synthesized. |
| Called before all components are synthesized. |
| Removes a task from a project. |
| Returns the shell command to execute in order to run a task. |
| Synthesize all project files into outdir . |
| Finds a file at the specified relative path within this project and all its subprojects. |
| Finds a json file by name. |
| Finds an object file (like JsonFile, YamlFile, etc.) by name. |
| Finds a file at the specified relative path within this project and removes it. |
| No description. |
| Defines bundled dependencies. |
| DEPRECATED. |
| Defines normal dependencies. |
| Defines development/test dependencies. |
| Directly set fields in package.json . |
| Adds keywords to package.json (deduplicated). |
| Defines peer dependencies. |
| Replaces the contents of multiple npm package.json scripts. |
| DEPRECATED. |
| Indicates if a script by the name name is defined. |
| Removes the npm script (always successful). |
| Returns the set of workflow steps which should be executed to bootstrap a workflow. |
| Replaces the contents of an npm package.json script. |
| Adds dependencies to AWS CDK modules. |
| Adds AWS CDK modules as dev dependencies. |
toString
toString
public toString(): string
Returns a string representation of this construct.
addExcludeFromCleanup
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.
globs
Required
- Type: ...string[]
The glob patterns to match.
addGitIgnore
addGitIgnore
public addGitIgnore(pattern: string): void
Adds a .gitignore pattern.
pattern
Required
- Type: string
The glob pattern to ignore.
addPackageIgnore
addPackageIgnore
public addPackageIgnore(pattern: string): void
Adds patterns to be ignored by npm.
pattern
Required
- Type: string
The pattern to ignore.
addTask
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.
name
Required
- Type: string
The task name to add.
props
Optional
- Type: projen.TaskOptions
Task properties.
addTip
addTip
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- Type: string
The message.
annotateGenerated
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
glob
Required
- Type: string
the glob pattern to match (could be a file path).
postSynthesize
postSynthesize
public postSynthesize(): void
Called after all components are synthesized.
Order is not guaranteed.
preSynthesize
preSynthesize
public preSynthesize(): void
Called before all components are synthesized.
removeTask
removeTask
public removeTask(name: string): Task
Removes a task from a project.
name
Required
- Type: string
The name of the task to remove.
runTaskCommand
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
.
task
Required
- Type: projen.Task
The task for which the command is required.
synth
synth
public synth(): void
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all subprojects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- Call "this.postSynthesize()"
tryFindFile
tryFindFile
public tryFindFile(filePath: string): FileBase
Finds a file at the specified relative path within this project and all its subprojects.
filePath
Required
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
tryFindJsonFile
tryFindJsonFile
public tryFindJsonFile(filePath: string): JsonFile
Finds a json file by name.
filePath
Required
- Type: string
The file path.
tryFindObjectFile
tryFindObjectFile
public tryFindObjectFile(filePath: string): ObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
filePath
Required
- Type: string
The file path.
tryRemoveFile
tryRemoveFile
public tryRemoveFile(filePath: string): FileBase
Finds a file at the specified relative path within this project and removes it.
filePath
Required
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
addBins
addBins
public addBins(bins: {[ key: string ]: string}): void
bins
Required
- Type: {[ key: string ]: string}
addBundledDeps
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
.
deps
Required
- 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
addCompileCommand
public addCompileCommand(commands: ...string[]): void
DEPRECATED.
commands
Required
- Type: ...string[]
addDeps
addDeps
public addDeps(deps: ...string[]): void
Defines normal dependencies.
deps
Required
- 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
addDevDeps
public addDevDeps(deps: ...string[]): void
Defines development/test dependencies.
deps
Required
- 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
addFields
public addFields(fields: {[ key: string ]: any}): void
Directly set fields in package.json
.
fields
Required
- Type: {[ key: string ]: any}
The fields to set.
addKeywords
addKeywords
public addKeywords(keywords: ...string[]): void
Adds keywords to package.json (deduplicated).
keywords
Required
- Type: ...string[]
The keywords to add.
addPeerDeps
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.
deps
Required
- 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
addScripts
public addScripts(scripts: {[ key: string ]: string}): void
Replaces the contents of multiple npm package.json scripts.
scripts
Required
- Type: {[ key: string ]: string}
The scripts to set.
addTestCommand
addTestCommand
public addTestCommand(commands: ...string[]): void
DEPRECATED.
commands
Required
- Type: ...string[]
hasScript
hasScript
public hasScript(name: string): boolean
Indicates if a script by the name name is defined.
name
Required
- Type: string
The name of the script.
removeScript
removeScript
public removeScript(name: string): void
Removes the npm script (always successful).
name
Required
- Type: string
The name of the script.
renderWorkflowSetup
renderWorkflowSetup
public renderWorkflowSetup(options?: RenderWorkflowSetupOptions): JobStep[]
Returns the set of workflow steps which should be executed to bootstrap a workflow.
options
Optional
- Type: projen.javascript.RenderWorkflowSetupOptions
Options.
setScript
setScript
public setScript(name: string, command: string): void
Replaces the contents of an npm package.json script.
name
Required
- Type: string
The script name.
command
Required
- Type: string
The command to execute.
addCdkDependencies
addCdkDependencies
public addCdkDependencies(deps: ...string[]): void
Adds dependencies to AWS CDK modules.
Since this is a library project, dependencies will be added as peer dependencies.
deps
Required
- Type: ...string[]
names of cdk modules (e.g. @aws-cdk/aws-lambda
).
addCdkTestDependencies
addCdkTestDependencies
public addCdkTestDependencies(deps: ...string[]): void
Adds AWS CDK modules as dev dependencies.
deps
Required
- Type: ...string[]
names of cdk modules (e.g. @aws-cdk/aws-lambda
).
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a project. |
| Find the closest ancestor project for given construct. |
isConstruct
isConstruct
import { awscdk } from 'projen'
awscdk.ConstructLibraryAws.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.
x
Required
- Type: any
Any object.
isProject
isProject
import { awscdk } from 'projen'
awscdk.ConstructLibraryAws.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
of
import { awscdk } from 'projen'
awscdk.ConstructLibraryAws.of(construct: IConstruct)
Find the closest ancestor project for given construct.
When given a project, this it the project itself.
construct
Required
- Type: constructs.IConstruct
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Task | No description. |
| boolean | Whether to commit the managed files by default. |
| projen.Task | No description. |
| projen.Component[] | Returns all the components within this project. |
| projen.Dependencies | Project dependencies. |
| boolean | Whether or not the project is being ejected. |
| projen.FileBase[] | All files in this project. |
| projen.GitAttributesFile | The .gitattributes file for this repository. |
| projen.IgnoreFile | .gitignore. |
| projen.Logger | Logging utilities. |
| string | Project name. |
| string | Absolute output directory of this project. |
| projen.Task | No description. |
| projen.Task | No description. |
| projen.Task | No description. |
| projen.ProjectBuild | Manages the build process of the project. |
| string | The command to use in order to run the projen CLI. |
| projen.Project | The root project. |
| projen.Project[] | Returns all the subprojects within this project. |
| projen.Tasks | Project tasks. |
| projen.Task | No description. |
| projen.Task | This is the "default" task, the one that executes "projen". |
| projen.InitProject | The options used when this project is bootstrapped via projen new . |
| projen.Project | A parent project. |
| projen.ProjectType | No description. |
| projen.github.AutoApprove | Auto approve set up for this project. |
| projen.vscode.DevContainer | Access for .devcontainer.json (used for GitHub Codespaces). |
| projen.github.GitHub | Access all github components. |
| projen.Gitpod | Access for Gitpod. |
| projen.vscode.VsCode | Access all VSCode components. |
| boolean | No description. |
| string | The build output directory. |
| string | The location of the npm tarball after build (${artifactsDirectory}/js ). |
| projen.javascript.Bundler | No description. |
| string | No description. |
| any | No description. |
| projen.javascript.NpmConfig | The .npmrc file. |
| projen.javascript.NodePackage | API for managing the node package. |
| projen.javascript.NodePackageManager | The package manager to use. |
| string | The command to use to run scripts (e.g. yarn run or npm run depends on the package manager). |
| projen.github.AutoMerge | Component that sets up mergify for merging approved pull requests. |
| projen.build.BuildWorkflow | The PR build GitHub workflow. |
| string | The job ID of the build workflow. |
| projen.javascript.Jest | The Jest configuration (if enabled). |
| string | Maximum node version supported by this package. |
| string | The minimum node version required by this package to function. |
| projen.IgnoreFile | The .npmignore file. |
| projen.javascript.Prettier | No description. |
| projen.release.Publisher | Package publisher. |
| projen.release.Release | Release management. |
| projen.javascript.UpgradeDependencies | The upgrade workflow. |
| string | No description. |
| string | The directory in which compiled .js files reside. |
| string | The directory in which the .ts sources reside. |
| string | The directory in which tests reside. |
| projen.javascript.TypescriptConfig | A typescript configuration file which covers all files (sources, tests, projen). |
| projen.Task | The "watch" task. |
| boolean | No description. |
| projen.javascript.Eslint | No description. |
| projen.javascript.TypescriptConfig | No description. |
| projen.javascript.TypescriptConfig | No description. |
|
| No description. |
| string | The target CDK version for this library. |
| string | No description. |
node
Required
node
- Deprecated: use
AwsCdkConstructLibrary
public readonly node: Node;
- Type: constructs.Node
The tree node.
buildTask
Required
buildTask
- Deprecated: use
AwsCdkConstructLibrary
public readonly buildTask: Task;
- Type: projen.Task
commitGenerated
Required
commitGenerated
- Deprecated: use
AwsCdkConstructLibrary
public readonly commitGenerated: boolean;
- Type: boolean
Whether to commit the managed files by default.
compileTask
Required
compileTask
- Deprecated: use
AwsCdkConstructLibrary
public readonly compileTask: Task;
- Type: projen.Task
components
Required
components
- Deprecated: use
AwsCdkConstructLibrary
public readonly components: Component[];
- Type: projen.Component[]
Returns all the components within this project.
deps
Required
deps
- Deprecated: use
AwsCdkConstructLibrary
public readonly deps: Dependencies;
- Type: projen.Dependencies
Project dependencies.
ejected
Required
ejected
- Deprecated: use
AwsCdkConstructLibrary
public readonly ejected: boolean;
- Type: boolean
Whether or not the project is being ejected.
files
Required
files
- Deprecated: use
AwsCdkConstructLibrary
public readonly files: FileBase[];
- Type: projen.FileBase[]
All files in this project.
gitattributes
Required
gitattributes
- Deprecated: use
AwsCdkConstructLibrary
public readonly gitattributes: GitAttributesFile;
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
gitignore
Required
gitignore
- Deprecated: use
AwsCdkConstructLibrary
public readonly gitignore: IgnoreFile;
- Type: projen.IgnoreFile
.gitignore.
logger
Required
logger
- Deprecated: use
AwsCdkConstructLibrary
public readonly logger: Logger;
- Type: projen.Logger
Logging utilities.
name
Required
name
- Deprecated: use
AwsCdkConstructLibrary
public readonly name: string;
- Type: string
Project name.
outdir
Required
outdir
- Deprecated: use
AwsCdkConstructLibrary
public readonly outdir: string;
- Type: string
Absolute output directory of this project.
packageTask
Required
packageTask
- Deprecated: use
AwsCdkConstructLibrary
public readonly packageTask: Task;
- Type: projen.Task
postCompileTask
Required
postCompileTask
- Deprecated: use
AwsCdkConstructLibrary
public readonly postCompileTask: Task;
- Type: projen.Task
preCompileTask
Required
preCompileTask
- Deprecated: use
AwsCdkConstructLibrary
public readonly preCompileTask: Task;
- Type: projen.Task
projectBuild
Required
projectBuild
- Deprecated: use
AwsCdkConstructLibrary
public readonly projectBuild: ProjectBuild;
- Type: projen.ProjectBuild
Manages the build process of the project.
projenCommand
Required
projenCommand
- Deprecated: use
AwsCdkConstructLibrary
public readonly projenCommand: string;
- Type: string
The command to use in order to run the projen CLI.
root
Required
root
- Deprecated: use
AwsCdkConstructLibrary
public readonly root: Project;
- Type: projen.Project
The root project.
subprojects
Required
subprojects
- Deprecated: use
AwsCdkConstructLibrary
public readonly subprojects: Project[];
- Type: projen.Project[]
Returns all the subprojects within this project.
tasks
Required
tasks
- Deprecated: use
AwsCdkConstructLibrary
public readonly tasks: Tasks;
- Type: projen.Tasks
Project tasks.
testTask
Required
testTask
- Deprecated: use
AwsCdkConstructLibrary
public readonly testTask: Task;
- Type: projen.Task
defaultTask
Optional
defaultTask
- Deprecated: use
AwsCdkConstructLibrary
public readonly defaultTask: Task;
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
initProject
Optional
initProject
- Deprecated: use
AwsCdkConstructLibrary
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.
parent
Optional
parent
- Deprecated: use
AwsCdkConstructLibrary
public readonly parent: Project;
- Type: projen.Project
A parent project.
If undefined, this is the root project.
projectType
Required
projectType
- Deprecated: use
AwsCdkConstructLibrary
public readonly projectType: ProjectType;
- Type: projen.ProjectType
autoApprove
Optional
autoApprove
- Deprecated: use
AwsCdkConstructLibrary
public readonly autoApprove: AutoApprove;
- Type: projen.github.AutoApprove
Auto approve set up for this project.
devContainer
Optional
devContainer
- Deprecated: use
AwsCdkConstructLibrary
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
github
Optional
github
- Deprecated: use
AwsCdkConstructLibrary
public readonly github: GitHub;
- Type: projen.github.GitHub
Access all github components.
This will be undefined
for subprojects.
gitpod
Optional
gitpod
- Deprecated: use
AwsCdkConstructLibrary
public readonly gitpod: Gitpod;
- Type: projen.Gitpod
Access for Gitpod.
This will be undefined
if gitpod boolean is false
vscode
Optional
vscode
- Deprecated: use
AwsCdkConstructLibrary
public readonly vscode: VsCode;
- Type: projen.vscode.VsCode
Access all VSCode components.
This will be undefined
for subprojects.
allowLibraryDependencies
Required
allowLibraryDependencies
- Deprecated: use
package.allowLibraryDependencies
public readonly allowLibraryDependencies: boolean;
- Type: boolean
artifactsDirectory
Required
artifactsDirectory
- Deprecated: use
AwsCdkConstructLibrary
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
.
artifactsJavascriptDirectory
Required
artifactsJavascriptDirectory
- Deprecated: use
AwsCdkConstructLibrary
public readonly artifactsJavascriptDirectory: string;
- Type: string
The location of the npm tarball after build (${artifactsDirectory}/js
).
bundler
Required
bundler
- Deprecated: use
AwsCdkConstructLibrary
public readonly bundler: Bundler;
- Type: projen.javascript.Bundler
entrypoint
Required
entrypoint
- Deprecated: use
package.entrypoint
public readonly entrypoint: string;
- Type: string
manifest
Required
manifest
- Deprecated: use
package.addField(x, y)
public readonly manifest: any;
- Type: any
npmrc
Required
npmrc
- Deprecated: use
AwsCdkConstructLibrary
public readonly npmrc: NpmConfig;
- Type: projen.javascript.NpmConfig
The .npmrc file.
package
Required
package
- Deprecated: use
AwsCdkConstructLibrary
public readonly package: NodePackage;
- Type: projen.javascript.NodePackage
API for managing the node package.
packageManager
Required
packageManager
- Deprecated: use
package.packageManager
public readonly packageManager: NodePackageManager;
- Type: projen.javascript.NodePackageManager
The package manager to use.
runScriptCommand
Required
runScriptCommand
- Deprecated: use
AwsCdkConstructLibrary
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).
autoMerge
Optional
autoMerge
- Deprecated: use
AwsCdkConstructLibrary
public readonly autoMerge: AutoMerge;
- Type: projen.github.AutoMerge
Component that sets up mergify for merging approved pull requests.
buildWorkflow
Optional
buildWorkflow
- Deprecated: use
AwsCdkConstructLibrary
public readonly buildWorkflow: BuildWorkflow;
- Type: projen.build.BuildWorkflow
The PR build GitHub workflow.
undefined
if buildWorkflow
is disabled.
buildWorkflowJobId
Optional
buildWorkflowJobId
- Deprecated: use
AwsCdkConstructLibrary
public readonly buildWorkflowJobId: string;
- Type: string
The job ID of the build workflow.
jest
Optional
jest
- Deprecated: use
AwsCdkConstructLibrary
public readonly jest: Jest;
- Type: projen.javascript.Jest
The Jest configuration (if enabled).
maxNodeVersion
Optional
maxNodeVersion
- Deprecated: use
AwsCdkConstructLibrary
public readonly maxNodeVersion: string;
- Type: string
Maximum node version supported by this package.
The value indicates the package is incompatible with newer versions.
minNodeVersion
Optional
minNodeVersion
- Deprecated: use
AwsCdkConstructLibrary
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.
npmignore
Optional
npmignore
- Deprecated: use
AwsCdkConstructLibrary
public readonly npmignore: IgnoreFile;
- Type: projen.IgnoreFile
The .npmignore file.
prettier
Optional
prettier
- Deprecated: use
AwsCdkConstructLibrary
public readonly prettier: Prettier;
- Type: projen.javascript.Prettier
publisher
Optional
publisher
- 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.
release
Optional
release
- Deprecated: use
AwsCdkConstructLibrary
public readonly release: Release;
- Type: projen.release.Release
Release management.
upgradeWorkflow
Optional
upgradeWorkflow
- Deprecated: use
AwsCdkConstructLibrary
public readonly upgradeWorkflow: UpgradeDependencies;
- Type: projen.javascript.UpgradeDependencies
The upgrade workflow.
docsDirectory
Required
docsDirectory
- Deprecated: use
AwsCdkConstructLibrary
public readonly docsDirectory: string;
- Type: string
libdir
Required
libdir
- Deprecated: use
AwsCdkConstructLibrary
public readonly libdir: string;
- Type: string
The directory in which compiled .js files reside.
srcdir
Required
srcdir
- Deprecated: use
AwsCdkConstructLibrary
public readonly srcdir: string;
- Type: string
The directory in which the .ts sources reside.
testdir
Required
testdir
- Deprecated: use
AwsCdkConstructLibrary
public readonly testdir: string;
- Type: string
The directory in which tests reside.
tsconfigDev
Required
tsconfigDev
- Deprecated: use
AwsCdkConstructLibrary
public readonly tsconfigDev: TypescriptConfig;
- Type: projen.javascript.TypescriptConfig
A typescript configuration file which covers all files (sources, tests, projen).
watchTask
Required
watchTask
- Deprecated: use
AwsCdkConstructLibrary
public readonly watchTask: Task;
- Type: projen.Task
The "watch" task.
docgen
Optional
docgen
- Deprecated: use
AwsCdkConstructLibrary
public readonly docgen: boolean;
- Type: boolean
eslint
Optional
eslint
- Deprecated: use
AwsCdkConstructLibrary
public readonly eslint: Eslint;
- Type: projen.javascript.Eslint
tsconfig
Optional
tsconfig
- Deprecated: use
AwsCdkConstructLibrary
public readonly tsconfig: TypescriptConfig;
- Type: projen.javascript.TypescriptConfig
tsconfigEslint
Optional
tsconfigEslint
- Deprecated: use
AwsCdkConstructLibrary
public readonly tsconfigEslint: TypescriptConfig;
- Type: projen.javascript.TypescriptConfig
cdkDeps
Required
cdkDeps
- Deprecated: use
AwsCdkConstructLibrary
public readonly cdkDeps: AwsCdkDeps;
- Type: AwsCdkDeps
cdkVersion
Required
cdkVersion
- Deprecated: use
AwsCdkConstructLibrary
public readonly cdkVersion: string;
- Type: string
The target CDK version for this library.
version
Required
version
- Deprecated: use
cdkVersion
public readonly version: string;
- Type: string
Constants
Name | Type | Description |
---|---|---|
| string | The name of the default task (the task executed when projen is run without arguments). |
| string | No description. |
DEFAULT_TASK
Required
DEFAULT_TASK
- Deprecated: use
AwsCdkConstructLibrary
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_PATTERN
Required
DEFAULT_TS_JEST_TRANFORM_PATTERN
- Deprecated: use
AwsCdkConstructLibrary
public readonly DEFAULT_TS_JEST_TRANFORM_PATTERN: string;
- Type: string
EdgeLambdaAutoDiscover
Creates edge lambdas from entry points discovered in the project's source tree.
Initializers
import { awscdk } from 'projen'
new awscdk.EdgeLambdaAutoDiscover(project: Project, options: EdgeLambdaAutoDiscoverOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.EdgeLambdaAutoDiscover.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.EdgeLambdaAutoDiscover.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string[] | Auto-discovered entry points with paths relative to the project directory. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
entrypoints
Required
public readonly entrypoints: string[];
- Type: string[]
Auto-discovered entry points with paths relative to the project directory.
IntegrationTest
Cloud integration tests.
Initializers
import { awscdk } from 'projen'
new awscdk.IntegrationTest(project: Project, options: IntegrationTestOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
- Type: IntegrationTestOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.IntegrationTest.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.IntegrationTest.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| projen.Task | Synthesizes the integration test and compares against a local copy (runs during build). |
| projen.Task | Deploy the integration test and update the snapshot upon success. |
| projen.Task | Just update snapshot (without deployment). |
| projen.Task | Destroy the integration test resources. |
| projen.Task | The watch task. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
assertTask
Required
public readonly assertTask: Task;
- Type: projen.Task
Synthesizes the integration test and compares against a local copy (runs during build).
deployTask
Required
public readonly deployTask: Task;
- Type: projen.Task
Deploy the integration test and update the snapshot upon success.
snapshotTask
Required
public readonly snapshotTask: Task;
- Type: projen.Task
Just update snapshot (without deployment).
destroyTask
Required
public readonly destroyTask: Task;
- Type: projen.Task
Destroy the integration test resources.
watchTask
Required
public readonly watchTask: Task;
- Type: projen.Task
The watch task.
IntegrationTestAutoDiscover
Creates integration tests from entry points discovered in the test tree.
Initializers
import { awscdk } from 'projen'
new awscdk.IntegrationTestAutoDiscover(project: Project, options: IntegrationTestAutoDiscoverOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.IntegrationTestAutoDiscover.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.IntegrationTestAutoDiscover.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string[] | Auto-discovered entry points with paths relative to the project directory. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
entrypoints
Required
public readonly entrypoints: string[];
- Type: string[]
Auto-discovered entry points with paths relative to the project directory.
LambdaAutoDiscover
Creates lambdas from entry points discovered in the project's source tree.
Initializers
import { awscdk } from 'projen'
new awscdk.LambdaAutoDiscover(project: Project, options: LambdaAutoDiscoverOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.LambdaAutoDiscover.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.LambdaAutoDiscover.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string[] | Auto-discovered entry points with paths relative to the project directory. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
entrypoints
Required
public readonly entrypoints: string[];
- Type: string[]
Auto-discovered entry points with paths relative to the project directory.
LambdaExtension
Create a Lambda Extension.
Initializers
import { awscdk } from 'projen'
new awscdk.LambdaExtension(project: Project, options: LambdaExtensionOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
- Type: LambdaExtensionOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.LambdaExtension.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.LambdaExtension.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
LambdaExtensionAutoDiscover
Creates Lambda Extensions from entrypoints discovered in the project's source tree.
Initializers
import { awscdk } from 'projen'
new awscdk.LambdaExtensionAutoDiscover(project: Project, options: LambdaExtensionAutoDiscoverOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.LambdaExtensionAutoDiscover.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.LambdaExtensionAutoDiscover.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string[] | Auto-discovered entry points with paths relative to the project directory. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
entrypoints
Required
public readonly entrypoints: string[];
- Type: string[]
Auto-discovered entry points with paths relative to the project directory.
LambdaFunction
Generates a pre-bundled AWS Lambda function construct from handler code.
To use this, create an AWS Lambda handler file under your source tree with
the .lambda.ts
extension and add a LambdaFunction
component to your
typescript project pointing to this entrypoint.
This will add a task to your "compile" step which will use esbuild
to
bundle the handler code into the build directory. It will also generate a
file src/foo-function.ts
with a custom AWS construct called FooFunction
which extends @aws-cdk/aws-lambda.Function
which is bound to the bundled
handle through an asset.
Example
new LambdaFunction(myProject, {
srcdir: myProject.srcdir,
entrypoint: 'src/foo.lambda.ts',
});
Initializers
import { awscdk } from 'projen'
new awscdk.LambdaFunction(project: Project, options: LambdaFunctionOptions)
Name | Type | Description |
---|---|---|
| projen.Project | The project to use. |
|
| Options. |
project
Required
- Type: projen.Project
The project to use.
options
Required
- Type: LambdaFunctionOptions
Options.
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { awscdk } from 'projen'
awscdk.LambdaFunction.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.
x
Required
- Type: any
Any object.
isComponent
import { awscdk } from 'projen'
awscdk.LambdaFunction.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
Structs
AutoDiscoverCommonOptions
Common options for auto discovering project subcomponents.
Initializer
import { awscdk } from 'projen'
const autoDiscoverCommonOptions: awscdk.AutoDiscoverCommonOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
|
| AWS CDK dependency manager. |
| string | Path to the tsconfig file to use for integration tests. |
cdkDeps
Required
public readonly cdkDeps: AwsCdkDeps;
- Type: AwsCdkDeps
AWS CDK dependency manager.
tsconfigPath
Required
public readonly tsconfigPath: string;
- Type: string
Path to the tsconfig file to use for integration tests.
AutoDiscoverOptions
Options for AutoDiscover
.
Initializer
import { awscdk } from 'projen'
const autoDiscoverOptions: awscdk.AutoDiscoverOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
|
| AWS CDK dependency manager. |
| string | Path to the tsconfig file to use for integration tests. |
| string | Project source tree (relative to project output directory). |
|
| Options for AWS Lambda functions. |
|
| Options for lambda extensions. |
| string | Test source tree. |
|
| Options for integration tests. |
| boolean | Auto-discover edge lambda functions. |
| boolean | Auto-discover integration tests. |
| boolean | Auto-discover lambda functions. |
| boolean | Auto-discover lambda extensions. |
cdkDeps
Required
public readonly cdkDeps: AwsCdkDeps;
- Type: AwsCdkDeps
AWS CDK dependency manager.
tsconfigPath
Required
public readonly tsconfigPath: string;
- Type: string
Path to the tsconfig file to use for integration tests.
srcdir
Required
public readonly srcdir: string;
- Type: string
Project source tree (relative to project output directory).
lambdaOptions
Optional
public readonly lambdaOptions: LambdaFunctionCommonOptions;
Options for AWS Lambda functions.
lambdaExtensionOptions
Optional
public readonly lambdaExtensionOptions: LambdaExtensionCommonOptions;
Options for lambda extensions.
testdir
Required
public readonly testdir: string;
- Type: string
Test source tree.
integrationTestOptions
Optional
public readonly integrationTestOptions: IntegrationTestCommonOptions;
Options for integration tests.
edgeLambdaAutoDiscover
Optional
public readonly edgeLambdaAutoDiscover: boolean;
- Type: boolean
- Default: true
Auto-discover edge lambda functions.
integrationTestAutoDiscover
Optional
public readonly integrationTestAutoDiscover: boolean;
- Type: boolean
- Default: true
Auto-discover integration tests.
lambdaAutoDiscover
Optional
public readonly lambdaAutoDiscover: boolean;
- Type: boolean
- Default: true
Auto-discover lambda functions.
lambdaExtensionAutoDiscover
Optional
public readonly lambdaExtensionAutoDiscover: boolean;
- Type: boolean
- Default: true
Auto-discover lambda extensions.
AwsCdkConstructLibraryOptions
Options for AwsCdkConstructLibrary
.
Initializer
import { awscdk } from 'projen'
const awsCdkConstructLibraryOptions: awscdk.AwsCdkConstructLibraryOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | This is the name of your project. |
| boolean | Whether to commit the managed files by default. |
| projen.IgnoreFileOptions | Configuration options for .gitignore file. |
| projen.GitOptions | Configuration options for git. |
| projen.LoggerOptions | Configure logging options such as verbosity. |
| string | The root directory of the project. |
| projen.Project | The parent project, if this project is part of a bigger project. |
| string | The shell command to use in order to run the projen CLI. |
| boolean | Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation. |
| projen.ProjenrcJsonOptions | Options for .projenrc.json. |
| boolean | Use renovatebot to handle dependency upgrades. |
| projen.RenovatebotOptions | Options for renovatebot. |
| projen.github.AutoApproveOptions | Enable and configure the 'auto approve' workflow. |
| boolean | Enable automatic merging on GitHub. |
| projen.github.AutoMergeOptions | Configure options for automatic merging on GitHub. |
| boolean | Add a clobber task which resets the repo to origin. |
| boolean | Add a VSCode development environment (used for GitHub Codespaces). |
| boolean | Enable GitHub integration. |
| projen.github.GitHubOptions | Options for GitHub integration. |
| boolean | Add a Gitpod development environment. |
| boolean | Whether mergify should be enabled on this repository or not. |
| projen.github.MergifyOptions | Options for mergify. |
| projen.ProjectType | Which type of project this is (library/app). |
| projen.github.GithubCredentials | Choose a method of providing GitHub API access for projen workflows. |
| string | The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows. |
| projen.SampleReadmeProps | The README setup. |
| boolean | Auto-close of stale issues and pull request. |
| projen.github.StaleOptions | Auto-close stale issues and pull requests. |
| boolean | Enable VSCode integration. |
| boolean | Allow the project to include peerDependencies and bundledDependencies . |
| string | Author's e-mail. |
| string | Author's name. |
| boolean | Is the author an organization. |
| string | Author's URL / Website. |
| boolean | Automatically add all executables under the bin directory to your package.json file under the bin section. |
| {[ key: string ]: string} | Binary programs vended with your module. |
| string | The email address to which issues should be reported. |
| string | The url to your project's issue tracker. |
| string[] | List of dependencies to bundle into this module. |
| string | The version of Bun to use if using Bun as a package manager. |
| projen.javascript.CodeArtifactOptions | Options for npm packages using AWS CodeArtifact. |
| string[] | Runtime dependencies of this module. |
| string | The description is just a string that helps people understand the purpose of the package. |
| string[] | Build dependencies for this module. |
| string | Module entrypoint (main in package.json ). |
| string | Package's Homepage / Website. |
| string[] | Keywords to include in package.json . |
| string | License's SPDX identifier. |
| boolean | Indicates if a license should be added. |
| string | The maximum node version supported by this package. Most projects should not use this option. |
| string | The minimum node version required by this package to function. Most projects should not use this option. |
| projen.javascript.NpmAccess | Access level of the npm package. |
| boolean | Should provenance statements be generated when the package is published. |
| string | The host name of the npm registry to publish to. |
| string | The base URL of the npm package registry. |
| string | GitHub secret which contains the NPM token to use when publishing packages. |
| projen.javascript.NodePackageManager | The Node Package Manager used to execute scripts. |
| string | The "name" in package.json. |
| projen.javascript.PeerDependencyOptions | Options for peerDeps . |
| string[] | Peer dependencies for this module. |
| string | The version of PNPM to use if using PNPM as a package manager. |
| string | The repository is the location where the actual code for your package lives. |
| 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. |
| projen.javascript.ScopedPackagesOptions[] | Options for privately hosted scoped packages. |
| {[ key: string ]: string} | npm scripts to include. |
| string | Package's Stability. |
| projen.javascript.YarnBerryOptions | Options for Yarn Berry. |
| string | The commit-and-tag-version compatible package used to bump the package version, as a dependency string. |
| string | Version requirement of publib which is used to publish modules to npm. |
| number | Major version to release from the default branch. |
| number | Minimal Major version to release. |
| string | A shell command to control the next version to release. |
| string | The npmDistTag to use when publishing from the default branch. |
| projen.github.workflows.JobStep[] | Steps to execute after build as part of the release workflow. |
| string | Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre"). |
| boolean | Instead of actually publishing to package managers, just print the publishing command. |
| boolean | Define publishing tasks that can be executed manually as well as workflows. |
| projen.ReleasableCommits | Find commits that should be considered releasable Used to decide if a release is required. |
| {[ key: string ]: projen.release.BranchOptions} | Defines additional release branches. |
| boolean | Automatically release new versions every commit to one of branches in releaseBranches . |
| boolean | Create a github issue on every failed publishing task. |
| string | The label to apply to issues indicating publish failures. |
| string | CRON schedule to trigger new releases. |
| string | Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers. |
| projen.release.ReleaseTrigger | The release trigger to use. |
| string | The name of the default release workflow. |
| projen.github.workflows.JobStep[] | A set of workflow steps to execute in order to setup the workflow container. |
| {[ key: string ]: any} | Custom configuration used when creating changelog with commit-and-tag-version package. |
| string | Container image to use for GitHub workflows. |
| string[] | Github Runner selection labels. |
| projen.GroupRunnerOptions | Github Runner Group selection options. |
| string | The name of the main release branch. |
| string | A directory which will contain build artifacts. |
| boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued). |
| boolean | Define a GitHub workflow for building PRs. |
| projen.javascript.BuildWorkflowOptions | Options for PR build workflow. |
| projen.github.workflows.Triggers | Build workflow triggers. |
| projen.javascript.BundlerOptions | Options for Bundler . |
| projen.javascript.LicenseCheckerOptions | Configure which licenses should be deemed acceptable for use by dependencies. |
| 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 . |
| string | Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories. |
| string | License copyright owner. |
| string | The copyright years to put in the LICENSE file. |
| boolean | Use dependabot to handle dependency upgrades. |
| projen.github.DependabotOptions | Options for dependabot. |
| boolean | Use tasks and github workflows to handle dependency upgrades. |
| projen.javascript.UpgradeDependenciesOptions | Options for UpgradeDependencies . |
| string[] | Additional entries to .gitignore. |
| boolean | Setup jest unit tests. |
| projen.javascript.JestOptions | Jest options. |
| boolean | Automatically update files modified during builds to pull-request branches. |
| string[] | Additional entries to .npmignore. |
| boolean | Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs. |
| projen.IgnoreFileOptions | Configuration options for .npmignore file. |
| boolean | Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist ). |
| boolean | Setup prettier. |
| projen.javascript.PrettierOptions | Prettier options. |
| boolean | Indicates of "projen" should be installed as a devDependency. |
| boolean | Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation. |
| projen.javascript.ProjenrcOptions | Options for .projenrc.js. |
| string | Version of projen to install. |
| boolean | Include a GitHub pull request template. |
| string[] | The contents of the pull request template. |
| boolean | Add release management to this project. |
| boolean | Automatically release to npm when new versions are introduced. |
| boolean | DEPRECATED: renamed to release . |
| projen.github.workflows.JobStep[] | Workflow steps to use in order to bootstrap this repo. |
| projen.github.GitIdentity | The git identity to use in workflows. |
| string | The node version used in GitHub Actions workflows. |
| boolean | Enable Node.js package cache in GitHub workflows. |
| boolean | Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler). |
| boolean | Do not generate a tsconfig.dev.json file. |
| boolean | Docgen by Typedoc. |
| string | Docs directory. |
| string | The .d.ts file that includes the type declarations for this module. |
| boolean | Setup eslint. |
| projen.javascript.EslintOptions | Eslint options. |
| string | Typescript artifacts output directory. |
| boolean | Use TypeScript for your projenrc file (.projenrc.ts ). |
| projen.typescript.ProjenrcOptions | Options for .projenrc.ts. |
| boolean | Generate one-time sample in src/ and test/ if there are no files there. |
| string | Typescript sources directory. |
| string | Jest tests directory. Tests files should be named xxx.test.ts . |
| projen.javascript.TypescriptConfigOptions | Custom TSConfig. |
| projen.javascript.TypescriptConfigOptions | Custom tsconfig options for the development tsconfig.json file (used for testing). |
| string | The name of the development tsconfig.json file. |
| projen.typescript.TsJestOptions | Options for ts-jest. |
| string | TypeScript version to use. |
| string | The name of the library author. |
| string | Email or URL of the library author. |
| string | Git repository URL. |
| boolean | Automatically run API compatibility test against the latest version published to npm after compilation. |
| string | Name of the ignore file for API compatibility tests. |
| boolean | Emit a compressed version of the assembly. |
| string | File path for generated docs. |
| projen.cdk.JsiiDotNetTarget | No description. |
| string[] | Accepts a list of glob patterns. |
| string | Version of the jsii compiler to use. |
| projen.cdk.JsiiGoTarget | Publish Go bindings to a git repository. |
| projen.cdk.JsiiJavaTarget | Publish to maven. |
| projen.cdk.JsiiDotNetTarget | Publish to NuGet. |
| projen.cdk.JsiiPythonTarget | Publish to pypi. |
| projen.cdk.JsiiPythonTarget | No description. |
| string | No description. |
| projen.cdk.Catalog | Libraries will be picked up by the construct catalog when they are published to npm as jsii modules and will be published under:. |
| string | Minimum version of the AWS CDK to depend on. |
| boolean | Warning: NodeJS only. |
| boolean | Install the assertions library? |
| string | Version range of the AWS CDK CLI to depend on. |
| string[] | Which AWS CDKv1 modules this project requires. |
| boolean | If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies ). |
| string[] | AWS CDK modules required for testing. |
| boolean | Use pinned version instead of caret version for CDK. |
| string | Minimum version of the constructs library to depend on. |
| 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. |
| boolean | Enable experimental support for the AWS CDK integ-runner. |
| boolean | Automatically discovers and creates integration tests for each .integ.ts file under your test directory. |
| boolean | Automatically adds an aws_lambda.Function for each .lambda.ts handler in your source tree. If this is disabled, you either need to explicitly call aws_lambda.Function.autoDiscover() or define a new aws_lambda.Function() for each handler. |
| 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. |
|
| Common options for all AWS Lambda functions. |
name
Required
public readonly name: string;
- Type: string
- Default: $BASEDIR
This is the name of your project.
commitGenerated
Optional
public readonly commitGenerated: boolean;
- Type: boolean
- Default: true
Whether to commit the managed files by default.
gitIgnoreOptions
Optional
public readonly gitIgnoreOptions: IgnoreFileOptions;
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
gitOptions
Optional
public readonly gitOptions: GitOptions;
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
public readonly logging: LoggerOptions;
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
public readonly parent: Project;
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projenCommand
Optional
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.
projenrcJson
Optional
public readonly projenrcJson: boolean;
- Type: boolean
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrcJsonOptions
Optional
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
public readonly renovatebot: boolean;
- Type: boolean
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebotOptions
Optional
public readonly renovatebotOptions: RenovatebotOptions;
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
autoApproveOptions
Optional
public readonly autoApproveOptions: AutoApproveOptions;
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
autoMerge
Optional
public readonly autoMerge: boolean;
- Type: boolean
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
autoMergeOptions
Optional
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.
clobber
Optional
public readonly clobber: boolean;
- Type: boolean
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
devContainer
Optional
public readonly devContainer: boolean;
- Type: boolean
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
github
Optional
public readonly github: boolean;
- Type: boolean
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
githubOptions
Optional
public readonly githubOptions: GitHubOptions;
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitpod
Optional
public readonly gitpod: boolean;
- Type: boolean
- Default: false
Add a Gitpod development environment.
mergify
Optional
mergify
- Deprecated: use
githubOptions.mergify
instead
public readonly mergify: boolean;
- Type: boolean
- Default: true
Whether mergify should be enabled on this repository or not.
mergifyOptions
Optional
mergifyOptions
- Deprecated: use
githubOptions.mergifyOptions
instead
public readonly mergifyOptions: MergifyOptions;
- Type: projen.github.MergifyOptions
- Default: default options
Options for mergify.
projectType
Optional
projectType
- Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
- Type: projen.ProjectType
- Default: ProjectType.UNKNOWN
Which type of project this is (library/app).
projenCredentials
Optional
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.
projenTokenSecret
Optional
projenTokenSecret
- Deprecated: use
projenCredentials
public readonly projenTokenSecret: string;
- Type: string
- Default: "PROJEN_GITHUB_TOKEN"
The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
This token needs to have the repo
, workflows
and packages
scope.
readme
Optional
public readonly readme: SampleReadmeProps;
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
Example
"{ filename: 'readme.md', contents: '# title' }"
stale
Optional
public readonly stale: boolean;
- Type: boolean
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
staleOptions
Optional
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
.
vscode
Optional
public readonly vscode: boolean;
- Type: boolean
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
allowLibraryDependencies
Optional
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.
authorEmail
Optional
public readonly authorEmail: string;
- Type: string
Author's e-mail.
authorName
Optional
public readonly authorName: string;
- Type: string
Author's name.
authorOrganization
Optional
public readonly authorOrganization: boolean;
- Type: boolean
Is the author an organization.
authorUrl
Optional
public readonly authorUrl: string;
- Type: string
Author's URL / Website.
autoDetectBin
Optional
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.
bin
Optional
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.
bugsEmail
Optional
public readonly bugsEmail: string;
- Type: string
The email address to which issues should be reported.
bugsUrl
Optional
public readonly bugsUrl: string;
- Type: string
The url to your project's issue tracker.
bundledDeps
Optional
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.
bunVersion
Optional
public readonly bunVersion: string;
- Type: string
- Default: "latest"
The version of Bun to use if using Bun as a package manager.
codeArtifactOptions
Optional
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
deps
Optional
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.
Example
[ 'express', 'lodash', 'foo@^2' ]
description
Optional
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
devDeps
Optional
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.
Example
[ 'typescript', '@types/express' ]
entrypoint
Optional
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
homepage
Optional
public readonly homepage: string;
- Type: string
Package's Homepage / Website.
keywords
Optional
public readonly keywords: string[];
- Type: string[]
Keywords to include in package.json
.
license
Optional
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.
licensed
Optional
public readonly licensed: boolean;
- Type: boolean
- Default: true
Indicates if a license should be added.
maxNodeVersion
Optional
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.
minNodeVersion
Optional
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
.
npmAccess
Optional
public readonly npmAccess: NpmAccess;
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npmProvenance
Optional
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.
npmRegistry
Optional
npmRegistry
- Deprecated: use
npmRegistryUrl
instead
public readonly npmRegistry: string;
- Type: string
The host name of the npm registry to publish to.
Cannot be set together with npmRegistryUrl
.
npmRegistryUrl
Optional
public readonly npmRegistryUrl: string;
- Type: string
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npmTokenSecret
Optional
public readonly npmTokenSecret: string;
- Type: string
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
packageManager
Optional
public readonly packageManager: NodePackageManager;
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
packageName
Optional
public readonly packageName: string;
- Type: string
- Default: defaults to project name
The "name" in package.json.
peerDependencyOptions
Optional
public readonly peerDependencyOptions: PeerDependencyOptions;
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peerDeps
Optional
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.
pnpmVersion
Optional
public readonly pnpmVersion: string;
- Type: string
- Default: "9"
The version of PNPM to use if using PNPM as a package manager.
repository
Optional
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
repositoryDirectory
Optional
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.
scopedPackagesOptions
Optional
public readonly scopedPackagesOptions: ScopedPackagesOptions[];
- Type: projen.javascript.ScopedPackagesOptions[]
- Default: fetch all scoped packages from the public npm registry
Options for privately hosted scoped packages.
scripts
Optional
scripts
- Deprecated: use
project.addTask()
orpackage.setScript()
public readonly scripts: {[ key: string ]: string};
- 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. Also adds the script as a task.
stability
Optional
public readonly stability: string;
- Type: string
Package's Stability.
yarnBerryOptions
Optional
public readonly yarnBerryOptions: YarnBerryOptions;
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
bumpPackage
Optional
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
.
jsiiReleaseVersion
Optional
public readonly jsiiReleaseVersion: string;
- Type: string
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
majorVersion
Optional
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.
minMajorVersion
Optional
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
.
nextVersionCommand
Optional
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 like1.2.3
.$LATEST_TAG
: the most recent tag. Looks likeprefix-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 bex.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
.
npmDistTag
Optional
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.
postBuildSteps
Optional
public readonly postBuildSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
- Default: []
Steps to execute after build as part of the release workflow.
prerelease
Optional
public readonly prerelease: string;
- Type: string
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRun
Optional
public readonly publishDryRun: boolean;
- Type: boolean
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publishTasks
Optional
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.
releasableCommits
Optional
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.
releaseBranches
Optional
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.
releaseEveryCommit
Optional
releaseEveryCommit
- Deprecated: Use
releaseTrigger: ReleaseTrigger.continuous()
instead
public readonly releaseEveryCommit: boolean;
- Type: boolean
- Default: true
Automatically release new versions every commit to one of branches in releaseBranches
.
releaseFailureIssue
Optional
public readonly releaseFailureIssue: boolean;
- Type: boolean
- Default: false
Create a github issue on every failed publishing task.
releaseFailureIssueLabel
Optional
public readonly releaseFailureIssueLabel: string;
- Type: string
- Default: "failed-release"
The label to apply to issues indicating publish failures.
Only applies if releaseFailureIssue
is true.
releaseSchedule
Optional
releaseSchedule
- Deprecated: Use
releaseTrigger: ReleaseTrigger.scheduled()
instead
public readonly releaseSchedule: string;
- Type: string
- Default: no scheduled releases
CRON schedule to trigger new releases.
releaseTagPrefix
Optional
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.
releaseTrigger
Optional
public readonly releaseTrigger: ReleaseTrigger;
- Type: projen.release.ReleaseTrigger
- Default: Continuous releases (
ReleaseTrigger.continuous()
)
The release trigger to use.
releaseWorkflowName
Optional
public readonly releaseWorkflowName: string;
- Type: string
- Default: "release"
The name of the default release workflow.
releaseWorkflowSetupSteps
Optional
public readonly releaseWorkflowSetupSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
A set of workflow steps to execute in order to setup the workflow container.
versionrcOptions
Optional
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.
workflowContainerImage
Optional
public readonly workflowContainerImage: string;
- Type: string
- Default: default image
Container image to use for GitHub workflows.
workflowRunsOn
Optional
public readonly workflowRunsOn: string[];
- Type: string[]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflowRunsOnGroup
Optional
public readonly workflowRunsOnGroup: GroupRunnerOptions;
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
defaultReleaseBranch
Required
public readonly defaultReleaseBranch: string;
- Type: string
- Default: "main"
The name of the main release branch.
artifactsDirectory
Optional
public readonly artifactsDirectory: string;
- Type: string
- Default: "dist"
A directory which will contain build artifacts.
autoApproveUpgrades
Optional
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.
buildWorkflow
Optional
public readonly buildWorkflow: boolean;
- Type: boolean
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
buildWorkflowOptions
Optional
public readonly buildWorkflowOptions: BuildWorkflowOptions;
- Type: projen.javascript.BuildWorkflowOptions
Options for PR build workflow.
buildWorkflowTriggers
Optional
buildWorkflowTriggers
- Deprecated: - Use
buildWorkflowOptions.workflowTriggers
public readonly buildWorkflowTriggers: Triggers;
- Type: projen.github.workflows.Triggers
- Default: "{ pullRequest: {}, workflowDispatch: {} }"
Build workflow triggers.
bundlerOptions
Optional
public readonly bundlerOptions: BundlerOptions;
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
checkLicenses
Optional
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.
codeCov
Optional
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
.
codeCovTokenSecret
Optional
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.
copyrightOwner
Optional
public readonly copyrightOwner: string;
- Type: string
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyrightPeriod
Optional
public readonly copyrightPeriod: string;
- Type: string
- Default: current year
The copyright years to put in the LICENSE file.
dependabot
Optional
public readonly dependabot: boolean;
- Type: boolean
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabotOptions
Optional
public readonly dependabotOptions: DependabotOptions;
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
depsUpgrade
Optional
public readonly depsUpgrade: boolean;
- Type: boolean
- Default: true
Use tasks and github workflows to handle dependency upgrades.
Cannot be used in conjunction with dependabot
.
depsUpgradeOptions
Optional
public readonly depsUpgradeOptions: UpgradeDependenciesOptions;
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
gitignore
Optional
public readonly gitignore: string[];
- Type: string[]
Additional entries to .gitignore.
jest
Optional
public readonly jest: boolean;
- Type: boolean
- Default: true
Setup jest unit tests.
jestOptions
Optional
public readonly jestOptions: JestOptions;
- Type: projen.javascript.JestOptions
- Default: default options
Jest options.
mutableBuild
Optional
mutableBuild
- Deprecated: - Use
buildWorkflowOptions.mutableBuild
public readonly mutableBuild: boolean;
- 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.
npmignore
Optional
npmignore
- Deprecated: - use
project.addPackageIgnore
public readonly npmignore: string[];
- Type: string[]
Additional entries to .npmignore.
npmignoreEnabled
Optional
public readonly npmignoreEnabled: boolean;
- Type: boolean
- Default: true
Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions
Optional
public readonly npmIgnoreOptions: IgnoreFileOptions;
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
package
Optional
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
).
prettier
Optional
public readonly prettier: boolean;
- Type: boolean
- Default: false
Setup prettier.
prettierOptions
Optional
public readonly prettierOptions: PrettierOptions;
- Type: projen.javascript.PrettierOptions
- Default: default options
Prettier options.
projenDevDependency
Optional
public readonly projenDevDependency: boolean;
- Type: boolean
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrcJs
Optional
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.
projenrcJsOptions
Optional
public readonly projenrcJsOptions: ProjenrcOptions;
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projenVersion
Optional
public readonly projenVersion: string;
- Type: string
- Default: Defaults to the latest version.
Version of projen to install.
pullRequestTemplate
Optional
public readonly pullRequestTemplate: boolean;
- Type: boolean
- Default: true
Include a GitHub pull request template.
pullRequestTemplateContents
Optional
public readonly pullRequestTemplateContents: string[];
- Type: string[]
- Default: default content
The contents of the pull request template.
release
Optional
public readonly release: boolean;
- Type: boolean
- Default: true (false for subprojects)
Add release management to this project.
releaseToNpm
Optional
public readonly releaseToNpm: boolean;
- Type: boolean
- Default: false
Automatically release to npm when new versions are introduced.
releaseWorkflow
Optional
releaseWorkflow
- Deprecated: see
release
.
public readonly releaseWorkflow: boolean;
- Type: boolean
- Default: true if not a subproject
DEPRECATED: renamed to release
.
workflowBootstrapSteps
Optional
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.
workflowGitIdentity
Optional
public readonly workflowGitIdentity: GitIdentity;
- Type: projen.github.GitIdentity
- Default: GitHub Actions
The git identity to use in workflows.
workflowNodeVersion
Optional
public readonly workflowNodeVersion: string;
- Type: string
- Default:
minNodeVersion
if set, otherwiselts/*
.
The node version used in GitHub Actions workflows.
Always use this option if your GitHub Actions workflows require a specific to run.
workflowPackageCache
Optional
public readonly workflowPackageCache: boolean;
- Type: boolean
- Default: false
Enable Node.js package cache in GitHub workflows.
disableTsconfig
Optional
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).
disableTsconfigDev
Optional
public readonly disableTsconfigDev: boolean;
- Type: boolean
- Default: false
Do not generate a tsconfig.dev.json
file.
docgen
Optional
public readonly docgen: boolean;
- Type: boolean
- Default: false
Docgen by Typedoc.
docsDirectory
Optional
public readonly docsDirectory: string;
- Type: string
- Default: "docs"
Docs directory.
entrypointTypes
Optional
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.
eslint
Optional
public readonly eslint: boolean;
- Type: boolean
- Default: true
Setup eslint.
eslintOptions
Optional
public readonly eslintOptions: EslintOptions;
- Type: projen.javascript.EslintOptions
- Default: opinionated default options
Eslint options.
libdir
Optional
public readonly libdir: string;
- Type: string
- Default: "lib"
Typescript artifacts output directory.
projenrcTs
Optional
public readonly projenrcTs: boolean;
- Type: boolean
- Default: false
Use TypeScript for your projenrc file (.projenrc.ts
).
projenrcTsOptions
Optional
public readonly projenrcTsOptions: ProjenrcOptions;
- Type: projen.typescript.ProjenrcOptions
Options for .projenrc.ts.
sampleCode
Optional
public readonly sampleCode: boolean;
- Type: boolean
- Default: true
Generate one-time sample in src/
and test/
if there are no files there.
srcdir
Optional
public readonly srcdir: string;
- Type: string
- Default: "src"
Typescript sources directory.
testdir
Optional
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.
tsconfig
Optional
public readonly tsconfig: TypescriptConfigOptions;
- Type: projen.javascript.TypescriptConfigOptions
- Default: default options
Custom TSConfig.
tsconfigDev
Optional
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).
tsconfigDevFile
Optional
public readonly tsconfigDevFile: string;
- Type: string
- Default: "tsconfig.dev.json"
The name of the development tsconfig.json file.
tsJestOptions
Optional
public readonly tsJestOptions: TsJestOptions;
- Type: projen.typescript.TsJestOptions
Options for ts-jest.
typescriptVersion
Optional
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
).
author
Required
public readonly author: string;
- Type: string
- Default: $GIT_USER_NAME
The name of the library author.
authorAddress
Required
public readonly authorAddress: string;
- Type: string
- Default: $GIT_USER_EMAIL
Email or URL of the library author.
repositoryUrl
Required
public readonly repositoryUrl: string;
- Type: string
- Default: $GIT_REMOTE
Git repository URL.
compat
Optional
public readonly compat: boolean;
- Type: boolean
- Default: false
Automatically run API compatibility test against the latest version published to npm after compilation.
You can manually run compatibility tests using yarn compat
if this feature is disabled.
- You can ignore compatibility failures by adding lines to a ".compatignore" file.
compatIgnore
Optional
public readonly compatIgnore: string;
- Type: string
- Default: ".compatignore"
Name of the ignore file for API compatibility tests.
compressAssembly
Optional
public readonly compressAssembly: boolean;
- Type: boolean
- Default: false
Emit a compressed version of the assembly.
docgenFilePath
Optional
public readonly docgenFilePath: string;
- Type: string
- Default: "API.md"
File path for generated docs.
dotnet
Optional
dotnet
- Deprecated: use
publishToNuget
public readonly dotnet: JsiiDotNetTarget;
- Type: projen.cdk.JsiiDotNetTarget
excludeTypescript
Optional
public readonly excludeTypescript: string[];
- Type: string[]
Accepts a list of glob patterns.
Files matching any of those patterns will be excluded from the TypeScript compiler input.
By default, jsii will include all *.ts files (except .d.ts files) in the TypeScript compiler input. This can be problematic for example when the package's build or test procedure generates .ts files that cannot be compiled with jsii's compiler settings.
jsiiVersion
Optional
public readonly jsiiVersion: string;
- Type: string
- Default: "~5.6.0"
Version of the jsii compiler to use.
Set to "*" if you want to manually manage the version of jsii in your
project by managing updates to package.json
on your own.
NOTE: The jsii compiler releases since 5.0.0 are not semantically versioned
and should remain on the same minor, so we recommend using a ~
dependency
(e.g. ~5.0.0
).
publishToGo
Optional
public readonly publishToGo: JsiiGoTarget;
- Type: projen.cdk.JsiiGoTarget
- Default: no publishing
Publish Go bindings to a git repository.
publishToMaven
Optional
public readonly publishToMaven: JsiiJavaTarget;
- Type: projen.cdk.JsiiJavaTarget
- Default: no publishing
Publish to maven.
publishToNuget
Optional
public readonly publishToNuget: JsiiDotNetTarget;
- Type: projen.cdk.JsiiDotNetTarget
- Default: no publishing
Publish to NuGet.
publishToPypi
Optional
public readonly publishToPypi: JsiiPythonTarget;
- Type: projen.cdk.JsiiPythonTarget
- Default: no publishing
Publish to pypi.
python
Optional
python
- Deprecated: use
publishToPyPi
public readonly python: JsiiPythonTarget;
- Type: projen.cdk.JsiiPythonTarget
rootdir
Optional
public readonly rootdir: string;
- Type: string
- Default: "."
catalog
Optional
public readonly catalog: Catalog;
- Type: projen.cdk.Catalog
- Default: new version will be announced
Libraries will be picked up by the construct catalog when they are published to npm as jsii modules and will be published under:.
https://awscdk.io/packages/[@SCOPE/]PACKAGE@VERSION
The catalog will also post a tweet to https://twitter.com/awscdkio with the
package name, description and the above link. You can disable these tweets
through { announce: false }
.
You can also add a Twitter handle through { twitter: 'xx' }
which will be
mentioned in the tweet.
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
- Default: "2.1.0"
Minimum version of the AWS CDK to depend on.
cdkAssert
Optional
cdkAssert
- Deprecated: The
public readonly cdkAssert: boolean;
- Type: boolean
- Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0
Warning: NodeJS only.
Install the
cdkAssertions
Optional
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'
cdkCliVersion
Optional
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.
cdkDependencies
Optional
cdkDependencies
- Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
- Type: string[]
Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
Optional
cdkDependenciesAsDeps
- Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
- Type: boolean
- Default: true
If this is enabled (default), all modules declared in cdkDependencies
will be also added as normal dependencies
(as well as peerDependencies
).
This is to ensure that downstream consumers actually have your CDK dependencies installed
when using npm < 7 or yarn, where peer dependencies are not automatically installed.
If this is disabled, cdkDependencies
will be added to devDependencies
to ensure
they are present during development.
Note: this setting only applies to construct library projects
cdkTestDependencies
Optional
cdkTestDependencies
- Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
- Type: string[]
AWS CDK modules required for testing.
cdkVersionPinning
Optional
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.
constructsVersion
Optional
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.
edgeLambdaAutoDiscover
Optional
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.
experimentalIntegRunner
Optional
public readonly experimentalIntegRunner: boolean;
- Type: boolean
- Default: false
Enable experimental support for the AWS CDK integ-runner.
integrationTestAutoDiscover
Optional
public readonly integrationTestAutoDiscover: boolean;
- Type: boolean
- Default: true
Automatically discovers and creates integration tests for each .integ.ts
file under your test directory.
lambdaAutoDiscover
Optional
public readonly lambdaAutoDiscover: boolean;
- Type: boolean
- Default: true
Automatically adds an aws_lambda.Function
for each .lambda.ts
handler in your source tree. If this is disabled, you either need to explicitly call aws_lambda.Function.autoDiscover()
or define a new aws_lambda.Function()
for each handler.
lambdaExtensionAutoDiscover
Optional
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.
lambdaOptions
Optional
public readonly lambdaOptions: LambdaFunctionCommonOptions;
- Type: LambdaFunctionCommonOptions
- Default: default options
Common options for all AWS Lambda functions.
AwsCdkDepsCommonOptions
Options for AwsCdkDeps
.
Initializer
import { awscdk } from 'projen'
const awsCdkDepsCommonOptions: awscdk.AwsCdkDepsCommonOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | Minimum version of the AWS CDK to depend on. |
| boolean | Warning: NodeJS only. |
| boolean | Install the assertions library? |
| string | Version range of the AWS CDK CLI to depend on. |
| string[] | Which AWS CDKv1 modules this project requires. |
| boolean | If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies ). |
| string[] | AWS CDK modules required for testing. |
| boolean | Use pinned version instead of caret version for CDK. |
| string | Minimum version of the constructs library to depend on. |
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
- Default: "2.1.0"
Minimum version of the AWS CDK to depend on.
cdkAssert
Optional
cdkAssert
- Deprecated: The
public readonly cdkAssert: boolean;
- Type: boolean
- Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0
Warning: NodeJS only.
Install the
cdkAssertions
Optional
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'
cdkCliVersion
Optional
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.
cdkDependencies
Optional
cdkDependencies
- Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
- Type: string[]
Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
Optional
cdkDependenciesAsDeps
- Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
- Type: boolean
- Default: true
If this is enabled (default), all modules declared in cdkDependencies
will be also added as normal dependencies
(as well as peerDependencies
).
This is to ensure that downstream consumers actually have your CDK dependencies installed
when using npm < 7 or yarn, where peer dependencies are not automatically installed.
If this is disabled, cdkDependencies
will be added to devDependencies
to ensure
they are present during development.
Note: this setting only applies to construct library projects
cdkTestDependencies
Optional
cdkTestDependencies
- Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
- Type: string[]
AWS CDK modules required for testing.
cdkVersionPinning
Optional
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.
constructsVersion
Optional
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.
AwsCdkDepsOptions
Initializer
import { awscdk } from 'projen'
const awsCdkDepsOptions: awscdk.AwsCdkDepsOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | Minimum version of the AWS CDK to depend on. |
| boolean | Warning: NodeJS only. |
| boolean | Install the assertions library? |
| string | Version range of the AWS CDK CLI to depend on. |
| string[] | Which AWS CDKv1 modules this project requires. |
| boolean | If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies ). |
| string[] | AWS CDK modules required for testing. |
| boolean | Use pinned version instead of caret version for CDK. |
| string | Minimum version of the constructs library to depend on. |
| projen.DependencyType | The type of dependency to use for runtime AWS CDK and constructs modules. |
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
- Default: "2.1.0"
Minimum version of the AWS CDK to depend on.
cdkAssert
Optional
cdkAssert
- Deprecated: The
public readonly cdkAssert: boolean;
- Type: boolean
- Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0
Warning: NodeJS only.
Install the
cdkAssertions
Optional
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'
cdkCliVersion
Optional
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.
cdkDependencies
Optional
cdkDependencies
- Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
- Type: string[]
Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
Optional
cdkDependenciesAsDeps
- Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
- Type: boolean
- Default: true
If this is enabled (default), all modules declared in cdkDependencies
will be also added as normal dependencies
(as well as peerDependencies
).
This is to ensure that downstream consumers actually have your CDK dependencies installed
when using npm < 7 or yarn, where peer dependencies are not automatically installed.
If this is disabled, cdkDependencies
will be added to devDependencies
to ensure
they are present during development.
Note: this setting only applies to construct library projects
cdkTestDependencies
Optional
cdkTestDependencies
- Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
- Type: string[]
AWS CDK modules required for testing.
cdkVersionPinning
Optional
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.
constructsVersion
Optional
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.
dependencyType
Required
public readonly dependencyType: DependencyType;
- Type: projen.DependencyType
The type of dependency to use for runtime AWS CDK and constructs
modules.
For libraries, use peer dependencies and for apps use runtime dependencies.
AwsCdkJavaAppOptions
Initializer
import { awscdk } from 'projen'
const awsCdkJavaAppOptions: awscdk.AwsCdkJavaAppOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | This is the name of your project. |
| boolean | Whether to commit the managed files by default. |
| projen.IgnoreFileOptions | Configuration options for .gitignore file. |
| projen.GitOptions | Configuration options for git. |
| projen.LoggerOptions | Configure logging options such as verbosity. |
| string | The root directory of the project. |
| projen.Project | The parent project, if this project is part of a bigger project. |
| string | The shell command to use in order to run the projen CLI. |
| boolean | Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation. |
| projen.ProjenrcJsonOptions | Options for .projenrc.json. |
| boolean | Use renovatebot to handle dependency upgrades. |
| projen.RenovatebotOptions | Options for renovatebot. |
| projen.github.AutoApproveOptions | Enable and configure the 'auto approve' workflow. |
| boolean | Enable automatic merging on GitHub. |
| projen.github.AutoMergeOptions | Configure options for automatic merging on GitHub. |
| boolean | Add a clobber task which resets the repo to origin. |
| boolean | Add a VSCode development environment (used for GitHub Codespaces). |
| boolean | Enable GitHub integration. |
| projen.github.GitHubOptions | Options for GitHub integration. |
| boolean | Add a Gitpod development environment. |
| boolean | Whether mergify should be enabled on this repository or not. |
| projen.github.MergifyOptions | Options for mergify. |
| projen.ProjectType | Which type of project this is (library/app). |
| projen.github.GithubCredentials | Choose a method of providing GitHub API access for projen workflows. |
| string | The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows. |
| projen.SampleReadmeProps | The README setup. |
| boolean | Auto-close of stale issues and pull request. |
| projen.github.StaleOptions | Auto-close stale issues and pull requests. |
| boolean | Enable VSCode integration. |
| string | The artifactId is generally the name that the project is known by. |
| string | This is generally unique amongst an organization or a project. |
| string | This is the last piece of the naming puzzle. |
| string | Description of a project is always good. |
| string | Project packaging format. |
| projen.java.ParentPom | A Parent Pom can be used to have a child project inherit properties/plugins/ect in order to reduce duplication and keep standards across a large amount of repos. |
| string | The URL, like the name, is not required. |
| projen.java.MavenCompileOptions | Compile options. |
| string[] | List of runtime dependencies for this project. |
| string | Final artifact output directory. |
| boolean | Include junit tests. |
| projen.java.JunitOptions | junit options. |
| projen.java.MavenPackagingOptions | Packaging options. |
| boolean | Use projenrc in java. |
| projen.java.ProjenrcOptions | Options related to projenrc in java. |
| string[] | List of test dependencies for this project. |
| boolean | Include sample code and test if the relevant directories don't exist. |
| string | The java package to use for the code sample. |
| string | A command to execute before synthesis. |
| string | cdk.out directory. |
| {[ key: string ]: any} | Additional context to include in cdk.json . |
| boolean | Include all feature flags in cdk.json. |
|
| 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. |
| string[] | Glob patterns to exclude from cdk watch . |
| string[] | Glob patterns to include in cdk watch . |
| string | Minimum version of the AWS CDK to depend on. |
| boolean | Warning: NodeJS only. |
| boolean | Install the assertions library? |
| string | Version range of the AWS CDK CLI to depend on. |
| string[] | Which AWS CDKv1 modules this project requires. |
| boolean | If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies ). |
| string[] | AWS CDK modules required for testing. |
| boolean | Use pinned version instead of caret version for CDK. |
| string | Minimum version of the constructs library to depend on. |
| string | The name of the Java class with the static main() method. |
name
Required
public readonly name: string;
- Type: string
- Default: $BASEDIR
This is the name of your project.
commitGenerated
Optional
public readonly commitGenerated: boolean;
- Type: boolean
- Default: true
Whether to commit the managed files by default.
gitIgnoreOptions
Optional
public readonly gitIgnoreOptions: IgnoreFileOptions;
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
gitOptions
Optional
public readonly gitOptions: GitOptions;
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
public readonly logging: LoggerOptions;
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
public readonly parent: Project;
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projenCommand
Optional
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.
projenrcJson
Optional
public readonly projenrcJson: boolean;
- Type: boolean
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrcJsonOptions
Optional
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
public readonly renovatebot: boolean;
- Type: boolean
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebotOptions
Optional
public readonly renovatebotOptions: RenovatebotOptions;
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
autoApproveOptions
Optional
public readonly autoApproveOptions: AutoApproveOptions;
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
autoMerge
Optional
public readonly autoMerge: boolean;
- Type: boolean
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
autoMergeOptions
Optional
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.
clobber
Optional
public readonly clobber: boolean;
- Type: boolean
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
devContainer
Optional
public readonly devContainer: boolean;
- Type: boolean
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
github
Optional
public readonly github: boolean;
- Type: boolean
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
githubOptions
Optional
public readonly githubOptions: GitHubOptions;
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitpod
Optional
public readonly gitpod: boolean;
- Type: boolean
- Default: false
Add a Gitpod development environment.
mergify
Optional
mergify
- Deprecated: use
githubOptions.mergify
instead
public readonly mergify: boolean;
- Type: boolean
- Default: true
Whether mergify should be enabled on this repository or not.
mergifyOptions
Optional
mergifyOptions
- Deprecated: use
githubOptions.mergifyOptions
instead
public readonly mergifyOptions: MergifyOptions;
- Type: projen.github.MergifyOptions
- Default: default options
Options for mergify.
projectType
Optional
projectType
- Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
- Type: projen.ProjectType
- Default: ProjectType.UNKNOWN
Which type of project this is (library/app).
projenCredentials
Optional
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.
projenTokenSecret
Optional
projenTokenSecret
- Deprecated: use
projenCredentials
public readonly projenTokenSecret: string;
- Type: string
- Default: "PROJEN_GITHUB_TOKEN"
The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
This token needs to have the repo
, workflows
and packages
scope.
readme
Optional
public readonly readme: SampleReadmeProps;
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
Example
"{ filename: 'readme.md', contents: '# title' }"
stale
Optional
public readonly stale: boolean;
- Type: boolean
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
staleOptions
Optional
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
.
vscode
Optional
public readonly vscode: boolean;
- Type: boolean
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
artifactId
Required
public readonly artifactId: string;
- Type: string
- Default: "my-app"
The artifactId is generally the name that the project is known by.
Although the groupId is important, people within the group will rarely mention the groupId in discussion (they are often all be the same ID, such as the MojoHaus project groupId: org.codehaus.mojo). It, along with the groupId, creates a key that separates this project from every other project in the world (at least, it should :) ). Along with the groupId, the artifactId fully defines the artifact's living quarters within the repository. In the case of the above project, my-project lives in $M2_REPO/org/codehaus/mojo/my-project.
groupId
Required
public readonly groupId: string;
- Type: string
- Default: "org.acme"
This is generally unique amongst an organization or a project.
For example, all core Maven artifacts do (well, should) live under the groupId org.apache.maven. Group ID's do not necessarily use the dot notation, for example, the junit project. Note that the dot-notated groupId does not have to correspond to the package structure that the project contains. It is, however, a good practice to follow. When stored within a repository, the group acts much like the Java packaging structure does in an operating system. The dots are replaced by OS specific directory separators (such as '/' in Unix) which becomes a relative directory structure from the base repository. In the example given, the org.codehaus.mojo group lives within the directory $M2_REPO/org/codehaus/mojo.
version
Required
public readonly version: string;
- Type: string
- Default: "0.1.0"
This is the last piece of the naming puzzle.
groupId:artifactId denotes a single project but they cannot delineate which incarnation of that project we are talking about. Do we want the junit:junit of 2018 (version 4.12), or of 2007 (version 3.8.2)? In short: code changes, those changes should be versioned, and this element keeps those versions in line. It is also used within an artifact's repository to separate versions from each other. my-project version 1.0 files live in the directory structure $M2_REPO/org/codehaus/mojo/my-project/1.0.
description
Optional
public readonly description: string;
- Type: string
- Default: undefined
Description of a project is always good.
Although this should not replace formal documentation, a quick comment to any readers of the POM is always helpful.
packaging
Optional
public readonly packaging: string;
- Type: string
- Default: "jar"
Project packaging format.
parentPom
Optional
public readonly parentPom: ParentPom;
- Type: projen.java.ParentPom
- Default: undefined
A Parent Pom can be used to have a child project inherit properties/plugins/ect in order to reduce duplication and keep standards across a large amount of repos.
url
Optional
public readonly url: string;
- Type: string
- Default: undefined
The URL, like the name, is not required.
This is a nice gesture for projects users, however, so that they know where the project lives.
compileOptions
Optional
public readonly compileOptions: MavenCompileOptions;
- Type: projen.java.MavenCompileOptions
- Default: defaults
Compile options.
deps
Optional
public readonly deps: string[];
- Type: string[]
- Default: []
List of runtime dependencies for this project.
Dependencies use the format: <groupId>/<artifactId>@<semver>
Additional dependencies can be added via project.addDependency()
.
distdir
Optional
public readonly distdir: string;
- Type: string
- Default: "dist/java"
Final artifact output directory.
junit
Optional
public readonly junit: boolean;
- Type: boolean
- Default: true
Include junit tests.
junitOptions
Optional
public readonly junitOptions: JunitOptions;
- Type: projen.java.JunitOptions
- Default: defaults
junit options.
packagingOptions
Optional
public readonly packagingOptions: MavenPackagingOptions;
- Type: projen.java.MavenPackagingOptions
- Default: defaults
Packaging options.
projenrcJava
Optional
public readonly projenrcJava: boolean;
- Type: boolean
- Default: true
Use projenrc in java.
This will install projen
as a java dependency and will add a synth
task which
will compile & execute main()
from src/main/java/projenrc.java
.
projenrcJavaOptions
Optional
public readonly projenrcJavaOptions: ProjenrcOptions;
- Type: projen.java.ProjenrcOptions
- Default: default options
Options related to projenrc in java.
testDeps
Optional
public readonly testDeps: string[];
- Type: string[]
- Default: []
List of test dependencies for this project.
Dependencies use the format: <groupId>/<artifactId>@<semver>
Additional dependencies can be added via project.addTestDependency()
.
sample
Optional
public readonly sample: boolean;
- Type: boolean
- Default: true
Include sample code and test if the relevant directories don't exist.
sampleJavaPackage
Optional
public readonly sampleJavaPackage: string;
- Type: string
- Default: "org.acme"
The java package to use for the code sample.
buildCommand
Optional
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.
cdkout
Optional
public readonly cdkout: string;
- Type: string
- Default: "cdk.out"
cdk.out directory.
context
Optional
public readonly context: {[ key: string ]: any};
- Type: {[ key: string ]: any}
- Default: no additional context
Additional context to include in cdk.json
.
featureFlags
Optional
public readonly featureFlags: boolean;
- Type: boolean
- Default: true
Include all feature flags in cdk.json.
requireApproval
Optional
public readonly requireApproval: ApprovalLevel;
- Type: 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.
watchExcludes
Optional
public readonly watchExcludes: string[];
- Type: string[]
- Default: []
Glob patterns to exclude from cdk watch
.
watchIncludes
Optional
public readonly watchIncludes: string[];
- Type: string[]
- Default: []
Glob patterns to include in cdk watch
.
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
- Default: "2.1.0"
Minimum version of the AWS CDK to depend on.
cdkAssert
Optional
cdkAssert
- Deprecated: The
public readonly cdkAssert: boolean;
- Type: boolean
- Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0
Warning: NodeJS only.
Install the
cdkAssertions
Optional
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'
cdkCliVersion
Optional
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.
cdkDependencies
Optional
cdkDependencies
- Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
- Type: string[]
Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
Optional
cdkDependenciesAsDeps
- Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
- Type: boolean
- Default: true
If this is enabled (default), all modules declared in cdkDependencies
will be also added as normal dependencies
(as well as peerDependencies
).
This is to ensure that downstream consumers actually have your CDK dependencies installed
when using npm < 7 or yarn, where peer dependencies are not automatically installed.
If this is disabled, cdkDependencies
will be added to devDependencies
to ensure
they are present during development.
Note: this setting only applies to construct library projects
cdkTestDependencies
Optional
cdkTestDependencies
- Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
- Type: string[]
AWS CDK modules required for testing.
cdkVersionPinning
Optional
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.
constructsVersion
Optional
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.
mainClass
Required
public readonly mainClass: string;
- Type: string
- Default: "org.acme.MyApp"
The name of the Java class with the static main()
method.
This method
should call app.synth()
on the CDK app.
AwsCdkPackageNames
Language-specific AWS CDK package names.
Initializer
import { awscdk } from 'projen'
const awsCdkPackageNames: awscdk.AwsCdkPackageNames = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | Fully qualified name of the assertions library package. |
| string | Fully qualified name of the constructs library package. |
| string | Fully qualified name of the core framework package for CDKv1. |
| string | Fully qualified name of the core framework package for CDKv2. |
| string | Fully qualified name of the assert library package Can be empty as it's only really available for javascript projects. |
assertions
Required
public readonly assertions: string;
- Type: string
Fully qualified name of the assertions library package.
constructs
Required
public readonly constructs: string;
- Type: string
Fully qualified name of the constructs library package.
coreV1
Required
public readonly coreV1: string;
- Type: string
Fully qualified name of the core framework package for CDKv1.
coreV2
Required
public readonly coreV2: string;
- Type: string
Fully qualified name of the core framework package for CDKv2.
assert
Optional
public readonly assert: string;
- Type: string
Fully qualified name of the assert library package Can be empty as it's only really available for javascript projects.
AwsCdkPythonAppOptions
Options for AwsCdkPythonApp
.
Initializer
import { awscdk } from 'projen'
const awsCdkPythonAppOptions: awscdk.AwsCdkPythonAppOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | This is the name of your project. |
| boolean | Whether to commit the managed files by default. |
| projen.IgnoreFileOptions | Configuration options for .gitignore file. |
| projen.GitOptions | Configuration options for git. |
| projen.LoggerOptions | Configure logging options such as verbosity. |
| string | The root directory of the project. |
| projen.Project | The parent project, if this project is part of a bigger project. |
| string | The shell command to use in order to run the projen CLI. |
| boolean | Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation. |
| projen.ProjenrcJsonOptions | Options for .projenrc.json. |
| boolean | Use renovatebot to handle dependency upgrades. |
| projen.RenovatebotOptions | Options for renovatebot. |
| projen.github.AutoApproveOptions | Enable and configure the 'auto approve' workflow. |
| boolean | Enable automatic merging on GitHub. |
| projen.github.AutoMergeOptions | Configure options for automatic merging on GitHub. |
| boolean | Add a clobber task which resets the repo to origin. |
| boolean | Add a VSCode development environment (used for GitHub Codespaces). |
| boolean | Enable GitHub integration. |
| projen.github.GitHubOptions | Options for GitHub integration. |
| boolean | Add a Gitpod development environment. |
| boolean | Whether mergify should be enabled on this repository or not. |
| projen.github.MergifyOptions | Options for mergify. |
| projen.ProjectType | Which type of project this is (library/app). |
| projen.github.GithubCredentials | Choose a method of providing GitHub API access for projen workflows. |
| string | The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows. |
| projen.SampleReadmeProps | The README setup. |
| boolean | Auto-close of stale issues and pull request. |
| projen.github.StaleOptions | Auto-close stale issues and pull requests. |
| boolean | Enable VSCode integration. |
| string | Author's e-mail. |
| string | Author's name. |
| string | Version of the package. |
| string[] | A list of PyPI trove classifiers that describe the project. |
| string | A short description of the package. |
| string | A URL to the website of the project. |
| string | License of this package as an SPDX identifier. |
| string | Package name. |
| projen.python.PoetryPyprojectOptionsWithoutDeps | Additional options to set for poetry if using poetry. |
| {[ key: string ]: any} | Additional fields to pass in the setup() function if using setuptools. |
| string | Path to the python executable to use. |
| string | Name of the python package as used in imports and filenames. |
| string[] | List of runtime dependencies for this project. |
| string[] | List of dev dependencies for this project. |
| boolean | Use pip with a requirements.txt file to track project dependencies. |
| boolean | Use poetry to manage your project dependencies, virtual environment, and (optional) packaging/publishing. |
| boolean | Use projenrc in javascript. |
| projen.javascript.ProjenrcOptions | Options related to projenrc in JavaScript. |
| boolean | Use projenrc in Python. |
| projen.python.ProjenrcOptions | Options related to projenrc in python. |
| boolean | Use projenrc in TypeScript. |
| projen.typescript.ProjenrcTsOptions | Options related to projenrc in TypeScript. |
| boolean | Include pytest tests. |
| projen.python.PytestOptions | pytest options. |
| boolean | Include sample code and test if the relevant directories don't exist. |
| string | Location of sample tests. |
| boolean | Use setuptools with a setup.py script for packaging and publishing. |
| boolean | Use venv to manage a virtual environment for installing dependencies inside. |
| projen.python.VenvOptions | Venv options. |
| string | A command to execute before synthesis. |
| string | cdk.out directory. |
| {[ key: string ]: any} | Additional context to include in cdk.json . |
| boolean | Include all feature flags in cdk.json. |
|
| 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. |
| string[] | Glob patterns to exclude from cdk watch . |
| string[] | Glob patterns to include in cdk watch . |
| string | Minimum version of the AWS CDK to depend on. |
| boolean | Warning: NodeJS only. |
| boolean | Install the assertions library? |
| string | Version range of the AWS CDK CLI to depend on. |
| string[] | Which AWS CDKv1 modules this project requires. |
| boolean | If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies ). |
| string[] | AWS CDK modules required for testing. |
| boolean | Use pinned version instead of caret version for CDK. |
| string | Minimum version of the constructs library to depend on. |
| string | The CDK app's entrypoint (relative to the source directory, which is "src" by default). |
| string | Python sources directory. |
name
Required
public readonly name: string;
- Type: string
- Default: $BASEDIR
This is the name of your project.
commitGenerated
Optional
public readonly commitGenerated: boolean;
- Type: boolean
- Default: true
Whether to commit the managed files by default.
gitIgnoreOptions
Optional
public readonly gitIgnoreOptions: IgnoreFileOptions;
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
gitOptions
Optional
public readonly gitOptions: GitOptions;
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
public readonly logging: LoggerOptions;
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
public readonly parent: Project;
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projenCommand
Optional
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.
projenrcJson
Optional
public readonly projenrcJson: boolean;
- Type: boolean
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrcJsonOptions
Optional
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
public readonly renovatebot: boolean;
- Type: boolean
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebotOptions
Optional
public readonly renovatebotOptions: RenovatebotOptions;
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
autoApproveOptions
Optional
public readonly autoApproveOptions: AutoApproveOptions;
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
autoMerge
Optional
public readonly autoMerge: boolean;
- Type: boolean
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
autoMergeOptions
Optional
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.
clobber
Optional
public readonly clobber: boolean;
- Type: boolean
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
devContainer
Optional
public readonly devContainer: boolean;
- Type: boolean
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
github
Optional
public readonly github: boolean;
- Type: boolean
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
githubOptions
Optional
public readonly githubOptions: GitHubOptions;
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitpod
Optional
public readonly gitpod: boolean;
- Type: boolean
- Default: false
Add a Gitpod development environment.
mergify
Optional
mergify
- Deprecated: use
githubOptions.mergify
instead
public readonly mergify: boolean;
- Type: boolean
- Default: true
Whether mergify should be enabled on this repository or not.
mergifyOptions
Optional
mergifyOptions
- Deprecated: use
githubOptions.mergifyOptions
instead
public readonly mergifyOptions: MergifyOptions;
- Type: projen.github.MergifyOptions
- Default: default options
Options for mergify.
projectType
Optional
projectType
- Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
- Type: projen.ProjectType
- Default: ProjectType.UNKNOWN
Which type of project this is (library/app).
projenCredentials
Optional
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.
projenTokenSecret
Optional
projenTokenSecret
- Deprecated: use
projenCredentials
public readonly projenTokenSecret: string;
- Type: string
- Default: "PROJEN_GITHUB_TOKEN"
The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
This token needs to have the repo
, workflows
and packages
scope.
readme
Optional
public readonly readme: SampleReadmeProps;
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
Example
"{ filename: 'readme.md', contents: '# title' }"
stale
Optional
public readonly stale: boolean;
- Type: boolean
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
staleOptions
Optional
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
.
vscode
Optional
public readonly vscode: boolean;
- Type: boolean
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
authorEmail
Required
public readonly authorEmail: string;
- Type: string
- Default: $GIT_USER_EMAIL
Author's e-mail.
authorName
Required
public readonly authorName: string;
- Type: string
- Default: $GIT_USER_NAME
Author's name.
version
Required
public readonly version: string;
- Type: string
- Default: "0.1.0"
Version of the package.
classifiers
Optional
public readonly classifiers: string[];
- Type: string[]
A list of PyPI trove classifiers that describe the project.
description
Optional
public readonly description: string;
- Type: string
A short description of the package.
homepage
Optional
public readonly homepage: string;
- Type: string
A URL to the website of the project.
license
Optional
public readonly license: string;
- Type: string
License of this package as an SPDX identifier.
packageName
Optional
public readonly packageName: string;
- Type: string
Package name.
poetryOptions
Optional
public readonly poetryOptions: PoetryPyprojectOptionsWithoutDeps;
- Type: projen.python.PoetryPyprojectOptionsWithoutDeps
Additional options to set for poetry if using poetry.
setupConfig
Optional
public readonly setupConfig: {[ key: string ]: any};
- Type: {[ key: string ]: any}
Additional fields to pass in the setup() function if using setuptools.
pythonExec
Optional
public readonly pythonExec: string;
- Type: string
- Default: "python"
Path to the python executable to use.
moduleName
Required
public readonly moduleName: string;
- Type: string
- Default: $PYTHON_MODULE_NAME
Name of the python package as used in imports and filenames.
Must only consist of alphanumeric characters and underscores.
deps
Optional
public readonly deps: string[];
- Type: string[]
- Default: []
List of runtime dependencies for this project.
Dependencies use the format: <module>@<semver>
Additional dependencies can be added via project.addDependency()
.
devDeps
Optional
public readonly devDeps: string[];
- Type: string[]
- Default: []
List of dev dependencies for this project.
Dependencies use the format: <module>@<semver>
Additional dependencies can be added via project.addDevDependency()
.
pip
Optional
public readonly pip: boolean;
- Type: boolean
- Default: true, unless poetry is true, then false
Use pip with a requirements.txt file to track project dependencies.
poetry
Optional
public readonly poetry: boolean;
- Type: boolean
- Default: false
Use poetry to manage your project dependencies, virtual environment, and (optional) packaging/publishing.
This feature is incompatible with pip, setuptools, or venv.
If you set this option to true
, then pip, setuptools, and venv must be set to false
.
projenrcJs
Optional
public readonly projenrcJs: boolean;
- Type: boolean
- Default: false
Use projenrc in javascript.
This will install projen
as a JavaScript dependency and add a synth
task which will run .projenrc.js
.
projenrcJsOptions
Optional
public readonly projenrcJsOptions: ProjenrcOptions;
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options related to projenrc in JavaScript.
projenrcPython
Optional
public readonly projenrcPython: boolean;
- Type: boolean
- Default: true
Use projenrc in Python.
This will install projen
as a Python dependency and add a synth
task which will run .projenrc.py
.
projenrcPythonOptions
Optional
public readonly projenrcPythonOptions: ProjenrcOptions;
- Type: projen.python.ProjenrcOptions
- Default: default options
Options related to projenrc in python.
projenrcTs
Optional
public readonly projenrcTs: boolean;
- Type: boolean
- Default: false
Use projenrc in TypeScript.
This will create a tsconfig file (default: tsconfig.projen.json
)
and use ts-node
in the default task to parse the project source files.
projenrcTsOptions
Optional
public readonly projenrcTsOptions: ProjenrcTsOptions;
- Type: projen.typescript.ProjenrcTsOptions
- Default: default options
Options related to projenrc in TypeScript.
pytest
Optional
public readonly pytest: boolean;
- Type: boolean
- Default: true
Include pytest tests.
pytestOptions
Optional
public readonly pytestOptions: PytestOptions;
- Type: projen.python.PytestOptions
- Default: defaults
pytest options.
sample
Optional
public readonly sample: boolean;
- Type: boolean
- Default: true
Include sample code and test if the relevant directories don't exist.
sampleTestdir
Optional
public readonly sampleTestdir: string;
- Type: string
- Default: "tests"
Location of sample tests.
Typically the same directory where project tests will be located.
setuptools
Optional
public readonly setuptools: boolean;
- Type: boolean
- Default: true, unless poetry is true, then false
Use setuptools with a setup.py script for packaging and publishing.
venv
Optional
public readonly venv: boolean;
- Type: boolean
- Default: true, unless poetry is true, then false
Use venv to manage a virtual environment for installing dependencies inside.
venvOptions
Optional
public readonly venvOptions: VenvOptions;
- Type: projen.python.VenvOptions
- Default: defaults
Venv options.
buildCommand
Optional
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.
cdkout
Optional
public readonly cdkout: string;
- Type: string
- Default: "cdk.out"
cdk.out directory.
context
Optional
public readonly context: {[ key: string ]: any};
- Type: {[ key: string ]: any}
- Default: no additional context
Additional context to include in cdk.json
.
featureFlags
Optional
public readonly featureFlags: boolean;
- Type: boolean
- Default: true
Include all feature flags in cdk.json.
requireApproval
Optional
public readonly requireApproval: ApprovalLevel;
- Type: 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.
watchExcludes
Optional
public readonly watchExcludes: string[];
- Type: string[]
- Default: []
Glob patterns to exclude from cdk watch
.
watchIncludes
Optional
public readonly watchIncludes: string[];
- Type: string[]
- Default: []
Glob patterns to include in cdk watch
.
cdkVersion
Required
public readonly cdkVersion: string;
- Type: string
- Default: "2.1.0"
Minimum version of the AWS CDK to depend on.
cdkAssert
Optional
cdkAssert
- Deprecated: The
public readonly cdkAssert: boolean;
- Type: boolean
- Default: will be included by default for AWS CDK >= 1.0.0 < 2.0.0
Warning: NodeJS only.
Install the
cdkAssertions
Optional
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'
cdkCliVersion
Optional
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.
cdkDependencies
Optional
cdkDependencies
- Deprecated: For CDK 2.x use "deps" instead. (or "peerDeps" if you're building a library)
public readonly cdkDependencies: string[];
- Type: string[]
Which AWS CDKv1 modules this project requires.
cdkDependenciesAsDeps
Optional
cdkDependenciesAsDeps
- Deprecated: Not supported in CDK v2.
public readonly cdkDependenciesAsDeps: boolean;
- Type: boolean
- Default: true
If this is enabled (default), all modules declared in cdkDependencies
will be also added as normal dependencies
(as well as peerDependencies
).
This is to ensure that downstream consumers actually have your CDK dependencies installed
when using npm < 7 or yarn, where peer dependencies are not automatically installed.
If this is disabled, cdkDependencies
will be added to devDependencies
to ensure
they are present during development.
Note: this setting only applies to construct library projects
cdkTestDependencies
Optional
cdkTestDependencies
- Deprecated: For CDK 2.x use 'devDeps' (in node.js projects) or 'testDeps' (in java projects) instead
public readonly cdkTestDependencies: string[];
- Type: string[]
AWS CDK modules required for testing.
cdkVersionPinning
Optional
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.
constructsVersion
Optional
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.
appEntrypoint
Optional
public readonly appEntrypoint: string;
- Type: string
- Default: "app.py"
The CDK app's entrypoint (relative to the source directory, which is "src" by default).
testdir
Optional
testdir
- Deprecated: Use
sampleTestdir
instead.
public readonly testdir: string;
- Type: string
- Default: "tests"
Python sources directory.
AwsCdkTypeScriptAppOptions
Initializer
import { awscdk } from 'projen'
const awsCdkTypeScriptAppOptions: awscdk.AwsCdkTypeScriptAppOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | This is the name of your project. |
| boolean | Whether to commit the managed files by default. |
| projen.IgnoreFileOptions | Configuration options for .gitignore file. |
| projen.GitOptions | Configuration options for git. |
| projen.LoggerOptions | Configure logging options such as verbosity. |
| string | The root directory of the project. |
| projen.Project | The parent project, if this project is part of a bigger project. |
| string | The shell command to use in order to run the projen CLI. |
| boolean | Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation. |
| projen.ProjenrcJsonOptions | Options for .projenrc.json. |
| boolean | Use renovatebot to handle dependency upgrades. |
| projen.RenovatebotOptions | Options for renovatebot. |
| projen.github.AutoApproveOptions | Enable and configure the 'auto approve' workflow. |
| boolean | Enable automatic merging on GitHub. |
| projen.github.AutoMergeOptions | Configure options for automatic merging on GitHub. |
| boolean | Add a clobber task which resets the repo to origin. |
| boolean | Add a VSCode development environment (used for GitHub Codespaces). |
| boolean | Enable GitHub integration. |
| projen.github.GitHubOptions | Options for GitHub integration. |
| boolean | Add a Gitpod development environment. |
| boolean | Whether mergify should be enabled on this repository or not. |
| projen.github.MergifyOptions | Options for mergify. |
| projen.ProjectType | Which type of project this is (library/app). |
| projen.github.GithubCredentials | Choose a method of providing GitHub API access for projen workflows. |
| string | The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows. |
| projen.SampleReadmeProps | The README setup. |
| boolean | Auto-close of stale issues and pull request. |
| projen.github.StaleOptions | Auto-close stale issues and pull requests. |
| boolean | Enable VSCode integration. |
| boolean | Allow the project to include peerDependencies and bundledDependencies . |
| string | Author's e-mail. |
| string | Author's name. |
| boolean | Is the author an organization. |
| string | Author's URL / Website. |
| boolean | Automatically add all executables under the bin directory to your package.json file under the bin section. |
| {[ key: string ]: string} | Binary programs vended with your module. |
| string | The email address to which issues should be reported. |
| string | The url to your project's issue tracker. |
| string[] | List of dependencies to bundle into this module. |
| string | The version of Bun to use if using Bun as a package manager. |
| projen.javascript.CodeArtifactOptions | Options for npm packages using AWS CodeArtifact. |
| string[] | Runtime dependencies of this module. |
| string | The description is just a string that helps people understand the purpose of the package. |
| string[] | Build dependencies for this module. |
| string | Module entrypoint (main in package.json ). |
| string | Package's Homepage / Website. |
| string[] | Keywords to include in package.json . |
| string | License's SPDX identifier. |
| boolean | Indicates if a license should be added. |
| string | The maximum node version supported by this package. Most projects should not use this option. |
| string | The minimum node version required by this package to function. Most projects should not use this option. |
| projen.javascript.NpmAccess | Access level of the npm package. |
| boolean | Should provenance statements be generated when the package is published. |
| string | The host name of the npm registry to publish to. |
| string | The base URL of the npm package registry. |
| string | GitHub secret which contains the NPM token to use when publishing packages. |
| projen.javascript.NodePackageManager | The Node Package Manager used to execute scripts. |
| string | The "name" in package.json. |
| projen.javascript.PeerDependencyOptions | Options for peerDeps . |
| string[] | Peer dependencies for this module. |
| string | The version of PNPM to use if using PNPM as a package manager. |
| string | The repository is the location where the actual code for your package lives. |
| 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. |
| projen.javascript.ScopedPackagesOptions[] | Options for privately hosted scoped packages. |
| {[ key: string ]: string} | npm scripts to include. |
| string | Package's Stability. |
| projen.javascript.YarnBerryOptions | Options for Yarn Berry. |
| string | The commit-and-tag-version compatible package used to bump the package version, as a dependency string. |
| string | Version requirement of publib which is used to publish modules to npm. |
| number | Major version to release from the default branch. |
| number | Minimal Major version to release. |
| string | A shell command to control the next version to release. |
| string | The npmDistTag to use when publishing from the default branch. |
| projen.github.workflows.JobStep[] | Steps to execute after build as part of the release workflow. |
| string | Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre"). |
| boolean | Instead of actually publishing to package managers, just print the publishing command. |
| boolean | Define publishing tasks that can be executed manually as well as workflows. |
| projen.ReleasableCommits | Find commits that should be considered releasable Used to decide if a release is required. |
| {[ key: string ]: projen.release.BranchOptions} | Defines additional release branches. |
| boolean | Automatically release new versions every commit to one of branches in releaseBranches . |
| boolean | Create a github issue on every failed publishing task. |
| string | The label to apply to issues indicating publish failures. |
| string | CRON schedule to trigger new releases. |
| string | Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers. |
| projen.release.ReleaseTrigger | The release trigger to use. |
| string | The name of the default release workflow. |
| projen.github.workflows.JobStep[] | A set of workflow steps to execute in order to setup the workflow container. |
| {[ key: string ]: any} | Custom configuration used when creating changelog with commit-and-tag-version package. |
| string | Container image to use for GitHub workflows. |
| string[] | Github Runner selection labels. |
| projen.GroupRunnerOptions | Github Runner Group selection options. |
| string | The name of the main release branch. |
| string | A directory which will contain build artifacts. |
| boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued). |
| boolean | Define a GitHub workflow for building PRs. |
| projen.javascript.BuildWorkflowOptions | Options for PR build workflow. |
| projen.github.workflows.Triggers | Build workflow triggers. |
| projen.javascript.BundlerOptions | Options for Bundler . |
| projen.javascript.LicenseCheckerOptions | Configure which licenses should be deemed acceptable for use by dependencies. |
| 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 . |
| string | Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories. |
| string | License copyright owner. |
| string | The copyright years to put in the LICENSE file. |
| boolean | Use dependabot to handle dependency upgrades. |
| projen.github.DependabotOptions | Options for dependabot. |
| boolean | Use tasks and github workflows to handle dependency upgrades. |
| projen.javascript.UpgradeDependenciesOptions | Options for UpgradeDependencies . |
| string[] | Additional entries to .gitignore. |
| boolean | Setup jest unit tests. |
| projen.javascript.JestOptions | Jest options. |
| boolean | Automatically update files modified during builds to pull-request branches. |
| string[] | Additional entries to .npmignore. |
| boolean | Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs. |
| projen.IgnoreFileOptions | Configuration options for .npmignore file. |
| boolean | Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist ). |
| boolean | Setup prettier. |
| projen.javascript.PrettierOptions | Prettier options. |
| boolean | Indicates of "projen" should be installed as a devDependency. |
| boolean | Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation. |
| projen.javascript.ProjenrcOptions | Options for .projenrc.js. |
| string | Version of projen to install. |
| boolean | Include a GitHub pull request template. |
| string[] | The contents of the pull request template. |
| boolean | Add release management to this project. |
| boolean | Automatically release to npm when new versions are introduced. |
| boolean | DEPRECATED: renamed to release . |
| projen.github.workflows.JobStep[] | Workflow steps to use in order to bootstrap this repo. |
| projen.github.GitIdentity | The git identity to use in workflows. |
| string | The node version used in GitHub Actions workflows. |
| boolean | Enable Node.js package cache in GitHub workflows. |
| boolean | Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler). |
| boolean | Do not generate a tsconfig.dev.json file. |
| boolean | Docgen by Typedoc. |
| string | Docs directory. |
| string | The .d.ts file that includes the type declarations for this module. |
| boolean | Setup eslint. |
| projen.javascript.EslintOptions | Eslint options. |
| string | Typescript artifacts output directory. |
| boolean | Use TypeScript for your projenrc file (.projenrc.ts ). |
| projen.typescript.ProjenrcOptions | Options for .projenrc.ts. |
| boolean | Generate one-time sample in src/ and test/ if there are no files there. |
| string | Typescript sources directory. |
| string | Jest tests directory. Tests files should be named xxx.test.ts . |
| projen.javascript.TypescriptConfigOptions | Custom TSConfig. |
| projen.javascript.TypescriptConfigOptions | Custom tsconfig options for the development tsconfig.json file (used for testing). |
| string | The name of the development tsconfig.json file. |
| projen.typescript.TsJestOptions | Options for ts-jest. |
| string | TypeScript version to use. |
| string | A command to execute before synthesis. |
| string | cdk.out directory. |
| {[ key: string ]: any} | Additional context to include in cdk.json . |
| boolean | Include all feature flags in cdk.json. |
|
| 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. |
| string[] | Glob patterns to exclude from cdk watch . |
| string[] | Glob patterns to include in cdk watch . |
| string | Minimum version of the AWS CDK to depend on. |
| boolean | Warning: NodeJS only. |
| boolean | Install the assertions library? |
| string | Version range of the AWS CDK CLI to depend on. |
| string[] | Which AWS CDKv1 modules this project requires. |
| boolean | If this is enabled (default), all modules declared in cdkDependencies will be also added as normal dependencies (as well as peerDependencies ). |
| string[] | AWS CDK modules required for testing. |
| boolean | Use pinned version instead of caret version for CDK. |
| string | Minimum version of the constructs library to depend on. |
| string | The CDK app's entrypoint (relative to the source directory, which is "src" by default). |
| 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. |
| boolean | Enable experimental support for the AWS CDK integ-runner. |
| boolean | Automatically discovers and creates integration tests for each .integ.ts file in under your test directory. |
| 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. |
| 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. |
|
| Common options for all AWS Lambda functions. |
name
Required
public readonly name: string;
- Type: string
- Default: $BASEDIR
This is the name of your project.
commitGenerated
Optional
public readonly commitGenerated: boolean;
- Type: boolean
- Default: true
Whether to commit the managed files by default.
gitIgnoreOptions
Optional
public readonly gitIgnoreOptions: IgnoreFileOptions;
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
gitOptions
Optional
public readonly gitOptions: GitOptions;
- Type: projen.GitOptions
Configuration options for git.
logging
Optional
public readonly logging: LoggerOptions;
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
outdir
Optional
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.
parent
Optional
public readonly parent: Project;
- Type: projen.Project
The parent project, if this project is part of a bigger project.
projenCommand
Optional
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.
projenrcJson
Optional
public readonly projenrcJson: boolean;
- Type: boolean
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
projenrcJsonOptions
Optional
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
renovatebot
Optional
public readonly renovatebot: boolean;
- Type: boolean
- Default: false
Use renovatebot to handle dependency upgrades.
renovatebotOptions
Optional
public readonly renovatebotOptions: RenovatebotOptions;
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
autoApproveOptions
Optional
public readonly autoApproveOptions: AutoApproveOptions;
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
autoMerge
Optional
public readonly autoMerge: boolean;
- Type: boolean
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
autoMergeOptions
Optional
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.
clobber
Optional
public readonly clobber: boolean;
- Type: boolean
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
devContainer
Optional
public readonly devContainer: boolean;
- Type: boolean
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
github
Optional
public readonly github: boolean;
- Type: boolean
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
githubOptions
Optional
public readonly githubOptions: GitHubOptions;
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
gitpod
Optional
public readonly gitpod: boolean;
- Type: boolean
- Default: false
Add a Gitpod development environment.
mergify
Optional
mergify
- Deprecated: use
githubOptions.mergify
instead
public readonly mergify: boolean;
- Type: boolean
- Default: true
Whether mergify should be enabled on this repository or not.
mergifyOptions
Optional
mergifyOptions
- Deprecated: use
githubOptions.mergifyOptions
instead
public readonly mergifyOptions: MergifyOptions;
- Type: projen.github.MergifyOptions
- Default: default options
Options for mergify.
projectType
Optional
projectType
- Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
- Type: projen.ProjectType
- Default: ProjectType.UNKNOWN
Which type of project this is (library/app).
projenCredentials
Optional
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.
projenTokenSecret
Optional
projenTokenSecret
- Deprecated: use
projenCredentials
public readonly projenTokenSecret: string;
- Type: string
- Default: "PROJEN_GITHUB_TOKEN"
The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
This token needs to have the repo
, workflows
and packages
scope.
readme
Optional
public readonly readme: SampleReadmeProps;
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
Example
"{ filename: 'readme.md', contents: '# title' }"
stale
Optional
public readonly stale: boolean;
- Type: boolean
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
staleOptions
Optional
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
.
vscode
Optional
public readonly vscode: boolean;
- Type: boolean
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
allowLibraryDependencies
Optional
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.
authorEmail
Optional
public readonly authorEmail: string;
- Type: string
Author's e-mail.
authorName
Optional
public readonly authorName: string;
- Type: string
Author's name.
authorOrganization
Optional
public readonly authorOrganization: boolean;
- Type: boolean
Is the author an organization.
authorUrl
Optional
public readonly authorUrl: string;
- Type: string
Author's URL / Website.
autoDetectBin
Optional
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.
bin
Optional
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.
bugsEmail
Optional
public readonly bugsEmail: string;
- Type: string
The email address to which issues should be reported.
bugsUrl
Optional
public readonly bugsUrl: string;
- Type: string
The url to your project's issue tracker.
bundledDeps
Optional
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.
bunVersion
Optional
public readonly bunVersion: string;
- Type: string
- Default: "latest"
The version of Bun to use if using Bun as a package manager.
codeArtifactOptions
Optional
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
deps
Optional
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.
Example
[ 'express', 'lodash', 'foo@^2' ]
description
Optional
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
devDeps
Optional
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.
Example
[ 'typescript', '@types/express' ]
entrypoint
Optional
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
homepage
Optional
public readonly homepage: string;
- Type: string
Package's Homepage / Website.
keywords
Optional
public readonly keywords: string[];
- Type: string[]
Keywords to include in package.json
.
license
Optional
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.
licensed
Optional
public readonly licensed: boolean;
- Type: boolean
- Default: true
Indicates if a license should be added.
maxNodeVersion
Optional
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.
minNodeVersion
Optional
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
.
npmAccess
Optional
public readonly npmAccess: NpmAccess;
- Type: projen.javascript.NpmAccess
- Default: for scoped packages (e.g.
foo@bar
), the default isNpmAccess.RESTRICTED
, for non-scoped packages, the default isNpmAccess.PUBLIC
.
Access level of the npm package.
npmProvenance
Optional
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.
npmRegistry
Optional
npmRegistry
- Deprecated: use
npmRegistryUrl
instead
public readonly npmRegistry: string;
- Type: string
The host name of the npm registry to publish to.
Cannot be set together with npmRegistryUrl
.
npmRegistryUrl
Optional
public readonly npmRegistryUrl: string;
- Type: string
- Default: "https://registry.npmjs.org"
The base URL of the npm package registry.
Must be a URL (e.g. start with "https://" or "http://")
npmTokenSecret
Optional
public readonly npmTokenSecret: string;
- Type: string
- Default: "NPM_TOKEN"
GitHub secret which contains the NPM token to use when publishing packages.
packageManager
Optional
public readonly packageManager: NodePackageManager;
- Type: projen.javascript.NodePackageManager
- Default: NodePackageManager.YARN_CLASSIC
The Node Package Manager used to execute scripts.
packageName
Optional
public readonly packageName: string;
- Type: string
- Default: defaults to project name
The "name" in package.json.
peerDependencyOptions
Optional
public readonly peerDependencyOptions: PeerDependencyOptions;
- Type: projen.javascript.PeerDependencyOptions
Options for peerDeps
.
peerDeps
Optional
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.
pnpmVersion
Optional
public readonly pnpmVersion: string;
- Type: string
- Default: "9"
The version of PNPM to use if using PNPM as a package manager.
repository
Optional
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
repositoryDirectory
Optional
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.
scopedPackagesOptions
Optional
public readonly scopedPackagesOptions: ScopedPackagesOptions[];
- Type: projen.javascript.ScopedPackagesOptions[]
- Default: fetch all scoped packages from the public npm registry
Options for privately hosted scoped packages.
scripts
Optional
scripts
- Deprecated: use
project.addTask()
orpackage.setScript()
public readonly scripts: {[ key: string ]: string};
- 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. Also adds the script as a task.
stability
Optional
public readonly stability: string;
- Type: string
Package's Stability.
yarnBerryOptions
Optional
public readonly yarnBerryOptions: YarnBerryOptions;
- Type: projen.javascript.YarnBerryOptions
- Default: Yarn Berry v4 with all default options
Options for Yarn Berry.
bumpPackage
Optional
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
.
jsiiReleaseVersion
Optional
public readonly jsiiReleaseVersion: string;
- Type: string
- Default: "latest"
Version requirement of publib
which is used to publish modules to npm.
majorVersion
Optional
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.
minMajorVersion
Optional
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
.
nextVersionCommand
Optional
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 like1.2.3
.$LATEST_TAG
: the most recent tag. Looks likeprefix-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 bex.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
.
npmDistTag
Optional
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.
postBuildSteps
Optional
public readonly postBuildSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
- Default: []
Steps to execute after build as part of the release workflow.
prerelease
Optional
public readonly prerelease: string;
- Type: string
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRun
Optional
public readonly publishDryRun: boolean;
- Type: boolean
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publishTasks
Optional
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.
releasableCommits
Optional
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.
releaseBranches
Optional
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.
releaseEveryCommit
Optional
releaseEveryCommit
- Deprecated: Use
releaseTrigger: ReleaseTrigger.continuous()
instead
public readonly releaseEveryCommit: boolean;
- Type: boolean
- Default: true
Automatically release new versions every commit to one of branches in releaseBranches
.
releaseFailureIssue
Optional
public readonly releaseFailureIssue: boolean;
- Type: boolean
- Default: false
Create a github issue on every failed publishing task.
releaseFailureIssueLabel
Optional
public readonly releaseFailureIssueLabel: string;
- Type: string
- Default: "failed-release"
The label to apply to issues indicating publish failures.
Only applies if releaseFailureIssue
is true.
releaseSchedule
Optional
releaseSchedule
- Deprecated: Use
releaseTrigger: ReleaseTrigger.scheduled()
instead
public readonly releaseSchedule: string;
- Type: string
- Default: no scheduled releases
CRON schedule to trigger new releases.
releaseTagPrefix
Optional
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.
releaseTrigger
Optional
public readonly releaseTrigger: ReleaseTrigger;
- Type: projen.release.ReleaseTrigger
- Default: Continuous releases (
ReleaseTrigger.continuous()
)
The release trigger to use.
releaseWorkflowName
Optional
public readonly releaseWorkflowName: string;
- Type: string
- Default: "release"
The name of the default release workflow.
releaseWorkflowSetupSteps
Optional
public readonly releaseWorkflowSetupSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
A set of workflow steps to execute in order to setup the workflow container.
versionrcOptions
Optional
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.
workflowContainerImage
Optional
public readonly workflowContainerImage: string;
- Type: string
- Default: default image
Container image to use for GitHub workflows.
workflowRunsOn
Optional
public readonly workflowRunsOn: string[];
- Type: string[]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflowRunsOnGroup
Optional
public readonly workflowRunsOnGroup: GroupRunnerOptions;
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
defaultReleaseBranch
Required
public readonly defaultReleaseBranch: string;
- Type: string
- Default: "main"
The name of the main release branch.
artifactsDirectory
Optional
public readonly artifactsDirectory: string;
- Type: string
- Default: "dist"
A directory which will contain build artifacts.
autoApproveUpgrades
Optional
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.
buildWorkflow
Optional
public readonly buildWorkflow: boolean;
- Type: boolean
- Default: true if not a subproject
Define a GitHub workflow for building PRs.
buildWorkflowOptions
Optional
public readonly buildWorkflowOptions: BuildWorkflowOptions;
- Type: projen.javascript.BuildWorkflowOptions
Options for PR build workflow.
buildWorkflowTriggers
Optional
buildWorkflowTriggers
- Deprecated: - Use
buildWorkflowOptions.workflowTriggers
public readonly buildWorkflowTriggers: Triggers;
- Type: projen.github.workflows.Triggers
- Default: "{ pullRequest: {}, workflowDispatch: {} }"
Build workflow triggers.
bundlerOptions
Optional
public readonly bundlerOptions: BundlerOptions;
- Type: projen.javascript.BundlerOptions
Options for Bundler
.
checkLicenses
Optional
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.
codeCov
Optional
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
.
codeCovTokenSecret
Optional
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.
copyrightOwner
Optional
public readonly copyrightOwner: string;
- Type: string
- Default: defaults to the value of authorName or "" if
authorName
is undefined.
License copyright owner.
copyrightPeriod
Optional
public readonly copyrightPeriod: string;
- Type: string
- Default: current year
The copyright years to put in the LICENSE file.
dependabot
Optional
public readonly dependabot: boolean;
- Type: boolean
- Default: false
Use dependabot to handle dependency upgrades.
Cannot be used in conjunction with depsUpgrade
.
dependabotOptions
Optional
public readonly dependabotOptions: DependabotOptions;
- Type: projen.github.DependabotOptions
- Default: default options
Options for dependabot.
depsUpgrade
Optional
public readonly depsUpgrade: boolean;
- Type: boolean
- Default: true
Use tasks and github workflows to handle dependency upgrades.
Cannot be used in conjunction with dependabot
.
depsUpgradeOptions
Optional
public readonly depsUpgradeOptions: UpgradeDependenciesOptions;
- Type: projen.javascript.UpgradeDependenciesOptions
- Default: default options
Options for UpgradeDependencies
.
gitignore
Optional
public readonly gitignore: string[];
- Type: string[]
Additional entries to .gitignore.
jest
Optional
public readonly jest: boolean;
- Type: boolean
- Default: true
Setup jest unit tests.
jestOptions
Optional
public readonly jestOptions: JestOptions;
- Type: projen.javascript.JestOptions
- Default: default options
Jest options.
mutableBuild
Optional
mutableBuild
- Deprecated: - Use
buildWorkflowOptions.mutableBuild
public readonly mutableBuild: boolean;
- 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.
npmignore
Optional
npmignore
- Deprecated: - use
project.addPackageIgnore
public readonly npmignore: string[];
- Type: string[]
Additional entries to .npmignore.
npmignoreEnabled
Optional
public readonly npmignoreEnabled: boolean;
- Type: boolean
- Default: true
Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
npmIgnoreOptions
Optional
public readonly npmIgnoreOptions: IgnoreFileOptions;
- Type: projen.IgnoreFileOptions
Configuration options for .npmignore file.
package
Optional
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
).
prettier
Optional
public readonly prettier: boolean;
- Type: boolean
- Default: false
Setup prettier.
prettierOptions
Optional
public readonly prettierOptions: PrettierOptions;
- Type: projen.javascript.PrettierOptions
- Default: default options
Prettier options.
projenDevDependency
Optional
public readonly projenDevDependency: boolean;
- Type: boolean
- Default: true if not a subproject
Indicates of "projen" should be installed as a devDependency.
projenrcJs
Optional
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.
projenrcJsOptions
Optional
public readonly projenrcJsOptions: ProjenrcOptions;
- Type: projen.javascript.ProjenrcOptions
- Default: default options
Options for .projenrc.js.
projenVersion
Optional
public readonly projenVersion: string;
- Type: string
- Default: Defaults to the latest version.
Version of projen to install.
pullRequestTemplate
Optional
public readonly pullRequestTemplate: boolean;
- Type: boolean
- Default: true
Include a GitHub pull request template.
pullRequestTemplateContents
Optional
public readonly pullRequestTemplateContents: string[];
- Type: string[]
- Default: default content
The contents of the pull request template.
release
Optional
public readonly release: boolean;
- Type: boolean
- Default: true (false for subprojects)
Add release management to this project.
releaseToNpm
Optional
public readonly releaseToNpm: boolean;
- Type: boolean
- Default: false
Automatically release to npm when new versions are introduced.
releaseWorkflow
Optional
releaseWorkflow