A monorepo example demonstrating how to use Yarn workspaces with the Serverless Framework and TypeScript project references.
Serverless Mono Repo Typescript References example is a demonstration repository that shows how to structure and manage a monorepo for serverless applications. It combines Yarn workspaces, TypeScript project references, and the Serverless Framework to enable efficient development, testing, and deployment of multiple interdependent packages. The example solves the complexity of building and deploying TypeScript-based serverless services in a shared codebase.
Developers and teams building serverless applications on AWS Lambda who want to organize their code in a monorepo with TypeScript. It's particularly useful for those managing multiple services with shared dependencies.
It provides a ready-to-use template with best practices for monorepo tooling, eliminating the setup overhead. The integration of TypeScript project references ensures type safety and optimal build performance, while the Serverless Framework integration streamlines deployment workflows.
Example repo on how to use yarn workspaces together with the serverless framework.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages TypeScript references to enable intelligent compilation order based on package dependencies, ensuring efficient builds and robust type safety across the monorepo as described in the README.
Provides root-level commands to build and deploy all serverless services based on dependency graphs, streamlining workflows for multi-package development and deployment.
Uses ts-node to run tests directly on TypeScript source code, eliminating the need for compilation and speeding up the development feedback loop, as highlighted in the features.
Includes a dedicated 'packages/types' package for defining custom typings for external packages, promoting consistency and type safety throughout the monorepo.
Real-time type checking across packages doesn't work reliably in VS Code, only partially in WebStorm, as acknowledged in the open issues, hindering developer experience for some IDEs.
Due to a Serverless Framework bug, deployment artifacts include unnecessary dependencies, increasing package size and potentially raising AWS Lambda costs, with a slow manual workaround noted.
Yarn workspace hoisting is disabled for serverless packages (prefixed with 'sls-'), complicating dependency management and leading to larger individual service bundles.