Skip to content

Conversation

@addaleax
Copy link
Collaborator

@addaleax addaleax commented Dec 1, 2025

Copilot AI review requested due to automatic review settings December 1, 2025 10:45
@addaleax addaleax requested a review from a team as a code owner December 1, 2025 10:45
Copy link

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 enables the TypeScript erasableSyntaxOnly compiler option across the repository, which requires removing syntax that can't be cleanly erased during transpilation. The main changes involve converting TypeScript enums to const objects with string literal types, and adjusting constructor parameter properties to explicit assignments.

Key changes:

  • Converting enums to const objects with as const assertions and corresponding type definitions
  • Replacing constructor parameter properties (e.g., public config) with explicit property declarations and assignments
  • Updating all references to use string literals instead of enum values

Reviewed changes

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

Show a summary per file
File Description
configs/tsconfig-mongosh/tsconfig.common.json Enables erasableSyntaxOnly compiler option
packages/shell-api/src/enums.ts Converts ServerVersions and Topologies enums to const objects with type definitions
packages/shell-api/src/error-codes.ts Converts ShellApiErrors enum to const object
packages/errors/src/common-errors.ts Converts CommonErrors enum to const object
packages/cli-repl/src/error-codes.ts Converts CliReplErrors enum to const object
packages/async-rewriter2/src/error-codes.ts Converts AsyncRewriterErrors enum to const object
packages/node-runtime-worker-thread/src/serializer.ts Converts SerializedResultTypes enum to union type and updates usages
packages/node-runtime-worker-thread/src/rpc.ts Removes RPCMessageTypes enum and uses string literals directly
packages/build/src/config/platform.ts Converts Platform enum to union type
packages/shell-api/src/shell-instance-state.ts Updates topology assignments to use string literals
packages/shell-api/src/mongo.ts Updates decorator calls to use string literal arrays
packages/shell-api/src/database.ts Updates decorator calls to use string literal arrays
packages/shell-api/src/collection.ts Updates decorator calls to use string literal arrays and removes unused import
packages/shell-api/src/integration.spec.ts Updates test assertion to use string literal
packages/browser-runtime-core/src/autocompleter/shell-api-autocompleter.spec.ts Updates test data to use string literal and removes unused import
packages/autocomplete/src/index.spec.ts Updates test parameters to use string literals with const assertions
packages/logging/src/analytics-helpers.ts Converts constructor parameter property to explicit declaration
packages/build/src/publish-mongosh.ts Converts constructor parameter properties to explicit declarations
packages/build/src/homebrew/publish-to-homebrew.ts Converts constructor parameter property to explicit declaration
packages/build/src/evergreen/rest-api.ts Converts constructor parameter properties to explicit declarations
packages/build/src/config/config.ts Updates platform type from string to NodeJS.Platform
packages/build/src/barque.ts Updates platform comparison to use string literal and removes unused import

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@addaleax addaleax added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Dec 1, 2025
Copy link
Contributor

@gagik gagik left a comment

Choose a reason for hiding this comment

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

nice! this reminds me I need to finalize mongodb-js/vscode#1175

@addaleax addaleax merged commit 44372c1 into main Dec 1, 2025
146 of 147 checks passed
@addaleax addaleax deleted the tsconfig-enable-erasable-syntax-only branch December 1, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants