Skip to content

Commit f34ca0b

Browse files
committed
Package release updates
1 parent ea85add commit f34ca0b

File tree

4 files changed

+118
-41
lines changed

4 files changed

+118
-41
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const outputPath = 'Release' !== 'Release' ? '../wwwroot' : '../obj/Release/net8.0/clientassets'

src/Umbraco.Cms.Integrations.Commerce.Shopify/Client/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { defineConfig } from "vite";
22
import tsconfigPaths from "vite-tsconfig-paths";
3+
import { outputPath } from "./config.outputPath.js";
34

45
export default defineConfig({
56
build: {
67
lib: {
78
entry: "src/index.ts",
89
formats: ["es"],
910
},
10-
outDir: "../wwwroot/App_Plugins/Shopify",
11+
outDir: outputPath,
1112
emptyOutDir: true,
1213
sourcemap: true,
1314
rollupOptions: {
Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,58 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
8-
<StaticWebAssetBasePath>/</StaticWebAssetBasePath>
9-
</PropertyGroup>
10-
11-
<PropertyGroup>
12-
<PackageId>Umbraco.Cms.Integrations.Commerce.Shopify</PackageId>
13-
<Title>Umbraco CMS Integrations: Commerce - Shopify</Title>
14-
<Description>Core package for Umbraco CMS integration with Shopify.</Description>
15-
<PackageIconUrl></PackageIconUrl>
16-
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Cms.Integrations/tree/main-v14/src/Umbraco.Cms.Integrations.Commerce.Shopify</PackageProjectUrl>
17-
<RepositoryUrl>https://github.com/umbraco/Umbraco.Cms.Integrations</RepositoryUrl>
18-
<Version>2.0.0</Version>
19-
<Authors>Umbraco HQ</Authors>
20-
<Company>Umbraco</Company>
21-
</PropertyGroup>
22-
23-
<ItemGroup>
24-
<PackageReference Include="Umbraco.Cms.Api.Common" Version="[14.0.0, 15)" />
25-
<PackageReference Include="Umbraco.Cms.Api.Management" Version="[14.0.0, 15)" />
26-
<PackageReference Include="Umbraco.Cms.Web.Common" Version="[14.0.0, 15)" />
27-
</ItemGroup>
28-
29-
<ItemGroup>
30-
<Content Include="shopify.png">
31-
<Pack>true</Pack>
32-
<PackagePath>\</PackagePath>
33-
</Content>
34-
</ItemGroup>
35-
36-
<ItemGroup>
37-
<None Include="docs\readme.md" Pack="true" PackagePath="\" />
38-
</ItemGroup>
39-
40-
<ItemGroup>
41-
<Folder Include="wwwroot\" />
42-
</ItemGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
8+
<EnableDefaultContentItems>false</EnableDefaultContentItems>
9+
<StaticWebAssetBasePath>/App_Plugins/Shopify</StaticWebAssetBasePath>
10+
</PropertyGroup>
11+
12+
<PropertyGroup>
13+
<PackageId>Umbraco.Cms.Integrations.Commerce.Shopify</PackageId>
14+
<Title>Umbraco CMS Integrations: Commerce - Shopify</Title>
15+
<Description>An extension for Umbraco CMS providing a products picker and rendering component for Shopify.</Description>
16+
<PackageIconUrl></PackageIconUrl>
17+
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Cms.Integrations/tree/main-v14/src/Umbraco.Cms.Integrations.Commerce.Shopify</PackageProjectUrl>
18+
<RepositoryUrl>https://github.com/umbraco/Umbraco.Cms.Integrations</RepositoryUrl>
19+
<Version>2.0.0</Version>
20+
<Authors>Umbraco HQ</Authors>
21+
<Company>Umbraco</Company>
22+
<PackageIcon>shopify.png</PackageIcon>
23+
<PackageReadmeFile>readme.md</PackageReadmeFile>
24+
</PropertyGroup>
25+
26+
<ItemGroup>
27+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
28+
<SupportedPlatform Include="browser" />
29+
</ItemGroup>
30+
31+
<ItemGroup>
32+
<PackageReference Include="Umbraco.Cms.Api.Common" Version="[14.0.0, 15)" />
33+
<PackageReference Include="Umbraco.Cms.Api.Management" Version="[14.0.0, 15)" />
34+
<PackageReference Include="Umbraco.Cms.Web.Common" Version="[14.0.0, 15)" />
35+
</ItemGroup>
36+
37+
<ItemGroup>
38+
<Content Include="shopify.png">
39+
<Pack>true</Pack>
40+
<PackagePath>\</PackagePath>
41+
</Content>
42+
</ItemGroup>
43+
44+
<ItemGroup>
45+
<None Include="docs\readme.md" Pack="true" PackagePath="\" />
46+
</ItemGroup>
47+
48+
<!-- Build client assets using NPM -->
49+
<Import Project="build\Microsoft.AspNetCore.ClientAssets.targets" />
50+
<PropertyGroup>
51+
<!-- Use this to (temporarily) disable building client assets, e.g. to start the project and generate updated API models -->
52+
<ShouldRunClientAssetsBuild>true</ShouldRunClientAssetsBuild>
53+
</PropertyGroup>
54+
<Target Name="ClientAssetsBuildOutputPath" BeforeTargets="ClientAssetsBuild">
55+
<WriteLinesToFile File="Client\config.outputPath.js" Lines="export const outputPath = '$(Configuration)' !== 'Release' ? '../wwwroot' : '../$(IntermediateOutputPath.Replace('\', '/'))clientassets';" Overwrite="true" />
56+
</Target>
4357

4458
</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)