9.7 KiB
9.7 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-foundation | 01 | execute | 1 |
|
true |
|
|
Purpose: Every subsequent plan builds on a compiling, test-wired foundation. Getting the Generic Host + WPF STA threading right here prevents the most common startup crash. Output: SharepointToolbox.sln with two projects, zero build errors, zero test failures on first run.
<execution_context> @C:/Users/SebastienQUEROL/.claude/get-shit-done/workflows/execute-plan.md @C:/Users/SebastienQUEROL/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/01-foundation/01-CONTEXT.md @.planning/phases/01-foundation/01-RESEARCH.md Task 1: Create solution and WPF project with all NuGet packages SharepointToolbox.sln, SharepointToolbox/SharepointToolbox.csproj, SharepointToolbox/App.xaml, SharepointToolbox/App.xaml.cs, SharepointToolbox/MainWindow.xaml, SharepointToolbox/MainWindow.xaml.cs Run from the repo root:```
dotnet new sln -n SharepointToolbox
dotnet new wpf -n SharepointToolbox -f net10.0-windows
dotnet sln add SharepointToolbox/SharepointToolbox.csproj
```
Edit SharepointToolbox/SharepointToolbox.csproj:
- Set `<TargetFramework>net10.0-windows</TargetFramework>`
- Add `<Nullable>enable</Nullable>`, `<ImplicitUsings>enable</ImplicitUsings>`
- Add `<PublishTrimmed>false</PublishTrimmed>` (critical — PnP.Framework + MSAL use reflection)
- Add `<StartupObject>SharepointToolbox.App</StartupObject>`
- Add NuGet packages:
- `CommunityToolkit.Mvvm` version 8.4.2
- `Microsoft.Extensions.Hosting` version 10.x (latest 10.x)
- `Microsoft.Identity.Client` version 4.83.1
- `Microsoft.Identity.Client.Extensions.Msal` version 4.83.3
- `Microsoft.Identity.Client.Broker` version 4.82.1
- `PnP.Framework` version 1.18.0
- `Serilog` version 4.3.1
- `Serilog.Sinks.File` (latest)
- `Serilog.Extensions.Hosting` (latest)
- Change `<ApplicationDefinition Remove="App.xaml" />` and `<Page Include="App.xaml" />` to demote App.xaml from ApplicationDefinition
Edit App.xaml: Remove `StartupUri="MainWindow.xaml"`. Keep `x:Class="SharepointToolbox.App"`.
Edit App.xaml.cs: Replace default App class with Generic Host entry point pattern:
```csharp
public partial class App : Application
{
[STAThread]
public static void Main(string[] args)
{
using IHost host = Host.CreateDefaultBuilder(args)
.UseSerilog((ctx, cfg) => cfg
.WriteTo.File(
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"SharepointToolbox", "logs", "app-.log"),
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: 30))
.ConfigureServices(RegisterServices)
.Build();
host.Start();
App app = new();
app.InitializeComponent();
app.MainWindow = host.Services.GetRequiredService<MainWindow>();
app.MainWindow.Visibility = Visibility.Visible;
app.Run();
}
private static void RegisterServices(HostBuilderContext ctx, IServiceCollection services)
{
// Placeholder — services registered in subsequent plans
services.AddSingleton<MainWindow>();
}
}
```
Leave MainWindow.xaml and MainWindow.xaml.cs as the default WPF template output — they will be replaced in plan 01-06.
Run `dotnet build SharepointToolbox/SharepointToolbox.csproj` and fix any errors before moving to Task 2.
cd "C:\Users\dev\Documents\projets\Sharepoint" && dotnet build SharepointToolbox/SharepointToolbox.csproj --no-incremental 2>&1 | tail -5
Build output shows "Build succeeded" with 0 errors. App.xaml has no StartupUri. csproj contains PublishTrimmed=false and StartupObject.
Task 2: Create xUnit test project with stub test files
SharepointToolbox.Tests/SharepointToolbox.Tests.csproj,
SharepointToolbox.Tests/Services/ProfileServiceTests.cs,
SharepointToolbox.Tests/Services/SettingsServiceTests.cs,
SharepointToolbox.Tests/Auth/MsalClientFactoryTests.cs,
SharepointToolbox.Tests/Auth/SessionManagerTests.cs,
SharepointToolbox.Tests/ViewModels/FeatureViewModelBaseTests.cs,
SharepointToolbox.Tests/Localization/TranslationSourceTests.cs,
SharepointToolbox.Tests/Integration/LoggingIntegrationTests.cs
Run from the repo root:
```
dotnet new xunit -n SharepointToolbox.Tests -f net10.0
dotnet sln add SharepointToolbox.Tests/SharepointToolbox.Tests.csproj
dotnet add SharepointToolbox.Tests/SharepointToolbox.Tests.csproj reference SharepointToolbox/SharepointToolbox.csproj
```
Edit SharepointToolbox.Tests/SharepointToolbox.Tests.csproj:
- Add `Moq` (latest) NuGet package
- Add `Microsoft.NET.Test.Sdk` (already included in xunit template)
- Add `<Nullable>enable</Nullable>`, `<ImplicitUsings>enable</ImplicitUsings>`
Create stub test files — each file compiles but has a single `[Fact(Skip = "Not implemented yet")]` test so the suite passes (no failures, just skips):
**SharepointToolbox.Tests/Services/ProfileServiceTests.cs**
```csharp
namespace SharepointToolbox.Tests.Services;
public class ProfileServiceTests
{
[Fact(Skip = "Wave 0 stub — implemented in plan 01-03")]
public void SaveAndLoad_RoundTrips_Profiles() { }
}
```
Create identical stub pattern for:
- `SettingsServiceTests.cs` — class `SettingsServiceTests`, skip reason "plan 01-03"
- `MsalClientFactoryTests.cs` — class `MsalClientFactoryTests`, skip reason "plan 01-04"
- `SessionManagerTests.cs` — class `SessionManagerTests`, skip reason "plan 01-04"
- `FeatureViewModelBaseTests.cs` — class `FeatureViewModelBaseTests`, skip reason "plan 01-06"
- `TranslationSourceTests.cs` — class `TranslationSourceTests`, skip reason "plan 01-05"
- `LoggingIntegrationTests.cs` — class `LoggingIntegrationTests`, skip reason "plan 01-05"
Run `dotnet test SharepointToolbox.Tests/SharepointToolbox.Tests.csproj --no-build` after building to confirm all tests are skipped (0 failed).
cd "C:\Users\dev\Documents\projets\Sharepoint" && dotnet test SharepointToolbox.Tests/SharepointToolbox.Tests.csproj 2>&1 | tail -10
dotnet test shows 0 failed, 7 skipped (or similar). All stub test files exist in correct subdirectories.
- `dotnet build SharepointToolbox.sln` succeeds with 0 errors
- `dotnet test SharepointToolbox.Tests/SharepointToolbox.Tests.csproj` shows 0 failures
- App.xaml contains no StartupUri attribute
- SharepointToolbox.csproj contains `false`
- SharepointToolbox.csproj contains `SharepointToolbox.App`
- App.xaml.cs Main method is decorated with `[STAThread]`
<success_criteria> Solution compiles cleanly. Both projects in the solution. Test runner executes without failures. Generic Host wiring is correct (most critical risk for this plan — wrong STA threading causes runtime crash). </success_criteria>
After completion, create `.planning/phases/01-foundation/01-01-SUMMARY.md`