Skip to content

Conversation

@nbbeeken
Copy link
Collaborator

Description

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@github-actions github-actions bot added the fix label Aug 25, 2025
@nbbeeken nbbeeken marked this pull request as ready for review August 26, 2025 17:50
Copilot AI review requested due to automatic review settings August 26, 2025 17:50
@nbbeeken nbbeeken requested a review from a team as a code owner August 26, 2025 17:50
Copy link
Contributor

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 TypeScript type definition bundling for the compass-web package to ensure proper type definitions are available for external consumers. The changes focus on setting up API Extractor to generate clean, consolidated type definitions and implementing proper type safety validation.

  • Configures API Extractor to bundle type definitions into a single compass-web.d.ts file
  • Adds type safety testing infrastructure to verify external consumer compatibility
  • Exports additional type definitions and marks key functions as public APIs

Reviewed Changes

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

Show a summary per file
File Description
packages/compass-web/package.json Updates build pipeline to include API extractor and type testing
packages/compass-web/api-extractor.json Configures API Extractor for bundling type definitions
packages/compass-web/src/index.tsx Exports additional type definitions for external consumers
packages/compass-web/src/entrypoint.tsx Adds public API annotations and refines type definitions
packages/compass-web/src/url-builder.ts Marks functions as public API
packages/compass-web/src/logger.tsx Marks type definitions as public API
packages/compass-web/scripts/clean-dts.mjs Script to clean up intermediate type definition files
packages/compass-web/test/types/ Test infrastructure to validate type definitions work for external consumers
packages/compass-connections/src/stores/store-context.tsx Fixes void return type issue

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@gribnoysup gribnoysup left a comment

Choose a reason for hiding this comment

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

Looks awesome, thanks for tackling this one! Left two notes: one is tiny nit, another should help to resolve the issue in CI, otherwise this looks good to be merged to me

},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I think not providing a value at all basically has the same effect

Suggested change
"untrimmedFilePath": "",

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea an old version of api-extractor required this exist, anyway, gone!

"types": "./dist/index.d.ts",
"types": "./dist/compass-web.d.ts",
"scripts": {
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Check in CI is currently failing because we don't have a bootstrap script in compass-web (it was just not needed before). Now that check depends on some assets being produced, we probably should add it. I don't think we need to waste CI (and local bootstrap for that matter) time building compass-web completely, but definitely looks like we'd need types built

Suggested change
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
"bootstrap": "npm run postcompile",
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done!

@nbbeeken nbbeeken added the no release notes Fix or feature not for release notes label Aug 27, 2025
@nbbeeken nbbeeken merged commit 5a26679 into main Aug 27, 2025
59 checks passed
@nbbeeken nbbeeken deleted the COMPASS-9733 branch August 27, 2025 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants