Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/14 website #437

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
afa0928
Rename TPP. folders to use C# PascalCase conventions and move TPP. fo…
feselene Oct 9, 2024
ce31bf1
Add Program.cs, Startup.cs, and Website.csproj. Website works success…
feselene Oct 10, 2024
2ef5070
dotnet tests now passing, but some missing modules still. Will invest…
feselene Oct 10, 2024
f02034b
Check in changes. Still bug with EventSub and PersistenceMongoDB inte…
feselene Oct 10, 2024
9f7035b
Added missing persistence libraries. Still missing eventSub file and …
feselene Oct 10, 2024
387c184
Merge branch 'refactor/directory-structure' into issue/14-website
feselene Oct 10, 2024
0622cf0
rename TwitchEventSub to EventSub. Note that some of the dependendenc…
feselene Oct 10, 2024
20b31e4
try catch away mongoDB test
feselene Oct 10, 2024
7e6245c
Fix Resources import in Core.csproj to include Resources folder
feselene Oct 10, 2024
d7840f1
Merge branch 'refactor/directory-structure' into issue/14-website
feselene Oct 10, 2024
5faa6ae
use correct directory structure for json-schemas.yml and test-publish…
feselene Oct 10, 2024
a5e3acd
Merge branch 'refactor/directory-structure' into issue/14-website
feselene Oct 10, 2024
eaa4042
changne timeout command to use release/runtimes/Core.dll path. For so…
feselene Oct 10, 2024
5d55f71
Merge branch 'refactor/directory-structure' into issue/14-website
feselene Oct 10, 2024
fec860f
modify test-publish.yml. Confirmed test code 143 received.
feselene Oct 10, 2024
80a18fd
Merge branch 'refactor/directory-structure' into issue/14-website
feselene Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
dotnet-version: 8.0.x
- uses: actions/checkout@v2
- name: Publish the core
run: dotnet publish TPP.Core -c Release -r linux-x64 -p:PublishSingleFile=true --no-self-contained -p:IncludeNativeLibrariesForSelfExtract=true
run: dotnet publish Core -c Release -r linux-x64 -p:PublishSingleFile=true --no-self-contained -p:IncludeNativeLibrariesForSelfExtract=true
- name: Deploy the core to TPP
env:
SSHUSER: ${{ secrets.TPP_SSH_USER }}
Expand All @@ -24,5 +24,5 @@ jobs:
run: |
echo "$SSHPRIVKEY" > tpp.key
chmod 600 tpp.key
scp -q -i tpp.key -o StrictHostKeyChecking=no -P ${SSHPORT} artifacts/publish/TPP.Core/release_linux-x64/TPP.Core ${SSHUSER}@${SSHHOST}:core_update
scp -q -i tpp.key -o StrictHostKeyChecking=no -P ${SSHPORT} artifacts/publish/Core/release_linux-x64/Core ${SSHUSER}@${SSHHOST}:core_update
cat .github/workflows/deploy.sh | ssh -q -i tpp.key -o StrictHostKeyChecking=no -p ${SSHPORT} ${SSHUSER}@${SSHHOST}
2 changes: 1 addition & 1 deletion .github/workflows/json-schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v2
- name: Regenerate core config json schemas
run: |
cd TPP.Core
cd src/Core
dotnet run -- regenjsonschemas
git add config.schema.json
git add config.runmode.schema.json
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- uses: actions/checkout@v2
- name: Try publishing and running dummy mode
run: |
cd TPP.Core
cd src/Core
dotnet run -- gendefaultconfig --outfile=config.json
dotnet publish -c Release
timeout --preserve-status -k1 3 dotnet ../artifacts/publish/TPP.Core/release/TPP.Core.dll start -m dummy || exit_code=$?
timeout --preserve-status -k1 3 dotnet ../../artifacts/publish/Core/release/Core.dll start -m dummy || exit_code=$?
if [ $exit_code -ne 143 ]; then
echo "expected exit code 143, which means the program handled SIGTERM, but got $exit_code"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Porting features over is an ongoing process.
## requirements
- .NET 8 SDK (exactly, not 9 or up), you can get one from [dotnet.microsoft.com](https://dotnet.microsoft.com/download)
- If you use or run any components with persistence, MongoDB.
See [TPP.Persistence.MongoDB](TPP.Persistence.MongoDB) for details.
See [PersistenceMongoDB](src/PersistenceMongoDB) for details.

## run
The executable project is located at [TPP.Core](TPP.Core). See its readme for further instructions.
The executable project is located at [Core](src/Core). See its readme for further instructions.

## run tests
- `dotnet test` runs all tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.Immutable;
using System.Linq;

namespace TPP.ArgsParsing
namespace ArgsParsing
{
/// <summary>
/// Exception thrown by <see cref="ArgsParser"/> if results are being queried without checking for parse failure.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Immutable;

namespace TPP.ArgsParsing
namespace ArgsParsing
{
public enum ErrorRelevanceConfidence
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Linq;
using System.Threading.Tasks;

namespace TPP.ArgsParsing
namespace ArgsParsing
{
public class MissingParserException : ArgumentException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.Immutable;
using System.Threading.Tasks;

namespace TPP.ArgsParsing
namespace ArgsParsing
{
/// <summary>
/// Various extensions to ArgsParser, including type-safe convenience methods
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\TPP.Persistence\TPP.Persistence.csproj" />
<ProjectReference Include="..\Persistence\Persistence.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Immutable;
using System.Threading.Tasks;

namespace TPP.ArgsParsing
namespace ArgsParsing
{
/// <summary>
/// Non-generic version of <see cref="IArgumentParser{T}"/>.
Expand Down
2 changes: 1 addition & 1 deletion TPP.ArgsParsing/README.md → src/ArgsParsing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This project already includes parser implementations for a bunch of commonly use
but can be extended by deriving from [IArgumentParser](IArgumentParser.cs)
and adding that parser to your `ArgsParser`-instance.

Take a look at the [tests](../tests/TPP.ArgsParsing.Tests) for more in-depth usage examples.
Take a look at the [tests](../../tests/ArgsParsing.Tests) for more in-depth usage examples.

# built-in types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using TPP.ArgsParsing.Types;
using ArgsParsing.Types;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser that parses values using the generic type arguments of any of the derived classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Threading.Tasks;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
public class BoolParser : IArgumentParser<bool>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using TPP.Common;
using Common;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// Parser capable of parsing colors represented as a 6-digit hexadecimal string optionally prefixed with '#',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using NodaTime;
using NodaTime.Text;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser capable of parsing instants in strict ISO-8601 UTC format, for example <c>2014-02-12T15:30:00Z</c>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using TPP.ArgsParsing.Types;
using ArgsParsing.Types;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser capable of parsing numbers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using TPP.ArgsParsing.Types;
using ArgsParsing.Types;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser that parses values using the generic type argument of <see cref="ManyOf{T}"/>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using TPP.ArgsParsing.Types;
using ArgsParsing.Types;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser that parses values using the generic type arguments of any of the derived classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using TPP.ArgsParsing.Types;
using ArgsParsing.Types;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser that parses values using the generic type argument of <see cref="Optional{T}"/>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using TPP.ArgsParsing.Types;
using ArgsParsing.Types;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// Parses floating point numbers suffixed with '%' into <see cref="Percentage"/> instances, e.g. '12.34%'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using TPP.Common;
using Common;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser that recognizes a pokemon species, either by name or by a #-prefixed species id.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using TPP.ArgsParsing.Types;
using ArgsParsing.Types;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser capable recognizing numbers prefixed with a predefined prefix.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using TPP.Model;
using Model;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser that finds a role by name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Threading.Tasks;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser that just forwards one argument as a string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser capable of recognizing time spans in the format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using TPP.Model;
using TPP.Persistence;
using Model;
using Persistence;

namespace TPP.ArgsParsing.TypeParsers
namespace ArgsParsing.TypeParsers
{
/// <summary>
/// A parser capable of looking up users by name in a <see cref="IUserRepo"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TPP.ArgsParsing.Types
namespace ArgsParsing.Types
{
/// <summary>
/// Non-generic base class used by all of the derived classes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using TPP.ArgsParsing.TypeParsers;
using ArgsParsing.TypeParsers;

namespace TPP.ArgsParsing.Types
namespace ArgsParsing.Types
{
/// <summary>
/// Non-generic base class used by <see cref="ManyOf{T}"/>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TPP.ArgsParsing.Types
namespace ArgsParsing.Types
{
/// <summary>
/// Non-generic base class used by all of the derived classes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace TPP.ArgsParsing.Types
namespace ArgsParsing.Types
{
/// <summary>
/// Non-generic base class used by <see cref="Optional{T}"/>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TPP.ArgsParsing.Types
namespace ArgsParsing.Types
{
public class Percentage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TPP.ArgsParsing.Types
namespace ArgsParsing.Types
{
public class ImplicitNumber
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;

namespace TPP.Common
namespace Common
{
public static class DictionaryExtensions
{
Expand Down
2 changes: 1 addition & 1 deletion TPP.Common/Emblems.cs → src/Common/Emblems.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;

namespace TPP.Common
namespace Common
{
public static class Emblems
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Reflection;
using System.Runtime.Serialization;

namespace TPP.Common
namespace Common
{
public static class EnumExtensions
{
Expand Down
2 changes: 1 addition & 1 deletion TPP.Common/HexColor.cs → src/Common/HexColor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Text.RegularExpressions;

namespace TPP.Common
namespace Common
{
/// <summary>
/// Wrapper around a color in hexadecimal string notation, e.g. <c>#FF0000</c> for pure red.
Expand Down
4 changes: 2 additions & 2 deletions TPP.Common/PkmnSpecies.cs → src/Common/PkmnSpecies.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace TPP.Common
namespace Common
{
/// <summary>
/// A <see cref="PkmnSpecies"/> uniquely identifies and describes a species of pokemon.
Expand All @@ -16,7 +16,7 @@ namespace TPP.Common
/// This class is deliberately not loading any pokemon name data by itself,
/// since that would most likely be done by loading a large JSON file in application code.
/// Loading such a file imposes additional startup time, could depend on a JSON library
/// (e.g. JSON.net) and takes up significant space. Since this class lives in the "TPP.Common" project,
/// (e.g. JSON.net) and takes up significant space. Since this class lives in the "Common" project,
/// which every other project depends on, that is to be avoided.
/// Instead, the project bundling all dependencies together (the main application)
/// should register names for known pokemon using <see cref="RegisterName"/> at startup.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace TPP.Common
namespace Common
{
/// <summary>
/// Convenience base class that implements <see cref="IEquatable{T}"/>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion TPP.Common/Resources.cs → src/Common/Resources.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.IO;
using System.Reflection;

namespace TPP.Common
namespace Common
{
public static class Resources
{
Expand Down
Loading
Loading