Skip to content

Commit

Permalink
Merge branch 'main' into migrate-button-over-to-composition-api
Browse files Browse the repository at this point in the history
  • Loading branch information
Haberkamp authored Oct 10, 2024
2 parents 195f77a + 78e08dc commit fef0410
Show file tree
Hide file tree
Showing 89 changed files with 3,752 additions and 797 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@shopware-ag/meteor-component-library": patch
---

Improve a11y of help text
Add translation for mt-banner
5 changes: 0 additions & 5 deletions .changeset/ninety-hairs-reflect.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tender-llamas-sleep.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/violet-books-kick.md

This file was deleted.

114 changes: 114 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,117 @@ jobs:
with:
name: meteor-admin-sdk--playwright-test-results
path: packages/admin-sdk/playwright-report/


tested-versions:
name: tested-versions
runs-on: ubuntu-latest
outputs:
first-version: ${{ steps.versions.outputs.first-version }}
latest-version: ${{ steps.versions.outputs.latest-version }}
lts-first-version: ${{ steps.versions.outputs.lts-first-version }}
lts-latest-version: ${{ steps.versions.outputs.lts-latest-version }}
steps:
- name: Generate versions
id: versions
uses: shopware/github-actions/versions@main

ats:
name: Acceptance tests
timeout-minutes: 20
runs-on: ubuntu-latest
needs:
- circular-dependencies
- unit-tests
- static-analysis
- tested-versions
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TZ: Europe/Berlin
strategy:
fail-fast: false
matrix:
shopware-version:
# TODO: add again with next major, does not work right now because 6.5 does not support vue3
# - ${{ needs.tested-versions.outputs.lts-latest-version }}
- ${{ needs.tested-versions.outputs.first-version }}
- ${{ needs.tested-versions.outputs.latest-version }}
- trunk
steps:
- name: Setup shopware
uses: shopware/setup-shopware@main
with:
path: shopware/
install: "true"
installAdmin: "true"
installStorefront: "true"
shopware-version: "${{ matrix.shopware-version }}"
env: dev

- name: Checkout
uses: actions/checkout@v4
with:
path: meteor/

- name: Symlink plugin
working-directory: shopware/custom/plugins/
run: ln -s ../../../meteor/examples/admin-sdk-plugin TestPlugin

- name: Activate TestPlugin
working-directory: shopware/
run: |
bin/console plugin:refresh
bin/console plugin:install --activate TestPlugin
bin/console cache:clear
- uses: pnpm/action-setup@v3
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"

- name: Install dependencies
working-directory: meteor/
run: pnpm install --frozen-lockfile --prefer-offline

- name: Build packages
working-directory: meteor/
run: npx turbo run build

- name: Build assets
working-directory: shopware/
run: |
composer run build:js
bin/console assets:install
- name: Start webserver
working-directory: shopware/
run: symfony server:start --allow-http --no-tls --port=8000 -d

- name: Install playwright
working-directory: meteor/examples/admin-sdk-plugin/tests/acceptance/
run: |
pnpm install --frozen-lockfile --prefer-offline
npx playwright install --with-deps
- name: Run Playwrigth
working-directory: meteor/examples/admin-sdk-plugin/tests/acceptance/
run: npx playwright test --retries=2 --reporter=github --trace=on-first-retry --project chromium

- uses: actions/upload-artifact@v4
if: always()
with:
name: ats-test-results-${{ matrix.project }}
path: meteor/examples/admin-sdk-plugin/tests/acceptance/test-results/

- uses: actions/upload-artifact@v4
if: always()
with:
name: ats-report-${{ matrix.project }}
path: meteor/examples/admin-sdk-plugin/tests/acceptance/playwright-report/
4 changes: 1 addition & 3 deletions .github/workflows/visual-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: pnpm dlx playwright install-deps

- name: Install Playwright
run: pnpm dlx playwright@1.44.0 install
run: pnpm dlx playwright@1.47.2 install

- name: Build storybook
run: pnpx turbo run build:storybook --filter=@shopware-ag/meteor-component-library -- --test
Expand All @@ -53,8 +53,6 @@ jobs:
"http-server ./packages/component-library/storybook-static -a 127.0.0.1 --port 6006" \
"wait-on http://127.0.0.1:6006 && pnpx turbo run test:storybook --filter=@shopware-ag/meteor-component-library"
# TODO: Check if there are visual diffs and fail the build if there are

