Skip to content

Commit

Permalink
Merge pull request #335 from PrestaShopCorp/ACCOUNT-1795/feat/add-reb…
Browse files Browse the repository at this point in the history
…randing-to-5.x

[ACCOUNT-1795] Add rebranding to 5.x & use same front end setup as 6.x
  • Loading branch information
emmanuelgautier authored May 15, 2023
2 parents 749500a + 5cb5913 commit 372e9d2
Show file tree
Hide file tree
Showing 69 changed files with 2,169 additions and 13,308 deletions.
39 changes: 32 additions & 7 deletions .github/workflows/build-release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,45 @@ jobs:
- name: Checkout
uses: actions/[email protected]

- name: Setup node env 🏗
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
scope: '@prestashopcorp'

- name: Bump version
run: |
VERSION=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//' | cut -d'-' -f1) \
make version
- name: Build JS dependencies
uses: PrestaShopCorp/github-action-build-js/[email protected]
with:
cmd: yarn
path: ./_dev

- name: Install composer dependencies
run: composer install --no-dev -o

- name: Get yarn cache directory path 🛠
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
working-directory: ./_dev

- name: Cache node_modules 📦
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install _dev dependencies 👨🏻‍💻
working-directory: ./_dev
run: yarn --frozen-lockfile --silent
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_RO }}

- name: Build apps
working-directory: ./_dev
run: yarn build

- name: Clean-up project
uses: PrestaShopCorp/[email protected]

