Module is a helper to install ScandiPWA Theme.
composer require scandipwa/installer
After installation flush the caches (Varnish or filesystem).
scandipwa:theme:bootstrap must appear in your Magento 2 CLI command list
php bin/magento
Command accepts single parameter, which is treated as following format: "Vendor/theme".
After php bin/magento scandipwa:theme:bootstrap Scandiweb/pwa it will make next effect:
- Check for
<magento_root>/app/design/frontend/Scandiweb/pwa- bootstrap will quite with error if directory is present to prevent unwanted overrides. - Create
<magento_root>/app/design/frontend/Scandiweb/pwadirectory - Copy necessary files to the newly created theme root.
- Answer y/N (No is default) to a prompt for
theme.xmlandregistration.phpgeneration. You might want to create them manually - feel free to do it! - Run
php bin/magento setup:upgrade. - You are bootstraped!
If you ever need a similar bootstrap and "magento-extra" section within composer.json is not enough - here is a short summary of module logic and customization, so feel free to re-use it!
Package goal is ensure simple theme bootstrap, by copying specific files, keeping the file structure. Apart of it - it must be interactive at some sort, to give you ability to generate more then one theme, without additional configuration.
- Magento 2 CLI command
- File copying logic (adding directory recursive copy)
In order to customize copying task - simply edit di.xml, passing array with paths.