Skip to content

Commit 7c99f0b

Browse files
authored
Merge pull request #123 from PrestaShop/dev
Release 0.2.0
2 parents 6aebe14 + 36411ab commit 7c99f0b

File tree

135 files changed

+13398
-1620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+13398
-1620
lines changed

.github/workflows/integration.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
php: [ '8.1', '8.2', '8.3' ]
20+
php: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
2121
prestashop_version: ['develop', '9.0.x']
22+
exclude:
23+
# 9.0.x doesn't support PHP 8.5
24+
- php: '8.5'
25+
prestashop_version: '9.0.x'
2226
fail-fast: false
2327
steps:
2428
- name: Checkout module code
@@ -33,6 +37,7 @@ jobs:
3337
path: prestashop
3438
ref: ${{ matrix.prestashop_version }}
3539
- name: Build Docker
40+
timeout-minutes: 15
3641
env:
3742
VERSION: ${{ matrix.php }}-apache
3843
run: |

.github/workflows/php.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
- name: PHP syntax checker 8.4
2525
uses: prestashop/github-action-php-lint/8.4@master
2626

27+
- name: PHP syntax checker 8.5
28+
uses: prestashop/github-action-php-lint/8.5@master
29+
2730
# Check the PHP code follow the coding standards
2831
php-cs-fixer:
2932
name: PHP-CS-Fixer
@@ -72,3 +75,51 @@ jobs:
7275

7376
- name: Run header-stamp
7477
run: php vendor/bin/header-stamp --license=vendor/prestashop/header-stamp/assets/afl.txt --exclude=vendor --dry-run
78+
79+
phpunit:
80+
name: PHPUnit Tests
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Setup PHP
84+
uses: shivammathur/setup-php@v2
85+
with:
86+
php-version: '8.1'
87+
88+
- name: Checkout
89+
uses: actions/checkout@v4
90+
91+
- name: Cache dependencies
92+
uses: actions/cache@v3
93+
with:
94+
path: vendor
95+
key: php-${{ hashFiles('composer.lock') }}
96+
97+
- name: Install dependencies
98+
run: composer install
99+
100+
- name: Run PHPUnit tests
101+
run: php vendor/bin/phpunit -c tests/Unit/phpunit.xml
102+
103+
rector:
104+
name: Rector Dry Run
105+
runs-on: ubuntu-latest
106+
steps:
107+
- name: Setup PHP
108+
uses: shivammathur/setup-php@v2
109+
with:
110+
php-version: '8.1'
111+
112+
- name: Checkout
113+
uses: actions/checkout@v4
114+
115+
- name: Cache dependencies
116+
uses: actions/cache@v3
117+
with:
118+
path: vendor
119+
key: php-${{ hashFiles('composer.lock') }}
120+
121+
- name: Install dependencies
122+
run: composer install
123+
124+
- name: Run Rector dry-run
125+
run: composer rector

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ This module contains no code only some resource files that are automatically sca
1010

1111
You can report issues with this module in the main PrestaShop repository. [Click here to report an issue][report-issue].
1212

13+
## Under development
14+
15+
Please be aware that this module is still under development, that is why its version is only `0.*`, we didn't release a major version `1.0` yet because we anticipate some breaking changes may happen while we add all the missing endpoints.
16+
17+
We try to maintain retro compatibility as much as possible and always refrain from adding breaking changes, but we also want this API contract to be a fixed standard once it's finalized, so we prefer to polish and improve it before a major version is released.
18+
19+
After the `1.0` version is released it won't include other breaking changes, any breaking change will require a new major version (`2.0`) and will follow semver convention.
20+
1321
## Requirements
1422

1523
Required only for development:
@@ -51,6 +59,10 @@ composer setup-local-tests -- [arguments]
5159
5260
Example:
5361
```bash
62+
# To test with 9.0.x branch
63+
composer setup-local-tests -- --force --core-branch=9.0.x
64+
65+
# To test with a branch from your fork (in this example fork: jolelievre branch: product-api)
5466
composer setup-local-tests -- --force --core-branch=jolelievre:product-api
5567
```
5668
@@ -73,6 +85,6 @@ Just make sure to follow our [contribution guidelines][contribution-guidelines].
7385
This module is released under the [Academic Free License 3.0][AFL-3.0]
7486
7587
[report-issue]: https://github.com/PrestaShop/PrestaShop/issues/new/choose
76-
[prestashop]: https://www.prestashop.com/
77-
[contribution-guidelines]: https://devdocs.prestashop.com/1.7/contribute/contribution-guidelines/project-modules/
88+
[prestashop]: https://www.prestashop-project.org/
89+
[contribution-guidelines]: https://devdocs.prestashop-project.org/9/contribute/contribution-guidelines/project-modules/
7890
[AFL-3.0]: https://opensource.org/licenses/AFL-3.0

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
"prestashop/php-dev-tools": "^4.3",
1717
"czproject/git-php": "^4.2",
1818
"phpunit/phpunit": "^10",
19-
"friendsofphp/php-cs-fixer": "^v3"
19+
"friendsofphp/php-cs-fixer": "^v3",
20+
"rector/rector": "^2.0",
21+
"doctrine/inflector": "^2.0"
2022
},
2123
"autoload": {
2224
"psr-4": {
@@ -47,7 +49,10 @@
4749
"@composer setup-local-tests -- --build-db"
4850
],
4951
"run-module-tests": "@php -d date.timezone=UTC ./vendor/bin/phpunit -c tests/Integration/phpunit-local.xml",
50-
"setup-local-tests": "PsApiResourcesTest\\EnvironmentBuilder::setupLocalTests"
52+
"run-unit-tests": "@php -d date.timezone=UTC ./vendor/bin/phpunit -c tests/Unit/phpunit.xml",
53+
"setup-local-tests": "PsApiResourcesTest\\EnvironmentBuilder::setupLocalTests",
54+
"rector": "vendor/bin/rector process --clear-cache --dry-run",
55+
"rector-fix": "vendor/bin/rector process"
5156
},
5257
"type": "prestashop-module",
5358
"author": "PrestaShop"

composer.lock

Lines changed: 204 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<module>
33
<name>ps_apiresources</name>
44
<displayName><![CDATA[PrestaShop API Resources]]></displayName>
5-
<version><![CDATA[0.1.0]]></version>
5+
<version><![CDATA[0.2.0]]></version>
66
<description><![CDATA[Includes the resources allowing using the API for the PrestaShop domain, all endpoints are based on CQRS commands/queries from the Core and we APIPlatform framework is used as a base.]]></description>
77
<author><![CDATA[PrestaShop]]></author>
88
<tab><![CDATA[administration]]></tab>

0 commit comments

Comments
 (0)