Skip to content

feat: implement OpenAPI auto-discovery system - #12

Open
iacapuca wants to merge 1 commit into
mainfrom
feat/openapi-discovery
Open

feat: implement OpenAPI auto-discovery system#12
iacapuca wants to merge 1 commit into
mainfrom
feat/openapi-discovery

Conversation

@iacapuca

Copy link
Copy Markdown
Contributor

Implement a self-discovery system for OpenAPI spec generation that eliminates manual registration of API apps.

Changes:

  • Add scripts/generate-all-openapi.ts for automatic app discovery
  • Update root package.json to use discovery script
  • Remove generate-openapi from individual app build scripts
  • Add comprehensive documentation in docs/OPENAPI_DISCOVERY.md
  • Update README.md with auto-discovery information
  • Add tsx as dev dependency for running discovery script

Discovery Criteria:
Apps are automatically discovered if they have:

  1. A 'generate-openapi' script in package.json
  2. A src/generate-openapi.ts file

Benefits:

  • Zero configuration - new apps are automatically discovered
  • No manual registration in any central file
  • Consistent behavior across all API services
  • Single command (pnpm generate-openapi) generates all specs
  • Specs are automatically copied to docs app

Example Output:
🔍 Discovering apps with OpenAPI generation capability...

Found 3 app(s) with OpenAPI generation: ✓ cyclist-counts (@atlas/cyclist-counts) ✓ cyclist-profile (@atlas/cyclist-profile) ✓ traffic-deaths (@atlas/traffic-deaths)

🎉 All OpenAPI specs generated successfully!

This is the first step in implementing self-discovery patterns across the monorepo to reduce manual configuration and improve developer experience.

Implement a self-discovery system for OpenAPI spec generation that eliminates
manual registration of API apps.

Changes:
- Add scripts/generate-all-openapi.ts for automatic app discovery
- Update root package.json to use discovery script
- Remove generate-openapi from individual app build scripts
- Add comprehensive documentation in docs/OPENAPI_DISCOVERY.md
- Update README.md with auto-discovery information
- Add tsx as dev dependency for running discovery script

Discovery Criteria:
Apps are automatically discovered if they have:
1. A 'generate-openapi' script in package.json
2. A src/generate-openapi.ts file

Benefits:
- Zero configuration - new apps are automatically discovered
- No manual registration in any central file
- Consistent behavior across all API services
- Single command (pnpm generate-openapi) generates all specs
- Specs are automatically copied to docs app

Example Output:
  🔍 Discovering apps with OpenAPI generation capability...

  Found 3 app(s) with OpenAPI generation:
    ✓ cyclist-counts (@atlas/cyclist-counts)
    ✓ cyclist-profile (@atlas/cyclist-profile)
    ✓ traffic-deaths (@atlas/traffic-deaths)

  🎉 All OpenAPI specs generated successfully!

This is the first step in implementing self-discovery patterns across
the monorepo to reduce manual configuration and improve developer experience.
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.

1 participant