Skip to content

Handle Express Router imports after block comment banners#70

Merged
steipete merged 5 commits into
openclaw:mainfrom
rohitjavvadi:fix/express-banner-imports
May 18, 2026
Merged

Handle Express Router imports after block comment banners#70
steipete merged 5 commits into
openclaw:mainfrom
rohitjavvadi:fix/express-banner-imports

Conversation

@rohitjavvadi
Copy link
Copy Markdown
Contributor

Summary

This updates the Node route mapper so Express Router imports are detected when a block comment banner appears immediately before the import.

Example shape this now handles:

/* route imports */ import { Router as ApiRouter } from "express";

const router = ApiRouter();
router.get("/health", health);

Without this, routes created from the aliased router factory could be skipped during feature mapping.

The matcher stays conservative:

  • non-Express imports are not treated as Express router factories
  • fully commented-out Express imports are ignored
  • multiline and stacked block comment banners are handled
  • semicolon-prefixed same-line imports are handled

Validation

  • Formatter check
  • Lint
  • Typecheck
  • Build
  • Mapper test suite
  • Full test suite

Comment thread src/mappers/node-routes.ts Fixed
Comment thread src/mappers/node-routes.ts Fixed
@rohitjavvadi rohitjavvadi force-pushed the fix/express-banner-imports branch from efc2cee to 047e61b Compare May 18, 2026 05:49
@steipete steipete merged commit e9f90a4 into openclaw:main May 18, 2026
6 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.

3 participants