Hierarchy

  • AwsCdkTypeScriptApp
    • ServerlessProject

Constructors

Properties

appEntrypoint: string

The CDK app entrypoint

artifactsDirectory: 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: string

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

autoApprove?: AutoApprove

Auto approve set up for this project.

autoMerge?: AutoMerge

Component that sets up mergify for merging approved pull requests.

buildWorkflow?: BuildWorkflow

The PR build GitHub workflow. undefined if buildWorkflow is disabled.

bundler: Bundler
cdkConfig: CdkConfig

cdk.json configuration.

cdkDeps: AwsCdkDeps
cdkTasks: CdkTasks

Common CDK tasks.

commitGenerated: boolean

Whether to commit the managed files by default.

defaultTask?: Task

This is the "default" task, the one that executes "projen". Undefined if the project is being ejected.

deps: Dependencies

Project dependencies.

devContainer: undefined | DevContainer

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

This will be undefined if devContainer boolean is false

docgen?: boolean
docsDirectory: string
eslint?: Eslint
gitattributes: GitAttributesFile

The .gitattributes file for this repository.

github: undefined | GitHub

Access all github components.

This will be undefined for subprojects.

gitignore: IgnoreFile

.gitignore

gitpod: undefined | Gitpod

Access for Gitpod

This will be undefined if gitpod boolean is false

initProject?: 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.

jest?: Jest

The Jest configuration (if enabled)

libdir: string

The directory in which compiled .js files reside.

logger: Logger

Logging utilities.

name: string

Project name.

nodeVersion?: string
npmignore?: IgnoreFile

The .npmignore file.

outdir: string

Absolute output directory of this project.

package: NodePackage

API for managing the node package.

parent?: Project

A parent project. If undefined, this is the root project.

prettier?: Prettier
projectBuild: ProjectBuild

Manages the build process of the project.

projectType: ProjectType
projenCommand: string

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

publisher?: Publisher

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

Deprecated

use release.publisher.

release?: Release

Release management.

root: Project

The root project.

runScriptCommand: string

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

srcdir: string

The directory in which the .ts sources reside.

tasks: Tasks

Project tasks.

testdir: string

The directory in which tests reside.

tsconfig?: TypescriptConfig
tsconfigDev: TypescriptConfig

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

tsconfigEslint?: TypescriptConfig
upgradeWorkflow?: UpgradeDependencies

The upgrade workflow.

vscode: undefined | VsCode

Access all VSCode components.

This will be undefined for subprojects.

watchTask: Task

The "watch" task.

workflowBootstrapSteps: JobStep[]
DEFAULT_TASK: "default" = "default"

The name of the default task (the task executed when projen is run without arguments). Normally this task should synthesize the project files.

Accessors

  • get allowLibraryDependencies(): boolean
  • Deprecated

    use package.allowLibraryDependencies

    Returns boolean

  • get buildTask(): Task
  • Returns Task

  • get buildWorkflowJobId(): undefined | string
  • The job ID of the build workflow.

    Returns undefined | string

  • get cdkVersion(): string
  • The CDK version this app is using.

    Returns string

  • get compileTask(): Task
  • Returns Task

  • get components(): Component[]
  • Returns all the components within this project.

    Returns Component[]

  • get ejected(): boolean
  • Whether or not the project is being ejected.

    Returns boolean

  • get entrypoint(): string
  • Deprecated

    use package.entrypoint

    Returns string

  • get files(): FileBase[]
  • All files in this project.

    Returns FileBase[]

  • get manifest(): any
  • Deprecated

    use package.addField(x, y)

    Returns any

  • get maxNodeVersion(): undefined | string
  • Maximum node version required by this package.

    Returns undefined | string

  • get minNodeVersion(): undefined | string
  • Minimum node.js version required by this package.

    Returns undefined | string

  • get packageManager(): NodePackageManager
  • The package manager to use.

    Deprecated

    use package.packageManager

    Returns NodePackageManager

  • get packageTask(): Task
  • Returns Task

  • get postCompileTask(): Task
  • Returns Task

  • get preCompileTask(): Task
  • Returns Task

  • get testTask(): Task
  • Returns Task

