Skip to content
Merged
Changes from all commits
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
41 changes: 41 additions & 0 deletions wc-grid-examples-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,35 @@ stages:
# (cd "$dir" && npx ig upgrade-packages --skip-install)
# fi
# done

- task: PowerShell@2
displayName: 'Replace references to IG trial packages with licensed ones'
inputs:
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)'
targetType: 'inline'
script: |
$packageJson = Get-Content -Raw .\package.json | ConvertFrom-Json
$properties = $packageJson.dependencies.PSObject.Properties `
| where-object { $_.Name.StartsWith("igniteui-react") -or $_.Name.StartsWith("igniteui-dockmanager") }

foreach( $property in $properties )
{
$oldName = $property.Name;
$newName = "@infragistics/" + $oldName

# remember the current value of the old property
$value = $property.Value;

# remove reference to the trial package reference
$packageJson.dependencies.psobject.Properties.Remove($oldName);

# add reference to the licensed package reference
$packageJson.dependencies | Add-Member -NotePropertyName $newName -NotePropertyValue $value;
}

ConvertTo-Json -InputObject $packageJson | Set-Content -Path .\package.json

- task: Npm@1
displayName: 'npm install --legacy-peer-deps'
Expand All @@ -141,6 +170,18 @@ stages:
workingDir: '$(Build.SourcesDirectory)'
customCommand: 'install --legacy-peer-deps'

- task: PowerShell@2
displayName: 'Replace references to IG trial packages with licensed ones in TSX files'
inputs:
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)'
targetType: 'inline'
script: |
Get-ChildItem -Include "*.tsx","*.ts" -Recurse | `
ForEach { (Get-Content $_.PSPath | ForEach { ($_ -replace '([from|import])\s?[''"](igniteui-[react|dockmanager].*)[''"]', '$1 "@infragistics/$2"') }) | `
Set-Content $_.PSPath }

- task: Npm@1
displayName: 'npm run build'
inputs:
Expand Down