Skip to content

Latest commit

 

History

History
2132 lines (1337 loc) · 83.1 KB

API.md

File metadata and controls

2132 lines (1337 loc) · 83.1 KB

API Reference

Structs

TurborepoConfig

Initializer

import { TurborepoConfig } from 'projen-turborepo'

const turborepoConfig: TurborepoConfig = { ... }

Properties

Name Type Description
globalDependencies string[] A list of globs for implicit global hash dependencies.
pipeline {[ key: string ]: projen-turborepo.TurborepoPipelineConfig} An object representing the task dependency graph of your project.

globalDependenciesOptional
public readonly globalDependencies: string[];
  • Type: string[]

A list of globs for implicit global hash dependencies.

The contents of these files will be included in the global hashing algorithm. This is useful for busting the cache based on .env files (not in Git) or any root level file that impacts package tasks (but are not represented in the traditional dependency graph (e.g. a root tsconfig.json, jest.config.js, .eslintrc , etc.)).

https://turborepo.org/docs/reference/configuration#globaldependencies


pipelineOptional
public readonly pipeline: {[ key: string ]: TurborepoPipelineConfig};

An object representing the task dependency graph of your project.

turbo interprets these conventions to properly schedule, execute, and cache the outputs of tasks in your project Each key in the pipeline object is the name of a task that can be executed by turbo run. If turbo finds a workspace package with a package.json scripts object with a matching key, it will apply the pipeline task configuration to that NPM script during execution. This allows you to use pipeline to set conventions across your entire Turborepo.

https://turborepo.org/docs/reference/configuration#pipeline


TurborepoPipelineConfig

Initializer

import { TurborepoPipelineConfig } from 'projen-turborepo'

const turborepoPipelineConfig: TurborepoPipelineConfig = { ... }

Properties

Name Type Description
cache boolean Whether or not to cache the task outputs.
dependsOn string[] The list of tasks that this task depends on.
outputs string[] Defaults to ["dist/**", "build/**"]. The set of glob patterns of a task's cacheable filesystem outputs.

cacheOptional
public readonly cache: boolean;
  • Type: boolean
  • Default: true

Whether or not to cache the task outputs.

Setting cache to false is useful for daemon or long-running "watch" or development mode tasks that you don't want to cache.


dependsOnOptional
public readonly dependsOn: string[];
  • Type: string[]

The list of tasks that this task depends on.

Prefixing a task in dependsOn with a ^ tells turbo that this pipeline task depends on the package's topological dependencies completing the task with the ^ prefix first (e.g. "a package's build tasks should only run once all of its dependencies and devDependencies have completed their own build commands"). Items in dependsOn without ^ prefix, express the relationships between tasks at the package level (e.g. "a package's test and lint commands depend on build being completed first").


outputsOptional
public readonly outputs: string[];
  • Type: string[]

Defaults to ["dist/**", "build/**"]. The set of glob patterns of a task's cacheable filesystem outputs.

Note: turbo automatically logs stderr/stdout to .turbo/run-<task>.log. This file is always treated as a cacheable artifact and never needs to be specified. Passing an empty array can be used to tell turbo that a task is a side-effect and thus doesn't emit any filesystem artifacts (e.g. like a linter), but you still want to cache its logs (and treat them like an artifact).


TurborepoProjectOptions

Initializer

import { TurborepoProjectOptions } from 'projen-turborepo'

const turborepoProjectOptions: TurborepoProjectOptions = { ... }

Properties

