Build Framework Packages
This guide explains how maintainers rebuild the frontend, backend, and testing packages that ship with Webstir.
Overview
Framework/Frontend,Framework/Backend, andFramework/Testingcontain the sources for the published@webstir-io/*packages.- The standalone
frameworkconsole rebuilds those packages, records registry metadata inFramework/Packaging/framework-packages.json, and updatesEngine/Resources/package.jsonso workspace templates stay in sync. webstir installkeeps consuming workspaces aligned with the recorded registry versions by updatingpackage.jsonspecifiers and running the configured package manager (pnpm by default) when drift is detected.
Update The Packages
- Bump versions – Run
dotnet run --project Framework/Framework.csproj -- packages bump(append--bump <patch|minor|major>or--set-version <x.y.z>). Add--dry-runto preview the next version without touching manifests. The publish workflow invokes the same command automatically. - Optional diff – Run
dotnet run --project Framework/Framework.csproj -- packages diffto compare the current registry metadata with the package sources. A non-zero exit code indicates version, registry specifier, or workspace specifier drift. - Rebuild packages – Run
dotnet run --project Framework/Framework.csproj -- packages syncfrom the repo root (or invoke the publishedframeworkbinary).- Add
--frontend,--testing, or--backendto rebuild a single package. - The command runs the workspace’s package manager install (
pnpm install --frozen-lockfileby default) andnpm run buildin each package directory, then rewritesframework-packages.jsonandEngine/Resources/package.jsonwith the new versions and caret specifiers. - Set
WEBSTIR_FRONTEND_REGISTRY_SPEC,WEBSTIR_TEST_REGISTRY_SPEC, orWEBSTIR_BACKEND_REGISTRY_SPECbefore running if you need to override the default<name>@<version>registry specifier (for example, to target a dist-tag during validation).
- Add
- Verify metadata – Run
dotnet run --project Framework/Framework.csproj -- packages verifyto confirm that the package sources, manifest entries, template dependencies, and repository state are aligned. The verifier also ensures no legacy tarball assets remain. - Publish packages – Run
dotnet run --project Framework/Framework.csproj -- packages publishto bump versions, rebuild metadata, and publish any missing releases. Add--dry-runto preview without touching files or hitting the registry, and pass--bump <patch|minor|major>(or--set-version <x.y.z>) when you need to override the automatic bump detection. EnsureGH_PACKAGES_TOKENis available before attempting to publish; the command surfaces actionable errors if authentication or.npmrcconfiguration is missing. - Commit artifacts – Include the updated package sources, lockfiles,
Framework/Packaging/framework-packages.json, andEngine/Resources/package.jsonin your PR. No tarballs are generated or committed in the registry-only flow.
Automate Releases
- Trigger the Release workflow in GitHub Actions when you are ready to publish a new build.
- Choose the bump type (patch, minor, or major). With the default
autoselection, apply arelease:{patch|minor|major}label to the PR; the workflow picks the highest bump present. - The workflow:
- Bumps package manifests and lockfiles.
- Runs
dotnet run --project Framework/Framework.csproj -- packages publishto rebuild metadata and publish any missing versions. - Commits the updated metadata back to
main, tagsvX.Y.Z, and creates the corresponding GitHub release.
- Provide
dry_run: trueif you only want to preview the next version without publishing or pushing changes.
Developer Helpers
- Run
dotnet run --project Framework/Framework.csproj -- packages diffto see how the current sources compare to the recorded manifest before touching tracked files. - Before committing frontend/testing/back-end changes, run
dotnet run --project Framework/Framework.csproj -- packages syncfollowed bydotnet run --project Framework/Framework.csproj -- packages verifyto ensure the metadata and template dependencies are in sync. - Use
dotnet run --project Framework/Framework.csproj -- packages bump --dry-run --bump patchto preview the next version without touching files.
Install In A Workspace
- Run
webstir install(or any workflow that calls it) inside a consuming workspace. - The installer rewrites the workspace
package.jsonentries for the framework packages, removes stale caches when necessary, and runs the selected package manager sonode_modulesmatches the recorded registry versions. - Use
webstir install --dry-runto inspect upcoming changes, orwebstir install --cleanto clear the.webstir/cache before reinstalling. - Override the tool for a single run with
webstir install --package-manager pnpm@9(or-m pnpm@9); omit the version to use the repo’spackageManagermetadata.
Registry Notes
- Framework installs now rely on registry packages. Configure
.npmrcwith the appropriate registry URL and authentication token (currentlyGH_PACKAGES_TOKENfor GitHub Packages). - For Sandbox or CI scenarios, provision the token and
.npmrcbefore executingframework packages publishorwebstir install.
Verify Changes
- Run
./utilities/scripts/format-build.shto ensure formatting passes, the solution builds, and frontend tests succeed. - When package contents change, run
framework packages syncfollowed byframework packages verify. Runframework packages publish --dry-runfor an end-to-end preview of the release pipeline without modifying artifacts. - In a throwaway workspace, run
webstir install --cleanto confirm the packages reinstall from the registry and that the package manager completes without manual intervention. - Optionally run
framework packages publishin a dry environment to ensure credentials are configured before the release workflow executes.