Skip to content

Commit 82e6992

Browse files
authored
Merge pull request #101 from PrestaShop/dev
Release 2.0.0
2 parents db63373 + bcf8309 commit 82e6992

205 files changed

Lines changed: 25437 additions & 4197 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.php]
16+
indent_size = 4
17+
18+
[*.md]
19+
trim_trailing_whitespace = false
20+
21+
[Makefile]
22+
indent_style = tabs

.eslintignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/node_modules/
2+
/public/
3+
/vendor/
4+
/bundle.js
5+
/tests/
6+
!.eslintrc.js
7+
!.webpack

.eslintrc.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// http://eslint.org/docs/user-guide/configuring
2+
3+
module.exports = {
4+
root: true,
5+
env: {
6+
browser: true,
7+
node: true,
8+
es6: true,
9+
jquery: true,
10+
},
11+
globals: {
12+
google: true,
13+
document: true,
14+
navigator: false,
15+
window: true,
16+
},
17+
parserOptions: {
18+
parser: 'babel-eslint',
19+
},
20+
extends: ['prestashop', 'plugin:vue/strongly-recommended'],
21+
plugins: ['import', 'vue'],
22+
rules: {
23+
'class-methods-use-this': 0,
24+
'func-names': 0,
25+
'import/no-extraneous-dependencies': [
26+
'error',
27+
{
28+
devDependencies: ['tests/**/*.js', '.webpack/**/*.js'],
29+
},
30+
],
31+
'max-len': ['error', {code: 120}],
32+
'no-alert': 0,
33+
'no-bitwise': 0,
34+
'no-new': 0,
35+
'no-param-reassign': ['error', {props: false}],
36+
'no-restricted-globals': [
37+
'error',
38+
{
39+
name: 'global',
40+
message: 'Use window variable instead.',
41+
},
42+
],
43+
'no-restricted-syntax': 0,
44+
'prefer-destructuring': ['error', {object: true, array: false}],
45+
'vue/script-indent': [
46+
'error',
47+
2,
48+
{
49+
baseIndent: 1,
50+
switchCase: 1,
51+
},
52+
],
53+
'vue/require-default-prop': 0,
54+
},
55+
settings: {
56+
'import/resolver': 'webpack',
57+
},
58+
overrides: [
59+
{
60+
files: ['*.vue'],
61+
rules: {
62+
indent: 0,
63+
},
64+
},
65+
],
66+
};

.github/release-drafter.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name-template: v$NEXT_PATCH_VERSION
2+
tag-template: v$NEXT_PATCH_VERSION
3+
categories:
4+
- title: 🔨 Improvements
5+
label: enhancement
6+
- title: 🐛 Bug Fixes
7+
label: bug
8+
- title: 🚀 New Features
9+
label: Feature
10+
change-template: '- #$NUMBER: $TITLE by @$AUTHOR'
11+
template: |
12+
# Changes
13+
$CHANGES
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build & Release draft
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
deploy:
7+
name: build dependencies & create artifact
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/[email protected]
12+
13+
- name: Clone PrestaShop for core dependencies
14+
run: |
15+
git clone --depth=50 https://github.com/PrestaShop/PrestaShop.git ~/PrestaShop
16+
rm -rf ~/PrestaShop/modules/blockwishlist
17+
cd ..
18+
mv blockwishlist ~/PrestaShop/modules
19+
ln -s ~/PrestaShop/modules/blockwishlist
20+
cd blockwishlist
21+
22+
- name: Install Node.js
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: 12.x
26+
27+
- run: yarn install
28+
29+
- name: Build JS dependencies
30+
run: |
31+
yarn --cwd ~/PrestaShop/modules/blockwishlist run build
32+
rm -rf node_modules
33+
34+
- name: Install composer dependencies
35+
run: composer install --no-dev -o
36+
37+
- name: Clean-up project
38+
uses: PrestaShopCorp/[email protected]
39+
with:
40+
paths: node_modules
41+
42+
- name: Create & upload artifact
43+
uses: actions/upload-artifact@v1
44+
with:
45+
name: ${{ github.event.repository.name }}
46+
path: ../
47+
48+
update_release_draft:
49+
runs-on: ubuntu-latest
50+
needs: [deploy]
51+
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
52+
steps:
53+
- name: Download artifact
54+
uses: actions/download-artifact@v1
55+
with:
56+
name: ${{ github.event.repository.name }}
57+
58+
- id: release_info
59+
uses: toolmantim/release-drafter@v5
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
63+
- name: Prepare for Release
64+
run: |
65+
cd ${{ github.event.repository.name }}
66+
zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }}
67+
68+
- name: Clean existing assets
69+
shell: bash
70+
run: |
71+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
72+
assets=`bin/hub api -t repos/${{ github.repository }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'`
73+
for asset in $assets
74+
do
75+
bin/hub api -X DELETE $asset
76+
done
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
80+
- name: Publish to GitHub Release
81+
uses: actions/[email protected]
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
with:
85+
upload_url: ${{ steps.release_info.outputs.upload_url }}
86+
asset_path: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}.zip
87+
asset_name: ${{ github.event.repository.name }}.zip
88+
asset_content_type: application/zip