Name Type Description
name* string This is the name of your project.
logging projen.LoggerOptions Configure logging options such as verbosity.
outdir string The root directory of the project.
parent projen.Project The parent project, if this project is part of a bigger project.
projenCommand string The shell command to use in order to run the projen CLI.
projenrcJson boolean Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.
projenrcJsonOptions projen.ProjenrcOptions Options for .projenrc.json.
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.
devContainer boolean Add a VSCode development environment (used for GitHub Codespaces).
github boolean Enable GitHub integration.
githubOptions projen.github.GitHubOptions Options for GitHub integration.
gitpod boolean Add a Gitpod development environment.
mergify boolean Whether mergify should be enabled on this repository or not.
mergifyOptions projen.github.MergifyOptions Options for mergify.
projectType projen.ProjectType Which type of project this is (library/app).
projenCredentials projen.github.GithubCredentials Choose a method of providing GitHub API access for projen workflows.
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.
stale boolean Auto-close of stale issues and pull request.
staleOptions projen.github.StaleOptions Auto-close stale issues and pull requests.
vscode boolean Enable VSCode integration.
allowLibraryDependencies boolean Allow the project to include peerDependencies and bundledDependencies.
authorEmail string Author's e-mail.
authorName string Author's name.
authorOrganization boolean Author's Organization.
authorUrl string Author's URL / Website.
autoDetectBin boolean Automatically add all executables under the bin directory to your package.json file under the bin section.
bin {[ key: string ]: string} Binary programs vended with your module.
bugsEmail string The email address to which issues should be reported.
bugsUrl string The url to your project's issue tracker.
bundledDeps string[] List of dependencies to bundle into this module.
codeArtifactOptions projen.javascript.CodeArtifactOptions Options for npm packages using AWS CodeArtifact.
deps string[] Runtime dependencies of this module.
description string The description is just a string that helps people understand the purpose of the package.
devDeps string[] Build dependencies for this module.
entrypoint string Module entrypoint (main in package.json).
homepage string Package's Homepage / Website.
keywords string[] Keywords to include in package.json.
license string License's SPDX identifier.
licensed boolean Indicates if a license should be added.
maxNodeVersion string Minimum node.js version to require via engines (inclusive).
minNodeVersion string Minimum Node.js version to require via package.json engines (inclusive).
npmAccess projen.javascript.NpmAccess Access level of the npm package.
npmRegistry string The host name of the npm registry to publish to.
npmRegistryUrl string The base URL of the npm package registry.
npmTokenSecret string GitHub secret which contains the NPM token to use when publishing packages.
packageManager projen.javascript.NodePackageManager The Node Package Manager used to execute scripts.
packageName string The "name" in package.json.
peerDependencyOptions projen.javascript.PeerDependencyOptions Options for peerDeps.
peerDeps string[] Peer dependencies for this module.
repository string The repository is the location where the actual code for your package lives.
repositoryDirectory string If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.
scopedPackagesOptions projen.javascript.ScopedPackagesOptions[] Options for privately hosted scoped packages.
scripts {[ key: string ]: string} npm scripts to include.
stability string Package's Stability.
jsiiReleaseVersion string Version requirement of publib which is used to publish modules to npm.
majorVersion number Major version to release from the default branch.
npmDistTag string The npmDistTag to use when publishing from the default branch.
postBuildSteps projen.github.workflows.JobStep[] Steps to execute after build as part of the release workflow.
prerelease string Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRun boolean Instead of actually publishing to package managers, just print the publishing command.
publishTasks boolean Define publishing tasks that can be executed manually as well as workflows.
releaseBranches {[ key: string ]: projen.release.BranchOptions} Defines additional release branches.
releaseEveryCommit boolean Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssue boolean Create a github issue on every failed publishing task.
releaseFailureIssueLabel string The label to apply to issues indicating publish failures.
releaseSchedule string CRON schedule to trigger new releases.
releaseTagPrefix string Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.
releaseTrigger projen.release.ReleaseTrigger The release trigger to use.
releaseWorkflowName string The name of the default release workflow.
releaseWorkflowSetupSteps projen.github.workflows.JobStep[] A set of workflow steps to execute in order to setup the workflow container.
versionrcOptions {[ key: string ]: any} Custom configuration used when creating changelog with standard-version package.
workflowContainerImage string Container image to use for GitHub workflows.
workflowRunsOn string[] Github Runner selection labels.
defaultReleaseBranch* string The name of the main release branch.
artifactsDirectory string A directory which will contain build artifacts.
autoApproveUpgrades boolean Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
buildWorkflow boolean Define a GitHub workflow for building PRs.
buildWorkflowTriggers projen.github.workflows.Triggers Build workflow triggers.
bundlerOptions projen.javascript.BundlerOptions Options for Bundler.
codeCov boolean Define a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v1 A secret is required for private repos. Configured with @codeCovTokenSecret.
codeCovTokenSecret string Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.
copyrightOwner string License copyright owner.
copyrightPeriod string The copyright years to put in the LICENSE file.
dependabot boolean Use dependabot to handle dependency upgrades.
dependabotOptions projen.github.DependabotOptions Options for dependabot.
depsUpgrade boolean Use github workflows to handle dependency upgrades.
depsUpgradeOptions projen.javascript.UpgradeDependenciesOptions Options for UpgradeDependencies.
gitignore string[] Additional entries to .gitignore.
jest boolean Setup jest unit tests.
jestOptions projen.javascript.JestOptions Jest options.
mutableBuild boolean Automatically update files modified during builds to pull-request branches.
npmignore string[] Additional entries to .npmignore.
npmignoreEnabled boolean Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.
package boolean Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).
prettier boolean Setup prettier.
prettierOptions projen.javascript.PrettierOptions Prettier options.
projenDevDependency boolean Indicates of "projen" should be installed as a devDependency.
projenrcJs boolean Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.
projenrcJsOptions projen.javascript.ProjenrcOptions Options for .projenrc.js.
projenVersion string Version of projen to install.
pullRequestTemplate boolean Include a GitHub pull request template.
pullRequestTemplateContents string[] The contents of the pull request template.
release boolean Add release management to this project.
releaseToNpm boolean Automatically release to npm when new versions are introduced.
releaseWorkflow boolean DEPRECATED: renamed to release.
workflowBootstrapSteps projen.github.workflows.JobStep[] Workflow steps to use in order to bootstrap this repo.
workflowGitIdentity projen.github.GitIdentity The git identity to use in workflows.
workflowNodeVersion string The node version to use in GitHub workflows.
disableTsconfig boolean Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).
docgen boolean Docgen by Typedoc.
docsDirectory string Docs directory.
entrypointTypes string The .d.ts file that includes the type declarations for this module.
eslint boolean Setup eslint.
eslintOptions projen.javascript.EslintOptions Eslint options.
libdir string Typescript artifacts output directory.
projenrcTs boolean Use TypeScript for your projenrc file (.projenrc.ts).
projenrcTsOptions projen.typescript.ProjenrcOptions Options for .projenrc.ts.
sampleCode boolean Generate one-time sample in src/ and test/ if there are no files there.
srcdir string Typescript sources directory.
testdir string Jest tests directory. Tests files should be named xxx.test.ts.
tsconfig projen.javascript.TypescriptConfigOptions Custom TSConfig.
tsconfigDev projen.javascript.TypescriptConfigOptions Custom tsconfig options for the development tsconfig.json file (used for testing).
tsconfigDevFile string The name of the development tsconfig.json file.
typescriptVersion string TypeScript version to use.
jestModuleNameMapper boolean Add jest config for moduleNameMapper.
parallelWorkflows boolean GitHub Build Workflows.
pathMapping boolean Add TypeScript path maps in the root project for sub-projects.
projectReferences boolean Adds TypeScript project references for each sub-project that depends on other sub-project.
turbo projen-turborepo.TurborepoConfig Turborepo config options.
vscodeMultiRootWorkspaces boolean VS Code Multi-root Workspaces.

