diff --git a/.github/workflows/updateModules.yml b/.github/workflows/updateModules.yml new file mode 100644 index 00000000..44899806 --- /dev/null +++ b/.github/workflows/updateModules.yml @@ -0,0 +1,66 @@ +name: Cron Update Modules +on: + schedule: + - cron: '0 23 * * *' + workflow_dispatch: + +permissions: + contents: read + +jobs: + update-composer-modules: + permissions: + contents: write # for peter-evans/create-pull-request to create branch + pull-requests: write # for peter-evans/create-pull-request to create a PR + runs-on: ubuntu-latest + name: Update Modules + + steps: + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + registry-url: 'https://registry.npmjs.org' + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: develop + + - name: Checkout PrestaShop + uses: actions/checkout@v4 + with: + repository: PrestaShop/PrestaShop + fetch-depth: 1 + path: prestashop + ref: develop + + - name: Install NPM dependencies + run: npm ci + + - name: Execute script for updating modules + run: npm run check:data:modules > cron_php_update_modules.txt + + - name: Update PrestaShop packages + id: updated-packages + run: | + if [[ -f cron_php_update_modules.txt ]]; then + FILE_CONTENT=$(cat cron_php_update_modules.txt) + echo PR_BODY=$FILE_CONTENT >> $GITHUB_OUTPUT + rm cron_php_update_modules.txt + else + echo 'Nothing to update' + fi + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + if: ${{steps.updated-packages.outputs.PR_BODY}} != '' + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: cron-php-update-modules + commit-message: '`@data/demo/modules`: Update modules' + title: '`@data/demo/modules`: Update modules' + body: ${{steps.updated-packages.outputs.PR_BODY}} + base: main + delete-branch: true diff --git a/package-lock.json b/package-lock.json index ae16f85a..f56d2cec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ "eslint-plugin-html": "^7.1.0", "eslint-plugin-import": "^2.29.1", "tsc-alias": "^1.8.8", + "tsconfig-paths": "^4.2.0", "typescript": "^5.3.3" } }, @@ -2246,6 +2247,18 @@ "node": ">=0.10.0" } }, + "node_modules/eslint-plugin-import/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/eslint-plugin-import/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -2267,6 +2280,18 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-import/node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -3642,15 +3667,15 @@ "dev": true }, "node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, "bin": { "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" } }, "node_modules/keyv": { @@ -5253,15 +5278,17 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", - "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", "dev": true, "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", + "json5": "^2.2.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" } }, "node_modules/tslib": { @@ -7460,6 +7487,15 @@ "esutils": "^2.0.2" } }, + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -7474,6 +7510,18 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true + }, + "tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } } } }, @@ -8392,13 +8440,10 @@ "dev": true }, "json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true }, "keyv": { "version": "4.5.4", @@ -9538,13 +9583,12 @@ } }, "tsconfig-paths": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", - "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", "dev": true, "requires": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", + "json5": "^2.2.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } diff --git a/package.json b/package.json index 99b8b394..002c5df7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,10 @@ "lint": "eslint --ignore-path .gitignore .", "build": "tsc && tsc-alias && npm run copy:assets", "prepare": "npm run build", - "copy:assets": "cp assets dist/ -R" + "copy:assets": "cp assets dist/ -R", + "// Scripts": "", + "// - Check data modules": "Script to check if data modules are updated", + "check:data:modules": "ts-node -r tsconfig-paths/register src/scripts/updateModules.ts" }, "repository": { "type": "git", @@ -54,6 +57,7 @@ "eslint-plugin-html": "^7.1.0", "eslint-plugin-import": "^2.29.1", "tsc-alias": "^1.8.8", + "tsconfig-paths": "^4.2.0", "typescript": "^5.3.3" }, "publishConfig": { diff --git a/src/data/demo/modules.ts b/src/data/demo/modules.ts index 395d7722..3edf934d 100644 --- a/src/data/demo/modules.ts +++ b/src/data/demo/modules.ts @@ -37,7 +37,7 @@ export default { psFacetedSearch: new FakerModule({ tag: 'ps_facetedsearch', name: 'Faceted search', - releaseZip: 'https://github.com/PrestaShop/ps_facetedsearch/releases/download/v3.15.1/ps_facetedsearch.zip', + releaseZip: 'https://github.com/PrestaShop/ps_facetedsearch/releases/download/v3.16.1/ps_facetedsearch.zip', }), psGdpr: new FakerModule({ tag: 'psgdpr', diff --git a/src/versions/develop/pages/FO/classic/myAccount/myWishlists/index.ts b/src/versions/develop/pages/FO/classic/myAccount/myWishlists/index.ts index 6a0fb541..caf77dc8 100644 --- a/src/versions/develop/pages/FO/classic/myAccount/myWishlists/index.ts +++ b/src/versions/develop/pages/FO/classic/myAccount/myWishlists/index.ts @@ -73,7 +73,7 @@ class MyWishlistsPage extends FOBasePage implements FoMyWishlistsPageInterface { await page.locator(this.wishlistListItemNthLink(nth)).click(); if (await this.elementNotVisible(page, foClassicMyWishlistsViewPage.productListEmpty, 3000)) { - await this.elementVisible(page, foClassicMyWishlistsViewPage.productListEmpty, 3000) + await this.elementVisible(page, foClassicMyWishlistsViewPage.productListEmpty, 3000); } }