Skip to content

pantoken / deprecations

deprecations

베타

@pantoken/plugin-deprecations — 드롭된 업스트림 토큰을 위한 라이프사이클 인식 호환성 shim.

업스트림 릴리스가 --instui-* 토큰을 제거할 때, 수작업으로 작성된 DeprecationLedger이 그 라이프사이클을 기록한다: 언제 더 이상 권장되지 않았는지, 제거될 업스트림 마이너 릴리스, 그리고 그 사이에 어떻게 계속 작동시킬지 — 정식 토큰으로 전달하는 방법(replacementvar(...)) 또는 마지막으로 알려진 리터럴을 고정하는 방법(value) 중 하나다. 이 플러그인은 각 항목마다 하나의 shim 토큰을 추가한다. shim이 단일 var(...)이거나 일반 값이기 때문에, defineToken은 그 refersTo/구문을 기록하고 toCss은 이를 출력하므로, shim은 추가 연결 없이 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를 재내보냄