.github/workflows/js.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: JS tests
2+
on: [push, pull_request]
3+
jobs:
4+
js-linter:
5+
name: JS linter
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/[email protected]
10+
11+
- name: lint js dependencies
12+
uses: PrestaShopCorp/github-action-lint-js/[email protected]
13+
with:
14+
cmd: yarn
15+
path: .

.github/workflows/php.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: PHP tests
2+
on: [push, pull_request]
3+
jobs:
4+
php-linter:
5+
name: PHP Syntax check 5.6|7.2|7.3
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/[email protected]
10+
- name: PHP syntax checker 5.6
11+
uses: prestashop/github-action-php-lint/5.6@master
12+
- name: PHP syntax checker 7.2
13+
uses: prestashop/github-action-php-lint/7.2@master
14+
- name: PHP syntax checker 7.3
15+
uses: prestashop/github-action-php-lint/7.3@master
16+
php-cs-fixer:
17+
name: PHP-CS-Fixer
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/[email protected]
22+
- name: Run PHP-CS-Fixer
23+
uses: prestashopcorp/github-action-php-cs-fixer@master
24+
phpstan:
25+
name: PHPStan
26+
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
presta-versions: ['1.7.6.3', 'latest']
30+
steps:
31+
- name: Checkout
32+
uses: actions/[email protected]
33+
34+
- name: Cache vendor folder
35+
uses: actions/cache@v1
36+
with:
37+
path: vendor
38+
key: php-${{ hashFiles('composer.lock') }}
39+
40+
- name: Cache composer folder
41+
uses: actions/cache@v1
42+
with:
43+
path: ~/.composer/cache
44+
key: php-composer-cache
45+
46+
- run: composer install
47+
48+
- name: Pull PrestaShop files (Tag ${{ matrix.presta-versions }})
49+
run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }}
50+
51+
- name : Run PHPStan
52+
run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12.32 analyse --configuration=/web/module/tests/phpstan/phpstan.neon --error-format github

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# php
2+
3+
vendor
4+
.php_cs.cache
5+
6+
# vim
7+
8+
*.swp
9+
*.swo
10+
*.swn
11+
12+
# npm
13+
14+
node_modules
15+
16+
# mac
17+
.DS_Store

.php_cs.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
$config = new PrestaShop\CodingStandards\CsFixer\Config();
4+
5+
$config
6+
->setUsingCache(true)
7+
->getFinder()
8+
->in(__DIR__)
9+
->exclude('vendor');
10+
11+
return $config;

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
htmlWhitespaceSensitivity: 'ignore',
3+
semi: true,
4+
singleQuote: true,
5+
vueIndentScriptAndStyle: true,
6+
trailingComma: 'none'
7+
};

0 commit comments

Comments
 (0)