Aller au contenu principal
BlueForge
Commencer gratuitement

Agent pack

Publishing packages from blueforge-org

The publish path for fleet packages — what runs, what to check, nothing published by accident.

Rendered from docs/agent-pack/publishing.mdrelease v0.2.0Edit on forge-git

Verified 2026-10-11 by reading origin/main of blueforge-org at b0648e0b (2026-10-10). Nothing was published or dispatched. Registry: https://api.packr.blueforge.studio, scope @blueforge-studio/*. Tokens: see tokens.md. Newest authoritative doc: blueforge-org/docs/packages/PUBLISHING.md (2026-09-12), stale in places (below); HANDOVER.md (2026-09-29) is newest on gotchas.

Scope: this covers packages that live in blueforge-org. Packages in other repos publish through their own pipeline: e.g. @blueforge-studio/flags lives in forge-control and goes through forge-control's .gitea/workflows/publish.yml (the change adding it is forge-git PR #1977, reportedly unmerged, unverified by me). Before publishing from any repo, check which workflow owns it.

The normal path: bump the version, merge

  1. Edit package.json#version by hand (no changesets). Package needs publishConfig.registry = the packr URL and files: ["dist"]; dist/ is gitignored.
  2. Merge to main. .gitea/workflows/publish-changed.yml runs on a push touching packages/** (concurrency group publish-packr, 30 min timeout).
  3. It finds changed packages (diff against the last publish/* tag), adds their dependents, sorts topologically on dependencies + peerDependencies, and for each package: builds its prebuildDeps first, checks pnpm view name@ver, builds, tests, packs and validates exports, then pnpm publish <tgz> --access public --no-git-checks --registry ….
  4. Effective gate = the version bump. A changed package whose version is already on packr returns already-published (skipped), so only bumped packages ship. A 409 counts as already-published.
  5. Secrets (names only): PACKR_TOKEN (read), PACKR_TOKEN_PUBLISH (read + publish). A missing publish secret fails preflight. An expired token gives 401: a human mints a new one (see tokens.md).

Outcomes: already-published-broken (version on packr but exported files missing) exits non-zero with no tag; the fix is a version bump. A failed package makes its dependents skip. The publish/batch-<date>-<epoch> tag is cut only when nothing failed, but already-published counts as published, so a tag can be cut when nothing new shipped.

Manual path

  • There is no release-package workflow on forge-git. release-package is only a script (scripts/release-package.ts) called per package by publish-changed.ts. .github/workflows/publish-manual.yml has a per-package input but GitHub Actions is off for the org, so it never runs. (An unmerged branch feat/package-release-scripts adds release scripts; whether it adds a dispatch workflow is UNVERIFIED.)
  • Dispatch the real workflow: fgit ci dispatch blueforge-studio/blueforge-org publish-changed.yml --ref main --input dry_run=true, then again with --input publish_all=true or no inputs. Pass the filename. There is no per-package input: it publishes everything changed since the last tag. Needed for lockfile-only changes, which do not trigger it (it fires only on packages/**).
  • One package locally: pnpm exec tsx scripts/release-package.ts --package <name|dir> [--dry-run]. Needs the publish token, which only the operator supplies.
  • Never pnpm publish by hand from a checkout without dist: that shipped sidecar-schemas@0.4.1 broken.
  • Agents do not mint tokens or run a real publish unless the operator says so; do the dry run, then hand the token step to the operator.

Gotchas

  • Dependency not built: publish-changed.ts now builds <dep>... for every prebuildDeps first. Cause was a node16 dist resolution failure (TS2307) when a dependency's dist is absent (vision-gateway@0.7.1, marketing-kit@0.6.1).
  • Stale-dist phantom failures (green alone, red in the suite): pnpm -r --filter './packages/**' --no-bail --workspace-concurrency=1 build || true once per worktree; --no-bail goes before build.
  • pnpm overrides live in pnpm-workspace.yaml (pnpm 10 ignores the pnpm field in package.json here). In consuming repos that run pnpm 9.15 and 11 they must be declared in both places.
  • *.json gitignore was narrowed 2026-09-29; HANDOVER.md:44,57 still describe the old blanket rule. New packages can 401 on first publish (unverified, from a peer's memory).
  • Queueing: the only mechanism in source is the single publish-packr concurrency group (cancel-in-progress: false). A queued publish is not a failure: check, don't re-dispatch.
  • UNVERIFIED: the cache-save ETIMEDOUT false failure, and whether test jobs are required PR checks (ci/gitea-pr-gate branch exists). Treat blueforge-org as force-merge (no required PR gate) until told otherwise.
  • fgit ci logs is reported broken in HANDOVER.md:73; use fgit ci why / jobs.

Verify: a merged PR is not a published version

pnpm view @blueforge-studio/<pkg> versions --registry https://api.packr.blueforge.studio (and dist-tags.latest). The script verifies a tarball with npm pack <spec> --pack-destination <tmp> + tar -tzf. Also fgit ci runs blueforge-studio/blueforge-org. A successful full batch cuts a publish/batch-* tag.

Consumers: bumping a pin

Edit the range in the consumer's package.json, pnpm install (needs a packr token in .npmrc; PACKR_TOKEN in deploy environments), commit lockfile too. Pin first: sidecar schemas are .strict(), so a new key fails any repo pinned below the version that added it. Order: publish the schema, bump every consumer's pin, then write the new field. Confirm the version is on packr before bumping.

Stale text to ignore

  • PUBLISHING.md:113-118,185-188 say publish-changed.ts rewrites workspace:*; no rewrite was found (pnpm handles it). :133 says tea actions run: use fgit ci dispatch. :46,251 say fgit token create (UNVERIFIED); claude/TOKENS.md:36 says packr admin tokens create. The troubleshooting table omits already-published-broken.
  • claude/CLIS.md:96 cites a "Publish pipeline" section that does not exist (real one: CLAUDE.md "Package Registry (packr)", ~168-178). :40 has the wrong host (packr-registry.blueforge.studio; real is api.packr.blueforge.studio). claude/TOKENS.md:30-51 says both active tokens are 401: current token state not verified.

Restez informé

Notes de version et accès anticipé

Un e-mail à chaque nouveauté : fonctionnalités de la plateforme, nouvelles applications et invitations de lancement. Inscrivez-vous sur la liste d'attente pour accéder en avant-première à l'inscription en libre-service et aux sites de promotion.

Pas de spam. Désabonnement en un clic.