Skip to content

Commit 7f5f2d3

Browse files
authored
Build client and js api (#234)
* first pass adding projects and files * work in progress * update git ignore * run npm tests when appropriate * remove project * gather npm test results * remove npmrc * rename folders * fix vulnerability * trxfile name changed * update packages * fix catch block in build script * change package name * fix har validator * fixed version for har * node as latest lts * add css dts * fix test script for node tests * lock file * set default startup options * clean obj before bulid * clean obj utility * clean before build * moca opt missing * align node version * peer dependencies * revert change * skip npm install at test execution time * removed awesome type loader * add release to trx file path * remove unused plugin * test results from node runs * install mocha peer dependendy * remove unused packages * experiment grabbing the output of npm i * experiment * experiment with start process * add write elements * fix write-host invocation * fix npm test runner * updated ncrunch settings
1 parent 98c5b5d commit 7f5f2d3

File tree

346 files changed

+44792
-5455
lines changed

Some content is hidden

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

346 files changed

+44792
-5455
lines changed

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,18 @@ healthchecksdb
348348

349349
# Backup folder for Package Reference Convert tool in Visual Studio 2017
350350
MigrationBackup/
351+
352+
wwwroot/api/
353+
354+
wwwroot/client/
355+
356+
MLS\.Agent/wwwroot/api/
357+
358+
MLS\.Agent/wwwroot/client/
359+
360+
*.trx
361+
362+
363+
Microsoft\.DotNet\.Try\.js/\.rpt2_cache/
364+
365+
Microsoft\.DotNet\.Try\.js/dist/

.vscode/launch.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (web)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/MLS.Agent/bin/Debug/netcoreapp2.1/MLS.Agent.dll",
14+
"args": [],
15+
"cwd": "${workspaceFolder}/MLS.Agent",
16+
"stopAtEntry": false,
17+
"launchBrowser": {
18+
"enabled": true
19+
},
20+
"env": {
21+
"ASPNETCORE_ENVIRONMENT": "Development"
22+
},
23+
"sourceFileMap": {
24+
"/Views": "${workspaceFolder}/Views"
25+
}
26+
},
27+
{
28+
"name": ".NET Core Attach",
29+
"type": "coreclr",
30+
"request": "attach",
31+
"processId": "${command:pickProcess}"
32+
}
33+
]
34+
}

.vscode/tasks.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/MLS.Agent/MLS.Agent.csproj"
11+
],
12+
"problemMatcher": "$tsc"
13+
},
14+
{
15+
"label": "publish",
16+
"command": "dotnet",
17+
"type": "process",
18+
"args": [
19+
"publish",
20+
"${workspaceFolder}/MLS.Agent/MLS.Agent.csproj"
21+
],
22+
"problemMatcher": "$tsc"
23+
},
24+
{
25+
"label": "watch",
26+
"command": "dotnet",
27+
"type": "process",
28+
"args": [
29+
"watch",
30+
"run",
31+
"${workspaceFolder}/MLS.Agent/MLS.Agent.csproj"
32+
],
33+
"problemMatcher": "$tsc"
34+
}
35+
]
36+
}

MLS.Agent/MLS.Agent.csproj

+66-4
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,18 @@
126126
</EmbeddedResource>
127127
</ItemGroup>
128128

129-
<Target Name="BuildCss" Inputs="$(MSBuildThisFileDirectory)..\MLS.Styles\sass\trydotnet.scss" Outputs="$(MSBuildThisFileDirectory)wwwroot\css\trydotnet.css" BeforeTargets="BeforeBuild">
129+
<Target Name="BuildCss"
130+
Inputs="$(MSBuildThisFileDirectory)..\Microsoft.DotNet.Try.Styles\sass\trydotnet.scss"
131+
Outputs="$(MSBuildThisFileDirectory)wwwroot\css\trydotnet.css"
132+
BeforeTargets="BeforeBuild">
130133

131134
<PropertyGroup>
132135
<_TryDotNetCssExists Condition="Exists('$(MSBuildThisFileDirectory)wwwroot\css\trydotnet.css')">true</_TryDotNetCssExists>
133136
</PropertyGroup>
134137

135-
<Exec Command="npm rebuild node-sass" WorkingDirectory="$(MSBuildThisFileDirectory)..\MLS.Styles" />
136-
<Exec Command="npm i" WorkingDirectory="$(MSBuildThisFileDirectory)..\MLS.Styles" />
137-
<Exec Command="npm run release -- $(MSBuildThisFileDirectory)wwwroot/css/trydotnet.css" WorkingDirectory="$(MSBuildThisFileDirectory)..\MLS.Styles" />
138+
<Exec Command="npm rebuild node-sass" WorkingDirectory="$(MSBuildThisFileDirectory)..\Microsoft.DotNet.Try.Styles" />
139+
<Exec Command="npm i" WorkingDirectory="$(MSBuildThisFileDirectory)..\Microsoft.DotNet.Try.Styles" />
140+
<Exec Command="npm run release -- $(MSBuildThisFileDirectory)wwwroot/css/trydotnet.css" WorkingDirectory="$(MSBuildThisFileDirectory)..\Microsoft.DotNet.Try.Styles" />
138141

139142
<ItemGroup>
140143
<FileWrites Include="$(MSBuildThisFileDirectory)wwwroot\css\trydotnet.css" />
@@ -144,6 +147,65 @@
144147
</ItemGroup>
145148
</Target>
146149

