Skip to content

Commit f0b3ab0

Browse files
committed
refactor: upgrade docfx to new site design
1 parent dd0cee4 commit f0b3ab0

25 files changed

+438
-2168
lines changed

.config/dotnet-tools.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
"commands": [
88
"dotnet-serve"
99
]
10+
},
11+
"docfx": {
12+
"version": "2.67.0",
13+
"commands": [
14+
"docfx"
15+
]
1016
}
1117
}
1218
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:7.0
2+
3+
RUN dotnet --version
4+
5+
# Setting the path up to allow .NET tools
6+
ENV PATH "$PATH:/root/.dotnet/tools"
7+
8+
RUN dotnet tool install --global docfx --version 2.67.0
9+
10+
# Just checking things
11+
RUN dotnet tool list --global
12+
RUN docfx -v
13+
14+
# HACK: This effectively negates a git security patch that requires file ownership to match.
15+
# Doing this because it does not appear that there is a standard way to address this in our container setup.
16+
# A follow-up will likely be to take in a parameter and set the safe directory when that parameter is passed in.
17+
RUN git config --system --add safe.directory '*'
18+
19+
ENTRYPOINT [ "docfx" ]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: docfx-action
2+
author: bUnit team (forked from Niklas Mollenhauer)
3+
description: Runs docfx as a GitHub Action.
4+
5+
runs:
6+
using: docker
7+
image: 'Dockerfile'
8+
9+
branding:
10+
icon: book
11+
color: green

.github/workflows/docs-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
run: dotnet test docs/samples/samples.sln
8282

8383
- name: 🛠️ Building docs
84-
uses: nikeee/docfx[email protected]
84+
uses: ./workflows/actions/docfx
8585
with:
8686
args: docs/site/docfx.json
8787

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- Pass parameters, cascading values and inject services into components under test
2121
- Mock `IJSRuntime`, Blazor authentication and authorization, and others
2222

23-
bUnit builds on top of existing unit testing frameworks such as xUnit, NUnit, and MSTest, which run the Blazor component tests in just the same way as any normal unit test. bUnit runs a test in milliseconds, compared to browser-based UI tests which usually take seconds to run.
23+
bUnit builds on top of existing unit testing frameworks such as xUnit, NUnit, and MSTest, which run the Blazor component tests in just the same way as any normal unit test. bUnit runs a test in milliseconds, compared to browser-based UI tests which usually take seconds to run.
2424

