@graphcommerce/docs 6.0.0-canary.42 → 6.0.0-canary.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 6.0.0-canary.44
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1842](https://github.com/graphcommerce-org/graphcommerce/pull/1842) [`7b67d84bd`](https://github.com/graphcommerce-org/graphcommerce/commit/7b67d84bd269c3fc91afbd69f6683c5d12808d36) - Renamed i18n to storefront in configuration ([@paales](https://github.com/paales))
8
+
9
+ ## 6.0.0-canary.43
10
+
3
11
  ## 6.0.0-canary.42
4
12
 
5
13
  ## 6.0.0-canary.41
@@ -13,21 +13,21 @@ The configuration file is a javascript file that exports a `GraphCommerceConfig`
13
13
  Configuration can be accessed in your project with the `import.meta.graphCommerce` object.
14
14
 
15
15
  ```tsx
16
- import { i18nAll, i18nConfig, i18nConfigDefault, useI18nConfig } from '@graphcommerce/next-ui'
16
+ import { storefrontAll, storefrontConfig, storefrontConfigDefault, useStorefrontConfig } from '@graphcommerce/next-ui'
17
17
 
18
18
  // Accessing a global value
19
19
  const globalConf = import.meta.graphCommerce.cartDisplayPricesInclTax
20
20
 
21
21
  function MyComponent() {
22
- // Configuration configured per i18n locale.
23
- const scopedConfig = useI18nConfig().cartDisplayPricesInclTax
22
+ // Configuration configured per storefront locale.
23
+ const scopedConfig = useStorefrontConfig().cartDisplayPricesInclTax
24
24
 
25
25
  // Creating a fallback system
26
26
  const scopedConfigWithFallback = scopedConfig ?? globalConf
27
27
 
28
28
  // Or as single line
29
29
  const scopedConfigWithFallback2 =
30
- useI18nConfig().cartDisplayPricesInclTax ?? import.meta.graphCommerce.cartDisplayPricesInclTax
30
+ useStorefrontConfig().cartDisplayPricesInclTax ?? import.meta.graphCommerce.cartDisplayPricesInclTax
31
31
 
32
32
  return <div>{googleRecaptchaKey}</div>
33
33
  }
@@ -50,7 +50,7 @@ Configuration values can be overwriten by environment variables, with the follow
50
50
 
51
51
  Examples:
52
52
  - `limitSsg` -> `GC_LIMIT_SSG="1"`
53
- - `i18n[0].locale` -> `GC_I18N_0_LOCALE="en"`
53
+ - `storefront[0].locale` -> `GC_STOREFRONT_0_LOCALE="en"`
54
54
  - `debug.pluginStatus` -> `GC_DEBUG_PLUGIN_STATUS="1"`
55
55
 
56
56
 
@@ -60,7 +60,7 @@ You can export configuration by running `yarn graphcommerce export-config`
60
60
 
61
61
  ## Extending the configuration in your project
62
62
 
63
- Create a graphql/Config.graphqls file in your project and extend the GraphCommerceConfig, GraphCommerceI18nConfig inputs to add configuration.
63
+ Create a graphql/Config.graphqls file in your project and extend the GraphCommerceConfig, GraphCommerceStorefrontConfig inputs to add configuration.
64
64
 
65
65
  ```graphql
66
66
  extend input GraphCommerceConfig {
@@ -73,7 +73,7 @@ extend input GraphCommerceConfig {
73
73
  myOptionalFloat: Float
74
74
  myRequiredFloat: Float!
75
75
  }
76
- extend input GraphCommerceI18nConfig {
76
+ extend input GraphCommerceStorefrontConfig {
77
77
  myField: Boolean
78
78
  }
79
79
  ```
@@ -99,10 +99,6 @@ The HyGraph endpoint.
99
99
 
100
100
  Project settings -> API Access -> High Performance Read-only Content API
101
101
 
102
- #### `i18n: [[GraphCommerceI18nConfig](#GraphCommerceI18nConfig)!]!`
103
-
104
- All i18n configuration for the project
105
-
106
102
  #### `magentoEndpoint: String!`
107
103
 
108
104
  GraphQL Magento endpoint.
@@ -110,6 +106,10 @@ GraphQL Magento endpoint.
110
106
  Examples:
111
107
  - https://magento2.test/graphql
112
108
 
109
+ #### `storefront: [[GraphCommerceStorefrontConfig](#GraphCommerceStorefrontConfig)!]!`
110
+
111
+ All storefront configuration for the project
112
+
113
113
  #### `cartDisplayPricesInclTax: Boolean`
114
114
 
115
115
  Due to a limitation of the GraphQL API it is not possible to determine if a cart should be displayed including or excluding tax.
@@ -221,9 +221,9 @@ Issues that this can cause are:
221
221
  - The same package is included multiple times in the bundle, increasing the bundle size.
222
222
  - The Typescript types of the package are not compatible with each other, causing Typescript errors.
223
223
 
224
- ### GraphCommerceI18nConfig
224
+ ### GraphCommerceStorefrontConfig
225
225
 
226
- All i18n configuration for the project
226
+ All storefront configuration for the project
227
227
 
228
228
  #### `locale: String!`
229
229
 
@@ -139,9 +139,10 @@ msgstr "Cart ({0})"
139
139
  `Admin > Store > Configuration > General > General > Locale`. Choose one of
140
140
  the options from the Magento Locale codes (below).
141
141
  2. In your graphcommerce.config.js file, add the desired `locale` and
142
- `magentoStoreCode` to the [i18n config](./config.md#graphcommercei18nconfig)
143
- environment variable. The route will be visible to the user (added to the
144
- url) when the user switches storeview.
142
+ `magentoStoreCode` to the
143
+ [i18n config](./config.md#GraphCommerceStorefrontConfig) environment
144
+ variable. The route will be visible to the user (added to the url) when the
145
+ user switches storeview.
145
146
 
146
147
  It's considered best practice to match the route with the store code,
147
148
  replacing an underscore for a dash. For example, to add Swedish (Finland),
@@ -39,7 +39,7 @@ const variables = {
39
39
  ```
40
40
 
41
41
  ```graphql
42
- mutation MyGatewayPaymentOptionsAndPlaceOrder(
42
+ mutation MyGatewayPaymentOptions(
43
43
  $cartId: String!
44
44
  $paymentMethod: PaymentMethodInput!
45
45
  ) {
@@ -47,11 +47,14 @@ mutation MyGatewayPaymentOptionsAndPlaceOrder(
47
47
  input: { cart_id: $cartId, payment_method: $paymentMethod }
48
48
  ) {
49
49
  cart {
50
- selected_payment_method {
51
- ...SelectedPaymentMethod
52
- }
50
+ ...PaymentMethodUpdated
53
51
  }
54
52
  }
53
+ }
54
+ ```
55
+
56
+ ```graphql
57
+ mutation MyGatewayPaymentOptionsAndPlaceOrder($cartId: String!) {
55
58
  placeOrder(input: { cart_id: $cartId }) {
56
59
  order {
57
60
  order_number
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "name": "@graphcommerce/docs",
3
3
  "homepage": "https://www.graphcommerce.org/docs",
4
4
  "repository": "github:graphcommerce-org/graphcommerce/docs",
5
- "version": "6.0.0-canary.42",
5
+ "version": "6.0.0-canary.44",
6
6
  "sideEffects": true,
7
7
  "devDependencies": {
8
- "@graphcommerce/prettier-config-pwa": "6.0.0-canary.42"
8
+ "@graphcommerce/prettier-config-pwa": "6.0.0-canary.44"
9
9
  },
10
10
  "prettier": "@graphcommerce/prettier-config-pwa"
11
11
  }