Skip to content

Commit

Permalink
Merge pull request #101 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
Progi1984 committed Mar 9, 2021
2 parents db63373 + bcf8309 commit 82e6992
Show file tree
Hide file tree
Showing 205 changed files with 25,437 additions and 4,197 deletions.
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[*.php]
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tabs
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/node_modules/
/public/
/vendor/
/bundle.js
/tests/
!.eslintrc.js
!.webpack
66 changes: 66 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// http://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
jquery: true,
},
globals: {
google: true,
document: true,
navigator: false,
window: true,
},
parserOptions: {
parser: 'babel-eslint',
},
extends: ['prestashop', 'plugin:vue/strongly-recommended'],
plugins: ['import', 'vue'],
rules: {
'class-methods-use-this': 0,
'func-names': 0,
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['tests/**/*.js', '.webpack/**/*.js'],
},
],
'max-len': ['error', {code: 120}],
'no-alert': 0,
'no-bitwise': 0,
'no-new': 0,
'no-param-reassign': ['error', {props: false}],
'no-restricted-globals': [
'error',
{
name: 'global',
message: 'Use window variable instead.',
},
],
'no-restricted-syntax': 0,
'prefer-destructuring': ['error', {object: true, array: false}],
'vue/script-indent': [
'error',
2,
{
baseIndent: 1,
switchCase: 1,
},
],
'vue/require-default-prop': 0,
},
settings: {
'import/resolver': 'webpack',
},
overrides: [
{
files: ['*.vue'],
rules: {
indent: 0,
},
},
],
};
13 changes: 13 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name-template: v$NEXT_PATCH_VERSION
tag-template: v$NEXT_PATCH_VERSION
categories:
- title: 🔨 Improvements
label: enhancement
- title: 🐛 Bug Fixes
label: bug
- title: 🚀 New Features
label: Feature
change-template: '- #$NUMBER: $TITLE by @$AUTHOR'
template: |
# Changes
$CHANGES
88 changes: 88 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Build & Release draft

on: [push, pull_request]

jobs:
deploy:
name: build dependencies & create artifact
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0

- name: Clone PrestaShop for core dependencies
run: |
git clone --depth=50 https://github.com/PrestaShop/PrestaShop.git ~/PrestaShop
rm -rf ~/PrestaShop/modules/blockwishlist
cd ..
mv blockwishlist ~/PrestaShop/modules
ln -s ~/PrestaShop/modules/blockwishlist
cd blockwishlist
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x

- run: yarn install

- name: Build JS dependencies
run: |
yarn --cwd ~/PrestaShop/modules/blockwishlist run build
rm -rf node_modules
- name: Install composer dependencies
run: composer install --no-dev -o

- name: Clean-up project
uses: PrestaShopCorp/github-action-clean-before-deploy@v1.0
with:
paths: node_modules

- name: Create & upload artifact
uses: actions/upload-artifact@v1
with:
name: ${{ github.event.repository.name }}
path: ../

update_release_draft:
runs-on: ubuntu-latest
needs: [deploy]
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: ${{ github.event.repository.name }}

- id: release_info
uses: toolmantim/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare for Release
run: |
cd ${{ github.event.repository.name }}
zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }}
- name: Clean existing assets
shell: bash
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
assets=`bin/hub api -t repos/${{ github.repository }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'`
for asset in $assets
do
bin/hub api -X DELETE $asset
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to GitHub Release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_info.outputs.upload_url }}
asset_path: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
15 changes: 15 additions & 0 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: JS tests
on: [push, pull_request]
jobs:
js-linter:
name: JS linter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0

- name: lint js dependencies
uses: PrestaShopCorp/github-action-lint-js/12@v1.0
with:
cmd: yarn
path: .
52 changes: 52 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: PHP tests
on: [push, pull_request]
jobs:
php-linter:
name: PHP Syntax check 5.6|7.2|7.3
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
- name: PHP syntax checker 5.6
uses: prestashop/github-action-php-lint/5.6@master
- name: PHP syntax checker 7.2
uses: prestashop/github-action-php-lint/7.2@master
- name: PHP syntax checker 7.3
uses: prestashop/github-action-php-lint/7.3@master
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
- name: Run PHP-CS-Fixer
uses: prestashopcorp/github-action-php-cs-fixer@master
phpstan:
name: PHPStan
runs-on: ubuntu-latest
strategy:
matrix:
presta-versions: ['1.7.6.3', 'latest']
steps:
- name: Checkout
uses: actions/checkout@v2.0.0

- name: Cache vendor folder
uses: actions/cache@v1
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}

- name: Cache composer folder
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php-composer-cache

- run: composer install

- name: Pull PrestaShop files (Tag ${{ matrix.presta-versions }})
run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }}

- name : Run PHPStan
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
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# php

vendor
.php_cs.cache

# vim

*.swp
*.swo
*.swn

# npm

node_modules

# mac
.DS_Store
11 changes: 11 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

$config = new PrestaShop\CodingStandards\CsFixer\Config();

$config
->setUsingCache(true)
->getFinder()
->in(__DIR__)
->exclude('vendor');

return $config;
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
htmlWhitespaceSensitivity: 'ignore',
semi: true,
singleQuote: true,
vueIndentScriptAndStyle: true,
trailingComma: 'none'
};

0 comments on commit 82e6992

Please sign in to comment.