API Reference
Constructs
OpenApiAsyncDefinition
The OpenAPI Spec.
Initializers
import { OpenApiAsyncDefinition } from '@aws/pdk/type-safe-api'
new OpenApiAsyncDefinition(project: Project, options: OpenApiAsyncDefinitionOptions)
Name | Type | Description |
---|---|---|
project |
projen.Project |
No description. |
options |
OpenApiAsyncDefinitionOptions |
No description. |
project
Required
- Type: projen.Project
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
postSynthesize |
Called after synthesis. |
preSynthesize |
Called before synthesis. |
synthesize |
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 |
---|---|
isConstruct |
Checks if x is a construct. |
isComponent |
Test whether the given construct is a component. |
isConstruct
import { OpenApiAsyncDefinition } from '@aws/pdk/type-safe-api'
OpenApiAsyncDefinition.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 { OpenApiAsyncDefinition } from '@aws/pdk/type-safe-api'
OpenApiAsyncDefinition.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
projen.Project |
No description. |
openApiSpecificationPath |
string |
Path to the root OpenAPI specification file. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
openApiSpecificationPath
Required
public readonly openApiSpecificationPath: string;
- Type: string
Path to the root OpenAPI specification file.
OpenApiAsyncModelProject
Project for defining an OpenAPI model for a WebSocket API.
Initializers
import { OpenApiAsyncModelProject } from '@aws/pdk/type-safe-api'
new OpenApiAsyncModelProject(options: OpenApiAsyncModelProjectOptions)
Name | Type | Description |
---|---|---|
options |
OpenApiAsyncModelProjectOptions |
No description. |
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Exclude these files from the bundled package. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Consider a set of files as "generated". |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
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
~~
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- Type: string
The message.
annotateGenerated
public annotateGenerated(_glob: string): void
Consider a set of files as "generated".
This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.
_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
~~
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.
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isProject |
Test whether the given construct is a project. |
of |
Find the closest ancestor project for given construct. |
isConstruct
import { OpenApiAsyncModelProject } from '@aws/pdk/type-safe-api'
OpenApiAsyncModelProject.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 { OpenApiAsyncModelProject } from '@aws/pdk/type-safe-api'
OpenApiAsyncModelProject.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { OpenApiAsyncModelProject } from '@aws/pdk/type-safe-api'
OpenApiAsyncModelProject.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 |
---|---|---|
node |
constructs.Node |
The tree node. |
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
apiName |
string |
Name of the API. |
definition |
OpenApiAsyncDefinition |
OpenAPI specification component. |
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.
apiName
Required
public readonly apiName: string;
- Type: string
Name of the API.
definition
Required
public readonly definition: OpenApiAsyncDefinition;
- Type: OpenApiAsyncDefinition
OpenAPI specification component.
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
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.
OpenApiDefinition
The OpenAPI Spec.
Initializers
import { OpenApiDefinition } from '@aws/pdk/type-safe-api'
new OpenApiDefinition(project: Project, options: OpenApiDefinitionOptions)
Name | Type | Description |
---|---|---|
project |
projen.Project |
No description. |
options |
OpenApiDefinitionOptions |
No description. |
project
Required
- Type: projen.Project
options
Required
- Type: OpenApiDefinitionOptions
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
postSynthesize |
Called after synthesis. |
preSynthesize |
Called before synthesis. |
synthesize |
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 |
---|---|
isConstruct |
Checks if x is a construct. |
isComponent |
Test whether the given construct is a component. |
isConstruct
import { OpenApiDefinition } from '@aws/pdk/type-safe-api'
OpenApiDefinition.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 { OpenApiDefinition } from '@aws/pdk/type-safe-api'
OpenApiDefinition.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
projen.Project |
No description. |
openApiSpecificationPath |
string |
Path to the root OpenAPI specification file. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
openApiSpecificationPath
Required
public readonly openApiSpecificationPath: string;
- Type: string
Path to the root OpenAPI specification file.
OpenApiModelProject
Project for defining an OpenAPI model for a REST API.
Initializers
import { OpenApiModelProject } from '@aws/pdk/type-safe-api'
new OpenApiModelProject(options: OpenApiModelProjectOptions)
Name | Type | Description |
---|---|---|
options |
OpenApiModelProjectOptions |
No description. |
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Exclude these files from the bundled package. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Consider a set of files as "generated". |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
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
~~
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- Type: string
The message.
annotateGenerated
public annotateGenerated(_glob: string): void
Consider a set of files as "generated".
This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.
_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
~~
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.
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isProject |
Test whether the given construct is a project. |
of |
Find the closest ancestor project for given construct. |
isConstruct
import { OpenApiModelProject } from '@aws/pdk/type-safe-api'
OpenApiModelProject.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 { OpenApiModelProject } from '@aws/pdk/type-safe-api'
OpenApiModelProject.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { OpenApiModelProject } from '@aws/pdk/type-safe-api'
OpenApiModelProject.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 |
---|---|---|
node |
constructs.Node |
The tree node. |
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
apiName |
string |
Name of the API. |
definition |
OpenApiDefinition |
OpenAPI specification component. |
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.
apiName
Required
public readonly apiName: string;
- Type: string
Name of the API.
definition
Required
public readonly definition: OpenApiDefinition;
- Type: OpenApiDefinition
OpenAPI specification component.
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
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.
OpenApiProjectDefinition
The OpenAPI Spec.
Initializers
import { OpenApiProjectDefinition } from '@aws/pdk/type-safe-api'
new OpenApiProjectDefinition(project: Project, _options: OpenApiProjectDefinitionOptions)
Name | Type | Description |
---|---|---|
project |
projen.Project |
No description. |
_options |
OpenApiProjectDefinitionOptions |
No description. |
project
Required
- Type: projen.Project
_options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
postSynthesize |
Called after synthesis. |
preSynthesize |
Called before synthesis. |
synthesize |
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 |
---|---|
isConstruct |
Checks if x is a construct. |
isComponent |
Test whether the given construct is a component. |
isConstruct
import { OpenApiProjectDefinition } from '@aws/pdk/type-safe-api'
OpenApiProjectDefinition.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 { OpenApiProjectDefinition } from '@aws/pdk/type-safe-api'
OpenApiProjectDefinition.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
projen.Project |
No description. |
openApiSpecificationPath |
string |
Path to the root OpenAPI specification file. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
openApiSpecificationPath
Required
public readonly openApiSpecificationPath: string;
- Type: string
Path to the root OpenAPI specification file.
SmithyAsyncModelProject
Smithy model project for a WebSocket API.
Initializers
import { SmithyAsyncModelProject } from '@aws/pdk/type-safe-api'
new SmithyAsyncModelProject(options: SmithyAsyncModelProjectOptions)
Name | Type | Description |
---|---|---|
options |
SmithyAsyncModelProjectOptions |
No description. |
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Exclude these files from the bundled package. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Consider a set of files as "generated". |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
addSmithyDeps |
Add a dependency on other smithy projects. |
smithyProjectDefinition |
Returns the smithy project definition. |
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
~~
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- Type: string
The message.
annotateGenerated
public annotateGenerated(_glob: string): void
Consider a set of files as "generated".
This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.
_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
~~
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.
addSmithyDeps
public addSmithyDeps(deps: SmithyBaseProject): void
Add a dependency on other smithy projects.
deps
Required
- Type: SmithyBaseProject
smithyProjectDefinition
public smithyProjectDefinition(): SmithyProjectDefinition
Returns the smithy project definition.
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isProject |
Test whether the given construct is a project. |
of |
Find the closest ancestor project for given construct. |
isConstruct
import { SmithyAsyncModelProject } from '@aws/pdk/type-safe-api'
SmithyAsyncModelProject.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 { SmithyAsyncModelProject } from '@aws/pdk/type-safe-api'
SmithyAsyncModelProject.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { SmithyAsyncModelProject } from '@aws/pdk/type-safe-api'
SmithyAsyncModelProject.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 |
---|---|---|
node |
constructs.Node |
The tree node. |
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
apiName |
string |
Name of the API. |
definition |
SmithyServiceProjectDefinition |
Smithy model and build settings. |
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.
apiName
Required
public readonly apiName: string;
- Type: string
Name of the API.
definition
Required
public readonly definition: SmithyServiceProjectDefinition;
Smithy model and build settings.
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
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.
SmithyBaseProject
Base project for Smithy projects.
Initializers
import { SmithyBaseProject } from '@aws/pdk/type-safe-api'
new SmithyBaseProject(options: SmithyBaseProjectOptions)
Name | Type | Description |
---|---|---|
options |
SmithyBaseProjectOptions |
No description. |
options
Required
- Type: SmithyBaseProjectOptions
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Exclude these files from the bundled package. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Consider a set of files as "generated". |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
addSmithyDeps |
Add a dependency on other smithy projects. |
smithyProjectDefinition |
Returns the smithy project definition. |
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
~~
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- Type: string
The message.
annotateGenerated
public annotateGenerated(_glob: string): void
Consider a set of files as "generated".
This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.
_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
~~
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.
addSmithyDeps
public addSmithyDeps(deps: SmithyBaseProject): void
Add a dependency on other smithy projects.
deps
Required
- Type: SmithyBaseProject
smithyProjectDefinition
public smithyProjectDefinition(): SmithyProjectDefinition
Returns the smithy project definition.
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isProject |
Test whether the given construct is a project. |
of |
Find the closest ancestor project for given construct. |
isConstruct
import { SmithyBaseProject } from '@aws/pdk/type-safe-api'
SmithyBaseProject.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 { SmithyBaseProject } from '@aws/pdk/type-safe-api'
SmithyBaseProject.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { SmithyBaseProject } from '@aws/pdk/type-safe-api'
SmithyBaseProject.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 |
---|---|---|
node |
constructs.Node |
The tree node. |
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
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.
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
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.
SmithyModelProject
Smithy model project for a REST API.
Initializers
import { SmithyModelProject } from '@aws/pdk/type-safe-api'
new SmithyModelProject(options: SmithyModelProjectOptions)
Name | Type | Description |
---|---|---|
options |
SmithyModelProjectOptions |
No description. |
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Exclude these files from the bundled package. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Consider a set of files as "generated". |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
addSmithyDeps |
Add a dependency on other smithy projects. |
smithyProjectDefinition |
Returns the smithy project definition. |
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
~~
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- Type: string
The message.
annotateGenerated
public annotateGenerated(_glob: string): void
Consider a set of files as "generated".
This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.
_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
~~
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.
addSmithyDeps
public addSmithyDeps(deps: SmithyBaseProject): void
Add a dependency on other smithy projects.
deps
Required
- Type: SmithyBaseProject
smithyProjectDefinition
public smithyProjectDefinition(): SmithyProjectDefinition
Returns the smithy project definition.
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isProject |
Test whether the given construct is a project. |
of |
Find the closest ancestor project for given construct. |
isConstruct
import { SmithyModelProject } from '@aws/pdk/type-safe-api'
SmithyModelProject.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 { SmithyModelProject } from '@aws/pdk/type-safe-api'
SmithyModelProject.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { SmithyModelProject } from '@aws/pdk/type-safe-api'
SmithyModelProject.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 |
---|---|---|
node |
constructs.Node |
The tree node. |
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
apiName |
string |
Name of the API. |
definition |
SmithyServiceProjectDefinition |
Smithy model and build settings. |
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.
apiName
Required
public readonly apiName: string;
- Type: string
Name of the API.
definition
Required
public readonly definition: SmithyServiceProjectDefinition;
Smithy model and build settings.
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
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.
SmithyProjectDefinition
Definition for a Smithy project.
Initializers
import { SmithyProjectDefinition } from '@aws/pdk/type-safe-api'
new SmithyProjectDefinition(project: Project, options: SmithyProjectDefinitionOptions)
Name | Type | Description |
---|---|---|
project |
projen.Project |
No description. |
options |
SmithyProjectDefinitionOptions |
No description. |
project
Required
- Type: projen.Project
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
postSynthesize |
Called after synthesis. |
preSynthesize |
Called before synthesis. |
synthesize |
Synthesizes files to the project output directory. |
addDeps |
Add maven-style or local file dependencies to the smithy model project. |
addSmithyDeps |
Add dependencies on other smithy models, such that their shapes can be imported in this project. |
addSources |
Add additional paths to model source files or directories. |
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.
addDeps
public addDeps(deps: string): void
Add maven-style or local file dependencies to the smithy model project.
deps
Required
- Type: string
dependencies to add, eg "software.amazon.smithy:smithy-validation-model:1.27.2" or "file://../some/path/build/lib/my-shapes.jar.
addSmithyDeps
public addSmithyDeps(deps: SmithyProjectDefinition): void
Add dependencies on other smithy models, such that their shapes can be imported in this project.
deps
Required
- Type: SmithyProjectDefinition
smithy definitions to depend on.
addSources
public addSources(sources: string): void
Add additional paths to model source files or directories.
Paths should be relative to the project outdir. Any absolute paths will be resolved as relative paths.
sources
Required
- Type: string
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isComponent |
Test whether the given construct is a component. |
isConstruct
import { SmithyProjectDefinition } from '@aws/pdk/type-safe-api'
SmithyProjectDefinition.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 { SmithyProjectDefinition } from '@aws/pdk/type-safe-api'
SmithyProjectDefinition.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
projen.Project |
No description. |
gradleProjectName |
string |
Name of the gradle project. |
modelDir |
string |
Directory of model source code. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
gradleProjectName
Required
public readonly gradleProjectName: string;
- Type: string
Name of the gradle project.
modelDir
Required
public readonly modelDir: string;
- Type: string
Directory of model source code.
SmithyServiceProjectDefinition
Creates a project which defines a Smithy service, and transforms the Smithy model to OpenAPI.
Initializers
import { SmithyServiceProjectDefinition } from '@aws/pdk/type-safe-api'
new SmithyServiceProjectDefinition(project: Project, options: SmithyServiceProjectDefinitionOptions)
Name | Type | Description |
---|---|---|
project |
projen.Project |
No description. |
options |
SmithyServiceProjectDefinitionOptions |
No description. |
project
Required
- Type: projen.Project
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
postSynthesize |
Called after synthesis. |
preSynthesize |
Called before synthesis. |
synthesize |
Synthesizes files to the project output directory. |
addDeps |
Add maven-style or local file dependencies to the smithy model project. |
addSmithyDeps |
Add dependencies on other smithy models, such that their shapes can be imported in this project. |
addSources |
Add additional paths to model source files or directories. |
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.
addDeps
public addDeps(deps: string): void
Add maven-style or local file dependencies to the smithy model project.
deps
Required
- Type: string
dependencies to add, eg "software.amazon.smithy:smithy-validation-model:1.27.2" or "file://../some/path/build/lib/my-shapes.jar.
addSmithyDeps
public addSmithyDeps(deps: SmithyProjectDefinition): void
Add dependencies on other smithy models, such that their shapes can be imported in this project.
deps
Required
- Type: SmithyProjectDefinition
smithy definitions to depend on.
addSources
public addSources(sources: string): void
Add additional paths to model source files or directories.
Paths should be relative to the project outdir. Any absolute paths will be resolved as relative paths.
sources
Required
- Type: string
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isComponent |
Test whether the given construct is a component. |
isConstruct
import { SmithyServiceProjectDefinition } from '@aws/pdk/type-safe-api'
SmithyServiceProjectDefinition.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 { SmithyServiceProjectDefinition } from '@aws/pdk/type-safe-api'
SmithyServiceProjectDefinition.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
projen.Project |
No description. |
gradleProjectName |
string |
Name of the gradle project. |
modelDir |
string |
Directory of model source code. |
generatedModelDir |
string |
Directory of generated model source code. |
openApiSpecificationPath |
string |
Path to the generated OpenAPI specification, relative to the project outdir. |
smithyJsonModelPath |
string |
Path to the json Smithy model, relative to the project outdir. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
gradleProjectName
Required
public readonly gradleProjectName: string;
- Type: string
Name of the gradle project.
modelDir
Required
public readonly modelDir: string;
- Type: string
Directory of model source code.
generatedModelDir
Required
public readonly generatedModelDir: string;
- Type: string
Directory of generated model source code.
openApiSpecificationPath
Required
public readonly openApiSpecificationPath: string;
- Type: string
Path to the generated OpenAPI specification, relative to the project outdir.
smithyJsonModelPath
Required
public readonly smithyJsonModelPath: string;
- Type: string
Path to the json Smithy model, relative to the project outdir.
SmithyShapeLibraryProject
A project for defining a library of Smithy shapes which can be consumed by other projects.
Initializers
import { SmithyShapeLibraryProject } from '@aws/pdk/type-safe-api'
new SmithyShapeLibraryProject(options: SmithyShapeLibraryProjectOptions)
Name | Type | Description |
---|---|---|
options |
SmithyShapeLibraryProjectOptions |
No description. |
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Exclude these files from the bundled package. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Consider a set of files as "generated". |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
addSmithyDeps |
Add a dependency on other smithy projects. |
smithyProjectDefinition |
Returns the smithy project definition. |
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
~~
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- Type: string
The message.
annotateGenerated
public annotateGenerated(_glob: string): void
Consider a set of files as "generated".
This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.
_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
~~
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.
addSmithyDeps
public addSmithyDeps(deps: SmithyBaseProject): void
Add a dependency on other smithy projects.
deps
Required
- Type: SmithyBaseProject
smithyProjectDefinition
public smithyProjectDefinition(): SmithyProjectDefinition
Returns the smithy project definition.
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isProject |
Test whether the given construct is a project. |
of |
Find the closest ancestor project for given construct. |
isConstruct
import { SmithyShapeLibraryProject } from '@aws/pdk/type-safe-api'
SmithyShapeLibraryProject.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 { SmithyShapeLibraryProject } from '@aws/pdk/type-safe-api'
SmithyShapeLibraryProject.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { SmithyShapeLibraryProject } from '@aws/pdk/type-safe-api'
SmithyShapeLibraryProject.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 |
---|---|---|
node |
constructs.Node |
The tree node. |
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
definition |
SmithyProjectDefinition |
Smithy model and build settings. |
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.
definition
Required
public readonly definition: SmithyProjectDefinition;
- Type: SmithyProjectDefinition
Smithy model and build settings.
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
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.
SnapStartFunction
A lambda function which enables SnapStart on published versions by default.
Initializers
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
new SnapStartFunction(scope: Construct, id: string, props: SnapStartFunctionProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
SnapStartFunctionProps |
No description. |
scope
Required
- Type: constructs.Construct
id
Required
- Type: string
props
Required
- Type: SnapStartFunctionProps
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
addEventSource |
Adds an event source to this function. |
addEventSourceMapping |
Adds an event source that maps to this AWS Lambda function. |
addFunctionUrl |
Adds a url to this lambda function. |
addPermission |
Adds a permission to the Lambda resource policy. |
addToRolePolicy |
Adds a statement to the IAM role assumed by the instance. |
configureAsyncInvoke |
Configures options for asynchronous invocation. |
considerWarningOnInvokeFunctionPermissions |
A warning will be added to functions under the following conditions: - permissions that include lambda:InvokeFunction are added to the unqualified function. |
grantInvoke |
Grant the given identity permissions to invoke this Lambda. |
grantInvokeCompositePrincipal |
Grant multiple principals the ability to invoke this Lambda via CompositePrincipal. |
grantInvokeLatestVersion |
Grant the given identity permissions to invoke the $LATEST version or unqualified version of this Lambda. |
grantInvokeUrl |
Grant the given identity permissions to invoke this Lambda Function URL. |
grantInvokeVersion |
Grant the given identity permissions to invoke the given version of this Lambda. |
metric |
Return the given named metric for this Function. |
metricDuration |
How long execution of this Lambda takes. |
metricErrors |
How many invocations of this Lambda fail. |
metricInvocations |
How often this Lambda is invoked. |
metricThrottles |
How often this Lambda is throttled. |
addAlias |
Defines an alias for this function. |
addEnvironment |
Adds an environment variable to this Lambda function. |
addLayers |
Adds one or more Lambda Layers to this Lambda function. |
invalidateVersionBasedOn |
Mix additional information into the hash of the Version object. |
toString
public toString(): string
Returns a string representation of this construct.
applyRemovalPolicy
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
policy
Required
- Type: aws-cdk-lib.RemovalPolicy
addEventSource
public addEventSource(source: IEventSource): void
Adds an event source to this function.
Event sources are implemented in the aws-cdk-lib/aws-lambda-event-sources module.
The following example adds an SQS Queue as an event source:
import { SqsEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';
myFunction.addEventSource(new SqsEventSource(myQueue));
source
Required
- Type: aws-cdk-lib.aws_lambda.IEventSource
addEventSourceMapping
public addEventSourceMapping(id: string, options: EventSourceMappingOptions): EventSourceMapping
Adds an event source that maps to this AWS Lambda function.
id
Required
- Type: string
options
Required
- Type: aws-cdk-lib.aws_lambda.EventSourceMappingOptions
addFunctionUrl
public addFunctionUrl(options?: FunctionUrlOptions): FunctionUrl
Adds a url to this lambda function.
options
Optional
- Type: aws-cdk-lib.aws_lambda.FunctionUrlOptions
addPermission
public addPermission(id: string, permission: Permission): void
Adds a permission to the Lambda resource policy.
id
Required
- Type: string
The id for the permission construct.
permission
Required
- Type: aws-cdk-lib.aws_lambda.Permission
The permission to grant to this Lambda function.
addToRolePolicy
public addToRolePolicy(statement: PolicyStatement): void
Adds a statement to the IAM role assumed by the instance.
statement
Required
- Type: aws-cdk-lib.aws_iam.PolicyStatement
configureAsyncInvoke
public configureAsyncInvoke(options: EventInvokeConfigOptions): void
Configures options for asynchronous invocation.
options
Required
- Type: aws-cdk-lib.aws_lambda.EventInvokeConfigOptions
considerWarningOnInvokeFunctionPermissions
public considerWarningOnInvokeFunctionPermissions(scope: Construct, action: string): void
A warning will be added to functions under the following conditions: - permissions that include lambda:InvokeFunction
are added to the unqualified function.
function.currentVersion is invoked before or after the permission is created.
This applies only to permissions on Lambda functions, not versions or aliases. This function is overridden as a noOp for QualifiedFunctionBase.
scope
Required
- Type: constructs.Construct
action
Required
- Type: string
grantInvoke
public grantInvoke(grantee: IGrantable): Grant
Grant the given identity permissions to invoke this Lambda.
grantee
Required
- Type: aws-cdk-lib.aws_iam.IGrantable
grantInvokeCompositePrincipal
public grantInvokeCompositePrincipal(compositePrincipal: CompositePrincipal): Grant[]
Grant multiple principals the ability to invoke this Lambda via CompositePrincipal.
compositePrincipal
Required
- Type: aws-cdk-lib.aws_iam.CompositePrincipal
grantInvokeLatestVersion
public grantInvokeLatestVersion(grantee: IGrantable): Grant
Grant the given identity permissions to invoke the $LATEST version or unqualified version of this Lambda.
grantee
Required
- Type: aws-cdk-lib.aws_iam.IGrantable
grantInvokeUrl
public grantInvokeUrl(grantee: IGrantable): Grant
Grant the given identity permissions to invoke this Lambda Function URL.
grantee
Required
- Type: aws-cdk-lib.aws_iam.IGrantable
grantInvokeVersion
public grantInvokeVersion(grantee: IGrantable, version: IVersion): Grant
Grant the given identity permissions to invoke the given version of this Lambda.
grantee
Required
- Type: aws-cdk-lib.aws_iam.IGrantable
version
Required
- Type: aws-cdk-lib.aws_lambda.IVersion
metric
public metric(metricName: string, props?: MetricOptions): Metric
Return the given named metric for this Function.
metricName
Required
- Type: string
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
metricDuration
public metricDuration(props?: MetricOptions): Metric
How long execution of this Lambda takes.
Average over 5 minutes
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
metricErrors
public metricErrors(props?: MetricOptions): Metric
How many invocations of this Lambda fail.
Sum over 5 minutes
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
metricInvocations
public metricInvocations(props?: MetricOptions): Metric
How often this Lambda is invoked.
Sum over 5 minutes
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
metricThrottles
public metricThrottles(props?: MetricOptions): Metric
How often this Lambda is throttled.
Sum over 5 minutes
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
addAlias
public addAlias(aliasName: string, options?: AliasOptions): Alias
Defines an alias for this function.
The alias will automatically be updated to point to the latest version of the function as it is being updated during a deployment.
declare const fn: lambda.Function;
fn.addAlias('Live');
// Is equivalent to
new lambda.Alias(this, 'AliasLive', {
aliasName: 'Live',
version: fn.currentVersion,
});
aliasName
Required
- Type: string
The name of the alias.
options
Optional
- Type: aws-cdk-lib.aws_lambda.AliasOptions
Alias options.
addEnvironment
public addEnvironment(key: string, value: string, options?: EnvironmentOptions): Function
Adds an environment variable to this Lambda function.
If this is a ref to a Lambda function, this operation results in a no-op.
key
Required
- Type: string
The environment variable key.
value
Required
- Type: string
The environment variable's value.
options
Optional
- Type: aws-cdk-lib.aws_lambda.EnvironmentOptions
Environment variable options.
addLayers
public addLayers(layers: ILayerVersion): void
Adds one or more Lambda Layers to this Lambda function.
layers
Required
- Type: aws-cdk-lib.aws_lambda.ILayerVersion
the layers to be added.
invalidateVersionBasedOn
public invalidateVersionBasedOn(x: string): void
Mix additional information into the hash of the Version object.
The Lambda Function construct does its best to automatically create a new Version when anything about the Function changes (its code, its layers, any of the other properties).
However, you can sometimes source information from places that the CDK cannot look into, like the deploy-time values of SSM parameters. In those cases, the CDK would not force the creation of a new Version object when it actually should.
This method can be used to invalidate the current Version object. Pass in any string into this method, and make sure the string changes when you know a new Version needs to be created.
This method may be called more than once.
x
Required
- Type: string
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isOwnedResource |
Returns true if the construct was created by CDK, and false otherwise. |
isResource |
Check whether the given construct is a Resource. |
classifyVersionProperty |
Record whether specific properties in the AWS::Lambda::Function resource should also be associated to the Version resource. |
fromFunctionArn |
Import a lambda function into the CDK using its ARN. |
fromFunctionAttributes |
Creates a Lambda function object which represents a function not defined within this stack. |
fromFunctionName |
Import a lambda function into the CDK using its name. |
metricAll |
Return the given named metric for this Lambda. |
metricAllConcurrentExecutions |
Metric for the number of concurrent executions across all Lambdas. |
metricAllDuration |
Metric for the Duration executing all Lambdas. |
metricAllErrors |
Metric for the number of Errors executing all Lambdas. |
metricAllInvocations |
Metric for the number of invocations of all Lambdas. |
metricAllThrottles |
Metric for the number of throttled invocations of all Lambdas. |
metricAllUnreservedConcurrentExecutions |
Metric for the number of unreserved concurrent executions across all Lambdas. |
isConstruct
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.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.
isOwnedResource
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.isOwnedResource(construct: IConstruct)
Returns true if the construct was created by CDK, and false otherwise.
construct
Required
- Type: constructs.IConstruct
isResource
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
construct
Required
- Type: constructs.IConstruct
classifyVersionProperty
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.classifyVersionProperty(propertyName: string, locked: boolean)
Record whether specific properties in the AWS::Lambda::Function
resource should also be associated to the Version resource.
See 'currentVersion' section in the module README for more details.
propertyName
Required
- Type: string
The property to classify.
locked
Required
- Type: boolean
whether the property should be associated to the version or not.
fromFunctionArn
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.fromFunctionArn(scope: Construct, id: string, functionArn: string)
Import a lambda function into the CDK using its ARN.
For Function.addPermissions()
to work on this imported lambda, make sure that is
in the same account and region as the stack you are importing it into.
scope
Required
- Type: constructs.Construct
id
Required
- Type: string
functionArn
Required
- Type: string
fromFunctionAttributes
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.fromFunctionAttributes(scope: Construct, id: string, attrs: FunctionAttributes)
Creates a Lambda function object which represents a function not defined within this stack.
For Function.addPermissions()
to work on this imported lambda, set the sameEnvironment property to true
if this imported lambda is in the same account and region as the stack you are importing it into.
scope
Required
- Type: constructs.Construct
The parent construct.
id
Required
- Type: string
The name of the lambda construct.
attrs
Required
- Type: aws-cdk-lib.aws_lambda.FunctionAttributes
the attributes of the function to import.
fromFunctionName
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.fromFunctionName(scope: Construct, id: string, functionName: string)
Import a lambda function into the CDK using its name.
scope
Required
- Type: constructs.Construct
id
Required
- Type: string
functionName
Required
- Type: string
metricAll
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.metricAll(metricName: string, props?: MetricOptions)
Return the given named metric for this Lambda.
metricName
Required
- Type: string
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
metricAllConcurrentExecutions
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.metricAllConcurrentExecutions(props?: MetricOptions)
Metric for the number of concurrent executions across all Lambdas.
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
metricAllDuration
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.metricAllDuration(props?: MetricOptions)
Metric for the Duration executing all Lambdas.
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
metricAllErrors
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.metricAllErrors(props?: MetricOptions)
Metric for the number of Errors executing all Lambdas.
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
metricAllInvocations
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.metricAllInvocations(props?: MetricOptions)
Metric for the number of invocations of all Lambdas.
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
metricAllThrottles
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.metricAllThrottles(props?: MetricOptions)
Metric for the number of throttled invocations of all Lambdas.
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
metricAllUnreservedConcurrentExecutions
import { SnapStartFunction } from '@aws/pdk/type-safe-api'
SnapStartFunction.metricAllUnreservedConcurrentExecutions(props?: MetricOptions)
Metric for the number of unreserved concurrent executions across all Lambdas.
props
Optional
- Type: aws-cdk-lib.aws_cloudwatch.MetricOptions
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
architecture |
aws-cdk-lib.aws_lambda.Architecture |
The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64). |
connections |
aws-cdk-lib.aws_ec2.Connections |
Access the Connections object. |
functionArn |
string |
ARN of this function. |
functionName |
string |
Name of this function. |
grantPrincipal |
aws-cdk-lib.aws_iam.IPrincipal |
The principal this Lambda Function is running as. |
isBoundToVpc |
boolean |
Whether or not this Lambda function was bound to a VPC. |
latestVersion |
aws-cdk-lib.aws_lambda.IVersion |
The $LATEST version of this function. |
permissionsNode |
constructs.Node |
The construct node where permissions are attached. |
resourceArnsForGrantInvoke |
string[] |
The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke(). |
role |
aws-cdk-lib.aws_iam.IRole |
Execution role associated with this function. |
currentVersion |
aws-cdk-lib.aws_lambda.Version |
Returns a lambda.Version which represents the current version of this Lambda function. A new version will be created every time the function's configuration changes. |
logGroup |
aws-cdk-lib.aws_logs.ILogGroup |
The LogGroup where the Lambda function's logs are made available. |
runtime |
aws-cdk-lib.aws_lambda.Runtime |
The runtime configured for this lambda. |
deadLetterQueue |
aws-cdk-lib.aws_sqs.IQueue |
The DLQ (as queue) associated with this Lambda Function (this is an optional attribute). |
deadLetterTopic |
aws-cdk-lib.aws_sns.ITopic |
The DLQ (as topic) associated with this Lambda Function (this is an optional attribute). |
timeout |
aws-cdk-lib.Duration |
The timeout configured for this lambda. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
env
Required
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
stack
Required
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
architecture
Required
public readonly architecture: Architecture;
- Type: aws-cdk-lib.aws_lambda.Architecture
The architecture of this Lambda Function (this is an optional attribute and defaults to X86_64).
connections
Required
public readonly connections: Connections;
- Type: aws-cdk-lib.aws_ec2.Connections
Access the Connections object.
Will fail if not a VPC-enabled Lambda Function
functionArn
Required
public readonly functionArn: string;
- Type: string
ARN of this function.
functionName
Required
public readonly functionName: string;
- Type: string
Name of this function.
grantPrincipal
Required
public readonly grantPrincipal: IPrincipal;
- Type: aws-cdk-lib.aws_iam.IPrincipal
The principal this Lambda Function is running as.
isBoundToVpc
Required
public readonly isBoundToVpc: boolean;
- Type: boolean
Whether or not this Lambda function was bound to a VPC.
If this is is false
, trying to access the connections
object will fail.
latestVersion
Required
public readonly latestVersion: IVersion;
- Type: aws-cdk-lib.aws_lambda.IVersion
The $LATEST
version of this function.
Note that this is reference to a non-specific AWS Lambda version, which means the function this version refers to can return different results in different invocations.
To obtain a reference to an explicit version which references the current
function configuration, use lambdaFunction.currentVersion
instead.
permissionsNode
Required
public readonly permissionsNode: Node;
- Type: constructs.Node
The construct node where permissions are attached.
resourceArnsForGrantInvoke
Required
public readonly resourceArnsForGrantInvoke: string[];
- Type: string[]
The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke().
role
Optional
public readonly role: IRole;
- Type: aws-cdk-lib.aws_iam.IRole
Execution role associated with this function.
currentVersion
Required
public readonly currentVersion: Version;
- Type: aws-cdk-lib.aws_lambda.Version
Returns a lambda.Version
which represents the current version of this Lambda function. A new version will be created every time the function's configuration changes.
You can specify options for this version using the currentVersionOptions
prop when initializing the lambda.Function
.
logGroup
Required
public readonly logGroup: ILogGroup;
- Type: aws-cdk-lib.aws_logs.ILogGroup
The LogGroup where the Lambda function's logs are made available.
If either logRetention
is set or this property is called, a CloudFormation custom resource is added to the stack that
pre-creates the log group as part of the stack deployment, if it already doesn't exist, and sets the correct log retention
period (never expire, by default).
Further, if the log group already exists and the logRetention
is not set, the custom resource will reset the log retention
to never expire even if it was configured with a different value.
runtime
Required
public readonly runtime: Runtime;
- Type: aws-cdk-lib.aws_lambda.Runtime
The runtime configured for this lambda.
deadLetterQueue
Optional
public readonly deadLetterQueue: IQueue;
- Type: aws-cdk-lib.aws_sqs.IQueue
The DLQ (as queue) associated with this Lambda Function (this is an optional attribute).
deadLetterTopic
Optional
public readonly deadLetterTopic: ITopic;
- Type: aws-cdk-lib.aws_sns.ITopic
The DLQ (as topic) associated with this Lambda Function (this is an optional attribute).
timeout
Optional
public readonly timeout: Duration;
- Type: aws-cdk-lib.Duration
The timeout configured for this lambda.
TypeSafeApiAsyncModelBuild
Adds a task to convert the OpenAPI specification into an AsyncAPI specification, which can be used for documentation generation.
Initializers
import { TypeSafeApiAsyncModelBuild } from '@aws/pdk/type-safe-api'
new TypeSafeApiAsyncModelBuild(project: Project, options: TypeSafeApiAsyncModelBuildOptions)
Name | Type | Description |
---|---|---|
project |
projen.Project |
No description. |
options |
TypeSafeApiAsyncModelBuildOptions |
No description. |
project
Required
- Type: projen.Project
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
postSynthesize |
Called after synthesis. |
preSynthesize |
Called before synthesis. |
synthesize |
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 |
---|---|
isConstruct |
Checks if x is a construct. |
isComponent |
Test whether the given construct is a component. |
isConstruct
import { TypeSafeApiAsyncModelBuild } from '@aws/pdk/type-safe-api'
TypeSafeApiAsyncModelBuild.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 { TypeSafeApiAsyncModelBuild } from '@aws/pdk/type-safe-api'
TypeSafeApiAsyncModelBuild.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
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
TypeSafeApiModelBuild
Adds the build task for parsing/bundling an OpenAPI spec ready for use by code generation projects.
Initializers
import { TypeSafeApiModelBuild } from '@aws/pdk/type-safe-api'
new TypeSafeApiModelBuild(project: Project, options: TypeSafeApiModelBuildOptions)
Name | Type | Description |
---|---|---|
project |
projen.Project |
No description. |
options |
TypeSafeApiModelBuildOptions |
No description. |
project
Required
- Type: projen.Project
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
postSynthesize |
Called after synthesis. |
preSynthesize |
Called before synthesis. |
synthesize |
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 |
---|---|
isConstruct |
Checks if x is a construct. |
isComponent |
Test whether the given construct is a component. |
isConstruct
import { TypeSafeApiModelBuild } from '@aws/pdk/type-safe-api'
TypeSafeApiModelBuild.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 { TypeSafeApiModelBuild } from '@aws/pdk/type-safe-api'
TypeSafeApiModelBuild.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
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
TypeSafeApiProject
Project for a type-safe API, defined using Smithy or OpenAPI.
Generates a CDK construct to deploy your API, as well as client and server code to help build your API quickly.
Initializers
import { TypeSafeApiProject } from '@aws/pdk/type-safe-api'
new TypeSafeApiProject(options: TypeSafeApiProjectOptions)
Name | Type | Description |
---|---|---|
options |
TypeSafeApiProjectOptions |
No description. |
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Exclude these files from the bundled package. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Consider a set of files as "generated". |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
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
~~
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- Type: string
The message.
annotateGenerated
public annotateGenerated(_glob: string): void
Consider a set of files as "generated".
This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.
_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
~~
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.
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isProject |
Test whether the given construct is a project. |
of |
Find the closest ancestor project for given construct. |
isConstruct
import { TypeSafeApiProject } from '@aws/pdk/type-safe-api'
TypeSafeApiProject.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 { TypeSafeApiProject } from '@aws/pdk/type-safe-api'
TypeSafeApiProject.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { TypeSafeApiProject } from '@aws/pdk/type-safe-api'
TypeSafeApiProject.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 |
---|---|---|
node |
constructs.Node |
The tree node. |
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
all |
ProjectCollections |
Collections of all sub-projects managed by this project. |
documentation |
GeneratedDocumentationProjects |
Generated documentation projects. |
handlers |
GeneratedCodeProjects |
Lambda handlers projects. |
infrastructure |
GeneratedCodeProjects |
Generated infrastructure projects. |
library |
GeneratedLibraryProjects |
Generated library projects. |
model |
ModelProject |
Project for the api model. |
runtime |
GeneratedCodeProjects |
Generated runtime projects. |
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.
all
Required
public readonly all: ProjectCollections;
- Type: ProjectCollections
Collections of all sub-projects managed by this project.
documentation
Required
public readonly documentation: GeneratedDocumentationProjects;
Generated documentation projects.
Only the properties corresponding to specified documentation.formats
will be defined.
handlers
Required
public readonly handlers: GeneratedCodeProjects;
- Type: GeneratedCodeProjects
Lambda handlers projects.
Only the properties corresponding to handlers.languages
will be defined.
infrastructure
Required
public readonly infrastructure: GeneratedCodeProjects;
- Type: GeneratedCodeProjects
Generated infrastructure projects.
Only the property corresponding to infrastructure.language
will be defined.
library
Required
public readonly library: GeneratedLibraryProjects;
- Type: GeneratedLibraryProjects
Generated library projects.
Only the properties corresponding to specified library.libraries
will be defined.
model
Required
public readonly model: ModelProject;
- Type: ModelProject
Project for the api model.
runtime
Required
public readonly runtime: GeneratedCodeProjects;
- Type: GeneratedCodeProjects
Generated runtime projects.
When runtime.languages
includes the corresponding language, the project can be
assumed to be defined.
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
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.
TypeSafeRestApi
A construct for creating an api gateway rest api based on the definition in the OpenAPI spec.
Initializers
import { TypeSafeRestApi } from '@aws/pdk/type-safe-api'
new TypeSafeRestApi(scope: Construct, id: string, props: TypeSafeRestApiProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
TypeSafeRestApiProps |
No description. |
scope
Required
- Type: constructs.Construct
id
Required
- Type: string
props
Required
- Type: TypeSafeRestApiProps
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
toString
public toString(): string
Returns a string representation of this construct.
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isConstruct
import { TypeSafeRestApi } from '@aws/pdk/type-safe-api'
TypeSafeRestApi.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.
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
api |
aws-cdk-lib.aws_apigateway.SpecRestApi |
Underlying API Gateway API construct. |
extendedApiSpecification |
any |
The OpenAPI specification with applied API gateway extensions. |
ipSet |
aws-cdk-lib.aws_wafv2.CfnIPSet |
Reference to the IP set if created. |
webAcl |
aws-cdk-lib.aws_wafv2.CfnWebACL |
Reference to the webacl, if created. |
webAclAssociation |
aws-cdk-lib.aws_wafv2.CfnWebACLAssociation |
Reference to the web acl association if created. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
api
Required
public readonly api: SpecRestApi;
- Type: aws-cdk-lib.aws_apigateway.SpecRestApi
Underlying API Gateway API construct.
extendedApiSpecification
Required
public readonly extendedApiSpecification: any;
- Type: any
The OpenAPI specification with applied API gateway extensions.
ipSet
Optional
public readonly ipSet: CfnIPSet;
- Type: aws-cdk-lib.aws_wafv2.CfnIPSet
Reference to the IP set if created.
webAcl
Optional
public readonly webAcl: CfnWebACL;
- Type: aws-cdk-lib.aws_wafv2.CfnWebACL
Reference to the webacl, if created.
webAclAssociation
Optional
public readonly webAclAssociation: CfnWebACLAssociation;
- Type: aws-cdk-lib.aws_wafv2.CfnWebACLAssociation
Reference to the web acl association if created.
TypeSafeWebsocketApi
A construct for creating a websocket API, based on the provided spec and integrations.
Initializers
import { TypeSafeWebsocketApi } from '@aws/pdk/type-safe-api'
new TypeSafeWebsocketApi(scope: Construct, id: string, props: TypeSafeWebsocketApiProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
TypeSafeWebsocketApiProps |
No description. |
scope
Required
- Type: constructs.Construct
id
Required
- Type: string
props
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
toString
public toString(): string
Returns a string representation of this construct.
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isConstruct
import { TypeSafeWebsocketApi } from '@aws/pdk/type-safe-api'
TypeSafeWebsocketApi.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.
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
api |
aws-cdk-lib.aws_apigatewayv2.WebSocketApi |
Reference to the websocket API. |
defaultStage |
aws-cdk-lib.aws_apigatewayv2.WebSocketStage |
Reference to the default deploy stage. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
api
Required
public readonly api: WebSocketApi;
- Type: aws-cdk-lib.aws_apigatewayv2.WebSocketApi
Reference to the websocket API.
defaultStage
Required
public readonly defaultStage: WebSocketStage;
- Type: aws-cdk-lib.aws_apigatewayv2.WebSocketStage
Reference to the default deploy stage.
TypeSafeWebSocketApiProject
Project for a Type Safe WebSocket API, defined using Smithy or OpenAPI.
Generates a CDK construct to deploy your API, as well as client and server code to help build your API quickly.
Initializers
import { TypeSafeWebSocketApiProject } from '@aws/pdk/type-safe-api'
new TypeSafeWebSocketApiProject(options: TypeSafeWebSocketApiProjectOptions)
Name | Type | Description |
---|---|---|
options |
TypeSafeWebSocketApiProjectOptions |
No description. |
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Exclude these files from the bundled package. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Consider a set of files as "generated". |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
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
~~
public addTip(message: string): void
Prints a "tip" message during synthesis.
message
Required
- Type: string
The message.
annotateGenerated
public annotateGenerated(_glob: string): void
Consider a set of files as "generated".
This method is implemented by derived classes and used for example, to add git attributes to tell GitHub that certain files are generated.
_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
~~
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.
Static Functions
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isProject |
Test whether the given construct is a project. |
of |
Find the closest ancestor project for given construct. |
isConstruct
import { TypeSafeWebSocketApiProject } from '@aws/pdk/type-safe-api'
TypeSafeWebSocketApiProject.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 { TypeSafeWebSocketApiProject } from '@aws/pdk/type-safe-api'
TypeSafeWebSocketApiProject.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { TypeSafeWebSocketApiProject } from '@aws/pdk/type-safe-api'
TypeSafeWebSocketApiProject.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 |
---|---|---|
node |
constructs.Node |
The tree node. |
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
all |
ProjectCollections |
Collections of all sub-projects managed by this project. |
documentation |
GeneratedWebSocketDocumentationProjects |
Generated documentation projects. |
handlers |
GeneratedCodeProjects |
Lambda handlers projects. |
infrastructure |
GeneratedCodeProjects |
Generated infrastructure projects. |
library |
GeneratedWebSocketLibraryProjects |
Generated library projects. |
model |
WebSocketModelProject |
Project for the api model. |
runtime |
GeneratedCodeProjects |
Generated runtime projects. |
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.
all
Required
public readonly all: ProjectCollections;
- Type: ProjectCollections
Collections of all sub-projects managed by this project.
documentation
Required
public readonly documentation: GeneratedWebSocketDocumentationProjects;
Generated documentation projects.
Only the properties corresponding to specified documentation.formats
will be defined.
handlers
Required
public readonly handlers: GeneratedCodeProjects;
- Type: GeneratedCodeProjects
Lambda handlers projects.
Only the properties corresponding to handlers.languages
will be defined.
infrastructure
Required
public readonly infrastructure: GeneratedCodeProjects;
- Type: GeneratedCodeProjects
Generated infrastructure projects.
Only the property corresponding to infrastructure.language
will be defined.
library
Required
public readonly library: GeneratedWebSocketLibraryProjects;
Generated library projects.
Only the properties corresponding to specified library.libraries
will be defined.
model
Required
public readonly model: WebSocketModelProject;
- Type: WebSocketModelProject
Project for the api model.
runtime
Required
public readonly runtime: GeneratedCodeProjects;
- Type: GeneratedCodeProjects
Generated runtime projects.
When runtime.languages
includes the corresponding language, the project can be
assumed to be defined.
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
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.
TypeSpecAsyncDefinition
The TypeSpec model definition for an async api.
Initializers
import { TypeSpecAsyncDefinition } from '@aws/pdk/type-safe-api'
new TypeSpecAsyncDefinition(project: NodeProject, options: TypeSpecAsyncDefinitionOptions)
Name | Type | Description |
---|---|---|
project |
projen.javascript.NodeProject |
No description. |
options |
TypeSpecAsyncDefinitionOptions |
No description. |
project
Required
- Type: projen.javascript.NodeProject
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
postSynthesize |
Called after synthesis. |
preSynthesize |
Called before synthesis. |
synthesize |
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 |
---|---|
isConstruct |
Checks if x is a construct. |
isComponent |
Test whether the given construct is a component. |
isConstruct
import { TypeSpecAsyncDefinition } from '@aws/pdk/type-safe-api'
TypeSpecAsyncDefinition.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 { TypeSpecAsyncDefinition } from '@aws/pdk/type-safe-api'
TypeSpecAsyncDefinition.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
projen.Project |
No description. |
openApiSpecificationPath |
string |
Path to the generated OpenAPI specification. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
openApiSpecificationPath
Required
public readonly openApiSpecificationPath: string;
- Type: string
Path to the generated OpenAPI specification.
TypeSpecAsyncModelProject
Model project for defining a WebSocket API in TypeSpec.
Initializers
import { TypeSpecAsyncModelProject } from '@aws/pdk/type-safe-api'
new TypeSpecAsyncModelProject(options: TypeSpecAsyncModelProjectOptions)
Name | Type | Description |
---|---|---|
options |
TypeSpecAsyncModelProjectOptions |
No description. |
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Adds patterns to be ignored by npm. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Marks the provided file(s) as being generated. |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
addBins |
No description. |
addBundledDeps |
Defines bundled dependencies. |
addCompileCommand |
DEPRECATED. |
addDeps |
Defines normal dependencies. |
addDevDeps |
Defines development/test dependencies. |
addFields |
Directly set fields in package.json . |
addKeywords |
Adds keywords to package.json (deduplicated). |
addPeerDeps |
Defines peer dependencies. |
addScripts |
Replaces the contents of multiple npm package.json scripts. |
addTestCommand |
DEPRECATED. |
hasScript |
Indicates if a script by the name name is defined. |
removeScript |
Removes the npm script (always successful). |
renderWorkflowSetup |
Returns the set of workflow steps which should be executed to bootstrap a workflow. |
setScript |
Replaces the contents of an npm package.json script. |
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
~~
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
~~
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
~~
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
~~
public addTestCommand(commands: string): void
DEPRECATED.
commands
Required
- Type: string
~~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 |
---|---|
isConstruct |
Checks if x is a construct. |
isProject |
Test whether the given construct is a project. |
of |
Find the closest ancestor project for given construct. |
isConstruct
import { TypeSpecAsyncModelProject } from '@aws/pdk/type-safe-api'
TypeSpecAsyncModelProject.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 { TypeSpecAsyncModelProject } from '@aws/pdk/type-safe-api'
TypeSpecAsyncModelProject.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { TypeSpecAsyncModelProject } from '@aws/pdk/type-safe-api'
TypeSpecAsyncModelProject.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 |
---|---|---|
node |
constructs.Node |
The tree node. |
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
projectType |
projen.ProjectType |
No description. |
autoApprove |
projen.github.AutoApprove |
Auto approve set up for this project. |
devContainer |
projen.vscode.DevContainer |
Access for .devcontainer.json (used for GitHub Codespaces). |
github |
projen.github.GitHub |
Access all github components. |
gitpod |
projen.Gitpod |
Access for Gitpod. |
vscode |
projen.vscode.VsCode |
Access all VSCode components. |
allowLibraryDependencies |
boolean |
No description. |
artifactsDirectory |
string |
The build output directory. |
artifactsJavascriptDirectory |
string |
The location of the npm tarball after build (${artifactsDirectory}/js ). |
bundler |
projen.javascript.Bundler |
No description. |
entrypoint |
string |
No description. |
manifest |
any |
No description. |
npmrc |
projen.javascript.NpmConfig |
The .npmrc file. |
package |
projen.javascript.NodePackage |
API for managing the node package. |
packageManager |
projen.javascript.NodePackageManager |
The package manager to use. |
runScriptCommand |
string |
The command to use to run scripts (e.g. yarn run or npm run depends on the package manager). |
autoMerge |
projen.github.AutoMerge |
Component that sets up mergify for merging approved pull requests. |
buildWorkflow |
projen.build.BuildWorkflow |
The PR build GitHub workflow. |
buildWorkflowJobId |
string |
The job ID of the build workflow. |
jest |
projen.javascript.Jest |
The Jest configuration (if enabled). |
maxNodeVersion |
string |
Maximum node version required by this package. |
minNodeVersion |
string |
Minimum node.js version required by this package. |
npmignore |
projen.IgnoreFile |
The .npmignore file. |
prettier |
projen.javascript.Prettier |
No description. |
publisher |
projen.release.Publisher |
Package publisher. |
release |
projen.release.Release |
Release management. |
upgradeWorkflow |
projen.javascript.UpgradeDependencies |
The upgrade workflow. |
apiName |
string |
No description. |
definition |
TypeSpecAsyncDefinition |
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
- 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
- Deprecated: use
package.entrypoint
public readonly entrypoint: string;
- Type: string
~~manifest
~~Required
- 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
- 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 required by this package.
minNodeVersion
Optional
public readonly minNodeVersion: string;
- Type: string
Minimum node.js version required by this package.
npmignore
Optional
public readonly npmignore: IgnoreFile;
- Type: projen.IgnoreFile
The .npmignore file.
prettier
Optional
public readonly prettier: Prettier;
- Type: projen.javascript.Prettier
~~publisher
~~Optional
- 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.
apiName
Required
public readonly apiName: string;
- Type: string
definition
Required
public readonly definition: TypeSpecAsyncDefinition;
- Type: TypeSpecAsyncDefinition
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
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.
TypeSpecDefinition
The TypeSpec model definition.
Initializers
import { TypeSpecDefinition } from '@aws/pdk/type-safe-api'
new TypeSpecDefinition(project: NodeProject, options: TypeSpecDefinitionOptions)
Name | Type | Description |
---|---|---|
project |
projen.javascript.NodeProject |
No description. |
options |
TypeSpecDefinitionOptions |
No description. |
project
Required
- Type: projen.javascript.NodeProject
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
postSynthesize |
Called after synthesis. |
preSynthesize |
Called before synthesis. |
synthesize |
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 |
---|---|
isConstruct |
Checks if x is a construct. |
isComponent |
Test whether the given construct is a component. |
isConstruct
import { TypeSpecDefinition } from '@aws/pdk/type-safe-api'
TypeSpecDefinition.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 { TypeSpecDefinition } from '@aws/pdk/type-safe-api'
TypeSpecDefinition.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
projen.Project |
No description. |
openApiSpecificationPath |
string |
Path to the generated OpenAPI specification. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
openApiSpecificationPath
Required
public readonly openApiSpecificationPath: string;
- Type: string
Path to the generated OpenAPI specification.
TypeSpecModelProject
Model project for defining a REST API in TypeSpec.
Initializers
import { TypeSpecModelProject } from '@aws/pdk/type-safe-api'
new TypeSpecModelProject(options: TypeSpecModelProjectOptions)
Name | Type | Description |
---|---|---|
options |
TypeSpecModelProjectOptions |
No description. |
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Adds patterns to be ignored by npm. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Marks the provided file(s) as being generated. |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
addBins |
No description. |
addBundledDeps |
Defines bundled dependencies. |
addCompileCommand |
DEPRECATED. |
addDeps |
Defines normal dependencies. |
addDevDeps |
Defines development/test dependencies. |
addFields |
Directly set fields in package.json . |
addKeywords |
Adds keywords to package.json (deduplicated). |
addPeerDeps |
Defines peer dependencies. |
addScripts |
Replaces the contents of multiple npm package.json scripts. |
addTestCommand |
DEPRECATED. |
hasScript |
Indicates if a script by the name name is defined. |
removeScript |
Removes the npm script (always successful). |
renderWorkflowSetup |
Returns the set of workflow steps which should be executed to bootstrap a workflow. |
setScript |
Replaces the contents of an npm package.json script. |
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
~~
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
~~
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
~~
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
~~
public addTestCommand(commands: string): void
DEPRECATED.
commands
Required
- Type: string
~~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 |
---|---|
isConstruct |
Checks if x is a construct. |
isProject |
Test whether the given construct is a project. |
of |
Find the closest ancestor project for given construct. |
isConstruct
import { TypeSpecModelProject } from '@aws/pdk/type-safe-api'
TypeSpecModelProject.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 { TypeSpecModelProject } from '@aws/pdk/type-safe-api'
TypeSpecModelProject.isProject(x: any)
Test whether the given construct is a project.
x
Required
- Type: any
of
import { TypeSpecModelProject } from '@aws/pdk/type-safe-api'
TypeSpecModelProject.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 |
---|---|---|
node |
constructs.Node |
The tree node. |
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
projectType |
projen.ProjectType |
No description. |
autoApprove |
projen.github.AutoApprove |
Auto approve set up for this project. |
devContainer |
projen.vscode.DevContainer |
Access for .devcontainer.json (used for GitHub Codespaces). |
github |
projen.github.GitHub |
Access all github components. |
gitpod |
projen.Gitpod |
Access for Gitpod. |
vscode |
projen.vscode.VsCode |
Access all VSCode components. |
allowLibraryDependencies |
boolean |
No description. |
artifactsDirectory |
string |
The build output directory. |
artifactsJavascriptDirectory |
string |
The location of the npm tarball after build (${artifactsDirectory}/js ). |
bundler |
projen.javascript.Bundler |
No description. |
entrypoint |
string |
No description. |
manifest |
any |
No description. |
npmrc |
projen.javascript.NpmConfig |
The .npmrc file. |
package |
projen.javascript.NodePackage |
API for managing the node package. |
packageManager |
projen.javascript.NodePackageManager |
The package manager to use. |
runScriptCommand |
string |
The command to use to run scripts (e.g. yarn run or npm run depends on the package manager). |
autoMerge |
projen.github.AutoMerge |
Component that sets up mergify for merging approved pull requests. |
buildWorkflow |
projen.build.BuildWorkflow |
The PR build GitHub workflow. |
buildWorkflowJobId |
string |
The job ID of the build workflow. |
jest |
projen.javascript.Jest |
The Jest configuration (if enabled). |
maxNodeVersion |
string |
Maximum node version required by this package. |
minNodeVersion |
string |
Minimum node.js version required by this package. |
npmignore |
projen.IgnoreFile |
The .npmignore file. |
prettier |
projen.javascript.Prettier |
No description. |
publisher |
projen.release.Publisher |
Package publisher. |
release |
projen.release.Release |
Release management. |
upgradeWorkflow |
projen.javascript.UpgradeDependencies |
The upgrade workflow. |
apiName |
string |
No description. |
definition |
TypeSpecDefinition |
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
- 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
- Deprecated: use
package.entrypoint
public readonly entrypoint: string;
- Type: string
~~manifest
~~Required
- 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
- 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 required by this package.
minNodeVersion
Optional
public readonly minNodeVersion: string;
- Type: string
Minimum node.js version required by this package.
npmignore
Optional
public readonly npmignore: IgnoreFile;
- Type: projen.IgnoreFile
The .npmignore file.
prettier
Optional
public readonly prettier: Prettier;
- Type: projen.javascript.Prettier
~~publisher
~~Optional
- 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.
apiName
Required
public readonly apiName: string;
- Type: string
definition
Required
public readonly definition: TypeSpecDefinition;
- Type: TypeSpecDefinition
Constants
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
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.
TypeSpecProjectDefinition
Creates a project which allows APIs to be defined in TypeSpec.
Initializers
import { TypeSpecProjectDefinition } from '@aws/pdk/type-safe-api'
new TypeSpecProjectDefinition(project: NodeProject, options: TypeSpecProjectDefinitionOptions)
Name | Type | Description |
---|---|---|
project |
projen.javascript.NodeProject |
No description. |
options |
TypeSpecProjectDefinitionOptions |
No description. |
project
Required
- Type: projen.javascript.NodeProject
options
Required
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
postSynthesize |
Called after synthesis. |
preSynthesize |
Called before synthesis. |
synthesize |
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 |
---|---|
isConstruct |
Checks if x is a construct. |
isComponent |
Test whether the given construct is a component. |
isConstruct
import { TypeSpecProjectDefinition } from '@aws/pdk/type-safe-api'
TypeSpecProjectDefinition.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 { TypeSpecProjectDefinition } from '@aws/pdk/type-safe-api'
TypeSpecProjectDefinition.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
project |
projen.Project |
No description. |
openApiSpecificationPath |
string |
Path to the generated OpenAPI specification. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
openApiSpecificationPath
Required
public readonly openApiSpecificationPath: string;
- Type: string
Path to the generated OpenAPI specification.
Structs
ApiGatewayIntegration
Represents an api gateway integration.
Initializer
import { ApiGatewayIntegration } from '@aws/pdk/type-safe-api'
const apiGatewayIntegration: ApiGatewayIntegration = { ... }
Properties
Name | Type | Description |
---|---|---|
cacheKeyParameters |
string[] |
A list of request parameters whose values are to be cached. |
cacheNamespace |
string |
An API-specific tag group of related cached parameters. |
connectionId |
string |
The ID of a VpcLink for the private integration. |
connectionType |
string |
The integration connection type. |
contentHandling |
string |
Request payload encoding conversion types. |
credentials |
string |
For AWS IAM role-based credentials, specify the ARN of an appropriate IAM role. |
httpMethod |
string |
The HTTP method used in the integration request. |
passthroughBehavior |
string |
Specifies how a request payload of unmapped content type is passed through the integration request without modification. |
requestParameters |
{[ key: string ]: string} |
Specifies mappings from method request parameters to integration request parameters. |
requestTemplates |
{[ key: string ]: string} |
Mapping templates for a request payload of specified MIME types. |
responses |
{[ key: string ]: ApiGatewayIntegrationResponse} |
Defines the method's responses and specifies desired parameter mappings or payload mappings from integration responses to method responses. |
timeoutInMillis |
number |
Custom timeout between 50 and 29,000 milliseconds. |
tlsConfig |
ApiGatewayIntegrationTlsConfig |
Specifies the TLS configuration for an integration. |
type |
string |
The type of integration with the specified backend. |
uri |
string |
The endpoint URI of the backend. |
cacheKeyParameters
Optional
public readonly cacheKeyParameters: string[];
- Type: string[]
A list of request parameters whose values are to be cached.
cacheNamespace
Optional
public readonly cacheNamespace: string;
- Type: string
An API-specific tag group of related cached parameters.
connectionId
Optional
public readonly connectionId: string;
- Type: string
The ID of a VpcLink for the private integration.
https://docs.aws.amazon.com/apigateway/latest/api/API_VpcLink.html
connectionType
Optional
public readonly connectionType: string;
- Type: string
The integration connection type.
The valid value is "VPC_LINK" for private integration or "INTERNET", otherwise.
contentHandling
Optional
public readonly contentHandling: string;
- Type: string
Request payload encoding conversion types.
Valid values are 1) CONVERT_TO_TEXT, for converting a binary payload into a base64-encoded string or converting a text payload into a utf-8-encoded string or passing through the text payload natively without modification, and 2) CONVERT_TO_BINARY, for converting a text payload into a base64-decoded blob or passing through a binary payload natively without modification.
credentials
Optional
public readonly credentials: string;
- Type: string
For AWS IAM role-based credentials, specify the ARN of an appropriate IAM role.
If unspecified, credentials default to resource-based permissions that must be added manually to allow the API to access the resource. For more information, see Granting Permissions Using a Resource Policy.
Note: When using IAM credentials, make sure that AWS STS Regional endpoints are enabled for the Region where this API is deployed for best performance.
httpMethod
Optional
public readonly httpMethod: string;
- Type: string
The HTTP method used in the integration request.
For Lambda function invocations, the value must be POST.
passthroughBehavior
Optional
public readonly passthroughBehavior: string;
- Type: string
Specifies how a request payload of unmapped content type is passed through the integration request without modification.
Supported values are when_no_templates, when_no_match, and never.
https://docs.aws.amazon.com/apigateway/latest/api/API_Integration.html#passthroughBehavior
requestParameters
Optional
public readonly requestParameters: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Specifies mappings from method request parameters to integration request parameters.
Supported request parameters are querystring, path, header, and body.
requestTemplates
Optional
public readonly requestTemplates: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Mapping templates for a request payload of specified MIME types.
responses
Optional
public readonly responses: {[ key: string ]: ApiGatewayIntegrationResponse};
- Type: {[ key: string ]: ApiGatewayIntegrationResponse}
Defines the method's responses and specifies desired parameter mappings or payload mappings from integration responses to method responses.
timeoutInMillis
Optional
public readonly timeoutInMillis: number;
- Type: number
Custom timeout between 50 and 29,000 milliseconds.
The default value is 29,000 milliseconds or 29 seconds.
tlsConfig
Optional
public readonly tlsConfig: ApiGatewayIntegrationTlsConfig;
Specifies the TLS configuration for an integration.
type
Optional
public readonly type: string;
- Type: string
The type of integration with the specified backend.
https://docs.aws.amazon.com/apigateway/latest/api/API_Integration.html#type
uri
Optional
public readonly uri: string;
- Type: string
The endpoint URI of the backend.
For integrations of the aws type, this is an ARN value. For the HTTP integration, this is the URL of the HTTP endpoint including the https or http scheme.
ApiGatewayIntegrationResponse
API Gateway integration response.
https://docs.aws.amazon.com/apigateway/latest/api/API_Integration.html
Initializer
import { ApiGatewayIntegrationResponse } from '@aws/pdk/type-safe-api'
const apiGatewayIntegrationResponse: ApiGatewayIntegrationResponse = { ... }
Properties
Name | Type | Description |
---|---|---|
responseParameters |
{[ key: string ]: string} |
Specifies parameter mappings for the response. |
responseTemplates |
{[ key: string ]: string} |
Specifies MIME type-specific mapping templates for the response’s payload. |
statusCode |
string |
HTTP status code for the method response. |
contentHandling |
string |
Response payload encoding conversion types. |
responseParameters
Required
public readonly responseParameters: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Specifies parameter mappings for the response.
responseTemplates
Required
public readonly responseTemplates: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Specifies MIME type-specific mapping templates for the response’s payload.
statusCode
Required
public readonly statusCode: string;
- Type: string
HTTP status code for the method response.
contentHandling
Optional
public readonly contentHandling: string;
- Type: string
Response payload encoding conversion types.
Valid values are 1) CONVERT_TO_TEXT, for converting a binary payload into a base64-encoded string or converting a text payload into a utf-8-encoded string or passing through the text payload natively without modification, and 2) CONVERT_TO_BINARY, for converting a text payload into a base64-decoded blob or passing through a binary payload natively without modification.
ApiGatewayIntegrationTlsConfig
Specifies the TLS configuration for an integration.
Initializer
import { ApiGatewayIntegrationTlsConfig } from '@aws/pdk/type-safe-api'
const apiGatewayIntegrationTlsConfig: ApiGatewayIntegrationTlsConfig = { ... }
Properties
Name | Type | Description |
---|---|---|
insecureSkipVerification |
boolean |
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority. |
insecureSkipVerification
Optional
public readonly insecureSkipVerification: boolean;
- Type: boolean
Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a supported certificate authority.
This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for HTTP and HTTP_PROXY integrations.
ApiKeyOptions
Options for API keys.
Initializer
import { ApiKeyOptions } from '@aws/pdk/type-safe-api'
const apiKeyOptions: ApiKeyOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
source |
aws-cdk-lib.aws_apigateway.ApiKeySourceType |
Source type for an API key. |
requiredByDefault |
boolean |
Set to true to require an API key on all operations by default. |
source
Required
public readonly source: ApiKeySourceType;
- Type: aws-cdk-lib.aws_apigateway.ApiKeySourceType
Source type for an API key.
requiredByDefault
Optional
public readonly requiredByDefault: boolean;
- Type: boolean
Set to true to require an API key on all operations by default.
Only applicable when the source is HEADER.
AuthorizerProps
Properties for an authorizer.
Initializer
import { AuthorizerProps } from '@aws/pdk/type-safe-api'
const authorizerProps: AuthorizerProps = { ... }
Properties
Name | Type | Description |
---|---|---|
authorizationType |
aws-cdk-lib.aws_apigateway.AuthorizationType |
The type of the authorizer. |
authorizerId |
string |
The unique identifier for the authorizer. |
authorizationScopes |
string[] |
Scopes for the authorizer, if any. |
authorizationType
Required
public readonly authorizationType: AuthorizationType;
- Type: aws-cdk-lib.aws_apigateway.AuthorizationType
The type of the authorizer.
authorizerId
Required
public readonly authorizerId: string;
- Type: string
The unique identifier for the authorizer.
authorizationScopes
Optional
public readonly authorizationScopes: string[];
- Type: string[]
Scopes for the authorizer, if any.
CidrAllowList
Representation of a CIDR range.
Initializer
import { CidrAllowList } from '@aws/pdk/type-safe-api'
const cidrAllowList: CidrAllowList = { ... }
Properties
Name | Type | Description |
---|---|---|
cidrRanges |
string[] |
Specify an IPv4 address by using CIDR notation. |
cidrType |
string |
Type of CIDR range. |
cidrRanges
Required
public readonly cidrRanges: string[];
- Type: string[]
Specify an IPv4 address by using CIDR notation.
For example: To configure AWS WAF to allow, block, or count requests that originated from the IP address 192.0.2.44, specify 192.0.2.44/32 . To configure AWS WAF to allow, block, or count requests that originated from IP addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24 .
For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .
Specify an IPv6 address by using CIDR notation. For example: To configure AWS WAF to allow, block, or count requests that originated from the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify 1111:0000:0000:0000:0000:0000:0000:0111/128 . To configure AWS WAF to allow, block, or count requests that originated from IP addresses 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64 .
cidrType
Required
public readonly cidrType: string;
- Type: string
Type of CIDR range.
CodeGenerationSourceOptions
Options for the source files used for code generation.
Initializer
import { CodeGenerationSourceOptions } from '@aws/pdk/type-safe-api'
const codeGenerationSourceOptions: CodeGenerationSourceOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
specPath |
string |
Path to the OpenAPI specification. |
specPath
Required
public readonly specPath: string;
- Type: string
Path to the OpenAPI specification.
CognitoAuthorizerProps
Properties used to configure a cognito authorizer.
Initializer
import { CognitoAuthorizerProps } from '@aws/pdk/type-safe-api'
const cognitoAuthorizerProps: CognitoAuthorizerProps = { ... }
Properties
Name | Type | Description |
---|---|---|
authorizerId |
string |
Unique identifier for this authorizer. |
userPools |
aws-cdk-lib.aws_cognito.IUserPool[] |
The Cognito user pools associated with this authorizer. |
authorizationScopes |
string[] |
A list of authorization scopes configured on the method. |
authorizerId
Required
public readonly authorizerId: string;
- Type: string
Unique identifier for this authorizer.
userPools
Required
public readonly userPools: IUserPool[];
- Type: aws-cdk-lib.aws_cognito.IUserPool[]
The Cognito user pools associated with this authorizer.
authorizationScopes
Optional
public readonly authorizationScopes: string[];
- Type: string[]
- Default: []
A list of authorization scopes configured on the method.
When used as the default authorizer, these scopes will be applied to all methods without an authorizer at the integration level.
CustomAuthorizerProps
Properties used to configure a custom authorizer.
Initializer
import { CustomAuthorizerProps } from '@aws/pdk/type-safe-api'
const customAuthorizerProps: CustomAuthorizerProps = { ... }
Properties
Name | Type | Description |
---|---|---|
authorizerId |
string |
Unique identifier for this authorizer. |
function |
aws-cdk-lib.aws_lambda.IFunction |
The lambda function used to authorize requests. |
authorizerResultTtlInSeconds |
number |
The number of seconds during which the authorizer result is cached. |
identitySource |
string |
The source of the identity in an incoming request. |
type |
CustomAuthorizerType |
The type of custom authorizer. |
authorizerId
Required
public readonly authorizerId: string;
- Type: string
Unique identifier for this authorizer.
function
Required
public readonly function: IFunction;
- Type: aws-cdk-lib.aws_lambda.IFunction
The lambda function used to authorize requests.
authorizerResultTtlInSeconds
Optional
public readonly authorizerResultTtlInSeconds: number;
- Type: number
- Default: 300
The number of seconds during which the authorizer result is cached.
identitySource
Optional
public readonly identitySource: string;
- Type: string
- Default: "method.request.header.Authorization"
The source of the identity in an incoming request.
type
Optional
public readonly type: CustomAuthorizerType;
- Type: CustomAuthorizerType
- Default: CustomAuthorizerType.TOKEN
The type of custom authorizer.
CustomIntegrationResponseSetProps
Properties for a custom integration response set.
Initializer
import { CustomIntegrationResponseSetProps } from '@aws/pdk/type-safe-api'
const customIntegrationResponseSetProps: CustomIntegrationResponseSetProps = { ... }
Properties
Name | Type | Description |
---|---|---|
responses |
{[ key: string ]: ApiGatewayIntegrationResponse} |
The responses to add to the integration response. |
responses
Optional
public readonly responses: {[ key: string ]: ApiGatewayIntegrationResponse};
- Type: {[ key: string ]: ApiGatewayIntegrationResponse}
The responses to add to the integration response.
DefaultPassthroughIntegrationResponseSetProps
Options for the DefaultPassthroughIntegrationResponseSet.
Initializer
import { DefaultPassthroughIntegrationResponseSetProps } from '@aws/pdk/type-safe-api'
const defaultPassthroughIntegrationResponseSetProps: DefaultPassthroughIntegrationResponseSetProps = { ... }
Properties
Name | Type | Description |
---|---|---|
statusCode |
number |
Override the status code returned by the default integration response. |
statusCode
Optional
public readonly statusCode: number;
- Type: number
- Default: 200
Override the status code returned by the default integration response.
DocumentationConfiguration
Configuration for generated documentation.
Initializer
import { DocumentationConfiguration } from '@aws/pdk/type-safe-api'
const documentationConfiguration: DocumentationConfiguration = { ... }
Properties
Name | Type | Description |
---|---|---|
formats |
DocumentationFormat[] |
Formats for generated documentation. |
options |
GeneratedDocumentationOptions |
Options for the generated documentation projects. |
formats
Required
public readonly formats: DocumentationFormat[];
- Type: DocumentationFormat[]
Formats for generated documentation.
options
Optional
public readonly options: GeneratedDocumentationOptions;
Options for the generated documentation projects.
Note that only those provided for the specified formats will apply
GeneratedAsyncApiHtmlDocumentationOptions
Options for the async api html documentation project.
Initializer
import { GeneratedAsyncApiHtmlDocumentationOptions } from '@aws/pdk/type-safe-api'
const generatedAsyncApiHtmlDocumentationOptions: GeneratedAsyncApiHtmlDocumentationOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
commitGeneratedCode |
boolean |
Whether to commit the code generated by the OpenAPI Generator. |
commitGeneratedCode
Optional
public readonly commitGeneratedCode: boolean;
- Type: boolean
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
GeneratedAsyncApiMarkdownDocumentationOptions
Options for the async api markdown documentation project.
Initializer
import { GeneratedAsyncApiMarkdownDocumentationOptions } from '@aws/pdk/type-safe-api'
const generatedAsyncApiMarkdownDocumentationOptions: GeneratedAsyncApiMarkdownDocumentationOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
commitGeneratedCode |
boolean |
Whether to commit the code generated by the OpenAPI Generator. |
commitGeneratedCode
Optional
public readonly commitGeneratedCode: boolean;
- Type: boolean
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
GeneratedCodeProjects
Generated code projects.
Initializer
import { GeneratedCodeProjects } from '@aws/pdk/type-safe-api'
const generatedCodeProjects: GeneratedCodeProjects = { ... }
Properties
Name | Type | Description |
---|---|---|
java |
projen.java.JavaProject |
Generated java project. |
python |
projen.python.PythonProject |
Generated python project. |
typescript |
projen.typescript.TypeScriptProject |
Generated typescript project. |
java
Optional
public readonly java: JavaProject;
- Type: projen.java.JavaProject
Generated java project.
python
Optional
public readonly python: PythonProject;
- Type: projen.python.PythonProject
Generated python project.
typescript
Optional
public readonly typescript: TypeScriptProject;
- Type: projen.typescript.TypeScriptProject
Generated typescript project.
GeneratedDocumentationOptions
Options for generated documentation projects.
Initializer
import { GeneratedDocumentationOptions } from '@aws/pdk/type-safe-api'
const generatedDocumentationOptions: GeneratedDocumentationOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
htmlRedoc |
GeneratedHtmlRedocDocumentationOptions |
Generated html redoc documentation project options. |
markdown |
GeneratedMarkdownDocumentationOptions |
Generated markdown documentation project options. |
plantuml |
GeneratedPlantumlDocumentationOptions |
Generated plantuml documentation project options. |
htmlRedoc
Optional
public readonly htmlRedoc: GeneratedHtmlRedocDocumentationOptions;
Generated html redoc documentation project options.
markdown
Optional
public readonly markdown: GeneratedMarkdownDocumentationOptions;
Generated markdown documentation project options.
plantuml
Optional
public readonly plantuml: GeneratedPlantumlDocumentationOptions;
Generated plantuml documentation project options.
GeneratedDocumentationProjects
Generated documentation project references.
Initializer
import { GeneratedDocumentationProjects } from '@aws/pdk/type-safe-api'
const generatedDocumentationProjects: GeneratedDocumentationProjects = { ... }
Properties
Name | Type | Description |
---|---|---|
htmlRedoc |
projen.Project |
Generated html redoc documentation project. |
markdown |
projen.Project |
Generated markdown documentation project. |
plantuml |
projen.Project |
Generated plantuml documentation project. |
htmlRedoc
Optional
public readonly htmlRedoc: Project;
- Type: projen.Project
Generated html redoc documentation project.
markdown
Optional
public readonly markdown: Project;
- Type: projen.Project
Generated markdown documentation project.
plantuml
Optional
public readonly plantuml: Project;
- Type: projen.Project
Generated plantuml documentation project.
GeneratedHandlersCodeOptions
Options for lambda handler projects for implementing API operations.
Initializer
import { GeneratedHandlersCodeOptions } from '@aws/pdk/type-safe-api'
const generatedHandlersCodeOptions: GeneratedHandlersCodeOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
java |
GeneratedJavaHandlersOptions |
Options for the java handlers project. |
python |
GeneratedPythonHandlersOptions |
Options for the python handlers project. |
typescript |
GeneratedTypeScriptHandlersOptions |
Options for the typescript handlers project. |
java
Optional
public readonly java: GeneratedJavaHandlersOptions;
Options for the java handlers project.
These override the default inferred options.
python
Optional
public readonly python: GeneratedPythonHandlersOptions;
Options for the python handlers project.
These override the default inferred options.
typescript
Optional
public readonly typescript: GeneratedTypeScriptHandlersOptions;
Options for the typescript handlers project.
These override the default inferred options.
GeneratedHtml2DocumentationOptions
Options for the html2 documentation project.
Initializer
import { GeneratedHtml2DocumentationOptions } from '@aws/pdk/type-safe-api'
const generatedHtml2DocumentationOptions: GeneratedHtml2DocumentationOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
commitGeneratedCode |
boolean |
Whether to commit the code generated by the OpenAPI Generator. |
commitGeneratedCode
Optional
public readonly commitGeneratedCode: boolean;
- Type: boolean
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
GeneratedHtmlRedocDocumentationOptions
Options for the html redoc documentation project.
Initializer
import { GeneratedHtmlRedocDocumentationOptions } from '@aws/pdk/type-safe-api'
const generatedHtmlRedocDocumentationOptions: GeneratedHtmlRedocDocumentationOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
commitGeneratedCode |
boolean |
Whether to commit the code generated by the OpenAPI Generator. |
commitGeneratedCode
Optional
public readonly commitGeneratedCode: boolean;
- Type: boolean
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
GeneratedInfrastructureCodeOptions
Options for generated infrastructure.
Initializer
import { GeneratedInfrastructureCodeOptions } from '@aws/pdk/type-safe-api'
const generatedInfrastructureCodeOptions: GeneratedInfrastructureCodeOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
java |
GeneratedJavaInfrastructureOptions |
Options for the generated java infrastructure project. |
python |
GeneratedPythonInfrastructureOptions |
Options for the generated python infrastructure project. |
typescript |
GeneratedTypeScriptInfrastructureOptions |
Options for the generated typescript infrastructure project. |
java
Optional
public readonly java: GeneratedJavaInfrastructureOptions;
Options for the generated java infrastructure project.
These override the default inferred options.
python
Optional
public readonly python: GeneratedPythonInfrastructureOptions;
Options for the generated python infrastructure project.
These override the default inferred options.
typescript
Optional
public readonly typescript: GeneratedTypeScriptInfrastructureOptions;
Options for the generated typescript infrastructure project.
These override the default inferred options.
GeneratedJavaHandlersOptions
Options for configuring a generated java handlers project.
Initializer
import { GeneratedJavaHandlersOptions } from '@aws/pdk/type-safe-api'
const generatedJavaHandlersOptions: GeneratedJavaHandlersOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
artifactId |
string |
The artifactId is generally the name that the project is known by. |
autoApproveOptions |
projen.github.AutoApproveOptions |
Enable and configure the 'auto approve' workflow. |
autoMerge |
boolean |
Enable automatic merging on GitHub. |
autoMergeOptions |
projen.github.AutoMergeOptions |
Configure options for automatic merging on GitHub. |
clobber |
boolean |
Add a clobber task which resets the repo to origin. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileOptions |
projen.java.MavenCompileOptions |
Compile options. |
deps |
string[] |
List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver> . |
description |
string |
Description of a project is always good. |
devContainer |
boolean |
Add a VSCode development environment (used for GitHub Codespaces). |
distdir |
string |
Final artifact output directory. |
github |
boolean |
Enable GitHub integration. |
githubOptions |
projen.github.GitHubOptions |
Options for GitHub integration. |
gitIgnoreOptions |
projen.IgnoreFileOptions |
Configuration options for .gitignore file. |
gitOptions |
projen.GitOptions |
Configuration options for git. |
gitpod |
boolean |
Add a Gitpod development environment. |
groupId |
string |
This is generally unique amongst an organization or a project. |
junit |
boolean |
Include junit tests. |
junitOptions |
projen.java.JunitOptions |
junit options. |
logging |
projen.LoggerOptions |
Configure logging options such as verbosity. |
mergify |
boolean |
Whether mergify should be enabled on this repository or not. |
mergifyOptions |
projen.github.MergifyOptions |
Options for mergify. |
name |
string |
This is the name of your project. |
outdir |
string |
The root directory of the project. Relative to this directory, all files are synthesized. |
packaging |
string |
Project packaging format. |
packagingOptions |
projen.java.MavenPackagingOptions |
Packaging options. |
parent |
projen.Project |
The parent project, if this project is part of a bigger project. |
parentPom |
projen.java.ParentPom |
A Parent Pom can be used to have a child project inherit properties/plugins/ect in order to reduce duplication and keep standards across a large amount of repos. |
projectType |
projen.ProjectType |
Which type of project this is (library/app). |
projenCommand |
string |
The shell command to use in order to run the projen CLI. |
projenCredentials |
projen.github.GithubCredentials |
Choose a method of providing GitHub API access for projen workflows. |
projenrcJava |
boolean |
Use projenrc in java. |
projenrcJavaOptions |
projen.java.ProjenrcOptions |
Options related to projenrc in java. |
projenrcJson |
boolean |
Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation. |
projenrcJsonOptions |
projen.ProjenrcJsonOptions |
Options for .projenrc.json. |
projenTokenSecret |
string |
The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows. |
readme |
projen.SampleReadmeProps |
The README setup. |
renovatebot |
boolean |
Use renovatebot to handle dependency upgrades. |
renovatebotOptions |
projen.RenovatebotOptions |
Options for renovatebot. |
sample |
boolean |
Include sample code and test if the relevant directories don't exist. |
sampleJavaPackage |
string |
The java package to use for the code sample. |
stale |
boolean |
Auto-close of stale issues and pull request. |
staleOptions |
projen.github.StaleOptions |
Auto-close stale issues and pull requests. |
testDeps |
string[] |
List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver> . |
url |
string |
The URL, like the name, is not required. |
version |
string |
This is the last piece of the naming puzzle. |
vscode |
boolean |
Enable VSCode integration. |
commitGeneratedCode |
boolean |
Whether to commit the code generated by the OpenAPI Generator. |
runtimeVersion |
JavaVersion |
Runtime version to target for the handlers. |
artifactId
Optional
public readonly artifactId: string;
- Type: string
- Default: "my-app"
The artifactId is generally the name that the project is known by.
Although the groupId is important, people within the group will rarely mention the groupId in discussion (they are often all be the same ID, such as the MojoHaus project groupId: org.codehaus.mojo). It, along with the groupId, creates a key that separates this project from every other project in the world (at least, it should :) ). Along with the groupId, the artifactId fully defines the artifact's living quarters within the repository. In the case of the above project, my-project lives in $M2_REPO/org/codehaus/mojo/my-project.
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.
commitGenerated
Optional
public readonly commitGenerated: boolean;
- Type: boolean
- Default: true
Whether to commit the managed files by default.
compileOptions
Optional
public readonly compileOptions: MavenCompileOptions;
- Type: projen.java.MavenCompileOptions
- Default: defaults
Compile options.
deps
Optional
public readonly deps: string[];
- Type: string[]
- Default: []
List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>
.
Additional dependencies can be added via project.addDependency()
.
description
Optional
public readonly description: string;
- Type: string
- Default: undefined
Description of a project is always good.
Although this should not replace formal documentation, a quick comment to any readers of the POM is always helpful.
devContainer
Optional
public readonly devContainer: boolean;
- Type: boolean
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
distdir
Optional
public readonly distdir: string;
- Type: string
- Default: "dist/java"
Final artifact output directory.
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.
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.
gitpod
Optional
public readonly gitpod: boolean;
- Type: boolean
- Default: false
Add a Gitpod development environment.
groupId
Optional
public readonly groupId: string;
- Type: string
- Default: "org.acme"
This is generally unique amongst an organization or a project.
For example, all core Maven artifacts do (well, should) live under the groupId org.apache.maven. Group ID's do not necessarily use the dot notation, for example, the junit project. Note that the dot-notated groupId does not have to correspond to the package structure that the project contains. It is, however, a good practice to follow. When stored within a repository, the group acts much like the Java packaging structure does in an operating system. The dots are replaced by OS specific directory separators (such as '/' in Unix) which becomes a relative directory structure from the base repository. In the example given, the org.codehaus.mojo group lives within the directory $M2_REPO/org/codehaus/mojo.
junit
Optional
public readonly junit: boolean;
- Type: boolean
- Default: true
Include junit tests.
junitOptions
Optional
public readonly junitOptions: JunitOptions;
- Type: projen.java.JunitOptions
- Default: defaults
junit options.
logging
Optional
public readonly logging: LoggerOptions;
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
~~mergify
~~Optional
- 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
- Deprecated: use
githubOptions.mergifyOptions
instead
public readonly mergifyOptions: MergifyOptions;
- Type: projen.github.MergifyOptions
- Default: default options
Options for mergify.
name
Optional
public readonly name: string;
- Type: string
- Default: $BASEDIR
This is the name of your project.
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.
packaging
Optional
public readonly packaging: string;
- Type: string
- Default: "jar"
Project packaging format.
packagingOptions
Optional
public readonly packagingOptions: MavenPackagingOptions;
- Type: projen.java.MavenPackagingOptions
- Default: defaults
Packaging options.
parent
Optional
public readonly parent: Project;
- Type: projen.Project
The parent project, if this project is part of a bigger project.
parentPom
Optional
public readonly parentPom: ParentPom;
- Type: projen.java.ParentPom
- Default: undefined
A Parent Pom can be used to have a child project inherit properties/plugins/ect in order to reduce duplication and keep standards across a large amount of repos.
~~projectType
~~Optional
- 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).
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.
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.
projenrcJava
Optional
public readonly projenrcJava: boolean;
- Type: boolean
- Default: true
Use projenrc in java.
This will install projen
as a java dependency and will add a synth
task which
will compile & execute main()
from src/main/java/projenrc.java
.
projenrcJavaOptions
Optional
public readonly projenrcJavaOptions: ProjenrcOptions;
- Type: projen.java.ProjenrcOptions
- Default: default options
Options related to projenrc in java.
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.
~~projenTokenSecret
~~Optional
- 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.
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.
sample
Optional
public readonly sample: boolean;
- Type: boolean
- Default: true
Include sample code and test if the relevant directories don't exist.
sampleJavaPackage
Optional
public readonly sampleJavaPackage: string;
- Type: string
- Default: "org.acme"
The java package to use for the code sample.
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
.
testDeps
Optional
public readonly testDeps: string[];
- Type: string[]
- Default: []
List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>
.
Additional dependencies can be added via project.addTestDependency()
.
url
Optional
public readonly url: string;
- Type: string
- Default: undefined
The URL, like the name, is not required.
This is a nice gesture for projects users, however, so that they know where the project lives.
version
Optional
public readonly version: string;
- Type: string
- Default: "0.1.0"
This is the last piece of the naming puzzle.
groupId:artifactId denotes a single project but they cannot delineate which incarnation of that project we are talking about. Do we want the junit:junit of 2018 (version 4.12), or of 2007 (version 3.8.2)? In short: code changes, those changes should be versioned, and this element keeps those versions in line. It is also used within an artifact's repository to separate versions from each other. my-project version 1.0 files live in the directory structure $M2_REPO/org/codehaus/mojo/my-project/1.0.
vscode
Optional
public readonly vscode: boolean;
- Type: boolean
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
commitGeneratedCode
Optional
public readonly commitGeneratedCode: boolean;
- Type: boolean
- Default: false
Whether to commit the code generated by the OpenAPI Generator.
runtimeVersion
Optional
public readonly runtimeVersion: JavaVersion;
- Type: JavaVersion
- Default: JavaVersion.JAVA_17
Runtime version to target for the handlers.
GeneratedJavaInfrastructureOptions
Options for configuring a generated java infrastructure project.
Initializer
import { GeneratedJavaInfrastructureOptions } from '@aws/pdk/type-safe-api'
const generatedJavaInfrastructureOptions: GeneratedJavaInfrastructureOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
artifactId |
string |
The artifactId is generally the name that the project is known by. |
autoApproveOptions |
projen.github.AutoApproveOptions |
Enable and configure the 'auto approve' workflow. |
autoMerge |
boolean |
Enable automatic merging on GitHub. |
autoMergeOptions |
projen.github.AutoMergeOptions |
Configure options for automatic merging on GitHub. |
clobber |
boolean |
Add a clobber task which resets the repo to origin. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileOptions |
projen.java.MavenCompileOptions |
Compile options. |
deps |
string[] |
List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver> . |
description |
string |
Description of a project is always good. |
devContainer |
boolean |
Add a VSCode development environment (used for GitHub Codespaces). |
distdir |
string |
Final artifact output directory. |
github |
boolean |
Enable GitHub integration. |
githubOptions |
projen.github.GitHubOptions |
Options for GitHub integration. |
gitIgnoreOptions |
projen.IgnoreFileOptions |
Configuration options for .gitignore file. |
gitOptions |
projen.GitOptions |
Configuration options for git. |
gitpod |
boolean |
Add a Gitpod development environment. |
groupId |
string |
This is generally unique amongst an organization or a project. |
junit |
boolean |
Include junit tests. |
junitOptions |
projen.java.JunitOptions |
junit options. |
logging |
projen.LoggerOptions |
Configure logging options such as verbosity. |
mergify |
boolean |
Whether mergify should be enabled on this repository or not. |
mergifyOptions |
projen.github.MergifyOptions |
Options for mergify. |
name |
string |
This is the name of your project. |
outdir |
string |
The root directory of the project. Relative to this directory, all files are synthesized. |
packaging |
string |
Project packaging format. |
packagingOptions |
projen.java.MavenPackagingOptions |
Packaging options. |
parent |
projen.Project |
The parent project, if this project is part of a bigger project. |
parentPom |
projen.java.ParentPom |
A Parent Pom can be used to have a child project inherit properties/plugins/ect in order to reduce duplication and keep standards across a large amount of repos. |
projectType |
projen.ProjectType |
Which type of project this is (library/app). |
projenCommand |
string |
The shell command to use in order to run the projen CLI. |
projenCredentials |
projen.github.GithubCredentials |
Choose a method of providing GitHub API access for projen workflows. |
projenrcJava |
boolean |
Use projenrc in java. |
projenrcJavaOptions |
projen.java.ProjenrcOptions |
Options related to projenrc in java. |
projenrcJson |
boolean |
Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation. |
projenrcJsonOptions |
projen.ProjenrcJsonOptions |
Options for .projenrc.json. |
projenTokenSecret |
string |
The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows. |
readme |
projen.SampleReadmeProps |
The README setup. |
renovatebot |
boolean |
Use renovatebot to handle dependency upgrades. |
renovatebotOptions |
projen.RenovatebotOptions |
Options for renovatebot. |
sample |
boolean |
Include sample code and test if the relevant directories don't exist. |
sampleJavaPackage |
string |
The java package to use for the code sample. |
stale |
boolean |
Auto-close of stale issues and pull request. |
staleOptions |
projen.github.StaleOptions |
Auto-close stale issues and pull requests. |
testDeps |
string[] |
List of test dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver> . |
url |
string |
The URL, like the name, is not required. |
version |
string |
This is the last piece of the naming puzzle. |
vscode |
boolean |
Enable VSCode integration. |
commitGeneratedCode |
boolean |
Whether to commit the code generated by the OpenAPI Generator. |
mockDataOptions |
MockResponseDataGenerationOptions |
Options for the generated mock response data. |
artifactId
Optional
public readonly artifactId: string;
- Type: string
- Default: "my-app"
The artifactId is generally the name that the project is known by.
Although the groupId is important, people within the group will rarely mention the groupId in discussion (they are often all be the same ID, such as the MojoHaus project groupId: org.codehaus.mojo). It, along with the groupId, creates a key that separates this project from every other project in the world (at least, it should :) ). Along with the groupId, the artifactId fully defines the artifact's living quarters within the repository. In the case of the above project, my-project lives in $M2_REPO/org/codehaus/mojo/my-project.
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.
commitGenerated
Optional
public readonly commitGenerated: boolean;
- Type: boolean
- Default: true
Whether to commit the managed files by default.
compileOptions
Optional
public readonly compileOptions: MavenCompileOptions;
- Type: projen.java.MavenCompileOptions
- Default: defaults
Compile options.
deps
Optional
public readonly deps: string[];
- Type: string[]
- Default: []
List of runtime dependencies for this project. Dependencies use the format: <groupId>/<artifactId>@<semver>
.
Additional dependencies can be added via project.addDependency()
.
description
Optional
public readonly description: string;
- Type: string
- Default: undefined
Description of a project is always good.
Although this should not replace formal documentation, a quick comment to any readers of the POM is always helpful.
devContainer
Optional
public readonly devContainer: boolean;
- Type: boolean
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
distdir
Optional
public readonly distdir: string;
- Type: string
- Default: "dist/java"
Final artifact output directory.
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.
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.
gitpod
Optional
public readonly gitpod: boolean;
- Type: boolean
- Default: false
Add a Gitpod development environment.
groupId
Optional
public readonly groupId: string;
- Type: string
- Default: "org.acme"
This is generally unique amongst an organization or a project.
For example, all core Maven artifacts do (well, should) live under the groupId org.apache.maven. Group ID's do not necessarily use the dot notation, for example, the junit project. Note that the dot-notated groupId does not have to correspond to the package structure that the project contains. It is, however, a good practice to follow. When stored within a repository, the group acts much like the Java packaging structure does in an operating system. The dots are replaced by OS specific directory separators (such as '/' in Unix) which becomes a relative directory structure from the base repository. In the example given, the org.codehaus.mojo group lives within the directory $M2_REPO/org/codehaus/mojo.
junit
Optional
public readonly junit: boolean;
- Type: boolean
- Default: true
Include junit tests.
junitOptions
Optional
public readonly junitOptions: JunitOptions;
- Type: projen.java.JunitOptions
- Default: defaults
junit options.
logging
Optional
public readonly logging: LoggerOptions;
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
~~mergify
~~Optional
- 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
- Deprecated: use
githubOptions.mergifyOptions
instead
public readonly mergifyOptions: MergifyOptions;
- Type: projen.github.MergifyOptions
- Default: default options
Options for mergify.
name
Optional
public readonly name: string;
- Type: string
- Default: $BASEDIR
This is the name of your project.
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.
packaging
Optional
public readonly packaging: string;
- Type: string
- Default: "jar"
Project packaging format.
packagingOptions
Optional
public readonly packagingOptions: MavenPackagingOptions;
- Type: projen.java.MavenPackagingOptions
- Default: defaults
Packaging options.