Skip to content

Commit

Permalink
Merge pull request #15 from nabond251/feature/init-rearch-reactor
Browse files Browse the repository at this point in the history
Feature/init rearch reactor
  • Loading branch information
nabond251 authored Feb 9, 2024
2 parents caab196 + 3b5a061 commit 3e46e3c
Show file tree
Hide file tree
Showing 60 changed files with 1,786 additions and 128 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- "*"

env:
SolutionName: Rearch.Build.sln
NuGetDirectory: ${{github.workspace}}/nuget
NUGET_AUTH_TOKEN: ${{secrets.NUGET_API_KEY}}

Expand All @@ -22,8 +23,8 @@ jobs:
dotnet-version: '8.0.x' # SDK Version to use.
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- run: dotnet build --configuration Release /p:Version=${VERSION}
- run: dotnet build ${SolutionName} --configuration Release /p:Version=${VERSION}
- name: Create the package
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output ${NuGetDirectory}
run: dotnet pack ${SolutionName} --configuration Release /p:Version=${VERSION} --no-build --output ${NuGetDirectory}
- name: Publish the package to NuGet
run: dotnet nuget push ${NuGetDirectory}/*.nupkg --api-key ${NUGET_AUTH_TOKEN} --source https://api.nuget.org/v3/index.json
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
# runs the CI everyday at 10AM
- cron: "0 10 * * *"

env:
SolutionName: Rearch.Build.sln

jobs:
build:

Expand All @@ -25,8 +28,8 @@ jobs:
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
run: dotnet restore ${SolutionName}
- name: Build
run: dotnet build --no-restore
run: dotnet build ${SolutionName} --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
run: dotnet test ${SolutionName} --no-build --verbosity normal
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2023-07-09
## 2024-02-08

### Changes

---

Packages with breaking changes:

- [`rearch` - `v0.0.0-dev.2`](#rearch---v000-dev2)

Packages with other changes:

- [`rearch.reactor` - `v0.0.0-dev.2`](#rearch.reactor---v000-dev2)

---

#### `rearch` - `v0.0.0-dev.2`

- **FIX**: listener handle will not recreate manager on dispose.
- **FEAT**: initial impl of rearch.reactor.

#### `rearch.reactor` - `v0.0.0-dev.2`

- **FEAT**: initial impl of rearch.reactor.
- **FEAT**: working mvp.


## 2024-01-31

### Changes

Expand Down
46 changes: 46 additions & 0 deletions Rearch.Build.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34330.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F67704B8-9273-407A-B93B-7874ADCF060B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rearch", "src\Rearch\Rearch.csproj", "{900169C0-3D32-430A-95C1-A713507A243D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{075AFD96-7D62-4387-BD0E-829BCBC5CA3B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rearch.Tests", "tests\Rearch.Tests\Rearch.Tests.csproj", "{0583184D-B026-4170-88D4-AD8876930160}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rearch.Reactor", "src\Rearch.Reactor\Rearch.Reactor.csproj", "{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{900169C0-3D32-430A-95C1-A713507A243D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{900169C0-3D32-430A-95C1-A713507A243D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{900169C0-3D32-430A-95C1-A713507A243D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{900169C0-3D32-430A-95C1-A713507A243D}.Release|Any CPU.Build.0 = Release|Any CPU
{0583184D-B026-4170-88D4-AD8876930160}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0583184D-B026-4170-88D4-AD8876930160}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0583184D-B026-4170-88D4-AD8876930160}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0583184D-B026-4170-88D4-AD8876930160}.Release|Any CPU.Build.0 = Release|Any CPU
{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{900169C0-3D32-430A-95C1-A713507A243D} = {F67704B8-9273-407A-B93B-7874ADCF060B}
{0583184D-B026-4170-88D4-AD8876930160} = {075AFD96-7D62-4387-BD0E-829BCBC5CA3B}
{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D} = {F67704B8-9273-407A-B93B-7874ADCF060B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B463A10B-699E-45A9-AAFE-ACCA65D8CADD}
EndGlobalSection
EndGlobal
23 changes: 17 additions & 6 deletions Rearch.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rearch.Tests", "tests\Rearc
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rearch.Reactor", "src\Rearch.Reactor\Rearch.Reactor.csproj", "{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rearch.Example.Tests", "tests\Rearch.Example.Tests\Rearch.Example.Tests.csproj", "{C9813C9F-2670-480A-A7EF-E8814D631806}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{88F6A6B4-A926-45B2-A4FB-89E5CD31E7A5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rearch.Example", "examples\Rearch.Example\Rearch.Example.csproj", "{9C4EFDE6-E6C9-4DAE-89A3-2691B3CF3C82}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rearch.Reactor.Example", "examples\Rearch.Reactor.Example\Rearch.Reactor.Example.csproj", "{9D315E53-4275-4C64-8CD5-F62B6DAD11CD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -33,10 +37,16 @@ Global
{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D}.Release|Any CPU.Build.0 = Release|Any CPU
{C9813C9F-2670-480A-A7EF-E8814D631806}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9813C9F-2670-480A-A7EF-E8814D631806}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9813C9F-2670-480A-A7EF-E8814D631806}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9813C9F-2670-480A-A7EF-E8814D631806}.Release|Any CPU.Build.0 = Release|Any CPU
{9C4EFDE6-E6C9-4DAE-89A3-2691B3CF3C82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C4EFDE6-E6C9-4DAE-89A3-2691B3CF3C82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C4EFDE6-E6C9-4DAE-89A3-2691B3CF3C82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C4EFDE6-E6C9-4DAE-89A3-2691B3CF3C82}.Release|Any CPU.Build.0 = Release|Any CPU
{9D315E53-4275-4C64-8CD5-F62B6DAD11CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D315E53-4275-4C64-8CD5-F62B6DAD11CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D315E53-4275-4C64-8CD5-F62B6DAD11CD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{9D315E53-4275-4C64-8CD5-F62B6DAD11CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D315E53-4275-4C64-8CD5-F62B6DAD11CD}.Release|Any CPU.Build.0 = Release|Any CPU
{9D315E53-4275-4C64-8CD5-F62B6DAD11CD}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -45,7 +55,8 @@ Global
{900169C0-3D32-430A-95C1-A713507A243D} = {F67704B8-9273-407A-B93B-7874ADCF060B}
{0583184D-B026-4170-88D4-AD8876930160} = {075AFD96-7D62-4387-BD0E-829BCBC5CA3B}
{B150E8CB-1350-4F5A-9521-2EDF3C7BB42D} = {F67704B8-9273-407A-B93B-7874ADCF060B}
{C9813C9F-2670-480A-A7EF-E8814D631806} = {075AFD96-7D62-4387-BD0E-829BCBC5CA3B}
{9C4EFDE6-E6C9-4DAE-89A3-2691B3CF3C82} = {88F6A6B4-A926-45B2-A4FB-89E5CD31E7A5}
{9D315E53-4275-4C64-8CD5-F62B6DAD11CD} = {88F6A6B4-A926-45B2-A4FB-89E5CD31E7A5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B463A10B-699E-45A9-AAFE-ACCA65D8CADD}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) SdgApps. All rights reserved.
// </copyright>

namespace Rearch.Example.Tests;
namespace Rearch.Example;

/// <summary>
/// Test example.
Expand All @@ -15,7 +15,7 @@ public class ExampleTest
[Fact]
public void MainFunctionRunsCorrectly()
{
using var container = new Container();
using var container = new CapsuleContainer();

Assert.True(
container.Read(Count) == 0,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
// ACTION REQUIRED: This file was automatically added to your project, but it
// will not take effect until additional steps are taken to enable it. See the
// following page for additional information:
//
// https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/EnableConfiguration.md

"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"documentationRules": {
Expand Down
4 changes: 4 additions & 0 deletions examples/Rearch.Reactor.Example/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
global using Microsoft.Maui;
global using Microsoft.Maui.Graphics;
global using Microsoft.Maui.Hosting;
global using MauiControls = Microsoft.Maui.Controls;
63 changes: 63 additions & 0 deletions examples/Rearch.Reactor.Example/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using MauiReactor;
using Microsoft.Extensions.Logging;
using ReactorData;
using ReactorData.Sqlite;
using System;
using System.IO;
using System.Reflection.Metadata;
using Rearch.Reactor.Components;
using Rearch.Reactor.Example.Models;
using Rearch.Reactor.Example.Pages;

namespace Rearch.Reactor.Example;

public static class MauiProgram
{
static readonly string _dbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "todo_app.db");

public static MauiApp CreateMauiApp()
{
//if (File.Exists(_dbPath))
//{
// File.Delete(_dbPath);
//}

var builder = MauiApp.CreateBuilder();
builder
.UseRearchReactorApp<MainPage>(app =>
{
//app.AddResource("Resources/Styles/Colors.xaml");
//app.AddResource("Resources/Styles/Styles.xaml");
})
#if DEBUG
.EnableMauiReactorHotReload()
#endif
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-SemiBold.ttf", "OpenSansSemiBold");
});

#if DEBUG
builder.Logging.AddDebug();
#endif
//ReactorData
builder.Services.AddReactorDataWithSqlite(
connectionString: $"Data Source={_dbPath}",
configure: _ => _.Model<Todo>(),
modelContextConfigure: options =>
{
options.Dispatcher = action =>
{
if (MauiControls.Application.Current?.Dispatcher.IsDispatchRequired == true)
{
MauiControls.Application.Current?.Dispatcher.Dispatch(action);
}
};
options.ConfigureContext = context => context.Load<Todo>();
});


return builder.Build();
}
}
18 changes: 18 additions & 0 deletions examples/Rearch.Reactor.Example/Models/Todo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using ReactorData;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rearch.Reactor.Example.Models;

[Model]
partial class Todo
{
public int Id { get; set; }

public required string Task { get; set; }

public bool Done { get; set; }
}
Loading

0 comments on commit 3e46e3c

Please sign in to comment.