nameRequired
public readonly name: string;
  • Type: string
  • Default: $BASEDIR

This is the name of your project.


loggingOptional
public readonly logging: LoggerOptions;

Configure logging options such as verbosity.


outdirOptional
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 sub-projects.


parentOptional
public readonly parent: Project;

The parent project, if this project is part of a bigger project.


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


projenrcJsonOptional
public readonly projenrcJson: boolean;
  • Type: boolean
  • Default: false

Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation.


projenrcJsonOptionsOptional
public readonly projenrcJsonOptions: ProjenrcOptions;

Options for .projenrc.json.


autoApproveOptionsOptional
public readonly autoApproveOptions: AutoApproveOptions;

Enable and configure the 'auto approve' workflow.


autoMergeOptional
public readonly autoMerge: boolean;
  • Type: boolean
  • Default: true

Enable automatic merging on GitHub.

Has no effect if github.mergify is set to false.


autoMergeOptionsOptional
public readonly autoMergeOptions: AutoMergeOptions;

Configure options for automatic merging on GitHub.

Has no effect if github.mergify or autoMerge is set to false.


clobberOptional
public readonly clobber: boolean;
  • Type: boolean
  • Default: true

Add a clobber task which resets the repo to origin.


devContainerOptional
public readonly devContainer: boolean;
  • Type: boolean
  • Default: false

