Skip to content

feat(nestjs): add middleware support (#21), update post commit scripts #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 19, 2025

Conversation

Groupguanfang
Copy link
Owner

No description provided.

@Copilot Copilot AI review requested due to automatic review settings April 19, 2025 14:36
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds middleware support for NestJS and updates the post-commit scripts. Key changes include:

  • Enhancements to middleware resolution and initialization for both NestJS and Express adapters.
  • Updates to the changeset filtering logic in post-commit scripts to account for private workspaces.
  • Minor adjustments in route patterns in the NestJS fixture module.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/post-commit.ts Updated changeset options and package JSON merging logic
packages/server/web/src/types/restful-scanner.ts Introduced InitializeContext and middleware initialization types
packages/server/web/src/plugins/restful.ts Added middleware initialization call for connect adapter
packages/server/web-express/src/adapter.ts Implemented initialize() for Express adapter
packages/adapter/adapter-nestjs/src/restful/restful-scanner.ts Replaced middleware execution with MiddlewareResolver integration
packages/adapter/adapter-nestjs/src/restful/restful-handler.ts Added initialization for NestJS middleware in restful handler
packages/adapter/adapter-nestjs/src/restful/method-operator.ts Added method to retrieve matched middlewares
packages/adapter/adapter-nestjs/src/restful/controller-wrapper.ts Adjusted HTTP method conversion to use the restful scanner method
packages/adapter/adapter-nestjs/src/middleware/middleware-resolver.ts New resolver implementation for middleware resolution
packages/adapter/adapter-nestjs/src/middleware/middleware-customer.ts Updated middleware route types
fixtures/nestjs/src/app.module.ts Modified route pattern in middleware consumer configuration
.changeset/260ea40f92d187fc13dd42cd404b6c3085cf3d7e.md Added changeset configuration for dependency version bumps
Comments suppressed due to low confidence (1)

fixtures/nestjs/src/app.module.ts:12

  • The change from using '*' to '*path' in the forRoutes method may unintentionally restrict the middleware to only match paths ending with 'path'. Please verify that '*path' is the intended route pattern.
consumer.apply(AppMiddleware).forRoutes('*path')

@Groupguanfang Groupguanfang merged commit 562ba97 into v1 Apr 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants