@graphcommerce/docs 6.0.0-canary.43 → 6.0.0-canary.45
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 +8 -0
- package/framework/config.md +13 -13
- package/framework/translations.md +4 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.0.0-canary.45
|
|
4
|
+
|
|
5
|
+
## 6.0.0-canary.44
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#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))
|
|
10
|
+
|
|
3
11
|
## 6.0.0-canary.43
|
|
4
12
|
|
|
5
13
|
## 6.0.0-canary.42
|
package/framework/config.md
CHANGED
|
@@ -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 {
|
|
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
|
|
23
|
-
const scopedConfig =
|
|
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
|
-
|
|
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
|
-
- `
|
|
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,
|
|
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
|
|
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
|
-
###
|
|
224
|
+
### GraphCommerceStorefrontConfig
|
|
225
225
|
|
|
226
|
-
All
|
|
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
|
|
143
|
-
|
|
144
|
-
|
|
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),
|
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.
|
|
5
|
+
"version": "6.0.0-canary.45",
|
|
6
6
|
"sideEffects": true,
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@graphcommerce/prettier-config-pwa": "6.0.0-canary.
|
|
8
|
+
"@graphcommerce/prettier-config-pwa": "6.0.0-canary.45"
|
|
9
9
|
},
|
|
10
10
|
"prettier": "@graphcommerce/prettier-config-pwa"
|
|
11
11
|
}
|