Add a VSCode development environment (used for GitHub Codespaces).


githubOptional
public readonly github: boolean;
  • Type: boolean
  • Default: true

Enable GitHub integration.

Enabled by default for root projects. Disabled for non-root projects.


githubOptionsOptional
public readonly githubOptions: GitHubOptions;

Options for GitHub integration.


gitpodOptional
public readonly gitpod: boolean;
  • Type: boolean
  • Default: false

Add a Gitpod development environment.


mergifyOptional
  • Deprecated: use githubOptions.mergify instead
public readonly mergify: boolean;
  • Type: boolean
  • Default: true

Whether mergify should be enabled on this repository or not.


mergifyOptionsOptional
  • Deprecated: use githubOptions.mergifyOptions instead
public readonly mergifyOptions: MergifyOptions;

Options for mergify.


projectTypeOptional
  • Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;

Which type of project this is (library/app).


projenCredentialsOptional
public readonly projenCredentials: GithubCredentials;

Choose a method of providing GitHub API access for projen workflows.


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


readmeOptional
public readonly readme: SampleReadmeProps;

The README setup.


staleOptional
public readonly stale: boolean;
  • Type: boolean
  • Default: false

Auto-close of stale issues and pull request.

See staleOptions for options.


staleOptionsOptional
public readonly staleOptions: StaleOptions;

Auto-close stale issues and pull requests.

To disable set stale to false.


vscodeOptional
public readonly vscode: boolean;
  • Type: boolean
  • Default: true

Enable VSCode integration.

Enabled by default for root projects. Disabled for non-root projects.


allowLibraryDependenciesOptional
public readonly allowLibraryDependencies: boolean;
  • Type: boolean
  • Default: true

Allow the project to include peerDependencies and bundledDependencies.

This is normally only allowed for libraries. For apps, there's no meaning for specifying these.


authorEmailOptional
public readonly authorEmail: string;
  • Type: string

Author's e-mail.


authorNameOptional
public readonly authorName: string;
  • Type: string

Author's name.


authorOrganizationOptional
public readonly authorOrganization: boolean;
  • Type: boolean

Author's Organization.


authorUrlOptional
public readonly authorUrl: string;
  • Type: string

Author's URL / Website.


autoDetectBinOptional
public readonly autoDetectBin: boolean;
  • Type: boolean
  • Default: true

Automatically add all executables under the bin directory to your package.json file under the bin section.


binOptional
public readonly bin: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Binary programs vended with your module.

You can use this option to add/customize how binaries are represented in your package.json, but unless autoDetectBin is false, every executable file under bin will automatically be added to this section.


bugsEmailOptional
public readonly bugsEmail: string;
  • Type: string

The email address to which issues should be reported.


bugsUrlOptional
public readonly bugsUrl: string;
  • Type: string

The url to your project's issue tracker.


bundledDepsOptional
public readonly bundledDeps: string[];
  • Type: string[]

List of dependencies to bundle into this module.

These modules will be added both to the dependencies section and bundledDependencies section of your package.json. The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


codeArtifactOptionsOptional
public readonly codeArtifactOptions: CodeArtifactOptions;

Options for npm packages using AWS CodeArtifact.

This is required if publishing packages to, or installing scoped packages from AWS CodeArtifact


depsOptional
public readonly deps: string[];
  • Type: string[]
  • Default: []

Runtime dependencies of this module.

The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


descriptionOptional
public readonly description: string;
  • Type: string

The description is just a string that helps people understand the purpose of the package.

It can be used when searching for packages in a package manager as well. See https://classic.yarnpkg.com/en/docs/package-json/#toc-description


devDepsOptional
public readonly devDeps: string[];
  • Type: string[]
  • Default: []

Build dependencies for this module.

These dependencies will only be available in your build environment but will not be fetched when this module is consumed. The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.


entrypointOptional
public readonly entrypoint: string;
  • Type: string
  • Default: "lib/index.js"

Module entrypoint (main in package.json).

Set to an empty string to not include main in your package.json


homepageOptional
public readonly homepage: string;
  • Type: string

Package's Homepage / Website.


keywordsOptional
public readonly keywords: string[];
  • Type: string[]

