Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev-tool] Create migration tool #30030

Merged
merged 6 commits into from
Jun 14, 2024
Merged

[dev-tool] Create migration tool #30030

merged 6 commits into from
Jun 14, 2024

Conversation

mpodwysocki
Copy link
Contributor

@mpodwysocki mpodwysocki commented Jun 12, 2024

Packages impacted by this PR

  • @azure/dev-tool

Issues associated with this PR

Describe the problem that is addressed by this PR

Creates a starter migration toolkit for projects to move to ESM and vitest. This project for dev-tool introduces a tool invoked such as the following to migrate service-bus

dev-tool admin migrate-package --package-name=@azure/service-bus

This does the following:

  • Changes the package.json for the following:
    • Removes chai/mocha/karma
    • Adds vitest and tshy
    • Modifies the build and test commands
    • Renames the mapped files to the proper output type such as -browser.mts
  • Changes the tsconfig.json for the following:
    • Moves module and moduleResolution to NodeNext
    • Removes outDir and declarationDir
  • Fixes the source files
    • Uses extension for files such as "foo.js" instead of "foo"
    • Removes "chai" usage
    • Adds vitest usage for spec files
  • Fixes api-extractor.json
    • Fixes input path for source
    • Fixes output trimmed path
  • Migrate Testing
    • Writes for both browser and node unit tests
    • Writes config for building browser bundle
    • Removes .nycrc and Karma configuration

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)

Copy link
Member

@maorleger maorleger left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Contributor

@jeremymeng jeremymeng left a comment

Choose a reason for hiding this comment

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

This is awesome!

@jeremymeng
Copy link
Contributor

We can have incremental improvements to this tool later as we apply the migration to more packages. One example I can think of is to remove this: Mocha.Context or this: Context from test callbacks.

@mpodwysocki mpodwysocki enabled auto-merge (squash) June 13, 2024 18:06
@jeremymeng jeremymeng closed this Jun 14, 2024
auto-merge was automatically disabled June 14, 2024 17:35

Pull request was closed

@jeremymeng jeremymeng reopened this Jun 14, 2024
@jeremymeng jeremymeng requested a review from timovv as a code owner June 14, 2024 17:35
@jeremymeng jeremymeng merged commit 46679df into main Jun 14, 2024
20 checks passed
@jeremymeng jeremymeng deleted the feat/dtx-migrate branch June 14, 2024 17:36
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.

None yet

3 participants