Skip to content

Commit

Permalink
add module parameter to the Boilerplate (bitfoundation#9668)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed Jan 14, 2025
1 parent 7e52dcb commit 7b0e84c
Show file tree
Hide file tree
Showing 35 changed files with 171 additions and 102 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/admin-sample.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --module Admin --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --module Admin --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
cd src\Templates\Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ..\..\..\ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --windows --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --captcha reCaptcha --signalR --framework net9.0
cd ..\..\..\ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --module Admin --windows --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --captcha reCaptcha --signalR --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --module Admin --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
- uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -313,7 +313,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --module Admin --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/bit.full.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ jobs:
cd TestPostgreSQL/src/Server/TestPostgreSQL.Server.Web/
dotnet build
cd ../../../../
dotnet new bit-bp --name TestMySql --database MySql --framework net8.0 --sample Admin --offlineDb
dotnet new bit-bp --name TestMySql --database MySql --framework net8.0 --module Admin --offlineDb
cd TestMySql/src/Server/TestMySql.Server.Web/
dotnet build
cd ../../../../
dotnet new bit-bp --name TestOther --database Other --framework net9.0 --sample Todo --sentry
dotnet new bit-bp --name TestOther --database Other --framework net9.0 --sample true --sentry
cd TestOther/src/Server/TestOther.Server.Web/
dotnet build
Expand Down Expand Up @@ -185,13 +185,13 @@ jobs:
- name: Test sample configuration 1
continue-on-error: true
run: |
dotnet new bit-bp --name TestProject --database SqlServer --filesStorage AzureBlobStorage --api Integrated --captcha reCaptcha --pipeline Azure --sample Admin --offlineDb --windows --appInsights --sentry --signalR --notification --framework net9.0
dotnet new bit-bp --name TestProject --database SqlServer --filesStorage AzureBlobStorage --api Integrated --captcha reCaptcha --pipeline Azure --module Admin --offlineDb --windows --appInsights --sentry --signalR --notification --framework net9.0
dotnet build TestProject/TestProject.sln -p:MultilingualEnabled=true -p:PwaEnabled=true -p:Environment=Staging
- name: Test sample configuration 2
continue-on-error: true
run: |
dotnet new bit-bp --name TestProject2 --database Other --filesStorage Other --api Standalone --captcha None --pipeline None --sample None --offlineDb false --windows false --appInsights false --sentry false --signalR false --notification false --framework net8.0
dotnet new bit-bp --name TestProject2 --database Other --filesStorage Other --api Standalone --captcha None --pipeline None --module None --offlineDb false --windows false --appInsights false --sentry false --signalR false --notification false --framework net8.0
dotnet build TestProject2/TestProject2.sln -p:MultilingualEnabled=false -p:PwaEnabled=false -p:Environment=Development
- name: Run BeforeBuildTasks
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/todo-sample.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net8.0
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample true --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net8.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --framework net9.0
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample true --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --offlineDb --signalR --framework net9.0
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample true --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --offlineDb --signalR --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down Expand Up @@ -234,7 +234,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --framework net9.0
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample true --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down Expand Up @@ -289,7 +289,7 @@ jobs:
cd src\Templates\Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ..\..\..\ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --windows --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --captcha reCaptcha --signalR --framework net8.0
cd ..\..\..\ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample true --windows --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --captcha reCaptcha --signalR --framework net8.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down Expand Up @@ -346,7 +346,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net8.0
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample true --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net8.0
- name: Extract Android signing key from env
uses: timheuer/[email protected]
Expand Down Expand Up @@ -444,7 +444,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net8.0
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample true --appInsights --sentry --apiServerUrl ${{ env.SERVER_ADDRESS }} --webAppUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net8.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
{
"id": "sample"
},
{
"id": "module"
},
{
"id": "signalR"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,23 @@
"sample": {
"displayName": "Sample",
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Add todo page sample."
},
"module": {
"displayName": "Module",
"type": "parameter",
"datatype": "choice",
"defaultValue": "None",
"choices": [
{
"choice": "Admin",
"description": "Admin Panel"
"description": "Admin Panel module"
},
{
"choice": "Todo",
"description": "Todo app"
"choice": "Sales",
"description": "Sales (E-Commerce module)"
},
{
"choice": "None",
Expand Down Expand Up @@ -407,30 +414,35 @@
]
},
{
"condition": "(sample != Admin)",
"condition": "(module != Admin)",
"exclude": [
"src/Shared/Dtos/Categories/**",
"src/Shared/Dtos/Dashboard/**",
"src/Server/Boilerplate.Server.Api/Controllers/Dashboard/**",
"src/Shared/Controllers/Dashboard/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Dashboard/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Categories/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Products/**"
]
},
{
"condition": "(module != Admin && module != Sales)",
"exclude": [
"src/Shared/Dtos/Categories/**",
"src/Shared/Dtos/Products/**",
"src/Server/Boilerplate.Server.Api/Controllers/Categories/**",
"src/Server/Boilerplate.Server.Api/Controllers/Products/**",
"src/Server/Boilerplate.Server.Api/Controllers/Dashboard/**",
"src/Server/Boilerplate.Server.Api/Data/Configurations/Category/**",
"src/Server/Boilerplate.Server.Api/Data/Configurations/Product/**",
"src/Server/Boilerplate.Server.Api/Mappers/CategoriesMapper.cs",
"src/Server/Boilerplate.Server.Api/Mappers/ProductsMapper.cs",
"src/Server/Boilerplate.Server.Api/Models/Categories/**",
"src/Server/Boilerplate.Server.Api/Models/Products/**",
"src/Shared/Controllers/Categories/**",
"src/Shared/Controllers/Products/**",
"src/Shared/Controllers/Dashboard/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Categories/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Dashboard/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Products/**"
"src/Shared/Controllers/Products/**"
]
},
{
"condition": "(sample != Todo)",
"condition": "(sample != true)",
"exclude": [
"src/Shared/Dtos/Todo/**",
"src/Server/Boilerplate.Server.Api/Controllers/Todo/**",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<section>
<BitNavBar TItem="BitNavBarOption" Style="width:100%">
<BitNavBarOption Text="@Localizer[nameof(AppStrings.Home)]" IconName="@BitIconName.Home" Url="@Urls.HomePage" />
@*#if (sample == "Todo")*@
@*#if (sample == true)*@
<BitNavBarOption Text="@Localizer[nameof(AppStrings.Todo)]" IconName="@BitIconName.ToDoLogoOutline" Url="@Urls.TodoPage" />
@*#endif*@
@*#if (sample == "Admin")*@
@*#if (module == "Admin")*@
<BitNavBarOption Text="@Localizer[nameof(AppStrings.Dashboard)]" IconName="@BitIconName.BarChartVerticalFill" Url="@Urls.DashboardPage" />
<BitNavBarOption Text="@Localizer[nameof(AppStrings.Categories)]" IconName="@BitIconName.BuildQueue" Url="@Urls.CategoriesPage" />
<BitNavBarOption Text="@Localizer[nameof(AppStrings.Products)]" IconName="@BitIconName.Product" Url="@Urls.ProductsPage" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*+:cnd:noEmit*@
@*#if (sample == "Admin")*@
@*#if (module == "Admin")*@
@using Boilerplate.Shared.Dtos.Categories
@using Boilerplate.Shared.Dtos.Products
@*#endif*@
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ private void InitializeNavPanelItems()
IconName = BitIconName.Home,
Url = Urls.HomePage,
},
//#if (sample == "Admin")
//#if (module == "Admin")
new()
{
Text = localizer[nameof(AppStrings.AdminPanel)],
Expand All @@ -38,7 +38,8 @@ private void InitializeNavPanelItems()
}
]
},
//#elif (sample == "Todo")
//#endif
//#if (sample == true)
new()
{
Text = localizer[nameof(AppStrings.Todo)],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,15 @@
"options": { "sourceMap": false }
},
//#endif
//#if (sample == "Todo")
//#if (sample == true)
{
"outputFile": "Components/Pages/Authorized/Todo/TodoPage.razor.css",
"inputFile": "Components/Pages/Authorized/Todo/TodoPage.razor.scss",
"minify": { "enabled": false },
"options": { "sourceMap": false }
},
//#elif (sample == "Admin")
//#endif
//#if (module == "Admin")
{
"outputFile": "Components/Pages/Authorized/Categories/AddOrEditCategoryPage.razor.css",
"inputFile": "Components/Pages/Authorized/Categories/AddOrEditCategoryPage.razor.scss",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" />
<PackageReference Include="Microsoft.Extensions.Logging.EventSource" />
<!--/+:msbuild-conditional:noEmit -->
<PackageReference Condition="'$(sample)' == 'Admin' OR '$(sample)' == ''" Include="Newtonsoft.Json" />
<PackageReference Condition="'$(module)' == 'Admin' OR '$(module)' == ''" Include="Newtonsoft.Json" />
<PackageReference Condition=" '$(sentry)' == 'true' OR '$(sentry)' == '' " Include="Sentry.Maui" />
<PackageReference Condition=" '$(appInsights)' == 'true' OR '$(appInsights)' == '' " Include="Microsoft.Extensions.Logging.ApplicationInsights" />
<PackageReference Condition=" '$(notification)' == 'true' OR '$(notification)' == ''" Include="Plugin.LocalNotification" />
Expand Down
Loading

0 comments on commit 7b0e84c

Please sign in to comment.