Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions InstallAndBuildAllTemplates.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Remove-Item -LiteralPath $tests -Force -Recurse -ErrorAction SilentlyContinue
New-Item -Path $tests -ItemType Directory

dotnet new install $(Join-Path $PSScriptRoot '/src/mudblazor') --force
dotnet new install $(Join-Path $PSScriptRoot '/src/mudblazor-wasm') --force

dotnet new mudblazor --interactivity None --output $(Join-Path $tests 'InteractivityNone')
dotnet build $(Join-Path $tests '/InteractivityNone') /warnaserror
Expand Down Expand Up @@ -55,3 +56,27 @@ dotnet build $(Join-Path $tests 'InteractivityAuto_Auth_LocalDb') /warnaserror

dotnet new mudblazor --interactivity Auto --output $(Join-Path $tests 'InteractivityAuto_UseMain') --use-program-main
dotnet build $(Join-Path $tests 'InteractivityAuto_UseMain') /warnaserror

dotnet new mudblazorwasm --output $(Join-Path $tests 'WasmStandalone')
dotnet build $(Join-Path $tests 'WasmStandalone') /warnaserror

dotnet new mudblazorwasm --output $(Join-Path $tests 'WasmStandalone_Auth_Individual') --auth Individual
dotnet build $(Join-Path $tests 'WasmStandalone_Auth_Individual') /warnaserror

dotnet new mudblazorwasm --output $(Join-Path $tests 'WasmStandalone_Auth_B2C') --auth IndividualB2C
dotnet build $(Join-Path $tests 'WasmStandalone_Auth_B2C') /warnaserror

dotnet new mudblazorwasm --output $(Join-Path $tests 'WasmStandalone_Auth_SingleOrg') --auth SingleOrg
dotnet build $(Join-Path $tests 'WasmStandalone_Auth_SingleOrg') /warnaserror

dotnet new mudblazorwasm --output $(Join-Path $tests 'WasmStandalone_Pwa') --pwa
dotnet build $(Join-Path $tests 'WasmStandalone_Pwa') /warnaserror

dotnet new mudblazorwasm --output $(Join-Path $tests 'WasmStandalone_UseMain') --use-program-main
dotnet build $(Join-Path $tests 'WasmStandalone_UseMain') /warnaserror

dotnet new mudblazorwasm --output $(Join-Path $tests 'WasmStandalone_Empty') --empty
dotnet build $(Join-Path $tests 'WasmStandalone_Empty') /warnaserror

