Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit ba67269

Browse files
authored
Merge branch 'release/v1.11-rc1' into add-website-id-to-password-reset
2 parents 5362c4a + 664b6fe commit ba67269

File tree

107 files changed

+6325
-2157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+6325
-2157
lines changed

.eslintrc.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
module.exports = {
2+
root: true,
3+
env: { jest: true, node: true, es6: true},
4+
parserOptions: {
5+
parser: '@typescript-eslint/parser',
6+
ecmaVersion: 2018,
7+
sourceType: 'module'
8+
},
9+
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
10+
extends: [
11+
'standard',
12+
'plugin:@typescript-eslint/recommended'
13+
],
14+
plugins: ['vue-storefront', '@typescript-eslint'],
15+
// add your custom rules here
16+
rules: {
17+
'@typescript-eslint/no-var-requires': 1,
18+
'@typescript-eslint/indent': ['error', 2],
19+
'@typescript-eslint/camelcase': 0,
20+
semi: 'off',
21+
'@typescript-eslint/semi': 0,
22+
'@typescript-eslint/member-delimiter-style': ['error', { 'multiline': { 'delimiter': 'comma', 'requireLast': false }, 'singleline': { 'delimiter': 'comma' } }],
23+
'@typescript-eslint/no-empty-interface': 1,
24+
'@typescript-eslint/no-use-before-define': 1,
25+
'@typescript-eslint/no-explicit-any': 0,
26+
'@typescript-eslint/class-name-casing': 1,
27+
'@typescript-eslint/no-unused-vars': 0,
28+
'@typescript-eslint/explicit-function-return-type': 0,
29+
'@typescript-eslint/no-var-requires': 0,
30+
'handle-callback-err': 1,
31+
'prefer-promise-reject-errors': 0,
32+
'import/no-duplicates': ['warning'],
33+
// allow paren-less arrow functions
34+
'arrow-parens': 0,
35+
'prefer-arrow-callback': 1,
36+
// allow async-await
37+
'generator-star-spacing': 0,
38+
// allow debugger during development
39+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
40+
'no-restricted-imports': [2, { paths: ['lodash-es'] }],
41+
'vue-storefront/no-corecomponent-import': 'error',
42+
'vue-storefront/no-corecomponent': 'error',
43+
'vue-storefront/no-corepage-import': 'error',
44+
'vue-storefront/no-corepage': 'error',
45+
'no-console': 0,
46+
'no-unused-vars': 1
47+
},
48+
overrides: [
49+
{
50+
// @todo check if this is closed https://github.com/typescript-eslint/typescript-eslint/issues/342
51+
// This is an issue with interfaces so we need to wait until it fixed.
52+
files: ['core/**/*.ts'],
53+
rules: {
54+
'no-undef': 1
55+
}
56+
}
57+
]
58+
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ api_test.sh
99
package-lock.json
1010
src/config.json
1111
config/local.json
12+
config/certs/*.pem
1213
var/magento2-sample-data/
1314
.migrate
1415
*.iml

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,12 @@ jobs:
2121
- <<: *build
2222
node_js: '8'
2323

24+
- &unit
25+
stage: Test
26+
script: yarn test:unit
27+
name: "NodeJS 10 unit tests"
28+
node_js: "10"
29+
30+
- <<: *unit
31+
name: "NodeJS 8 unit tests"
32+
node_js: "8"

CHANGELOG.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,36 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.11.0-rc.2] - unreleased
8+
9+
### Fixed
10+
11+
- Fixed some smaller issues with graphql so that it is now working again with the fronted - #350
12+
13+
14+
## [1.11.0-rc.1] - 2019.10.03
15+
16+
### Added
17+
- Output cache support with tagging and cache invalidate requests forwarding - @pkarw @resubaka (https://github.com/DivanteLtd/vue-storefront/issues/3367, #333)
18+
- Constant for Mailchimp subscription status - @KonstantinSoelch (#294)
19+
- mage2vs import now has optional `--generate-unique-url-keys` parameter which defaults to `false` to enable/disable the url key generation with name and id for categories - @rain2o (#232)
20+
- `extensions/elastic-stock` module added which is a drop-in replacement for `stock`; the difference is that it's getting the stock information from Elastic, not from e-Commerce backend directly; to use it - please just make sure your `config/local.json` file has `elastic-stock` in the `registeredExtensions` collection; then please make sure in the `vue-storefront` to change the `config.stock.ednpoint` from `http://<your-api-host>/api/stock` to `http://<your-api-host>/api/ext/elastic-stock`
21+
- Added eslint config from vue-storefront so we have the same config and in both repos typescript support - @resubaka (#320)
22+
- Added jest support - @resubaka (#321)
23+
- Added caching factory and action factory for the image endpoint. This gives the possibility to use other services for caching or image processing - @resubaka (#317, #315)
24+
- Added support for tax calculation where the values from customer_tax_class_ids is used - @resubaka (#307)
25+
26+
### Fixed
27+
- The `product.price_*` fields have been normalized with the backward compatibility support (see `config.tax.deprecatedPriceFieldsSupport` which is by default true) - @pkarw (#289)
28+
- The `product.final_price` field is now being taken into product price calcualtion. Moreover, we've added the `config.tax.finalPriceIncludesTax` - which is set to `true` by default. All the `price`, `original_price` and `special_price` fields are calculated accordingly. It was required as Magento2 uses `final_price` to set the catalog pricing rules after-prices - @pkarw (#289)
29+
- Force ES connections to use protocol config option - @cewald (#303, #304)
30+
- Better handling of HTTP error codes provided by API client - #3151
31+
32+
### Changed
33+
- Error responses for mailchimp - @andrzejewsky (#3337)
34+
- Replaced function arguments to object destructuring in `calculateProductTax` - @andrzejewsky (#3337)
35+
- Refactor `taxcalc.js` similar to frontend - @gibkigonzo (#356)
36+
737
## [1.10.0] - 2019.08.12
838

939
### Added
@@ -16,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1646
- Extensions have ability to modify Elasticsearch results. - @grimasod (#269)
1747
- Refactored Travis build config - @Tjitse-E (#273)
1848
- Multistore support for `magento1`-platform using `magento1-vsbridge` - @cewald (#276)
49+
- Support self signed certificates - @lukeromanowicz (#287)
1950

2051
### Changed
2152
- Sharp dependency has been updated. *It might require reinstalling yarn dependencies* - @lukeromanowicz
@@ -56,7 +87,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5687
- Support unicode characters in order requests - @lukeromanowicz (#201)
5788
- TravisCI configured for building and linting - @lukeromanowicz (#204)
5889
- Use Redis database from configuration in mage2vs - @Cyclonecode (#211)
59-
- Requests with invalid body result in HTTP code 400 instead of 500 - @AndreiBelokopytov (#220)
90+
- Requests with invalid body result in HTTP code 400 instead of 500 - @AndreiBelokopytov (#220)
6091
- `src/models/order.schema.json` was moved to `src/models/order.schema.js` to support regex transformation - @lukeromanowicz (#201)
6192

6293
## [1.8.4] - 2019.04.17

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ This backend is using ElasticSearch data formats popularized by [ElasticSuite fo
8282
Please use data migration mechanism provided to manipulate Redis, ElasticSearch or kue. Details: https://github.com/DivanteLtd/vue-storefront-api/tree/master/doc
8383

8484
## Adding custom modules with own dependencies (Yarn only)
85-
When adding custom [Extensions to the API](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Extending%20vue-storefront-api.md) you might want to define some dependencies inside them. Thanks to [Yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) dependecies defined inside your custom module will be intaled when you execute `yarn` at project root level, so it's way esier and faster than installing all modules dependcies separetly.
85+
When adding custom [Extensions to the API](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Extending%20vue-storefront-api.md) you might want to define some dependencies inside them. Thanks to [Yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) dependencies defined inside your custom module will be installed when you execute `yarn` at project root level, so it's way easier and faster than installing all modules dependencies separately.
8686

8787
To do this, define the `package.json` with your dependencies in your custom module:
8888
- `src/api/extensions/{your-custom-extension}/package.json`
@@ -94,6 +94,24 @@ NOTE: `npm` users will still have to install the dependencies individually in th
9494

9595
## Reviews
9696
To use review feature you need to install custom module for Magento 2: [Divante ReviewApi](https://github.com/DivanteLtd/magento2-review-api)
97+
By default new reviews will be added with status "Pending".
98+
```json
99+
"review": {
100+
"defaultReviewStatus": 2
101+
},
102+
```
103+
104+
## Output Cache
105+
Vue Storefront API supports output cache for catalog operations. Cache is tagged and can by dynamically invalidated. Please find the details how to configure it [in our docs](https://docs.vuestorefront.io/guide/basics/ssr-cache.html).
106+
107+
You can manually clear the Redis cache for specific tags by running the following command:
108+
109+
```bash
110+
npm run cache clear
111+
npm run cache clear -- --tag=product,category
112+
npm run cache clear -- --tag=P198
113+
npm run cache clear -- --tag=*
114+
```
97115

98116
## Running initial Magento2 import
99117

@@ -141,6 +159,11 @@ You can use the following command to run a delta indexer for a specific storevie
141159
yarn mage2vs productsdelta --store-code=de
142160
```
143161

162+
## Self signed certificates
163+
164+
Often in non production environment other services are using self signed certificates for secure connection.
165+
You can easily setup the application to trust them by putting them in config/certs directory.
166+
144167
License
145168
-------
146169

config/certs/.gitkeep

Whitespace-only changes.

config/default.json

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
"server": {
33
"host": "localhost",
44
"port": 8080,
5-
"searchEngine": "elasticsearch"
5+
"searchEngine": "elasticsearch",
6+
"useOutputCacheTagging": false,
7+
"useOutputCache": false,
8+
"outputCacheDefaultTtl": 86400,
9+
"availableCacheTags": ["P", "C", "T", "A", "product", "category", "attribute", "taxrule"],
10+
"invalidateCacheKey": "aeSu7aip",
11+
"invalidateCacheForwarding": false,
12+
"invalidateCacheForwardUrl": "http://localhost:3000/invalidate?key=aeSu7aip&tag="
613
},
714
"orders": {
815
"useServerQueue": false
@@ -14,8 +21,6 @@
1421
"host": "localhost",
1522
"port": 9200,
1623
"protocol": "http",
17-
"user": "elastic",
18-
"password": "changeme",
1924
"min_score": 0.01,
2025
"indices": [
2126
"vue_storefront_catalog",
@@ -70,8 +75,12 @@
7075
"tax": {
7176
"defaultCountry": "DE",
7277
"defaultRegion": "",
78+
"deprecatedPriceFieldsSupport": true,
7379
"calculateServerSide": true,
74-
"sourcePriceIncludesTax": false
80+
"sourcePriceIncludesTax": false,
81+
"finalPriceIncludesTax": true,
82+
"userGroupId": null,
83+
"useOnlyDefaultUserGroupId": false
7584
},
7685
"i18n": {
7786
"fullCountryName": "Germany",
@@ -102,7 +111,11 @@
102111
"defaultCountry": "IT",
103112
"defaultRegion": "",
104113
"calculateServerSide": true,
105-
"sourcePriceIncludesTax": false
114+
"sourcePriceIncludesTax": false,
115+
"deprecatedPriceFieldsSupport": true,
116+
"finalPriceIncludesTax": true,
117+
"userGroupId": null,
118+
"useOnlyDefaultUserGroupId": false
106119
},
107120
"i18n": {
108121
"fullCountryName": "Italy",
@@ -128,7 +141,14 @@
128141
"alwaysSyncPlatformPricesOver": false,
129142
"usePlatformTotals": true,
130143
"setConfigurableProductOptions": true,
131-
"sourcePriceIncludesTax": false
144+
"sourcePriceIncludesTax": false,
145+
"deprecatedPriceFieldsSupport": true,
146+
"finalPriceIncludesTax": true,
147+
"userGroupId": null,
148+
"useOnlyDefaultUserGroupId": false
149+
},
150+
"review": {
151+
"defaultReviewStatus": 2
132152
},
133153
"bodyLimit": "100kb",
134154
"corsHeaders": [
@@ -140,13 +160,15 @@
140160
"example-magento-api",
141161
"cms-data",
142162
"mail-service",
143-
"example-processor"
163+
"example-processor",
164+
"elastic-stock"
144165
],
145166
"extensions": {
146167
"mailchimp": {
147168
"listId": "e06875a7e1",
148169
"apiKey": "a9a3318ea7d30f5c5596bd4a78ae0985-us3",
149-
"apiUrl": "https://us3.api.mailchimp.com/3.0"
170+
"apiUrl": "https://us3.api.mailchimp.com/3.0",
171+
"userStatus": "subscribed"
150172
},
151173
"mailService": {
152174
"transport": {
@@ -210,7 +232,22 @@
210232
"queue": 2,
211233
"process": 4
212234
},
213-
"simd": true
235+
"simd": true,
236+
"caching": {
237+
"active": false,
238+
"type": "file",
239+
"file": {
240+
"path": "/tmp/vue-storefront-api"
241+
},
242+
"google-cloud-storage": {
243+
"libraryOptions": {},
244+
"bucket": "",
245+
"prefix": "vue-storefront-api/image-cache"
246+
}
247+
},
248+
"action": {
249+
"type": "local"
250+
}
214251
},
215252
"entities": {
216253
"category": {

config/test.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ services:
55
build: docker/elasticsearch/
66
volumes:
77
- ./docker/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
8-
- ./docker/elasticsearch/data:/usr/share/elasticsearch/data
98
ports:
109
- '9200:9200'
1110
- '9300:9300'

docker/vue-storefront-api/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ WORKDIR /var/www
77
RUN apk add --no-cache curl git
88

99
COPY package.json ./
10+
COPY yarn.lock ./
1011

1112
RUN apk add --no-cache --virtual .build-deps ca-certificates wget && \
1213
yarn install --no-cache && \

0 commit comments

Comments
 (0)