Keywords to include in package.json.


licenseOptional
public readonly license: string;
  • Type: string
  • Default: "Apache-2.0"

License's SPDX identifier.

See https://github.com/projen/projen/tree/main/license-text for a list of supported licenses. Use the licensed option if you want to no license to be specified.


licensedOptional
public readonly licensed: boolean;
  • Type: boolean
  • Default: true

Indicates if a license should be added.


maxNodeVersionOptional
public readonly maxNodeVersion: string;
  • Type: string
  • Default: no max

Minimum node.js version to require via engines (inclusive).


minNodeVersionOptional
public readonly minNodeVersion: string;
  • Type: string
  • Default: no "engines" specified

Minimum Node.js version to require via package.json engines (inclusive).


npmAccessOptional
public readonly npmAccess: NpmAccess;
  • Type: projen.javascript.NpmAccess
  • Default: for scoped packages (e.g. foo@bar), the default is NpmAccess.RESTRICTED, for non-scoped packages, the default is NpmAccess.PUBLIC.

Access level of the npm package.


npmRegistryOptional
  • Deprecated: use npmRegistryUrl instead
public readonly npmRegistry: string;
  • Type: string

The host name of the npm registry to publish to.

Cannot be set together with npmRegistryUrl.


npmRegistryUrlOptional
public readonly npmRegistryUrl: string;

The base URL of the npm package registry.

Must be a URL (e.g. start with "https://" or "http://")


npmTokenSecretOptional
public readonly npmTokenSecret: string;
  • Type: string
  • Default: "NPM_TOKEN"

GitHub secret which contains the NPM token to use when publishing packages.


packageManagerOptional
public readonly packageManager: NodePackageManager;

The Node Package Manager used to execute scripts.


packageNameOptional
public readonly packageName: string;
  • Type: string
  • Default: defaults to project name

The "name" in package.json.


peerDependencyOptionsOptional
public readonly peerDependencyOptions: PeerDependencyOptions;

Options for peerDeps.


peerDepsOptional
public readonly peerDeps: string[];
  • Type: string[]
  • Default: []

Peer dependencies for this module.

Dependencies listed here are required to be installed (and satisfied) by the consumer of this library. Using peer dependencies allows you to ensure that only a single module of a certain library exists in the node_modules tree of your consumers. Note that prior to npm@7, peer dependencies are not automatically installed, which means that adding peer dependencies to a library will be a breaking change for your customers. Unless peerDependencyOptions.pinnedDevDependency is disabled (it is enabled by default), projen will automatically add a dev dependency with a pinned version for each peer dependency. This will ensure that you build & test your module against the lowest peer version required.


repositoryOptional
public readonly repository: string;
  • Type: string

The repository is the location where the actual code for your package lives.

See https://classic.yarnpkg.com/en/docs/package-json/#toc-repository


repositoryDirectoryOptional
public readonly repositoryDirectory: string;
  • Type: string

If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.


scopedPackagesOptionsOptional
public readonly scopedPackagesOptions: ScopedPackagesOptions[];

Options for privately hosted scoped packages.


scriptsOptional
public readonly scripts: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: {}

npm scripts to include.

If a script has the same name as a standard script, the standard script will be overwritten.


stabilityOptional
public readonly stability: string;
  • Type: string

Package's Stability.


jsiiReleaseVersionOptional
public readonly jsiiReleaseVersion: string;
  • Type: string
  • Default: "latest"

Version requirement of publib which is used to publish modules to npm.


majorVersionOptional
public readonly majorVersion: number;
  • Type: number
  • Default: Major version is not enforced.

Major version to release from the default branch.

If this is specified, we bump the latest version of this major version line. If not specified, we bump the global latest version.


npmDistTagOptional
public readonly npmDistTag: string;
  • Type: string
  • Default: "latest"

The npmDistTag to use when publishing from the default branch.

To set the npm dist-tag for release branches, set the npmDistTag property for each branch.


postBuildStepsOptional
public readonly postBuildSteps: JobStep[];

Steps to execute after build as part of the release workflow.


prereleaseOptional
public readonly prerelease: string;
  • Type: string
  • Default: normal semantic versions

Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").


publishDryRunOptional
public readonly publishDryRun: boolean;
  • Type: boolean
  • Default: false

