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

Split ui package into utils and azureutils packages #1054

Merged
merged 25 commits into from
Feb 9, 2022

Conversation

alexweininger
Copy link
Member

@alexweininger alexweininger commented Feb 1, 2022

Working towards #1051

Work timeline

  • Create @microsoft/vscdoe-azext-azureutils package done in this PR
  • Rename @vscode-azureextensionui to @microsoft/vscode-azext-utils done in this PR
  • Publish both packages to npm, and begin migrating extensions
  • Rename utils (ui package) exports to more generic names. ex: AzureNameStepAzExtNameStep
  • Further refactoring if needed...

Changes

ui/src/index.ts shows a nice summary of what's been relocated (see ui/index.d.ts for more detailed summary).

The following has moved from ui to new azure utils package:

  • createAzureClient
  • openInPortal
  • AzureAccountTreeItemBase
  • SubscriptionTreeItemBase
  • LocationListStep
  • ResourceGroupCreateStep
  • ResourceGroupListStep
  • ResourceGroupNameStep
  • StorageAccountCreateStep
  • StorageAccountListStep
  • StorageAccountNameStep
  • VerifyProvidersStep
  • uiUtils (listAllIterator)

The following have been exported from ui and imported by azure utils package:

  • openUrl
  • addExtensionValueToMask
  • callWithMaskHandling
  • maskValue
  • nonNull utils

And I added registerAzureUtilsExtensionVariables which is a carbon copy of registerAppServiceExtensionVariables.

Migrating

I've migrated and tested locally Docker and VMs to use both of the new packages. See what those changes look like:

Notes

I plan for the new @microsoft/vscode-azext-utils package to live in utils. However, I've left the changes in the ui folder so you can see diff on GitHub. Once approved I'll revert the changes made in the ui folder. That way we're left with an unchanged version of the vscode-azureextensionui package code in case we need to make fixes/changes in there later.

@alexweininger alexweininger requested a review from a team as a code owner February 1, 2022 00:21
azure/.npmignore Show resolved Hide resolved
utils/.npmignore Show resolved Hide resolved
utils/src/utils/nonNull.ts Show resolved Hide resolved
@alexweininger
Copy link
Member Author

I plan on waiting for #1050 to be merged so I can pick up those changes.

@bwateratmsft
Copy link
Contributor

It's not related but after this PR is finished is probably a good time to fix #978.

@alexweininger alexweininger force-pushed the alex/azureUtils branch 2 times, most recently from a0bea49 to bf58858 Compare February 8, 2022 00:57
.azure-pipelines/package-steps.yml Show resolved Hide resolved
"vscode-tas-client": "^0.1.22"
},
"devDependencies": {
"@azure/core-client": "^1.5.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I know these are only being used as dev dependencies, but shouldn't these still go into the azure package?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, I moved those and the uiUtils that needed these types to the azure package. So now the only azure related (dev) dependency in the utils package is @azure/ms-rest-azure-env which we need for ISubscriptionContext.

utils/src/utils/uiUtils.ts Outdated Show resolved Hide resolved
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.

2 participants