Skip to content

Commit 97e5025

Browse files
committed
OXDEV-8635: Adjust Readme file for new module
1 parent 5673116 commit 97e5025

1 file changed

Lines changed: 42 additions & 137 deletions

File tree

README.md

Lines changed: 42 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# OXID eShop Examples Module
22

3-
[![Development](https://github.com/OXID-eSales/module-template/actions/workflows/trigger.yaml/badge.svg?branch=b-7.1.x)](https://github.com/OXID-eSales/module-template/actions/workflows/trigger.yaml)
4-
[![Latest Version](https://img.shields.io/packagist/v/OXID-eSales/module-template?logo=composer&label=latest&include_prereleases&color=orange)](https://packagist.org/packages/oxid-esales/module-template)
5-
[![PHP Version](https://img.shields.io/packagist/php-v/oxid-esales/module-template)](https://github.com/oxid-esales/module-template)
3+
[![Development](https://github.com/OXID-eSales/examples-module/actions/workflows/trigger.yaml/badge.svg?branch=b-7.3.x)](https://github.com/OXID-eSales/examples-module/actions/workflows/trigger.yaml)
4+
[![Latest Version](https://img.shields.io/packagist/v/OXID-eSales/examples-module?logo=composer&label=latest&include_prereleases&color=orange)](https://packagist.org/packages/oxid-esales/examples-module)
5+
[![PHP Version](https://img.shields.io/packagist/php-v/oxid-esales/examples-module)](https://github.com/oxid-esales/examples-module)
66

7-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=OXID-eSales_module-template&metric=alert_status)](https://sonarcloud.io/dashboard?id=OXID-eSales_module-template)
8-
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=OXID-eSales_module-template&metric=coverage)](https://sonarcloud.io/dashboard?id=OXID-eSales_module-template)
9-
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=OXID-eSales_module-template&metric=sqale_index)](https://sonarcloud.io/dashboard?id=OXID-eSales_module-template)
7+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=OXID-eSales_examples-module&metric=alert_status)](https://sonarcloud.io/dashboard?id=OXID-eSales_examples-module)
8+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=OXID-eSales_examples-module&metric=coverage)](https://sonarcloud.io/dashboard?id=OXID-eSales_examples-module)
9+
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=OXID-eSales_examples-module&metric=sqale_index)](https://sonarcloud.io/dashboard?id=OXID-eSales_examples-module)
1010

1111

12-
Reusable module template for extending OXID eShop core functionality.
13-
14-
The module template contains examples for the most common use cases (see below)
12+
The examples module contains examples for the most common use cases (see below)
1513
like OXID suggests it could be implemented.
1614

1715
This module also comes with all the quality tools OXID recommends to use.
@@ -22,24 +20,20 @@ This module also comes with all the quality tools OXID recommends to use.
2220
3. [Goals](#goals)
2321
4. [Examples](#examples)
2422
5. [Install and try it out](#install-and-try-it-out)
25-
6. [Use as a base for own module](#use-as-a-base-for-own-module)
26-
7. [Things to be aware of](#things-to-be-aware-of)
27-
8. [Running tests and quality tools](#running-tests-and-quality-tools)
28-
9. [Additional info](#additional-info)
23+
6. [Development installation](#development-installation)
24+
7. [Development installation on OXID eShop SDK](#development-installation-on-oxid-eshop-sdk)
25+
8. [Things to be aware of](#things-to-be-aware-of)
26+
9. [Running tests and quality tools](#running-tests-and-quality-tools)
27+
10. [Additional info](#additional-info)
2928

3029
## Branch compatibility
3130

3231
* b-7.3.x branch - compatible with OXID eShop compilation 7.3.x and the respective branch
33-
* b-7.2.x branch / v4.x version - compatible with OXID eShop compilation 7.2.x and the respective branch
34-
* b-7.1.x branch / v3.x version - compatible with OXID eShop compilation 7.1.x and the respective branch
35-
* b-7.0.x branch / v2.x version - compatible with OXID eShop compilation b-7.0.x
36-
* b-6.5.x branch / v1.0.0 version - compatible with OXID eShop compilation b-6.5.x
37-
* b-6.4.x branch is compatible with OXID eShop compilation b-6.4.x
3832

3933
## The Idea
4034

4135
OXID eSales would like to provide a lightweight reusable example module incorporating
42-
our best practices recommendations to be used as a template for developing own module solutions.
36+
our best practices recommendations to be used for developing own module solutions.
4337

4438
Story:
4539
- Module will extend a block on shop start page to show a greeting message (visible when module is active).
@@ -56,15 +50,7 @@ Story:
5650

5751
## Goals
5852

59-
There are three main goals this repository is intended to help with:
60-
61-
* Install and try out the module with simple examples to most common development questions.
62-
* The provided solution can be used as a base for your own module. It will help creating
63-
the personalized module base with all the examples listed in the Examples section.
64-
* The repository can be used for creating a clean skeleton with only preconfigured
65-
OXID recommended quality tools for your new module.
66-
67-
Please jump to the section that fits your needs.
53+
Install and try out the module with simple examples to most common development questions.
6854

6955
## Examples
7056

@@ -140,117 +126,39 @@ composer require oxid-esales/module-template
140126

141127
and [activate the module](https://docs.oxid-esales.com/developer/en/latest/development/modules_components_themes/module/installation_setup/setup.html#setup-activation).
142128

143-
## Use as a base for own module
129+
## Development installation
144130

145-
In case you'd like to use this module as a template for your own module, this section is for you.
131+
To be able running the tests and other preconfigured quality tools, please install the module as a [root package](https://getcomposer.org/doc/04-schema.md#root-package).
146132

147-
**Important** Instructions here are for the case you intend to develop a module for OXID eShop 7.2.x. For other
148-
versions, refer to the version specific branch.
133+
The next section shows how to install the module as a root package by using the OXID eShop SDK.
149134

150-
Before starting to do something, please, read the whole section once, then decide on required questions, decide
151-
what you want to achieve, and follow the procedure.
135+
In case of different environment usage, please adjust by your own needs.
152136

153-
### Terms
137+
## Development installation on OXID eShop SDK
154138

155-
First, lets decide on terms:
139+
The installation instructions below are shown for the current [SDK](https://github.com/OXID-eSales/docker-eshop-sdk)
140+
for shop 7.3. Make sure your system meets the requirements of the SDK.
156141

157-
* Module is installable to `vendor/<yourPackageName>` directory. The package name is **lowercased** and
158-
looks like: `<yourVendorName>/<yourModuleName>`, example: `oxid-esales/module-template`. Decide
159-
what will be your new module package name.
160-
* Please note that combination of `<yourVendorName>` and `<yourModuleRootDirectory>` should be unique. Based on this
161-
information your module id will be composed and will look like: `<yourVendorPrefix>_<yourModuleRootDirectory>`. In
162-
our case it is `oe_moduletemplate`.
163-
* It is recommended to use only alphanumeric characters, in case you need a separator you can use dash ("-") or underscore("_").
164-
* Decide on your module's namespace - `<YourVendorName>\<YourModuleName>`, example: `OxidEsales\ModuleTemplate`.
165-
* Decide on your module's ID - `<YourVendorPrefix>_<yourModuleName alphanumeric part>`, example: `oe_moduletemplate`.
166-
* It is recommended to use only alphanumeric characters, in case you need a separator you can use underscore. More
167-
information about module id can be found [here](https://docs.oxid-esales.com/developer/en/latest/development/modules_components_themes/module/skeleton/metadataphp/amodule/id.html).
142+
0. Ensure all docker containers are down to avoid port conflicts
168143

169-
In the following examples, your information required places will be shown as placeholders: `<yourPackageName>`, it means
170-
you should put your package name at that place, without brackets, for example:
171-
172-
```
173-
composer config repositories.<yourPackageName> path source/modules/<yourVendorName>/<yourModuleName>
144+
1. Clone the SDK for the new project
145+
```shell
146+
echo MyProject && git clone https://github.com/OXID-eSales/docker-eshop-sdk.git $_ && cd $_
174147
```
175-
will possibly look like:
176-
```
177-
composer config repositories.my-vendor-name/my-module-name path source/modules/mvn/mymodulerootdir
178-
```
179-
in our case it is:
180-
```
181-
composer config repositories.oxid-esales/module-template path source/modules/oe/module-template
182-
```
183-
184-
### Procedure
185-
186-
The following procedure describes how to create a base for your further module, and shows the basic installation for the development process:
187-
188-
#### 1. Use the Template
189-
190-
Click on the "Use this template" button on the template [main page](https://github.com/OXID-eSales/module-template) to
191-
create your module repository from the given template.
192-
193-
Please make sure to NOT choose the 'take all branches' option, as this will clone the repository with everything
194-
we have in our repository. Having all branches also will trigger the github actions for all branches and you dont want this usually.
195-
196-
As an outcome of this step, you should have a repository with one "Initial commit" of our current latest repository state.
197-
198-
#### 2. Personalize and cleanup the module
199-
200-
To personalize the module, use the "bin/personalize.sh" script. This script will prompt you for required information and do the work.
201-
202-
To cleanup the module from all current examples and make it a clean skeleton, use the "bin/cleanexamples.sh" script. This script will remove all example solutions code.
203-
204-
Its not mandatory to cleanup the module from examples, but you have this option if you want to start from the clean skeleton.
205-
206-
For this step, clone your module repository anywhere to your local directory and run the desired scripts.
207148

208-
```bash
209-
git clone <yourGitRepositoryUrl> myModule
210-
cd myModule
211-
212-
// Run the personalize script
213-
./bin/personalize.sh
214-
215-
// Run the clean examples script if you want to start from the clean skeleton
216-
./bin/cleanexamples.sh
217-
218-
git commit -am "Personalize and cleanup the module"
219-
git push origin
149+
2. Clone the repository to the source directory
150+
```shell
151+
git clone --recurse-submodules https://github.com/OXID-eSales/graphql-base-module.git --branch=b-7.3.x ./source
220152
```
221153

222-
Please note that the module comes with a database table, translations, settings and some templates which still have the original
223-
names after personalization, if cleanup was not done. Just keep an eye on all that's prefixed 'OEEM', 'oeem', 'OEEXAMPLESMODULE' etc.
224-
225-
Also, you will need to adjust the README, CHANGELOG, LICENSE, metadata and the GitHub workflow file, with your
226-
credentials and names. For running SonarCloud as part of the steps in GitHub workflow you
227-
will need to configure SonarCloud and to create a secret environment variable for your repository called SONAR_TOKEN.
228-
The token itself is provided by SonarCloud.
229-
230-
#### 3. Install the module for Development
231-
232-
For installing the module for development our recommended way, check the "Development installation section",
233-
or do it any other way you prefer, but make sure to reconfigure our preconfigured quality tools to fit your installation.
234-
235-
### Development installation
236-
237-
We recommend developing the module as independent as possible. This means that the module for development should
238-
be installed as a root package, with its own strict dependencies if such are needed.
239-
240-
Consider using our docker based SDK and our ["Recipes"](https://github.com/OXID-eSales/docker-eshop-sdk-recipes) to
241-
install this module development variant. Make sure you have all your current docker containers stopped before starting on this.
242-
243-
```bash
244-
cd ~/Projects
245-
echo ModuleTemplate && git clone https://github.com/OXID-eSales/docker-eshop-sdk.git $_ && cd $_
246-
git clone --recurse-submodules https://github.com/OXID-eSales/docker-eshop-sdk-recipes recipes/oxid-esales
247-
248-
// Important: In case you want to develop your module created from module template, edit the recipe with your
249-
// module repository and module id first
250-
251-
./recipes/oxid-esales/module-template/b-7.2.x-root.sh -eCE
154+
3. Run the recipe to setup the development environment, you can decide which shop edition to install. Omitting the flag installs EE.
155+
```shell
156+
./source/recipes/setup-development.sh -s CE
252157
```
253158

159+
You should be able to access the shop with http://localhost.local and the admin panel with http://localhost.local/admin
160+
(credentials: noreply@oxid-esales.com / admin)
161+
254162
## Things to be aware of
255163

256164
The module template is intended to act as a tutorial module so keep your eyes open for comments in the code.
@@ -284,10 +192,15 @@ As already mentioned above, in the 7.x versions of OXID eShop, the module code o
284192
namespace needs to point there. In our case this looks like
285193

286194
```bash
287-
"autoload": {
195+
"autoload": {
288196
"psr-4": {
289-
"OxidEsales\\ModuleTemplate\\": "src/",
290-
"OxidEsales\\ModuleTemplate\\Tests\\": "tests/"
197+
"OxidEsales\\ExamplesModule\\": "src/"
198+
}
199+
},
200+
"autoload-dev": {
201+
"psr-4": {
202+
"OxidEsales\\ExamplesModule\\Tests\\": "tests/",
203+
"OxidEsales\\EshopCommunity\\Tests\\": "./vendor/oxid-esales/oxideshop-ce/tests"
291204
}
292205
},
293206
```
@@ -357,13 +270,6 @@ In our case, we cover the reaction of the startpage to the different possibiliti
357270
The great thing about codeception tests is - they can create screenshot and html
358271
output in failure case, so you literally get a picture of the fail (`tests/Coreception/_output/`).
359272

360-
### Development Environment - Docker SDK
361-
362-
You can install the shop on whatever system fits your needs, but please check the
363-
[OXID Docker SDK recipes](https://github.com/OXID-eSales/docker-eshop-sdk-recipes).
364-
That's what we use in OXID Development to quickly set up whatever development environment we need and
365-
we are constantly trying to improve them.
366-
367273
### Github Actions Workflow
368274

369275
The module template comes complete with a github actions workflow. No need to rig up some separate continuous integration
@@ -401,7 +307,6 @@ Ps: a failing shop test might also turn up issues in your module, in that case f
401307
* Bug tracker - https://bugs.oxid-esales.com
402308
* Developer Documentation - https://docs.oxid-esales.com/developer/en/latest/
403309
* Quality Tools and Requirements - https://docs.oxid-esales.com/developer/en/latest/development/modules_components_themes/quality.html
404-
* Docker SDK recipes - https://github.com/OXID-eSales/docker-eshop-sdk-recipes
405310
* Docker SDK - https://github.com/OXID-eSales/docker-eshop-sdk
406311

407312
### Contact us

0 commit comments

Comments
 (0)