Skip to content

Commit 9a898a0

Browse files
committed
Include ActiveCampaign static assets
1 parent 8d7b8f3 commit 9a898a0

4 files changed

Lines changed: 74 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const outputPath = '../wwwroot'

src/Umbraco.Forms.Integrations.Crm.ActiveCampaign/Client/public/umbraco-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "Umbraco.Forms.Integrations.Crm.ActiveCampaign",
33
"name": "Umbraco Forms Integrations: CRM - ActiveCampaign",
4-
"version": "6.0.0",
4+
"version": "6.0.1",
55
"extensions": [
66
{
77
"name": "Umbraco EntryPoint",

src/Umbraco.Forms.Integrations.Crm.ActiveCampaign/Umbraco.Forms.Integrations.Crm.ActiveCampaign.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PackageIconUrl></PackageIconUrl>
1818
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Forms.Integrations/tree/main-v10/src/Umbraco.Forms.Integrations.Crm.ActiveCampaign</PackageProjectUrl>
1919
<RepositoryUrl>https://github.com/umbraco/Umbraco.Forms.Integrations</RepositoryUrl>
20-
<Version>6.0.0</Version>
20+
<Version>6.0.1</Version>
2121
<Authors>Umbraco HQ</Authors>
2222
<Company>Umbraco</Company>
2323
<PackageTags>Umbraco;Umbraco-Marketplace</PackageTags>
@@ -57,4 +57,14 @@
5757
<Content Include="Views\**" Pack="true" />
5858
<Content Include="wwwroot\**" Pack="true" />
5959
</ItemGroup>
60+
61+
<!-- Build client assets using NPM -->
62+
<Import Project="build\Microsoft.AspNetCore.ClientAssets.targets" />
63+
<PropertyGroup>
64+
<!-- Use this to (temporarily) disable building client assets, e.g. to start the project and generate updated API models -->
65+
<ShouldRunClientAssetsBuild>true</ShouldRunClientAssetsBuild>
66+
</PropertyGroup>
67+
<Target Name="ClientAssetsBuildOutputPath" BeforeTargets="ClientAssetsBuild">
68+
<WriteLinesToFile File="Client\config.outputPath.js" Lines="export const outputPath = '../wwwroot';" Overwrite="true" />
69+
</Target>
6070
</Project>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<Project>
2+
<!--
3+
Copied from: https://github.com/aspnet/AspLabs/blob/main/src/ClientAssets/Microsoft.AspNetCore.ClientAssets/build/netstandard2.0/Microsoft.AspNetCore.ClientAssets.targets
4+
5+
More information:
6+
- https://devblogs.microsoft.com/dotnet/build-client-web-assets-for-your-razor-class-library/
7+
- https://github.com/dotnet/aspnetcore/issues/38445
8+
-->
9+
<PropertyGroup>
10+
<ClientAssetsDirectory Condition="'$(ClientAssetsDirectory)' == ''">Client\</ClientAssetsDirectory>
11+
<ClientAssetsRestoreInputs Condition="'$(ClientAssetsRestoreInputs)' == ''">$(ClientAssetsDirectory)\package-lock.json;$(ClientAssetsDirectory)\package.json</ClientAssetsRestoreInputs>
12+
<ClientAssetsRestoreOutputs Condition="'$(ClientAssetsRestoreOutputs)' == ''">$(ClientAssetsDirectory)node_modules\.package-lock.json</ClientAssetsRestoreOutputs>
13+
<ClientAssetsRestoreCommand Condition="'$(ClientAssetsRestoreCommand)' == ''">npm ci --no-fund --no-audit --prefer-offline</ClientAssetsRestoreCommand>
14+
<ClientAssetsBuildCommand Condition="'$(ClientAssetsBuildCommand)' == ''">npm run build</ClientAssetsBuildCommand>
15+
16+
<!-- Include project file to pick up changes in the above values -->
17+
<ClientAssetsRestoreInputs>$(MSBuildProjectFile);$(ClientAssetsRestoreInputs)</ClientAssetsRestoreInputs>
18+
<!-- Run restore only once for multi targeting builds -->
19+
<ClientAssetsRestoreBeforeTargets Condition="'$(TargetFramework)' == ''">DispatchToInnerBuilds</ClientAssetsRestoreBeforeTargets>
20+
<!-- Allow multitargeting projects to choose the target framework in which they run by setting this value to true only for a given target framework -->
21+
<ShouldRunClientAssetsBuild Condition="'$(ShouldRunClientAssetsBuild)' == ''">true</ShouldRunClientAssetsBuild>
22+
</PropertyGroup>
23+
24+
<ItemGroup>
25+
<ClientAssetsInputs Include="$(ClientAssetsDirectory)**" Exclude="$(DefaultItemExcludes)" />
26+
</ItemGroup>
27+
28+
<Target Name="ClientAssetsRestore" BeforeTargets="$(ClientAssetsRestoreBeforeTargets)" Inputs="$(ClientAssetsRestoreInputs)" Outputs="$(ClientAssetsRestoreOutputs)">
29+
<Message Text="Restoring NPM packages" Importance="high" />
30+
<Exec Command="$(ClientAssetsRestoreCommand)" WorkingDirectory="$(ClientAssetsDirectory)"/>
31+
</Target>
32+
33+
<Target Name="ClientAssetsBuild" Condition="'$(ShouldRunClientAssetsBuild)' == 'true'" DependsOnTargets="ClientAssetsRestore" BeforeTargets="AssignTargetPaths" Inputs="@(ClientAssetsInputs)" Outputs="$(IntermediateOutputPath)clientassetsbuild.complete.txt">
34+
<PropertyGroup>
35+
<_ClientAssetsOutputFullPath>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)clientassets'))</_ClientAssetsOutputFullPath>
36+
</PropertyGroup>
37+
38+
<Message Text="Executing NPM build script" Importance="High" />
39+
40+
<MakeDir Directories="$(_ClientAssetsOutputFullPath)" />
41+
<Exec Command="$(ClientAssetsBuildCommand)" WorkingDirectory="$(ClientAssetsDirectory)" />
42+
43+
<ItemGroup>
44+
<_ClientAssetsBuildOutput Include="$(IntermediateOutputPath)clientassets\**"></_ClientAssetsBuildOutput>
45+
</ItemGroup>
46+
47+
<WriteLinesToFile File="$(IntermediateOutputPath)clientassetsbuild.complete.txt" Lines="@(_ClientAssetsBuildOutput)" />
48+
</Target>
49+
50+
<Target Name="DefineClientAssets" AfterTargets="ClientAssetsBuild" DependsOnTargets="ResolveStaticWebAssetsConfiguration">
51+
<ItemGroup>
52+
<FileWrites Include="@(_ClientAssetsBuildOutput)" />
53+
<FileWrites Include="$(IntermediateOutputPath)clientassetsbuild.complete.txt" />
54+
</ItemGroup>
55+
56+
<DefineStaticWebAssets CandidateAssets="@(_ClientAssetsBuildOutput)" SourceId="$(PackageId)" SourceType="Computed" ContentRoot="$(_ClientAssetsOutputFullPath)" BasePath="$(StaticWebAssetBasePath)">
57+
<Output TaskParameter="Assets" ItemName="StaticWebAsset" />
58+
</DefineStaticWebAssets>
59+
</Target>
60+
61+
</Project>

0 commit comments

Comments
 (0)