Instead of actually publishing to package managers, just print the publishing command.


publishTasksOptional
public readonly publishTasks: boolean;
  • Type: boolean
  • Default: false

Define publishing tasks that can be executed manually as well as workflows.

Normally, publishing only happens within automated workflows. Enable this in order to create a publishing task for each publishing activity.


releaseBranchesOptional
public readonly releaseBranches: {[ key: string ]: BranchOptions};
  • Type: {[ key: string ]: projen.release.BranchOptions}
  • Default: no additional branches are used for release. you can use addBranch() to add additional branches.

Defines additional release branches.

A workflow will be created for each release branch which will publish releases from commits in this branch. Each release branch must be assigned a major version number which is used to enforce that versions published from that branch always use that major version. If multiple branches are used, the majorVersion field must also be provided for the default branch.


releaseEveryCommitOptional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.continuous() instead
public readonly releaseEveryCommit: boolean;
  • Type: boolean
  • Default: true

Automatically release new versions every commit to one of branches in releaseBranches.


releaseFailureIssueOptional
public readonly releaseFailureIssue: boolean;
  • Type: boolean
  • Default: false

Create a github issue on every failed publishing task.


releaseFailureIssueLabelOptional
public readonly releaseFailureIssueLabel: string;
  • Type: string
  • Default: "failed-release"

The label to apply to issues indicating publish failures.

Only applies if releaseFailureIssue is true.


releaseScheduleOptional
  • Deprecated: Use releaseTrigger: ReleaseTrigger.scheduled() instead
public readonly releaseSchedule: string;
  • Type: string
  • Default: no scheduled releases

CRON schedule to trigger new releases.


releaseTagPrefixOptional
public readonly releaseTagPrefix: string;
  • Type: string
  • Default: no prefix

Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers.

Note: this prefix is used to detect the latest tagged version when bumping, so if you change this on a project with an existing version history, you may need to manually tag your latest release with the new prefix.


releaseTriggerOptional
public readonly releaseTrigger: ReleaseTrigger;

The release trigger to use.


releaseWorkflowNameOptional
public readonly releaseWorkflowName: string;
  • Type: string
  • Default: "Release"

The name of the default release workflow.


releaseWorkflowSetupStepsOptional
public readonly releaseWorkflowSetupSteps: JobStep[];

A set of workflow steps to execute in order to setup the workflow container.


versionrcOptionsOptional
public readonly versionrcOptions: {[ key: string ]: any};
  • Type: {[ key: string ]: any}
  • Default: standard configuration applicable for GitHub repositories

Custom configuration used when creating changelog with standard-version package.

Given values either append to default configuration or overwrite values in it.


workflowContainerImageOptional
public readonly workflowContainerImage: string;
  • Type: string
  • Default: default image

Container image to use for GitHub workflows.


workflowRunsOnOptional
public readonly workflowRunsOn: string[];
  • Type: string[]
  • Default: ["ubuntu-latest"]

Github Runner selection labels.


defaultReleaseBranchRequired
public readonly defaultReleaseBranch: string;
  • Type: string
  • Default: "main"

The name of the main release branch.


artifactsDirectoryOptional
public readonly artifactsDirectory: string;
  • Type: string
  • Default: "dist"

A directory which will contain build artifacts.


autoApproveUpgradesOptional
public readonly autoApproveUpgrades: boolean;
  • Type: boolean
  • Default: true

Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).

Throw if set to true but autoApproveOptions are not defined.


buildWorkflowOptional
public readonly buildWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

Define a GitHub workflow for building PRs.


buildWorkflowTriggersOptional
public readonly buildWorkflowTriggers: Triggers;

Build workflow triggers.


bundlerOptionsOptional
public readonly bundlerOptions: BundlerOptions;

Options for Bundler.


codeCovOptional
public readonly codeCov: boolean;
  • Type: boolean
  • Default: false

Define a GitHub workflow step for sending code coverage metrics to https://codecov.io/ Uses codecov/codecov-action@v1 A secret is required for private repos. Configured with @codeCovTokenSecret.


codeCovTokenSecretOptional
public readonly codeCovTokenSecret: string;
  • Type: string
  • Default: if this option is not specified, only public repositories are supported

