Skip to content

Conversation

kashish2508
Copy link
Member

Packages impacted by this PR

Issues associated with this PR

Describe the problem that is addressed by this PR

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Are there test cases added in this PR? (If not, why?)

Provide a list of related PRs (if any)

Command used to generate this PR:**(Applicable only to SDK release request PRs)

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)

@Copilot Copilot AI review requested due to automatic review settings September 9, 2025 10:58
Copy link
Contributor

@Copilot 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 fixes ESM (ECMAScript Module) migration issues in the microsoft-playwright-testing package by addressing import/require conflicts and updating TypeScript configurations.

  • Replaced require() calls with ESM-compatible module loading using createRequire from Node.js
  • Refactored package version retrieval to work in both ESM and CommonJS environments
  • Updated TypeScript configuration files for proper ESM formatting

Reviewed Changes

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

Show a summary per file
File Description
tsconfig.src.json Reformatted array formatting for consistency
tsconfig.snippets.json Reformatted array formatting for consistency
tsconfig.samples.json Reformatted array formatting for consistency
tsconfig.browser.config.json Reformatted array formatting for consistency
src/utils/utils.ts Replaced require-based package version loading with new ESM-compatible approach
src/utils/getPackageVersion.ts New ESM module for package version retrieval using createRequire
src/utils/getPackageVersion-cjs.cts New CommonJS module for package version retrieval
src/core/playwrightServiceUtils.ts Updated ESM path construction with improved variable naming
src/core/playwrightServiceUtils-cjs.cts Simplified path joining logic
eslint.config.mjs Removed deprecated ESLint rule exclusion

Copy link
Member

@puagarwa puagarwa left a comment

Choose a reason for hiding this comment

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

can we check implementation in our other package for similar logic and keep it same here ?

__dirname,
"./global/playwright-service-global-teardown.js",
);
export const globalSetupPath = path.join(path.join(__dirname, "./global/playwright-service-global-setup.js"));
Copy link
Member

Choose a reason for hiding this comment

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

what was the issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants