Skip to content

Commit 14a966e

Browse files
committed
Upgrade to .NET 5.0
1 parent c545e81 commit 14a966e

16 files changed

Lines changed: 27 additions & 17 deletions

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
22
WORKDIR /app
33

44
# copy csproj and restore as distinct layers
@@ -10,7 +10,7 @@ COPY src/. ./
1010
WORKDIR /app
1111
RUN dotnet publish -c Release -o out
1212

13-
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS runtime
13+
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime
1414
WORKDIR /app
1515
COPY --from=build /app/out ./
1616
ENV ASPNETCORE_URLS http://*:5000

src/GitHubMarkdownFilters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static async Task<Stream> convertScriptToLispBlocks(Stream renderedHtmlMa
5959
return MemoryStreamFactory.GetStream(html.ToUtf8Bytes());
6060
}
6161

62-
const bool ReplaceUserContent = true;
62+
static bool ReplaceUserContent = true;
6363

6464
public async Task githubMarkdown(ScriptScopeContext scope, string markdownPath)
6565
{

src/ScriptServices.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public async Task<string> Any(EvaluateScript request)
7070
DebugMode = false,
7171
ScriptLanguages = { ScriptLisp.Language },
7272
ScriptMethods = {
73-
new DbScripts(),
73+
new DbScriptsAsync(),
7474
new AutoQueryScripts(),
7575
new ServiceStackScripts(),
7676
new CustomScriptMethods(),

src/SharpScript.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5</TargetFramework>
55
<AssemblyName>SharpScript</AssemblyName>
66
<PackageId>SharpScript</PackageId>
77
</PropertyGroup>

src/wwwroot/docs/installation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h2 id="starter-projects">Starter Project Templates</h2>
6969
<h4>.NET Core #Script Pages Project</h4>
7070

7171
<p>
72-
Create a new <a href="https://github.com/NetCoreTemplates/templates">#Script Pages Website</a> .NET Core 3.1 App with
72+
Create a new <a href="https://github.com/NetCoreTemplates/templates">#Script Pages Website</a> .NET 5.0 App with
7373
<a href="https://docs.servicestack.net/web-new">x new</a>:
7474
</p>
7575

src/wwwroot/docs/script-pages.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ <h4 id="runs-everywhere">Runs Everywhere</h4>
108108
<h4>.NET Core #Script Pages Project</h4>
109109

110110
<p>
111-
Create a new <a href="https://github.com/NetCoreTemplates/templates">#Script Pages Website</a> .NET Core 3.1 App with
111+
Create a new <a href="https://github.com/NetCoreTemplates/templates">#Script Pages Website</a> .NET 5.0 App with
112112
<a href="https://docs.servicestack.net/web-new">x new</a>:
113113
</p>
114114

src/wwwroot/gfm/apps/02.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ <h3>
514514
<span class="pl-kos">]</span> |<span class="pl-c1">&gt;</span> <span class="pl-s1">map</span> <span class="pl-c1">=&gt;</span> <span class="pl-s">`&lt;script src="<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">it</span><span class="pl-kos">}</span></span>"&gt;&lt;/script&gt;`</span> |<span class="pl-c1">&gt;</span> <span class="pl-s1">joinln</span> |<span class="pl-c1">&gt;</span> <span class="pl-s1">raw</span> <span class="pl-kos">}</span><span class="pl-kos">}</span></pre></div>
515515
<p>But instead of needing to exist on disk &amp; deployed with your project it's referencing the embedded resources in <code>ServiceStack.Desktop.dll</code> and only the bundled assets need to be <a href="https://github.com/NetCoreApps/SharpData/blob/0499e7c66ca4289d17158e79bcc91815bbcd7a99/SharpData.csproj#L17">deployed with your project</a> which is using the built-in <a href="https://github.com/xoofx/NUglify">NUglify</a> support in the <a href="https://docs.servicestack.net/dotnet-tool" rel="nofollow">dotnet tools</a> to produce its highly optimized/minified bundle without needing to rely on any npm tooling when publishing the .NET Core App:</p>
516516
<div class="highlight highlight-text-xml"><pre>&lt;<span class="pl-ent">Target</span> <span class="pl-e">Name</span>=<span class="pl-s"><span class="pl-pds">"</span>Bundle<span class="pl-pds">"</span></span> <span class="pl-e">BeforeTargets</span>=<span class="pl-s"><span class="pl-pds">"</span>AfterPublish<span class="pl-pds">"</span></span>&gt;
517-
&lt;<span class="pl-ent">Exec</span> <span class="pl-e">Command</span>=<span class="pl-s"><span class="pl-pds">"</span>x run _bundle.ss -to /bin/Release/netcoreapp3.1/publish/wwwroot<span class="pl-pds">"</span></span> /&gt;
517+
&lt;<span class="pl-ent">Exec</span> <span class="pl-e">Command</span>=<span class="pl-s"><span class="pl-pds">"</span>x run _bundle.ss -to /bin/Release/net5/publish/wwwroot<span class="pl-pds">"</span></span> /&gt;
518518
&lt;/<span class="pl-ent">Target</span>&gt;</pre></div>
519519
<p>The included <a href="https://github.com/NetCoreApps/SharpData/tree/master/typings">/typings</a> are just the TypeScript definitions for each library which
520520
TypeScript uses for its static analysis &amp; its great dev UX in IDEs &amp; VSCode, but are only needed during development and not deployed with the project.</p>

src/wwwroot/gfm/apps/02.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ But instead of needing to exist on disk & deployed with your project it's refere
576576

577577
```xml
578578
<Target Name="Bundle" BeforeTargets="AfterPublish">
579-
<Exec Command="x run _bundle.ss -to /bin/Release/netcoreapp3.1/publish/wwwroot" />
579+
<Exec Command="x run _bundle.ss -to /bin/Release/net5/publish/wwwroot" />
580580
</Target>
581581
```
582582

src/wwwroot/gfm/sharp-apps/13.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@ <h3>
9191
<pre><code>$ npm run build
9292
</code></pre>
9393
<p>Which will bundle and minify all <code>.css</code>, <code>.js</code> and <code>.html</code> assets and publish to <code>/app/wwwroot</code>.</p>
94-
<p>Then to deploy Sharp Apps you just need to copy the <code>/app</code> and <code>/web</code> folders to any server with .NET Core 3.1 runtime installed.
94+
<p>Then to deploy Sharp Apps you just need to copy the <code>/app</code> and <code>/web</code> folders to any server with .NET 5.0 runtime installed.
9595
The <a href="http://sharpscript.net/docs/deploying-sharp-apps" rel="nofollow">Deploying Sharp Apps</a> docs.</p>
9696
</div>

src/wwwroot/gfm/sharp-apps/13.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,5 @@ During development Parcel maintains a debug and source-code friendly version of
116116

117117
Which will bundle and minify all `.css`, `.js` and `.html` assets and publish to `/app/wwwroot`.
118118

119-
Then to deploy Sharp Apps you just need to copy the `/app` and `/web` folders to any server with .NET Core 3.1 runtime installed.
119+
Then to deploy Sharp Apps you just need to copy the `/app` and `/web` folders to any server with .NET 5.0 runtime installed.
120120
The [Deploying Sharp Apps](http://sharpscript.net/docs/deploying-sharp-apps) docs.

0 commit comments

Comments
 (0)