Skip to content

Ensure regenerated modular package.json includes @azure/core-util runtime dependency#3996

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-missing-azure-core-util-dependency
Open

Ensure regenerated modular package.json includes @azure/core-util runtime dependency#3996
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-missing-azure-core-util-dependency

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

Some generated modular clients import uint8ArrayToString/stringToUint8Array from @azure/core-util, but the migration/update path for existing package.json did not guarantee that dependency was added.

  • Problem scope

    • New package generation already handled Azure modular dependency injection, but updatePackageFile-based regeneration could miss runtime deps required by generated models/helpers.
  • Generator update: include @azure/core-util in modular update flow

    • Updated packages/typespec-ts/src/index.ts so modular package updates add @azure/core-util (Azure flavor) in the same dependency bundle used during package migration updates.
  • Package updater enhancement: merge caller-provided dependencies

    • Updated packages/rlc-common/src/metadata/buildPackageFile.ts:
      • updatePackageFile(...) now accepts dependencies in options.
      • Added dependency updates to early-return conditions.
      • Merges provided dependencies into existing packageInfo.dependencies instead of ignoring them.
  • Focused regression coverage

    • Added integration test in packages/rlc-common/test/integration/packageJson.spec.ts verifying updatePackageFile(...) preserves existing deps and merges new ones like @azure/core-util.
const packageFileContent = updatePackageFile(model, initialPackageInfo, {
  dependencies: {
    "@azure/core-util": "^1.9.2"
  }
});

Copilot AI changed the title [WIP] Fix missing @azure/core-util dependency in generated code Ensure regenerated modular package.json includes @azure/core-util runtime dependency May 21, 2026
Copilot AI requested a review from jeremymeng May 21, 2026 21:07
@jeremymeng jeremymeng marked this pull request as ready for review May 21, 2026 21:31
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.

Missing @azure/core-util dependency when generated code import from it

2 participants