@graphcommerce/docs 4.4.3 → 4.5.0
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 +10 -0
- package/getting-started/create.md +11 -9
- package/getting-started/header.md +2 -7
- package/getting-started/pages.md +0 -2
- package/getting-started/vscode.md +8 -14
- package/package.json +1 -1
- package/readme.md +2 -2
- package/roadmap.md +1 -1
- package/upgrading.md +168 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1341](https://github.com/graphcommerce-org/graphcommerce/pull/1341) [`a06c86706`](https://github.com/graphcommerce-org/graphcommerce/commit/a06c86706c8b76ce91cfa1e526fe16aa20c53991) Thanks [@paales](https://github.com/paales)! - Added upgrade instructions
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#1338](https://github.com/graphcommerce-org/graphcommerce/pull/1338) [`a8886ce4c`](https://github.com/graphcommerce-org/graphcommerce/commit/a8886ce4c059e85b83158b4bc1d8e2f04626d49f) Thanks [@paales](https://github.com/paales)! - Docs improvements
|
|
12
|
+
|
|
3
13
|
## 4.4.3
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -65,14 +65,13 @@ https://user-images.githubusercontent.com/1251986/158647122-dc57002f-a9c2-4661-a
|
|
|
65
65
|
|
|
66
66
|
### Download the example
|
|
67
67
|
|
|
68
|
-
1. `git clone git@github.com:graphcommerce-org/graphcommerce.git
|
|
68
|
+
1. `git clone git@github.com:graphcommerce-org/graphcommerce.git`
|
|
69
69
|
2. `mkdir my-project`
|
|
70
70
|
3. `cp -R graphcommerce/examples/magento-graphcms/. my-project`
|
|
71
|
-
4. `
|
|
72
|
-
5. `
|
|
73
|
-
6. `
|
|
74
|
-
7. `rm
|
|
75
|
-
8. `rm -rf node_modules && rm -rf .next`
|
|
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`
|
|
76
75
|
|
|
77
76
|
Edit /package.json. Delete `"scripts": {...}` and rename `scripts_local` to
|
|
78
77
|
`scripts`:
|
|
@@ -99,7 +98,7 @@ Edit /package.json. Delete `"scripts": {...}` and rename `scripts_local` to
|
|
|
99
98
|
To order to be able to connect your GraphCommerce app to your Magento backend
|
|
100
99
|
and/or GraphCMS project, you'll need:
|
|
101
100
|
|
|
102
|
-
- Magento 2.4.3 - Clean install,
|
|
101
|
+
- Magento 2.4.3 - Clean install, a production or a development environment
|
|
103
102
|
- GraphCMS - A GraphCMS project with the required schema.
|
|
104
103
|
[Clone the demo GraphCMS project ↗](https://app.graphcms.com/clone/caddaa93cfa9436a9e76ae9c0F34d257)
|
|
105
104
|
as your starting point.
|
|
@@ -142,7 +141,7 @@ added as a result, with the exception of the first option in the list.
|
|
|
142
141
|
### Remove unused PSP's
|
|
143
142
|
|
|
144
143
|
The example has Payment Service Providers integrated (Mollie, Braintree). Remove
|
|
145
|
-
the ones
|
|
144
|
+
the ones your Magento backend doesn't support.
|
|
146
145
|
|
|
147
146
|
- Remove `"@graphcommerce/[psp]"` from package.json
|
|
148
147
|
- Remove all [psp] references from `pages/checkout/payment.tsx`
|
|
@@ -156,7 +155,10 @@ the ones you don't want to use.
|
|
|
156
155
|
Visit the development environment running at http://localhost:3000
|
|
157
156
|
Visit the GraphQL Playground running at http://localhost:3000/api/graphql
|
|
158
157
|
|
|
159
|
-
> No success? Refer to [common build errors](../framework/troubleshooting.md)
|
|
158
|
+
> No success? Refer to [common build errors](../framework/troubleshooting.md) or
|
|
159
|
+
> ask your question in the public
|
|
160
|
+
> [Slack community ↗](https://join.slack.com/t/graphcommerce/shared_invite/zt-11rmgq1ad-F~0daNtKcSvtcC4eQRzjeQ)
|
|
161
|
+
> chat
|
|
160
162
|
|
|
161
163
|
## Next steps
|
|
162
164
|
|
|
@@ -101,8 +101,8 @@ https://user-images.githubusercontent.com/1251986/154979091-89c72d68-c62f-451c-a
|
|
|
101
101
|
|
|
102
102
|
### Replace Search input with Search Fab
|
|
103
103
|
|
|
104
|
-
- In /components/Layout/LayoutFull.tsx, replace
|
|
105
|
-
|
|
104
|
+
- In /components/Layout/LayoutFull.tsx, replace `<SearchLink href='/search' />`
|
|
105
|
+
with:
|
|
106
106
|
|
|
107
107
|
```tsx
|
|
108
108
|
<PageLink href='/search' passHref>
|
|
@@ -144,11 +144,6 @@ https://user-images.githubusercontent.com/1251986/154979091-89c72d68-c62f-451c-a
|
|
|
144
144
|
|
|
145
145
|
- Make a copy of /node_modules/@graphcommerce/next-ui/LayoutParts/MenuFab.tsx
|
|
146
146
|
and move it to the directory /components/Layout/MenuFab.tsx
|
|
147
|
-
- In /components/Layout/MenuFab.tsx, change
|
|
148
|
-
`const MotionDiv = styled(m.div)({})` to:
|
|
149
|
-
```ts
|
|
150
|
-
const MotionDiv = styled('div')({})
|
|
151
|
-
```
|
|
152
147
|
- Remove the `style={{...}}` prop from both the `<MotionDiv>` components to
|
|
153
148
|
remove the Fab scroll animation
|
|
154
149
|
- Remove `const { opacity, scale, shadowOpacity } = useFabAnimation()`
|
package/getting-started/pages.md
CHANGED
|
@@ -102,7 +102,6 @@ export const getStaticProps: GetPageStaticProps = async (context) => {
|
|
|
102
102
|
...(await page).data,
|
|
103
103
|
apolloState: await conf.then(() => client.cache.extract()),
|
|
104
104
|
},
|
|
105
|
-
revalidate: 60 * 20,
|
|
106
105
|
}
|
|
107
106
|
}
|
|
108
107
|
```
|
|
@@ -209,7 +208,6 @@ export const getStaticProps: GetPageStaticProps = async (context) => {
|
|
|
209
208
|
...(await page).data,
|
|
210
209
|
apolloState: await conf.then(() => client.cache.extract()),
|
|
211
210
|
},
|
|
212
|
-
revalidate: 60 * 20,
|
|
213
211
|
}
|
|
214
212
|
}
|
|
215
213
|
```
|
|
@@ -13,7 +13,7 @@ as GraphCommerce. Visual Studio Code is free and available on all platforms.
|
|
|
13
13
|
This guide covers which useful VS Code extensions to install for an optimal
|
|
14
14
|
development experience.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Required extensions
|
|
17
17
|
|
|
18
18
|
- [ESLint ↗](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) -
|
|
19
19
|
Linter tool for identifying and reporting on patterns in JavaScript
|
|
@@ -22,24 +22,18 @@ Recommended extensions
|
|
|
22
22
|
- [GraphQL ↗](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql) -
|
|
23
23
|
Adds syntax highlighting, validation, hover information and autocompletion for
|
|
24
24
|
graphql files
|
|
25
|
+
- [Yaml ↗](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
|
|
26
|
+
|
|
27
|
+
Recommended extensions:
|
|
28
|
+
|
|
25
29
|
- [DotENV ↗](https://marketplace.visualstudio.com/items?itemName=mikestead.dotenv) -
|
|
26
30
|
Adds support for dotenv file syntax
|
|
27
|
-
- [JavaScript Booster ↗](https://marketplace.visualstudio.com/items?itemName=sburg.vscode-javascript-booster) -
|
|
28
|
-
Advanced JavaScript/TypeScript refactorings and commands
|
|
29
31
|
- [gettext ↗](https://marketplace.visualstudio.com/items?itemName=mrorz.language-gettext) -
|
|
30
32
|
Adds syntax highlight to po translation files
|
|
31
|
-
|
|
32
|
-
Optional extentions
|
|
33
|
-
|
|
34
|
-
- [Color Highlight ↗](https://marketplace.visualstudio.com/items?itemName=naumovs.color-highlight)
|
|
35
|
-
- [Material Theme ↗](https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-material-theme)
|
|
36
|
-
- [Material Theme Icons ↗](https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-material-theme-icons)
|
|
37
|
-
- [Output Colorizer ↗](https://marketplace.visualstudio.com/items?itemName=IBM.output-colorizer)
|
|
38
|
-
- [Readability Check ↗](https://marketplace.visualstudio.com/items?itemName=jemcclin.readabilitycheck)
|
|
39
33
|
- [Github Actions ↗](https://marketplace.visualstudio.com/items?itemName=me-dutour-mathieu.vscode-github-actions)
|
|
40
|
-
- [
|
|
41
|
-
|
|
42
|
-
- [
|
|
34
|
+
- [JavaScript Booster ↗](https://marketplace.visualstudio.com/items?itemName=sburg.vscode-javascript-booster) -
|
|
35
|
+
Advanced JavaScript/TypeScript refactorings and commands
|
|
36
|
+
- [Color Highlight ↗](https://marketplace.visualstudio.com/items?itemName=naumovs.color-highlight)
|
|
43
37
|
|
|
44
38
|
## Next steps
|
|
45
39
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/docs",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/docs",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce/docs",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.5.0",
|
|
6
6
|
"sideEffects": true,
|
|
7
7
|
"devDependencies": {
|
|
8
8
|
"@graphcommerce/prettier-config-pwa": "^4.0.2"
|
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
menu: Overview
|
|
3
|
-
order: getting-started,framework, contributing, roadmap
|
|
3
|
+
order: getting-started,framework, upgrading, contributing, roadmap
|
|
4
4
|
metaTitle: Start React, Next.js Magento PWA development here - GraphCommerce
|
|
5
5
|
metaDescription:
|
|
6
6
|
'GraphCommerce is the open-source PWA Studio Magento 2 alternative.
|
|
@@ -40,7 +40,7 @@ https://user-images.githubusercontent.com/1251986/154977573-4015e77c-43e7-481e-a
|
|
|
40
40
|
- Nextjs
|
|
41
41
|
- GraphQL
|
|
42
42
|
- Mui
|
|
43
|
-
- Apollo
|
|
43
|
+
- Apollo Client
|
|
44
44
|
- GraphQL Code Generator
|
|
45
45
|
- Framer Motion
|
|
46
46
|
|
package/roadmap.md
CHANGED
|
@@ -11,7 +11,7 @@ The following overview contains the status of items on the GraphCommerce roadmap
|
|
|
11
11
|
|
|
12
12
|
- [x] Framework updates (Mui5)
|
|
13
13
|
- [x] Translation updates (DE, NL, ES, FR, IT)
|
|
14
|
-
- [
|
|
14
|
+
- [x] Documentation and installation guide
|
|
15
15
|
- [ ] Quality improvements (Reduce components, naming)
|
|
16
16
|
|
|
17
17
|
## Planned
|
package/upgrading.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
> **Developer preview**
|
|
2
|
+
> This is a developer preview of GraphCommerce. The documentation will be
|
|
3
|
+
> updated as GraphCommerce introduces
|
|
4
|
+
> [new features and refines existing functionality](https://github.com/graphcommerce-org/graphcommerce/releases).
|
|
5
|
+
|
|
6
|
+
# Upgrading
|
|
7
|
+
|
|
8
|
+
We are going to upgrade your project to the latest version, for all the new
|
|
9
|
+
features and fixes that we've made. We can automate most of this process, but
|
|
10
|
+
there are some manual steps involved.
|
|
11
|
+
|
|
12
|
+
We try to keep changes to the examples minimal as possible, but sometimes this
|
|
13
|
+
is inevitable. 95% of the changes are made inside the @graphcommerce packages,
|
|
14
|
+
but for some changes we need to make changes in the example to get everything
|
|
15
|
+
working.
|
|
16
|
+
|
|
17
|
+
To upgrade your project to the latest version we need to do a few steps:
|
|
18
|
+
|
|
19
|
+
## What you'll do
|
|
20
|
+
|
|
21
|
+
After you've finished this guide, you'll have accomplished the following:
|
|
22
|
+
|
|
23
|
+
- Created a changes.patch file and applied it to your project
|
|
24
|
+
- Upgraded all dependencies to the latest version
|
|
25
|
+
- Incorporated all latest changes in your project while maintaining all your
|
|
26
|
+
customizations
|
|
27
|
+
|
|
28
|
+
## Create an apply a patch file
|
|
29
|
+
|
|
30
|
+
1. Get the version of **your own project**
|
|
31
|
+
|
|
32
|
+
In your local package.json you'll find something like this:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"dependencies": {
|
|
37
|
+
//...
|
|
38
|
+
"@graphcommerce/next-ui": "^4.2.0"
|
|
39
|
+
//...
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
We need the version of `@graphcommerce/next-ui` later.
|
|
45
|
+
|
|
46
|
+
2. Create a clone of the `https://github.com/graphcommerce-org/graphcommerce`
|
|
47
|
+
repo.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git clone git@github.com:graphcommerce-org/graphcommerce.git
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or if you have a local copy already available, make sure that you are on the
|
|
54
|
+
latest commit of the `main` branch.
|
|
55
|
+
|
|
56
|
+
3. Create a patch from the example
|
|
57
|
+
|
|
58
|
+
Replace `OLD_VERSION` in the command below with the version number of
|
|
59
|
+
`@graphcommerce/next-ui` you just looked up:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
git diff --relative=examples/magento-graphcms "@graphcommerce/next-ui@OLD_VERSION" examples/magento-graphcms ':!examples/magento-graphcms/CHANGELOG.md' > changes.patch
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Run the above command (with OLD_VERSION replaced with something like `1.2.3`)
|
|
66
|
+
in the `graphcommerce` repo. you should have a changes.patch file in root of
|
|
67
|
+
the `graphcommerce` repo.
|
|
68
|
+
|
|
69
|
+
4. Move the file to your project's root directory
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
mv changes.patch ../your-project-root
|
|
73
|
+
cd ../your-project-root
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Tip: create a separate branch
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
git checkout -b my-upgrade
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
You should now have a changes.patch file in the root of your project.
|
|
83
|
+
|
|
84
|
+
5. Apply the patch to your project
|
|
85
|
+
|
|
86
|
+
Make sure your working directory is clean (except for the changes.patch file)
|
|
87
|
+
and run:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
git apply --reject --ignore-whitespace --exclude=README.md changes.patch
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
You should now have all the changes from the example applied to your project.
|
|
94
|
+
|
|
95
|
+
Tip: create an intermediate commit
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
git commit -am"refactor: applied patches"
|
|
99
|
+
rm changes.patch
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## What has happened?
|
|
103
|
+
|
|
104
|
+
> `git apply --reject` will try and apply all the diffs to your project and if
|
|
105
|
+
> it isn't able to do so, it will create a `.rej` file for _each_ file that it
|
|
106
|
+
> couldn't apply the changes to.
|
|
107
|
+
>
|
|
108
|
+
> `git` expects you to manually apply the changes in the `.rej` files to your
|
|
109
|
+
> project.
|
|
110
|
+
|
|
111
|
+
## Resolving package.json issues
|
|
112
|
+
|
|
113
|
+
If you've got a package.json.rej file and the diff is very large, it might be
|
|
114
|
+
easier to manually update the file.
|
|
115
|
+
|
|
116
|
+
We want to have the latest `dependencies`, `devDependencies` and `scripts` from
|
|
117
|
+
`graphcommerce/examples/magento-example/package.json`.
|
|
118
|
+
|
|
119
|
+
- Replace your local `dependencies` with the example `dependencies` (and
|
|
120
|
+
[remove PSPs](./getting-started/create.md#remove-unused-psps) your backend
|
|
121
|
+
doesn't support)
|
|
122
|
+
- Replace your local `devDependencies` with the example `devDependencies`
|
|
123
|
+
- Replace your local `scripts` with the example `scripts_local`
|
|
124
|
+
|
|
125
|
+
It might be that you have installed additional local dependencies, you can keep
|
|
126
|
+
those.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
rm yarn.lock
|
|
130
|
+
yarn
|
|
131
|
+
yarn codegen
|
|
132
|
+
rm package.json.rej
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Resolving patch conflicts
|
|
136
|
+
|
|
137
|
+
It can very wel be that some files can't be updated automatically, because of
|
|
138
|
+
your modifications. You'll see something like `Rejected hunk #2` in the cli. The
|
|
139
|
+
above command will create rejection files like `Component.ts.rej` for each hunk
|
|
140
|
+
it couldn't apply.
|
|
141
|
+
|
|
142
|
+
All the '.rej' files **must** be handled manually by:
|
|
143
|
+
|
|
144
|
+
- Manually applying the diff in the .rej file to the original file because you
|
|
145
|
+
want the changes. (recommended)
|
|
146
|
+
- Discarding the .rej file because you've modified the project already.
|
|
147
|
+
|
|
148
|
+
Make sure all .rej files are deleted (`find . -type f -name '*.rej' -delete`)
|
|
149
|
+
|
|
150
|
+
Tip: make a commit
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
git commit -am"refactor: processed manual .rej files"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Running and validating your project
|
|
157
|
+
|
|
158
|
+
- `yarn codegen` should run without errors
|
|
159
|
+
- `yarn tsc:lint` should run without errors
|
|
160
|
+
- `yarn dev` should run without errors
|
|
161
|
+
|
|
162
|
+
If the above commands are working correctly you should now have a working
|
|
163
|
+
project. Validate if everything looks right, especially the parts that have
|
|
164
|
+
manual changes.
|
|
165
|
+
|
|
166
|
+
You are done with the upgrade! 🎉
|
|
167
|
+
|
|
168
|
+
Commit, push and deploy!
|