Skip to content

Commit

Permalink
Merge branch 'hotfix/v1.12.1' into bugfix/clear-vuex-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Kostuch authored Jun 17, 2020
2 parents 6739977 + 5404fb4 commit 5f9b4b6
Show file tree
Hide file tree
Showing 12 changed files with 610 additions and 36 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Add `purgeConfig` to default.json and purge-config loader - @gibkigonzo (#4540)
- Separate theme installation and add it as yarn init:theme or as a step in yarn installer. - @gibkigonzo (4534, #4552)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion core/mixins/onBottomScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const isBottomVisible = () => {
}

/**
* By implementing this mixin add "onBottomScroll" mthod in component.
* By implementing this mixin add "onBottomScroll" method in component.
* It will be invoked when view reach the bottom.
*/
export default {
Expand Down
33 changes: 17 additions & 16 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ module.exports = {
link: 'https://www.youtube.com/channel/UCkm1F3Cglty3CE1QwKQUhhg',
},
{
text: 'Medium',
link: 'https://medium.com/the-vue-storefront-journal',
text: 'Blog',
link: 'https://blog.vuestorefront.io/',
},
],
sidebar: {
Expand Down Expand Up @@ -78,7 +78,7 @@ module.exports = {
'basics/feature-list',
'basics/recipes',
'basics/typescript',
'basics/graphql',
// 'basics/graphql',
'basics/ssr-cache',
'basics/amp',
'basics/static-generator',
Expand Down Expand Up @@ -115,18 +115,18 @@ module.exports = {
'data/data-loader'
],
},
{
title: 'Working with Vuex',
collapsable: false,
children: [
'vuex/introduction',
'vuex/vuex-conventions',
'vuex/product-store',
'vuex/category-store',
'vuex/stock-store',
'vuex/attribute-store',
],
},
// {
// title: 'Working with Vuex',
// collapsable: false,
// children: [
// 'vuex/introduction',
// 'vuex/vuex-conventions',
// 'vuex/product-store',
// 'vuex/category-store',
// 'vuex/stock-store',
// 'vuex/attribute-store',
// ],
// },
{
title: 'Integrations',
collapsable: false,
Expand Down Expand Up @@ -156,7 +156,8 @@ module.exports = {
children: [
'archives/modules',
'archives/extensions',
'archives/components'
'archives/components',
'archives/vuex'
],
},
],
Expand Down
540 changes: 540 additions & 0 deletions docs/guide/archives/vuex.md

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion docs/guide/basics/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ The Vue Storefront application uses the [node-config](https://github.com/lorenwe

- `local.json` is the second configuration file which is .gitignore'd from the repository. This is the place where you should store all instance-specific configuration variables.

:::tip NOTE
Please not that the `config` is bundled into JavaScript files that are returned to the user's browser. Please **NEVER PUT ANY SENSITIVE INFORMATION** into the config file of `vue-storefront`. If your application requires some authorization / tokens /etc - please store them and access via dedicated [`vue-storefront-api`](https://github.com/DivanteLtd/vue-storefront-api) or [`storefront-api`](https://github.com/DivanteLtd/storefront-api) extension that will prevent these sensitive information from being returned to the users.
:::

The structure of these files is exactly the same! Vue Storefront does kind of `Object.assign(default, local)` (but with the deep-merge). This means that the `local.json` overrides the `default.json` properties.

:::tip NOTE
Please take a look at the `node-config` docs as the library is open for some other ways to modify the configuration (using, for example the `ENV` variables).
:::

:::tip NOTE
Currently, the configuration files are being processed by the webpack during the build process. This means that whenever you apply some configuration changes, you shall rebuild the app, even when using the `yarn dev` mode. This limitation can be solved with the VS 1.4 special config variable. Now the config can be reloaded on the fly with each server request if `config.server.dynamicConfigReload`is set to true. However, in that case, the config is added to `window.**INITIAL_STATE**` with the responses.
Currently, the configuration files are being processed by the webpack during the build process. This means that whenever you apply some configuration changes, you shall rebuild the app, even when using the `yarn dev` mode. This limitation can be solved with the VS 1.4 special config variable. Now the config can be reloaded on the fly with each server request if `config.server.dynamicConfigReload`is set to true. However, in that case, the config is added to `window.INITIAL_STATE` with the responses.

When you using the `config.server.dynamicConfigReload` plase remember about `config.server.dynamicConfigExclude` and `config.server.dynamicConfigInclude`.
:::
Expand Down
20 changes: 15 additions & 5 deletions docs/guide/cookbook/devops.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ In this chapter, we will cover :
[[toc]]

## 0. Introduction
As the industry matures, developers' concerns are poised to move towards dealing with operations of server infrastructure rather than development itself. The reason is simple and clear, it's simply more painful to deal with server operation. I am not saying AI programmer will take away your job, but there are lots of resources out there to help you build a software with such as frameworks, libraries, templates, best practices of all sorts and so on. Not to mention, IDEs on steroid are getting better all the time that guide you for the degree to which is foolproof. It just takes a single fool to build a great software these days. (Forgive me!)
As the industry matures, developers' concerns are poised to move towards dealing with operations of server infrastructure rather than development itself. The reason is clear as fire, it's simply more painful to deal with server operation. I am not saying AI programmer will take away your job, but there are lots of resources out there to help you build a software with such as frameworks, libraries, templates, best practices of all sorts, and so on. Not to mention, IDEs on steroid are getting better all the time which provides you with tools for the degree to which proves foolproof. It just takes a single fool to build a great software these days. (Forgive me!)

However, something people underestimated at first sight turned out to be the most stressful experiences; _Set the servers up and running_. (and maintain it!) Something you thought the last simple step for your development project turned out to be the separate portion of substantial workloads that needs to be taken care of from the beginning of the project. Now, that's where _DevOps_ comes in.
However, something people underestimated at the first sight turned out to be the most stressful experience; _Set the servers up and running_. (and maintain it!) Something you thought the last simple step for your development project turned out to be the separate portion of substantial workloads that needs to be taken care of from the beginning of the project. Now, that's where _DevOps_ comes in.

## 1. Infrastructure design
_Vue Storefront_ approaches the online commerce problem with _MSA (Microservice Architecture)_ methodology. A handful army of technology stacks is positioned in place to bring in the maximum efficiency on top of the PWA concept.

### 1. Preparation
### 2. Recipe
### 3. Peep into the kitchen (what happens internally)
Expand All @@ -24,23 +26,31 @@ However, something people underestimated at first sight turned out to be the mos
<br />
<br />

## 3. DevOps in VSF context
## 3. Cache Strategy
### 1. Preparation
### 2. Recipe
### 3. Peep into the kitchen (what happens internally)
### 4. Chef's secret (protip)
<br />
<br />

## 4. DevOps in VSF context
### 1. Preparation
### 2. Recipe
### 3. Peep into the kitchen (what happens internally)
### 4. Chef's secret (protip)
<br />
<br />

## 4. In case of StorefrontCloud.io
## 5. In case of StorefrontCloud.io
### 1. Preparation
### 2. Recipe
### 3. Peep into the kitchen (what happens internally)
### 4. Chef's secret (protip)
<br />
<br />

## 5. Rooms to improve
## 6. Rooms to improve
### 1. Preparation
### 2. Recipe
### 3. Peep into the kitchen (what happens internally)
Expand Down
1 change: 1 addition & 0 deletions docs/guide/integrations/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Here is a short list of existing Vue Storefront integrations with links to their
- [Vue Storefront + Pimcore](https://github.com/DivanteLtd/pimcore2vuestorefront)
- [Magento2 Product Reviews](https://github.com/DivanteLtd/vue-storefront/blob/develop/doc/Reviews.md)
- [Vue Storefront 3rd party platforms integration boilerplate](https://github.com/DivanteLtd/vue-storefront-integration-boilerplate) - This is the API you should implement to integrate a third-party platform.
- [Vue Storefront + Fresh Relevance](https://github.com/TriggeredMessaging/vsf-freshrelevance)
2 changes: 1 addition & 1 deletion docs/guide/vuex/introduction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

All data processing and remote requests should be managed by Vuex data stores. The core module contains more than [10 default data stores](https://github.com/DivanteLtd/vue-storefront/tree/master/core/store/modules) and can be easily extended by [store extensions](../extensions/extensions.md).
All data processing and remote requests should be managed by Vuex data stores. The core modules generally contain `store` folder inside.
You can modify the existing store actions by responding to events. Events are specified in the docs below and can be found in the [core module](https://github.com/DivanteLtd/vue-storefront/tree/master/core), where `EventBus.$emit` has been mostly used for Vuex Actions.

**You should put all the REST calls, Elasticsearch data queries inside the Vuex Actions.** This is our default design pattern for managing the data.
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Filip Rakowski (@filrak)",
"license": "MIT",
"dependencies": {
"execa": "^1.0.0",
"execa": "^4.0.2",
"fs-extra": "^8.1.0",
"inquirer": "^6.3.1",
"listr": "^0.14.3",
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/scripts/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ module.exports = function (installationDir) {
const tasks = {
installDeps: {
title: 'Installing dependencies',
task: () => execa.shell('cd ' + installationDir + ' && yarn')
task: () => execa.command('cd ' + installationDir + ' && yarn cache clean && yarn', { shell: true })
},
cloneVersion: {
title: 'Copying Vue Storefront files',
task: answers => {
return execa.shell(`git clone --quiet --single-branch --branch ${answers.specificVersion} https://github.com/DivanteLtd/vue-storefront.git ${installationDir} && cd ${installationDir}/core/scripts && git remote rm origin`)
return execa.command(`git clone --quiet --single-branch --branch ${answers.specificVersion} https://github.com/DivanteLtd/vue-storefront.git ${installationDir} && cd ${installationDir}/core/scripts && git remote rm origin`, { shell: true })
}
},
...createThemeTasks(installationDir),
Expand All @@ -35,11 +35,11 @@ module.exports = function (installationDir) {
},
getStorefrontVersions: {
title: 'Check available versions',
task: () => execa.stdout('git', ['ls-remote', '--tags', 'https://github.com/DivanteLtd/vue-storefront.git']).then(result => {
allTags = result.match(/refs\/tags\/v1.([0-9.]+)(-rc.[0-9])?/gm).map(tag => tag.replace('refs/tags/', ''))
task: () => execa('git', ['ls-remote', '--tags', 'https://github.com/DivanteLtd/vue-storefront.git']).then(({ stdout }) => {
allTags = stdout.match(/refs\/tags\/v1.([0-9.]+)(-rc.[0-9])?/gm).map(tag => tag.replace('refs/tags/', ''))
allTags = semverSortDesc(allTags)
execa.stdout('git', ['ls-remote', '--heads', 'https://github.com/DivanteLtd/vue-storefront.git']).then(branches => {
let rcBranches = branches.match(/refs\/heads\/release\/v1.([0-9.x]+)/gm).map(tag => tag.replace('refs/heads/', ''))
execa('git', ['ls-remote', '--heads', 'https://github.com/DivanteLtd/vue-storefront.git']).then(({ stdout }) => {
let rcBranches = stdout.match(/refs\/heads\/release\/v1.([0-9.x]+)/gm).map(tag => tag.replace('refs/heads/', ''))
availableBranches = [...rcBranches, ...availableBranches]
})
}).catch(e => {
Expand Down
12 changes: 7 additions & 5 deletions packages/cli/themeTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ const createThemeTasks = (installationDir = 'vue-storefront') => ({
title: 'Installing dependencies',
task: (answers) => {
const _installationDir = answers.vsf_dir || installationDir
return execa.shell('cd ' + _installationDir + ' && yarn')
return execa.command('cd ' + _installationDir + ' && yarn cache clean && yarn', { shell: true })
}
},
cloneTheme: {
title: 'Copying Vue Storefront theme',
task: answers => {
const _installationDir = answers.vsf_dir || installationDir
return execa.shell([
return execa.command([
`git clone --quiet --single-branch --branch ${answers.themeBranch} https://github.com/DivanteLtd/vsf-${answers.themeName}.git ${_installationDir}/src/themes/${answers.themeName}`,
`cd ${_installationDir}/src/themes/${answers.themeName}`,
`git remote rm origin`
].join(' && '))
].join(' && '), { shell: true })
},
skip: answers => {
const _installationDir = answers.vsf_dir || installationDir
Expand Down Expand Up @@ -100,7 +100,8 @@ const createThemePrompt = (installationDir = 'vue-storefront') => [
name: themeConfig.label,
value: themeName
}))
}
},
default: 'default'
},
{
type: 'list',
Expand All @@ -110,7 +111,8 @@ const createThemePrompt = (installationDir = 'vue-storefront') => [
.map(([branchName, branchLabel]) => ({
name: branchLabel,
value: branchName
}))
})),
default: 'master'
}
]

Expand Down
15 changes: 15 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7894,6 +7894,21 @@ execa@^3.2.0:
signal-exit "^3.0.2"
strip-final-newline "^2.0.0"

execa@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.2.tgz#ad87fb7b2d9d564f70d2b62d511bee41d5cbb240"
integrity sha512-QI2zLa6CjGWdiQsmSkZoGtDx2N+cQIGb3yNolGTdjSQzydzLgYYf8LRuagp7S7fPimjcrzUDSUFd/MgzELMi4Q==
dependencies:
cross-spawn "^7.0.0"
get-stream "^5.0.0"
human-signals "^1.1.1"
is-stream "^2.0.0"
merge-stream "^2.0.0"
npm-run-path "^4.0.0"
onetime "^5.1.0"
signal-exit "^3.0.2"
strip-final-newline "^2.0.0"

[email protected]:
version "4.1.1"
resolved "https://registry.yarnpkg.com/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c"
Expand Down

0 comments on commit 5f9b4b6

Please sign in to comment.