Thank you for your interest in contributing to astro-aws! This document provides guidelines and instructions for contributing to the project.
- Getting Started
- Development Setup
- Project Structure
- Making Changes
- Testing
- Code Style
- Submitting Changes
- Release Process
- Node.js: Version 22.x or 24.x
- Bun: Version 1.3.5 (specified in
package.json) - Git: For version control
- AWS Account: For testing infrastructure deployments (optional, but recommended)
- Fork the repository on GitHub
- Clone your fork:
git clone ssh://git@github.com/YOUR_USERNAME/astro-aws.git cd astro-aws - Add the upstream repository:
git remote add upstream ssh://git@github.com/lukeshay/astro-aws.git
This project uses Bun as the package manager. Install dependencies:
bun installBuild all packages:
bun run buildBuild a specific package:
bun run build:one @astro-aws/adapterStart development servers:
bun run devStart a specific workspace:
bun run dev:one @astro-aws/examples-baseThis is a monorepo managed with Bun workspaces and Turbo:
astro-aws/
├── apps/ # Applications
│ ├── docs/ # Documentation site
│ └── infra/ # AWS CDK infrastructure
├── examples/ # Example Astro applications
│ └── base/ # Base example
├── packages/ # Published packages
│ ├── adapter/ # Astro adapter for AWS Lambda
│ └── constructs/ # AWS CDK constructs
└── scripts/ # Build and utility scripts
- @astro-aws/adapter: The Astro adapter that handles deployment to AWS Lambda
- @astro-aws/constructs: AWS CDK constructs for deploying Astro applications
- @astro-aws/scripts: Internal build scripts
Create a new branch for your changes:
git checkout -b feature/your-feature-nameOr for bug fixes:
git checkout -b fix/your-bug-fix-name- Make your changes in the appropriate package or workspace
- Ensure your code follows the project's code style (see Code Style)
- Add tests if you're adding new functionality
- Update documentation if needed
Run tests:
bun run testRun tests for a specific package:
bun run test:one @astro-aws/adapterFormat code using Prettier:
bun run formatRun all tests:
bun run testRun tests for a specific package:
bun run test:one @astro-aws/adapterTo test infrastructure changes, you'll need AWS credentials configured:
# Set AWS environment variables
export AWS_ACCOUNT=your-account-id
export AWS_REGION=us-east-1 # us-east-1 is recommended; us-west-2 may be restricted by SCPs in some accounts
export AWS_PROFILE=your-profile
# Build the infra package first
bun run build:one @astro-aws/infra
# Synthesize CDK stacks (PERSONAL environment targets your account with no custom domain)
AWS_PROFILE=$AWS_PROFILE AWS_ACCOUNT=$AWS_ACCOUNT AWS_REGION=$AWS_REGION npx cdk synth "AstroAWS-PERSONAL-*" --app "node --enable-source-maps dist/bin/infra.js"
# Deploy a specific stack (use with caution)
AWS_PROFILE=$AWS_PROFILE AWS_ACCOUNT=$AWS_ACCOUNT AWS_REGION=$AWS_REGION npx cdk deploy "AstroAWS-PERSONAL-Website-nodejs24-ssr" --require-approval neverNote: The
PERSONALenvironment deploys without custom domains or hosted zones, making it safe for sandbox/personal account testing. CDK must be bootstrapped in your target account and region first (npx cdk bootstrap).
- Use TypeScript for all code
- Follow the existing code style
- Use meaningful variable and function names
- Add type annotations where helpful
- Code is formatted using Prettier
- Run
bun run formatbefore committing - Prettier config:
@lshay/prettier-config
- Keep functions and classes focused and single-purpose
- Add comments for complex logic
- Follow existing patterns in the codebase
Write clear, descriptive commit messages:
feat: add support for streaming SSR responses
fix: resolve CloudFront cache invalidation issue
docs: update getting started guide
-
Update your branch: Make sure your branch is up to date with
main:git checkout main git pull upstream main git checkout your-branch git rebase main
-
Run checks: Ensure all tests pass and code is formatted:
bun run build bun run test bun run format -
Create Pull Request:
- Push your branch to your fork
- Create a pull request on GitHub
- Fill out the PR template with:
- Description of changes
- Related issues (if any)
- Testing performed
- Screenshots (if applicable)
-
Respond to feedback: Be responsive to code review comments and make requested changes
- Keep PRs focused and reasonably sized
- Include tests for new features
- Update documentation as needed
- Ensure CI checks pass
This project uses Changesets for version management.
When making changes that should be released:
-
Create a changeset:
bun run changeset
-
Select the packages affected
-
Choose the type of change (major, minor, patch)
-
Describe your changes
The release process is handled by maintainers:
-
Prepare release:
bun run release:prepare- Builds all packages
- Synthesizes CDK stacks
- Versions packages based on changesets
- Formats code
-
Cut release:
bun run release:cut- Deploys infrastructure
- Publishes packages
- Pushes tags
If you have questions or need help, please:
- Open an issue on GitHub
- Check existing issues and discussions
- Review the documentation
Thank you for contributing to astro-aws! 🚀