Giter Site home page Giter Site logo

shopware6-dev-tools's Introduction

Shopware 6 Additional Dev Tools

A small stack of dev tools to make your life as a starting Shopware 6 developer a little easier

Assumptions

This plugin is build upon a few assumptions:

  • You have Shopware 6 already installed manually
  • shopware/platform is installed by composer

Features

  • Enable and Disable twig caching
  • Fix hot proxy
  • Create Shorthand for ./psh.phar
  • Works on three types of Shopware installation:
    • Composer platform installation: ./vendor/shopware/platform
    • Composer production template installation: ./vendor/shopware/core etc.
    • Installed following the Shopware installation guidelines by using git

Installation

Composer / packagist

composer require mmeester/shopware6-dev-tools --dev

That's it, follow the next steps in the activate plugin section.

Manual

  • Download the zipfile of this repo
  • Unzip the zip
  • Rename the folder to DevTools or whatevever your flavor is
  • Move the folder in your Shopware 6 Custom plugin directory, ex: custom/plugins

Activate plugin

In your CLI run the following inside the root of your Shopware project:

  • Detect new plugins: bin/console plugin:refresh ๐Ÿ‘‰ Look for the new plugin
  • Install & activate the plugin: bin/console plugin:install --activate DevTools

Commands

Enable or disable Twig Caching

Before you can start developing you need to disable twig caching so development goes faster (and your installation a little slower), to disable the cache run:

bin/console dev:twig-cache disable

to enable the cache:

bin/console dev:twig-cache enable

Add shorthand command to CLI

Typing ./psh.phar are way too much characters when typing it more than twice a day ๐Ÿ˜Š, so make your life a little easier and add a shorthand to your cli, run the following command once and follow the instructions in your cli:

bin/console dev:create-alias

Now you are able to run all your known Shopware Commands like this:

sw cache
sw update

sw storefront:build
sw storefront:dev
sw storefront:hot-proxy

...

NOTE: You only need to run this command once per machine, each time you run this command an additional alias will be written to your profile.

Hot proxy fix

This is a fix for Shopware 6 users that aren't able or don't want to use Docker to run their installation locally.

This solves the problem in Valet+ that it isn't accepting port :80 forwarding with hot proxy!

  • Run the new command to fix the hot-proxy: bin/console dev:hot-proxy-fix
  • Try the hot-proxy again by running the standard Shopware command: ./psh.phar storefront:hot-proxy

shopware6-dev-tools's People

Contributors

bethlehemit avatar mmeester avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

shopware6-dev-tools's Issues

Fix dev-ops files when switching type of installation

Use case:
We recently switched from composer require shopware/platform to composer require shopware/core, composer require shopware/storefront.

This resulted in non-working ./psh.phar commands that can be fixed by changing the path in a lot of dev-ops files.

There are no commands defined in the "dev" namespace.

Hi Maurits,

first let me compliment you with for your work on the SW6 Valet + install, I already worked that way but it's a really nice overview.

Also I hope you and your family are Healthy and save

I didn't jet find your dev-tools an i'm pleasantly surprised, so i did a clean install which gave me a perfectly working version 6.02. RC of Shopware, and as you already mentioned your solution is tested and works om SW 6.1.1.

the Issue is that when using the bin/console dev:hot-proxy-fix I get "There are no commands defined in the "dev" namespace."

Manually copying the index.js hot-proxy-fix file to proxy-server-hot shows that the fix still works ;-)

Hope you have time to upgrade the tools to work with the coming SW 6.2 release

Thanks en de groeten uit Germany ;-),

Ruud

Detect in what way Shopware is installed

We have three scenarios atm:

  • Installed via git by cloning platform inside development
  • Installed via composer by composer require shopware/platform
  • Installed as seperate modules by composer: composer require shopware/administration shopware/core shopware/elasticsearch shopware/recovery shopware/storefront

When detected perform hot proxy fix and template cache to the right directory

Normalize cms blocks

Problem:
Provided by Shopware 6, out of the box cms blocks now have a default config of 20px margin around each block, which is messing up design choices quite often.

Solution

  • Create a command to change these settings to remove all the already set margins from the database
  • Create additional plugin (installable by this toolset) that normalizes the margin by removing them all.

Command to create CMS block from scratch in existing plugin

Problem
Creating a cms block involves a lot of files, creating one block consumes a lot of time, this time can be saved by automation.

Solution

  • Create Skeleton template of a plugin
  • By command create a block in an existing plugin, should have a few parameters
    • Name of the block
    • Name of the plugin to add the block too

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.