Skip to content

Commit 5568436

Browse files
authored
WIP - Re-sync with JavaScriptServices (TrilonIO#376)
* WIP - Re-sync with JavaScriptServices Main goal is to re-align a bit more with JavaScriptServices to ensure people coming from there, wanting to add additional features, have an easier time syncing with this repo. Adds back vendor builds, Adds back fast HMR (but waiting for aspnet/JavaScriptServices#1204) AoT faster Cleans up multiple tsconfigs etc etc... * fix gitignore * fix HMR, VS builds, misc updates * add package-lock to gitignore closes TrilonIO#307 closes TrilonIO#318 closes TrilonIO#296 closes TrilonIO#294 closes TrilonIO#271 closes TrilonIO#267 closes TrilonIO#230 closes TrilonIO#161
1 parent fe9ab9c commit 5568436

File tree

68 files changed

+341
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+341
-210
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Obj/
3535
.vs/
3636

3737
/wwwroot/dist/
38-
/Client/dist/
38+
/ClientApp/dist/
3939

4040
# MSTest test Results
4141
[Tt]est[Rr]esult*/
@@ -187,6 +187,7 @@ BundleArtifacts/
187187
!*.[Cc]ache/
188188

189189
# Others
190+
*.db
190191
ClientBin/
191192
~$*
192193
*~
@@ -259,3 +260,6 @@ _Pvt_Extensions
259260

260261
# Jest Code Coverage report
261262
coverage/
263+
264+
.DS_Store
265+
package-lock.json

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"type": "coreclr",
2121
"request": "launch",
2222
"preLaunchTask": "build",
23-
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/Asp2017.dll",
23+
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.0/Asp2017.dll",
2424
"args": [],
2525
"cwd": "${workspaceRoot}",
2626
"stopAtEntry": false,
@@ -51,7 +51,7 @@
5151
"type": "coreclr",
5252
"request": "launch",
5353
"preLaunchTask": "build",
54-
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/Asp2017.dll",
54+
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.0/Asp2017.dll",
5555
"args": [],
5656
"cwd": "${workspaceRoot}",
5757
"stopAtEntry": false,
@@ -82,7 +82,7 @@
8282
"type": "coreclr",
8383
"request": "launch",
8484
"preLaunchTask": "build",
85-
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/Asp2017.dll",
85+
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.0/Asp2017.dll",
8686
"args": [],
8787
"cwd": "${workspaceRoot}",
8888
"stopAtEntry": false,

Asp2017.csproj

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,68 @@
11
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
2+
23
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">netcoreapp2.0</TargetFramework>
5+
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>
46
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
7+
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
58
<IsPackable>false</IsPackable>
69
</PropertyGroup>
7-
<ItemGroup>
8-
<!-- New Meta Package has SpaServices in It -->
10+
11+
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
912
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
13+
</ItemGroup>
14+
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
15+
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
16+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
17+
<PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="2.0.0" />
18+
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0" />
19+
</ItemGroup>
20+
<ItemGroup>
1021
<PackageReference Include="NETStandard.Library" Version="2.0.0" />
1122
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0" />
1223
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.0" />
1324
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
1425
</ItemGroup>
15-
<ItemGroup>
16-
<!-- Files not to show in IDE -->
17-
<None Remove="yarn.lock" />
18-
<Content Remove="wwwroot\dist\**" />
19-
<None Remove="Client\dist\**" />
20-
<Content Remove="coverage\**" />
2126

22-
<!-- Files not to publish (note that the 'dist' subfolders are re-added below) -->
23-
<Content Remove="Client\**" />
27+
<ItemGroup>
28+
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
2429
</ItemGroup>
30+
2531
<ItemGroup>
26-
<Content Include="Client\tsconfig.browser.json" />
27-
<Content Include="Client\tsconfig.server.aot.json" />
28-
<Content Include="Client\tsconfig.server.json" />
32+
<!-- Files not to publish (note that the 'dist' subfolders are re-added below) -->
33+
<Content Remove="ClientApp\**" />
2934
</ItemGroup>
30-
<Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish">
35+
36+
<!--/-:cnd:noEmit -->
37+
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
38+
<!-- Ensure Node.js is installed -->
39+
<Exec Command="node --version" ContinueOnError="true">
40+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
41+
</Exec>
42+
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
43+
44+
<!-- In development, the dist files won't exist on the first run or when cloning to
45+
a different machine, so rebuild them if not already present. -->
46+
<Message Importance="high" Text="Performing first-run Webpack build..." />
47+
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js" />
48+
<Exec Command="node node_modules/webpack/bin/webpack.js" />
49+
</Target>
50+
<!--/+:cnd:noEmit -->
51+
52+
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
3153
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
3254
<Exec Command="npm install" />
33-
<Exec Command="node node_modules/webpack/bin/webpack.js --env.aot --env.client" />
34-
<Exec Command="node node_modules/webpack/bin/webpack.js --env.aot --env.server" />
55+
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
56+
<Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />
57+
3558
<!-- Include the newly-built files in the publish output -->
3659
<ItemGroup>
37-
<DistFiles Include="wwwroot\dist\**; Client\dist\**" />
60+
<DistFiles Include="wwwroot\dist\**; ClientApp\dist\**" />
3861
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
3962
<RelativePath>%(DistFiles.Identity)</RelativePath>
4063
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
4164
</ResolvedFileToPublish>
4265
</ItemGroup>
4366
</Target>
44-
<Target Name="CleanDist" AfterTargets="Clean">
45-
<ItemGroup>
46-
<FilesToDelete Include="Client\dist\**; wwwroot\dist\**" />
47-
</ItemGroup>
48-
<Delete Files="@(FilesToDelete)" />
49-
<RemoveDir Directories="Client\dist; wwwroot\dist" />
50-
</Target>
67+
5168
</Project>

Client/main.server.aot.ts

Lines changed: 0 additions & 41 deletions
This file was deleted.

Client/tsconfig.browser.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

Client/tsconfig.server.aot.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

Client/tsconfig.server.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

Client/app/app.component.html renamed to ClientApp/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
</div>
44
<div class="col-sm-9 body-content">
55
<router-outlet></router-outlet>
6-
</div>
6+
</div>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)