Skip to content

Commit 34194f1

Browse files
authored
chore(Tools): move cli tool to root (#667)
* chore: 更新单元测试精简配置 * chore: 移动 Tools 位置 * chore: 增加 NetFramework 配置
1 parent 24abe7e commit 34194f1

9 files changed

Lines changed: 141 additions & 13 deletions

File tree

BootstrapBlazor.Extensions.slnx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@
103103
<File Path="src/readme.md" />
104104
<File Path="src/SourceLink.targets" />
105105
</Folder>
106-
<Folder Name="/src/tools/">
107-
<Project Path="src/tools/BootstrapBlazor.CssBundler/BootstrapBlazor.CssBundler.csproj" />
108-
</Folder>
109106
<Folder Name="/test/">
110107
<Project Path="test/UnitTestEditor/UnitTestEditor.csproj" />
111108
<Project Path="test/UnitTestHoliday/UnitTestHoliday.csproj" />
@@ -114,4 +111,10 @@
114111
<Project Path="test/UnitTestRegion/UnitTestRegion.csproj" Id="37e8696e-3ae5-468f-b6d9-0a8eb4e81876" />
115112
<Project Path="test/UnitTestSvgIcon/UnitTestSvgIcon.csproj" />
116113
</Folder>
114+
<Folder Name="/test/props/">
115+
<File Path="test/Directory.Build.props" />
116+
</Folder>
117+
<Folder Name="/tools/">
118+
<Project Path="tools/BootstrapBlazor.CssBundler/BootstrapBlazor.CssBundler.csproj" />
119+
</Folder>
117120
</Solution>

src/tools/BootstrapBlazor.CssBundler/ArgumentsHelper.cs renamed to tools/BootstrapBlazor.CssBundler/ArgumentsHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
1+
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

@@ -9,9 +9,9 @@ static class ArgumentsHelper
99
public static void PrintHelp()
1010
{
1111
Console.ForegroundColor = ConsoleColor.Cyan;
12-
Console.WriteLine("Usage: BootstrapBlazorCssBundler [options]");
12+
Console.WriteLine("Usage: BootstrapBlazor.CssBundler [options]");
1313
Console.WriteLine("Options:");
14-
Console.WriteLine(" <bundler.json> ConfigFileFullPath D:\\Argo\\src\\BootstrapBlazor\\src\\BootstrapBlazor\\bundler.json");
14+
Console.WriteLine(" <bundler.json> ConfigFileFullPath D:\\src\\BootstrapBlazor\\src\\BootstrapBlazor\\bundler.json");
1515
Console.WriteLine();
1616
Console.ForegroundColor = ConsoleColor.Gray;
1717
}

src/tools/BootstrapBlazor.CssBundler/BootstrapBlazor.CssBundler.csproj renamed to tools/BootstrapBlazor.CssBundler/BootstrapBlazor.CssBundler.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Version>1.0.1</Version>
5-
<OutputType>Exe</OutputType>
4+
<Version>9.0.0</Version>
65
<TargetFramework>net9.0</TargetFramework>
7-
<ImplicitUsings>enable</ImplicitUsings>
8-
<Nullable>enable</Nullable>
96
</PropertyGroup>
107

118
<PropertyGroup>
12-
<TargetFrameworks>net9.0</TargetFrameworks>
9+
<OutputType>Exe</OutputType>
10+
<ImplicitUsings>enable</ImplicitUsings>
11+
<Nullable>enable</Nullable>
1312
</PropertyGroup>
1413

1514
<PropertyGroup>

tools/BootstrapBlazor.CssBundler/BootstrapBlazor.CssBundler.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

src/tools/BootstrapBlazor.CssBundler/BundlerOptions.cs renamed to tools/BootstrapBlazor.CssBundler/BundlerOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -17,6 +17,6 @@ public static List<BundlerOptions> LoadFromConfigFile(string configFile)
1717
{
1818
var json = File.ReadAllText(configFile);
1919

20-
return JsonSerializer.Deserialize<List<BundlerOptions>>(json, JsonSerializerOptions.Web) ?? new();
20+
return JsonSerializer.Deserialize<List<BundlerOptions>>(json, JsonSerializerOptions.Web) ?? [];
2121
}
2222
}
File renamed without changes.
6.26 KB
Loading
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Bootstrap Blazor Component
2+
3+
## A set of enterprise-class UI components based on Bootstrap and Blazor.
4+
5+
[![License](https://img.shields.io/github/license/dotnetcore/bootstrapblazor.svg?logo=git&logoColor=red)](https://github.com/dotnetcore/BootstrapBlazor/blob/main/LICENSE)
6+
[![Github build](https://img.shields.io/github/actions/workflow/status/dotnetcore/BootstrapBlazor/build.yml?branch=main&?label=main&logo=github)](https://github.com/dotnetcore/BootstrapBlazor/actions?query=workflow%3A%22Build+Project%22+branch%3Amain)
7+
[![Repo Size](https://img.shields.io/github/repo-size/dotnetcore/BootstrapBlazor.svg?logo=github&logoColor=green&label=repo)](https://github.com/dotnetcore/BootstrapBlazor)
8+
[![Commit Date](https://img.shields.io/github/last-commit/dotnetcore/BootstrapBlazor/main.svg?logo=github&logoColor=green&label=commit)](https://github.com/dotnetcore/BootstrapBlazor)
9+
[![codecov](https://codecov.io/gh/dotnetcore/BootstrapBlazor/branch/main/graph/badge.svg?token=5SXIWHXZC3)](https://codecov.io/gh/dotnetcore/BootstrapBlazor)
10+
11+
---
12+
13+
## Features
14+
- Enterprise-class UI designed for web applications.
15+
- A set of high-quality Blazor components out of the box.
16+
- Supports WebAssembly-based client-side and SignalR-based server-side UI event interaction.
17+
- Supports Progressive Web Applications (PWA).
18+
- Build with C#, a multi-paradigm static language for an efficient development experience.
19+
- .NET Standard 2.1 based, with direct reference to the rich .NET ecosystem.
20+
- Supports NET5. (Server-Side, WASM)
21+
- Seamless integration with existing ASP.NET Core MVC and Razor Pages projects.
22+
23+
## Online Examples
24+
[![website](https://img.shields.io/badge/China-https://www.blazor.zone-success.svg?color=red&logo=buzzfeed&logoColor=green)](https://www.blazor.zone)
25+
26+
## Installation Guide
27+
28+
- Install .net core sdk [Official website](https://dotnet.microsoft.com/download)
29+
- Install Visual Studio 2019 lastest [Official website](https://visualstudio.microsoft.com/vs/getting-started/)
30+
31+
```shell
32+
git clone https://github.com/dotnetcore/BootstrapBlazor.git
33+
cd BootstrapBlazor/src/BootstrapBlazor.Server
34+
dotnet run
35+
```
36+
37+
## Create a new project from the dotnet new template
38+
39+
1. Install the template
40+
41+
`dotnet new install Bootstrap.Blazor.Templates::*`
42+
43+
2. Create the Boilerplate project with the template
44+
45+
`dotnet new bbapp`
46+
47+
## Install Bootstrap Blazor Project Template
48+
49+
1. Download Project Template
50+
51+
Microsoft Market [link](https://marketplace.visualstudio.com/items?itemName=Longbow.BootstrapBlazorUITemplate)
52+
53+
2. Double Click **BootstrapBlazor.UITemplate.vsix**
54+
55+
## Import Bootstrap Blazor into an existing project
56+
57+
1. Go to the project folder of the application and install the Nuget package reference
58+
59+
`dotnet add package BootstrapBlazor`
60+
61+
2. **Add** the `stylesheet` `javascripts` file to your main index file - `Pages/_Host.cshtml (Server)` or `wwwroot/index.html (WebAssembly)`
62+
63+
**HTML**
64+
65+
```
66+
<!DOCTYPE html>
67+
<html lang="en">
68+
<head>
69+
. . .
70+
<link rel="stylesheet" href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css">
71+
</head>
72+
<body>
73+
. . .
74+
<script src="_framework/blazor.server.js"></script>
75+
<script src="_content/BootstrapBlazor/js/bootstrap.blazor.bundle.min.js"></script>
76+
</body>
77+
</html>
78+
```
79+
80+
3. Open the `~/Startup.cs` file in the and register the `Bootstrap Blazor` service:
81+
82+
**C#**
83+
84+
```
85+
namespace BootstrapBlazorAppName
86+
{
87+
public class Startup
88+
{
89+
public void ConfigureServices(IServiceCollection services)
90+
{
91+
//more code may be present here
92+
services.AddBootstrapBlazor();
93+
}
94+
95+
//more code may be present here
96+
}
97+
}
98+
```
99+
100+
## Visual Studio Integration
101+
102+
To create a new `Bootstrap Blazor` UI for Blazor application, use the Create New Project Wizard. The wizard detects all installed versions of `Bootstrap Blazor` for Blazor and lists them in the Version combobox—this enables you to start your project with the desired version. You can also get the latest version to make sure you are up to date.
103+
104+
1. Get the Wizard
105+
106+
To use the Create New Project Wizard, install the `Bootstrap Blazor` UI for Blazor Visual Studio Extensions. You can get it from the:
107+
108+
- Visual Studio Marketplace (for Windows)
109+
110+
2. Start the Wizard
111+
112+
To start the wizard, use either of the following approaches
113+
114+
### Using the Project menu:
115+
116+
- Click File > New > Project.
117+
- Find and click the C# Blazor Application option (you can use the search, or filter by Blazor templates).
118+
- Follow the wizard.

0 commit comments

Comments
 (0)