Skip to content

Commit

Permalink
Sync release-2.4 with release/next (#6237)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsobol authored Aug 27, 2021
1 parent 7128c61 commit 8cf898b
Show file tree
Hide file tree
Showing 55 changed files with 2,078 additions and 1,885 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"scripts": {
"build:docs": "cd packages/core/docs && yarn build",
"dev:docs": "cd packages/core/docs && yarn dev",
"build:core": "cd packages/core/core && yarn build && cd ../middleware && yarn build",
"build:core": "yarn build:core:core && yarn build:core:cache && yarn build:core:middleware",
"build:core:core": "cd packages/core/core && yarn build",
"build:core:cache": "cd packages/core/cache && yarn build",
"build:core:middleware": "cd packages/core/middleware && yarn build",
"build:spr:api-client": "cd packages/spryker/api-client && yarn build",
"build:spr:composables": "cd packages/spryker/composables && yarn build",
"build:spr:tools": "yarn build:core && yarn build:spr:api-client && yarn build:spr:composables",
Expand Down
2 changes: 1 addition & 1 deletion packages/commercetools/api-client/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../api-extractor.base.json",
"mainEntryPointFilePath": "./lib/index.d.ts",
"mainEntryPointFilePath": "./lib/api-extractor-data.d.ts",
"dtsRollup": {
"untrimmedFilePath": "./lib/<unscopedPackageName>.d.ts"
},
Expand Down
15 changes: 15 additions & 0 deletions packages/commercetools/api-client/src/api-extractor-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* `api-client` for commercetools integration for Vue Storefront 2.
*
* @remarks
* The `@vue-storefront/commercetools-api` library includes everything needed to fetch data from the
* commercetools eCommerce platform. This includes API client configuration, API endpoints, and
* GraphQL types and fragments.
*
* @packageDocumentation
*/

import * as apiMethods from './api';

export * from './index';
export { apiMethods };
10 changes: 10 additions & 0 deletions packages/commercetools/composables/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../api-extractor.base.json",
"mainEntryPointFilePath": "./lib/index.d.ts",
"dtsRollup": {
"untrimmedFilePath": "./lib/<unscopedPackageName>.d.ts"
},
"docModel": {
"apiJsonFilePath": "<projectFolder>/core/docs/commercetools/api-reference/<unscopedPackageName>.api.json"
}
}
16 changes: 0 additions & 16 deletions packages/commercetools/composables/src/getters/storeGetters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { Store, Channel, Address } from '../types/GraphQL';
import { StoresData } from '../types';
import { FilterCriteriaRecord, Localized, filterArrayByCriteriaRecord } from '../helpers/internals';

/**
* Types
*/

interface StoreFilterCriteria {
store?: FilterCriteriaRecord<Store>;
channel?: FilterCriteriaRecord<Channel>
Expand All @@ -16,10 +12,6 @@ type StoreChannelSetKeys =
'distributionChannels' |
'supplyChannels';

/**
* Helpers
*/

function mapToAddress(address: Address): AgnosticAddress {
return {
addressLine1: `${address?.country ?? ''} ${address?.city ?? ''} ${address?.postalCode ?? ''}`.trim(),
Expand Down Expand Up @@ -94,10 +86,6 @@ function gainAgnosticStoreItems (criteria?: FilterCriteriaRecord<Channel>) {
};
}

/**
* Getters
*/

function getItems (stores: StoresData, criteria: StoreFilterCriteria = {}): AgnosticStore[] {
return filterArrayByCriteriaRecord<Store>(
stores?.results,
Expand All @@ -109,10 +97,6 @@ function getSelected (stores: StoresData): AgnosticStore | undefined {
return getItems(stores, { store: { key: (stores?._selectedStore ?? '') }})[0];
}

/**
* Export
*/

const storeGetters: UseStoreGetters<StoresData, StoreFilterCriteria> = {
getItems,
getSelected
Expand Down
12 changes: 12 additions & 0 deletions packages/commercetools/composables/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* `composables` for commercetools integration for Vue Storefront 2.
*
* @remarks
* The `@vue-storefront/commercetools` library includes everything needed to fetch data from the
* Server Middleware and display them in agnostic and formatted form. This includes composables
* and getters.
*
* @packageDocumentation
*/

/* istanbul ignore file */
import { track } from '@vue-storefront/core';

Expand All @@ -21,3 +32,4 @@ export { useForgotPassword, useForgotPasswordFactoryParams } from './useForgotPa
export { useStore, useStoreFactoryParams } from './useStore';

export * from './getters';
export * from './types';
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export interface CtUseStoreFactoryParams<STORES> extends UseStoreFactoryParams<S
changeChannel(context: Context, params: UseStoreFactoryChangeChannelParamArguments): Promise<STORES>
}

// Load param
async function load (context: Context, params: UseStoreFactoryLoadParamArguments): Promise<StoresData> {
const { api, config } = context.$ct;
const { customQuery } = params;
Expand All @@ -27,14 +26,12 @@ async function load (context: Context, params: UseStoreFactoryLoadParamArguments
};
}

// Change param
async function change (context: Context, { store }: UseStoreFactoryChangeParamArguments) {
context.$ct.config.storeService.changeCurrentStore(`${store.key}`);
window.location.reload();
return null as StoresData;
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function changeChannel (context: Context, { channel }: UseStoreFactoryChangeChannelParamArguments) {
context.$ct.config.storeService.changeCurrentStore(`${(channel.distributtionChannel || 'null')}-${(channel.supplyChannel || 'null')}`);
window.location.reload();
Expand Down
10 changes: 10 additions & 0 deletions packages/core/cache/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../api-extractor.base.json",
"mainEntryPointFilePath": "./lib/index.d.ts",
"dtsRollup": {
"untrimmedFilePath": "./lib/<unscopedPackageName>.d.ts"
},
"docModel": {
"apiJsonFilePath": "<projectFolder>/core/docs/core/api-reference/<unscopedPackageName>.api.json"
}
}
11 changes: 11 additions & 0 deletions packages/core/cache/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* Core Vue Storefront 2 library for enabling Server Side Rendering (SSR) cache.
*
* @remarks
* The `@vue-storefront/cache` library is a Nuxt.js module, that is core piece required
* to enable Server Side Rendering (SSR) cache in Vue Storefront 2. It uses drivers
* to integration with specific caching solutions.
*
* @packageDocumentation
*/

export { default as useCache } from './composables/useCache';

export enum CacheTagPrefix {
Expand Down
3 changes: 2 additions & 1 deletion packages/core/cache/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"strict": false,
"allowJs": true
},
"exclude": ["node_modules", "**/*.spec.ts"]
"exclude": ["node_modules", "**/*.spec.ts"],
"include": ["src"],
}
12 changes: 11 additions & 1 deletion packages/core/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/* istanbul ignore file */
/**
* Core Vue Storefront 2 library.
*
* @remarks
* The `@vue-storefront/core` library is a core of the whole Vue Storefront 2 application.
* It defines common interfaces for all eCommerce integrations, factories for creating
* composables, logger, SSR helpers and more.
*
* @packageDocumentation
*/

/* istanbul ignore file */
export * from './utils';
export * from './factories';
export * from './types';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ export interface UseStoreFactoryLoadParamArguments {

export interface UseStoreFactoryParams<STORES> extends FactoryParams {
load(context: Context, params: UseStoreFactoryLoadParamArguments): Promise<STORES>
change(context: Context, parmas: UseStoreFactoryChangeParamArguments): Promise<STORES>
change(context: Context, params: UseStoreFactoryChangeParamArguments): Promise<STORES>
}
export interface UseStoreInterface<STORES> {
change(params: UseStoreFactoryChangeParamArguments): Promise<void>;
Expand Down
4 changes: 2 additions & 2 deletions packages/core/docs/.vuepress/components/PersonTile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<img :src="photo" />
<div><b> {{ name }} </b></div>
<div class="gap">{{ company }} </div>
<div><b><a href="https://slack.vuestorefront.io">Slack:</a></b> @{{ slack }} </div>
<div><b><a href="https://discord.vuestorefront.io">Discord:</a></b> {{ discord }} </div>
</div>
</template>

<script>
export default {
props: ['name', 'company', 'slack', 'photo']
props: ['name', 'company', 'discord', 'photo']
}
</script>

Expand Down
30 changes: 15 additions & 15 deletions packages/core/docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,29 +164,29 @@ module.exports = {
title: 'Composables',
collapsable: false,
children: [
['/commercetools/composables/use-product', 'useProduct'],
['/commercetools/composables/use-review', 'useReview '],
['/commercetools/composables/use-user', 'useUser'],
['/commercetools/composables/use-user-shipping', 'useUserShipping'],
['/commercetools/composables/use-user-billing', 'useUserBilling'],
['/commercetools/composables/use-user-order', 'useUserOrder'],
['/commercetools/composables/use-facet', 'useFacet'],
['/commercetools/composables/use-billing', 'useBilling'],
['/commercetools/composables/use-cart', 'useCart'],
['/commercetools/composables/use-wishlist', 'useWishlist'],
['/commercetools/composables/use-category', 'useCategory'],
['/commercetools/composables/use-shipping', 'useShipping'],
['/commercetools/composables/use-shipping-provider', 'useShippingProvider'],
['/commercetools/composables/use-billing', 'useBilling'],
['/commercetools/composables/use-make-order', 'useMakeOrder'],
['/commercetools/composables/use-facet', 'useFacet'],
['/commercetools/composables/use-forgot-password', 'useForgotPassword'],
['/commercetools/composables/use-store', 'useStore']
['/commercetools/composables/use-make-order', 'useMakeOrder'],
['/commercetools/composables/use-product', 'useProduct'],
['/commercetools/composables/use-review', 'useReview'],
['/commercetools/composables/use-shipping-provider', 'useShippingProvider'],
['/commercetools/composables/use-shipping', 'useShipping'],
['/commercetools/composables/use-store', 'useStore'],
['/commercetools/composables/use-user-billing', 'useUserBilling'],
['/commercetools/composables/use-user-order', 'useUserOrder'],
['/commercetools/composables/use-user-shipping', 'useUserShipping'],
['/commercetools/composables/use-user', 'useUser'],
['/commercetools/composables/use-wishlist', 'useWishlist']
]
},
{
title: 'API Client',
title: 'API Reference',
collapsable: false,
children: [
['/commercetools/api-reference/', 'Methods reference']
['/commercetools/api-reference/', 'API Reference']
]
},
{
Expand Down
63 changes: 61 additions & 2 deletions packages/core/docs/.vuepress/integrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ const INTEGRATIONS = {
{ name: 'Vue Storefront', link: 'https://vuestorefront.io/' },
]
},
{
name: 'SAP Commerce Cloud',
link: '',
image: '/v2/integrations-logos/sap.svg',
status: STATUSES.WIP,
availability: AVAILABILITY.ENTERPRISE,
maintainedBy: [
{ name: 'Vue Storefront', link: 'https://vuestorefront.io/' },
]
},
{
name: 'Spryker',
link: 'https://docs.vuestorefront.io/spryker',
Expand Down Expand Up @@ -107,6 +117,42 @@ const INTEGRATIONS = {
{ name: 'BitBag', link: 'https://bitbag.io/' },
]
},
{
name: 'WooCommerce',
link: '',
image: '/v2/integrations-logos/woocommerce.svg',
status: STATUSES.WIP,
availability: AVAILABILITY.OPEN_SOURCE,
maintainedBy: []
},
{
name: 'OpenCart',
link: '',
image: '/v2/integrations-logos/opencart.svg',
status: STATUSES.WIP,
availability: AVAILABILITY.OPEN_SOURCE,
maintainedBy: []
},
{
name: 'Vendure',
link: '',
image: '/v2/integrations-logos/vendure.png',
status: STATUSES.WIP,
availability: AVAILABILITY.OPEN_SOURCE,
maintainedBy: [
{ name: 'Jakub Andrzejewski', link: 'https://www.linkedin.com/in/jakub-andrzejewski/' },
]
},
{
name: 'Odoo',
link: '',
image: '/v2/integrations-logos/odoo.svg',
status: STATUSES.WIP,
availability: AVAILABILITY.OPEN_SOURCE,
maintainedBy: [
{ name: 'OdooGap', link: 'https://www.odoogap.com/' }
]
}
],
other: [
{
Expand Down Expand Up @@ -238,7 +284,7 @@ const INTEGRATIONS = {
maintainedBy: [
{ name: 'Vue Storefront', link: 'https://vuestorefront.io/' },
],
categories: [ CATEGORIES.AUTH ],
categories: [ CATEGORIES.CMS ],
compatibility: []
},
{
Expand All @@ -250,7 +296,7 @@ const INTEGRATIONS = {
maintainedBy: [
{ name: 'Vue Storefront', link: 'https://vuestorefront.io/' },
],
categories: [ CATEGORIES.AUTH ],
categories: [ CATEGORIES.CMS ],
compatibility: []
},
{
Expand All @@ -275,6 +321,19 @@ const INTEGRATIONS = {
{ name: 'Vue Storefront', link: 'https://vuestorefront.io/' },
],
categories: [ CATEGORIES.SEARCH ],
compatibility: [ 'commercetools' ]
},

{
name: 'Constructor.io',
link: '',
image: '/v2/integrations-logos/constructor-io.svg',
status: STATUSES.BETA,
availability: AVAILABILITY.ENTERPRISE,
maintainedBy: [
{ name: 'Vue Storefront', link: 'https://vuestorefront.io/' },
],
categories: [ CATEGORIES.SEARCH ],
compatibility: []
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8cf898b

Please sign in to comment.