[core] Remove @azure/core-asynciterator-polyfill usage (#21290)

* Remove @azure/core-asynciterator-polyfill usage

* Remove @azure/core-asynciterator-polyfill usage

* Remove from workspace too

* Remove from core artifacts list

* Make eslint happy

* Fix more eslint errors

Co-authored-by: Jeremy Meng <yumeng@microsoft.com>
This commit is contained in:
Matthew Podwysocki 2022-04-11 17:17:23 -04:00 коммит произвёл GitHub
Родитель 21c67418da
Коммит 2230ad9cc7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
34 изменённых файлов: 69 добавлений и 331 удалений

Просмотреть файл

@ -183,7 +183,6 @@ specifiers:
'@rush-temp/confidential-ledger': file:./projects/confidential-ledger.tgz
'@rush-temp/container-registry': file:./projects/container-registry.tgz
'@rush-temp/core-amqp': file:./projects/core-amqp.tgz
'@rush-temp/core-asynciterator-polyfill': file:./projects/core-asynciterator-polyfill.tgz
'@rush-temp/core-auth': file:./projects/core-auth.tgz
'@rush-temp/core-client': file:./projects/core-client.tgz
'@rush-temp/core-client-1': file:./projects/core-client-1.tgz
@ -457,7 +456,6 @@ dependencies:
'@rush-temp/confidential-ledger': file:projects/confidential-ledger.tgz
'@rush-temp/container-registry': file:projects/container-registry.tgz
'@rush-temp/core-amqp': file:projects/core-amqp.tgz
'@rush-temp/core-asynciterator-polyfill': file:projects/core-asynciterator-polyfill.tgz
'@rush-temp/core-auth': file:projects/core-auth.tgz
'@rush-temp/core-client': file:projects/core-client.tgz
'@rush-temp/core-client-1': file:projects/core-client-1.tgz
@ -5909,6 +5907,7 @@ packages:
/lru-cache/7.4.2:
resolution: {integrity: sha512-Xs3+hFPDSKQmL05Gs6NhvAADol1u9TmLoNoE03ZjszX6a5iYIO3rPUM4jIjoBUJeTaWEBMozjjmV70gvdRfIdw==}
engines: {node: '>=12'}
deprecated: Please update to latest patch version to fix memory leak https://github.com/isaacs/node-lru-cache/issues/227
dev: false
/lunr/2.3.9:
@ -9091,7 +9090,7 @@ packages:
dev: false
file:projects/app-configuration.tgz:
resolution: {integrity: sha512-viaBpInDzOxVVDJHOq/AoRzgfQnK5lFalmAQraZZtv9miXnnhjpocos/smSYGMRNObwHKPXgJRZXinZJEpd0jA==, tarball: file:projects/app-configuration.tgz}
resolution: {integrity: sha512-MwpJxCKwaeur8hR7eA4HtYTRnBqkapZUO3uXS4MLvYsyEqMlBUxMu5R8KV9PK68a40PGzRbKyxJzjA61PeOU+A==, tarball: file:projects/app-configuration.tgz}
name: '@rush-temp/app-configuration'
version: 0.0.0
dependencies:
@ -14153,20 +14152,6 @@ packages:
- utf-8-validate
dev: false
file:projects/core-asynciterator-polyfill.tgz:
resolution: {integrity: sha512-GpIo8tI50+VINBys3AHw8vrLY2nyzln2wybGK6diXtnESTBIxDNsglH3sbB9K0mtTbjLsHsg/Rmuhor7Mkc4xQ==, tarball: file:projects/core-asynciterator-polyfill.tgz}
name: '@rush-temp/core-asynciterator-polyfill'
version: 0.0.0
dependencies:
'@types/node': 12.20.46
eslint: 7.32.0
prettier: 2.5.1
rimraf: 3.0.2
typescript: 4.2.4
transitivePeerDependencies:
- supports-color
dev: false
file:projects/core-auth.tgz:
resolution: {integrity: sha512-pvT5jz5/26W7t5fcru8y+Y9DgQAja/FPbVYyoViyJXMn33X2au1Z6sZkoWHpH0j3OGpTRgXXWxIbBfN2mTeJNQ==, tarball: file:projects/core-auth.tgz}
name: '@rush-temp/core-auth'
@ -14193,7 +14178,7 @@ packages:
dev: false
file:projects/core-client-1.tgz:
resolution: {integrity: sha512-R1d7k0BfA0KVeo8reFupEybFUaWdZNRcQWItkGh9ygtVlbEnRytOHh0RTomrHMXlCdVlQA6xxgAURkLK6lPssQ==, tarball: file:projects/core-client-1.tgz}
resolution: {integrity: sha512-KhMfs93o502xbS79pxmXfthe8EhN//elKfs1c2kkZDNl82B36e2jVxAnMAQMuXRQQvHIfAcgXknAkTcW5ZtcVA==, tarball: file:projects/core-client-1.tgz}
name: '@rush-temp/core-client-1'
version: 0.0.0
dependencies:
@ -14339,7 +14324,7 @@ packages:
dev: false
file:projects/core-http.tgz:
resolution: {integrity: sha512-jiD6yigzItg43NzPs/AN8oxAa8fXDsZPx920Sq7DGPlslluxiFzwdrLV1AGEVLZJAtxr+hIQIozsQBm5MHBOhg==, tarball: file:projects/core-http.tgz}
resolution: {integrity: sha512-TH+e3HkFGnRlIhsTO4QOlUIsntX1zT1tH+GVGT0GfpaRZuHZOz6malgjxoZbC4hp4cKb2hPPT5s6Dop0YioLbw==, tarball: file:projects/core-http.tgz}
name: '@rush-temp/core-http'
version: 0.0.0
dependencies:
@ -14449,7 +14434,7 @@ packages:
dev: false
file:projects/core-paging.tgz:
resolution: {integrity: sha512-Iw1Im8b4uxzs0xgW0iUPjd9r2KhLdgG0RYSE6YI6J1ttE9dzmug4gj9THTQlqOv0MAcoI2EAWAFWTh/QwRawFA==, tarball: file:projects/core-paging.tgz}
resolution: {integrity: sha512-7fa9r8In56omHTMiMAUc6nmacLpire9VQ5Qk5HmKoIuuArQZrz1u7mwxQ8JZQSQoy+AscNvPb40hM8QJKt2mPQ==, tarball: file:projects/core-paging.tgz}
name: '@rush-temp/core-paging'
version: 0.0.0
dependencies:
@ -14943,7 +14928,7 @@ packages:
dev: false
file:projects/event-hubs.tgz:
resolution: {integrity: sha512-jNawieawXJuUErO4DrKLwiZ/FBY2JTn9YJpOLpf/6rhLrvIc7wIyRyb0/PqWUIa0TfPDcv0P5pauk2yxgDPVAQ==, tarball: file:projects/event-hubs.tgz}
resolution: {integrity: sha512-JwE5R695+iuOoHFav9h+SfGKwKYKsaDuQNQ3/aB7cBRgDo7ZKMXvfjw+bN9W5x3nG+BAZ30wENMfVN5aaQxWyQ==, tarball: file:projects/event-hubs.tgz}
name: '@rush-temp/event-hubs'
version: 0.0.0
dependencies:
@ -15729,7 +15714,7 @@ packages:
dev: false
file:projects/mock-hub.tgz:
resolution: {integrity: sha512-LlpgK1cB6WNMiX6Zq+iQ8+uYzOOSzwdW7BGwRSy7y+vNJD1Dfiqj3DTPAWJ8l82oGD7h6tQJoC7Q884CKbGwWw==, tarball: file:projects/mock-hub.tgz}
resolution: {integrity: sha512-Yh6zEw8v/EZxlj3t43XsBcGz/76BSkEpvjpHatkL71Jh7a7pxhccAbA/J7VLajZGvQqhUK2rghOdorz6Q2OLLw==, tarball: file:projects/mock-hub.tgz}
name: '@rush-temp/mock-hub'
version: 0.0.0
dependencies:
@ -16682,7 +16667,7 @@ packages:
dev: false
file:projects/service-bus.tgz:
resolution: {integrity: sha512-4U/Rmts2m96qIZ61QtrBMgobguyAJA01WlqHPfZKIK5cahLfs3q3mJSPR2D5OihsWnfsvMkUpj43Yn5JqZloNg==, tarball: file:projects/service-bus.tgz}
resolution: {integrity: sha512-P3Rn6mictVwNI4EDig2gMjCEp2yPXMQrVKPzQ+04AFmhimoSeaqxOCvA7JphaSXUFwv/aEyHKYG4Lo1XDyN+fg==, tarball: file:projects/service-bus.tgz}
name: '@rush-temp/service-bus'
version: 0.0.0
dependencies:
@ -17419,7 +17404,7 @@ packages:
dev: false
file:projects/test-recorder.tgz:
resolution: {integrity: sha512-Xer6XFqtF+++PkuM8klXusuoFnbtFT0MYT+SSptHozyW84/FdCf2V5t0VZJmqSYF7AM42GVSnRMbl6KF/pzevA==, tarball: file:projects/test-recorder.tgz}
resolution: {integrity: sha512-I+6cy62A3fZO0CejOz4sYIld1JLcBtqgNxuBofi2ah7SuKDSXGYfPDk726RlCYb7thvK4JpXIm7Wh1J1DxQTYA==, tarball: file:projects/test-recorder.tgz}
name: '@rush-temp/test-recorder'
version: 0.0.0
dependencies:

Просмотреть файл

@ -90,19 +90,6 @@ function ignoreOpenTelemetryThisIsUndefined(warning: RollupWarning): boolean {
);
}
/**
* v1.0.0 of @azure/core-asynciterator-polyfill does not provide a source map.
*
* This was a bug, and this function works around that bug.
*/
function ignoreAsyncIteratorPolyfillSourceMaps(warning: RollupWarning): boolean {
return (
warning.code === "PLUGIN_WARNING" &&
warning.plugin === "sourcemaps" &&
warning.id?.includes("@azure+core-asynciterator-polyfill@1.0.0") === true
);
}
/**
* We ignore these warnings because some packages explicitly browser-map node builtins to `false`. Rollup will then
* complain that node-resolve's empty module does not export symbols from them, but as long as the package doesn't
@ -119,7 +106,6 @@ const warningInhibitors: Array<(warning: RollupWarning) => boolean> = [
ignoreChaiCircularDependency,
ignoreNiseSinonEval,
ignoreOpenTelemetryThisIsUndefined,
ignoreAsyncIteratorPolyfillSourceMaps,
ignoreMissingExportsFromEmpty,
];

Просмотреть файл

@ -93,7 +93,6 @@ const examplePackageGood = `{
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-amqp": "^3.0.0",
"@azure/core-asynciterator-polyfill": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-tracing": "1.0.0-preview.13",
"@azure/logger": "^1.0.0",
@ -251,7 +250,6 @@ const examplePackageBad = `{
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-amqp": "^3.0.0",
"@azure/core-asynciterator-polyfill": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-tracing": "1.0.0-preview.13",
"@azure/logger": "^1.0.0",

Просмотреть файл

@ -44,10 +44,6 @@
"name": "core-amqp",
"path": "sdk/core/core-amqp"
},
{
"name": "core-asynciterator-polyfill",
"path": "sdk/core/core-asynciterator-polyfill"
},
{
"name": "core-auth",
"path": "sdk/core/core-auth"

Просмотреть файл

@ -8,20 +8,16 @@ $BlobStorageUrl = "https://azuresdkdocs.blob.core.windows.net/%24web?restype=con
. "$PSScriptRoot/docs/Docs-ToC.ps1"
function Confirm-NodeInstallation
{
if (!(Get-Command npm -ErrorAction SilentlyContinue))
{
function Confirm-NodeInstallation {
if (!(Get-Command npm -ErrorAction SilentlyContinue)) {
LogError "Could not locate npm. Install NodeJS (includes npm and npx) https://nodejs.org/en/download"
exit 1
}
}
function Get-javascript-PackageInfoFromRepo ($pkgPath, $serviceDirectory)
{
function Get-javascript-PackageInfoFromRepo ($pkgPath, $serviceDirectory) {
$projectPath = Join-Path $pkgPath "package.json"
if (Test-Path $projectPath)
{
if (Test-Path $projectPath) {
$projectJson = Get-Content $projectPath | ConvertFrom-Json
$jsStylePkgName = $projectJson.name.Replace("@", "").Replace("/", "-")
@ -40,15 +36,12 @@ function Get-javascript-PackageInfoFromRepo ($pkgPath, $serviceDirectory)
}
# Returns the npm publish status of a package id and version.
function IsNPMPackageVersionPublished ($pkgId, $pkgVersion)
{
function IsNPMPackageVersionPublished ($pkgId, $pkgVersion) {
Confirm-NodeInstallation
$npmVersions = (npm show $pkgId versions)
if ($LastExitCode -ne 0)
{
if ($LastExitCode -ne 0) {
npm ping
if ($LastExitCode -eq 0)
{
if ($LastExitCode -eq 0) {
return $False
}
Write-Host "Could not find a deployed version of $pkgId, and NPM connectivity check failed."
@ -59,11 +52,9 @@ function IsNPMPackageVersionPublished ($pkgId, $pkgVersion)
}
# make certain to always take the package json closest to the top
function ResolvePkgJson($workFolder)
{
function ResolvePkgJson($workFolder) {
$pathsWithComplexity = @()
foreach ($file in (Get-ChildItem -Path $workFolder -Recurse -Include "package.json"))
{
foreach ($file in (Get-ChildItem -Path $workFolder -Recurse -Include "package.json")) {
$complexity = ($file.FullName -Split { $_ -eq "/" -or $_ -eq "\" }).Length
$pathsWithComplexity += New-Object PSObject -Property @{
Path = $file
@ -75,8 +66,7 @@ function ResolvePkgJson($workFolder)
}
# Parse out package publishing information given a .tgz npm artifact
function Get-javascript-PackageInfoFromPackageFile ($pkg, $workingDirectory)
{
function Get-javascript-PackageInfoFromPackageFile ($pkg, $workingDirectory) {
$workFolder = "$workingDirectory$($pkg.Basename)"
$origFolder = Get-Location
$releaseNotes = ""
@ -93,14 +83,12 @@ function Get-javascript-PackageInfoFromPackageFile ($pkg, $workingDirectory)
$pkgVersion = $packageJSON.version
$changeLogLoc = @(Get-ChildItem -Path $workFolder -Recurse -Include "CHANGELOG.md")[0]
if ($changeLogLoc)
{
if ($changeLogLoc) {
$releaseNotes = Get-ChangeLogEntryAsString -ChangeLogLocation $changeLogLoc -VersionString $pkgVersion
}
$readmeContentLoc = @(Get-ChildItem -Path $workFolder -Recurse -Include "README.md") | Select-Object -Last 1
if ($readmeContentLoc)
{
if ($readmeContentLoc) {
$readmeContent = Get-Content -Raw $readmeContentLoc
}
@ -127,7 +115,7 @@ function Get-javascript-DocsMsMetadataForPackage($PackageInfo) {
DocsMsReadMeName = $docsReadmeName
LatestReadMeLocation = 'docs-ref-services/latest'
PreviewReadMeLocation = 'docs-ref-services/preview'
Suffix = ''
Suffix = ''
}
}
@ -136,22 +124,18 @@ function Get-javascript-DocsMsMetadataForPackage($PackageInfo) {
# published at the "dev" tag. To prevent using a version which does not exist in
# NPM, use the "dev" tag instead.
function Get-javascript-DocsMsDevLanguageSpecificPackageInfo($packageInfo) {
try
{
try {
$npmPackageInfo = Invoke-RestMethod -Uri "https://registry.npmjs.com/$($packageInfo.Name)"
if ($npmPackageInfo.'dist-tags'.dev)
{
if ($npmPackageInfo.'dist-tags'.dev) {
Write-Host "Using published version at 'dev' tag: '$($npmPackageInfo.'dist-tags'.dev)'"
$packageInfo.Version = $npmPackageInfo.'dist-tags'.dev
}
else
{
else {
LogWarning "No 'dev' dist-tag available for '$($packageInfo.Name)'. Keeping current version '$($packageInfo.Version)'"
}
}
catch
{
catch {
LogWarning "Error getting package info from NPM for $($packageInfo.Name)"
LogWarning $_.Exception
LogWarning $_.Exception.StackTrace
@ -161,43 +145,36 @@ function Get-javascript-DocsMsDevLanguageSpecificPackageInfo($packageInfo) {
}
# Stage and Upload Docs to blob Storage
function Publish-javascript-GithubIODocs ($DocLocation, $PublicArtifactLocation)
{
function Publish-javascript-GithubIODocs ($DocLocation, $PublicArtifactLocation) {
$PublishedDocs = Get-ChildItem "$($DocLocation)/documentation" | Where-Object -FilterScript { $_.Name.EndsWith(".zip") }
foreach ($Item in $PublishedDocs)
{
foreach ($Item in $PublishedDocs) {
Expand-Archive -Force -Path "$($DocLocation)/documentation/$($Item.Name)" -DestinationPath "$($DocLocation)/documentation/$($Item.BaseName)"
$dirList = Get-ChildItem "$($DocLocation)/documentation/$($Item.BaseName)/$($Item.BaseName)" -Attributes Directory
if ($dirList.Length -eq 1)
{
if ($dirList.Length -eq 1) {
$DocVersion = $dirList[0].Name
$pkgs = Get-ChildItem -Path $PublicArtifactLocation -Include "*.tgz" -Recurse -File
# set default package name
$PkgName = "azure-$($Item.BaseName)"
if ($pkgs -and $pkgs.Count -eq 1)
{
if ($pkgs -and $pkgs.Count -eq 1) {
$parsedPackage = Get-javascript-PackageInfoFromPackageFile $pkgs[0] $PublicArtifactLocation
$PkgName = $parsedPackage.PackageId.Replace("@", "").Replace("/", "-")
}
else
{
else {
Write-Host "Package info is not available from artifact. Assuming package is in default scope @azure."
}
Write-Host "Uploading Doc for $($PkgName) Version:- $($DocVersion)..."
$releaseTag = RetrieveReleaseTag $PublicArtifactLocation
Upload-Blobs -DocDir "$($DocLocation)/documentation/$($Item.BaseName)/$($Item.BaseName)/$($DocVersion)" -PkgName $PkgName -DocVersion $DocVersion -ReleaseTag $releaseTag
}
else
{
else {
Write-Host "found more than 1 folder under the documentation for package - $($Item.Name)"
}
}
}
function Get-javascript-GithubIoDocIndex()
{
function Get-javascript-GithubIoDocIndex() {
# Update the main.js and docfx.json language content
UpdateDocIndexFiles -appTitleLang JavaScript -packageRegex "/\@(.*)\//i" -regexReplacement "`$1-"
# Fetch out all package metadata from csv file.
@ -256,9 +233,8 @@ function ValidatePackagesForDocs($packages, $DocValidationImageId) {
}
$PackageExclusions = @{
'@azure/identity-vscode' = 'Fails type2docfx execution https://github.com/Azure/azure-sdk-for-js/issues/16303';
'@azure/identity-cache-persistence' = 'Fails typedoc2fx execution https://github.com/Azure/azure-sdk-for-js/issues/16310';
'@azure/core-asynciterator-polyfill' = 'Docs CI fails https://github.com/Azure/azure-sdk-for-js/issues/16675';
'@azure/identity-vscode' = 'Fails type2docfx execution https://github.com/Azure/azure-sdk-for-js/issues/16303';
'@azure/identity-cache-persistence' = 'Fails typedoc2fx execution https://github.com/Azure/azure-sdk-for-js/issues/16310';
}
function Update-javascript-DocsMsPackages($DocsRepoLocation, $DocsMetadata, $DocValidationImageId) {
@ -270,17 +246,17 @@ function Update-javascript-DocsMsPackages($DocsRepoLocation, $DocsMetadata, $Doc
$FilteredMetadata = $DocsMetadata.Where({ !($PackageExclusions.ContainsKey($_.Package)) })
UpdateDocsMsPackages `
(Join-Path $DocsRepoLocation 'ci-configs/packages-preview.json') `
(Join-Path $DocsRepoLocation 'ci-configs/packages-preview.json') `
'preview' `
$FilteredMetadata `
(Join-Path $DocsRepoLocation 'ci-configs/packages-preview.json.log') `
(Join-Path $DocsRepoLocation 'ci-configs/packages-preview.json.log') `
$DocValidationImageId
UpdateDocsMsPackages `
(Join-Path $DocsRepoLocation 'ci-configs/packages-latest.json') `
(Join-Path $DocsRepoLocation 'ci-configs/packages-latest.json') `
'latest' `
$FilteredMetadata `
(Join-Path $DocsRepoLocation 'ci-configs/packages-latest.json.log') `
(Join-Path $DocsRepoLocation 'ci-configs/packages-latest.json.log') `
$DocValidationImageId
}
@ -348,12 +324,13 @@ function UpdateDocsMsPackages($DocConfigFile, $Mode, $DocsMetadata, $PackageHist
$remainingPackages = @()
if ($Mode -eq 'preview') {
$remainingPackages = $DocsMetadata.Where({
$_.VersionPreview.Trim() -and !$outputPackagesHash.ContainsKey($_.Package)
})
} else {
$_.VersionPreview.Trim() -and !$outputPackagesHash.ContainsKey($_.Package)
})
}
else {
$remainingPackages = $DocsMetadata.Where({
$_.VersionGA.Trim() -and !$outputPackagesHash.ContainsKey($_.Package)
})
$_.VersionGA.Trim() -and !$outputPackagesHash.ContainsKey($_.Package)
})
}
# Add packages that exist in the metadata but are not onboarded in docs config
@ -406,28 +383,23 @@ Removed $($package.name) because of docs package validation failure on $(Get-Dat
}
# function is used to auto generate API View
function Find-javascript-Artifacts-For-Apireview($artifactDir, $packageName)
{
function Find-javascript-Artifacts-For-Apireview($artifactDir, $packageName) {
$artifactPath = Join-Path $artifactDir $packageName
if (Test-Path $artifactPath)
{
if (Test-Path $artifactPath) {
Write-Host "Searching for *.api.json in path $($artifactPath)"
$files = Get-ChildItem "${artifactPath}" | Where-Object -FilterScript { $_.Name.EndsWith(".api.json") }
if (!$files)
{
if (!$files) {
Write-Host "$($packageName) does not have api review json"
Write-Host "API Extractor must be enabled for $($packageName). Please ensure api-extractor.json is present in package directory and api extract script included in build script"
return $null
}
elseif ($files.Count -ne 1)
{
elseif ($files.Count -ne 1) {
Write-Host "$($artifactPath) should contain only one api review for $($packageName)"
Write-Host "No of files $($files.Count)"
return $null
}
}
else
{
else {
Write-Host "$($pkgName) does not have api review json"
return $null
}
@ -437,10 +409,8 @@ function Find-javascript-Artifacts-For-Apireview($artifactDir, $packageName)
return $packages
}
function SetPackageVersion ($PackageName, $Version, $ReleaseDate, $ReplaceLatestEntryTitle = $true)
{
if ($null -eq $ReleaseDate)
{
function SetPackageVersion ($PackageName, $Version, $ReleaseDate, $ReplaceLatestEntryTitle = $true) {
if ($null -eq $ReleaseDate) {
$ReleaseDate = Get-Date -Format "yyyy-MM-dd"
}
Push-Location "$EngDir/tools/versioning"
@ -448,31 +418,26 @@ function SetPackageVersion ($PackageName, $Version, $ReleaseDate, $ReplaceLatest
npm install
$artifactName = $PackageName.Replace("@", "").Replace("/", "-")
node ./set-version.js --artifact-name $artifactName --new-version $Version --release-date $ReleaseDate `
--replace-latest-entry-title $ReplaceLatestEntryTitle --repo-root $RepoRoot
--replace-latest-entry-title $ReplaceLatestEntryTitle --repo-root $RepoRoot
Pop-Location
}
# PackageName: Pass full package name e.g. @azure/abort-controller
# You can obtain full pacakge name using the 'Get-PkgProperties' function in 'eng\common\scripts\Package-Properties.Ps1'
function GetExistingPackageVersions ($PackageName, $GroupId = $null)
{
try
{
function GetExistingPackageVersions ($PackageName, $GroupId = $null) {
try {
$existingVersion = Invoke-RestMethod -Method GET -Uri "http://registry.npmjs.com/${PackageName}"
return ($existingVersion.versions | Get-Member -MemberType NoteProperty).Name
}
catch
{
if ($_.Exception.Response.StatusCode -ne 404)
{
catch {
if ($_.Exception.Response.StatusCode -ne 404) {
LogError "Failed to retrieve package versions for ${PackageName}. $($_.Exception.Message)"
}
return $null
}
}
function Validate-javascript-DocMsPackages ($PackageInfo, $DocRepoLocation, $DocValidationImageId)
{
function Validate-javascript-DocMsPackages ($PackageInfo, $DocRepoLocation, $DocValidationImageId) {
$fileLocation = ""
if ($PackageInfo.DevVersion -or $PackageInfo.Version -contains "beta") {
$fileLocation = (Join-Path $DocRepoLocation 'ci-configs/packages-preview.json')

Просмотреть файл

@ -446,11 +446,6 @@
"projectFolder": "sdk/core/core-client-rest",
"versionPolicyName": "core"
},
{
"packageName": "@azure/core-asynciterator-polyfill",
"projectFolder": "sdk/core/core-asynciterator-polyfill",
"versionPolicyName": "core"
},
{
"packageName": "@azure/core-auth",
"projectFolder": "sdk/core/core-auth",

Просмотреть файл

@ -90,7 +90,6 @@
},
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-asynciterator-polyfill": "^1.0.0",
"@azure/core-client": "^1.5.0",
"@azure/core-http-compat": "^1.2.0",
"@azure/core-paging": "^1.1.1",

Просмотреть файл

@ -9,8 +9,6 @@ import { AppConfiguration } from "./generated/src/appConfiguration";
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { TokenCredential, isTokenCredential } from "@azure/core-auth";
import "@azure/core-asynciterator-polyfill";
import {
AddConfigurationSettingOptions,
AddConfigurationSettingParam,

Просмотреть файл

@ -309,6 +309,7 @@ export function errorMessageForUnexpectedSetting(
return `Setting with key ${key} is not a valid ${expectedType}, make sure to have the correct content-type and a valid non-null value.`;
}
// eslint-disable-next-line @typescript-eslint/ban-types
export function assertResponse<T extends object>(
result: T
): asserts result is T & HttpResponseField<any> {
@ -321,6 +322,7 @@ export function assertResponse<T extends object>(
}
}
// eslint-disable-next-line @typescript-eslint/ban-types
export function hasUnderscoreResponse<T extends object>(
result: T
): result is T & HttpResponseField<any> {

Просмотреть файл

@ -42,8 +42,6 @@ extends:
safeName: azureabortcontroller
- name: azure-core-amqp
safeName: azurecoreamqp
- name: azure-core-asynciterator-polyfill
safeName: azurecoreasynciteratorpolyfill
- name: azure-core-auth
safeName: azurecoreauth
- name: azure-core-client

Просмотреть файл

@ -1,20 +0,0 @@
{
"plugins": ["@azure/azure-sdk"],
"extends": ["plugin:@azure/azure-sdk/azure-sdk-base"],
"rules": {
// `package.json`'s sideEffects has to be true because this package loads a
// polyfill.
"@azure/azure-sdk/ts-package-json-sideeffects": "off",
// this package does not have a module in `dist` because the directory does
// not exist.
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
// this package does not export a module.
"@azure/azure-sdk/ts-package-json-module": "off",
// this package does not create a `dist` directory to be included in `files`
// list in `package.json`.
"@azure/azure-sdk/ts-package-json-files-required": "off",
// this package does not have type declaration file.
"@azure/azure-sdk/ts-package-json-types": "off",
"sort-imports": "error"
}
}

Просмотреть файл

@ -1,11 +0,0 @@
# Release History
## 1.0.2 (2022-02-09)
### Bugs Fixed
- `@azure/core-asynciterator-polyfill` was missing its source map file, even though the source file declared that one existed. This release adds that file to the package.
## 1.0.0 (29th October, 2019)
This release marks the general availability of the `@azure/core-asynciterator-polyfill` package.

Просмотреть файл

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2020 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Просмотреть файл

@ -1,46 +0,0 @@
# Azure Async Iterator Polyfill client library for JavaScript
This library provides a polyfill for [Symbol.asyncIterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator)
for platforms that do not have support for it by default.
## Getting started
### Installation
If using this as part of another project in the [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) repo,
then run `rush install` after cloning the repo.
Otherwise, use npm to install this package in your application as follows
```
npm install @azure/core-asynciterator-polyfill
```
## Key concepts
[Symbol.asyncIterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator) is not supported
in all platforms and therefore you might need a polyfill in order to get it working on such platforms. Importing the polyfill from
this library lets you use the iterator in your applications.
## Examples
To use this polyfill, just include an import of this library in your code
```typescript
import "@azure/core-asynciterator-polyfill";
```
## Next steps
Try out this package in your application if you are working on platforms that do not have support for
[Symbol.asyncIterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator) and provide feedback!
## Troubleshooting
Log an issue at https://github.com/Azure/azure-sdk-for-js/issues
## Contributing
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Fcore-asynciterator-polyfill%2FREADME.png)

Просмотреть файл

@ -1,64 +0,0 @@
{
"name": "@azure/core-asynciterator-polyfill",
"author": "Microsoft Corporation",
"sdk-type": "client",
"version": "1.0.2",
"description": "Polyfill for IE/Node 8 for Symbol.asyncIterator",
"tags": [
"microsoft",
"clientruntime"
],
"keywords": [
"microsoft",
"clientruntime",
"azure",
"cloud"
],
"main": "./dist/index.js",
"files": [
"dist/",
"README.md",
"LICENSE"
],
"engines": {
"node": ">=12.0.0"
},
"license": "MIT",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-asynciterator-polyfill/README.md",
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build:samples": "echo Obsolete",
"build:test": "echo skipped",
"build": "npm run clean && tsc -p .",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist *.log",
"execute:samples": "echo skipped",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint": "eslint package.json src --ext .ts",
"lint:fix": "eslint package.json src --ext .ts --fix --fix-type [problem,suggestion]",
"pack": "npm pack 2>&1",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build && npm run unit-test:node && rollup -c 2>&1 && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"sideEffects": true,
"private": false,
"devDependencies": {
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@types/node": "^12.0.0",
"eslint": "^7.15.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"typescript": "~4.2.0"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
if (typeof Symbol === undefined || !(Symbol as any).asyncIterator) {
(Symbol as any).asyncIterator = Symbol.for("Symbol.asyncIterator");
}

Просмотреть файл

@ -1,11 +0,0 @@
{
"extends": "../../../tsconfig.package",
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"outDir": "./dist",
"declaration": false,
"declarationMap": false
},
"include": ["./src/index.ts"]
}

Просмотреть файл

@ -69,7 +69,6 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-asynciterator-polyfill": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/core-tracing": "^1.0.0",

Просмотреть файл

@ -54,4 +54,3 @@ export {
SerializationPolicyOptions,
} from "./serializationPolicy";
export { authorizeRequestOnClaimChallenge } from "./authorizeRequestOnClaimChallenge";
import "@azure/core-asynciterator-polyfill";

Просмотреть файл

@ -116,7 +116,6 @@
},
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-asynciterator-polyfill": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-tracing": "1.0.0-preview.13",
"@azure/logger": "^1.0.0",

Просмотреть файл

@ -129,4 +129,3 @@ export { Authenticator } from "./credentials/credentials";
export { parseXML, stringifyXML } from "./util/xml";
export { XML_ATTRKEY, XML_CHARKEY, SerializerOptions } from "./util/serializer.common";
import "@azure/core-asynciterator-polyfill";

Просмотреть файл

@ -68,7 +68,6 @@
"sideEffects": true,
"private": false,
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.0",
"tslib": "^2.2.0"
},
"devDependencies": {

Просмотреть файл

@ -1,7 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "@azure/core-asynciterator-polyfill";
export * from "./models";
export * from "./getPagedAsyncIterator";

Просмотреть файл

@ -108,7 +108,6 @@
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-amqp": "^3.1.0",
"@azure/core-asynciterator-polyfill": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-tracing": "^1.0.0",
"@azure/logger": "^1.0.0",

Просмотреть файл

@ -10,6 +10,7 @@ import { hashPartitionKey } from "../../src/impl/partitionKeyToIdMapper";
*/
describe("hashPartitionKey", () => {
it("Generated hashes match the ones the service would have generated", () => {
// eslint-disable-next-line @typescript-eslint/no-require-imports
const expectations: { Key: string; Hash: number }[] = require("./partitionKeyHashMap.json");
expectations.map(({ Key, Hash }) => assert.equal(hashPartitionKey(Key), Hash));
});

Просмотреть файл

@ -1299,6 +1299,7 @@ testWithServiceTypes((serviceVersion) => {
await subscription!.close();
should.exist(receivedEvent);
const body = receivedEvent.body as Buffer;
// eslint-disable-next-line no-unused-expressions
expect(Buffer.isBuffer(body)).to.be.true;
expect(body.toJSON().data).to.be.deep.equal(data);
});

Просмотреть файл

@ -61,7 +61,6 @@
},
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-asynciterator-polyfill": "^1.0.0",
"rhea": "^2.0.3",
"tslib": "^2.2.0"
},

Просмотреть файл

@ -3,7 +3,6 @@
/// <reference lib="ES2018.AsyncIterable" />
import "@azure/core-asynciterator-polyfill";
import { EventPosition } from "../utils/eventPosition";
import { Message } from "rhea";
import { Queue } from "./queue";

Просмотреть файл

@ -27,8 +27,8 @@ import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
import { createChallengeCallbacks } from "./challengeAuthenticationCallbacks";
import { logger } from "./log";
import { mappings } from "./mappings";
import { v4 as v4uuid } from "uuid";
import { tracingClient } from "./tracing";
import { v4 as v4uuid } from "uuid";
/**
* The KeyVaultAccessControlClient provides methods to manage

Просмотреть файл

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { createTracingClient } from "@azure/core-tracing";
import { SDK_VERSION } from "./constants";

Просмотреть файл

@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { createTracingClient } from "@azure/core-tracing";
import { SDK_VERSION } from "./constants";

Просмотреть файл

@ -108,7 +108,6 @@
"@azure/abort-controller": "^1.0.0",
"@azure/core-amqp": "^3.1.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-asynciterator-polyfill": "^1.0.0",
"@azure/core-client": "^1.0.0",
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/core-tracing": "1.0.0-preview.13",

Просмотреть файл

@ -35,7 +35,6 @@ import {
import Long from "long";
import { ServiceBusMessageImpl, DeadLetterOptions } from "../serviceBusMessage";
import { Constants, RetryConfig, RetryOperationType, RetryOptions, retry } from "@azure/core-amqp";
import "@azure/core-asynciterator-polyfill";
import { LockRenewer } from "../core/autoLockRenewer";
import { receiverLogger as logger } from "../log";
import { translateServiceBusError } from "../serviceBusError";

Просмотреть файл

@ -37,7 +37,6 @@ import {
ErrorNameConditionMapper,
} from "@azure/core-amqp";
import { OperationOptionsBase, trace } from "../modelsToBeSharedWithEventHubs";
import "@azure/core-asynciterator-polyfill";
import { AmqpError } from "rhea-promise";
import { createProcessingSpan } from "../diagnostics/instrumentServiceBusMessage";
import { receiverLogger as logger } from "../log";