diff --git a/CHANGELOG.md b/CHANGELOG.md index ad38cc18b5..5b052734c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Location of type files (#2226) - Support regional characters in urls - `store/lib/search` has been moved to `core/lib/search` (#2225) +- `store/lib/multistore` has been moved to `core/lib/multistore` (#2224) ## [1.6.0] - 2018.12.05 diff --git a/core/app.ts b/core/app.ts index cb8e4cf1f3..fc04d1ee5e 100755 --- a/core/app.ts +++ b/core/app.ts @@ -19,7 +19,7 @@ import { getApolloProvider } from './scripts/resolvers/resolveGraphQL' import { registerTheme } from '@vue-storefront/core/lib/themes' import { themeEntry } from 'theme/index.js' import { registerModules } from '@vue-storefront/core/lib/module' -import { prepareStoreView } from '@vue-storefront/store/lib/multistore' +import { prepareStoreView } from '@vue-storefront/core/lib/multistore' import * as coreMixins from '@vue-storefront/core/mixins' import * as coreFilters from '@vue-storefront/core/filters' diff --git a/core/client-entry.ts b/core/client-entry.ts index 0ae3993998..f21d7761a4 100755 --- a/core/client-entry.ts +++ b/core/client-entry.ts @@ -10,7 +10,7 @@ import buildTimeConfig from 'config' import { execute } from '@vue-storefront/core/lib/sync/task' import UniversalStorage from '@vue-storefront/store/lib/storage' import i18n from '@vue-storefront/i18n' -import { prepareStoreView, storeCodeFromRoute, currentStoreView, localizedRoute } from '@vue-storefront/store/lib/multistore' +import { prepareStoreView, storeCodeFromRoute, currentStoreView, localizedRoute } from '@vue-storefront/core/lib/multistore' import { onNetworkStatusChange } from '@vue-storefront/core/modules/offline-order/helpers/onNetworkStatusChange' import '@vue-storefront/core/service-worker/registration' // register the service worker diff --git a/core/filters/date.js b/core/filters/date.js index 82cbc3bf3f..dbb9658556 100644 --- a/core/filters/date.js +++ b/core/filters/date.js @@ -1,4 +1,4 @@ -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' /** * Converts date to format provided as an argument or defined in config file (if argument not provided) diff --git a/core/filters/price.js b/core/filters/price.js index 0ffc83d86c..e229b83807 100644 --- a/core/filters/price.js +++ b/core/filters/price.js @@ -1,4 +1,4 @@ -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' /** * Converts number to price string diff --git a/core/helpers/initCacheStorage.ts b/core/helpers/initCacheStorage.ts index e1267e401a..f8ca2729a4 100644 --- a/core/helpers/initCacheStorage.ts +++ b/core/helpers/initCacheStorage.ts @@ -1,6 +1,6 @@ import * as localForage from 'localforage' import UniversalStorage from '@vue-storefront/store/lib/storage' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' import rootStore from '@vue-storefront/store' /** Inits cache storage for given module. By default via local storage */ diff --git a/core/lib/module.ts b/core/lib/module.ts index 4346c9a4db..be7ccca458 100644 --- a/core/lib/module.ts +++ b/core/lib/module.ts @@ -5,7 +5,7 @@ import merge from 'lodash-es/merge' import RootState from '@vue-storefront/core/types/RootState' import rootStore from '@vue-storefront/store' import { Logger } from '@vue-storefront/core/lib/logger' -import { setupMultistoreRoutes } from '@vue-storefront/store/lib/multistore' +import { setupMultistoreRoutes } from './multistore' import { router } from '@vue-storefront/core/app' export interface VueStorefrontModuleConfig { diff --git a/core/store/lib/multistore.ts b/core/lib/multistore.ts similarity index 96% rename from core/store/lib/multistore.ts rename to core/lib/multistore.ts index 6295cba33b..6a37426dd1 100644 --- a/core/store/lib/multistore.ts +++ b/core/lib/multistore.ts @@ -1,6 +1,6 @@ -import rootStore from '../' +import rootStore from '../store' import { loadLanguageAsync } from '@vue-storefront/i18n' -import { initializeSyncTaskStorage } from '@vue-storefront/core//lib/sync/task' +import { initializeSyncTaskStorage } from './sync/task' import Vue from 'vue' export function currentStoreView () { diff --git a/core/lib/search.ts b/core/lib/search.ts index c7541e3f9a..b953cf39b1 100644 --- a/core/lib/search.ts +++ b/core/lib/search.ts @@ -1,5 +1,6 @@ import Vue from 'vue' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' + +import { currentStoreView } from '@vue-storefront/core/lib/multistore' import { sha3_224 } from 'js-sha3' import rootStore from '@vue-storefront/store' import { getSearchAdapter } from './search/adapter/searchAdapterFactory' diff --git a/core/lib/search/adapter/api/searchAdapter.ts b/core/lib/search/adapter/api/searchAdapter.ts index bb338b014a..7ba0ee1a95 100644 --- a/core/lib/search/adapter/api/searchAdapter.ts +++ b/core/lib/search/adapter/api/searchAdapter.ts @@ -3,7 +3,7 @@ import rootStore from '@vue-storefront/store' import { prepareElasticsearchQueryBody } from './elasticsearchQuery' import fetch from 'isomorphic-fetch' import { slugify } from '@vue-storefront/core/helpers' -import { currentStoreView, prepareStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView, prepareStoreView } from '../../../multistore' import SearchQuery from '@vue-storefront/core/lib/search/searchQuery' import HttpQuery from '@vue-storefront/core/types/search/HttpQuery' import { SearchResponse } from '@vue-storefront/core/types/search/SearchResponse' diff --git a/core/lib/search/adapter/graphql/searchAdapter.ts b/core/lib/search/adapter/graphql/searchAdapter.ts index 1f1553dad5..d980f4096f 100644 --- a/core/lib/search/adapter/graphql/searchAdapter.ts +++ b/core/lib/search/adapter/graphql/searchAdapter.ts @@ -1,6 +1,6 @@ import rootStore from '@vue-storefront/store' import { prepareQueryVars } from './gqlQuery' -import { currentStoreView, prepareStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView, prepareStoreView } from '../../../multistore' import fetch from 'isomorphic-fetch' import {processESResponseType, processProductsType, processCmsType} from './processor/processType' import SearchQuery from '../../searchQuery' diff --git a/core/lib/sync/index.ts b/core/lib/sync/index.ts index a6b87f4677..4ce97a8434 100644 --- a/core/lib/sync/index.ts +++ b/core/lib/sync/index.ts @@ -5,7 +5,7 @@ import { Logger } from '@vue-storefront/core/lib/logger' import { execute as taskExecute, _prepareTask } from './task' import * as localForage from 'localforage' import UniversalStorage from '@vue-storefront/store/lib/storage' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '../multistore' /** Syncs given task. If user is offline requiest will be sent to the server after restored connection */ function queue (task) { diff --git a/core/lib/sync/task.ts b/core/lib/sync/task.ts index db91a0c363..06e077fbf5 100644 --- a/core/lib/sync/task.ts +++ b/core/lib/sync/task.ts @@ -6,7 +6,7 @@ import toString from 'lodash-es/toString' import fetch from 'isomorphic-fetch' import * as localForage from 'localforage' import rootStore from '@vue-storefront/store' -import { adjustMultistoreApiUrl, currentStoreView } from '@vue-storefront/store/lib/multistore' +import { adjustMultistoreApiUrl, currentStoreView } from '@vue-storefront/core/lib/multistore' import Task from '@vue-storefront/core/lib/sync/types/Task' import { Logger } from '@vue-storefront/core/lib/logger' import { TaskQueue } from '@vue-storefront/core/lib/sync' diff --git a/core/mixins/multistore.js b/core/mixins/multistore.js index 38e5557856..c25f3afdb5 100644 --- a/core/mixins/multistore.js +++ b/core/mixins/multistore.js @@ -1,4 +1,4 @@ -import { localizedRoute as localizedRouteHelper, currentStoreView } from '@vue-storefront/store/lib/multistore' +import { localizedRoute as localizedRouteHelper, currentStoreView } from '@vue-storefront/core/lib/multistore' export const multistore = { methods: { diff --git a/core/modules/cart/hooks/beforeRegistration.ts b/core/modules/cart/hooks/beforeRegistration.ts index d3d7984f18..95b731a979 100644 --- a/core/modules/cart/hooks/beforeRegistration.ts +++ b/core/modules/cart/hooks/beforeRegistration.ts @@ -1,6 +1,6 @@ import * as localForage from 'localforage' import UniversalStorage from '@vue-storefront/store/lib/storage' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' export function beforeRegistration(Vue, config, store, isServer) { const storeView = currentStoreView() diff --git a/core/modules/cart/store/actions.ts b/core/modules/cart/store/actions.ts index c00e10913a..a67661b7c7 100644 --- a/core/modules/cart/store/actions.ts +++ b/core/modules/cart/store/actions.ts @@ -4,7 +4,7 @@ import * as types from './mutation-types' import rootStore from '@vue-storefront/store' import i18n from '@vue-storefront/i18n' import { sha3_224 } from 'js-sha3' -import { currentStoreView, localizedRoute} from '@vue-storefront/store/lib/multistore' +import { currentStoreView, localizedRoute} from '@vue-storefront/core/lib/multistore' import omit from 'lodash-es/omit' import RootState from '@vue-storefront/core/types/RootState' import CartState from '../types/CartState' diff --git a/core/modules/catalog/helpers/index.ts b/core/modules/catalog/helpers/index.ts index 6bd032e9c4..5973b5330a 100644 --- a/core/modules/catalog/helpers/index.ts +++ b/core/modules/catalog/helpers/index.ts @@ -10,7 +10,7 @@ import union from 'lodash-es/union' // TODO: Remove this dep import { optionLabel } from './optionLabel' import i18n from '@vue-storefront/i18n' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' import { getThumbnailPath } from '@vue-storefront/core/helpers' function _filterRootProductByStockitem (context, stockItem, product, errorCallback) { diff --git a/core/modules/catalog/hooks/beforeRegistration.ts b/core/modules/catalog/hooks/beforeRegistration.ts index dcbe94525b..86dfb73148 100644 --- a/core/modules/catalog/hooks/beforeRegistration.ts +++ b/core/modules/catalog/hooks/beforeRegistration.ts @@ -1,6 +1,6 @@ import * as localForage from 'localforage' import UniversalStorage from '@vue-storefront/store/lib/storage' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' export function beforeRegistration(Vue, config, store, isServer) { const storeView = currentStoreView() diff --git a/core/modules/catalog/store/category/actions.ts b/core/modules/catalog/store/category/actions.ts index f3edd9c0dd..a4936ae698 100644 --- a/core/modules/catalog/store/category/actions.ts +++ b/core/modules/catalog/store/category/actions.ts @@ -12,7 +12,8 @@ import { optionLabel } from '../../helpers/optionLabel' import RootState from '@vue-storefront/core/types/RootState' import CategoryState from '../../types/CategoryState' import SearchQuery from '@vue-storefront/core/lib/search/searchQuery' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' + const actions: ActionTree = { /** diff --git a/core/modules/catalog/store/product/actions.ts b/core/modules/catalog/store/product/actions.ts index 2791056692..a272eca0e7 100644 --- a/core/modules/catalog/store/product/actions.ts +++ b/core/modules/catalog/store/product/actions.ts @@ -2,7 +2,7 @@ import Vue from 'vue' import { ActionTree } from 'vuex' import * as types from './mutation-types' import { breadCrumbRoutes, productThumbnailPath } from '@vue-storefront/core/helpers' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' import { configureProductAsync, doPlatformPricesSync, filterOutUnavailableVariants, diff --git a/core/modules/checkout/hooks/beforeRegistration.ts b/core/modules/checkout/hooks/beforeRegistration.ts index f189c07a8f..1c0a9af05f 100644 --- a/core/modules/checkout/hooks/beforeRegistration.ts +++ b/core/modules/checkout/hooks/beforeRegistration.ts @@ -1,6 +1,6 @@ import * as localForage from 'localforage' import UniversalStorage from '@vue-storefront/store/lib/storage' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' export function beforeRegistration(Vue, config, store, isServer) { const storeView = currentStoreView() diff --git a/core/modules/cms/hooks/beforeRegistration.ts b/core/modules/cms/hooks/beforeRegistration.ts index 68625afc5e..3786446c6d 100644 --- a/core/modules/cms/hooks/beforeRegistration.ts +++ b/core/modules/cms/hooks/beforeRegistration.ts @@ -1,6 +1,6 @@ import * as localForage from 'localforage' import UniversalStorage from '@vue-storefront/store/lib/storage' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' export function beforeRegistration(Vue, config, store, isServer) { const storeView = currentStoreView() diff --git a/core/modules/compare/hooks/beforeRegistration.ts b/core/modules/compare/hooks/beforeRegistration.ts index 8d6a50ceb0..d944b7b38e 100644 --- a/core/modules/compare/hooks/beforeRegistration.ts +++ b/core/modules/compare/hooks/beforeRegistration.ts @@ -1,6 +1,6 @@ import * as localForage from 'localforage' import UniversalStorage from '@vue-storefront/store/lib/storage' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' export function beforeRegistration(Vue, config, store, isServer) { const storeView = currentStoreView() diff --git a/core/modules/offline-order/helpers/onNetworkStatusChange.ts b/core/modules/offline-order/helpers/onNetworkStatusChange.ts index a0e6a6d020..6e15d68bf9 100644 --- a/core/modules/offline-order/helpers/onNetworkStatusChange.ts +++ b/core/modules/offline-order/helpers/onNetworkStatusChange.ts @@ -4,7 +4,7 @@ import store from '@vue-storefront/store' import EventBus from '@vue-storefront/core/compatibility/plugins/event-bus/index' import UniversalStorage from '@vue-storefront/store/lib/storage' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' export function onNetworkStatusChange (store) { console.log('Are we online: ' + navigator.onLine) diff --git a/core/modules/order/store/actions.ts b/core/modules/order/store/actions.ts index c6d36bce69..e3b901d906 100644 --- a/core/modules/order/store/actions.ts +++ b/core/modules/order/store/actions.ts @@ -1,6 +1,6 @@ import Vue from 'vue' import * as types from './mutation-types' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' import { ActionTree } from 'vuex' import RootState from '@vue-storefront/core/types/RootState' import OrderState from '../types/OrderState' diff --git a/core/modules/review/store/actions.ts b/core/modules/review/store/actions.ts index a9194a4741..b6fa11deac 100644 --- a/core/modules/review/store/actions.ts +++ b/core/modules/review/store/actions.ts @@ -2,7 +2,7 @@ import Vue from 'vue' import { ActionTree } from 'vuex' import { quickSearchByQuery } from '@vue-storefront/core/lib/search' import SearchQuery from '@vue-storefront/core/lib/search/searchQuery' -import { adjustMultistoreApiUrl } from '@vue-storefront/store/lib/multistore' +import { adjustMultistoreApiUrl } from '@vue-storefront/core/lib/multistore' import RootState from '@vue-storefront/core/types/RootState' import ReviewState from '../types/ReviewState' import * as types from './mutation-types' diff --git a/core/modules/user/hooks/beforeRegistration.ts b/core/modules/user/hooks/beforeRegistration.ts index bd76e1d0b8..d6e7b84fc6 100644 --- a/core/modules/user/hooks/beforeRegistration.ts +++ b/core/modules/user/hooks/beforeRegistration.ts @@ -1,6 +1,6 @@ import * as localForage from 'localforage' import UniversalStorage from '@vue-storefront/store/lib/storage' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' export function beforeRegistration(Vue, config, store, isServer) { const storeView = currentStoreView() diff --git a/core/modules/user/store/actions.ts b/core/modules/user/store/actions.ts index c19d8ae5c1..7c75d91699 100644 --- a/core/modules/user/store/actions.ts +++ b/core/modules/user/store/actions.ts @@ -3,7 +3,7 @@ import { ActionTree } from 'vuex' import * as types from './mutation-types' import rootStore from '@vue-storefront/store' import i18n from '@vue-storefront/i18n' -import { adjustMultistoreApiUrl } from '@vue-storefront/store/lib/multistore' +import { adjustMultistoreApiUrl } from '@vue-storefront/core/lib/multistore' import RootState from '@vue-storefront/core/types/RootState' import UserState from '../types/UserState' import { Logger } from '@vue-storefront/core/lib/logger' diff --git a/core/pages/Category.js b/core/pages/Category.js index 448cf3896e..fba2810f6f 100644 --- a/core/pages/Category.js +++ b/core/pages/Category.js @@ -5,7 +5,7 @@ import store from '@vue-storefront/store' import EventBus from '@vue-storefront/core/compatibility/plugins/event-bus' import { baseFilterProductsQuery, buildFilterProductsQuery } from '@vue-storefront/core/helpers' import { htmlDecode } from '@vue-storefront/core/filters/html-decode' -import { currentStoreView, localizedRoute } from '@vue-storefront/store/lib/multistore' +import { currentStoreView, localizedRoute } from '@vue-storefront/core/lib/multistore' import Composite from '@vue-storefront/core/mixins/composite' import { Logger } from '@vue-storefront/core/lib/logger' import { mapGetters, mapActions } from 'vuex' diff --git a/core/pages/Checkout.js b/core/pages/Checkout.js index fbb1ca5f1a..0c44aa4d9f 100644 --- a/core/pages/Checkout.js +++ b/core/pages/Checkout.js @@ -5,7 +5,7 @@ import VueOfflineMixin from 'vue-offline/mixin' import { mapGetters } from 'vuex' import Composite from '@vue-storefront/core/mixins/composite' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' export default { name: 'Checkout', diff --git a/core/pages/Product.js b/core/pages/Product.js index a9e94a5897..3f3a0eefe7 100644 --- a/core/pages/Product.js +++ b/core/pages/Product.js @@ -3,7 +3,7 @@ import { mapGetters } from 'vuex' import store from '@vue-storefront/store' import EventBus from '@vue-storefront/core/compatibility/plugins/event-bus' import { htmlDecode } from '@vue-storefront/core/filters' -import { currentStoreView, localizedRoute } from '@vue-storefront/store/lib/multistore' +import { currentStoreView, localizedRoute } from '@vue-storefront/core/lib/multistore' import { CompareProduct } from '@vue-storefront/core/modules/compare/components/Product.ts' import { AddToCompare } from '@vue-storefront/core/modules/compare/components/AddToCompare.ts' import { isOptionAvailableAsync } from '@vue-storefront/core/modules/catalog/helpers/index' diff --git a/core/server-entry.ts b/core/server-entry.ts index 7bd29efc4c..76f69e13f9 100755 --- a/core/server-entry.ts +++ b/core/server-entry.ts @@ -2,7 +2,7 @@ import union from 'lodash-es/union' import { createApp } from '@vue-storefront/core/app' import { HttpError } from '@vue-storefront/core/helpers/exceptions' -import { prepareStoreView, storeCodeFromRoute } from '@vue-storefront/store/lib/multistore' +import { prepareStoreView, storeCodeFromRoute } from '@vue-storefront/core/lib/multistore' import omit from 'lodash-es/omit' import pick from 'lodash-es/pick' import buildTimeConfig from 'config' diff --git a/docs/guide/upgrade-notes/README.md b/docs/guide/upgrade-notes/README.md index 30f19e14c8..cfd4600b56 100644 --- a/docs/guide/upgrade-notes/README.md +++ b/docs/guide/upgrade-notes/README.md @@ -5,7 +5,7 @@ We're trying to keep the upgrade process as easy as it's possible. Unfortunately ## 1.7 -> next - `store/types` have been moved to new module called `core/types`. - `store/lib/search` has been moved to `core/lib/search`. - +- `store/lib/multistore.ts` has been moved to `core/lib/multistore.ts` ## 1.6 -> 1.7 diff --git a/src/modules/claims/hooks/beforeRegistration.ts b/src/modules/claims/hooks/beforeRegistration.ts index ac17b2476d..1814acc399 100644 --- a/src/modules/claims/hooks/beforeRegistration.ts +++ b/src/modules/claims/hooks/beforeRegistration.ts @@ -1,6 +1,6 @@ import * as localForage from 'localforage' import UniversalStorage from '@vue-storefront/store/lib/storage' -import { currentStoreView } from '@vue-storefront/store/lib/multistore' +import { currentStoreView } from '@vue-storefront/core/lib/multistore' export function beforeRegistration(Vue, config, store, isServer) { const storeView = currentStoreView() diff --git a/src/modules/magento-2-cms/components/CmsData.vue b/src/modules/magento-2-cms/components/CmsData.vue index f0d537abab..a9a91eafe6 100644 --- a/src/modules/magento-2-cms/components/CmsData.vue +++ b/src/modules/magento-2-cms/components/CmsData.vue @@ -8,7 +8,7 @@