Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions eng/emitters/scripts/Update-TypeSpecNext.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#Requires -Version 7.0

<#
.SYNOPSIS
Updates TypeSpec dependencies in package.json to the latest @next versions.

.DESCRIPTION
Uses @azure-tools/typespec-bump-deps to update all TypeSpec-related dependencies
in the specified package.json file(s) to their latest @next versions. This script
only mutates the package manifest(s) — it does NOT run npm install.

The caller (typically Initialize-Repository.ps1) is responsible for running
npm install after this script completes.

.PARAMETER PackageJsonPaths
One or more paths to package.json files to update. Paths are relative to the
current working directory.

.EXAMPLE
./Update-TypeSpecNext.ps1 -PackageJsonPaths "package.json"

.EXAMPLE
./Update-TypeSpecNext.ps1 -PackageJsonPaths "package.json", "emitter/package.json"
#>

param(
[Parameter(Mandatory = $true)]
[string[]] $PackageJsonPaths
)

$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 3.0

. "$PSScriptRoot/CommandInvocation-Helpers.ps1"

Write-Host "Updating TypeSpec dependencies to @next versions..."

# Build the argument list from the provided paths
$pathArgs = ($PackageJsonPaths | ForEach-Object { "`"$_`"" }) -join " "

Invoke-LoggedCommand "npx -y @azure-tools/typespec-bump-deps@latest --use-peer-ranges $pathArgs"

Write-Host "TypeSpec dependencies updated to @next versions."
7 changes: 6 additions & 1 deletion packages/http-client-csharp/eng/pipeline/publish.yml
Comment thread
timotheeguerin marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ parameters:
type: boolean
default: true

- name: UseTypeSpecNext
displayName: Use TypeSpec Next (update dependencies to @next versions)
type: boolean
default: false

extends:
template: /eng/common/pipelines/templates/1es-redirect.yml

Expand All @@ -37,7 +42,7 @@ extends:
- template: /eng/emitters/pipelines/templates/stages/emitter-stages.yml
parameters:
BuildPrereleaseVersion: true
UseTypeSpecNext: false
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
Publish: ${{replace(replace('True',eq(variables['Build.SourceBranchName'], 'main'), 'public'),'True','internal')}}
PublishDependsOnTest: ${{ parameters.RunTests }}
PackagePath: /packages/http-client-csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ try {
Invoke-LoggedCommand "npm ci"
}
elseif ($UseTypeSpecNext) {
# TODO: add use typespec next to template later
Write-Host "Updating TypeSpec dependencies to @next versions..."
& "$packageRoot/../../eng/emitters/scripts/Update-TypeSpecNext.ps1" -PackageJsonPaths "package.json"
Invoke-LoggedCommand "npm install"
}
else {
Invoke-LoggedCommand "npm ci"
Expand Down
Loading