From 16469af5059f99d891454ecc6f9f9f62a24d2e4f Mon Sep 17 00:00:00 2001 From: AlisherAmonulloev Date: Thu, 12 Dec 2024 16:26:02 +0200 Subject: [PATCH 1/2] Update demo --- ASP.NET Core/Readme.md | 2 +- React/README.md | 4 +- Vue/README.md | 2 +- test-example.ps1 | 95 +++++++++++++++++++++++------------------- 4 files changed, 56 insertions(+), 47 deletions(-) diff --git a/ASP.NET Core/Readme.md b/ASP.NET Core/Readme.md index 19b2a4d..55ef6c2 100644 --- a/ASP.NET Core/Readme.md +++ b/ASP.NET Core/Readme.md @@ -6,7 +6,7 @@ Download the example and use Visual Studio 2019 to open the project. ## Client-side resources and bundling -This project uses [NPM](http://npmjs.com/) and [Gulp.js](https://gulpjs.com/) to install client-side libraries. The project restores NPM packages before the first build. Then, Gulp bundles required scripts and CSS files into the resulting package during the first and every next build. +This project uses [NPM](https://www.npmjs.com/) and [Gulp.js](https://gulpjs.com/) to install client-side libraries. The project restores NPM packages before the first build. Then, Gulp bundles required scripts and CSS files into the resulting package during the first and every next build. The resulted bundles will be located in the `wwwroot` folder: * `css/vendor.css` - a file with all CSS styles. diff --git a/React/README.md b/React/README.md index 4152601..1066816 100644 --- a/React/README.md +++ b/React/README.md @@ -26,11 +26,11 @@ It correctly bundles React in production mode and optimizes the build for the be The build is minified and the filenames include the hashes.
Your app is ready to be deployed! -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. +See the section about [deployment](https://create-react-app.dev/docs/deployment/) for more information. ## Further help -You can learn more about React in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). +You can learn more about React in the [Create React App documentation](https://create-react-app.dev/docs/getting-started/). To get more help on DevExtreme submit an issue on [GitHub](https://github.com/DevExpress/devextreme/issues) or [Support Center](https://www.devexpress.com/Support/Center/Question/Create) diff --git a/Vue/README.md b/Vue/README.md index 6171589..612e558 100644 --- a/Vue/README.md +++ b/Vue/README.md @@ -19,7 +19,7 @@ If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has a ## Customize configuration -See [Vite Configuration Reference](https://vitejs.dev/config/). +See [Vite Configuration Reference](https://vite.dev/config/). ## Project Setup diff --git a/test-example.ps1 b/test-example.ps1 index ce4c686..e513a24 100644 --- a/test-example.ps1 +++ b/test-example.ps1 @@ -1,10 +1,7 @@ -Write-Output "Branch name: $env:branchName" $global:inputVersion = $env:branchName $global:errorCode = 0 -$BUILD_VERSIONS_LIST = "BUILD_VERSIONS_LIST" - -$allVersions = @( +$global:allVersions = @( "14.1", "14.2", "15.1", "15.2", "16.1", "16.2", @@ -21,48 +18,55 @@ $allVersions = @( function Process-JavaScriptProjects { param ( - [string]$Path = ".", - [hashtable[]]$Folders = @( - @{ Name = "jQuery"; Packages = @("devextreme-dist", "devextreme") }, - @{ Name = "Angular"; Packages = @("devextreme-angular", "devextreme") }, - @{ Name = "React"; Packages = @("devextreme-react", "devextreme") }, - @{ Name = "Vue"; Packages = @("devextreme-vue", "devextreme") } - ) + [string]$buildVersion + ) + Write-Output "`n--== Processing JavaScript Projects ==--" + + [hashtable[]]$folders = @( + @{ Name = "Angular"; Packages = @("devextreme-angular", "devextreme") }, + @{ Name = "React"; Packages = @("devextreme-react", "devextreme") }, + @{ Name = "Vue"; Packages = @("devextreme-vue", "devextreme") } ) - Write-Host "`n--== Processing JavaScript Projects ==--" - foreach ($folder in $Folders) { + $jQueryEntry = @{ + Name = "jQuery"; + Packages = if ([double]$buildVersion -ge 23.1) { # `devextreme-dist` appeared in 23.1 + @("devextreme-dist", "devextreme") + } else { + @("devextreme") + } + } + + $folders = @($jQueryEntry) + folders + + foreach ($folder in $folders) { if (-not (Test-Path $($folder.Name))) { - Write-Host "Directory $($folder.Name) does not exist. Skipping..." + Write-Output "`nDirectory $($folder.Name) does not exist. Skipping..." continue } - Write-Host "`n<-- Processing folder: $($folder.Name) -->" + Write-Output "`n<-- Processing folder: $($folder.Name) -->" Set-Location $($folder.Name) - $packages = $folder.Packages | ForEach-Object { "$_@$global:buildVersion" } + $packages = $folder.Packages | ForEach-Object { "$_@$buildVersion" } $packageList = $packages -join " " - $command = "npm install $packageList --force --save --no-fund" - - Write-Output "Running: $command" - Invoke-Expression $command + Write-Output "`nInstalling DevExtreme packages" + npm install $packageList --save --save-exact --no-fund - Write-Host "Running 'npm install' in $($folder.Name)" - $installResult = & npm install --force --no-fund --loglevel=error -PassThru + Write-Output "`nInstalling the rest of the packages $($folder.Name)" + npm install --save --save-exact --no-fund --loglevel=error if ($LASTEXITCODE -ne 0) { - Write-Error "ERROR: npm install failed in $($folder.Name)" + Write-Error "`nERROR: Failed to install packages: $($folder.Name)" $global:errorCode = 1 } - Write-Host "`n<-- Updating packages... -->" - - Write-Host "Running 'npm run build' in $($folder.Name)" - $buildResult = & npm run build + Write-Output "`nBuilding the project with 'npm run build' $($folder.Name)" + npm run build if ($LASTEXITCODE -ne 0) { - Write-Error "ERROR: npm run build failed in $($folder.Name)" + Write-Error "`nERROR: Failed to build the project: $($folder.Name)" $global:errorCode = 1 } @@ -74,33 +78,35 @@ function Process-DotNetProjects { param ( [string]$RootDirectory = "." ) - Write-Host "`nProcessing .NET Projects" + Write-Output "`nProcessing .NET projects" $slnFiles = Get-ChildItem -Path $RootDirectory -Filter *.sln -Recurse -Depth 1 if ($slnFiles.Count -eq 0) { - Write-Host "No solution files (.sln) found in the specified directory at level 1." + Write-Output "`nNo solution files (.sln) found in the specified directory at level 1." return } foreach ($slnFile in $slnFiles) { - Write-Host "Found solution file: $($slnFile.FullName)" + Write-Output "`nFound solution file: $($slnFile.FullName)" dotnet build $slnFile.FullName -c Release if ($LASTEXITCODE -eq 0) { - Write-Host "Build succeeded for $($slnFile.FullName)." + Write-Output "`nBuild succeeded for $($slnFile.FullName)." } else { - Write-Error "Build failed for $($slnFile.FullName)." + Write-Error "`nBuild failed for $($slnFile.FullName)." $global:errorCode = 1 } } } function Set-BuildVersion { + $BUILD_VERSIONS_LIST = "BUILD_VERSIONS_LIST" + $inputMajorMinor = $global:inputVersion -replace "\.\d+\+$", "" - $filteredList = $allVersions | Where-Object { + $filteredList = $global:allVersions | Where-Object { ($_ -replace "\." -as [double]) -ge ($inputMajorMinor -replace "\." -as [double]) } @@ -114,31 +120,34 @@ function Set-BuildVersion { if ($currentList.Count -gt 1) { $inputMajorMinor = $currentList[0] - Write-Output "Input version: '$inputMajorMinor'" - $global:buildVersion = $inputMajorMinor $updatedList = $currentList[1..($currentList.Count - 1)] } else { - Write-Output "The list in the environment variable has only one item. " + Write-Output "`nThe list in the environment variable has only one item." $inputMajorMinor = $currentList - $global:buildVersion = $inputMajorMinor - Write-Output "Input version: '$inputMajorMinor'" $updatedList = "" } + $global:buildVersion = $inputMajorMinor + Write-Output "Input version: '$inputMajorMinor'" + $newValue = $updatedList -join ";" [Environment]::SetEnvironmentVariable($BUILD_VERSIONS_LIST, $newValue, [EnvironmentVariableTarget]::Machine) - Write-Output "Environment variable '$BUILD_VERSIONS_LIST' has been updated." + Write-Output "`nEnvironment variable '$BUILD_VERSIONS_LIST' has been updated." Write-Output "New List: $updatedList" } -Write-Host "`nBranch Name: $global:branchName" +Write-Output "`nBranch Name: $global:branchName" Set-BuildVersion -Process-JavaScriptProjects +if (-not $global:buildVersion) { + Write-Output "`nThe buildVersion is null or an empty string." + exit 1 +} +Process-JavaScriptProjects -buildVersion $global:buildVersion Process-DotNetProjects -Write-Host "Error code: $global:errorCode" +Write-Output "`nFinished testing. Error code: $global:errorCode" exit $global:errorCode From 4fb87bfff4c5da8c77a3edb58465eb87ccbbbdbc Mon Sep 17 00:00:00 2001 From: DevExpressExampleBot Date: Thu, 12 Dec 2024 18:34:22 +0400 Subject: [PATCH 2/2] README auto update [skip ci] --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 15b3351..c8b1ed7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/800447205/23.1.3%2B) [![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T1233410) [![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183) [![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)