Hierarchy

  • TypeScriptProject
    • GitHooksEnabledProject

Constructors

Properties

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
commitGenerated: boolean

Whether to commit the managed files by default.

debug?: boolean
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
editorConfig?: EditorConfig
eslint?: Eslint
gitHooksManager?: Husky | Lefthook
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
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.

npmrc: NpmConfig

The .npmrc 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[]
workflowPackageCache: boolean
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.

defaultTsConfig: {
    compilerOptions: {
        esModuleInterop: boolean;
        forceConsistentCasingInFileNames: boolean;
        moduleResolution: TypeScriptModuleResolution;
        noEmitOnError: boolean;
        noImplicitReturns: boolean;
    };
} = ...

Type declaration

  • compilerOptions: {
        esModuleInterop: boolean;
        forceConsistentCasingInFileNames: boolean;
        moduleResolution: TypeScriptModuleResolution;
        noEmitOnError: boolean;
        noImplicitReturns: boolean;
    }
    • esModuleInterop: boolean
    • forceConsistentCasingInFileNames: boolean
    • moduleResolution: TypeScriptModuleResolution
    • noEmitOnError: boolean
    • noImplicitReturns: boolean

Accessors

  • get allowLibraryDependencies(): boolean
  • Returns boolean

    Deprecated

    use package.allowLibraryDependencies

  • get buildTask(): Task
  • Returns Task

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

    Returns undefined | 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
  • Returns string

    Deprecated

    use package.entrypoint

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

    Returns FileBase[]

  • get manifest(): any
  • Returns any

    Deprecated

    use package.addField(x, y)

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

    Returns NodePackageManager

    Deprecated

    use package.packageManager

  • get packageTask(): Task
  • Returns Task

  • get postCompileTask(): Task
  • Returns Task

  • get preCompileTask(): Task
  • Returns Task

  • get subprojects(): Project[]
  • Returns all the subprojects within this project.

    Returns Project[]

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

      Rest

    Returns void

  • DEPRECATED

    Parameters

    • Rest ...commands: string[]
      Rest

    Returns void

    Deprecated

    use project.compileTask.exec()

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

      Rest

    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.

      Rest

    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

      Rest

    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

      Rest

    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.

      Rest

    Returns void

  • Replaces the contents of multiple npm package.json scripts.

    Parameters

    • scripts: {
          [name: string]: string;
      }

      The scripts to set

      • [name: string]: string

    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

      Optional

    Returns Task

  • DEPRECATED

    Parameters

    • Rest ...commands: string[]
      Rest

    Returns void

    Deprecated

    use project.testTask.exec()

  • Prints a "tip" message during synthesis.

    Parameters

    • message: string

      The message

    Returns void

    Deprecated

    • use project.logger.info(message) to show messages during synthesis
  • 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.

    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

    Deprecated

    Use project.tasks.tryFind(name)

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

    Parameters

    • name: string

      The name of the task to remove.

    Returns undefined | Task

    The Task that was removed, otherwise undefined.

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

    Parameters

    • Optional options: RenderWorkflowSetupOptions

      Options.

      Optional

    Returns JobStep[]

    Job steps

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

    Parameters

    • filePath: string

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

    Returns undefined | FileBase

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

  • Finds a json file by name.

    Parameters

    • filePath: string

      The file path.

    Returns undefined | JsonFile

    Deprecated

    use tryFindObjectFile

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

    Parameters

    • filePath: string

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

    Returns undefined | FileBase

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

Generated using TypeDoc