Creating TypeScript Client npm module during build
This commit is contained in:
parent
24ce511044
commit
96aac19044
|
|
@ -3,4 +3,7 @@
|
|||
<ExcludeFromTest Include="$(RepositoryRoot)test\Microsoft.AspNetCore.SignalR.Test.Server\*.csproj" />
|
||||
<ExcludeFromTest Include="$(RepositoryRoot)test\WebSocketsTestApp\*.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectsToPack Include="$(RepositoryRoot)client-ts\Microsoft.AspNetCore.SignalR.Client.TS\*.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<Project>
|
||||
<Target Name="RestoreNpm" AfterTargets="Restore" Condition="'$(PreflightRestore)' != 'True'">
|
||||
<Message Text="Restoring NPM modules" Importance="high" />
|
||||
<Exec Command="npm install" WorkingDirectory="$(RepositoryRoot)/client-ts" />
|
||||
<Exec Command="npm install" WorkingDirectory="$(RepositoryRoot)client-ts" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RunTSClientNodeTests" AfterTargets="Test">
|
||||
<Message Text="Running TypeScript client Node tests" Importance="high" />
|
||||
<Exec Command="npm test" WorkingDirectory="$(RepositoryRoot)/client-ts" />
|
||||
<Exec Command="npm test" WorkingDirectory="$(RepositoryRoot)client-ts" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project>
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
@ -29,4 +30,25 @@
|
|||
<Target Name="CleanTSClient" AfterTargets="Clean">
|
||||
<RemoveDir Directories="$(SignalRClientDistFolder)" />
|
||||
</Target>
|
||||
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
|
||||
|
||||
<Target Name="Pack">
|
||||
<Message Text="Creating TypeScript client Node module" Importance="High" />
|
||||
<Exec Command="node -pe "require('./package.json').version"" ConsoleToMSBuild="true" WorkingDirectory="$(MSBuildThisFileDirectory)..">
|
||||
<Output TaskParameter="ConsoleOutput" ItemName="ExecOutput" />
|
||||
</Exec>
|
||||
<PropertyGroup>
|
||||
<ModuleVersion>@(ExecOutput)</ModuleVersion>
|
||||
<ModuleVersion Condition="'$(VersionSuffix)' != ''">$(ModuleVersion)-$(VersionSuffix)</ModuleVersion>
|
||||
</PropertyGroup>
|
||||
<Exec Command="npm version $(ModuleVersion)" WorkingDirectory="$(MSBuildThisFileDirectory).." Condition="'$(VersionSuffix)' != ''" />
|
||||
<Exec Command="npm pack" WorkingDirectory="$(MSBuildThisFileDirectory).." />
|
||||
<Exec Command="git checkout HEAD -- $(MSBuildThisFileDirectory)../package.json" Condition="'$(VersionSuffix)' != ''" />
|
||||
|
||||
<ItemGroup>
|
||||
<TSClient Include="$(MSBuildThisFileDirectory)../signalr-client*.tgz" />
|
||||
</ItemGroup>
|
||||
<Move SourceFiles="@(TSClient)" DestinationFolder="$(PackageOutputPath)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "signalr-client",
|
||||
"version": "0.1.0-alpha",
|
||||
"version": "0.1.0",
|
||||
"description": "ASP.NET Core SignalR",
|
||||
"main": "dist/src/index.js",
|
||||
"typings": "dist/src/index.d.ts",
|
||||
|
|
|
|||
Loading…
Reference in New Issue