A comprehensive Nx plugin providing executors for building, testing, and deploying applications across various platforms including AWS Lambda, ECS, S3, and local development environments.
npm install @onivoro/onixBuilds CLI applications.
Schema: No configuration options required.
Example usage:
{
"targets": {
"package-cli": {
"executor": "@onivoro/onix:build-cli"
}
}
}Command:
nx package-cli my-projectExecutes TypeORM migrations and database operations.
Configuration Options:
runOrRevert(string): TypeORM CLI command: 'run' or 'revert'envFile(string, required): Path and name of the .env file to loadormConfigPath(string, required): Path and name of the ormconfig
Example usage:
{
"targets": {
"migrate": {
"executor": "@onivoro/onix:typeorm",
"options": {
"runOrRevert": "run",
"envFile": ".env",
"ormConfigPath": "ormconfig.json"
}
},
"migrate-revert": {
"executor": "@onivoro/onix:typeorm",
"options": {
"runOrRevert": "revert",
"envFile": ".env",
"ormConfigPath": "ormconfig.json"
}
}
}
}Command:
nx migrate my-project
nx migrate-revert my-projectRuns Docker containers locally with environment configuration.
Configuration Options:
envFile(string, required): Path and name of the .env file to loadecr(string, required): Name of the ECR repository and tag (conventionally separated by a colon)port(number, required): Docker port to bind to localhost
Example usage:
{
"targets": {
"docker-run": {
"executor": "@onivoro/onix:docker-run",
"options": {
"envFile": ".env.local",
"ecr": "my-app:latest",
"port": 3000
}
}
}
}Command:
nx docker-run my-projectDeploys AWS Lambda functions with configurable runtime and environment settings.
Configuration Options:
bucket(string, required): Name of the S3 bucket to use for uploading Lambda artifactsregion(string, required): AWS regionroleArn(string, required): AWS IAM role ARN the Lambda will assumefunctionName(string): Name to use for lambda. Defaults to context.projectNameprofile(string): AWS profile name (from ~/.aws/credentials)runtime(string): NodeJS runtime versionhandler(string): Lambda handler resolution expression. Defaults to main.handlermemorySize(number): Lambda allocated memory in MBdelayMs(number): Delay in millis to wait after creating the Lambdaenvironment(object): Environment variables structured as an object
Example usage:
{
"targets": {
"deploy": {
"executor": "@onivoro/onix:deploy-lambda",
"options": {
"bucket": "my-lambda-deployments",
"region": "us-east-1",
"roleArn": "arn:aws:iam::123456789012:role/lambda-execution-role",
"runtime": "nodejs18.x",
"handler": "main.handler",
"memorySize": 256,
"environment": {
"NODE_ENV": "production",
"LOG_LEVEL": "info"
}
}
}
}
}Command:
nx deploy my-lambdaBuilds and deploys Docker images to AWS ECS services.
Configuration Options:
ecr(string, required): Name of the ECR repository and tag (conventionally separated by a colon)dockerfile(string, required): Path and name of the Dockerfileplatform(string): The platform argument for running the Docker build (example 'linux/amd64')profile(string): AWS profile name (from ~/.aws/credentials)ui(string): Name of the web/UI project to include in the assetscluster(string): AWS cluster for identifying the ECS service to redeployregion(string): AWS region for identifying the ECS service to redeployservice(string): AWS service for identifying the ECS service to redeploy
Example usage:
{
"targets": {
"deploy": {
"executor": "@onivoro/onix:deploy-ecs",
"options": {
"ecr": "my-app:latest",
"dockerfile": "Dockerfile",
"platform": "linux/amd64",
"cluster": "my-cluster",
"region": "us-east-1",
"service": "my-service",
"ui": "my-frontend"
}
}
}
}Command:
nx deploy my-apiDeploys static assets to AWS S3.
Configuration Options:
bucket(string, required): Name of the S3 bucket to use for uploading artifactsregion(string, required): AWS regionprofile(string): AWS profile name (from ~/.aws/credentials)prefix(string): The prefix for S3 upload within the specified bucketomitAcl(boolean): Whether to use acl public-read for S3 push
Example usage:
{
"targets": {
"deploy": {
"executor": "@onivoro/onix:deploy-s3",
"options": {
"bucket": "my-static-assets",
"region": "us-east-1",
"prefix": "app/v1/",
"omitAcl": false
}
}
}
}Command:
nx deploy my-static-siteDeploys React applications to AWS S3 with versioning support.
Configuration Options:
bucket(string, required): Name of the S3 bucket to use for uploading artifactsregion(string, required): AWS regionversion(string, required): Version identifier for the deploymentprofile(string): AWS profile name (from ~/.aws/credentials)omitAcl(boolean): Whether to use acl public-read for S3 push
Example usage:
{
"targets": {
"deploy": {
"executor": "@onivoro/onix:deploy-s3-react",
"options": {
"bucket": "my-react-app",
"region": "us-east-1",
"version": "1.0.0",
"omitAcl": false
}
}
}
}Command:
nx deploy my-react-appSynchronizes local directories with S3 buckets and optionally invalidates CloudFront distributions.
Configuration Options:
bucket(string, required): Name of the S3 bucket to use for uploading artifactsregion(string, required): AWS regionprofile(string): AWS profile name (from ~/.aws/credentials)omitAcl(boolean): Whether to use acl public-read for S3 pushlocalDirectory(string): Local directory to upload to S3cloudFrontId(string): CloudFront distribution ID for invalidationcloudFrontRegion(string): CloudFront region (defaults to us-east-1)env(object): Object that provides keys and values to load as environment variables
Example usage:
{
"targets": {
"deploy": {
"executor": "@onivoro/onix:deploy-s3-sync",
"options": {
"bucket": "my-website",
"region": "us-east-1",
"localDirectory": "dist",
"cloudFrontId": "E1234567890123",
"cloudFrontRegion": "us-east-1",
"env": {
"NODE_ENV": "production"
}
}
}
}
}Command:
nx deploy my-websiteDeploys Vite applications to AWS S3 with versioning support.
Configuration Options:
bucket(string, required): Name of the S3 bucket to use for uploading artifactsregion(string, required): AWS regionversion(string, required): Version identifier for the deploymentprofile(string): AWS profile name (from ~/.aws/credentials)omitAcl(boolean): Whether to use acl public-read for S3 push
Example usage:
{
"targets": {
"deploy": {
"executor": "@onivoro/onix:deploy-s3-vite",
"options": {
"bucket": "my-vite-app",
"region": "us-east-1",
"version": "2.1.0",
"omitAcl": false
}
}
}
}Command:
nx deploy my-vite-appGenerates client code from OpenAPI specifications.
Configuration Options:
openapiJsonPath(string, required): Path to the openapi definition JSON file (or yml file)outputPath(string, required): Path where the output of the openapi will be writtenflavor(string): Lowercase identifier corresponding to one of the predefined openapi generator target formats. Defaults to 'typescript-axios'
Example usage:
{
"targets": {
"generate-client": {
"executor": "@onivoro/onix:openapi-gen",
"options": {
"openapiJsonPath": "src/api/openapi.json",
"outputPath": "src/generated/api",
"flavor": "typescript-axios"
}
}
}
}Command:
nx generate-client my-apiServes applications locally with optional debugging support and S3 file copying capabilities.
Configuration Options:
debugPort(number): Debug port for Node.js debuggingenvFile(string): Path and name of the .env file to loadcopyFromS3(object): Configuration for copying files from S3 before servingprofile(string): AWS profile name (from ~/.aws/credentials)files(object): Key-value pairs where keys are S3 paths and values are local file paths
Features:
- Loads environment variables from specified
.envfile - Optionally copies files from AWS S3 to local filesystem before serving
- Supports Node.js debugging with configurable debug port
- Integrates with the project's existing development target
Example usage:
{
"targets": {
"start-local": {
"executor": "@onivoro/onix:local",
"options": {
"debugPort": 9229,
"envFile": ".env.local"
}
},
"start-with-s3": {
"executor": "@onivoro/onix:local",
"options": {
"envFile": ".env.local",
"copyFromS3": {
"profile": "dev-profile",
"files": {
"s3://my-bucket/config/app.json": "./config/app.json",
"my-bucket/data/sample.csv": "~/Downloads/sample.csv"
}
}
}
}
}
}S3 Path Formats:
- Full S3 URI:
s3://bucket-name/path/to/file - Bucket-relative path:
bucket-name/path/to/file
Local Path Features:
- Supports
~expansion to home directory - Creates directories recursively if they don't exist
- Overwrites existing files
Command:
# Basic local start
nx start-local my-project
# Start with S3 file copying
nx start-with-s3 my-projectAWS X-Ray tracing executor.
Schema: No configuration options required.
Example usage:
{
"targets": {
"trace": {
"executor": "@onivoro/onix:xray"
}
}
}Command:
nx trace my-projectRuns Playwright end-to-end tests.
Configuration Options:
envFile(string): Path and name of the .env file to load
Example usage:
{
"targets": {
"e2e": {
"executor": "@onivoro/onix:playwright",
"options": {
"envFile": ".env.test"
}
}
}
}Command:
nx e2e my-projectMany executors support loading environment variables from .env files. This is useful for managing different configurations across environments:
# .env.local
DATABASE_URL=postgresql://localhost:5432/myapp
API_KEY=dev-key-123
# .env.production
DATABASE_URL=postgresql://prod-server:5432/myapp
API_KEY=prod-key-456For AWS-related executors, you can either:
- Use AWS profile names (configured in
~/.aws/credentials) - Set AWS credentials as environment variables (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY)
You can define multiple targets for different environments:
{
"targets": {
"deploy:dev": {
"executor": "@onivoro/onix:deploy-lambda",
"options": {
"bucket": "my-app-dev",
"region": "us-east-1",
"roleArn": "arn:aws:iam::123456789012:role/lambda-dev-role"
}
},
"deploy:prod": {
"executor": "@onivoro/onix:deploy-lambda",
"options": {
"bucket": "my-app-prod",
"region": "us-east-1",
"roleArn": "arn:aws:iam::123456789012:role/lambda-prod-role"
}
}
}
}Then run with:
nx deploy:dev my-project
nx deploy:prod my-project