Files
Umbraco-CMS/templates/UmbracoExtension/Umbraco.Extension.csproj
Jacob Overgaard df6a88b4d5 V15: Enable umbraco-extension client to auto-build (#18597)
* feat: adds autobuild of umbraco extensions created by the dotnet template

* adds file extensions to imports to follow the esmodule convention + apply formatting

* build(deps): upgrade hey-api, vite, typescript and generate new api

* chore: formatting

* clean up actions as client is now automatically being built when starting the site

* revert change with UMBRACO_VERSION_FROM_TEMPLATE

* revert if(includeExample)

* use template name

* use template name

* feat: update the way it sets the auth token

* add back in IncludeExample if

* fix: rename allowPackageTelemetry to allowTelemetry because that is what it is actually called

* `.csproj` amends

- Adds `BeforeTargets` to "BuildClient" target
- Adds "package.json" to "RestoreClient" target input
- Removes extra parameters from `npm i` command

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-03-11 16:14:47 +00:00

58 lines
2.5 KiB
XML

<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AddRazorSupportForMvc Condition="'$(SupportPagesAndViews)' == 'True'">true</AddRazorSupportForMvc>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Umbraco.Extension</RootNamespace>
<StaticWebAssetBasePath>/</StaticWebAssetBasePath>
</PropertyGroup>
<PropertyGroup>
<PackageId>Umbraco.Extension</PackageId>
<Product>Umbraco.Extension</Product>
<Title>Umbraco.Extension</Title>
</PropertyGroup>
<ItemGroup Condition="'$(SupportPagesAndViews)' == 'True'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Umbraco.Cms.Web.Website" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
<PackageReference Include="Umbraco.Cms.Web.Common" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
<PackageReference Include="Umbraco.Cms.Api.Common" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
<PackageReference Include="Umbraco.Cms.Api.Management" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
</ItemGroup>
<ItemGroup>
<ClientAssetsInputs Include="Client\**" Exclude="$(DefaultItemExcludes)" />
<!-- Dont include the client folder as part of packaging nuget build -->
<Content Remove="Client\**" />
<!-- However make the Umbraco-package.json included for dotnet pack or nuget package and visible to the solution -->
<None Include="Client\public\umbraco-package.json" Pack="false" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<!-- Restore and build Client files -->
<Target Name="RestoreClient" Inputs="Client\package.json;Client\package-lock.json" Outputs="Client\node_modules\.package-lock.json">
<Message Importance="high" Text="Restoring Client NPM packages..." />
<Exec Command="npm i" WorkingDirectory="Client" />
</Target>
<Target Name="BuildClient" BeforeTargets="AssignTargetPaths" DependsOnTargets="RestoreClient" Inputs="@(ClientAssetsInputs)" Outputs="$(IntermediateOutputPath)client.complete.txt">
<Message Importance="high" Text="Executing Client NPM build script..." />
<Exec Command="npm run build" WorkingDirectory="Client" />
<ItemGroup>
<_ClientAssetsBuildOutput Include="wwwroot\App_Plugins\**" />
</ItemGroup>
<WriteLinesToFile File="$(IntermediateOutputPath)client.complete.txt" Lines="@(_ClientAssetsBuildOutput)" Overwrite="true" />
</Target>
</Project>