@equinor/echo-base

中文文档
7.0.0发布于 2026/10/27MITTypeScriptCommonJS近 30 天下载 2698

logo

原始使用文档
文档目录3 节
  1. ⚠️ Dependency Rules
  2. How to develop and release EchoCore
  3. Available NPM scripts

logo

echo-base

Everything a Echo web need for enabling micro frontend development.

This library was generated with Nx.

⚠️ Dependency Rules

Source of truth: /eslint.config.js - The @nx/enforce-module-boundaries rule defines all allowed dependencies.

echo-base is the foundation library and CANNOT import from any other echo library.

See libs/README.md for the full dependency flow diagram.


How to develop and release EchoCore

Check the readme in the NX libraries folder.

Available NPM scripts

  • lint-base
  • build-base
  • test-base

What's new

v0.7.0:

  • Moved to Monorepo
  • Updated some Typescript Types: they caused build errors with the Monorepo setup

v0.6.0:

  • Fixed error reporting to application insights, it now properly reports all properties including innerErrorsProperties.
  • Fixed baseError, it now properly supports nested innerErrors. Exception/inner Error used to overwrite each others property if they had the same name.
  • BaseError now has errorTraceId, either from backEnd, or a unique frontEnd id
  • BaseError helper methods added for getting properties or propertyByName

It's recommended to create your own error types, extending BaseError, and decorate it with your own fields:

    export class PdfError extends BaseError {
        docNo: string;
        constructor(args: { message: string; docNo: string; innerError?: Error }) {
            super({ name: 'PdfError', message: args.message, innerError: args.innerError });
            this.docNo = args.docNo;
        }
    }

Breaking Changes

v0.6.0:

  • Renamed initializeError to initializeNetworkError and simplified it. It now only takes NetworkErrorArgs as argument.
  • BaseError now properly support nested (and nested-nested) errors with argument innerError.
    Earlier properties with the same name would overwrite each other.
    exception argument renamed to innerError, of type Record<string, unknown> | Error
  • BaseError doesn't add properties directly onto itself anymore, but uses nested errors with argument innerError.
  • Instead of BaseError.allProperties()["someCustomProperty"] use BaseError.findPropertyByName("someCustomProperty"). Since we now use innerError of type Error or Record<string, unknown>, the property has been moved from baseError[property] to baseError.innerError[property].
  • Moved EchoEvents enum to EchoCore.
  • Changed types for EventHub event keys in all functions from string | EchoEvents to string only.

v0.5.0:

  • SubClasses of BaseError will not get the name of the class automatically anymore, but have to specify it. This to avoid name obfuscation/minify to a single letter in appInsight.

Example implementation:

export class CustomError extends BaseError {
    constructor(args: ErrorArgs) {
        super({ ...args, name: 'CustomError' });
    }
}

版本与发布记录

@equinor/echo-base 共发布 126 个版本,首次发布于 2021/04/12;过去 12 个月发布了 33 个版本。

版本发布日期距今
7.0.0latest2026/10/2717 天前
7.0.0-beta-2beta2026/10/2717 天前
7.0.0-beta-12026/10/2222 天前
7.0.0-beta-02026/10/2024 天前
6.3.12026/08/073 个月前
6.3.02026/07/233 个月前

其他发布通道:next → 0.6.13-rc1,beta → 7.0.0-beta-2。

关于 @equinor/echo-base 的常见问题

如何安装 @equinor/echo-base?

在项目目录运行 npm install @equinor/echo-base,或使用 pnpm add / yarn add / bun add。

@equinor/echo-base 支持 TypeScript 吗?

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

@equinor/echo-base 支持 ESM 还是 CommonJS?

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

@equinor/echo-base 可以商用吗?

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

@equinor/echo-base 的下载量有多少?

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

@equinor/echo-base 还在维护吗?

最新版本 7.0.0 发布于 2026/10/27(17 天前);至今共发布 126 个版本,其中过去 12 个月发布了 33 个;首次发布于 2021/04/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。