Expand Down Expand Up @@ -140,4 +165,4 @@ jobs:
run: |
~/.composer/vendor/bin/publish-on-marketplace --archive=$PWD/${{ github.event.repository.name }}.zip --metadata-json=$PWD/.github/mktp-metadata.json --changelog="${{ github.event.release.body }}" --debug
env:
MARKETPLACE_API_KEY: ${{ secrets.MARKETPLACE_API_KEY }}
MARKETPLACE_API_KEY: ${{ secrets.MARKETPLACE_API_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ views/files/*
### Vuejs ignore build files ###
/views/js/app*.js
/views/js/app*.js.map
/views/css/app*.css
/views/js/chunk-vendors*.js
/views/js/chunk-vendors*.js.map
/views/js/settings*.js
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/erbium
v18
3 changes: 0 additions & 3 deletions _dev/.eslintignore

This file was deleted.

49 changes: 8 additions & 41 deletions _dev/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,14 @@
module.exports = {
root: true,
env: {
node: true,
},
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
sourceType: "module",
parser: "babel-eslint",
},
extends: [
"prestashop",
"plugin:vue/strongly-recommended",
"eslint:recommended",
"plugin:prettier/recommended",
"prettier/vue",
],
plugins: ["import", "vue", "prettier"],
extends: ['@vue/typescript/recommended', 'plugin:vue/vue3-recommended', 'prettier'],
rules: {
"prettier/prettier": ["warn"],
"vue/component-name-in-template-casing": ["error", "PascalCase"],
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"template-curly-spacing": "off",
indent: "off",
"no-param-reassign": ["error", { props: false }],
"prefer-destructuring": ["error", { object: true, array: false }],
"import/no-extraneous-dependencies": [
"error",
indent: ['error', 2],
'vue/multi-word-component-names': 'off',
indent: [
'error',
2,
{
devDependencies: [".storybook/**", "./src/stories/**"],
SwitchCase: 1,
},
],
},
overrides: [
{
files: ["*.vue"],
rules: {
indent: 0,
},
},
],
};
};
1 change: 0 additions & 1 deletion _dev/.yarnclean
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ docs
doc
website
images
assets

# examples
example
Expand Down
29 changes: 0 additions & 29 deletions _dev/babel.config.js

This file was deleted.

13 changes: 13 additions & 0 deletions _dev/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
96 changes: 27 additions & 69 deletions _dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,80 +3,38 @@
"version": "5.3.6",
"private": true,
"scripts": {
"dev": "vue-cli-service build --no-clean --mode development --watch",
"build": "vue-cli-service build --no-clean",
"lint": "vue-cli-service lint"
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"lint": "eslint --ext .js,.ts,.vue .",
"lint:fix": "eslint --ext .js,.ts,.vue . --fix"
},
"dependencies": {
"@prestashopcorp/segment-vue": "^1.2.10",
"@sentry/browser": "^5.24.2",
"@sentry/integrations": "^5.24.2",
"@sentry/tracing": "^5.24.2",
"@vue/composition-api": "^1.0.0-beta.3",
"autoprefixer": "^9.8.6",
"axios": "^0.19.2",
"bootstrap": "^4.5.0",
"bootstrap-vue": "^2.15.0",
"chart.js": "^2.9.3",
"core-js": "^3.6.4",
"lodash": "^4.17.17",
"moment": "^2.26.0",
"moment-range": "^4.0.2",
"prestakit": "^1.1.0",
"@prestashopcorp/ps-accounts-sdk": "^0.3.2",
"@prestashopcorp/puik": "^1.2.0",
"@splidejs/splide": "^4.0.8",
"prestashop_accounts_vue_components": "^4.2.7",
"regenerator-runtime": "^0.13.5",
"tailwindcss": "^1.8.10",
"tween.js": "^16.6.0",
"vue": "^2.6.11",
"vue-content-loader": "^0.2.3",
"vue-i18n": "^8.18.2",
"vue-router": "^3.2.0",
"vue-styled-components": "^1.5.1",
"vue2-collapse": "^1.0.15",
"vuex": "^3.4.0"
"vue": "^3.2.38",
"vue-i18n": "^9.2.2",
"zoid": "9.0.63"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/preset-env": "^7.10.4",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"@vue/babel-preset-jsx": "^1.1.2",
"@vue/cli-plugin-babel": "~4.3.0",
"@vue/cli-plugin-eslint": "~4.3.0",
"@vue/cli-service": "~4.3.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"babel-preset-vue": "^2.0.2",
"eslint": "7.2.0",
"eslint-config-airbnb": "18.2.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-config-node": "^4.1.0",
"eslint-config-prestashop": "0.0.2",
"eslint-config-prettier": "^6.11.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-jsx-a11y": "^6.3.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.14.1",
"prettier": "^2.0.5",
"sass-loader": "^8.0.2",
"vue-loader": "^15.9.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
"@types/node": "^18.16.2",
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"@vitejs/plugin-vue": "^3.0.3",
"@vue/eslint-config-typescript": "^11.0.0",
"autoprefixer": "^10.4.8",
"eslint": "^8.23.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-vue": "^9.4.0",
"postcss": "^8.4.16",
"prettier": "^2.7.1",
"prettier-eslint": "^15.0.1",
"sass": "^1.54.8",
"tailwindcss": "^3.1.8",
"typescript": "^4.6.2",
"vite": "^3.0.9",
"vue-tsc": "^0.40.5"
},
"browserslist": [
"> 1%",
Expand Down
10 changes: 5 additions & 5 deletions _dev/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const autoprefixer = require("autoprefixer");
const tailwindcss = require("tailwindcss");

module.exports = {
plugins: [tailwindcss, autoprefixer],
};
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
69 changes: 69 additions & 0 deletions _dev/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!--**
* 2007-2022 PrestaShop and Contributors
*
* 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.txt.
* 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 license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2022 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*-->
<template>
<div id="settingsApp">
<div class="onboarding">
<section class="onboarding-header">
<ConfigInformation />
</section>

<section class="onboarding-content">
<prestashop-accounts></prestashop-accounts>
</section>
</div>
</div>
</template>

<script setup lang="ts">
import ConfigInformation from "@/components/ConfigInformation.vue";
import { onMounted } from "vue";

onMounted(async () => {
if (window?.psaccountsVue) {
return window?.psaccountsVue?.init();
}
const accountFallback = (await import("prestashop_accounts_vue_components")).default;
accountFallback.init();
});
</script>
<style lang="scss">
#settingsApp {
font-family: Open Sans, Helvetica, Arial, sans-serif;
}
.nobootstrap {
background-color: unset !important;
padding: 100px 10px 100px;
min-width: unset !important;
}
.page-sidebar.mobile #content.nobootstrap {
@apply psacc-ml-0;
}
.onboarding {
@apply psacc-pt-24 psacc-max-w-screen-lg psacc-mx-auto;
&-header {
@apply psacc-mb-2;
}
@screen md {
@apply psacc-pt-4;
&-header {
@apply psacc-mb-4;
}
}
}
</style>
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@tailwind base;

@tailwind components;

@tailwind utilities;
@tailwind utilities;
Loading

0 comments on commit 372e9d2

Please sign in to comment.