@equinor/amplify-component-lib

中文文档
16.0.3发布于 2026/11/06ISCTypeScriptES Module构建来源已验证近 30 天下载 2万

Frontend Typescript components for the Amplify team

原始使用文档
文档目录6 节
  1. Notes
  2. Download and install pre-commit
  3. Add config file, .pre-commit-config.yaml
  4. Install hooks
  5. Dockerfile linting
  6. Install
intro-logo

SCM Compliance

Amplify Component Library (ACL) contains components, utils, providers and hooks developed and used by the Amplify team.

This package is first and foremost for our own Amplify applications. You can use them outside of Amplify if you want, but we will not be supporting any needs that don't align with our own Amplify applications. If you have an issue or find any bugs, create an issue in Github as we don't accept PRs from contributors outside of the Amplify team.

Quick links

Building amplify-component-lib

Build and publish is done automatically when code is merged into main branch, if the package.json version number is higher.

Using config files from amplify-component-lib

  1. Navigate to your projects root folder, ~/Projects/recap for instance

  2. Copy and run the following command

wget -q -O - https://raw.githubusercontent.com/equinor/amplify-component-lib/main/config/install.sh | bash

This should have downloaded the different config files to your project root folder.

If you want to ignore certain configuration files you can create a .acl-ignore file in the client folder in your project.

For example: acquire/client/.acl-ignore

eslint.config.mjs
CODEOWNERS
pull_request.yaml

Using github action workflows related to deploying from github from amplify-component-lib

  1. Navigate to your projects root folder, ~/Projects/recap for instance

  2. Copy and run the following command

wget -q -O - https://raw.githubusercontent.com/equinor/amplify-component-lib/main/config/install-deployment-files.sh | bash

This should have downloaded the build_deploy_radix.yaml, promote.yaml, notify.yaml, push.yaml

NOTE: These files should eventually be served from the same install script we use for getting other config files. We serve it from a different script so that applications which are not ready for the change in deployment process don't have to rush.

Notes

This script assumes the following structure in the project

project
│   README.md
│
└───client
│   |   ...
│
└───server
    │   ...

Using pre-commit

Download and install pre-commit

Using python's pip to download pre-commit

pip install pre-commit

Using brew to download pre-commit

brew install pre-commit

finally install pre-commit

pre-commit

Add config file, .pre-commit-config.yaml

Your .pre-commit-config.yaml file should look something like below

repos:
  - repo: local
    hooks:
      - id: hadolint
        name: Lint Dockerfiles
        description: Runs hadolint to lint Dockerfiles
        language: system
        types: ['dockerfile']
        entry: hadolint
      - id: trufflehog
        name: TruffleHog
        description: Detect secrets in your data with TruffleHog.
        entry: trufflehog git file://. --since-commit HEAD --only-verified --fail
        language: golang
        pass_filenames: false
      - id: prettier
        name: Prettier
        description: Runs prettier on supported files
        language: system
        entry: 'npx prettier --check'
        files: .*\.jsx?$|.*\.tsx?$|.*\.ts?$
  - repo: https://github.com/pre-commit/mirrors-eslint
    rev: v9.9.0
    hooks:
      - id: eslint
        files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
        types: [file]
        additional_dependencies:
          - [email protected]
          - [email protected]
          - [email protected]
          - [email protected]
          - [email protected]
          - [email protected]

Install hooks

When you have your config file in place you need to install the hooks

pre-commit install

Dockerfile linting

We use hadolint to check that our docker file is using best practice.

Install

In order to commit changes related to a dockerfile you need to have hadolint installed

CLI

On OSX you can use brew to install:

brew install hadolint

On Windows you can use scoop to install:

scoop install hadolint

In any of these do not work then you can refer to the installation section in hadolint's repository

VS Code

If you want to shorten the feedback loop when changing your dockerfile you can optionally add the hadolint extension (Extension id: exiasr.hadolint)

WebStorm

Looks like it is not available for WebStorm at the moment

Latest version

main

版本与发布记录

@equinor/amplify-component-lib 共发布 187 个版本,首次发布于 2024/07/12;过去 12 个月发布了 52 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
16.0.3latest2026/11/067 天前
16.0.22026/11/067 天前
16.0.12026/11/0310 天前
16.0.02026/11/0211 天前
15.0.1-alpha.0alpha2026/11/0211 天前
15.0.02026/10/1628 天前

其他发布通道:beta → 13.2.5-beta.1,alpha → 15.0.1-alpha.0。

关于 @equinor/amplify-component-lib 的常见问题

@equinor/amplify-component-lib 是什么?

Frontend Typescript components for the Amplify team

如何安装 @equinor/amplify-component-lib?

在项目目录运行 npm install @equinor/amplify-component-lib,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:proj4(^2.15.0)、react(^19.2.8)、lodash(^4.17.21)、motion(^12.38.0)、lowlight(^3.3.0)、react-dom(^19.2.8)、@tiptap/pm(^3.1.0)、jwt-decode(^4.0.0)、rehype-raw(^7.0.0)、html2canvas(^1.4.1)、@tiptap/core(^3.1.0)、@tiptap/react(^3.1.0)、react-dropzone(^14.3.8)、react-markdown(^10.1.0)、styled-components(^6.1.15)、@equinor/eds-icons(*)、@tiptap/extensions(^3.1.0)、@tiptap/suggestion(^3.1.0)、@tanstack/react-query(*)、@tanstack/react-router(*)、@tiptap/extension-bold(^3.1.0)、@tiptap/extension-link(^3.1.0)、@tiptap/extension-list(^3.1.0)、@tiptap/extension-text(^3.1.0)、@equinor/eds-core-react(0.44.0)、@tiptap/extension-color(^3.1.0)、@tiptap/extension-image(^3.1.0)、@tiptap/extension-table(^3.1.0)、@tiptap/extension-italic(^3.1.0)、@tiptap/extension-heading(^3.1.0)、@tiptap/extension-mention(^3.1.0)、@tiptap/extension-document(^3.1.0)、@tiptap/extension-gapcursor(^3.1.0)、@tiptap/extension-highlight(^3.1.0)、@tiptap/extension-paragraph(^3.1.0)、@equinor/eds-data-grid-react(^0.7.5)、@tiptap/extension-code-block(^3.1.0)、@tiptap/extension-hard-break(^3.1.0)、@tiptap/extension-text-align(^3.1.0)、@tiptap/extension-text-style(^3.1.0)、@tiptap/extension-typography(^3.1.0)、@equinor/subsurface-app-management(^5.6.1)、@tiptap/extension-code-block-lowlight(^3.1.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@equinor/amplify-component-lib 支持 TypeScript 吗?

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

@equinor/amplify-component-lib 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@equinor/amplify-component-lib 可以商用吗?

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

@equinor/amplify-component-lib 的下载量有多少?

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

@equinor/amplify-component-lib 还在维护吗?

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