Skip to content

auth: Convert from CJS to CJS+ESM, adopt finalized auth challenges API - #2092

Merged
Brandon Waterloo (bwateratmsft) merged 4 commits into
mainfrom
bmw/authEsmCjs
Oct 7, 2025
Merged

Brandon Waterloo (bwateratmsft) merged 4 commits into
mainfrom
bmw/authEsmCjs

Conversation

@bwateratmsft

@bwateratmsft Brandon Waterloo (bwateratmsft) commented Oct 7, 2025 •

Copy link
Copy Markdown
Contributor

See also #2091. Some files are the same since they haven't both been merged to main yet. Also note #2091 (comment).

In addition to the changes in the title I did a little light refactoring.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Converts the auth package from CommonJS (CJS) to dual CJS+ESM module format and adopts the finalized auth challenges API from VS Code 1.105.0. This change enables the package to work in both CommonJS and ESM environments while updating to use the stable authentication challenges API.

Key changes:

  • Migrated to dual build system supporting both ESM and CJS outputs
  • Updated to use finalized VS Code authentication challenges API instead of deprecated version
  • Refactored parameter naming for better clarity (e.g., scopes → scopeOrListOrRequest)

Reviewed Changes

Copilot reviewed 15 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.base.new.json New base TypeScript configuration for ESM builds
auth/tsconfig.json Updated to use new base config and ESM output directory
auth/package.json Added dual module support with separate ESM/CJS builds and updated VS Code engine requirement
auth/src/index.ts Added temporary type declarations for VS Code 1.105.0 authentication API
auth/src/getSessionFromVSCode.ts Refactored to use finalized auth challenges API and improved parameter handling
auth/src/VSCodeAzureSubscriptionProvider.ts Updated parameter names to match new API
auth/src/AzureAuthentication.ts Updated interface parameter name for consistency
auth/test/index.ts Updated imports to use default imports for ESM compatibility
auth/test/runTest.ts Fixed path resolution and reordered imports
auth/test/extension/extension.js Simplified test extension by removing unused functionality
auth/.vscode/tasks.json Updated build task to use new build script
auth/.vscode/launch.json Updated paths to use CJS build output
auth/.npmignore Modified to exclude source files properly
README.md Updated development instructions and examples
.nvmrc Updated Node.js version to 22.18
Files not reviewed (1)
  • auth/package-lock.json: Language not supported

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

Comment thread auth/src/getSessionFromVSCode.ts Resolved
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