@graphcommerce/docs 4.6.3 → 4.6.6
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 +55 -0
- package/feature-list.md +1 -1
- package/framework/translations.md +24 -12
- package/getting-started/create.md +7 -8
- package/getting-started/readme.md +1 -1
- package/package.json +2 -2
- package/roadmap.md +0 -1
- package/upgrading.md +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.6.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1587](https://github.com/graphcommerce-org/graphcommerce/pull/1587) [`6ce2cbaf2`](https://github.com/graphcommerce-org/graphcommerce/commit/6ce2cbaf2cf27e21b753f7cb71e7e74826294de6) Thanks [@paales](https://github.com/paales)! - fixed typo from grapql to graphql
|
|
8
|
+
|
|
9
|
+
## 4.6.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1584](https://github.com/graphcommerce-org/graphcommerce/pull/1584) [`f424f3da1`](https://github.com/graphcommerce-org/graphcommerce/commit/f424f3da125d2ec961ae60ebec7a65825710f72c) Thanks [@paales](https://github.com/paales)! - fixed typo from grapql to graphql
|
|
14
|
+
|
|
15
|
+
## 4.6.4
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#1443](https://github.com/graphcommerce-org/graphcommerce/pull/1443) [`c4c86df1e`](https://github.com/graphcommerce-org/graphcommerce/commit/c4c86df1e8c74956b2ae76ab1a88c496fced4790) Thanks [@timhofman](https://github.com/timhofman)! - Missing or outdated resolutions results in build errors
|
|
20
|
+
|
|
21
|
+
* [#1451](https://github.com/graphcommerce-org/graphcommerce/pull/1451) [`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061) Thanks [@paales](https://github.com/paales)! - Removed all occurences of @lingui/macro and moved to @lingui/macro / @lingui/core in preparation to move to swc.
|
|
22
|
+
|
|
23
|
+
Since we've removed @lingui/macro, all occurences need to be replaced with @lingui/core and @lingui/react.
|
|
24
|
+
|
|
25
|
+
All occurences of `<Trans>` and `t` need to be replaced:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { Trans, t } from '@lingui/macro'
|
|
29
|
+
|
|
30
|
+
function MyComponent() {
|
|
31
|
+
const foo = 'bar'
|
|
32
|
+
return (
|
|
33
|
+
<div aria-label={t`Account ${foo}`}>
|
|
34
|
+
<Trans>My Translation {foo}</Trans>
|
|
35
|
+
</div>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Needs to be replaced with:
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { Trans } from '@lingui/react'
|
|
44
|
+
import { i18n } from '@lingui/core'
|
|
45
|
+
|
|
46
|
+
function MyComponent() {
|
|
47
|
+
const foo = 'bar'
|
|
48
|
+
return (
|
|
49
|
+
<div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
|
|
50
|
+
<Trans key='My Translation {foo}' values={{ foo }}></Trans>
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
[More examples for Trans](https://lingui.js.org/ref/macro.html#examples-of-jsx-macros) and [more examples for `t`](https://lingui.js.org/ref/macro.html#examples-of-js-macros)
|
|
57
|
+
|
|
3
58
|
## 4.6.3
|
|
4
59
|
|
|
5
60
|
### Patch Changes
|
package/feature-list.md
CHANGED
|
@@ -218,7 +218,7 @@ Black checkbox is a feature unaffected by GraphCommerce
|
|
|
218
218
|
average order value.
|
|
219
219
|
- [ ] Show pricing tiers. — [Todo]
|
|
220
220
|
- [x] Present product ratings and reviews.
|
|
221
|
-
- [
|
|
221
|
+
- [x] Provide an option to add products to a wish list.
|
|
222
222
|
- [ ] Add Facebook, Twitter, and email links to share products. — [Todo]
|
|
223
223
|
|
|
224
224
|
### Checkout
|
|
@@ -26,12 +26,12 @@ msgstr "cancelado"
|
|
|
26
26
|
|
|
27
27
|
The msgid is the message being translated. In
|
|
28
28
|
/node_modules/@graphcommerce/magento-cart/components/EmptyCart/EmptyCart.tsx,
|
|
29
|
-
you can see
|
|
29
|
+
you can see that the first msgid is passed as a the id prop to the <Trans>
|
|
30
30
|
component:
|
|
31
31
|
|
|
32
|
-
```
|
|
32
|
+
```tsx
|
|
33
33
|
<FullPageMessage
|
|
34
|
-
title={<Trans
|
|
34
|
+
title={<Trans id="Your cart is empty" />}
|
|
35
35
|
...
|
|
36
36
|
>
|
|
37
37
|
```
|
|
@@ -57,20 +57,31 @@ Refresh to see your changes updated
|
|
|
57
57
|
## Adding translations to custom component
|
|
58
58
|
|
|
59
59
|
If you're building a component, you can wrap the strings you want to translate
|
|
60
|
-
in the `<Trans>`
|
|
60
|
+
in the `<Trans>` component:
|
|
61
61
|
|
|
62
|
-
```
|
|
62
|
+
```tsx
|
|
63
63
|
<Typography variant='h3'>
|
|
64
|
-
<Trans
|
|
64
|
+
<Trans id='Call us now' />
|
|
65
65
|
</Typography>
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
+
To translate a string:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
<PageMeta title={i18n._(/* i18n */ `Blog`)} />
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
_The `/* i18n */` comment is required for `lingui extract` to work properly_
|
|
75
|
+
|
|
68
76
|
Add Linqui to the component's imports:
|
|
69
77
|
|
|
70
|
-
```
|
|
71
|
-
import {
|
|
78
|
+
```tsx
|
|
79
|
+
import { Trans } from '@lingui/react'
|
|
80
|
+
import { i18n } from '@lingui/core'
|
|
72
81
|
```
|
|
73
82
|
|
|
83
|
+
## Generating translation files with all translations
|
|
84
|
+
|
|
74
85
|
Run `yarn lingui`. All new (missing) translations will be added to translations
|
|
75
86
|
files:
|
|
76
87
|
|
|
@@ -184,11 +195,12 @@ msgstr ""
|
|
|
184
195
|
|
|
185
196
|
```
|
|
186
197
|
|
|
187
|
-
5. Add your translations
|
|
198
|
+
5. Add your translations in the newly created .po file. Run the app and use the
|
|
188
199
|
store switcher to navigate to your new storeview.
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
200
|
+
|
|
201
|
+
> Tip: [Github copilot ↗](https://copilot.github.com/) provides very accurate
|
|
202
|
+
> suggestions in VS Code with the
|
|
203
|
+
> [Github copilot extention ↗](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot).
|
|
192
204
|
|
|
193
205
|
### Magento Locale codes
|
|
194
206
|
|
|
@@ -47,7 +47,7 @@ If you want to test a GraphCommerce storefront using a pre-configured Magento
|
|
|
47
47
|
demo store and a pre-configured GraphCMS project with demo content, then you
|
|
48
48
|
need to only install the dependencies. This is the quickest approach.
|
|
49
49
|
|
|
50
|
-
- Install and use node 14: `nvm install 14
|
|
50
|
+
- Install and use node 14: `nvm install 14` or `nvm use 14`
|
|
51
51
|
- Install yarn: `npm install --global yarn`
|
|
52
52
|
|
|
53
53
|
## Step 1: Create a new GraphCommerce app
|
|
@@ -65,13 +65,12 @@ https://user-images.githubusercontent.com/1251986/158647122-dc57002f-a9c2-4661-a
|
|
|
65
65
|
|
|
66
66
|
### Download the example
|
|
67
67
|
|
|
68
|
-
1. `git clone
|
|
69
|
-
2. `mkdir my-project`
|
|
70
|
-
3. `cp -R graphcommerce/examples/magento-graphcms/. my-project && rm -rf graphcommerce`
|
|
71
|
-
4. `cd my-project`
|
|
72
|
-
5. `cp -R .env.example .env`
|
|
73
|
-
6. `rm CHANGELOG.md`
|
|
74
|
-
7. `rm -rf node_modules && rm -rf .next`
|
|
68
|
+
1. `git clone https://github.com/graphcommerce-org/graphcommerce.git` — clone repository
|
|
69
|
+
2. `mkdir my-project` — create project folder
|
|
70
|
+
3. `cp -R graphcommerce/examples/magento-graphcms/. my-project && rm -rf graphcommerce` — copy example, delete repo
|
|
71
|
+
4. `cd my-project` — change directory to project folder
|
|
72
|
+
5. `cp -R .env.example .env` — create .env file
|
|
73
|
+
6. `rm CHANGELOG.md` — remove changelog
|
|
75
74
|
|
|
76
75
|
Edit /package.json. Delete `"scripts": {...}` and rename `scripts_local` to
|
|
77
76
|
`scripts`:
|
|
@@ -211,7 +211,7 @@ API. GraphCommerce uses GraphQL Mesh, which adds the ability to add extra
|
|
|
211
211
|
(micro)services as data sources. In the magento-graphcms example, a headless CMS
|
|
212
212
|
called [GraphCMS](../getting-started/../framework/graphcms.md) is integrated.
|
|
213
213
|
|
|
214
|
-
By default, the GraphQL Mesh endpoint runs on route /api/
|
|
214
|
+
By default, the GraphQL Mesh endpoint runs on route /api/graphql. You can query
|
|
215
215
|
both the Magento GraphQL schema and the GraphCMS GraphQL schema. Try out the
|
|
216
216
|
GraphCommerce demo
|
|
217
217
|
[GraphQL Explorer ↗](https://graphcommerce.vercel.app/api/graphql) with the
|
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": "4.6.
|
|
5
|
+
"version": "4.6.6",
|
|
6
6
|
"sideEffects": true,
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@graphcommerce/prettier-config-pwa": "^4.0.
|
|
8
|
+
"@graphcommerce/prettier-config-pwa": "^4.0.6"
|
|
9
9
|
},
|
|
10
10
|
"prettier": "@graphcommerce/prettier-config-pwa"
|
|
11
11
|
}
|
package/roadmap.md
CHANGED
|
@@ -10,7 +10,6 @@ The following overview contains the status of items on the GraphCommerce roadmap
|
|
|
10
10
|
## In progress
|
|
11
11
|
|
|
12
12
|
- [ ] Adyen payment service (Braintree, Mollie, already implemented)
|
|
13
|
-
- [ ] Wishlist
|
|
14
13
|
- [ ] PageBuilder support
|
|
15
14
|
- [ ] Fetch Magento image sizes (probe-image-size)
|
|
16
15
|
|
package/upgrading.md
CHANGED
|
@@ -74,7 +74,8 @@ Compare your local /package.json with the example's
|
|
|
74
74
|
[remove PSP's](./getting-started/create.md#remove-unused-psps) your backend
|
|
75
75
|
doesn't support.
|
|
76
76
|
2. Replace your local `devDependencies` with the example's `devDependencies`
|
|
77
|
-
3. Replace your local `
|
|
77
|
+
3. Replace your local `resolutions` with the example's `resolutions`
|
|
78
|
+
4. Replace your local `scripts` with the example's `scripts_local`
|
|
78
79
|
|
|
79
80
|
After updating the package.json file, run the following to install the latest
|
|
80
81
|
packages:
|