Define the secret name for a specified https://codecov.io/ token A secret is required to send coverage for private repositories.


copyrightOwnerOptional
public readonly copyrightOwner: string;
  • Type: string
  • Default: defaults to the value of authorName or "" if authorName is undefined.

License copyright owner.


copyrightPeriodOptional
public readonly copyrightPeriod: string;
  • Type: string
  • Default: current year

The copyright years to put in the LICENSE file.


dependabotOptional
public readonly dependabot: boolean;
  • Type: boolean
  • Default: false

Use dependabot to handle dependency upgrades.

Cannot be used in conjunction with depsUpgrade.


dependabotOptionsOptional
public readonly dependabotOptions: DependabotOptions;

Options for dependabot.


depsUpgradeOptional
public readonly depsUpgrade: boolean;
  • Type: boolean
  • Default: true

Use github workflows to handle dependency upgrades.

Cannot be used in conjunction with dependabot.


depsUpgradeOptionsOptional
public readonly depsUpgradeOptions: UpgradeDependenciesOptions;

Options for UpgradeDependencies.


gitignoreOptional
public readonly gitignore: string[];
  • Type: string[]

Additional entries to .gitignore.


jestOptional
public readonly jest: boolean;
  • Type: boolean
  • Default: true

Setup jest unit tests.


jestOptionsOptional
public readonly jestOptions: JestOptions;

Jest options.


mutableBuildOptional
public readonly mutableBuild: boolean;
  • Type: boolean
  • Default: true

Automatically update files modified during builds to pull-request branches.

This means that any files synthesized by projen or e.g. test snapshots will always be up-to-date before a PR is merged. Implies that PR builds do not have anti-tamper checks.


npmignoreOptional
  • Deprecated: - use project.addPackageIgnore
public readonly npmignore: string[];
  • Type: string[]

Additional entries to .npmignore.


npmignoreEnabledOptional
public readonly npmignoreEnabled: boolean;
  • Type: boolean
  • Default: true

Defines an .npmignore file. Normally this is only needed for libraries that are packaged as tarballs.


packageOptional
public readonly package: boolean;
  • Type: boolean
  • Default: true

Defines a package task that will produce an npm tarball under the artifacts directory (e.g. dist).


prettierOptional
public readonly prettier: boolean;
  • Type: boolean
  • Default: false

Setup prettier.


prettierOptionsOptional
public readonly prettierOptions: PrettierOptions;

Prettier options.


projenDevDependencyOptional
public readonly projenDevDependency: boolean;
  • Type: boolean
  • Default: true

Indicates of "projen" should be installed as a devDependency.


projenrcJsOptional
public readonly projenrcJs: boolean;
  • Type: boolean
  • Default: true if projenrcJson is false

Generate (once) .projenrc.js (in JavaScript). Set to false in order to disable .projenrc.js generation.


projenrcJsOptionsOptional
public readonly projenrcJsOptions: ProjenrcOptions;

Options for .projenrc.js.


projenVersionOptional
public readonly projenVersion: string;
  • Type: string
  • Default: Defaults to the latest version.

Version of projen to install.


pullRequestTemplateOptional
public readonly pullRequestTemplate: boolean;
  • Type: boolean
  • Default: true

Include a GitHub pull request template.


pullRequestTemplateContentsOptional
public readonly pullRequestTemplateContents: string[];
  • Type: string[]
  • Default: default content

The contents of the pull request template.


releaseOptional
public readonly release: boolean;
  • Type: boolean
  • Default: true (false for subprojects)

Add release management to this project.


releaseToNpmOptional
public readonly releaseToNpm: boolean;
  • Type: boolean
  • Default: false

Automatically release to npm when new versions are introduced.


releaseWorkflowOptional
  • Deprecated: see release.
public readonly releaseWorkflow: boolean;
  • Type: boolean
  • Default: true if not a subproject

DEPRECATED: renamed to release.


workflowBootstrapStepsOptional
public readonly workflowBootstrapSteps: JobStep[];

Workflow steps to use in order to bootstrap this repo.


workflowGitIdentityOptional
public readonly workflowGitIdentity: GitIdentity;

The git identity to use in workflows.


workflowNodeVersionOptional
public readonly workflowNodeVersion: string;
  • Type: string
  • Default: same as minNodeVersion

