Skip to content

Correct #platform subpath mappings in generated package metadata and emitted helper imports#3997

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-package-json-platform-imports
Open

Correct #platform subpath mappings in generated package metadata and emitted helper imports#3997
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-package-json-platform-imports

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

Generated Azure monorepo package metadata was emitting #platform imports with .js-suffixed keys/targets, while emitted helper imports also used .js suffixes that do not match the intended subpath pattern. This updates both metadata generation and emitted/import-rewritten specifiers to use extensionless #platform/* subpaths with source .ts/.mts targets.

  • Package.json imports generation (rlc-common)

    • Switched subpath key from #platform/*.js to #platform/*.
    • Updated source targets to TypeScript sources:
      • browser: ./src/*-browser.mts
      • react-native: ./src/*-react-native.mts
      • default: ./src/*.ts
    • Applied in both initial package generation and package update/migration paths.
  • Emitter subpath import specifiers (typespec-ts)

    • Removed .js suffix from generated #platform/... helper imports in binder logic.
    • Updated static-helper import rewrite for platform-types to emit #platform/static-helpers/platform-types (no extension).
  • Focused coverage updates

    • Expanded package metadata tests to assert exact imports shape for default and react-native variants.
    • Added integration assertions that binder/static-helper rewriting emits extensionless #platform/... specifiers.
{
  "imports": {
    "#platform/*": {
      "browser": "./src/*-browser.mts",
      "react-native": "./src/*-react-native.mts",
      "default": "./src/*.ts"
    }
  }
}
import { getBinaryResponse } from "#platform/static-helpers/serialization/get-binary-response";

Copilot AI changed the title [WIP] Fix package.json incorrect #platform imports Correct #platform subpath mappings in generated package metadata and emitted helper imports May 21, 2026
Copilot AI requested a review from jeremymeng May 21, 2026 21:00
@jeremymeng jeremymeng marked this pull request as ready for review May 21, 2026 21:30
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.

generated package.json has incorrect #platform imports

2 participants