| Interface | Description |
|---|---|
| CreateProjectOptions | |
| Dependency |
(experimental) Represents a project dependency.
|
| DependencyCoordinates |
(experimental) Coordinates of the dependency (name and version).
|
| DepsManifest | |
| DevEnvironmentOptions |
(experimental) Base options for configuring a container-based development environment.
|
| DockerComposeBuild |
(experimental) Build arguments for creating a docker image.
|
| DockerComposePortMappingOptions |
(experimental) Options for port mappings.
|
| DockerComposeProps |
(experimental) Props for DockerCompose.
|
| DockerComposeServiceDescription |
(experimental) Description of a docker-compose.yml service.
|
| DockerComposeServicePort |
(experimental) A service port mapping.
|
| DockerComposeVolumeConfig |
(experimental) Volume configuration.
|
| DockerComposeVolumeMount |
(experimental) Service volume mounting information.
|
| FileBaseOptions | |
| GitpodOptions |
(experimental) Constructor options for the Gitpod component.
|
| GitpodPort |
(experimental) Options for an exposed port on Gitpod.
|
| GitpodPrebuilds |
(experimental) Configure the Gitpod App for prebuilds.
|
| GitpodTask |
(experimental) Configure options for a task to be run when opening a Gitpod workspace (e.g.
|
| IDevEnvironment |
(experimental) Abstract interface for container-based development environments, such as Gitpod and GitHub Codespaces.
|
| IDevEnvironment.Jsii$Default |
Internal default implementation for
IDevEnvironment. |
| IDockerComposeServiceName |
(experimental) An interface providing the name of a docker compose service.
|
| IDockerComposeServiceName.Jsii$Default |
Internal default implementation for
IDockerComposeServiceName. |
| IDockerComposeVolumeBinding |
(experimental) Volume binding information.
|
| IDockerComposeVolumeBinding.Jsii$Default |
Internal default implementation for
IDockerComposeVolumeBinding. |
| IDockerComposeVolumeConfig |
(experimental) Storage for volume configuration.
|
| IDockerComposeVolumeConfig.Jsii$Default |
Internal default implementation for
IDockerComposeVolumeConfig. |
| IniFileOptions |
(experimental) Options for `IniFile`.
|
| InitProject |
(experimental) Information passed from `projen new` to the project object when the project is first created.
|
| IResolvable | |
| IResolvable.Jsii$Default |
Internal default implementation for
IResolvable. |
| IResolver |
(experimental) API for resolving tokens when synthesizing file content.
|
| IResolver.Jsii$Default |
Internal default implementation for
IResolver. |
| JsonFileOptions |
(experimental) Options for `JsonFile`.
|
| LicenseOptions | |
| LoggerOptions |
(experimental) Options for logging utilities.
|
| MakefileOptions |
(experimental) Options for Makefiles.
|
| ObjectFileOptions |
(experimental) Options for `ObjectFile`.
|
| ProjectOptions |
(experimental) Options for `Project`.
|
| ProjenrcOptions | |
| ResolveOptions |
(experimental) Resolve options.
|
| Rule |
(experimental) A Make rule.
|
| SampleDirOptions |
(experimental) SampleDir options.
|
| SampleFileOptions |
(experimental) Options for the SampleFile object.
|
| SampleReadmeProps |
(experimental) SampleReadme Properties.
|
| SourceCodeOptions |
(experimental) Options for `SourceCodeFile`.
|
| TaskCommonOptions | |
| TaskOptions | |
| TasksManifest |
(experimental) Schema for `tasks.json`.
|
| TaskSpec |
(experimental) Specification of a single task.
|
| TaskStep |
(experimental) A single step within a task.
|
| TaskStepOptions |
(experimental) Options for task steps.
|
| TextFileOptions |
(experimental) Options for `TextFile`.
|
| TomlFileOptions |
(experimental) Options for `TomlFile`.
|
| VersionOptions |
(experimental) Options for `Version`.
|
| XmlFileOptions |
(experimental) Options for `XmlFile`.
|
| YamlFileOptions |
(experimental) Options for `JsonFile`.
|
| Class | Description |
|---|---|
| Component |
(experimental) Represents a project component.
|
| CreateProjectOptions.Builder |
A builder for
CreateProjectOptions |
| CreateProjectOptions.Jsii$Proxy |
An implementation for
CreateProjectOptions |
| Dependencies |
(experimental) The `Dependencies` component is responsible to track the list of dependencies a project has, and then used by project types as the model for rendering project-specific dependency manifests such as the dependencies section `package.json` files.
|
| Dependency.Builder |
A builder for
Dependency |
| Dependency.Jsii$Proxy |
An implementation for
Dependency |
| DependencyCoordinates.Builder |
A builder for
DependencyCoordinates |
| DependencyCoordinates.Jsii$Proxy |
An implementation for
DependencyCoordinates |
| DepsManifest.Builder |
A builder for
DepsManifest |
| DepsManifest.Jsii$Proxy |
An implementation for
DepsManifest |
| DevEnvironmentDockerImage |
(experimental) Options for specifying the Docker image of the container.
|
| DevEnvironmentOptions.Builder |
A builder for
DevEnvironmentOptions |
| DevEnvironmentOptions.Jsii$Proxy |
An implementation for
DevEnvironmentOptions |
| DockerCompose |
(experimental) Create a docker-compose YAML file.
|
| DockerCompose.Builder |
(experimental) A fluent builder for
DockerCompose. |
| DockerComposeBuild.Builder |
A builder for
DockerComposeBuild |
| DockerComposeBuild.Jsii$Proxy |
An implementation for
DockerComposeBuild |
| DockerComposePortMappingOptions.Builder |
A builder for
DockerComposePortMappingOptions |
| DockerComposePortMappingOptions.Jsii$Proxy |
An implementation for
DockerComposePortMappingOptions |
| DockerComposeProps.Builder |
A builder for
DockerComposeProps |
| DockerComposeProps.Jsii$Proxy |
An implementation for
DockerComposeProps |
| DockerComposeService |
(experimental) A docker-compose service.
|
| DockerComposeService.Builder |
(experimental) A fluent builder for
DockerComposeService. |
| DockerComposeServiceDescription.Builder |
A builder for
DockerComposeServiceDescription |
| DockerComposeServiceDescription.Jsii$Proxy |
An implementation for
DockerComposeServiceDescription |
| DockerComposeServicePort.Builder |
A builder for
DockerComposeServicePort |
| DockerComposeServicePort.Jsii$Proxy |
An implementation for
DockerComposeServicePort |
| DockerComposeVolumeConfig.Builder |
A builder for
DockerComposeVolumeConfig |
| DockerComposeVolumeConfig.Jsii$Proxy |
An implementation for
DockerComposeVolumeConfig |
| DockerComposeVolumeMount.Builder |
A builder for
DockerComposeVolumeMount |
| DockerComposeVolumeMount.Jsii$Proxy |
An implementation for
DockerComposeVolumeMount |
| FileBase | |
| FileBaseOptions.Builder |
A builder for
FileBaseOptions |
| FileBaseOptions.Jsii$Proxy |
An implementation for
FileBaseOptions |
| GitAttributesFile |
(experimental) Assign attributes to file names in a git repository.
|
| Gitpod |
(experimental) The Gitpod component which emits .gitpod.yml.
|
| Gitpod.Builder |
(experimental) A fluent builder for
Gitpod. |
| GitpodOptions.Builder |
A builder for
GitpodOptions |
| GitpodOptions.Jsii$Proxy |
An implementation for
GitpodOptions |
| GitpodPort.Builder |
A builder for
GitpodPort |
| GitpodPort.Jsii$Proxy |
An implementation for
GitpodPort |
| GitpodPrebuilds.Builder |
A builder for
GitpodPrebuilds |
| GitpodPrebuilds.Jsii$Proxy |
An implementation for
GitpodPrebuilds |
| GitpodTask.Builder |
A builder for
GitpodTask |
| GitpodTask.Jsii$Proxy |
An implementation for
GitpodTask |
| IDevEnvironment.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| IDockerComposeServiceName.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| IDockerComposeVolumeBinding.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| IDockerComposeVolumeConfig.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| IgnoreFile | |
| IniFile |
(experimental) Represents an INI file.
|
| IniFile.Builder |
(experimental) A fluent builder for
IniFile. |
| IniFileOptions.Builder |
A builder for
IniFileOptions |
| IniFileOptions.Jsii$Proxy |
An implementation for
IniFileOptions |
| InitProject.Builder |
A builder for
InitProject |
| InitProject.Jsii$Proxy |
An implementation for
InitProject |
| IResolvable.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| IResolver.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| JsonFile |
(experimental) Represents a JSON file.
|
| JsonFile.Builder |
(experimental) A fluent builder for
JsonFile. |
| JsonFileOptions.Builder |
A builder for
JsonFileOptions |
| JsonFileOptions.Jsii$Proxy |
An implementation for
JsonFileOptions |
| License | |
| License.Builder |
(experimental) A fluent builder for
License. |
| LicenseOptions.Builder |
A builder for
LicenseOptions |
| LicenseOptions.Jsii$Proxy |
An implementation for
LicenseOptions |
| Logger |
(experimental) Project-level logging utilities.
|
| Logger.Builder |
(experimental) A fluent builder for
Logger. |
| LoggerOptions.Builder |
A builder for
LoggerOptions |
| LoggerOptions.Jsii$Proxy |
An implementation for
LoggerOptions |
| Makefile |
(experimental) Minimal Makefile.
|
| Makefile.Builder |
(experimental) A fluent builder for
Makefile. |
| MakefileOptions.Builder |
A builder for
MakefileOptions |
| MakefileOptions.Jsii$Proxy |
An implementation for
MakefileOptions |
| ObjectFile |
(experimental) Represents an Object file.
|
| ObjectFileOptions.Builder |
A builder for
ObjectFileOptions |
| ObjectFileOptions.Jsii$Proxy |
An implementation for
ObjectFileOptions |
| Project |
(experimental) Base project.
|
| Project.Builder |
(experimental) A fluent builder for
Project. |
| ProjectBuild |
(experimental) Manages a standard build process for all projects.
|
| ProjectOptions.Builder |
A builder for
ProjectOptions |
| ProjectOptions.Jsii$Proxy |
An implementation for
ProjectOptions |
| Projects |
(experimental) Programmatic API for projen.
|
| Projenrc |
(experimental) Sets up a project to use JSON for projenrc.
|
| Projenrc.Builder |
(experimental) A fluent builder for
Projenrc. |
| ProjenrcOptions.Builder |
A builder for
ProjenrcOptions |
| ProjenrcOptions.Jsii$Proxy |
An implementation for
ProjenrcOptions |
| ResolveOptions.Builder |
A builder for
ResolveOptions |
| ResolveOptions.Jsii$Proxy |
An implementation for
ResolveOptions |
| Rule.Builder |
A builder for
Rule |
| Rule.Jsii$Proxy |
An implementation for
Rule |
| SampleDir |
(experimental) Renders the given files into the directory if the directory does not exist.
|
| SampleDir.Builder |
(experimental) A fluent builder for
SampleDir. |
| SampleDirOptions.Builder |
A builder for
SampleDirOptions |
| SampleDirOptions.Jsii$Proxy |
An implementation for
SampleDirOptions |
| SampleFile |
(experimental) Produces a file with the given contents but only once, if the file doesn't already exist.
|
| SampleFile.Builder |
(experimental) A fluent builder for
SampleFile. |
| SampleFileOptions.Builder |
A builder for
SampleFileOptions |
| SampleFileOptions.Jsii$Proxy |
An implementation for
SampleFileOptions |
| SampleReadme |
(experimental) Represents a README.md sample file.
|
| SampleReadme.Builder |
(experimental) A fluent builder for
SampleReadme. |
| SampleReadmeProps.Builder |
A builder for
SampleReadmeProps |
| SampleReadmeProps.Jsii$Proxy |
An implementation for
SampleReadmeProps |
| Semver | Deprecated
This class will be removed in upcoming releases.
|
| SourceCode |
(experimental) Represents a source file.
|
| SourceCode.Builder |
(experimental) A fluent builder for
SourceCode. |
| SourceCodeOptions.Builder |
A builder for
SourceCodeOptions |
| SourceCodeOptions.Jsii$Proxy |
An implementation for
SourceCodeOptions |
| Task |
(experimental) A task that can be performed on the project.
|
| Task.Builder |
(experimental) A fluent builder for
Task. |
| TaskCommonOptions.Builder |
A builder for
TaskCommonOptions |
| TaskCommonOptions.Jsii$Proxy |
An implementation for
TaskCommonOptions |
| TaskOptions.Builder |
A builder for
TaskOptions |
| TaskOptions.Jsii$Proxy |
An implementation for
TaskOptions |
| TaskRuntime |
(experimental) The runtime component of the tasks engine.
|
| Tasks |
(experimental) Defines project tasks.
|
| TasksManifest.Builder |
A builder for
TasksManifest |
| TasksManifest.Jsii$Proxy |
An implementation for
TasksManifest |
| TaskSpec.Builder |
A builder for
TaskSpec |
| TaskSpec.Jsii$Proxy |
An implementation for
TaskSpec |
| TaskStep.Builder |
A builder for
TaskStep |
| TaskStep.Jsii$Proxy |
An implementation for
TaskStep |
| TaskStepOptions.Builder |
A builder for
TaskStepOptions |
| TaskStepOptions.Jsii$Proxy |
An implementation for
TaskStepOptions |
| Testing |
(experimental) A Testing static class with a .synth helper for getting a snapshots of construct outputs.
|
| TextFile |
(experimental) A text file.
|
| TextFile.Builder |
(experimental) A fluent builder for
TextFile. |
| TextFileOptions.Builder |
A builder for
TextFileOptions |
| TextFileOptions.Jsii$Proxy |
An implementation for
TextFileOptions |
| TomlFile |
(experimental) Represents a TOML file.
|
| TomlFile.Builder |
(experimental) A fluent builder for
TomlFile. |
| TomlFileOptions.Builder |
A builder for
TomlFileOptions |
| TomlFileOptions.Jsii$Proxy |
An implementation for
TomlFileOptions |
| Version | |
| Version.Builder |
(experimental) A fluent builder for
Version. |
| VersionOptions.Builder |
A builder for
VersionOptions |
| VersionOptions.Jsii$Proxy |
An implementation for
VersionOptions |
| XmlFile |
(experimental) Represents an XML file.
|
| XmlFile.Builder |
(experimental) A fluent builder for
XmlFile. |
| XmlFileOptions.Builder |
A builder for
XmlFileOptions |
| XmlFileOptions.Jsii$Proxy |
An implementation for
XmlFileOptions |
| YamlFile |
(experimental) Represents a YAML file.
|
| YamlFile.Builder |
(experimental) A fluent builder for
YamlFile. |
| YamlFileOptions.Builder |
A builder for
YamlFileOptions |
| YamlFileOptions.Jsii$Proxy |
An implementation for
YamlFileOptions |
| Enum | Description |
|---|---|
| DependencyType |
(experimental) Type of dependency.
|
| DockerComposeProtocol |
(experimental) Network protocol for port mapping.
|
| GitpodOnOpen |
(experimental) What to do when a service on a port is detected.
|
| GitpodOpenIn |
(experimental) Configure where in the IDE the terminal should be opened.
|
| GitpodOpenMode |
(experimental) Configure how the terminal should be opened relative to the previous task.
|
| GitpodPortVisibility |
(experimental) Whether the port visibility should be private or public.
|
| InitProjectOptionHints |
(experimental) Choices for how to display commented out options in projenrc files.
|
| LogLevel |
(experimental) Logging verbosity.
|
| ProjectType | Deprecated
no longer supported at the base project level
|
Define and maintain complex project configuration through code.
JOIN THE #TemplatesAreEvil MOVEMENT!
projen synthesizes project configuration files such as package.json,
tsconfig.json, .gitignore, GitHub Workflows, eslint, jest, etc from a
well-typed definition written in JavaScript.
Check out this talk about projen.
As opposed to existing templating/scaffolding tools, projen is not a one-off
generator. Synthesized files should never be manually edited (in fact, projen
enforces that). To modify your project setup, users interact with rich
strongly-typed class and execute projen to update their project configuration
files.
To create a new project, run the following command and follow the instructions:
$ mkdir my-project $ cd my-project $ git init $ npx projen new PROJECT-TYPE π€ Synthesizing project... ...
Currently supported project types (use npx projen new without a type for a
list):
Use
npx projen new PROJECT-TYPE --helpto view a list of command line switches that allows you to specify most project options during bootstrapping. For example:npx projen new jsii --author-name "Jerry Berry".
The new command will create a .projenrc.js file which looks like this for
jsii projects:
const { JsiiProject } = require('projen');
const project = new JsiiProject({
authorAddress: "elad.benisrael@gmail.com",
authorName: "Elad Ben-Israel",
name: "foobar",
repository: "https://github.com/eladn/foobar.git",
});
project.synth();
This program instantiates the project type with minimal setup, and then calls
synth() to synthesize the project files. By default, the new command will
also execute this program, which will result in a fully working project.
Once your project is created, you can configure your project by editing
.projenrc.js and re-running npx projen to synthesize again.
The files generated by projen are considered an "implementation detail" and projen protects them from being manually edited (most files are marked read-only, and an "anti tamper" check is configured in the CI build workflow to ensure that files are not updated during build).
For example, to setup PyPI publishing in jsii projects, you can use
python option:
const project = new JsiiProject({
// ...
python: {
distName: "mydist",
module: "my_module",
}
});
Run:
npx projen
And you'll notice that your package.json file now contains a python section in
it's jsii config and the GitHub release.yml workflow includes a PyPI
publishing step.
We recommend to put this in your shell profile, so you can simply run pj every
time you update .projenrc.js:
alias pj='npx projen'
Most projects come with an assortment of tasks that handle various
development activities, from compiling to publishing. Tasks can be and composed
together, and can be run as local commands or turned into GitHub workflows. You
can list all tasks with npx projen --help:
$ npx projen --help projen [command] Commands: projen new [PROJECT-TYPE-NAME] [OPTIONS] Creates a new projen project projen clobber hard resets to HEAD of origin and cleans the local repo projen compile Only compile projen test:compile compiles the test code projen test Run tests projen build Full release build (test+compile) projen upgrade-dependencies upgrade dependencies projen upgrade-projen upgrade projen ...
The build task is the same task that's executed in your CI builds. It
typically compiles, lints, tests and packages your module for distribution.
If installed as a global package, projen includes rich shell tab-completion support. To enable this in your shell, run:
# Bash projen completion >> ~/.bashrc # ZSH projen completion >> ~/.zshrc
Some examples for features built-in to project types:
package.jsoncompile, build, test, package
See API Reference for API details.
In addition, several projen components and project types are explained with examples in /docs (currently a work in progress!).
projen takes a "batteries included" approach and aims to offer dozens of different project types out of
the box (we are just getting started). Think projen new react, projen new angular, projen new java-maven,
projen new awscdk-typescript, projen new cdk8s-python (nothing in projen is tied to javascript or npm!)...
Adding new project types is as simple as submitting a pull request to this repo and exporting a class that
extends projen.Project (or one of it's derivatives). Projen automatically discovers project types so your
type will immediately be available in projen new.
projen is bundled with many project types out of the box, but it can also work with project types and components defined in external jsii modules (the reason we need jsii is because projen uses the jsii metadata to discover project types & options in projen new).
Say we have a module in npm called projen-vuejs which includes a single project
type for vue.js:
$ npx projen new --from projen-vuejs
If the referenced module includes multiple project types, the type is required.
Switches can also be used to specify initial values based on the project type
APIs. You can also use any package syntax supported by yarn
add like
projen-vuejs@1.2.3, file:/path/to/local/folder,
git@github.com/awesome/projen-vuejs#1.2.3, etc.
$ npx projen new --from projen-vuejs@^2 vuejs-ts --description "my awesome vue project"
Under the hood, projen new will install the projen-vuejs module from npm
(version 2.0.0 and above), discover the project types in it and bootstrap the
vuejs-ts project type. It will assign the value "my awesome vue project" to
the description field. If you examine your .projenrc.js file, you'll see
that projen-vuejs is defined as a dev dependency:
const { VueJsProject } = require('projen-vuejs');
const project = new VueJsProject({
name: 'my-vuejs-sample',
description: "my awesome vue project",
// ...
devDeps: [
'projen-vuejs'
]
});
project.synth();
See Vision.
Not at all! JavaScript is the default, but it's also possible to write it in
Java, TypeScript, or even JSON. Python support is also planned. This is made
possible by the jsii library which allows us
to write APIs once and generate libraries in several languages. You can choose
a different language by passing the --projenrc-ts, --projenrc-java, or
--projenrc-json flags when running projen new.
Note: using a .projenrc.json file to specify configuration only allows
accessing a subset of the entire API - the options which are passed to the
constructor of each project type.
Contributions of all kinds are welcome! Check out our contributor's guide and our code of conduct.
For a quick start, check out a development environment:
$ git clone git@github.com:projen/projen $ cd projen $ yarn $ yarn watch # compile in the background
Thanks goes to these wonderful people (emoji key):
Distributed under the Apache-2.0 license.
Copyright © 2021. All rights reserved.