Skip to content

Commit 09ef606

Browse files
author
Tomasz Kostuch
authored
Merge pull request #4547 from DivanteLtd/hotfix/v1.12.1
Hotfix/v1.12.1
2 parents dfdb9f5 + 4318282 commit 09ef606

Some content is hidden

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

46 files changed

+504
-215
lines changed

CHANGELOG.md

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

8+
## [1.12.1] - 2020.06.22
9+
10+
### Added
11+
12+
- Add `purgeConfig` to default.json and purge-config loader - @gibkigonzo (#4540)
13+
- Load attributes data of attribute-meta for bundled and grouped products - @cewald (#4551)
14+
- Separate theme installation and add it as yarn init:theme or as a step in yarn installer. - @gibkigonzo (4534, #4552)
15+
16+
### Fixed
17+
18+
- use `config.i18n.defaultLocale` as fallback locale instead of `'en-US'` - @gibkigonzo (#4489)
19+
- use Math.abs on raw price - @gibkigonzo (#4521)
20+
- Clears vuex warnings about overriding state by module - @gibkigonzo (#4541)
21+
22+
### Changed / Improved
23+
824
## [1.12.0] - 2020.06.01
925

1026
### Added

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ You can find some tutorials and explanations on our [YouTube channel](https://ww
156156
- [Starter pack for install](https://docs.vuestorefront.io/guide/cookbook/setup.html)
157157
- [Installing on Linux/MacOS](https://docs.vuestorefront.io/guide/installation/linux-mac.html)
158158
- [Installing on Windows](https://docs.vuestorefront.io/guide/installation/windows.html)
159+
- [Installing theme](https://docs.vuestorefront.io/guide/installation/theme.html)
159160
- [How to install and integrate with Magento2](https://docs.vuestorefront.io/guide/installation/magento.html)
160161
- [Production setup](https://docs.vuestorefront.io/guide/installation/production-setup.html)
161162

config/default.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,5 +871,17 @@
871871
},
872872
"varnish": {
873873
"enabled":false
874-
}
874+
},
875+
"purgeConfig": [
876+
"server.invalidateCacheKey",
877+
"server.invalidateCacheForwardUrl",
878+
"server.trace",
879+
"redis",
880+
"install",
881+
"expireHeaders",
882+
"fastly",
883+
"nginx",
884+
"varnish",
885+
"cloudflare"
886+
]
875887
}

core/build/purge-config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const omit = require('lodash/omit')
2+
3+
/**
4+
* clear config properties that shouldn't be visible on frontend
5+
*/
6+
module.exports = function loader(source) {
7+
let config = JSON.parse(source);
8+
9+
const purgeConfig = (config.purgeConfig || []).slice()
10+
11+
config = omit(config, purgeConfig)
12+
13+
delete config['purgeConfig']
14+
15+
return JSON.stringify(config);
16+
}

core/build/theme-path.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ else {
1515
if(!fs.existsSync(themePath)) {
1616
console.error(`
1717
The theme you want to use does not exist.
18-
Please use 'vsf init' or install manualy one of our official themes:
19-
- https://github.com/DivanteLtd/vsf-capybara#--installation
20-
- https://github.com/DivanteLtd/vsf-default#--installation
18+
Please check theme installation: https://docs.vuestorefront.io/guide/installation/theme.html
2119
`)
2220
process.exit(1)
2321
}

core/build/webpack.base.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ export default {
193193
test: /\.(graphqls|gql)$/,
194194
exclude: /node_modules/,
195195
loader: ['graphql-tag/loader']
196+
},
197+
{
198+
test: /core\/build\/config\.json$/,
199+
loader: path.resolve('core/build/purge-config.js')
196200
}
197201
]
198202
}

core/filters/price.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function price (value, storeView) {
3434

3535
const options = { minimumFractionDigits: fractionDigits, maximumFractionDigits: fractionDigits };
3636

37-
let localePrice = Math.abs(Number(value).toLocaleString(defaultLocale, options)).toFixed(2);
37+
let localePrice = Math.abs(value).toLocaleString(defaultLocale, options);
3838

3939
if (currencyDecimal !== '' || currencyGroup !== '') {
4040
localePrice = replaceSeparators(localePrice, { decimal: currencyDecimal, group: currencyGroup }, getLocaleSeparators(defaultLocale));

core/i18n/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ once('__VUE_EXTEND_I18N__', () => {
88
Vue.use(VueI18n)
99
})
1010

11-
const loadedLanguages = ['en-US']
11+
const defaultLocale = config.i18n.defaultLocale || 'en-US'
12+
const loadedLanguages = [defaultLocale]
1213
const i18n = new VueI18n({
13-
locale: config.i18n.bundleAllStoreviewLanguages ? config.i18n.defaultLocale : 'en-US', // set locale
14-
fallbackLocale: 'en-US',
14+
locale: defaultLocale, // set locale
15+
fallbackLocale: defaultLocale,
1516
messages: config.i18n.bundleAllStoreviewLanguages ? require('./resource/i18n/multistoreLanguages.json') : {
16-
'en-US': require('./resource/i18n/en-US.json')
17+
[defaultLocale]: require(`./resource/i18n/${defaultLocale}.json`)
1718
}
1819
})
1920

core/i18n/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue-storefront/i18n",
3-
"version": "1.12.0",
3+
"version": "1.12.1",
44
"description": "Vue Storefront i18n",
55
"license": "MIT",
66
"main": "index.ts",

core/i18n/scripts/translation.preprocessor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function convertToObject (array) {
1717

1818
module.exports = function (csvDirectories, config = null) {
1919
const currentLocales = currentBuildLocales()
20-
const fallbackLocale = 'en-US'
20+
const fallbackLocale = config.i18n.defaultLocale || 'en-US'
2121
let messages = {}
2222
let languages = []
2323

@@ -43,7 +43,7 @@ module.exports = function (csvDirectories, config = null) {
4343

4444
// create fallback
4545
console.debug(`Writing JSON file fallback: ${fallbackLocale}.json`)
46-
fs.writeFileSync(path.join(__dirname, '../resource/i18n', `${fallbackLocale}.json`), JSON.stringify(messages[fallbackLocale]))
46+
fs.writeFileSync(path.join(__dirname, '../resource/i18n', `${fallbackLocale}.json`), JSON.stringify(messages[fallbackLocale] || {}))
4747

4848
// bundle all messages in one file
4949
if (config && config.i18n.bundleAllStoreviewLanguages) {

0 commit comments

Comments
 (0)