Skip to content

pantoken / deprecations

deprecations

ベータ

@pantoken/plugin-deprecations — 上流で削除されたトークン向けのライフサイクル対応互換シム。

上流のリリースが --instui-* トークンを削除すると、手作業で作成した DeprecationLedger が そのライフサイクルを記録します:いつ非推奨になったか、どの上流マイナーで削除されるか、そしてその間どうやって動作を保つか — 正準トークンへフォワードするか(replacementvar(...))、あるいは最後に知られているリテラルで固定するか(value)。 このプラグインはエントリごとに一つのシム・トークンを追加します。シムは単一の var(...) またはプレーン値なので、defineToken はその refersTo/構文を記録し、 toCss がそれを出力します。結果として追加の配線なしに css/scss/less/stylus/wordpress/vanilla にシムが流れ込みます。

廃止は別の場所で強制されます(アップグレード・パイプラインは、エントリの removeIn 上流マイナーに到達した時点でバンプを致命的に失敗させ、エントリを廃止して消費側のマイナーを切ることを強制します)。 dueForRemoval がそのチェックを担い、describeLifecycle がドキュメントを支えます。

ts
import { buildTokens } from "@pantoken/core/build";
import { deprecationShims } from "@pantoken/plugin-deprecations";
import ledger from "@pantoken/tokens/deprecations.json" with { type: "json" };

buildTokens({ theme: "rebrand", plugins: [deprecationShims(ledger)] });

インターフェース

関数

参照

default

名前を変更して deprecationShims を再エクスポートします