Methods

  • Parameters

    • bins: Record<string, string>

    Returns void

  • Defines bundled dependencies.

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

    Parameters

    • Rest ...deps: 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.

    Returns void

  • Adds an AWS CDK module dependencies

    Parameters

    • Rest ...modules: string[]

      The list of modules to depend on

    Returns void

  • DEPRECATED

    Deprecated

    use project.compileTask.exec()

    Parameters

    • Rest ...commands: string[]

    Returns void

  • Defines normal dependencies.

    Parameters

    • Rest ...deps: 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.

    Returns void

  • Defines development/test dependencies.

    Parameters

    • Rest ...deps: 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.

    Returns 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.

    Parameters

    • Rest ...globs: string[]

      The glob patterns to match

    Returns void

  • Directly set fields in package.json.

    Parameters

    • fields: {
          [name: string]: any;
      }

      The fields to set

      • [name: string]: any

    Returns void

  • Adds a .gitignore pattern.

    Parameters

    • pattern: string

      The glob pattern to ignore.

    Returns void

  • Adds keywords to package.json (deduplicated)

    Parameters

    • Rest ...keywords: string[]

      The keywords to add

    Returns void

  • Parameters

    • pattern: string

    Returns 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.

    Parameters

    • Rest ...deps: 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.

    Returns void

  • Adds a new task to this project. This will fail if the project already has a task with this name.

    Parameters

    • name: string

      The task name to add

    • Optional props: TaskOptions

      Task properties

    Returns Task

  • DEPRECATED

    Deprecated

    use project.testTask.exec()

    Parameters

    • Rest ...commands: string[]

    Returns void

  • Prints a "tip" message during synthesis.

    Deprecated

    • use project.logger.info(message) to show messages during synthesis

    Parameters

    • message: string

      The message

    Returns 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.

    See

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

    Parameters

    • glob: string

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

    Returns void

  • Indicates if a script by the name name is defined.

    Parameters

    • name: string

      The name of the script

    Returns boolean

  • Called after all components are synthesized. Order is not guaranteed.

    Returns void

  • Called before all components are synthesized.

    Returns void

  • Removes the npm script (always successful).

    Parameters

    • name: string

      The name of the script.

    Returns void

  • Removes a task from a project.

    Returns

    The Task that was removed, otherwise undefined.

    Parameters

    • name: string

      The name of the task to remove.

    Returns undefined | Task

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

    Returns

    Job steps

    Parameters

    • Optional options: RenderWorkflowSetupOptions

      Options.

    Returns JobStep[]

  • Returns the shell command to execute in order to run a task. This will typically be npx projen TASK.

    Parameters

    • task: Task

      The task for which the command is required

    Returns string

  • Replaces the contents of an npm package.json script.

    Parameters

    • name: string

      The script name

    • command: string

      The command to execute

    Returns void

  • Synthesize all project files into outdir.

    1. Call "this.preSynthesize()"
    2. Delete all generated files
    3. Synthesize all sub-projects
    4. Synthesize all components of this project
    5. Call "postSynthesize()" for all components of this project
    6. Call "this.postSynthesize()"

    Returns void

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

    Returns

    a FileBase or undefined if there is no file in that path

    Parameters

    • filePath: string

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

    Returns undefined | FileBase

  • Finds a json file by name.

    Deprecated

    use tryFindObjectFile

    Parameters

    • filePath: string

      The file path.

    Returns undefined | JsonFile

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

    Parameters

    • filePath: string

      The file path.

    Returns undefined | ObjectFile

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

    Returns

    a FileBase if the file was found and removed, or undefined if the file was not found.

    Parameters

    • filePath: string

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

    Returns undefined | FileBase

Generated using TypeDoc