diff --git a/docs/BuildFromSource.md b/docs/BuildFromSource.md index be1d8c70b9ac..99eff312c992 100644 --- a/docs/BuildFromSource.md +++ b/docs/BuildFromSource.md @@ -51,7 +51,7 @@ The steps you follow next depend on your preferred development environment: ## Visual Studio on Windows -1. This repo has JavaScript dependencies, so you need [Node.js](https://nodejs.org/en/). [Yarn](https://yarnpkg.com/) version 1.x will be installed automatically using `npm`, if you have already installed it with a version >= 2.x then you may have to uninstall it as it is not compatible with the aspnetcore build script. +1. This repo has JavaScript dependencies, so you need [Node.js](https://nodejs.org/en/). 1. Before you open project in Visual Studio, install the required dependencies and set up the repo by running the `restore.cmd` script in the root of the repo: @@ -89,7 +89,7 @@ The steps you follow next depend on your preferred development environment: 1. To use Visual Studio Code for developing in this repo, you need [Visual Studio Code installed](https://code.visualstudio.com/) and the ability to [launch `code` from the command line](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line). -1. This repo has JavaScript dependencies, so you need [Node.js](https://nodejs.org/en/). [Yarn](https://yarnpkg.com/) version 1.x will be installed automatically using `npm`, if you have already installed it with a version >= 2.x then you may have to uninstall it as it is not compatible with the aspnetcore build script. +1. This repo has JavaScript dependencies, so you need [Node.js](https://nodejs.org/en/). 1. Before you open anything in Visual Studio Code, run the `restore` script in the root of the repo to install the required .NET dependencies. @@ -235,5 +235,4 @@ To support building and testing the projects in the repo, several dependencies m | [Chrome](https://www.google.com/chrome/) | Required when running tests with Selenium or Playwright in the projects above. When using Playwright, the dependency is automatically installed. | | | [Java Development Kit (v11 or newer)](https://jdk.java.net/) | Required when building the Java SignalR client. Can be installed using the `./eng/scripts/InstallJdk.ps1` script on Windows. | Ensure that the `JAVA_HOME` directory points to the installation and that the `PATH` has been updated to include the `$(jdkInstallDir)/bin` folder. | | [Wix](https://wixtoolset.org/releases/) | Required when working with the Windows installers in the [Windows installers project](https://github.com/dotnet/aspnetcore/tree/main/src/Installers/Windows). | | -| [Node.js](https://nodejs.org/en/) | Used for building JavaScript assets in the repo, such as those in Blazor and SignalR. | Required a minimum version of the current NodeJS LTS. | -| [Yarn](https://yarnpkg.com/) | Used for installing JavaScript dependencies in the repo, such as those in Blazor and SignalR. | | +| [Node.js](https://nodejs.org/en/) | Used for building JavaScript assets in the repo, such as those in Blazor and SignalR. | Required a minimum version of the current NodeJS LTS. | diff --git a/eng/Build.props b/eng/Build.props index f3489af221fc..f564abe333f4 100644 --- a/eng/Build.props +++ b/eng/Build.props @@ -137,8 +137,6 @@ - - diff --git a/eng/Npm.Workspace.nodeproj b/eng/Npm.Workspace.nodeproj index 2946450da041..506a6b6dbcdc 100644 --- a/eng/Npm.Workspace.nodeproj +++ b/eng/Npm.Workspace.nodeproj @@ -35,6 +35,23 @@ + + + + + + <_FilteredNpmVersionOuput Include="@(_GetNpmVersionOutput)" Condition="'%(Identity)' == '' or $([System.String]::Copy('%(Identity)').StartsWith('>')) " /> + <_NodePackageNameAndVersions Include="@(_GetNpmVersionOutput)" Exclude="@(_FilteredNpmVersionOuput)"> + + <_NodePackageNameAndVersions Condition="$([System.String]::new('%(_NodePackageNameAndVersions.Identity)').Contains(';'))"> + $([System.String]::new('%(_NodePackageNameAndVersions.Identity)').Split(';')[0]) + $([System.String]::new('%(_NodePackageNameAndVersions.Identity)').Split(';')[1]) + + + + + + diff --git a/eng/Publishing.props b/eng/Publishing.props index 2cc2e5d63107..25cfee6dc1a3 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -47,13 +47,17 @@ version string to use as our publish location), non-packed (won't be shipped in the future), and it is _not_ a C# or F# project. For now at least, C# and F# projects should not be referenced when using desktop msbuild. --> - + <_PackageVersion>@(_ResolvedPackageVersionInfo->'%(PackageVersion)') @@ -101,19 +105,23 @@ Name="_WriteProductVersionFile" Condition=" '$(PublishInstallerBaseVersion)' == 'true'"> - - <_ProductVersion>@(_ResolvedProductVersionInfo->'%(PackageVersion)') + + <_ProductVersion>%(_ResolvedProductVersionInfo.PackageVersion) diff --git a/eng/Tools.props b/eng/Tools.props index 6dd4a2d87f16..e00d1d215cee 100644 --- a/eng/Tools.props +++ b/eng/Tools.props @@ -1,15 +1,4 @@ - - - - - diff --git a/eng/scripts/CodeCheck.ps1 b/eng/scripts/CodeCheck.ps1 index 616e3dcc6693..61217486f190 100644 --- a/eng/scripts/CodeCheck.ps1 +++ b/eng/scripts/CodeCheck.ps1 @@ -91,11 +91,11 @@ try { } # - # Check for unexpected (not from dotnet-public-npm) yarn resolutions in lock files. + # Check for unexpected (not from dotnet-public-npm) npm resolutions in lock files. # $registry = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/' - Get-ChildItem src\yarn.lock -Recurse | + Get-ChildItem src\package-lock.json -Recurse | ForEach-Object FullName | Where-Object {$_ -NotLike '*\node_modules\*'} | ForEach-Object { @@ -104,7 +104,7 @@ try { } | ForEach-Object { LogError -filePath "${_.Path}" -lineNumber $_.LineNumber ` - "Packages in yarn.lock file resolved from wrong registry. All dependencies must be resolved from $registry" + "Packages in package-lock.json file resolved from wrong registry. All dependencies must be resolved from $registry" } # diff --git a/eng/targets/CSharp.Common.props b/eng/targets/CSharp.Common.props index 1fe56a0cfd0d..a2f01936b417 100644 --- a/eng/targets/CSharp.Common.props +++ b/eng/targets/CSharp.Common.props @@ -22,9 +22,4 @@ - - - false - true - diff --git a/global.json b/global.json index f5e8c02768df..20e2a7213f35 100644 --- a/global.json +++ b/global.json @@ -26,7 +26,6 @@ "xcopy-msbuild": "17.1.0" }, "msbuild-sdks": { - "Yarn.MSBuild": "1.22.10", "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23619.4", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23619.4" } diff --git a/package.json b/package.json index 24b8619f2ea7..140132e33d6b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "lint": "npm run lint --workspaces --if-present", "test": "npm run test --workspaces --if-present", "integration-test": "npm run integration-test --workspaces --if-present", - "coverage": "npm run coverage --workspaces --if-present" + "coverage": "npm run coverage --workspaces --if-present", + "get-version": "npm run get-version --workspaces --if-present" }, "overrides": { "got": "^11.8.2", diff --git a/src/Components/README.md b/src/Components/README.md index ea0061ea850e..e442101b1323 100644 --- a/src/Components/README.md +++ b/src/Components/README.md @@ -39,7 +39,7 @@ To build this specific project from source, follow the instructions [on building Prior to building `src\Components\Web.JS\` -1. You'll need to install [Node](https://nodejs.org) and [yarn](https://yarnpkg.com) on your machine. +1. You'll need to install [Node](https://nodejs.org) on your machine. 2. You'll need to run the `restore` script locally to install the required dotnet dependencies and setup the repo. The `restore` script is located in the root of the repo. diff --git a/src/JSInterop/Microsoft.JSInterop.JS/src/package.json b/src/JSInterop/Microsoft.JSInterop.JS/src/package.json index 84bfc1e22328..cae6e83b3869 100644 --- a/src/JSInterop/Microsoft.JSInterop.JS/src/package.json +++ b/src/JSInterop/Microsoft.JSInterop.JS/src/package.json @@ -9,7 +9,8 @@ "clean": "npx rimraf ./dist", "build": "npm run clean && npm run build:esm", "build:lint": "eslint -c .eslintrc.json --ext .ts ./src", - "build:esm": "npx tsc --project ./tsconfig.json" + "build:esm": "npx tsc --project ./tsconfig.json", + "get-version": "node -e \"const { name, version } = require('./package.json'); console.log(`${name};${version}`);\"" }, "repository": { "type": "git", diff --git a/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json b/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json index 3362e9367ad8..eebc80cc4222 100644 --- a/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json +++ b/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json @@ -18,7 +18,8 @@ "build:esm": "tsc --project ./tsconfig.json --module es2015 --outDir ./dist/esm -d", "build:cjs": "tsc --project ./tsconfig.json --module commonjs --outDir ./dist/cjs", "build:browser": "webpack-cli", - "build:uglify": "terser -m -c --ecma 2019 --module --source-map \"url='signalr-protocol-msgpack.min.js.map',content='./dist/browser/signalr-protocol-msgpack.js.map'\" --comments -o ./dist/browser/signalr-protocol-msgpack.min.js ./dist/browser/signalr-protocol-msgpack.js" + "build:uglify": "terser -m -c --ecma 2019 --module --source-map \"url='signalr-protocol-msgpack.min.js.map',content='./dist/browser/signalr-protocol-msgpack.js.map'\" --comments -o ./dist/browser/signalr-protocol-msgpack.min.js ./dist/browser/signalr-protocol-msgpack.js", + "get-version": "node -e \"const { name, version } = require('./package.json'); console.log(`${name};${version}`);\"" }, "keywords": [ "signalr", diff --git a/src/SignalR/clients/ts/signalr/package.json b/src/SignalR/clients/ts/signalr/package.json index 5f11d829f9e8..bfe2c8f53758 100644 --- a/src/SignalR/clients/ts/signalr/package.json +++ b/src/SignalR/clients/ts/signalr/package.json @@ -18,7 +18,8 @@ "build:esm": "tsc --project ./tsconfig.json --module es2015 --outDir ./dist/esm -d", "build:cjs": "tsc --project ./tsconfig.json --module commonjs --outDir ./dist/cjs", "build:browser": "webpack-cli", - "build:webworker": "webpack-cli --env platform=webworker" + "build:webworker": "webpack-cli --env platform=webworker", + "get-version": "node -e \"const { name, version } = require('./package.json'); console.log(`${name};${version}`);\"" }, "keywords": [ "signalr", diff --git a/src/SignalR/docs/JSFunctionalTests.md b/src/SignalR/docs/JSFunctionalTests.md index a7e5a26fd278..27a7392fb44b 100644 --- a/src/SignalR/docs/JSFunctionalTests.md +++ b/src/SignalR/docs/JSFunctionalTests.md @@ -13,7 +13,7 @@ Our JavaScript client functional tests are written using [Jasmine](https://jasmi ### Iterating -The `npm test` command will take a while, because it will build the `clients\ts\signalr`, `clients\ts\signalr-protocol-msgpack` and `clients\ts\FunctionalTests` folders as well as `dotnet build` the `clients\ts\FunctionalTests` folder (to build the server-side components). If you are making changes, it's nice to be able to build only the things you need to build. To skip all the optional build steps, you can run `yarn run test:inner` in `clients\ts\FunctionalTests`. This will skip building `clients\ts\signalr` and `clients\signalr-protocol-msgpack` (it will still build the `clients\ts\FunctionalTests` folder). If you make changes to those libraries, you have to manually build those directories. +The `npm test` command will take a while, because it will build the `clients\ts\signalr`, `clients\ts\signalr-protocol-msgpack` and `clients\ts\FunctionalTests` folders as well as `dotnet build` the `clients\ts\FunctionalTests` folder (to build the server-side components). If you are making changes, it's nice to be able to build only the things you need to build. To skip all the optional build steps, you can run `npm run test:inner` in `clients\ts\FunctionalTests`. This will skip building `clients\ts\signalr` and `clients\signalr-protocol-msgpack` (it will still build the `clients\ts\FunctionalTests` folder). If you make changes to those libraries, you have to manually build those directories. ## Running tests from the browser