Framework Packaging Plan
Status: completed. This document is retained for historical context; the registry-first approach described here is now the default.
Background
- Historically,
framework packages syncrebuilt tarballs, copied them intoFramework/outandFramework/Resources/tools, and then rewroteFramework/out/manifest.json(Framework/Packaging/PackageBuilder.cs,Framework/Commands/PackageConsoleCommand.cs). - Runtime installers (
Framework/Packaging/FrontendPackageInstaller.cs,Framework/Packaging/TestPackageInstaller.cs) read that manifest, copy tarballs into workspace.webstir, and verify hashes viaFrameworkPackageRepository. - CLI helpers (for example,
utilities/scripts/local-ci.sh) expectframework packages verifyto confirm the manifest and tarballs match git. - This dual-storage model was designed for offline installs but increases maintenance, adds hash drift failure modes, and confuses contributors who expect a registry-first experience.
Goals
- Treat the registry as the single distribution channel for
@webstir-io/*packages. - Simplify the build/publish workflow to mirror standard npm libraries.
- Reduce repository noise by eliminating committed tarballs and manifests.
- Improve developer ergonomics with straightforward auth guidance and clearer errors when credentials are missing.
Non-Goals
- Enabling full offline installs after the migration.
- Redesigning the package contents themselves.
- Moving to the public npm registry (tracked separately; this plan keeps GitHub Packages until release).
Target Architecture
Build & Publish
framework packages syncruns the package manager install (pnpm install --frozen-lockfileby default),npm run build, andnpm packinside each package workspace (e.g.,Framework/Frontend,Framework/Testing), returning metadata but leaving the tarball alongside the source.framework packages publishpushes the built tarball to a configurable registry URL (default: GitHub Packages) and skips if the version already exists.- No files are copied into
Framework/outorFramework/Resources/webstir; no manifest is generated.
Installers & CLI Workflows
FrontendPackageInstallerandTestPackageInstalleralways pin the dependency to the registry specifier (falling back topackage.jsonversions if none provided).PackageSynchronizerdetermines whether to rerun the package manager install by comparing dependency specifiers and installed versions, not tarball hashes.- If the registry install fails or credentials are missing, the CLI surfaces a clear error with remediation steps (token required, link to docs).
Auth & Config
.npmrccontinues to point@webstir-ioto GitHub Packages and requiresGH_PACKAGES_TOKENduring the private phase. Corepack users should runcorepack enableso pnpm is available without a global install.PackageBuilderreads the registry URL and access mode from environment variables or CLI flags to ease the eventual switch to npmjs.- Scripts emit friendly warnings when auth variables are unset and skip publish gracefully.
Workstreams
- Refactor
PackageBuilderflow- Remove copies to
Framework/out/Framework/Resources/webstirand the manifest writer. - Simplify result objects to return build metadata and publish status only.
- Remove copies to
- Retire manifest consumers
- Delete
FrameworkPackageRepositoryand related manifest parsing. - Rework installers to depend solely on registry specifiers and installed package.json data.
- Trim hash validation and tarball copying logic.
- Delete
- Update
PackageSynchronizer- Adjust install decision logic to align with the new installer outputs.
- Remove references to tarball flags (
TarballUpdated,Hashchecks) and rely on dependency/ version mismatch detection.
- Tooling & script updates
- Edit
utilities/scripts/local-ci.shand any CI jobs to dropframework packages verifyand manifest checks. - Add lightweight publish validation (e.g.,
npm view) whenframework packages publishruns. - Rework
.github/workflows/release.ymlso releases no longer rely onFramework/outtarballs—either stop attaching them or generate fresh archives during the job.
- Asset cleanup
- Delete
Framework/out/**,Framework/Resources/webstir/**, and embedded resource item groups fromFramework.csproj. - Remove
Framework/outfrom.gitignoreonce the directory disappears.
- Delete
- Docs & Dev Onboarding
- Update
docs/how-to/package-synchronization.mdanddocs/how-to/framework-packages.mdto describe the registry-first flow and credential requirements. - Document how to set
GH_PACKAGES_TOKEN, how publishing works now, and call out the future switch to the public registry.
- Update
- Testing & rollout
- Add/adjust integration tests to validate installer behavior with registry installs (mock success/failure).
- Run through
webstir init/install/watchmanually with and without valid auth to confirm error messaging. - Communicate the breaking change (registry access now required) and coordinate the release after packages are rebuilt.
Migration Notes
- Expect PRs to land in the above order to keep diffs reviewable.
- A transitional milestone can keep the manifest generation behind a feature flag if we need to support both modes briefly, but the goal is to remove it entirely once scripts/docs are updated.
- When ready to publish publicly, override the registry URL/access mode in one place (environment variable or config file) and update docs accordingly.