feat: Templates for V4.0#15
Open
rsaz wants to merge 39 commits into
Open
Conversation
Member
rsaz
commented
Dec 30, 2025
- Opinionated and Non opinionated template don't exist anymore
- Application and Micro services template are in place
…ting, and testing setup - Added .env.example for environment variable configuration - Created .gitignore to exclude unnecessary files - Implemented expressots.config.ts for CLI scaffolding - Set up Jest configuration for testing - Added package.json with scripts and dependencies - Developed basic application structure with AppController and App class - Included README.md for project documentation - Established TypeScript configuration files for building and development
…structure - Deleted .env.example and config.ts as they are no longer needed - Updated tsconfig.json to include expressots.config.ts - Simplified App class by removing logger configuration - Adjusted AppController method signature for consistency - Enhanced test setup for AppController with zero-config test app
- Added *.tsbuildinfo to .gitignore to exclude TypeScript build info files - Simplified expressots.config.ts by removing unnecessary comments - Updated jest.config.ts to include --detectOpenHandles for better test handling - Modified package.json scripts for improved test and coverage commands - Enhanced tsconfig files with incremental builds and better type definitions - Cleaned up app.ts and app.controller.spec.ts by removing commented code
- Added path mappings for useCases and controllers in tsconfig.build.json and tsconfig.json - Disabled the no-unused-vars rule in ESLint configuration for better flexibility
…s for improved performance and clarity
…ernetes, and migration templates - Introduced a new repository structure for community-maintained templates. - Added templates for various CI/CD platforms (GitHub Actions, GitLab, CircleCI, Jenkins, Bitbucket, Azure). - Included Docker configurations for production and development environments. - Provided Kubernetes manifests for deployments, services, config maps, and ingress. - Created migration checklists for transitioning from Heroku to Railway, Render, and Fly.io. - Implemented a manifest and pricing data structure for template versioning and cloud provider pricing.
…emplate - Introduced Docker Compose setup for local development and production environments. - Added multi-stage Dockerfile for optimized production builds. - Created Kubernetes manifests including ConfigMap, Deployment, Service, Ingress, and Network Policy for production readiness. - Implemented observability features with health checks and metrics endpoints. - Provided example implementations for dependency injection, event-driven architecture, and observability in the microservice context.
- Added local dependencies for @expressots/adapter-express and @expressots/core in package.json. - Refactored di-container.example.ts to simplify user service implementation and logging. - Updated event-driven.example.ts to use a simple event emitter pattern and improved event handling. - Enhanced serverless-lambda.example.ts with clearer Lambda handler creation instructions and updated deployment steps.
- Deleted Docker Compose and Dockerfile as they are no longer needed. - Removed example environment configuration and Jest configuration files. - Eliminated Kubernetes manifests including ConfigMap, Deployment, Ingress, and Network Policy. - Cleared out example implementations for dependency injection, event-driven architecture, and observability. - Updated package.json to reflect the removal of unnecessary dependencies and scripts.
- Changed the import from createMicroAPI to micro for a more streamlined API setup. - Updated the package.json to reference the correct path for @expressots/adapter-express. - Simplified the API initialization by removing unnecessary middleware parsing and directly defining the route handler.
- Updated package.json to improve project description and add relevant keywords. - Introduced new npm scripts for example execution, showcasing advanced features like Circuit Breaker, Service Discovery, and Service Client. - Expanded README.md to reflect new features and provide detailed usage instructions. - Added example implementations for Circuit Breaker, Service Discovery, Service Client, Full DI API, and Serverless deployment. - Included comprehensive examples and documentation to facilitate understanding of advanced capabilities.
…Micro - Removed the .env.local file as it is no longer needed. - Updated entryPoint in expressots.config.ts to reflect the new directory structure. - Revised package.json to use local paths for dependencies and added new testing scripts. - Modified tsconfig files to improve build settings and include test files. - Changed the API listening port from 3001 to 3000 for consistency.
- application/package.json: add missing @expressots/adapter-express, @expressots/core, @expressots/shared and reflect-metadata runtime deps, plus @expressots/cli devDependency. The new application template was missing every framework dep and would not boot. - provider/package.json: bump @expressots/core from 3.0.0 to ^4.0.0 so scaffolded providers compile against the v4 API. Made-with: Cursor
micro/package.json still had file:../adapter-express/...tgz paths from the local dev workspace. These break for end-users scaffolding via degit because the relative tarballs do not exist. Switched to ^4.0.0 (matching the application template) and added reflect-metadata.
No longer needed — the CLI dev command now uses tsx --watch directly.
application/
- src/config/app.config.ts: type-safe defineConfig + Env.string/port/enum with multi-environment defaults.
- src/main.ts: loadEnvSync for development/production/test + bootstrap reads port from appConfig.
- src/app.ts: full AppExpress lifecycle hooks (globalConfiguration, configureServices, postServerInitialization, serverShutdown), setGlobalRoutePrefix("/api"), Logger.configure with the config-driven level, setupInterceptorsForExpress with built-in performance interceptor + LoggingInterceptor, setupEventSystemForExpress with environment-aware recording/flow tracking.
- src/interceptors/logging.interceptor.ts: sample request/response timing interceptor using Logger.withContext("HTTP").
- src/events/user-created.event.ts + welcome-email.handler.ts: end-to-end @onevent demo with EventEmitter wiring via setupEventSystemForExpress.
- src/app.controller.ts: structured welcome payload + /health endpoint reading config values.
- expressots.config.ts, tsconfig.json, tsconfig.build.json, jest.config.ts: add scaffoldSchematics + path aliases + moduleNameMapper entries for interceptor / event / handler / guard / config / providers / entities / middleware (full v4 schematic set).
- test/app.controller.spec.ts: validate new endpoints with the v4 testing utilities (mockReqRes, expectBody partial matching).
- .env.example, package.json, README.md: expose APP_NAME / PORT / LOG_LEVEL, devDeps for @expressots/studio + studio-agent + class-validator + class-transformer, studio npm script, modernized walkthrough.
micro/
- src/api.ts: keep single-file footprint but add /health, configurable PORT, environment-aware banner, setErrorHandler -- representative v4 baseline.
- examples/full-di-api.example.ts: rewritten to use createMicroAPI() correctly, structured Logger, and to point users to the application template as the graduation path.
- examples/README.md + README.md: rewritten to describe each example, decision matrix between micro() / createMicroAPI() / application template, serverless adapters, and link out to expresso-ts.com guides.
- package.json: add studio + studio-agent devDeps and studio npm script.
- test/api.spec.ts: add /health test alongside the welcome message check.
These templates are now the gold path for "small to mid" and "tiny" v4 starters and back the cli/new.mdx documentation in the site repo.
Co-authored-by: Cursor <cursoragent@cursor.com>
- src/greeter.provider.ts (new): replace the empty placeholder with a real sample provider decorated with @provide(), an optional prefix configuration, and a clear DI usage example in the doc-comment. - src/index.ts: export the sample provider so the scaffold compiles and is npm-installable out of the box. - test/greeter.provider.spec.ts (new): two-case Jest suite that exercises the default greeting and the custom prefix; replaces the trivial 1+1 placeholder. - test/example.spec.ts: removed in favour of the real spec above. - README.md: rewritten as the v4 provider author guide. Quick start via degit, project layout walkthrough, "Building a provider" section covering plain helpers, adapters, cross-cutting concerns, and lifecycle decorators (@PostConstruct / @preDestroy), scripts table, publishing notes, and how a consuming v4 app installs the provider via `expressots add`. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…gement - Updated the README to enhance visual appeal with a centered layout and new header. - Streamlined content to focus on community-maintained templates for CI/CD, Docker, Kubernetes, and cloud migrations. - Added badges for npm version, license, and Discord community for better accessibility. - Improved sections for contributors and organizations, emphasizing ease of use and contribution guidelines. - Removed outdated sections and consolidated information for a more concise presentation.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ata, add .env defaults Co-authored-by: Cursor <cursoragent@cursor.com>
…cate logger, add API preset deps Co-authored-by: Cursor <cursoragent@cursor.com>
…ypes Co-authored-by: Cursor <cursoragent@cursor.com>
… application - New 'application-with-events' template — pre-wired Event Bus example (UserCreatedEvent + WelcomeEmailHandler) so the base 'application' template stays minimal and on-purpose. - application: drop events from the default template; ship .env and .env.example so dev runs work out of the box; add @Injectable() to LoggingInterceptor; remove the redundant `import "reflect-metadata"` (already implicit via core); switch LOG_LEVEL casing to uppercase to match core's parser; slim down app.ts and main.ts; refresh README; normalize tsconfig (remove deprecated baseUrl, use relative aliases).
Refactor the README's intro to reflect the API-first scaffold: fix the misplaced path-aliases bullet, note that the chosen middleware preset is applied at scaffold time, and rewrite the events callout to mention the new `--events` flag instead of the removed "Application with Events" top-level template choice. Co-authored-by: Cursor <cursoragent@cursor.com>
…Interceptor error logging - Removed commented-out code and unnecessary comments in app.ts for clarity. - Simplified postServerInitialization and serverShutdown methods in app.ts. - Updated LoggingInterceptor to improve error logging format and context in intercept method. - Cleaned up main.ts by removing redundant comments related to environment loading.
…udio calls - Remove this.logger.configure() and this.setStudio() from app.ts - Remove logger section from defineConfig in app.config.ts - Remove LoggingInterceptor from CreateModule array - Add @UseInterceptors(LoggingInterceptor) to AppController - Update .env LOG_LEVEL comments to reflect ALL level Co-authored-by: Cursor <cursoragent@cursor.com>
…cation-with-events - Cleaned up package.json files by removing unnecessary dependencies: compression, cors, express-rate-limit, and helmet, while retaining express version 5.2.1 for both application and application-with-events.
…eline Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.