--next now prefers a fast npm @next install (CLI + gateway from the Gitea registry) and falls back to source build at next if the dist-tag is unavailable. Registry lane gated to non-dev, non-explicit-ref next installs; CLI/gateway prerelease versions must share a pipeline suffix. Adds tools/install-next-lane.test.sh (wired into CI). PR-event CI 1635 fully green + review-of-record APPROVE (functional install test, head 2fd7cfc3).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.2 KiB
Installer --next fast npm lane — 2026-06-25
Scope
Flip tools/install.sh --next from source-build-first to fast npm @next first, with source fallback.
Registry reality check
Gitea npm registry: https://git.mosaicstack.dev/api/packages/mosaicstack/npm/
Verified before implementation:
@mosaicstack/mosaic@nextresolves to0.0.49-next.1633.@mosaicstack/gateway@nextresolves to0.0.7-next.1633.@mosaicstack/gatewaydist-tags includelatest: 0.0.6andnext: 0.0.7-next.1633.apps/gateway/package.jsonis non-private and has Gitea npmpublishConfig.
Conclusion: the installer can fast-install both CLI and gateway npm packages for --next. The gateway Docker gateway:sha-<short> remains the deployment/harness artifact; the npm gateway package is valid for the installer global package path.
Behavior
--nextwith no explicit ref:- framework archive from
next; - resolve
@mosaicstack/gateway@nextand@mosaicstack/mosaic@next; - require both resolved versions to share the same
next.<pipeline>suffix; - install the exact resolved package versions;
- set
MOSAIC_GATEWAY_SKIP_NPM_INSTALL=1so wizard does not overwrite the prerelease gateway; - if either package is missing/unreachable/mismatched/fails, fall back to existing source build at
next.
- framework archive from
--devremains pure source build.- explicit
--ref/MOSAIC_REFstill wins over--nextand uses the source path for that exact ref.
Install detail
The installer writes the scoped npmrc mapping (@mosaicstack:registry=...) and then runs npm install without overriding npm's default registry. Passing --registry=<gitea> to npm install forces public transitive dependencies (for example @anthropic-ai/sdk) to resolve from Gitea and breaks the fast path; the scoped npmrc mapping is the correct split-registry behavior.
Verification notes
- Added
tools/install-next-lane.test.shwith a fake npm/source harness for exact-version fast install, registry failure source fallback, explicit-ref precedence, and mismatched suffix warning. - Wired the installer harness into
pnpm testviapnpm run test:installer. - Real temp-prefix fast install succeeded with
@mosaicstack/gateway@0.0.7-next.1633and@mosaicstack/mosaic@0.0.49-next.1633.