dotnet new mudblazorwasm --output $(Join-Path $tests 'WasmStandalone_CallsWebApi') --auth IndividualB2C --called-api-url https://example.com/api --called-api-scopes api.read
dotnet build $(Join-Path $tests 'WasmStandalone_CallsWebApi') /warnaserror
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ To preview updates without changing anything:
dotnet new update --check-only
```

To verify which version is installed / available:
To verify which versions/templates are installed / available:

```bash
dotnet new list mudblazor
dotnet new list mudblazorwasm
```

If you want to reinstall manually (for example, to pin a specific version), uninstall and install again:
Expand All @@ -60,6 +61,10 @@ dotnet new install MudBlazor.Templates::<version>
## Usage
### Common Commands

Templates included in this package:
- `mudblazor` = MudBlazor Web App (Blazor Web App / interactivity modes)
- `mudblazorwasm` = MudBlazor WebAssembly Standalone App

Create a new app (default is `Server` interactivity):
```bash
dotnet new mudblazor -o MyMudApp
Expand Down Expand Up @@ -130,6 +135,53 @@ For the complete option list (including advanced template options), run:
dotnet new mudblazor --help
```

### Standalone WASM (`mudblazorwasm`)

Create a new standalone WebAssembly app:
```bash
dotnet new mudblazorwasm -o MyMudWasmApp
```

Create a standalone WebAssembly app with Individual auth (this also exercises the `MissingAuthority` guidance by default until provider values are configured):
```bash
dotnet new mudblazorwasm -o MyMudWasmApp --auth Individual
```

Create a standalone WebAssembly app with Azure AD B2C auth:
```bash
dotnet new mudblazorwasm -o MyMudWasmApp --auth IndividualB2C
```

Create a standalone WebAssembly app with single-tenant organizational auth:
```bash
dotnet new mudblazorwasm -o MyMudWasmApp --auth SingleOrg
```

Create a standalone PWA:
```bash
dotnet new mudblazorwasm -o MyMudWasmApp --pwa
```

Create an empty standalone app (omit sample/demo pages and styling):
```bash
dotnet new mudblazorwasm -o MyMudWasmApp --empty
```

Create a standalone app using explicit `Program.Main`:
```bash
dotnet new mudblazorwasm -o MyMudWasmApp --use-program-main
```

Generate the "Call Web API" sample navigation/page variant (B2C + non-default API settings):
```bash
dotnet new mudblazorwasm -o MyMudWasmApp --auth IndividualB2C --called-api-url https://example.com/api --called-api-scopes api.read
```

For the complete standalone WASM option list, run:
```bash
dotnet new mudblazorwasm --help
```

### Visual Studio Templates
The templates can also be used in Visual Studio and should show up in the "Create a new project" template list.
Common options map to Visual Studio's project creation UI, but the CLI examples above are the best reference for advanced combinations and flags.
Expand Down
3 changes: 2 additions & 1 deletion src/MudBlazor.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- The package metadata. Fill in the properties marked as TODO below -->
<!-- Follow the instructions on https://learn.microsoft.com/en-us/nuget/create-packages/package-authoring-best-practices -->
<PackageId>MudBlazor.Templates</PackageId>
<Version>4.0.1</Version>
<Version>4.1.0</Version>
<Title>MudBlazor Templates</Title>
<Company>MudBlazor</Company>
<Authors>MudBlazor Team and Contributors</Authors>
Expand Down Expand Up @@ -44,6 +44,7 @@

<ItemGroup>
<Content Include="mudblazor\**\*" Exclude="mudblazor\**\bin\**;mudblazor\**\obj\**" />
<Content Include="mudblazor-wasm\**\*" Exclude="mudblazor-wasm\**\bin\**;mudblazor-wasm\**\obj\**" />
<Compile Remove="**\*" />
</ItemGroup>
</Project>
107 changes: 107 additions & 0 deletions src/mudblazor-wasm/.template.config/dotnetcli.host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"$schema": "https://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"skipRestore": {
"longName": "no-restore",
"shortName": ""
},
"PWA": {
"longName": "pwa"
},
"Framework": {
"longName": "framework"
},
"Empty": {
"longName": "empty"
},
"IncludeSampleContent": {
"isHidden": true
},
"UseLocalDB": {
"longName": "use-local-db"
},
"AADInstance": {
"longName": "aad-instance",
"shortName": ""
},
"AAdB2CInstance": {
"longName": "aad-b2c-instance",
"shortName": ""
},
"SignUpSignInPolicyId": {
"longName": "susi-policy-id",
"shortName": "ssp"
},
"OrgReadAccess": {
"longName": "org-read-access",
"shortName": "r"
},
"ClientId": {
"longName": "client-id",
"shortName": ""
},
"AppIDUri": {
"longName": "app-id-uri",
"shortName": ""
},
"APIClientId": {
"longName": "api-client-id",
"shortName": ""
},
"Domain": {
"longName": "domain",
"shortName": ""
},
"TenantId": {
"longName": "tenant-id",
"shortName": ""
},
"DefaultScope": {
"longName": "default-scope",
"shortName": "s"
},
"Authority": {
"longName": "authority",
"shortName": ""
},
"kestrelHttpPort": {
"isHidden": true
},
"kestrelHttpsPort": {
"isHidden": true
},
"iisHttpPort": {
"isHidden": true
},
"iisHttpsPort": {
"isHidden": true
},
"ExcludeLaunchSettings": {
"longName": "exclude-launch-settings",
"shortName": ""
},
"UserSecretsId": {
"isHidden": true
},
"NoHttps": {
"longName": "no-https",
"shortName": ""
},
"CalledApiUrl": {
"longName": "called-api-url",
"shortName": ""
},
"CalledApiScopes": {
"longName": "called-api-scopes",
"shortName": ""
},
"CallsMicrosoftGraph": {
"longName": "calls-graph",
"shortName": ""
},
"UseProgramMain": {
"longName": "use-program-main",
"shortName": ""
}
}
}
25 changes: 25 additions & 0 deletions src/mudblazor-wasm/.template.config/ide.host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://json.schemastore.org/ide.host",
"order": 610,
"icon": "ide/icon.ico",
"disableHttpsSymbol": "NoHttps",
"symbolInfo": [
{
"id": "PWA",
"isVisible": true,
"persistenceScope": "templateGroup"
},
{
"id": "UseProgramMain",
"isVisible": true,
"persistenceScope": "shared",
"persistenceScopeName": "Microsoft"
},
{
"id": "IncludeSampleContent",
"isVisible": true,
"persistenceScope": "shared",
"persistenceScopeName": "Microsoft"
}
]
}
Binary file added src/mudblazor-wasm/.template.config/ide/icon.ico
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"author": "MudBlazor",
"name": "MudBlazor Samostatná aplikace Blazor WebAssembly",
"description": "Šablona projektu pro vytvoření aplikace Blazor, která běží ve WebAssembly. Tato šablona se dá využít pro webové aplikace s propracovanými dynamickými uživatelskými rozhraními (UI).",
"symbols/Framework/description": "Cílová architektura pro projekt",
"symbols/Framework/choices/net10.0/description": "Cíl net10.0",
"symbols/skipRestore/description": "Pokud se tato možnost zadá, přeskočí automatické obnovení projektu při vytvoření.",
"symbols/auth/choices/None/description": "Bez ověřování",
"symbols/auth/choices/Individual/description": "Ověřování Individual",
"symbols/auth/choices/IndividualB2C/description": "Ověřování Individual pomocí Azure AD B2C",
"symbols/auth/choices/SingleOrg/description": "Ověřování organizace pro jednoho tenanta",
"symbols/auth/description": "Typ ověřování, který se má použít",
"symbols/Authority/description": "Autorita poskytovatele OIDC (používá se se samostatným ověřováním Individual).",
"symbols/AAdB2CInstance/description": "Instance Azure Active Directory B2C, ke které se chcete připojit (používá se s ověřováním IndividualB2C).",
"symbols/SignUpSignInPolicyId/description": "ID zásad přihlašování a registrace pro tento projekt (používá se s ověřováním IndividualB2C).",
"symbols/AADInstance/description": "Instance Azure Active Directory, ke které se chcete připojit (používá se s ověřováním SingleOrg).",
"symbols/ClientId/description": "ID klienta pro tento projekt (v samostatných scénářích se používá s ověřováním IndividualB2C, SingleOrg nebo Individual).",
"symbols/Domain/description": "Doména pro tenanta adresáře (používá se s ověřováním SingleOrg nebo IndividualB2C).",
"symbols/AppIDUri/description": "Identifikátor URI ID aplikace pro serverové rozhraní API, které chceme volat (používá se s ověřováním SingleOrg nebo IndividualB2C).",
"symbols/APIClientId/description": "ID klienta pro rozhraní API, které server hostuje (používá se s IndividualB2C, SingleOrg).",
"symbols/DefaultScope/description": "Rozsah rozhraní API, který musí klient požádat o zřízení přístupového tokenu. (použijte s IndividualB2C, SingleOrg).",
"symbols/TenantId/description": "TenantId adresáře, ke kterému se chcete připojit (používá se s ověřováním SingleOrg).",
"symbols/OrgReadAccess/description": "Určuje, jestli se této aplikaci povolí přístup ke čtení adresáře (platí jenom pro ověřování SingleOrg).",
"symbols/UserSecretsId/description": "ID, které se má použít pro tajné kódy (používá se s ověřováním OrgReadAccess nebo Individual).",
"symbols/ExcludeLaunchSettings/description": "Určuje, jestli se má z vygenerované šablony vyloučit soubor launchSettings.json.",
"symbols/kestrelHttpPort/description": "Číslo portu, který se má použít pro koncový bod HTTP v souboru launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Číslo portu, který se má použít pro koncový bod HTTPS v souboru launchSettings.json. Tato možnost se dá použít jenom v případě, že se nepoužije parametr no-https (no-https se bude ignorovat, pokud se použije IndividualAuth nebo OrganizationalAuth).",
"symbols/iisHttpPort/description": "Číslo portu, který se má použít pro koncový bod IIS Express HTTP v souboru launchSettings.json.",
"symbols/iisHttpsPort/description": "Číslo portu, který se má použít pro koncový bod IIS Express HTTPS v souboru launchSettings.json. Tato možnost se dá použít jenom v případě, že se nepoužije parametr no-https (no-https se bude ignorovat, pokud se použije IndividualAuth nebo OrganizationalAuth).",
"symbols/PWA/displayName": "_Progresivní webová aplikace",
"symbols/PWA/description": "Pokud je tato možnost zadaná, vytvoří progresivní webovou aplikaci (PWA), která podporuje instalaci a offline použití.",
"symbols/IncludeSampleContent/displayName": "_Zahrnout ukázkové stránky",
"symbols/IncludeSampleContent/description": "Nastavuje, jestli se mají přidávat ukázkové stránky a styly pro demonstraci základních vzorů použití.",
"symbols/Empty/description": "Nastavuje, jestli se mají vynechat ukázkové stránky a styly, které demonstrují základní vzory použití.",
"symbols/NoHttps/description": "Určuje, jestli se má protokol HTTPS vypnout. Tato možnost platí jenom v případě, že se pro --auth nepoužívají Individual, IndividualB2C, SingleOrg ani MultiOrg.",
"symbols/UseLocalDB/description": "Určuje, jestli se má použít LocalDB namísto SQLite. Tato možnost platí jenom v případě, že je zadáno --auth Individual nebo --auth IndividualB2C.",
"symbols/CalledApiUrl/description": "Adresa URL rozhraní API, která se má volat z webové aplikace. Tato možnost platí jenom v případě, že je zadáno --auth SingleOrg, --auth MultiOrg nebo --auth IndividualB2C a také je zadán hostitel ASP.NET Core.",
"symbols/CalledApiScopes/description": "Obory, které se mají požádat žádat o volání rozhraní API z webové aplikace. Tato možnost platí jenom v případě, že je zadáno --auth SingleOrg, --auth MultiOrg nebo --auth IndividualB2C a také je zadán hostitel ASP.NET Core.",
"symbols/UseProgramMain/displayName": "Nepoužívat _příkazy nejvyšší úrovně",
"symbols/UseProgramMain/description": "Určuje, jestli se má místo příkazů nejvyšší úrovně generovat explicitní třída Program a metoda Main.",
"postActions/restore/description": "Obnoví balíčky NuGet vyžadované tímto projektem.",
"postActions/restore/manualInstructions/default/text": "Spustit dotnet restore",
"postActions/open-file/description": "Otevře soubor Readme.txt v editoru."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"author": "MudBlazor",
"name": "MudBlazor Eigenständige Blazor WebAssembly-App",
"description": "Eine Projektvorlage für das Erstellen einer Blazor-App, die in WebAssembly ausgeführt wird. Diese Vorlage kann für Web-Apps mit umfangreichen dynamischen Benutzeroberflächen verwendet werden.",
"symbols/Framework/description": "Das Zielframework für das Projekt.",
"symbols/Framework/choices/net10.0/description": "Ziel.-NET10.0",
"symbols/skipRestore/description": "Wenn angegeben, wird die automatische Wiederherstellung des Projekts beim Erstellen übersprungen.",
"symbols/auth/choices/None/description": "Keine Authentifizierung",
"symbols/auth/choices/Individual/description": "Individuelle Authentifizierung",
"symbols/auth/choices/IndividualB2C/description": "Individuelle Authentifizierung mit Azure AD B2C",
"symbols/auth/choices/SingleOrg/description": "Organisationsauthentifizierung für einen einzelnen Mandanten",
"symbols/auth/description": "Der zu verwendende Authentifizierungstyp",
"symbols/Authority/description": "Die Autorität des OIDC Anbieters (Verwendung mit eigenständiger individueller Authentifizierung).",
"symbols/AAdB2CInstance/description": "Die Azure Active Directory B2C-Instanz, mit der eine Verbindung hergestellt werden soll (mit IndividualB2C-Authentifizierung verwenden).",
"symbols/SignUpSignInPolicyId/description": "Die Anmelde und Registrierungsrichtlinien ID für dieses Projekt (mit IndividualB2C Authentifizierung verwenden).",
"symbols/AADInstance/description": "Die Azure Active Directory-Instanz, mit der eine Verbindung hergestellt werden soll (mit SingleOrg-Authentifizierung verwenden).",
"symbols/ClientId/description": "Die Client-ID für dieses Projekt (Verwendung mit IndividualB2C, SingleOrg oder Individual Auth in eigenständigen Szenarien).",
"symbols/Domain/description": "Die Domäne für den Verzeichnismandanten (mit SingleOrg oder IndividualB2C Authentifizierung verwenden).",
"symbols/AppIDUri/description": "Der App ID URI für die Server-API, die wir aufrufen möchten (mit SingleOrg- oder IndividualB2C-Authentifizierung verwenden).",
"symbols/APIClientId/description": "Die Client ID für die API, die der Server hostet (mit IndividualB2C, SingleOrg verwenden).",
"symbols/DefaultScope/description": "Der API Bereich, den der Client anfordern muss, um ein Zugriffstoken bereitzustellen. (Verwendung mit IndividualB2C, SingleOrg).",
"symbols/TenantId/description": "Die TenantId ID des Verzeichnisses, mit dem eine Verbindung hergestellt werden soll (mit SingleOrg Authentifizierung verwenden).",
"symbols/OrgReadAccess/description": "Ob dieser Anwendung Lesezugriff auf das Verzeichnis gewährt werden soll oder nicht (gilt nur für SingleOrg).",
"symbols/UserSecretsId/description": "Die für Geheimnisse zu verwendende ID (Verwendung mit OrgReadAccess oder Einzelauthentifizierung).",
"symbols/ExcludeLaunchSettings/description": "Ob launchSettings.json aus der generierten Vorlage ausgeschlossen werden soll.",
"symbols/kestrelHttpPort/description": "Portnummer, die für den HTTP Endpunkt in launchSettings.json verwendet werden soll.",
"symbols/kestrelHttpsPort/description": "Portnummer, die für den HTTPS Endpunkt in launchSettings.json verwendet werden soll. Diese Option ist nur anwendbar, wenn der Parameter no-https nicht verwendet wird (no-https wird ignoriert, wenn entweder IndividualAuth oder OrganizationalAuth verwendet wird).",
"symbols/iisHttpPort/description": "Portnummer, die für den IIS Express HTTP Endpunkt in launchSettings.json verwendet werden soll.",
"symbols/iisHttpsPort/description": "Portnummer, die für den IIS Express HTTPS Endpunkt in launchSettings.json verwendet werden soll. Diese Option ist nur anwendbar, wenn der Parameter no-https nicht verwendet wird (no-https wird ignoriert, wenn entweder IndividualAuth oder OrganizationalAuth verwendet wird).",
"symbols/PWA/displayName": "_Progressive Webanwendung",
"symbols/PWA/description": "Wenn angegeben, wird eine Progressive Web Application (PWA) erstellt, die die Installation und Offlineverwendung unterstützt.",
"symbols/IncludeSampleContent/displayName": "_Include Beispielseiten",
"symbols/IncludeSampleContent/description": "Konfiguriert, ob Beispielseiten und Stile hinzugefügt werden, um grundlegende Verwendungsmuster zu veranschaulichen.",
"symbols/Empty/description": "Konfiguriert, ob Beispielseiten und Formatierungen weggelassen werden sollen, die grundlegende Verwendungsmuster veranschaulichen.",
"symbols/NoHttps/description": "Ob HTTPS deaktiviert werden soll. Diese Option gilt nur, wenn Individual, IndividualB2C, SingleOrg oder MultiOrg nicht für --auth verwendet werden.",
"symbols/UseLocalDB/description": "Ob LocalDB anstelle von SQLite verwendet werden soll. Diese Option gilt nur, wenn --auth Individual oder --auth IndividualB2C angegeben ist.",
"symbols/CalledApiUrl/description": "URL der API, die von der Web-App aufgerufen werden soll. Diese Option gilt nur, wenn --auth SingleOrg, --auth MultiOrg oder --auth IndividualB2C ohne und ASP.NET Core-Host angegeben ist.",
"symbols/CalledApiScopes/description": "Anzufordernde Bereiche zum Aufrufen der API von der Web-App. Diese Option gilt nur, wenn --auth SingleOrg, --auth MultiOrg oder --auth IndividualB2C ohne und ASP.NET Core-Host angegeben ist.",
"symbols/UseProgramMain/displayName": "Keine Anweisungen_der obersten Ebene verwenden",
"symbols/UseProgramMain/description": "Gibt an, ob anstelle von Anweisungen der obersten Ebene eine explizite Programmklasse und eine Main-Methode generiert werden soll.",
"postActions/restore/description": "„NuGet-Pakete“ wiederherstellen, die für dieses Projekt erforderlich sind.",
"postActions/restore/manualInstructions/default/text": "„dotnet restore“ ausführen",
"postActions/open-file/description": "Öffnet Readme.txt im Editor"
}
Loading
Loading