Add Common/RestClientBase to the package exports map - #210
Open
Dmitry Zhukovsky (dzhukovsky) wants to merge 1 commit into
Open
Add Common/RestClientBase to the package exports map#210Dmitry Zhukovsky (dzhukovsky) wants to merge 1 commit into
Dmitry Zhukovsky (dzhukovsky) wants to merge 1 commit into
Conversation
The exports map introduced with the ESM build restricts subpath resolution to listed entries, which broke the deep import "azure-devops-extension-api/Common/RestClientBase" — the only way to reach RestClientBase, the base class extensions extend to implement custom REST clients. Add an explicit exports entry so the long-standing import path keeps working. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since v5, the package ships an
exportsmap (generated inbuildpackage.js). The map lists the root entry and one entry per API area (./Build,./Git, ...), and — asexportsmaps do — restricts subpath resolution to the listed entries only.This broke the deep import that extensions with custom REST clients rely on:
RestClientBaseis the base class custom clients must extend (it is whatgetClient()constructs), but it is not re-exported byCommon/index.tsnor by the package root — the deep path was the only way to reach it, and it worked in every version before theexportsmap existed. With v5, bundler-mode TypeScript fails with:and bundlers refuse to resolve the path at build time for the same reason.
Fix
Add an explicit
./Common/RestClientBaseentry to the generated exports map, alongside the area entries:Both target files are already emitted by the build (
bin/Common/RestClientBase.js,bin/esm/Common/RestClientBase.js), so this only exposes what is already shipped.An explicit entry (rather than re-exporting
RestClientBasefromCommon/index.ts) restores the exact import path existing extensions already use, avoids touching the public API surface of./Common, and follows the file's existing no-wildcard convention. It also keeps the docs pipeline unaffected, since it walks subpath exports of API areas.