Please execute the following steps in the given order.
- Remove all references to
Lombiq.Gulp.Extensions
andLombiq.Npm.Targets
. - Add project and/or package references to
Lombiq.NodeJs.Extensions
. - In case of a project reference, you also need to manually import the .props and .targets files.
<Project Sdk="Microsoft.NET.Sdk.Razor">
+ <Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.props" />
+
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
@@ -41,16 +43,16 @@
<PackageReference Include="OrchardCore.ContentFields" Version="1.4.0" />
</ItemGroup>
- <Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\Utilities\Lombiq.Npm.Targets\Lombiq.Npm.Targets.props" />
- <Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\Utilities\Lombiq.Npm.Targets\Lombiq.Npm.Targets.targets" />
-
<ItemGroup Condition="'$(NuGetBuild)' != 'true'">
<ProjectReference Include="..\..\Libraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries.OrchardCore\Lombiq.HelpfulLibraries.OrchardCore.csproj" />
- <ProjectReference Include="..\..\Utilities\Lombiq.Gulp.Extensions\Lombiq.Gulp.Extensions.csproj" />
- <ProjectReference Include="..\..\Utilities\Lombiq.Npm.Targets\Lombiq.Npm.Targets.csproj" />
+ <ProjectReference Include="..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.HelpfulLibraries.OrchardCore" Version="4.7.0" />
+ <!-- Replace TODO with the latest version number. -->
+ <PackageReference Include="Lombiq.NodeJs.Extensions" Version="TODO" />
</ItemGroup>
+ <Import Condition="'$(NuGetBuild)' != 'true'" Project="..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions.targets" />
+
</Project>
Refer to the documentation on how to configure each part.
Asset copying needs to be manually configurated - there are no magic assets directories in Node.js Extensions anymore.
For an example of such a migration, take a look at the pull request that contained the migration of our Lombiq Data Tables for Orchard Core project to Node.js Extensions, especially the following files:
This includes removing any .placeholder file that might exist there.
Also ensure that wwwroot is added to the project's .gitignore file. In the standard scenario, no files under wwwroot should be committed to the repository.
This could be a directory of task scripts, for example.
Any project using Node.js Extensions will be using PNPM for package management. In order for PNPM to properly handle packages, it is necessary to clear or delete any affected project's node_modules directory.
One way to achieve the above would be to execute the following PowerShell script:
Get-ChildItem -Filter node_modules -Recurse | Remove-Item -Force -Recurse
With the switch from NPM to PNPM, any package-lock.json can be removed from your source repository. Instead, add pnpm-lock.yaml, PNPM's own lockfile, to it.