150+
<Target Name="GatherInputs">
151+
<PropertyGroup>
152+
<ClientInputDir>$(MSBuildThisFileDirectory)..\Microsoft.DotNet.Try.Client</ClientInputDir>
153+
<ClientOutputDir>$(MSBuildThisFileDirectory)wwwroot/client</ClientOutputDir>
154+
<ClientOutputFile>$(ClientOutputDir)/bundle.js</ClientOutputFile><!-- TODO: fix this? -->
155+
<TryDotNetJsInputDir>$(MSBuildThisFileDirectory)..\Microsoft.DotNet.Try.js</TryDotNetJsInputDir>
156+
<TryDotNetJsOutputDir>$(MSBuildThisFileDirectory)wwwroot/api</TryDotNetJsOutputDir>
157+
<TryDotNetJsFile>$(TryDotNetJsOutputDir)/trydotnet.min.js</TryDotNetJsFile>
158+
<TryDotNetJsMap>$(TryDotNetJsOutputDir)/trydotnet.min.js.map</TryDotNetJsMap>
159+
</PropertyGroup>
160+
<ItemGroup>
161+
<ClientInputFiles Include="$(ClientInputDir)\**" />
162+
<TryDotNetJsInput Include="$(TryDotNetJsInputDir)\**" />
163+
</ItemGroup>
164+
</Target>
165+
166+
<Target Name="BuildTryDotNetJs"
167+
Inputs="@(TryDotNetJsInput)"
168+
Outputs="$(TryDotNetJsFile);$(TryDotNetJsMap)"
169+
DependsOnTargets="GatherInputs"
170+
BeforeTargets="BeforeBuild">
171+
<PropertyGroup>
172+
<_TryDotNetMinJsExists Condition="Exists('$(TryDotNetJsFile)')">true</_TryDotNetMinJsExists>
173+
</PropertyGroup>
174+
175+
<Exec Command="npm i" WorkingDirectory="$(TryDotNetJsInputDir)" />
176+
<MakeDir Directories="$(TryDotNetJsOutputDir)" />
177+
<Exec Command="npm run build" WorkingDirectory="$(TryDotNetJsInputDir)" />
178+
<Exec Command="npm run ciMinify -- --output $(TryDotNetJsFile)" WorkingDirectory="$(TryDotNetJsInputDir)" />
179+
180+
<ItemGroup>
181+
<FileWrites Include="$(TryDotNetJsFile);$(TryDotNetJsMap)" />
182+
183+
<!-- if the file already existed then it'll already be in the @(Content) item group -->
184+
<Content Include="$(TryDotNetJsFile);$(TryDotNetJsMap)" Condition="'$(_TryDotNetMinJsExists)' != 'true'" />
185+
</ItemGroup>
186+
</Target>
187+
188+
<Target Name="BuildClient"
189+
Inputs="@(ClientInputFiles)"
190+
Outputs="$(ClientOutputFile)"
191+
DependsOnTargets="GatherInputs"
192+
BeforeTargets="BeforeBuild">
193+
194+
<PropertyGroup>
195+
<_TryDotNetClientExists Condition="Exists('$(ClientOutputFile)')">true</_TryDotNetClientExists>
196+
</PropertyGroup>
197+
198+
<Exec Command="npm i" WorkingDirectory="$(ClientInputDir)" />
199+
<Exec Command="npm run buildCi -- --output-path $(ClientOutputDir)" WorkingDirectory="$(ClientInputDir)" />
200+
201+
<ItemGroup>
202+
<FileWrites Include="$(ClientOutputDir)\**" />
203+
204+
<!-- if the file already existed then it'll already be in the @(Content) item group -->
205+
<Content Include="$(ClientOutputDir)\**" Condition="'$(_TryDotNetClientExists)' != 'true'" />
206+
</ItemGroup>
207+
</Target>
208+
147209
<Target Name="CopyDemoFiles">
148210
<ItemGroup>
149211
<DemoFiles Include="$(MSBuildProjectDirectory)/../docs/GettingStarted/**/*.cs;$(MSBuildProjectDirectory)/../docs/GettingStarted/**/*.md;$(MSBuildProjectDirectory)/../docs/GettingStarted/**/*.csproj;$(MSBuildProjectDirectory)/../docs/GettingStarted/**/*.config" Exclude="**/bin/**; **/obj/**" SkipUnchangedFiles="true" />

MLS.Agent/MLS.Agent.v3.ncrunchproject

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<Settings>
33
<AdditionalFilesToIncludeForProject>
44
<Value>..\docs\**.*</Value>
5-
<Value>..\MLS.Styles\**.*</Value>
5+
<Value>..\Microsoft.DotNet.Try.Client\**.*</Value>
6+
<Value>..\Microsoft.DotNet.Try.js\**.*</Value>
7+
<Value>..\Microsoft.DotNet.Try.Styles\**.*</Value>
68
</AdditionalFilesToIncludeForProject>
79
</Settings>
810
</ProjectConfiguration>

MLS.Agent/wwwroot/api/trydotnet.min.js

-1
This file was deleted.

MLS.Agent/wwwroot/api/trydotnet.min.js.map

-1
This file was deleted.

MLS.Agent/wwwroot/client/0.bundle.js

-2
This file was deleted.

MLS.Agent/wwwroot/client/10.bundle.js

-2
This file was deleted.

0 commit comments

Comments
 (0)