@shopware-ag/meteor-component-library

中文文档
5.9.0发布于 2026/11/02MITTypeScriptESM + CJS构建来源已验证

The meteor component library is a Vue component library developed by Shopware. It is based on the Meteor Design System.

原始使用文档
文档目录6 节
  1. Requirements
  2. Installation
  3. Development
  4. Project setup
  5. Writing interaction tests
  6. Writing visual tests

Meteor component library

The meteor component library is a Vue component library developed by Shopware. It is based on the Meteor Design System.

  • Perfect suitable for Shopware Apps
  • Matches the Shopware administration look and feel
  • Small bundle sizes with tree-shaking
  • Tested and previewed with Storybook, documented on meteor.shopware.com

Requirements

You need a working Vue 3 application with the i18n plugin for the translations. The main translations (English and German) are bundled in the components. For other languages you need to add the snippets for the correct paths.

Installation

Add these packages to your project:

npm i @shopware-ag/meteor-component-library vue-i18n

Import the style.css for general styling and font.css for the Inter font in the root file of your application or in you root styling file.

import "@shopware-ag/meteor-component-library/styles.css";
import "@shopware-ag/meteor-component-library/font.css";

Now, configure the i18n plugin for Vue.

const i18n = createI18n({
  legacy: false,
});

app.use(i18n);

Each component works independently and can be imported directly from the root like this:

<script>
  import { MtButton } from "@shopware-ag/meteor-component-library";

  export default {
    components: {
      "mt-button": MtButton,
    },
  };
</script>

Development

These guides are useful if you want to contribute this component library.

Project setup

pnpm install

Compiles and hot-reloads for development

pnpm run storybook

To run Storybook and the documentation site together, use pnpm dev from the repository root instead. See the contribution guidelines for details.

Compiles and minifies for production

pnpm run build:storybook

Run your interaction tests (running Storybook instance is needed)

pnpm run test:storybook

Lints and fixes files

pnpm run lint:all

Build the bundled component library

pnpm run build

Writing interaction tests

All interaction tests are written in component-name.interactive.stories.js files. The title needs to be prefixed with Interaction Tests/. These interaction tests are hidden in the final build but are visible in the Storybook development watcher.

Example:

import meta from "./mt-button.stories";

export default {
  ...meta,
  title: "Interaction Tests/base/mt-button",
  component: MtButton,
};

Writing visual tests

Stories for visual tests need to start with VisualTest.

Example:

export const VisualTestPrimaryVariant = {
  name: "Render the primary variant",
  play: async ({ canvasElement }) => {
    const canvas = within(canvasElement);

    // your interaction test ...
  },
};

The screenshot will be generated at the end of the Play function. If no Play function is defined then it will be created immediately.

For reduced flakiness all animations are automatically disabled from Playwright.

版本与发布记录

@shopware-ag/meteor-component-library 共发布 92 个版本,首次发布于 2022/08/09;过去 12 个月发布了 31 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
5.9.0latest2026/11/021 天前
5.8.02026/10/011 个月前
5.7.12026/08/282 个月前
5.7.02026/08/202 个月前
5.6.22026/08/122 个月前
5.6.12026/08/102 个月前

关于 @shopware-ag/meteor-component-library 的常见问题

@shopware-ag/meteor-component-library 是什么?

meteor组件库是由Shopware开发的一个Vue组件库。它是基于 流星设计系统.

如何安装 @shopware-ag/meteor-component-library?

在项目目录运行 npm install @shopware-ag/meteor-component-library,或使用 pnpm add / yarn add / bun add。

@shopware-ag/meteor-component-library 支持 TypeScript 吗?

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

@shopware-ag/meteor-component-library 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@shopware-ag/meteor-component-library 可以商用吗?

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

@shopware-ag/meteor-component-library 还在维护吗?

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