# @dweber019/backstage-plugin-endoflife 中文文档

规范地址：https://npmcn.com/package/%40dweber019/backstage-plugin-endoflife/

版本：0\.1\.2
npm 元数据更新时间：2025-12-19T07:45:21.760Z
中文译文更新时间：2026-11-13T01:18:09.425Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40dweber019/backstage-plugin-endoflife
原文对照：https://npmcn.com/package/%40dweber019/backstage-plugin-endoflife/?lang=original
项目主页：https://github.com/dweber019/backstage-plugins/tree/main/plugins/endoflife
源码仓库：https://github.com/dweber019/backstage-plugins

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：83.9 kB，30 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- 运行依赖：17 个
- peer 依赖：react ^16\.13\.1 \|\| ^17\.0\.0 \|\| ^18\.0\.0，react-dom ^16\.13\.1 \|\| ^17\.0\.0 \|\| ^18\.0\.0，react-router-dom 6\.0\.0-beta\.0 \|\| ^6\.3\.0
- 首次发布：2024-01-14T12:57:40.123Z
- 最新版本发布：2025-12-19T07:45:21.568Z
- 近 30 天下载量：7242（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：24（近 12 个月 1 个）

## 中文简介

欢迎来到生命结束插件!

## 安装

```sh
npm install @dweber019/backstage-plugin-endoflife
```

也可以使用：`pnpm add @dweber019/backstage-plugin-endoflife`、`yarn add @dweber019/backstage-plugin-endoflife`、`bun add @dweber019/backstage-plugin-endoflife`

## README

# 寿命结束插件

欢迎来到生命结束插件!

