spryker-sdk / spryk
Spryk module
Installs: 2 002 909
Dependents: 7
Suggesters: 0
Security: 0
Stars: 4
Watchers: 19
Forks: 12
Open Issues: 5
Requires
- php: >=8.2
- dev-master / 1.0.x-dev
- 0.7.0
- 0.6.0
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.9
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.2
- 0.1.1
- 0.1.0
- dev-spryker-sdk/spryk-src/feature/frw-8801/master-php-upgrade-and-drop-81
- dev-spryker-sdk/spryk-src/feature/frw-998/dev-php-upgrade-and-drop-8
- dev-spryker-sdk/spryk-src/feature/fix-spryks
- dev-spryker-sdk/spryk-src/bugfix/frw-1790-fix-phar-compilation
- dev-spryker-sdk/spryk-src/bugfix/issues-3
This package is auto-updated.
Last update: 2024-12-17 01:48:00 UTC
README
Installation
composer require --dev spryker-sdk/spryk
This is a development only "require-dev" module. Please make sure you include it as such.
What are Spryks?
Spryks are some sort of code generators for Spryker. Writing code is often a very repetitive task and you often need to write a lot code just to follow Spryker's clean and complex architecture. To take a way the monkey work from writing wir up code and move faster towards writing business code Spryks are born.
Spryks are written with the help of yml files. The filename of the yml file represents also the Spryk name. In most cases the Spryk yml contains arguments which are needed to fullfill the Spryk build run. Almost all Spryks need the module name to run properly. Some Spryks require much more arguments.
The vast majority of the Spryks need to execute other Spryks before the called Spryk can run. For example Add a Zed Business Facade needs to have a properly created module before the Facade itself can be created. Therefore Spryks have pre and post Spryks and with the call of one Spryk many things can and will be created for you.
How to use Spryks?
vendor/bin/spryk-run
- Runs Spryks in your projectvendor/bin/spryk-dump
- Lists all available Spryksvendor/bin/spryk-build
- Builds a cache file for all Spryk arguments
Examples:
- To get a list of top level spryks run
vendor/bin/spryk-dump
. - To get a list of all available spryks run
vendor/bin/spryk-dump --level=all
. - To get a list of all options available for a specific spryk run
vendor/bin/spryk-dump {SPRYK NAME}
. - To execute one Spryk run
vendor/bin/spryk-run {SPRYK NAME}
. - To reflect changes in Spryk arguments and generate a new cache for them run
vendor/bin/spryk-build
.
When you run a Spryk, the console will ask you for all needed arguments to build the Spryk. You also have the ability to pass all known arguments on the console by using --{argument name}={argument value}
.
Extending Spryk
Adding Spryks
You can add your own Spryks by creating a Spryk definition in your projects config/spryk/spryks/
directory.
Spryk definitions in this directory will be found by the tool and can be executed as usually.
Adding Spryk templates
You can add your own Spryk templates by creating a template in your projects config/spryk/templates/
directory.
Spryk templates in this directory will be found by the tool and can be used in your Spryks.
Configuration
Spryks need some project related configurations. These are passed automatically to the tool.
The following configurations will be passed to the Spryk tool:
Spryker\Shared\Kernel\KernelConstants::PROJECT_NAMESPACE
Spryker\Shared\Kernel\KernelConstants::PROJECT_NAMESPACES
Spryker\Shared\Kernel\KernelConstants::CORE_NAMESPACES