Home›Industry & Policy›npmのステージ済みパッケージを一括承認でリリース可能に

npmのステージ済みパッケージを一括承認でリリース可能にnpm batch approval releases for staged packages

元記事を読むRead original articleblog.github.com(新しいタブで開きます)(opens in a new tab)
AI 要約AI summary

npmのStaged Publishing Plansで、複数パッケージのステージ済みバージョンを1つのバッチにまとめ、2FA承認1回で同時公開できるようになりました。モノレポの一斉リリースで、公開途中に依存関係が崩れる事態を防げます。

npm Staged Publishing Plans now group staged versions from several packages into one batch, released with a single 2FA approval. Monorepo maintainers avoid per-package prompts and half-published states that break installs.

AI 生成の要約と解説(解説は要約と収集メタデータに基づく)で、元記事全文の転載・翻訳ではありません。日本語版と英語版は言語ごとに独立して生成しています。正確性は元記事 (blog.github.com) でご確認ください。AI-generated summary and explainer (the latter based on the summaries and collected metadata), not a copy or translation of the full source article. Generated independently for each language. Verify accuracy at the original source (blog.github.com).

一括承認の仕組み

npmのStaged Publishing Plansにより、パッケージのメンテナーは複数のステージ済みバージョンを1つのグループ(バッチ)にまとめ、二要素認証(2FA)の承認1回でまとめてリリースできるようになった。複数パッケージを持つモノレポの一斉リリースで、承認の手間と公開途中の不整合を減らす機能と位置づけられる。

バッチにまとめられるのは、1パッケージにつき最大1バージョンまでである。複数のパッケージから集めたステージ済みバージョンを、ひとまとまりのリリースとして扱う形になる。

従来の2FAチャレンジ

これまでのステージ公開では、リリースのたびに2FAチャレンジが発行されていた。そのため多数のパッケージを同時に出す場合は、パッケージとバージョンの数だけ承認を繰り返す必要があった。

この方式にはもう一つ問題があったと説明されている。承認と公開をひとつずつ進めると、一部のパッケージはすでに公開されているのに、それに依存する同じリポジトリ内のパッケージはまだ公開されていない、という時間帯が生じる。この状態ではリリースの途中でインストールが壊れる可能性があった。

承認の対象範囲

Publishing Plansでは、モノレポの複数パッケージのリリースに必要な承認は1回になる。この承認は、承認の時点で画面に示されているパッケージとバージョンの組み合わせそのものに結び付けられる。

バッチ全体を単一のリリースとして調整できるため、パッケージごとに承認を重ねる運用から、まとまった単位で承認して公開する運用に変わる。依存関係のあるパッケージを順番に出すことで生じていた、公開が中途半端な状態も避けやすくなる。

Staged Publishing Plans

npm's Staged Publishing Plans let package maintainers bundle several staged versions into one grouped batch and release them together. This matters for monorepo maintainers, who previously had to approve each package and version on its own when releasing many packages at once.

According to the announcement, a batch can include up to one version per package. The whole group is then released under a single two-factor authentication (2FA) approval, so coordinating a large release no longer means working through a long series of separate approvals.

One Approval for the Batch

Before this change, staged publishing issued a 2FA challenge for each release. A multi-package monorepo release therefore meant one challenge per package and version. With Publishing Plans, the same release needs just one approval.

The announcement says that approval is bound to the exact set of packages and versions shown at the time of approval. In other words, the maintainer approves a specific, visible list, and that approval applies to that list.

Avoiding Half-Published Releases

The source also describes a second problem with the earlier per-release approach. Because each package was approved separately, there was a window in which some packages had been published while their dependent siblings had not. According to the announcement, that gap could break installs in the middle of a release.

Publishing Plans addresses this by treating the entire batch as a single release. Rather than packages going live one at a time as each challenge is answered, the group is coordinated and released together. The announcement presents this as the way to avoid the mid-release state in which dependencies and their dependents are out of step.

What Changes for Maintainers

In practice, the announcement describes two benefits for monorepo maintainers. First, they avoid the repeated per-package 2FA prompts that came with releasing many packages. Second, they avoid the partially published state that can leave installs broken until the remaining packages are approved.

The core idea is grouping: staged versions from several packages are collected into one batch, reviewed as a set, and released with a single 2FA approval.

ポコとTECHガイドPoko & TECH Guide

ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.

  1. ポコPokoモノレポでパッケージをたくさん出すとき、普段の作業は何が変わるの?When I release lots of packages from a monorepo, what actually changes in my day-to-day?
  2. TECHガイドTECH Guideステージ済みの複数バージョンを1つのバッチにまとめて、2FA承認1回でまとめてリリースできるよ。承認時に見えている組み合わせに紐づくんだ。You can bundle staged versions into one batch and release them together with a single 2FA approval. That approval is tied to the exact packages and versions shown.
  3. ポコPoko前は、パッケージごとに承認が必要だったの?So before this, did you have to approve each package one by one?
  4. TECHガイドTECH Guideこの記事だと、以前は1リリースごとに2FAが必要で、数が多いと承認も増えたよ。一部だけ公開済みの間にインストールが壊れる可能性もあったみたい。Per the post, yes: each release triggered its own 2FA challenge. Also, some packages could go live before their dependents, which could break installs mid-release.
  5. ポコPokoじゃあ一番の収穫は、承認が1回で済むことと、公開途中の中途半端な状態を避けられることだね。So the big win is one approval, plus avoiding that half-published state in the middle of a release. Right?
  6. TECHガイドTECH Guideそうだね。次は、1パッケージにつき1バージョンまでという条件が、自分たちの運用に合うか見ておくといいかも。Right. Next, check whether the limit of one version per package fits how your team releases.
記事情報・収集記録Article details & collection record
出典Source
GitHub Changelog公式Official
公開日時 (JST)Published (JST)
収集日時 (JST)Collected (JST)
配信形式Format
変更履歴Changelog
原文言語Source language
英語English
重要度の位置づけImportance in this lane
MediumMedium priority(Industry & Policy 476件中、同等以上 425件)(425 of 476 Industry & Policy entries are equal or higher)
出典の平均重要度(掲載直近 30 件・最大 30 件)Source average (last 30 listed, up to 30)
2.0 / 31=情報 · 2=中 · 3=高1=Info · 2=Medium · 3=High
情報の寿命Half-life
短命 (ニュース)Short-lived (news)

📰Industry & Policy の他の記事More from Industry & Policyもっと見る →View more →

ページ上部へScroll to top