Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
Resolved merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
marianoeramirez committed Jun 28, 2020
2 parents f2c3031 + b296500 commit 071c2ea
Show file tree
Hide file tree
Showing 508 changed files with 9,471 additions and 25,706 deletions.
15 changes: 3 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,21 @@ jobs:
build:
working_directory: ~/app
docker:
- image: circleci/node:10.7.0-browsers
- image: circleci/node:12.16.3-browsers
steps:
- checkout
- run:
name: Install system dependencies
command: sudo apt-get install -y libpng-dev
- run:
name: Install dependencies
command: npm install
- run:
name: Run typescript checker
command: npx tsc --noEmit & npx tsc --noEmit -p src/@sdk & npx tsc --noEmit -p src/@next
- run:
name: Run tslint
command: npm run tslint
command: npm ci
- run:
name: Build application
command: npm run build
- run:
name: Run tests
command: npm run test
- run:
name: Package lock security test
command: npx lockfile-lint --path package-lock.json --allowed-hosts npm yarn
- run:
name: lhci autorun
command: npx lhci autorun --upload.target=temporary-public-storage || echo "LHCI failed!"
Expand All @@ -36,7 +27,7 @@ jobs:
- dist/*
cypress/run:
docker:
- image: cypress/base:10
- image: cypress/base:12.16.2
environment:
TERM: xterm
parallelism: 1
Expand Down
76 changes: 76 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"extends": [
"airbnb-typescript",
"prettier",
"prettier/react",
"plugin:import/errors",
"plugin:import/typescript"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint", "import", "react", "prettier"],
"rules": {
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/indent": "off",
"@typescript-eslint/quotes": "off",
"comma-spacing": "off",
"import/no-cycle": "off",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/stories.tsx",
"**/test.ts",
"**/*.test.ts",
"**/test.tsx",
"**/tests.tsx",
"config/**/*",
"*.config.js",
"src/@next/pages/baseStory.ts"
]
}
],
"import/no-internal-modules": "off",
"import/no-named-as-default": "off",
"import/order": "error",
"import/prefer-default-export": "off",
"no-nested-ternary": "off",
"prettier/prettier": ["error"],
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-spreading": "off",
"react/jsx-wrap-multilines": "off",
"react/prop-types": "off",
"sort-imports": "off",
"no-underscore-dangle": "off",
"react/state-in-constructor": "off",
"react/static-property-placement": "off",

"sort-keys": "off",
"no-prototype-builtins": "off",
"no-shadow": "off",
"jsx-a11y/click-events-have-key-events": "off",
"consistent-return": "off",
"react/no-this-in-sfc": "off",
"array-callback-return": "off",
"no-plusplus": "off",
"react/no-did-update-set-state": "off",
"jsx-a11y/no-static-element-interactions": "off",
"react/destructuring-assignment": "off",
"react/button-has-type": "off",
"@typescript-eslint/no-use-before-define": "off",
"no-useless-escape": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"react/no-array-index-key": "off",
"no-param-reassign": "off",
"no-empty-pattern": "off",
"no-restricted-globals": "off",
"@typescript-eslint/no-unused-vars": "off"
},
"settings": {
"import/resolver": {
"typescript": {}
}
}
}
73 changes: 73 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: QA

on:
pull_request:
branches: [ '*' ]

jobs:

check-lock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2


- name: Validate lock file
run: |
npx lockfile-lint --path package-lock.json --allowed-hosts npm yarn
tsc-and-linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-qa-${{ env.cache-name }}-
${{ runner.os }}-qa-
${{ runner.os }}-
- name: Install deps
run: |
npm ci
- name: Run tsc
run: |
npm run tsc
- name: Run linters
run: |
npm run lint
jest-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-qa-${{ env.cache-name }}-
${{ runner.os }}-qa-
${{ runner.os }}-
- name: Install deps
run: |
npm ci
- name: Run jest
run: |
npm run test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
!.dockerignore
!.storybook
!.circle
!.eslintrc
!.gitignore
!.github
!.babelrc
!.plop
!.jest
!.linguirc
!.prettierrc
!.prettierignore
dist
node_modules
src/locales/_build
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gqlTypes
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"arrowParens": "avoid",
"trailingComma": "es5"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { addSerializer } from "jest-specific-snapshot";