- name: Archive visual test diffs
uses: actions/upload-artifact@v4
if: always()
Expand Down
2 changes: 1 addition & 1 deletion docs/admin-sdk/docs/guide/2_api-reference/ui/mainModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ ui.mainModule.hideSmartBar({
#### Parameters
| Name | Required | Default | Description | Available at Shopware |
| :----------- | :------- | :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------|
| `locationId` | true | | The locationId of the module you want to hide the smart bar | v6.6.6.2 |
| `locationId` | true | | The locationId of the module you want to hide the smart bar | v6.6.7.0 |
16 changes: 16 additions & 0 deletions examples/admin-sdk-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# meteor-admin-sdk-app

## 1.0.22

### Patch Changes

- Updated dependencies [cc754b9]
- Updated dependencies [47063ae]
- Updated dependencies [62be382]
- Updated dependencies [28f5cb1]
- Updated dependencies [001adb3]
- Updated dependencies [6d32afa]
- Updated dependencies [936ccf3]
- Updated dependencies [2f0a666]
- Updated dependencies [07e243a]
- @shopware-ag/meteor-component-library@3.14.0
- @shopware-ag/meteor-admin-sdk@5.5.1

## 1.0.21

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/admin-sdk-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meteor-admin-sdk-app",
"version": "1.0.21",
"version": "1.0.22",
"private": true,
"description": "",
"repository": {
Expand Down
25 changes: 25 additions & 0 deletions examples/admin-sdk-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Meteor Admin SDK Example Plugin

This package contains an example plugin. It uses the [Meteor Admin SDK](https://github.com/shopware/meteor/tree/main/packages/admin-sdk) to extend the administration.

## Prerequisites
We assume that you have a functioning Shopware 6 setup on your local machine.

## Plugin setup

1. Install all meteor dependencies: `cd <meteorRoot> && pnpm install`
2. Build all meteor packages: `cd <meteorRoot> && turbo run build`
3. Symlink the plugin to your Shopware 6 installation: `cd <shopwareRoot>/custom/plugins && ln -s <meteorRoot>/examples/admin-sdk-plugin TestPlugin`
4. It's important that the plugin Folder is named `TestPlugin` inside `custom/plugins`
5. Activate the plugin : `cd <shopwareRoot> && php bin/console plugin:refresh && php bin/console plugin:install -a -c TestPlugin`
6. Built the administration Javascript: `cd <shopwareRoot> && composer run build:js:admin`

Now you should see the plugin installed when opening the Shopware Admin and looking in "Extensions" -> "My Extensions".

## Acceptance tests

1. Create a `.env` file in `<meteorRoot>/examples/admin-sdk-plugin/tests/acceptance`
2. Specify your Shopware instance app url: `APP_URL=https://dev.local/`
3. Run the tests: `cd <meteorRoot> && pnpm --filter @shopware-ag/meteor-admin-sdk-example-plugin run test:ats`


18 changes: 18 additions & 0 deletions examples/admin-sdk-plugin/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "swag/sdk-test-plugin",
"description": "Meteor Admin SDK Testplugin",
"type": "shopware-platform-plugin",
"license": "MIT",
"autoload": {
"psr-4": {
"TestPlugin\\": "src/"
}
},
"extra": {
"shopware-plugin-class": "TestPlugin\\TestPlugin",
"label": {
"de-DE": "SDK Testplugin",
"en-GB": "SDK Testplugin"
}
}
}
2 changes: 2 additions & 0 deletions examples/admin-sdk-plugin/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Resources/app/administration/node_modules/
Resources/public
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = () => {
return {
resolve: {
alias: {
vue$: 'vue/dist/vue.esm-browser.js'
}
}
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Test plugin example</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "administration",
"version": "1.0.0",
"private": true,
"description": "",
"license": "MIT",
"author": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@shopware-ag/meteor-admin-sdk": "workspace:*",
"@shopware-ag/meteor-component-library": "workspace:*",
"regenerator-runtime": "^0.14.1",
"vue": "3.4.21",
"vue-router": "4.4.5"
},
"devDependencies": {
"typescript": "^5.6.2"
}
}
Loading

0 comments on commit fef0410

Please sign in to comment.