Skip to content

Commit

Permalink
Upgrade to latest Svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed May 27, 2021
1 parent 100cab4 commit ac7a7bd
Show file tree
Hide file tree
Showing 57 changed files with 2,672 additions and 11,636 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/node_modules
*/npm-debug.log
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
echo TESTS FAILED
exit 1
fi
working-directory: ./SvelteSpaTemplate.Tests
working-directory: ./SvelteSpa.Tests

6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
LETSENCRYPT_EMAIL: ${{ env.letsencrypt_email }}
with:
input: deploy/docker-compose-template.yml
output: deploy/SvelteSpaTemplate-docker-compose.yml
output: deploy/SvelteSpa-docker-compose.yml

- name: copy compose file via scp
uses: appleboy/[email protected]
Expand All @@ -58,7 +58,7 @@ jobs:
username: ${{ secrets.DEPLOY_USERNAME }}
port: ${{ secrets.DEPLOY_PORT }}
key: ${{ secrets.DEPLOY_KEY }}
source: "deploy/SvelteSpaTemplate-docker-compose.yml"
source: "deploy/SvelteSpa-docker-compose.yml"
target: "~/"

- name: Set the value
Expand All @@ -79,4 +79,4 @@ jobs:
envs: APPTOKEN,USERNAME
script: |
echo $APPTOKEN | docker login ghcr.io -u $USERNAME --password-stdin
docker-compose -f ~/deploy/SvelteSpaTemplate-docker-compose.yml up -d
docker-compose -f ~/deploy/SvelteSpa-docker-compose.yml up -d
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/SvelteSpaTemplate/bin/Debug/net5/SvelteSpaTemplate.dll",
"program": "${workspaceFolder}/SvelteSpa/bin/Debug/net5/SvelteSpa.dll",
"args": [],
"cwd": "${workspaceFolder}/SvelteSpaTemplate",
"cwd": "${workspaceFolder}/SvelteSpa",
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
Expand All @@ -25,9 +25,9 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/SvelteSpaTemplate/bin/Debug/net5/SvelteSpaTemplate.dll",
"program": "${workspaceFolder}/SvelteSpa/bin/Debug/net5/SvelteSpa.dll",
"args": [],
"cwd": "${workspaceFolder}/SvelteSpaTemplate",
"cwd": "${workspaceFolder}/SvelteSpa",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"launchBrowser": {
Expand Down
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /source
WORKDIR /app

RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& echo "node version: $(node --version)" \
&& echo "npm version: $(npm --version)" \
&& rm -rf /var/lib/apt/lists/*

COPY SvelteSpaTemplate/package.json .
COPY SvelteSpaTemplate/npm-shrinkwrap.json .

RUN npm --prefix SvelteSpaTemplate install

COPY . .
RUN dotnet restore

WORKDIR /source/SvelteSpaTemplate
RUN dotnet publish -c release -o /app --no-restore
WORKDIR /app/SvelteSpa
RUN dotnet publish -c release -o /out --no-restore

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime
WORKDIR /app
COPY --from=build /app ./
ENTRYPOINT ["dotnet", "SvelteSpaTemplate.dll"]
COPY --from=build /out ./
ENTRYPOINT ["dotnet", "SvelteSpa.dll"]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

$ x new svelte-spa ProjectName

Alternatively write new project files directly into an empty repository, using the Directory Name as the ProjectName:

$ git clone https://github.com/<User>/<ProjectName>.git
$ cd <ProjectName>
$ x new svelte-spa

## Development workflow

[![](https://raw.githubusercontent.com/ServiceStack/Assets/master/img/screencasts/svelte-spa-youtube.png)](https://youtu.be/cKlFABFECnQ)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using ServiceStack;
using SvelteSpaTemplate.ServiceModel;
using SvelteSpa.ServiceModel;

namespace SvelteSpaTemplate.ServiceInterface
namespace SvelteSpa.ServiceInterface
{
public class MyServices : Service
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SvelteSpaTemplate.ServiceModel\SvelteSpaTemplate.ServiceModel.csproj" />
<ProjectReference Include="..\SvelteSpa.ServiceModel\SvelteSpa.ServiceModel.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using ServiceStack;

namespace SvelteSpaTemplate.ServiceModel
namespace SvelteSpa.ServiceModel
{
[Route("/hello")]
[Route("/hello/{Name}")]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Funq;
using ServiceStack;
using NUnit.Framework;
using SvelteSpaTemplate.ServiceInterface;
using SvelteSpaTemplate.ServiceModel;
using SvelteSpa.ServiceInterface;
using SvelteSpa.ServiceModel;

namespace SvelteSpaTemplate.Tests
namespace SvelteSpa.Tests
{
public class IntegrationTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\SvelteSpaTemplate.ServiceInterface\SvelteSpaTemplate.ServiceInterface.csproj" />
<ProjectReference Include="..\SvelteSpaTemplate.ServiceModel\SvelteSpaTemplate.ServiceModel.csproj" />
<ProjectReference Include="..\SvelteSpa.ServiceInterface\SvelteSpa.ServiceInterface.csproj" />
<ProjectReference Include="..\SvelteSpa.ServiceModel\SvelteSpa.ServiceModel.csproj" />

<PackageReference Include="NUnit" Version="3.12.*" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.*" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using NUnit.Framework;
using ServiceStack;
using ServiceStack.Testing;
using SvelteSpaTemplate.ServiceInterface;
using SvelteSpaTemplate.ServiceModel;
using SvelteSpa.ServiceInterface;
using SvelteSpa.ServiceModel;

namespace SvelteSpaTemplate.Tests
namespace SvelteSpa.Tests
{
public class UnitTest
{
Expand Down
8 changes: 4 additions & 4 deletions SvelteSpaTemplate.sln → SvelteSpa.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvelteSpaTemplate", "SvelteSpaTemplate\SvelteSpaTemplate.csproj", "{5F817400-1A3A-48DF-98A6-E7E5A3DC762F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvelteSpa", "SvelteSpa\SvelteSpa.csproj", "{5F817400-1A3A-48DF-98A6-E7E5A3DC762F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvelteSpaTemplate.ServiceInterface", "SvelteSpaTemplate.ServiceInterface\SvelteSpaTemplate.ServiceInterface.csproj", "{5B8FFF01-1E0B-477D-9D7F-93016C128B23}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvelteSpa.ServiceInterface", "SvelteSpa.ServiceInterface\SvelteSpa.ServiceInterface.csproj", "{5B8FFF01-1E0B-477D-9D7F-93016C128B23}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvelteSpaTemplate.ServiceModel", "SvelteSpaTemplate.ServiceModel\SvelteSpaTemplate.ServiceModel.csproj", "{0127B6CA-1B79-46A6-8307-B36836D107F0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvelteSpa.ServiceModel", "SvelteSpa.ServiceModel\SvelteSpa.ServiceModel.csproj", "{0127B6CA-1B79-46A6-8307-B36836D107F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvelteSpaTemplate.Tests", "SvelteSpaTemplate.Tests\SvelteSpaTemplate.Tests.csproj", "{455EC1EF-134F-4CD4-9C78-E813E4E6D8F6}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvelteSpa.Tests", "SvelteSpa.Tests\SvelteSpa.Tests.csproj", "{455EC1EF-134F-4CD4-9C78-E813E4E6D8F6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using ServiceStack.Configuration;
using ServiceStack.FluentValidation;

namespace SvelteSpaTemplate
namespace SvelteSpa
{
// Run before AppHost.Configure()
public class ConfigureAuth : IConfigureAppHost
Expand Down
22 changes: 22 additions & 0 deletions SvelteSpa/Configure.Ui.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ServiceStack;

namespace SvelteSpa
{
public class ConfigureUi : IConfigureAppHost
{
public void Configure(IAppHost appHost)
{
// if wwwroot/ is empty, build Client App with 'npm run build'
var svgDir = appHost.RootDirectory.GetDirectory("/assets/svg");
if (svgDir != null)
{
Svg.Load(svgDir);
}
Svg.CssFillColor["svg-icons"] = "#FF3E00";
}
}
}
2 changes: 1 addition & 1 deletion SvelteSpaTemplate/Program.cs → SvelteSpa/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.Extensions.Logging;
using ServiceStack;

namespace SvelteSpaTemplate
namespace SvelteSpa
{
public class Program
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"SvelteSpaTemplate": {
"SvelteSpa": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
Expand Down
6 changes: 3 additions & 3 deletions SvelteSpaTemplate/Startup.cs → SvelteSpa/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
using Funq;
using ServiceStack;
using ServiceStack.Configuration;
using SvelteSpaTemplate.ServiceInterface;
using SvelteSpa.ServiceInterface;
using ServiceStack.Script;
using ServiceStack.Web;
using System;
using ServiceStack.Text;
using ServiceStack.Logging;

namespace SvelteSpaTemplate
namespace SvelteSpa
{
public class Startup : ModularStartup
{
Expand All @@ -42,7 +42,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

public class AppHost : AppHostBase
{
public AppHost() : base("SvelteSpaTemplate", typeof(MyServices).Assembly) { }
public AppHost() : base("SvelteSpa", typeof(MyServices).Assembly) { }

// Configure your AppHost with the necessary configuration and dependencies your App needs
public override void Configure(Container container)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SvelteSpaTemplate.ServiceInterface\SvelteSpaTemplate.ServiceInterface.csproj" />
<ProjectReference Include="..\SvelteSpaTemplate.ServiceModel\SvelteSpaTemplate.ServiceModel.csproj" />
<ProjectReference Include="..\SvelteSpa.ServiceInterface\SvelteSpa.ServiceInterface.csproj" />
<ProjectReference Include="..\SvelteSpa.ServiceModel\SvelteSpa.ServiceModel.csproj" />
</ItemGroup>

<Target Name="OnFirstUse" BeforeTargets="Build" Condition=" !Exists('wwwroot\dist') ">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ac7a7bd

Please sign in to comment.