jest.mock("react-dom", () => ({
createPortal: node => node,
findDOMNode: () => {}
findDOMNode: () => {},
}));

global.matchMedia = media => ({
(global as any).matchMedia = () => ({
addListener: jest.fn(),
matches: true,
removeListener: jest.fn()
removeListener: jest.fn(),
});

addSerializer(styleSheetSerializer);

initStoryshots({
framework: "react",
test: multiSnapshotWithOptions({})
test: multiSnapshotWithOptions({}),
});
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@ All notable, unreleased changes to this project will be documented in this file.

## [Unreleased]

- Add product hyperlink in cart page - #745 by @konstantinoschristomanos
- Add Cypress tags to all of the buttons (also speed up tests) - #718 by @krzysztofwolski
- Automatically choose variant attributes from url in ProductVariantPicker - #708 by @AlicjaSzu
- Use sdk as a standalone package - #724 by @dominik-zeglen
- Fix CartRow tests - #749 by @dominik-zeglen
- Add prettier to precommit - #766 by @dominik-zeglen
- Do not use prettier on generated files - #773 by @dominik-zeglen
- Add eslint - #776 by @dominik-zeglen

## 2.10.2

- Fix fetching `quantityAvailable` field - #738 by @AlicjaSzu

## 2.10.1

- Replace stockQuantity field with quantityAvailable - #723 by @AlicjaSzu
- Regenerate types - #712 by @dominik-zeglen

## 2.10.0

Expand Down Expand Up @@ -37,7 +53,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Hide payment options - #678 by @orzechdev
- Fix unhandled JWT token expiration - #696 by @orzechdev
- Regenerate types - #712 by @dominik-zeglen
- Automatically choose variant attributes from url in ProductVariantPicker - #708 by @AlicjaSzu
- Replace stockQuantity field with quantityAvailable - #723 by @AlicjaSzu

## 0.7.0

Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ COPY package*.json ./
RUN npm install
COPY . .
ARG API_URI
ARG SENTRY_DSN
ARG SENTRY_APM
ARG DEMO_MODE
ARG GTM_ID
ENV API_URI ${API_URI:-http://localhost:8000/graphql/}
RUN API_URI=${API_URI} npm run build

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cd saleor-storefront
To use the official stable release, checkout to a release tag:

```
$ git checkout 2.10.0
$ git checkout 2.10.1
```

See the list of all releases here: https://github.com/mirumee/saleor-storefront/releases/
Expand Down
50 changes: 44 additions & 6 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,51 @@
module.exports = {
presets: [
module.exports = api => {
const isExtract = api.env("extract");
const isTest = api.env("test");
const isStorybook = api.env("storybook");

const ignore =
isTest || isStorybook
? []
: ["**/*.test.ts", "**/*.test.tsx", "src/storybook"];
const presets = [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript",
],
plugins: [
[
"@babel/preset-typescript",
{
allowNamespaces: true,
},
],
];
const plugins = [
"@babel/plugin-syntax-dynamic-import",
"transform-class-properties",
"@babel/transform-runtime",
"@babel/plugin-proposal-optional-chaining",
],
[
"react-intl-auto",
{
filebase: true,
includeExportName: "all",
removePrefix: "src/",
},
],
];
if (isExtract) {
plugins.push([
"react-intl",
{
extractFromFormatMessageCall: true,
messagesDir: "dist/locale/",
},
]);
}

plugins.push("macros");

return {
ignore,
plugins,
presets,
};
};
Loading

0 comments on commit 071c2ea

Please sign in to comment.