The node version to use in GitHub workflows.


disableTsconfigOptional
public readonly disableTsconfig: boolean;
  • Type: boolean
  • Default: false

Do not generate a tsconfig.json file (used by jsii projects since tsconfig.json is generated by the jsii compiler).


docgenOptional
public readonly docgen: boolean;
  • Type: boolean
  • Default: false

Docgen by Typedoc.


docsDirectoryOptional
public readonly docsDirectory: string;
  • Type: string
  • Default: "docs"

Docs directory.


entrypointTypesOptional
public readonly entrypointTypes: string;
  • Type: string
  • Default: .d.ts file derived from the project's entrypoint (usually lib/index.d.ts)

The .d.ts file that includes the type declarations for this module.


eslintOptional
public readonly eslint: boolean;
  • Type: boolean
  • Default: true

Setup eslint.


eslintOptionsOptional
public readonly eslintOptions: EslintOptions;

Eslint options.


libdirOptional
public readonly libdir: string;
  • Type: string
  • Default: "lib"

Typescript artifacts output directory.


projenrcTsOptional
public readonly projenrcTs: boolean;
  • Type: boolean
  • Default: false

Use TypeScript for your projenrc file (.projenrc.ts).


projenrcTsOptionsOptional
public readonly projenrcTsOptions: ProjenrcOptions;

Options for .projenrc.ts.


sampleCodeOptional
public readonly sampleCode: boolean;
  • Type: boolean
  • Default: true

Generate one-time sample in src/ and test/ if there are no files there.


srcdirOptional
public readonly srcdir: string;
  • Type: string
  • Default: "src"

Typescript sources directory.


testdirOptional
public readonly testdir: string;
  • Type: string
  • Default: "test"

Jest tests directory. Tests files should be named xxx.test.ts.

If this directory is under srcdir (e.g. src/test, src/__tests__), then tests are going to be compiled into lib/ and executed as javascript. If the test directory is outside of src, then we configure jest to compile the code in-memory.


tsconfigOptional
public readonly tsconfig: TypescriptConfigOptions;

Custom TSConfig.


tsconfigDevOptional
public readonly tsconfigDev: TypescriptConfigOptions;

Custom tsconfig options for the development tsconfig.json file (used for testing).


tsconfigDevFileOptional
public readonly tsconfigDevFile: string;
  • Type: string
  • Default: "tsconfig.dev.json"

The name of the development tsconfig.json file.


typescriptVersionOptional
public readonly typescriptVersion: string;
  • Type: string
  • Default: "latest"

TypeScript version to use.

NOTE: Typescript is not semantically versioned and should remain on the same minor, so we recommend using a ~ dependency (e.g. ~1.2.3).


jestModuleNameMapperOptional
public readonly jestModuleNameMapper: boolean;
  • Type: boolean
  • Default: false

Add jest config for moduleNameMapper.

https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping/


parallelWorkflowsOptional
public readonly parallelWorkflows: boolean;
  • Type: boolean
  • Default: false

GitHub Build Workflows.

Adds parallel GitHub Build workflows for each sub-project.


pathMappingOptional
public readonly pathMapping: boolean;
  • Type: boolean
  • Default: false

Add TypeScript path maps in the root project for sub-projects.


projectReferencesOptional
public readonly projectReferences: boolean;
  • Type: boolean
  • Default: false

Adds TypeScript project references for each sub-project that depends on other sub-project.

https://www.typescriptlang.org/docs/handbook/project-references.html


turboOptional
public readonly turbo: TurborepoConfig;

Turborepo config options.


vscodeMultiRootWorkspacesOptional
public readonly vscodeMultiRootWorkspaces: boolean;
  • Type: boolean
  • Default: false

VS Code Multi-root Workspaces.

Adds support for VS Code multi-root workspaces.

https://code.visualstudio.com/docs/editor/multi-root-workspaces


Classes

TurborepoProject

Initializers

import { TurborepoProject } from 'projen-turborepo'

new TurborepoProject(options: TurborepoProjectOptions)
Name Type Description
options* projen-turborepo.TurborepoProjectOptions No description.

optionsRequired

Methods

Name Description
preSynthesize Called before all components are synthesized.

preSynthesize
public preSynthesize()