@yuebai008/cli
Version:
Command line interface for rapid qg-minigame development
1 lines • 1.94 kB
JavaScript
import*as i18n from"../../core/i18n/i18n.js";import*as Deprecation from"../../generated/Deprecation.js";import{Issue,IssueCategory,IssueKind}from"./Issue.js";import{resolveLazyDescription}from"./MarkdownIssueDescription.js";const UIStrings={feature:"Check the feature status page for more details.",milestone:"This change will go into effect with milestone {milestone}.",title:"Deprecated Feature Used"},str_=i18n.i18n.registerUIStrings("models/issues_manager/DeprecationIssue.ts",UIStrings),i18nLazyString=i18n.i18n.getLazilyComputedLocalizedString.bind(void 0,str_),strDeprecation=i18n.i18n.registerUIStrings("generated/Deprecation.ts",Deprecation.UIStrings),i18nLazyDeprecationString=i18n.i18n.getLazilyComputedLocalizedString.bind(void 0,strDeprecation);export class DeprecationIssue extends Issue{#e;constructor(e,t){super({code:["DeprecationIssue",e.type].join("::"),umaCode:"DeprecationIssue"},t),this.#e=e}getCategory(){return IssueCategory.Other}details(){return this.#e}getDescription(){let e=()=>"";const t=Deprecation.UIStrings[this.#e.type];t&&(e=i18nLazyDeprecationString(t));const s=[],i=Deprecation.DEPRECATIONS_METADATA[this.#e.type],r=i?.chromeStatusFeature??0;0!==r&&s.push({link:`https://chromestatus.com/feature/${r}`,linkTitle:i18nLazyString(UIStrings.feature)});const n=i?.milestone??0;return 0!==n&&s.push({link:"https://chromiumdash.appspot.com/schedule",linkTitle:i18nLazyString(UIStrings.milestone,{milestone:n})}),resolveLazyDescription({file:"deprecation.md",substitutions:new Map([["PLACEHOLDER_title",i18nLazyString(UIStrings.title)],["PLACEHOLDER_message",e]]),links:s})}sources(){return this.#e.sourceCodeLocation?[this.#e.sourceCodeLocation]:[]}primaryKey(){return JSON.stringify(this.#e)}getKind(){return IssueKind.BreakingChange}static fromInspectorIssue(e,t){const s=t.details.deprecationIssueDetails;return s?[new DeprecationIssue(s,e)]:(console.warn("Deprecation issue without details received."),[])}}