-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add full vitepress documentation page (#69)
* Write UPGRADE guide * Rewrote upgrade guide * Add simple vitepress project * Configure colors * Finish first draft of "Getting started" * Add first draft of installation chapter * Add first draft of supported versions * Add first draft of upgrade guide * Add first draft of first fixture page, add uuid command * Add first draft of the "Dependencies & Prioritization" page * Add first draft of grouping chapter * Add first draft of "Available commands" page * Add first draft of "Fixture Helper" page * Add first draft of "PHPUnit & Tests" chapter * Add first draft of "Utility methods" page * Add first draft of "media helper" page * Add first draft of category helpers page * Add first draft of sales channel helper page * Add first draft of salutation page * Add first draft of cms page * Add first drafts for payment- and shipping method pages * Add first draft of "Language & Locale" helpers * Add first drafts of currency and tax page * Finish first draft of all helper pages * Finish examples * Rewrote a lot of pages * finalized all links * Add first try at deployment * Fix wrong variable * Fix base path * Only run on main branch
- Loading branch information
Showing
42 changed files
with
1,719 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy documentation | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: pages | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- name: Setup pages | ||
uses: actions/configure-pages@v4 | ||
- name: Install dependencies | ||
run: bun install | ||
- name: Build vitepress | ||
run: bun run docs:build | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: docs/.vitepress/dist | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to Github Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,46 +5,43 @@ | |
namespace Basecom\FixturePlugin; | ||
|
||
use Shopware\Core\Framework\Context; | ||
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface; | ||
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository; | ||
|
||
class CustomerFixture extends Fixture | ||
{ | ||
private const CUSTOMER_ID = '0d8eefdd6d32456385580e2ff42431b9'; | ||
private const ADDRESS_ID = 'e27dc2b4e85f4a0f9a912a09f07701b0'; | ||
|
||
private FixtureHelper $helper; | ||
private EntityRepositoryInterface $customerRepository; | ||
|
||
public function __construct(FixtureHelper $helper, EntityRepositoryInterface $customerRepository) | ||
{ | ||
$this->helper = $helper; | ||
$this->customerRepository = $customerRepository; | ||
public function __construct( | ||
private readonly EntityRepository $customerRepository | ||
) { | ||
} | ||
|
||
public function load(FixtureBag $bag): void | ||
public function load(): void | ||
{ | ||
$salesChannel = $this->helper->SalesChannel()->getStorefrontSalesChannel(); | ||
$this->helper->ensureNotEmpty($salesChannel); | ||
|
||
$this->customerRepository->upsert([[ | ||
'id' => self::CUSTOMER_ID, | ||
'salesChannelId' => $salesChannel->getId(), | ||
'groupId' => $salesChannel->getCustomerGroupId(), | ||
'defaultPaymentMethodId' => $this->helper->PaymentMethod()->getInvoicePaymentMethod()->getId(), | ||
'defaultPaymentMethodId' => $this->helper->PaymentMethod()->getInvoicePaymentMethod()?->getId(), | ||
'defaultBillingAddress' => [ | ||
'id' => self::ADDRESS_ID, | ||
'salutationId' => $this->helper->Salutation()->getNotSpecifiedSalutation()->getId(), | ||
'firstName' => 'John', | ||
'lastName' => 'Doe', | ||
'salutationId' => $this->helper->Salutation()->getNotSpecifiedSalutation()?->getId(), | ||
'firstName' => 'Zoey', | ||
'lastName' => 'Smith', | ||
'zipcode' => '1234', | ||
'street' => 'Sample Street', | ||
'city' => 'Berlin', | ||
'countryId' => $this->helper->SalesChannel()->getCountry('DE')->getId(), | ||
'countryId' => $this->helper->LanguageAndLocale()->getCountry('DE')?->getId(), | ||
], | ||
'defaultShippingAddressId' => self::ADDRESS_ID, | ||
'salutationId' => $this->helper->Salutation()->getNotSpecifiedSalutation()->getId(), | ||
'salutationId' => $this->helper->Salutation()->getNotSpecifiedSalutation()?->getId(), | ||
'customerNumber' => '1122', | ||
'firstName' => 'John', | ||
'lastName' => 'Doe', | ||
'firstName' => 'Zoey', | ||
'lastName' => 'Smith', | ||
'email' => '[email protected]', | ||
'password' => 'notset', | ||
]], Context::createDefaultContext()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { defineConfig } from 'vitepress' | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: "Shopware 6 Fixture Plugin", | ||
description: "The fixture plugin is really helpful if you want to create some static demo data", | ||
base: "/FixturesPlugin", | ||
lastUpdated: true, | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: 'Getting started', link: '/getting-started' }, | ||
], | ||
|
||
sidebar: [ | ||
{ | ||
text: 'Basics', | ||
items: [ | ||
{ text: 'Getting started', link: '/getting-started' }, | ||
{ text: 'Installation', link: '/installation' }, | ||
{ text: 'Supported versions', link: '/supported-versions' }, | ||
{ text: 'Upgrade guide', link: '/upgrade' }, | ||
{ text: 'Changelog', link: 'https://github.com/basecom/FixturesPlugin/blob/main/CHANGELOG.md' }, | ||
] | ||
}, | ||
{ | ||
text: 'Writing fixtures', | ||
items: [ | ||
{ text: 'Your first fixture', link: '/writing/first-fixture' }, | ||
{ text: 'Dependencies & Prioritization', link: '/writing/dependencies-prioritization' }, | ||
{ text: 'Grouping', link: '/writing/groups' }, | ||
{ text: 'Available commands', link: '/writing/available-commands' }, | ||
{ text: 'Fixture Helper', link: '/writing/fixture-helper' }, | ||
{ text: 'PHPUnit & Tests', link: '/writing/phpunit-tests' }, | ||
] | ||
}, | ||
{ | ||
text: 'Fixture Helpers', | ||
items: [ | ||
{ text: 'Utility methods', link: '/helpers/utility' }, | ||
{ text: 'Media Helpers', link: '/helpers/media' }, | ||
{ text: 'Category Helpers', link: '/helpers/category' }, | ||
{ text: 'Sales Channel Helpers', link: '/helpers/sales-channel' }, | ||
{ text: 'Salutation Helpers', link: '/helpers/salutation' }, | ||
{ text: 'CMS Helpers', link: '/helpers/cms' }, | ||
{ text: 'Payment Method Helpers', link: '/helpers/payment-method' }, | ||
{ text: 'Shipping Method Helpers', link: '/helpers/shipping-method' }, | ||
{ text: 'Language & Locale Helpers', link: '/helpers/language-locale' }, | ||
{ text: 'Currency Helpers', link: '/helpers/currency' }, | ||
{ text: 'Tax Helpers', link: '/helpers/tax' }, | ||
{ text: 'Database Helpers', link: '/helpers/database' }, | ||
] | ||
}, | ||
{ | ||
text: 'Examples', | ||
items: [ | ||
{ text: 'Overview', link: '/examples/' }, | ||
{ text: 'Create a customer', link: '/examples/customer' }, | ||
{ text: 'Create a product', link: '/examples/product' }, | ||
], | ||
}, | ||
//{ | ||
// text: 'Contributing', | ||
// items: [ | ||
// { text: 'Internals', link: '/contributing/internals' }, | ||
// { text: 'Contribution guide', link: '/contributing/guide' }, | ||
// ] | ||
//} | ||
], | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/basecom/FixturesPlugin' }, | ||
{ icon: 'instagram', link: 'https://www.instagram.com/basecom.de/?hl=en' }, | ||
{ icon: 'linkedin', link: 'https://www.linkedin.com/company/basecom-gmbh-&-co.-kg/' }, | ||
], | ||
|
||
footer: { | ||
message: 'Released under the MIT License.', | ||
copyright: 'Copyright © 2021-2024 basecom GmbH & Co. KG' | ||
}, | ||
|
||
editLink: { | ||
pattern: 'https://github.com/basecom/FixturesPlugin/edit/main/docs/:path', | ||
text: 'Edit this page on GitHub' | ||
}, | ||
|
||
search: { | ||
provider: 'local' | ||
} | ||
}, | ||
markdown: { | ||
lineNumbers: true | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:root { | ||
--vp-c-brand-1: #0099ff; | ||
--vp-c-brand-2: #006eff; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import DefaultTheme from 'vitepress/theme' | ||
import './custom.css' | ||
|
||
export default DefaultTheme |
Oops, something went wrong.