This README provides step-by-step instructions to integrate the SprykerCommunity Dummy Module into your Spryker B2B Demo Shop.
- Spryker B2B Demo Shop installed and running
- Git access to clone the dummy module
- Composer installed
- Create local-packages Directory
Create a local-packages directory in your demo shop root:
mkdir local-packages
cd local-packages
- Adjust .gitignore of demo-shop
Add the module directory to your main project's .gitignore file to prevent tracking the module as part of the main project:
# Add to .gitignore
/local-packages/
- Clone Dummy Module
Clone the dummy module repository into the module directory:
git clone [email protected]:spryker-community/dummy-module.git dummy-module
Your directory structure should now look like:
b2b-demo-shop/
├── local-packages/
│ └── dummy-module/
│ ├── assets/
│ │ ├── Zed/
│ │ │ └── package.json
│ │ └── package.json
│ └── src/
│ └── SprykerCommunity/
│ └── Zed/
│ └── DummyModule/
├── src/
├── vendor/
└── composer.json
- Update Main Project composer.json
Add the path repository configuration to your main project's composer.json:
{
"repositories": [
{
"type": "path",
"url": "local-packages/dummy-module",
"options": {
"symlink": true
}
}
],
}
- Install the Module
Run the composer require command from your demo shop root directory:
composer require spryker-community/dummy-module:@dev
- Configure Spryker Core Namespaces
Add the SprykerCommunity namespace to your Spryker configuration:
File: config/Shared/config_default.php
<?php
// Add SprykerCommunity to the core namespaces array
$config[KernelConstants::CORE_NAMESPACES] = [
'SprykerCommunity', // Add this line
'SprykerShop',
'SprykerEco',
'Spryker',
'SprykerSdk',
];
- Clear Cache (Optional)
If needed, clear the Spryker cache:
vendor/bin/console cache:empty-all
- Add the
spryker-community
workspace to the rootpackage.json
of your project:
"workspaces": [
"vendor/spryker/*",
"vendor/spryker-community/*",
"vendor/spryker-community/*/assets/",
"vendor/spryker/*/assets/Zed",
"vendor/spryker-community/*/assets/Zed"
],
- Install all JavaScript dependencies from the
/vendor/spryker-community
directory and compile them for use in your application:
Note: Execute inside your docker/sdk cli
npm install
With ls -la node_modules
you should see that we installed the node modules dummy-package-tsl
and hello-world-npm
.
After successful installation, you should be able to access the test module at: http://backoffice.eu.spryker.local/dummy-module