cdk8s
Submodule
Constructs
AutoDiscover
Automatically discovers and creates IntegrationTest
s from entry points found in the test tree.
Initializers
import { cdk8s } from 'projen'
new cdk8s.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 { cdk8s } from 'projen'
cdk8s.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 { cdk8s } from 'projen'
cdk8s.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
Cdk8sDeps
Manages dependencies on the CDK8s.
Initializers
import { cdk8s } from 'projen'
new cdk8s.Cdk8sDeps(project: Project, options: Cdk8sDepsOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
- Type: Cdk8sDepsOptions
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 { cdk8s } from 'projen'
cdk8s.Cdk8sDeps.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 { cdk8s } from 'projen'
cdk8s.Cdk8sDeps.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. |
| number | The major version of the CDK8s (e.g. 1, 2, ...). |
| string | The minimum version of the CDK8s (e.g. 2.0.0 ). |
| string | The dependency requirement for CDK8s. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
cdk8sMajorVersion
Required
public readonly cdk8sMajorVersion: number;
- Type: number
The major version of the CDK8s (e.g. 1, 2, ...).
cdk8sMinimumVersion
Required
public readonly cdk8sMinimumVersion: string;
- Type: string
The minimum version of the CDK8s (e.g. 2.0.0
).
cdk8sVersion
Required
public readonly cdk8sVersion: string;
- Type: string
The dependency requirement for CDK8s.
Cdk8sDepsPy
Initializers
import { cdk8s } from 'projen'
new cdk8s.Cdk8sDepsPy(project: Project, options: Cdk8sDepsOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Required
- Type: Cdk8sDepsOptions
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 { cdk8s } from 'projen'
cdk8s.Cdk8sDepsPy.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 { cdk8s } from 'projen'
cdk8s.Cdk8sDepsPy.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. |
| number | The major version of the CDK8s (e.g. 1, 2, ...). |
| string | The minimum version of the CDK8s (e.g. 2.0.0 ). |
| string | The dependency requirement for CDK8s. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
cdk8sMajorVersion
Required
public readonly cdk8sMajorVersion: number;
- Type: number
The major version of the CDK8s (e.g. 1, 2, ...).
cdk8sMinimumVersion
Required
public readonly cdk8sMinimumVersion: string;
- Type: string
The minimum version of the CDK8s (e.g. 2.0.0
).
cdk8sVersion
Required
public readonly cdk8sVersion: string;
- Type: string
The dependency requirement for CDK8s.
Cdk8sPythonApp
CDK8s app in Python.
Initializers
import { cdk8s } from 'projen'
new cdk8s.Cdk8sPythonApp(options: Cdk8sPythonOptions)
Name | Type | Description |
---|---|---|
|
| No description. |
options
Required
- Type: Cdk8sPythonOptions
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 { cdk8s } from 'projen'
cdk8s.Cdk8sPythonApp.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 { cdk8s } from 'projen'
cdk8s.Cdk8sPythonApp.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { cdk8s } from 'projen'
cdk8s.Cdk8sPythonApp.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 | Directory where sample tests are located. |
| 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 CDK8s app entrypoint. |
|
| 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.
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
- Default: "tests"
Directory where sample tests are located.
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 CDK8s app entrypoint.
cdk8sDeps
Required
public readonly cdk8sDeps: Cdk8sDeps;
- Type: Cdk8sDeps
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.
Cdk8sTypeScriptApp
CDK8s app in TypeScript.
Initializers
import { cdk8s } from 'projen'
new cdk8s.Cdk8sTypeScriptApp(options: Cdk8sTypeScriptAppOptions)
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. |
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.
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 { cdk8s } from 'projen'
cdk8s.Cdk8sTypeScriptApp.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 { cdk8s } from 'projen'
cdk8s.Cdk8sTypeScriptApp.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { cdk8s } from 'projen'
cdk8s.Cdk8sTypeScriptApp.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 CDK8s app entrypoint. |
|
| 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
appEntrypoint
Required
public readonly appEntrypoint: string;
- Type: string
The CDK8s app entrypoint.
cdk8sDeps
Required
public readonly cdk8sDeps: Cdk8sDeps;
- Type: Cdk8sDeps
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
ConstructLibraryCdk8s
CDK8s construct library project.
A multi-language (jsii) construct library which vends constructs designed to use within the CDK for Kubernetes (CDK8s), with a friendly workflow and automatic publishing to the construct catalog.
Initializers
import { cdk8s } from 'projen'
new cdk8s.ConstructLibraryCdk8s(options: ConstructLibraryCdk8sOptions)
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. |
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.
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 { cdk8s } from 'projen'
cdk8s.ConstructLibraryCdk8s.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 { cdk8s } from 'projen'
cdk8s.ConstructLibraryCdk8s.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { cdk8s } from 'projen'
cdk8s.ConstructLibraryCdk8s.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 CDK8s version this app is using. |
| string | The constructs 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
cdk8sVersion
Required
public readonly cdk8sVersion: string;
- Type: string
The CDK8s version this app is using.
constructsVersion
Required
public readonly constructsVersion: string;
- Type: string
The constructs 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
IntegrationTest
CDK8S integration test.
Initializers
import { cdk8s } from 'projen'
new cdk8s.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 { cdk8s } from 'projen'
cdk8s.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 { cdk8s } from 'projen'
cdk8s.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). |
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).
IntegrationTestAutoDiscover
Discovers and creates integration tests from files in the test root.
Initializers
import { cdk8s } from 'projen'
new cdk8s.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 { cdk8s } from 'projen'
cdk8s.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 { cdk8s } from 'projen'
cdk8s.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.
Structs
AutoDiscoverOptions
Options for AutoDiscover
.
Initializer
import { cdk8s } from 'projen'
const autoDiscoverOptions: cdk8s.AutoDiscoverOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | Test source tree. |
| string | Path to the tsconfig file to use for integration tests. |
| boolean | Automatically discover integration tests. |
testdir
Required
public readonly testdir: string;
- Type: string
Test source tree.
tsconfigPath
Required
public readonly tsconfigPath: string;
- Type: string
Path to the tsconfig file to use for integration tests.
integrationTestAutoDiscover
Optional
public readonly integrationTestAutoDiscover: boolean;
- Type: boolean
- Default: true
Automatically discover integration tests.
Cdk8sDepsCommonOptions
Options for Cdk8sDeps
.
Initializer
import { cdk8s } from 'projen'
const cdk8sDepsCommonOptions: cdk8s.Cdk8sDepsCommonOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | Minimum version of the cdk8s to depend on. |
| string | Minimum version of the cdk8s-cli to depend on. |
| boolean | Use pinned version instead of caret version for cdk8s-cli. |
| boolean | Include cdk8s-plus. |
| string | Minimum version of the cdk8s-plus-XX to depend on. |
| boolean | Use pinned version instead of caret version for cdk8s-plus-17. |
| boolean | Use pinned version instead of caret version for cdk8s. |
| string | Minimum version of the constructs library to depend on. |
| boolean | Use pinned version instead of caret version for constructs. |
| number | The cdk8s-plus library depends of Kubernetes minor version For example, cdk8s-plus-22 targets kubernetes version 1.22.0 cdk8s-plus-21 targets kubernetes version 1.21.0. |
cdk8sVersion
Required
public readonly cdk8sVersion: string;
- Type: string
- Default: "2.3.33"
Minimum version of the cdk8s to depend on.
cdk8sCliVersion
Optional
public readonly cdk8sCliVersion: string;
- Type: string
- Default: "2.0.28"
Minimum version of the cdk8s-cli to depend on.
cdk8sCliVersionPinning
Optional
public readonly cdk8sCliVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for cdk8s-cli.
You can use this to prevent yarn to mix versions for your CDK8s package and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.
cdk8sPlus
Optional
public readonly cdk8sPlus: boolean;
- Type: boolean
- Default: true
Include cdk8s-plus.
cdk8sPlusVersion
Optional
public readonly cdk8sPlusVersion: string;
- Type: string
- Default: "2.0.0-rc.26"
Minimum version of the cdk8s-plus-XX to depend on.
cdk8sPlusVersionPinning
Optional
public readonly cdk8sPlusVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for cdk8s-plus-17.
You can use this to prevent yarn to mix versions for your CDK8s package and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.
cdk8sVersionPinning
Optional
public readonly cdk8sVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for cdk8s.
You can use this to prevent yarn to mix versions for your CDK8s package 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: "10.1.42"
Minimum version of the constructs
library to depend on.
constructsVersionPinning
Optional
public readonly constructsVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for constructs.
You can use this to prevent yarn to mix versions for your consructs package and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.
k8sMinorVersion
Optional
public readonly k8sMinorVersion: number;
- Type: number
- Default: 22
The cdk8s-plus library depends of Kubernetes minor version For example, cdk8s-plus-22 targets kubernetes version 1.22.0 cdk8s-plus-21 targets kubernetes version 1.21.0.
Cdk8sDepsOptions
Initializer
import { cdk8s } from 'projen'
const cdk8sDepsOptions: cdk8s.Cdk8sDepsOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | Minimum version of the cdk8s to depend on. |
| string | Minimum version of the cdk8s-cli to depend on. |
| boolean | Use pinned version instead of caret version for cdk8s-cli. |
| boolean | Include cdk8s-plus. |
| string | Minimum version of the cdk8s-plus-XX to depend on. |
| boolean | Use pinned version instead of caret version for cdk8s-plus-17. |
| boolean | Use pinned version instead of caret version for cdk8s. |
| string | Minimum version of the constructs library to depend on. |
| boolean | Use pinned version instead of caret version for constructs. |
| number | The cdk8s-plus library depends of Kubernetes minor version For example, cdk8s-plus-22 targets kubernetes version 1.22.0 cdk8s-plus-21 targets kubernetes version 1.21.0. |
| boolean | Add cdk8s-cli only to Node projects. |
| projen.DependencyType | The type of dependency to use for runtime CDK8s and constructs modules. |
cdk8sVersion
Required
public readonly cdk8sVersion: string;
- Type: string
- Default: "2.3.33"
Minimum version of the cdk8s to depend on.
cdk8sCliVersion
Optional
public readonly cdk8sCliVersion: string;
- Type: string
- Default: "2.0.28"
Minimum version of the cdk8s-cli to depend on.
cdk8sCliVersionPinning
Optional
public readonly cdk8sCliVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for cdk8s-cli.
You can use this to prevent yarn to mix versions for your CDK8s package and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.
cdk8sPlus
Optional
public readonly cdk8sPlus: boolean;
- Type: boolean
- Default: true
Include cdk8s-plus.
cdk8sPlusVersion
Optional
public readonly cdk8sPlusVersion: string;
- Type: string
- Default: "2.0.0-rc.26"
Minimum version of the cdk8s-plus-XX to depend on.
cdk8sPlusVersionPinning
Optional
public readonly cdk8sPlusVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for cdk8s-plus-17.
You can use this to prevent yarn to mix versions for your CDK8s package and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.
cdk8sVersionPinning
Optional
public readonly cdk8sVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for cdk8s.
You can use this to prevent yarn to mix versions for your CDK8s package 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: "10.1.42"
Minimum version of the constructs
library to depend on.
constructsVersionPinning
Optional
public readonly constructsVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for constructs.
You can use this to prevent yarn to mix versions for your consructs package and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.
k8sMinorVersion
Optional
public readonly k8sMinorVersion: number;
- Type: number
- Default: 22
The cdk8s-plus library depends of Kubernetes minor version For example, cdk8s-plus-22 targets kubernetes version 1.22.0 cdk8s-plus-21 targets kubernetes version 1.21.0.
cdk8sCliDependency
Required
public readonly cdk8sCliDependency: boolean;
- Type: boolean
- Default: false
Add cdk8s-cli only to Node projects.
dependencyType
Required
public readonly dependencyType: DependencyType;
- Type: projen.DependencyType
The type of dependency to use for runtime CDK8s and constructs
modules.
For libraries, use peer dependencies and for apps use runtime dependencies.
Cdk8sPackageNames
Initializer
import { cdk8s } from 'projen'
const cdk8sPackageNames: cdk8s.Cdk8sPackageNames = { ... }
Properties
Name | Type | Description |
---|---|---|
| string | Fully qualified name of the core framework package. |
| string | Fully qualified name of the cdk9s-plus-XX library package. |
| string | Fully qualified name of the constructs library package. |
| string | Fully qualified name of the client package. |
cdk8s
Required
public readonly cdk8s: string;
- Type: string
Fully qualified name of the core framework package.
cdk8sPlus
Required
public readonly cdk8sPlus: string;
- Type: string
Fully qualified name of the cdk9s-plus-XX library package.
constructs
Required
public readonly constructs: string;
- Type: string
Fully qualified name of the constructs library package.
cdk8sClient
Optional
public readonly cdk8sClient: string;
- Type: string
Fully qualified name of the client package.
Used only on Node projects
Cdk8sPythonOptions
Options for Cdk8sPythonApp
.
Initializer
import { cdk8s } from 'projen'
const cdk8sPythonOptions: cdk8s.Cdk8sPythonOptions = { ... }
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 | Minimum version of the cdk8s to depend on. |
| string | Minimum version of the cdk8s-cli to depend on. |
| boolean | Use pinned version instead of caret version for cdk8s-cli. |
| boolean | Include cdk8s-plus. |
| string | Minimum version of the cdk8s-plus-XX to depend on. |
| boolean | Use pinned version instead of caret version for cdk8s-plus-17. |
| boolean | Use pinned version instead of caret version for cdk8s. |
| string | Minimum version of the constructs library to depend on. |
| boolean | Use pinned version instead of caret version for constructs. |
| number | The cdk8s-plus library depends of Kubernetes minor version For example, cdk8s-plus-22 targets kubernetes version 1.22.0 cdk8s-plus-21 targets kubernetes version 1.21.0. |
| string | The CDK8s app's entrypoint. |
| string[] | Import additional specs. |
| string | Import a specific Kubernetes spec version. |
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.
cdk8sVersion
Required
public readonly cdk8sVersion: string;
- Type: string
- Default: "2.3.33"
Minimum version of the cdk8s to depend on.
cdk8sCliVersion
Optional
public readonly cdk8sCliVersion: string;
- Type: string
- Default: "2.0.28"
Minimum version of the cdk8s-cli to depend on.
cdk8sCliVersionPinning
Optional
public readonly cdk8sCliVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for cdk8s-cli.
You can use this to prevent yarn to mix versions for your CDK8s package and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.
cdk8sPlus
Optional
public readonly cdk8sPlus: boolean;
- Type: boolean
- Default: true
Include cdk8s-plus.
cdk8sPlusVersion
Optional
public readonly cdk8sPlusVersion: string;
- Type: string
- Default: "2.0.0-rc.26"
Minimum version of the cdk8s-plus-XX to depend on.
cdk8sPlusVersionPinning
Optional
public readonly cdk8sPlusVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for cdk8s-plus-17.
You can use this to prevent yarn to mix versions for your CDK8s package and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.
cdk8sVersionPinning
Optional
public readonly cdk8sVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for cdk8s.
You can use this to prevent yarn to mix versions for your CDK8s package 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: "10.1.42"
Minimum version of the constructs
library to depend on.
constructsVersionPinning
Optional
public readonly constructsVersionPinning: boolean;
- Type: boolean
- Default: false
Use pinned version instead of caret version for constructs.
You can use this to prevent yarn to mix versions for your consructs package and to prevent auto-updates. If you use experimental features this will let you define the moment you include breaking changes.
k8sMinorVersion
Optional
public readonly k8sMinorVersion: number;
- Type: number
- Default: 22
The cdk8s-plus library depends of Kubernetes minor version For example, cdk8s-plus-22 targets kubernetes version 1.22.0 cdk8s-plus-21 targets kubernetes version 1.21.0.
appEntrypoint
Optional
public readonly appEntrypoint: string;
- Type: string
- Default: "app.py"
The CDK8s app's entrypoint.