journal/scripts/WORKFLOWS.md
stan44 506aa072f6 Added README for scripts.
Added WORKFLOWS for scripts.
2026-02-27 11:11:53 -06:00

3.1 KiB

Script Workflows

Practical command recipes for common tasks.

1) Start a Clean Dev Shell

cd E:\stansshit\csharp\journal-master\journal
. .\scripts\dev-shell.ps1

Use this when you want the current shell configured with repo-local cache paths.

2) Build .NET Projects With Safe Defaults

.\scripts\dotnet-min.ps1 build Journal.Sidecar/Journal.Sidecar.csproj
.\scripts\dotnet-min.ps1 build Journal.WebGateway/Journal.WebGateway.csproj

3) Build Frontend or Desktop App

Web build:

.\scripts\publish-app.ps1 -Target web

Tauri raw exe (no installer):

.\scripts\publish-app.ps1 -Target tauri -TauriBundles none

Tauri installer bundles:

.\scripts\publish-app.ps1 -Target tauri -TauriBundles nsis
.\scripts\publish-app.ps1 -Target tauri -TauriBundles msi

4) Publish Sidecar

.\scripts\publish-sidecar.ps1 -Configuration Release -Runtime win-x64

Expected output under output/.

5) Publish WebGateway Package

.\scripts\publish-app.ps1 -Target web
.\scripts\publish-webgateway.ps1 -Configuration Release -Runtime win-x64

If you only want gateway binary refresh:

.\scripts\publish-webgateway.ps1 -SkipWebAssets

6) Run WebGateway Against Explicit Root

When multiple clones exist, always pin project root:

.\scripts\run-webgateway.ps1 -ProjectRoot E:\stansshit\csharp\journal-master\journal -Urls http://0.0.0.0:5180

Quick health check:

Invoke-RestMethod http://127.0.0.1:5180/api/health

Inspect active backend config:

$body = @{ action = 'config.get' } | ConvertTo-Json
Invoke-RestMethod -Uri http://127.0.0.1:5180/api/command -Method Post -ContentType 'application/json' -Body $body

7) Python Package Installs in Repo-Local Target

.\scripts\pip-min.ps1 install requests

Packages go to .pydeps\py314 unless you pass your own --target/--prefix.

8) Migration Gate (When Full Test Assets Exist)

.\scripts\migration-gate.ps1

Partial run:

.\scripts\migration-gate.ps1 -SkipSmoke -SkipApi

Current clean repo caveat: tests/ and Journal.Api/ are not present, so full gate will fail until those assets are available.

9) NuGet Cache Export/Import (Offline-ish Restore)

Export:

.\scripts\nuget-export-cache.ps1 -OutputZip .\nuget-cache-export.zip

Import:

.\scripts\nuget-import-cache.ps1 -InputZip .\nuget-cache-export.zip

Current clean repo caveat: both scripts reference Journal.Api/Journal.Api.csproj.

10) Quick Troubleshooting

Script blocked by execution policy:

pwsh -NoProfile -ExecutionPolicy Bypass -File .\scripts\publish-app.ps1 -Target web

Unexpected data/vault mismatch in WebGateway:

  1. Run with explicit -ProjectRoot.
  2. Verify with config.get via /api/command.
  3. Verify sidecar root via /api/sidecar/root.

NuGet restore flakiness:

  1. Use dotnet-min.ps1 wrappers.
  2. Confirm proxy vars are cleared (HTTP_PROXY, HTTPS_PROXY, etc.).
  3. Ensure .nuget directories are writable.