Projen project types with standard configuration for consistent project setup across all repositories.
pnpm add -D @nikovirtala/projen-constructs projen constructs
ProjectType enum from Projen's JSII manifest (18 project types)ProjectGenerator creates project classes with standard configurationOverride any option by passing it to the constructor:
const project = new JsiiProject({
name: "my-project",
repositoryUrl: "https://github.com/nikovirtala/my-project.git",
minNodeVersion: "20.0.0",
author: "Custom Author",
authorAddress: "custom@example.com",
mise: false,
vitest: false,
tsconfig: {
compilerOptions: {
noUnusedLocals: false,
},
},
biomeOptions: {
biomeConfig: {
formatter: {
lineWidth: 100,
},
},
},
});
import { AwsCdkConstructLibraryProject } from "@nikovirtala/projen-constructs";
const project = new AwsCdkConstructLibraryProject({
name: "my-cdk-construct",
repositoryUrl: "https://github.com/nikovirtala/my-cdk-construct.git",
});
project.synth();
import { AwsCdkTypeScriptAppProject } from "@nikovirtala/projen-constructs";
const project = new AwsCdkTypeScriptAppProject({
name: "my-cdk-app",
repositoryUrl: "https://github.com/nikovirtala/my-cdk-app.git",
});
project.synth();
import { JsiiProject } from "@nikovirtala/projen-constructs";
const project = new JsiiProject({
name: "my-jsii-project",
repositoryUrl: "https://github.com/nikovirtala/my-jsii-project.git",
});
project.synth();
import { TypeScriptProject } from "@nikovirtala/projen-constructs";
const project = new TypeScriptProject({
name: "my-typescript-project",
repositoryUrl: "https://github.com/nikovirtala/my-typescript-project.git",
});
project.synth();
The package includes reusable components for common development tasks:
Vitest testing framework component.
import { Vitest } from "@nikovirtala/projen-constructs";
new Vitest(project, {
vitestVersion: "^4",
config: {
coverageProvider: CoverageProvider.V8,
coverageReporters: [CoverageReporter.TEXT, CoverageReporter.LCOV],
},
});
TypeDoc documentation generation component.
import { TypeDoc, EntryPointStrategy } from "@nikovirtala/projen-constructs";
new TypeDoc(project, {
version: "^0.28",
typeDocConfig: {
entryPointStrategy: EntryPointStrategy.EXPAND,
out: "docs/api",
exclude: ["**/*.test.ts"],
},
});
Mise dev tools/runtimes management component.
import { Mise } from "@nikovirtala/projen-constructs";
new Mise(project, {
nodeVersion: "22.21.1",
});
Homebrew package management component.
import { Homebrew } from "@nikovirtala/projen-constructs";
const homebrew = new Homebrew(project, {
packages: ["jq", "yq"],
});
homebrew.addPackage("gh");
Colima container runtime component. Alternative for Docker.
import { Colima } from "@nikovirtala/projen-constructs";
new Colima(project);
LocalStack AWS emulation component.
import { LocalStack } from "@nikovirtala/projen-constructs";
new LocalStack(project, {
services: ["s3", "lambda", "dynamodb"],
port: 4566,
debug: true,
});
Generates AWS CDK Lambda Function constructs and bundles their code.
import { LambdaFunctionConstructGenerator } from "@nikovirtala/projen-constructs";
new LambdaFunctionConstructGenerator(project, {
sourceDir: "src/handlers",
outputDir: "src/constructs/lambda",
filePattern: "*.lambda.ts",
esbuildOptions: {
minify: true,
sourcemap: true,
},
});
Low-level bundling utilities for Lambda functions.
import {
Bundler,
LambdaFunctionCodeBundle,
} from "@nikovirtala/projen-constructs";
const bundler = new Bundler(project, {
assetsDir: "assets",
esbuildVersion: "^0.25",
});
new LambdaFunctionCodeBundle(project, {
entrypoint: "src/my-function.lambda.ts",
extension: ".lambda.ts",
});
Generates TypeScript project classes with standard configuration.
import { ProjectGenerator, ProjectType } from "@nikovirtala/projen-constructs";
new ProjectGenerator(project, {
name: "TypeScriptProject",
projectType: ProjectType.TYPESCRIPT,
filePath: "./src/projects/typescript.generated.ts",
components: [
{ componentClass: Mise },
{ componentClass: Vitest }, // Auto-detects VitestOptions from JSII manifest
],
});
Features:
ProjectType enum from Projen's JSII manifest