diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index daa48a7ee0..6d54018010 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,9 @@ jobs: # Install dependencies - uses: actions/setup-dotnet@v3 with: - dotnet-version: '6.0.x' + global-json-file: packages/nimble-blazor/global.json + - run: dotnet --info + working-directory: packages/nimble-blazor/ - uses: actions/setup-node@v3 with: node-version: '16' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b724ddbcc..57c52c1103 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,8 @@ This repository uses the following tooling. See below for more info. First step in development is to build the monorepo which requires the following to be installed: - Node.js version 16+ (run `node --version`) and npm version 8+ (run `npm --version`) which can be downloaded from https://nodejs.org/en/download/ -- .NET 6 SDK version 6.0.202+ (run `dotnet --version`) which can be downloaded from https://dotnet.microsoft.com/en-us/download +- .NET 6 SDK (`6.0.202 <= version < 7`) which can be downloaded from https://dotnet.microsoft.com/en-us/download + - Run `dotnet --info` to verify the required version of the SDK is installed. A `v6` install is required, but it's fine if later versions are installed too. From the `nimble` directory: diff --git a/change/@ni-nimble-blazor-48a8f3aa-cad3-4fc9-8a98-159d24ed56d0.json b/change/@ni-nimble-blazor-48a8f3aa-cad3-4fc9-8a98-159d24ed56d0.json new file mode 100644 index 0000000000..8861fc783b --- /dev/null +++ b/change/@ni-nimble-blazor-48a8f3aa-cad3-4fc9-8a98-159d24ed56d0.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Specify .NET 6 via global.json file; re-enable Blazor linting", + "packageName": "@ni/nimble-blazor", + "email": "20709258+msmithNI@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/nimble-blazor/CONTRIBUTING.md b/packages/nimble-blazor/CONTRIBUTING.md index a7aaa659bd..d89f2e2ab7 100644 --- a/packages/nimble-blazor/CONTRIBUTING.md +++ b/packages/nimble-blazor/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## Getting Started -If not already done, download and install the .NET 6 SDK version 6.0.202+ (run `dotnet --version`) which can be downloaded from https://dotnet.microsoft.com/en-us/download +If not already done, download and install the .NET SDK (see [the main contributing doc](/CONTRIBUTING.md) for the required version). Initialize and build the Nimble monorepo (`npm install` + `npm run build` from the root `nimble` directory) before working with the Blazor codebase. diff --git a/packages/nimble-blazor/README.md b/packages/nimble-blazor/README.md index 0cfea8c2aa..11314a368b 100644 --- a/packages/nimble-blazor/README.md +++ b/packages/nimble-blazor/README.md @@ -21,7 +21,7 @@ This repo contains: - Visual Studio 2022 ([Enterprise, if available](https://my.visualstudio.com/Downloads?PId=8229)): Choose the "ASP.NET and Web Development" Workload in the installer - Ensure Visual Studio is completely up to date (v17.1.6+): In Visual Studio click "Help" then "Check for Updates" - **Mac with Visual Studio Code**: Install [Visual Studio Code](https://code.visualstudio.com/) and open it. Open the Extensions pane ("Preferences" >> "Extensions"), and search for / install the `ms-dotnettools.csharp` extension. -2. .NET 6 SDK: If not already done, download and install the .NET 6 SDK version 6.0.202+ (run `dotnet --version`) which can be downloaded from https://dotnet.microsoft.com/en-us/download +2. .NET SDK: See [the main contributing doc](/CONTRIBUTING.md) for the required version. ### Creating a new Blazor project diff --git a/packages/nimble-blazor/global.json b/packages/nimble-blazor/global.json new file mode 100644 index 0000000000..bfdf1e2ca5 --- /dev/null +++ b/packages/nimble-blazor/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "6.0.202", + "allowPrelease": "false", + "rollForward": "latestMinor" + } +} diff --git a/packages/nimble-blazor/package.json b/packages/nimble-blazor/package.json index 6295d33c42..40891a590a 100644 --- a/packages/nimble-blazor/package.json +++ b/packages/nimble-blazor/package.json @@ -11,7 +11,7 @@ "generate-icons:bundle": "rollup --bundleConfigAsCjs --config build/generate-icons/rollup.config.js", "generate-icons:run": "node build/generate-icons/dist/index.js", "generate-hybrid": "rollup --bundleConfigAsCjs --config build/generate-hybrid/rollup.config.js", - "lint": "npm run lint:js", + "lint": "npm run lint:cs && npm run lint:js", "lint:cs": "dotnet format --verify-no-changes", "lint:js": "eslint .", "format": "npm run format:cs && npm run format:js",