此插件将显示来自 [寿终正寝](https://endoflife.date/) 或由URL或集成提供自己的数据.

![OpenShift](https://raw.githubusercontent.com/dweber019/backstage-plugins/main/plugins/endoflife/docs/example-open-shift.png) ![Python](https://raw.githubusercontent.com/dweber019/backstage-plugins/main/plugins/endoflife/docs/example-python.png)

## 设置

安装此插件 :

```bash
# From your Backstage root directory
yarn --cwd packages/app add @dweber019/backstage-plugin-endoflife
```

### 说明

你可以使用注释 `endoflife.date/products` 定义在 [寿终正寝](https://endoflife.date/)。 。 。 .  
在 [url 地址( 如角)](https://endoflife.date/angular) 你的注释.

```yaml
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: eol-angular
  annotations:
    endoflife.date/products: angular
```

甚至可以使用多个带有逗号分离列表的产品.

```yaml
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: eol-angular-nginx-app
  annotations:
    endoflife.date/products: angular,nginx
```

此外,您可以通过使用 [发布栏](https://endoflife.date/angular) (在API称为循环).

```yaml
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: eol-angular-nignx-version-app
  annotations:
    endoflife.date/products: angular@17,nginx@1.25
```

除了从 [寿终正寝](https://endoflife.date/) 您可以从 URL 中装入信息 或您的仓库,通过提供说明 `endoflife.date/url-location` 或者说 `endoflife.date/source-location` 财务报告和审定财务报表 使用类型 `EndOfLifeCycle` 时间 `plugins/endoflife/src/api/types.ts`。 。 。 .

```yaml
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: angular-app
  annotations:
    endoflife.date/url-location: https://gist.githubusercontent.com/dweber019/.../raw/.../versions.json
```

```yaml
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: 'angular-app'
  annotations:
    endoflife.date/source-location: /versions.json
```

> 这个 `endoflife.date/source-location` 必须是相对于您的源寄存器

> 用来使用 `endoflife.date/source-location`,您需要安装 [后端插件](https://npmcn.com/package/%40dweber019/endoflife-backend)

> 说明不能合并 顺序是 `endoflife.date/products`, (中文(简体) ), `endoflife.date/url-location`, (中文(简体) ), `endoflife.date/source-location`

### 实体页

添加数据 `EntityEndOfLifeCard` 到实体页.

你可以直接用在这样的组件上

```tsx
// packages/app/src/components/catalog/EntityPage.tsx

import {
  EntityEndOfLifeCard,
  isEndOfLifeAvailable,
} from '@dweber019/backstage-plugin-endoflife';

const overviewContent = (
  <Grid container spacing={3} alignItems="stretch">
    {entityWarningContent}
    ...
    <EntitySwitch>
      <EntitySwitch.Case if={isEndOfLifeAvailable}>
        <Grid item md={6}>
          <EntityEndOfLifeCard />
        </Grid>
      </EntitySwitch.Case>
    </EntitySwitch>
    ...
  </Grid>
);
```

或者,如果你有资源 代表诸如数据库或角技术, 你可以使用

```tsx
// packages/app/src/components/catalog/EntityPage.tsx

import {
  EntityEndOfLifeCard,
  isEndOfLifeAvailable,
} from '@dweber019/backstage-plugin-endoflife';

const resourcePage = (
  <EntityLayoutWrapper>
    <EntityLayout.Route path="/" title="Overview">
      <Grid container spacing={3} alignItems="stretch">
        {entityWarningContent}
        ...
        <EntitySwitch>
          <EntitySwitch.Case if={isEndOfLifeAvailable}>
            <Grid item md={6}>
              <EntityEndOfLifeCard variant="gridItem" />
            </Grid>
          </EntitySwitch.Case>
        </EntitySwitch>
      </Grid>
    </EntityLayout.Route>
    ...
  </EntityLayoutWrapper>
);
```

如果您有 API 实体, 您可以使用注释 `endoflife.date/source-location` 使版本生命周期对消费者可见.

### 帮助文本

您可以使用以下配置自定义右上角的帮助文本 `app-config.yaml`

```yaml
endOfLife:
  helpText: |
    # Custom help text

    You can use markdown if you like
```

### 基本乌尔尔

如果您是本地的“ 生命终结” 实例, 请在您所在的 `app-config.yaml`

```yaml
endOfLife:
  baseUrl: https://endoflife.mycompany.com
```

## 解决问题

### 行为“ 报废. 日期/ 产品” : 角

使用这一注释将会导致呼吁 [获取所有细节](https://endoflife.date/docs/api)。 。 。 .

### 行为“ 报废. 日期/ 产品” : angular@ 17

使用这一注释将会导致呼吁 [单一周期详情](https://endoflife.date/docs/api)。 。 。 .

### 行为“ 报废. 日期/ 产品” : angular@ 17,nginx

使用此注释会给上述相应行为带来多次呼叫,这取决于该版本是否定义.

### 数据错误或缺失

所有数据来自 [寿终正寝](https://endoflife.date/) 也可能是错的或失踪的.  
请改正 [捐款](https://endoflife.date/contribute) 回到社区.

## 地方发展

有本地设置 `plugins/endoflife/dev` 可以从 `yarn --cwd plugins/endoflife start` 从根起.

## 常见问题

### @dweber019/backstage-plugin-endoflife 是什么？

欢迎来到生命结束插件\!

### 如何安装 @dweber019/backstage-plugin-endoflife？

在项目目录运行 npm install @dweber019/backstage-plugin-endoflife，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（^16\.13\.1 \|\| ^17\.0\.0 \|\| ^18\.0\.0）、react-dom（^16\.13\.1 \|\| ^17\.0\.0 \|\| ^18\.0\.0）、react-router-dom（6\.0\.0-beta\.0 \|\| ^6\.3\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @dweber019/backstage-plugin-endoflife 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @dweber019/backstage-plugin-endoflife 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @dweber019/backstage-plugin-endoflife 可以商用吗？

@dweber019/backstage-plugin-endoflife 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @dweber019/backstage-plugin-endoflife 的下载量有多少？

根据 npm 官方下载统计，@dweber019/backstage-plugin-endoflife 在 2026/10/13 – 2026/11/11 这 30 天内被下载 7,242 次，日均约 241 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @dweber019/backstage-plugin-endoflife 还在维护吗？

最新版本 0\.1\.2 发布于 2025/12/19（10 个月前）；至今共发布 24 个版本，其中过去 12 个月发布了 1 个；首次发布于 2024/01/14。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

