⚠️ This repository is considered deprecated and will be archived in March 2024. For the new version of this tool please go to meteor our new monorepo. In there you find all Meteor related projects like the Meteor Icon Kit, Meteor Components, etc.
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
- Completely tested and documented with Storybook
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.
Add this package to your project:
npm i @shopware-ag/meteor-component-library
Import the style.css
for general styling like fonts, etc. in the root file of your application or in you root styling file.
import "@shopware-ag/meteor-component-library/dist/style.css";
Each component works independently and can be imported directly from the root like this:
<script>
import { SwButton } from "@shopware-ag/meteor-component-library";
export default {
components: {
"sw-button": SwButton,
},
};
</script>
These guides are useful if you want to contribute this component library.
npm install
npm run storybook
npm run build-storybook
npm run test-storybook
Useful for creating screenshot files to have a consistent screenshot between different operating systems.
npm run docker;
// Inside docker
npm run test-storybook:ci
npm run lint
npm run build-vue
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 "./sw-button.stories";
export default {
...meta,
title: "Interaction Tests/base/sw-button",
component: SwButton,
};
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 immediatly.
For reduced flakiness all animations are automatically disabled from Playwright.