Scaffolds a new Dynamo package repo that hosts a view extension with a WebView2-embedded React frontend. Use when setting up a new repo following the Switchboard pattern — Dynamo package structure, build pipeline, system tests, and bidirectional C#/TypeScript messaging.
You scaffold new Dynamo extension repos following the Switchboard pattern. The reference implementation is DynamoDS/Dynamo-Switchboard.
src/
{Product}.sln
Directory.Build.props # central: DynamoVersion, Product, deployment paths
common.tasks # ReplaceFileText MSBuild task
nuget.config # Autodesk Artifactory + nuget.org sources
{Product}.ViewExtension/ # net8.0-windows, IViewExtension + WebView2 host
{Product}.Messages/ # net8.0, shared C#/TS message types
{Product}.SystemTests/ # net8.0-windows, NUnit + SystemTestBase
{Product}.WebView/ # React + Vite + TypeScript frontend
packageItems/
pkg.json # template — version/name replaced at build time
extra/
{Product}_ViewExtensionDefinition.xml
scripts/
build.ps1 # TypeScript codegen → npm build → dotnet build
create-package-zip.ps1
tools/
WriteTypescript/ # Roslyn-based C# → TypeScript type generator
pipeline.yml # Jenkins: build → test → publish artifact
deploy/{Configuration}/{Product}/
bin/ # assemblies + dist/ (React build output)
extra/ # ViewExtensionDefinition.xml
pkg.json # populated at build time from Directory.Build.props
ViewExtension
IViewExtension with UniqueId, Startup, Loaded, ShutdownAssemblyLoadContext to avoid version conflictsIOAuth2AuthProvider and PathManager from Dynamo via ViewLoadedParamsWebView2 hosting
Microsoft.Web.WebView2 NuGet with ExcludeAssets="runtime" (relies on system runtime){DynamoUserDataDir}/{Product}WebView--allow-file-access-from-filesfile://{bin}/dist/index.htmlC# ↔ TypeScript messaging
WebViewMessage base class with [JsonDerivedType] for polymorphic JSONCoreWebView2.PostWebMessageAsString(json)CoreWebView2.WebMessageReceived eventSystem tests
SystemTestBase from DynamoVisualProgramming.TestsTestServices.dll.config with %DynamoBasePath% placeholder replaced by MSBuild[SetUpFixture] registers AppDomain.AssemblyResolve for Dynamo binariessrc/deploy/{Configuration}/{Product}/Build
Directory.Build.props defines DynamoVersion, Product, DeployTargetFoldersCopyReactApp (AfterBuild), CopyOutputToPackageFolder (AfterBuild), CreatePkgJson (AfterBuild)build.ps1 enforces order: WriteTypescript codegen → npm ci && npm run build → dotnet buildpipeline.yml: Jenkins, Windows node, weekly schedule, publishes {Product}.zip to Autodesk package managerSwitchboard/DynamoSwitchboard with the new product nameUniqueId GUID for the ViewExtensionDynamoVersion in Directory.Build.props to the target Dynamo versionnuget.config if the new repo uses different feeds