Skip to content

Environment Setup, Build Pipeline & Diagnostics ​

This guide covers setting up a ShibaPPT development workstation, running full and incremental builds via scripts\build.ps1, understanding automated guardrails, and diagnosing runtime issues.


1. Prerequisites ​

ComponentRequirementNotes
OSWindows 10 / Windows 11 (x64)High-DPI multi-monitor awareness supported
Visual StudioVisual Studio 2022Install ".NET desktop development" and "Office/SharePoint development (VSTO)" workloads
.NET Targeting Pack.NET Framework 4.8 Developer PackSolution builds shibappt.csproj and Tools\ShibaVbaRunner\ShibaVbaRunner.csproj (C# 8.0)
Node.js & npmNode.js v18+ (v20 / v22 LTS recommended)Required for shibappt-ui frontend bundles and VitePress docs
Microsoft PowerPointOffice 2016 / 2019 / 2021 / Microsoft 365Required for F5 VSTO debugging and COM testing
WebView2 RuntimeMicrosoft Edge WebView2 Evergreen RuntimePre-installed on Windows 11; install Evergreen Runtime on Windows 10 if missing
Inno Setup (Optional)Inno Setup 6Needed only when compiling shibappt-setup-v*.exe installers locally

2. Standard Build Pipeline (scripts\build.ps1) ​

Always build through scripts\build.ps1. It uses vswhere.exe to locate the Visual Studio MSBuild instance equipped with VSTO Microsoft.VisualStudio.Tools.Office.targets and runs serial resource compilation (/m:1, preventing intermittent RG1000 duplicate resource errors in classic WPF/VSTO projects).

1. Full Reproducible Build ​

powershell
# Default Debug build
powershell -ExecutionPolicy Bypass -File scripts\build.ps1 -Configuration Debug

# Production Release build (required before Inno Setup packaging)
powershell -ExecutionPolicy Bypass -File scripts\build.ps1 -Configuration Release

A full build executes 5 sequential stages:

  1. Frontend Build: Runs npm ci and npm run build (including fix-paths.cjs) inside shibappt-ui/.
  2. Source Web-Asset Validation (scripts\verify-web-assets.ps1): Verifies every HTML entry and all relative .html / .js / .css imports across shibappt-ui\dist, mod_design\html, mod_colorpicker\html, mod_Fonts\html, and mod_paperjs\html.
  3. Architecture & Size Guardrails (scripts\verify-architecture.ps1): Enforces WebView2 service boundaries, ThisAddIn.cs zero coupling, and the 2,000-line limit on C# and Vue files.
  4. MSBuild Compilation: Runs MSBuild.exe shibappt.sln /restore /t:Build /p:Configuration=<Debug|Release> /m:1 /v:minimal.
  5. Output Web-Asset Validation: Re-runs verify-web-assets.ps1 -OutputRoot bin\<Configuration> to ensure all web bundles were copied cleanly into the build output directory.

2. Fast Incremental Builds for Daily Iteration ​

powershell
# Scenario 1: Only C# code changed (skips frontend completely, ~5 seconds)
powershell -ExecutionPolicy Bypass -File scripts\build.ps1 -SkipFrontend

# Scenario 2: Only a single frontend module changed (skips npm ci and other modules)
# Allowed -FrontendModule values:
#   all | design | colorpicker | fonts | circular-menu | icon-picker |
#   command-center | web-image-picker | custom-ribbon | cross-page
powershell -ExecutionPolicy Bypass -File scripts\build.ps1 -FrontendModule design -SkipNpmInstall

TIP

Single-Module Isolation: When -FrontendModule <name> is specified, Vite prefixes shared non-entry chunks with <module>-- so rebuilding one frontend module never clobbers shared chunks used by other modules in shibappt-ui/dist/assets/.


3. Frontend Dev Server & Documentation Site ​

1. shibappt-ui Vite Dev Server ​

powershell
cd shibappt-ui
npm run dev

Starts Vite on http://localhost:5174. Note: inside PowerPoint, WebView2 hosts load local disk bundles via virtual domains (e.g., https://design.local/), so run npm run build:<module> or npm run build:watch to test changes live inside PowerPoint.

2. VitePress Bilingual Documentation Site ​

powershell
cd docs
npm run docs:dev      # Start local live-reload server at http://localhost:5175
npm run docs:build    # Build static site into docs/.vitepress/dist
npm run docs:preview  # Preview production build at http://localhost:4175

4. Runtime Diagnostics & Logging ​

1. Log Files & Environment Overrides ​

LoggerDefault PathRotation & RetentionPurpose
ShibaLogger%LocalAppData%\ShibaPPT\Logs\shibappt-YYYY-MM-DD.logDaily rolling, 7-day retentionStartup events, module lifecycle, exceptions, and System.Diagnostics.Trace output
DevelopmentTrace%LocalAppData%\ShibaPPT\Logs\development-trace.jsonlRotates to .1 at 10 MBStructured JSONL trace of WebView2 route timings, errors, and lifecycle checkpoints
SimpleLogger%LocalAppData%\ShibaPPT\Logs\Written during early host initCaptures AssemblyResolve diagnostics before full infrastructure starts

Environment Variables:

  • SHIBAPPT_DIAGNOSTIC_LOG_PATH: Override the file path for development-trace.jsonl.
  • SHIBAPPT_DIAGNOSTICS=0 (false / off): Disable structured JSONL tracing.

2. Visual Environment Diagnostics (EnvironmentDiagnosticsReport) ​

Open Plugin Settings -> Diagnostics inside PowerPoint to inspect weighted health checks and export a one-click diagnostic bundle (ShibaLogger.ExportDiagnosticBundle):

  • P0 Critical: WebView2 Runtime presence/version and Edge/Chromium group policies (EdgeProbe).
  • P1 Environment: Per-STA-thread CoreWebView2Environment status and WebView2Data folder permissions.
  • P2 Display & DPI: Multi-monitor layout and per-monitor DPI scaling factors (DisplayProbe).
  • P3 Host & Module Timings: OS build, .NET release key, Office ClickToRun/MSI build, VSTO manifest URI, and a full table of all 29 modules with startup latency (InitDurationMs) and registered CommandBus IDs.