Skip to content

Commit

Permalink
Merge pull request #385 from PrestaShop/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
Hlavtox authored Oct 27, 2022
2 parents 2667daa + aebfc39 commit 9d4f4cc
Show file tree
Hide file tree
Showing 373 changed files with 6,614 additions and 11,100 deletions.
40 changes: 34 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,35 @@ module.exports = {
parserOptions: {
parser: '@typescript-eslint/parser',
},
extends: ['prestashop', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:jest/recommended'],
plugins: ['import', '@typescript-eslint', 'jest'],
extends: ['airbnb-base', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:jest/recommended'],
plugins: ['import', '@typescript-eslint', 'jest'],
rules: {
indent: ['error', 2, {SwitchCase: 1}],
'function-paren-newline': ['off', 'never'],
'object-curly-spacing': ['error', 'never'],
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: ['for', 'switch', 'var', 'let', 'const'],
next: 'return',
},
{
blankLine: 'always',
prev: ['for', 'switch'],
next: ['var', 'let', 'const'],
},
{
blankLine: 'always',
prev: ['var', 'let', 'const'],
next: ['switch', 'for', 'if'],
},
],
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-console': process.env.NODE_ENV === 'production' ? 2 : 0,
'import/no-unresolved': 0,
'import/extensions': ['off', 'never'],
'no-use-before-define': 0,
'class-methods-use-this': 0,
'func-names': 0,
'import/no-extraneous-dependencies': [
Expand All @@ -29,26 +55,28 @@ module.exports = {
devDependencies: ['tests/**/*.js', '.webpack/**/*.js'],
},
],
'max-len': ['error', { code: 120 }],
'max-len': ['error', {code: 120}],
'no-alert': 0,
'no-bitwise': 0,
'no-new': 0,
'max-classes-per-file': 0,
'no-param-reassign': ['error', { props: false }],
'no-param-reassign': ['error', {props: false}],
'no-restricted-globals': [
'error',
{
name: 'global',
message: 'Use window variable instead.',
},
],
'prefer-destructuring': ['error', { object: true, array: false }],
'prefer-destructuring': ['error', {object: true, array: false}],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
},
settings: {
'import/resolver': 'webpack',
},
env: {
'jest/globals': true
'jest/globals': true,
},
overrides: [
{
Expand Down
33 changes: 27 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,47 @@
### Understanding

Before getting started, you should read our article introducing the project:
[We're Building A Starter Theme For PrestaShop 1.7.0.0](http://build.prestashop.com/news/starter-theme-kickoff/).
[We're Building A Starter Theme For PrestaShop 1.7.8 and 8](https://build.prestashop.com/news/new-theme-announce/).

If you are contributing to this theme, you are probably interested in PrestaShop development as well. Please the following article to get familiar with [PrestaShop branching model](http://build.prestashop.com/news/introducing-new-branching-model-prestashop/).

You got any questions ? Join the gitter chat room.

[![Join the chat at https://gitter.im/PrestaShop/StarterTheme](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PrestaShop/StarterTheme?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
You got any questions ? Join the open source slack.

[Join the slack at https://www.prestashop-project.org/slack/](https://www.prestashop-project.org/slack/)

### Setting up

There are few things to do before you are ready to contribute.

1. Check your _Git_ configuration. Read [Set Up Your Git For Contributing](http://build.prestashop.com/howtos/misc/set-up-your-git-for-contributing/)
1. Check your editor configuration. The rules are defined in `.editorconfig`. Do it manually or [install the available plugin](http://editorconfig.org/#download).
2. Check your editor configuration. The rules are defined in `.editorconfig`. Do it manually or [install the available plugin](http://editorconfig.org/#download).
3. Make sure you at least have [NodeJS 14](https://nodejs.org/en/download/) installed.
4. You should install the theme inside a PrestaShop instance, please refer to [the developers docummentation of the project](https://devdocs.prestashop.com/1.7/basics/installation/).

### How to build the theme

First you need to install every node module:

`npm i`

then create a `.env` file inside the *webpack* folder by copying `webpack/.env-example` and complete it with your environment's informations. Please use a free tcp port.

then build assets:

`npm run build`

### Good practices

- Follow the BEM convention
- Be careful about creating SCSS files in the right folder, refer to the [documentation](https://build.prestashop.com/hummingbird/) for further informations.
- When you want to submit a PR, please make sure that you ran both linters using `npm run lint-fix && npm run scss-fix` and fixed every lint issues.
- If your PR is a work in progress, make sure that you use the Github draft mode.
- Fill the PR template as much as possible, it's important to speed the process of testing, reviewing...
- Try to organize your commits in a way to simplify the review.

### Reporting issues

Open an issue:

1. To report a bug.
1. To propose an improvement and get feedbacks before you code it. ([example](https://github.com/PrestaShop/StarterTheme/issues/2))
2. To propose an improvement and get feedbacks before you code it. ([example](https://github.com/PrestaShop/hummingbird/issues/))
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Hummingbird theme

This is the new theme of PrestaShop we are working on. Please, if you work on this theme, use the `develop` branch of PrestaShop, because this theme will be available from version 8.0.
This is a PrestaShop's theme we are working on. Please, if you work on this theme, use the `1.7.8.x` branch of PrestaShop to make sure this theme is compatible with the latest `1.7` version.

[Read more](https://build.prestashop.com/news/new-theme-announce/) about this theme on the blog.

## How to build assets

Same as the PrestaShop project, you need **NodeJS 14.x** and **NPM 7** in order to build the project.
Same as the PrestaShop project, you need at least **NodeJS 14.x** and **NPM 7** in order to build the project.

First you need to install every node module:

Expand All @@ -18,6 +18,22 @@ then build assets:

`npm run build`

## Documentation

We use Storybook as a [documentation](https://build.prestashop.com/hummingbird/). As the theme is currently in development, there is a lot of work on documentation. Don't hesitate to add whatever you feel usefull to it.

## Contributing

Please refer to the [contributing guide](https://github.com/PrestaShop/hummingbird/blob/develop/CONTRIBUTING.md)

## Continuous Integration

The CI runs contain stylelint, eslint, TypeScript type checks.

## Continuous Deployment

When develop is merged into master, the Storybook is delivered almost instantly to his public link using a Github Pages.

## License

This theme is released under the [Academic Free License 3.0][AFL-3.0]
Expand Down
7 changes: 5 additions & 2 deletions config/theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0
author:
name: "PrestaShop Team"
email: "[email protected]"
url: "https://www.prestashop.com"
url: "https://www.prestashop-project.org/"

meta:
compatibility:
Expand Down Expand Up @@ -67,16 +67,19 @@ global_settings:
- ps_searchbar
displayHome:
- ps_imageslider
- ps_customtext
- ps_featuredproducts
- ps_banner
- ps_customtext
- ps_newproducts
- ps_bestsellers
displayFooterBefore:
- ps_emailsubscription
- ps_socialfollow
displayFooter:
- ps_linklist
- ps_customeraccountlinks
- ps_contactinfo
- ~
displayLeftColumn:
- ps_categorytree
- ps_facetedsearch
Expand Down
7 changes: 3 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
const path = require('path');

const config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
'moduleNameMapper': {
moduleNameMapper: {
'^@js(.*)$': '<rootDir>/src/js$1',
'^@services(.*)$': '<rootDir>/src/js/services$1',
'^@constants(.*)$': '<rootDir>/src/js/constants$1',
'^@helpers(.*)$': '<rootDir>/src/js/helpers$1',
}
},
};

module.exports = config;
24 changes: 2 additions & 22 deletions modules/blockreassurance/views/templates/hook/blockreassurance.tpl
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}
{if $elements}
<div id="block-reassurance">
Expand Down
24 changes: 2 additions & 22 deletions modules/contactform/views/templates/widget/contactform.tpl
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}
<section class="contact-form">
<form action="{$urls.pages.contact}" method="post" {if $contact.allow_file_upload}enctype="multipart/form-data"{/if}>
Expand Down
24 changes: 2 additions & 22 deletions modules/productcomments/views/templates/hook/alert-modal.tpl
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}

{assign var='icon' value=$icon|default:'check_circle'}
Expand Down
24 changes: 2 additions & 22 deletions modules/productcomments/views/templates/hook/confirm-modal.tpl
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}

{assign var='icon' value=$icon|default:'check_circle'}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}

<div id="empty-product-comment" class="product-comment-list-item">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}

<script type="text/javascript">
Expand Down
Loading

0 comments on commit 9d4f4cc

Please sign in to comment.