2525
**Go to [bUnit.dev](https://bunit.dev) to learn more.**
2626

@@ -31,9 +31,9 @@ bUnit is available on NuGet in various incarnations. Most should just pick the [
3131
| Name | Description | NuGet Download Link |
3232
| ----- | ----- | ---- |
3333
| [bUnit](https://www.nuget.org/packages/bunit/) | Includes the bUnit.core and bUnit.web packages. | [![Nuget](https://img.shields.io/nuget/dt/bunit?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit/) |
34-
| [bUnit.core](https://www.nuget.org/packages/bunit.core/) | Core library that enables rendering a Blazor component in a test context. | [![Nuget](https://img.shields.io/nuget/dt/bunit.core?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.core/) |
35-
| [bUnit.web](https://www.nuget.org/packages/bunit.web/) | Adds support for testing Blazor components for the web. This includes bUnit.core. | [![Nuget](https://img.shields.io/nuget/dt/bunit.web?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.web/) |
36-
| [bUnit.template](https://www.nuget.org/packages/bunit.template/) | Template, which currently creates xUnit-based bUnit test projects only | [![Nuget](https://img.shields.io/nuget/dt/bunit.template?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.template/) |
34+
| [bUnit.core](https://www.nuget.org/packages/bunit.core/) | Core library that enables rendering a Blazor component in a test context. | [![Nuget](https://img.shields.io/nuget/dt/bunit.core?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.core/) |
35+
| [bUnit.web](https://www.nuget.org/packages/bunit.web/) | Adds support for testing Blazor components for the web. This includes bUnit.core. | [![Nuget](https://img.shields.io/nuget/dt/bunit.web?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.web/) |
36+
| [bUnit.template](https://www.nuget.org/packages/bunit.template/) | Template, which currently creates xUnit-based bUnit test projects only | [![Nuget](https://img.shields.io/nuget/dt/bunit.template?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.template/) |
3737

3838
To get started, head to the [getting started documentation](https://bunit.dev/docs/getting-started) to learn more.
3939

@@ -63,13 +63,6 @@ A huge thank you to the [sponsors of my work with bUnit](https://github.com/spon
6363
<br />
6464
Amazon Web Services
6565
</a>
66-
</td>
67-
<td align="center" width="120">
68-
<a href="https://github.com/hassanhabib">
69-
<img src="https://avatars.githubusercontent.com/u/1453985?s=460" alt="Hassan Rezk Habib (@hassanhabib)" width="72" height="72" class="avatar" />
70-
<br />
71-
Hassan Rezk Habib
72-
</a>
7366
</td>
7467
</tr>
7568
</table>
@@ -87,7 +80,7 @@ These good people have contributed code or documentation to bUnit:
8780
## Code of conduct
8881

8982
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
90-
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
83+
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
9184

9285
## .NET Foundation
9386

docs/.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
root = true
22

33
[*]
4+
tab_size = 2
45
indent_style = space
56
indent_size = 2
7+
indent_width = 2
68
charset = utf-8
79
trim_trailing_whitespace = true
810
insert_final_newline = false
@@ -11,6 +13,11 @@ insert_final_newline = false
1113
trim_trailing_whitespace = false
1214

1315
[*.{cs,razor}]
16+
tab_size = 2
17+
indent_style = space
18+
indent_size = 2
19+
indent_width = 2
20+
1421
dotnet_diagnostic.BL0001.severity = none
1522
dotnet_diagnostic.BL0002.severity = none
1623
dotnet_diagnostic.BL0003.severity = none

docs/site/docfx.json

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@
77
"bunit.core/bunit.core.csproj",
88
"bunit.web/bunit.web.csproj"
99
],
10-
"exclude": [ "**/bin/**", "**/obj/**", "../../src/AngleSharpWrappers", "../../src/bunit", "../../src/bunit.web.testcomponents", "../../src/bunit.template" ],
1110
"src": "../../src"
1211
}
1312
],
1413
"dest": "api",
15-
"properties": {
16-
"TargetFramework": "net7.0"
17-
},
14+
"includePrivateMembers": false,
1815
"disableGitFeatures": false,
19-
"disableDefaultFilter": false
16+
"disableDefaultFilter": false,
17+
"noRestore": true,
18+
"namespaceLayout": "flattened",
19+
"memberLayout": "samePage",
20+
"allowCompilationErrors": false
2021
}
2122
],
23+
2224
"build": {
2325
"content": [
2426
{
@@ -44,19 +46,8 @@
4446
"site.webmanifest",
4547
"*.png",
4648
"CNAME",
47-
"sponsors/**"
48-
]
49-
}
50-
],
51-
"overwrite": [
52-
{
53-
"files": [
54-
"apidoc/**.md"
55-
],
56-
"exclude": [
57-
"obj/**",
58-
"bin/**",
59-
"_site/**"
49+
"sponsors/**",
50+
"favicon.ico"
6051
]
6152
}
6253
],
@@ -65,6 +56,7 @@
6556
"fileMetadataFiles": [],
6657
"template": [
6758
"default",
59+
"modern",
6860
"templates/bunit"
6961
],
7062
"globalMetadata": {
@@ -73,11 +65,11 @@
7365
"_description": "bUnit is a unit testing library for Blazor Components. You can easily define components under test in C# or Razor syntax and verify outcome using semantic HTML diffing/comparison logic. You can interact with and inspect components, trigger event handlers, provide cascading values, inject services, mock IJsRuntime, and perform snapshot testing.",
7466
"_enableSearch": true,
7567
"_appLogoPath": "/images/bunit-logo.png",
76-
"_disableBreadcrumb": true,
77-
"_disableFooter": false
68+
"_disableBreadcrumb": false,
69+
"_disableFooter": false,
70+
"_appFooter": "<small>Documentation updated on #{NBGV_GitCommitDate}# in commit #{NBGV_GitCommitIdShort}#</small>"
7871
},
7972
"postProcessors": [],
80-
"markdownEngineName": "markdig",
8173
"noLangKeyword": false,
8274
"keepFileLink": false,
8375
"cleanupCacheHistory": true,

docs/site/docs.csproj

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/site/docs.sln

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/site/index.md

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ title: bUnit - a testing library for Blazor components
1818
- Pass parameters, cascading values and inject services into components under test
1919
- Mock `IJSRuntime`, Blazor authentication and authorization, and others
2020

21-
bUnit builds on top of existing unit testing frameworks such as xUnit, NUnit, and MSTest, which run the Blazor components tests in just the same way as any normal unit test. bUnit runs a test in milliseconds, compared to browser-based UI tests which usually take seconds to run.
21+
bUnit builds on top of existing unit testing frameworks such as xUnit, NUnit, and MSTest, which run the Blazor components tests in just the same way as any normal unit test. bUnit runs a test in milliseconds, compared to browser-based UI tests which usually take seconds to run.
2222

2323
**Go to the [Documentation](xref:getting-started) pages to learn more.**
2424

25-
### Test example
25+
### Test example
2626

2727
Let’s write a test for the `<Counter>` component listed below. This comes with the standard Blazor project template which verifies that the counter corrects increments when the button is clicked:
2828

29-
[!code-cshtml[Counter.razor](../samples/components/Counter.razor)]
29+
[!code-razor[Counter.razor](../samples/components/Counter.razor)]
3030

3131
To do this, you can carry out the following using bUnit and xUnit:
3232

@@ -43,50 +43,35 @@ bUnit is available on NuGet in various incarnations. Most users should just pick
4343
| Name | Description | NuGet Download Link |
4444
| ----- | ----- | ---- |
4545
| [bUnit](https://www.nuget.org/packages/bunit/) | Includes the bUnit.core and bUnit.web packages. | [![Nuget](https://img.shields.io/nuget/dt/bunit?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit/) |
46-
| [bUnit.core](https://www.nuget.org/packages/bunit.core/) | Core library that enables rendering a Blazor component in a test context. | [![Nuget](https://img.shields.io/nuget/dt/bunit.core?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.core/) |
47-
| [bUnit.web](https://www.nuget.org/packages/bunit.web/) | Adds support for testing Blazor components for the web. This includes bUnit.core. | [![Nuget](https://img.shields.io/nuget/dt/bunit.web?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.web/) |
48-
| [bUnit.template](https://www.nuget.org/packages/bunit.template/) | Template, which currently creates xUnit-based bUnit test projects only | [![Nuget](https://img.shields.io/nuget/dt/bunit.template?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.template/) |
46+
| [bUnit.core](https://www.nuget.org/packages/bunit.core/) | Core library that enables rendering a Blazor component in a test context. | [![Nuget](https://img.shields.io/nuget/dt/bunit.core?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.core/) |
47+
| [bUnit.web](https://www.nuget.org/packages/bunit.web/) | Adds support for testing Blazor components for the web. This includes bUnit.core. | [![Nuget](https://img.shields.io/nuget/dt/bunit.web?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.web/) |
48+
| [bUnit.template](https://www.nuget.org/packages/bunit.template/) | Template, which currently creates xUnit-based bUnit test projects only | [![Nuget](https://img.shields.io/nuget/dt/bunit.template?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.template/) |
4949

5050
## Sponsors
5151

5252
A huge thank you to the [sponsors of my work with bUnit](https://github.com/sponsors/egil). The higher tier sponsors are:
5353

54-
<table class="sponsors">
55-
<tr>
56-
<td align="center" width="120">
57-
<a href="https://github.com/Progress-Telerik">
58-
<img src="https://avatars.githubusercontent.com/u/57092419?s=460" alt="@Progress-Telerik" class="avatar" width="72" height="72" />
59-
<br />
60-
Progress Telerik
61-
</a>
62-
</td>
63-
<td align="center" width="120">
64-
<a href="https://github.com/syncfusion">
65-
<img class="avatar" src="https://avatars.githubusercontent.com/u/1699795?s=460" width="72" height="72" alt="@syncfusion" />
66-
<br />
67-
Syncfusion
68-
</a>
69-
</td>
70-
<td align="center" width="120">
71-
<a href="https://github.com/aws">
72-
<img class="avatar" src="https://avatars.githubusercontent.com/u/2232217?s=200&v=4" width="72" height="72" alt="@aws" />
73-
<br />
74-
Amazon Web Services
75-
</a>
76-
</td>
77-
<td align="center" width="120">
78-
<a href="https://github.com/hassanhabib">
79-
<img src="https://avatars.githubusercontent.com/u/1453985?s=460" alt="Hassan Rezk Habib (@hassanhabib)" width="72" height="72" class="avatar" />
80-
<br />
81-
Hassan Rezk Habib
82-
</a>
83-
</td>
84-
</tr>
85-
</table>
54+
<div class="d-flex flex-row mb-3">
55+
<a href="https://github.com/Progress-Telerik" class="d-block p-3 text-center">
56+
<img src="https://avatars.githubusercontent.com/u/57092419?s=460" alt="@Progress-Telerik" class="avatar avatar rounded-circle" width="72" height="72" />
57+
<br />
58+
Progress Telerik
59+
</a>
60+
<a href="https://github.com/syncfusion" class="d-block p-3 text-center">
61+
<img class="avatar avatar rounded-circle" src="https://avatars.githubusercontent.com/u/1699795?s=460" width="72" height="72" alt="@syncfusion" />
62+
<br />
63+
Syncfusion
64+
</a>
65+
<a href="https://github.com/aws" class="d-block p-3 text-center">
66+
<img class="avatar avatar rounded-circle" src="https://avatars.githubusercontent.com/u/2232217?s=200&v=4" width="72" height="72" alt="@aws" />
67+
<br />
68+
Amazon Web Services
69+
</a>
70+
</div>
8671

8772
## Contributors
8873

89-
Shout outs and a big thank you [to all the contributors](https://github.com/egil/bunit/graphs/contributors) to the library, including those who raise issues, those who provide input to issues, and those who send pull requests.
74+
Shout outs and a big thank you [to all the contributors](https://github.com/egil/bunit/graphs/contributors) to the library, including those who raise issues, those who provide input to issues, and those who send pull requests.
9075

9176
**Want to help out? You can help in a number of ways:**
9277

@@ -98,7 +83,7 @@ Shout outs and a big thank you [to all the contributors](https://github.com/egil
9883
## Code of conduct
9984

10085
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
101-
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
86+
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
10287

10388
## .NET Foundation
10489

0 commit comments

Comments
 (0)