@graphcommerce/docs 4.4.2 → 4.5.1

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,27 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1347](https://github.com/graphcommerce-org/graphcommerce/pull/1347) [`31f463d5c`](https://github.com/graphcommerce-org/graphcommerce/commit/31f463d5c2edff45911b63b1d89e5857244c1754) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Upgrading
8
+
9
+ ## 4.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#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
14
+
15
+ ### Patch Changes
16
+
17
+ - [#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
18
+
19
+ ## 4.4.3
20
+
21
+ ### Patch Changes
22
+
23
+ - [#1334](https://github.com/graphcommerce-org/graphcommerce/pull/1334) [`d1a06dd8e`](https://github.com/graphcommerce-org/graphcommerce/commit/d1a06dd8e060986a4d652c9d5e46d9d1a161a7d1) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - fix installation video
24
+
3
25
  ## 4.4.2
4
26
 
5
27
  ### Patch Changes
@@ -63,18 +63,15 @@ https://user-images.githubusercontent.com/1251986/158647122-dc57002f-a9c2-4661-a
63
63
  <figcaption>GraphCommerce installation</figcaption>
64
64
  </figure>
65
65
 
66
- <figure>
67
-
68
66
  ### Download the example
69
67
 
70
- 1. `git clone git@github.com:graphcommerce-org/graphcommerce.git graphcommerce`
68
+ 1. `git clone git@github.com:graphcommerce-org/graphcommerce.git`
71
69
  2. `mkdir my-project`
72
70
  3. `cp -R graphcommerce/examples/magento-graphcms/. my-project`
73
- 4. `rm -rf graphcommerce`
74
- 5. `cd my-project`
75
- 6. `cp -R .env.example .env`
76
- 7. `rm CHANGELOG.md && touch CHANGELOG.md`
77
- 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`
78
75
 
79
76
  Edit /package.json. Delete `"scripts": {...}` and rename `scripts_local` to
80
77
  `scripts`:
@@ -101,7 +98,7 @@ Edit /package.json. Delete `"scripts": {...}` and rename `scripts_local` to
101
98
  To order to be able to connect your GraphCommerce app to your Magento backend
102
99
  and/or GraphCMS project, you'll need:
103
100
 
104
- - Magento 2.4.3 - Clean install, or a production or development environment
101
+ - Magento 2.4.3 - Clean install, a production or a development environment
105
102
  - GraphCMS - A GraphCMS project with the required schema.
106
103
  [Clone the demo GraphCMS project ↗](https://app.graphcms.com/clone/caddaa93cfa9436a9e76ae9c0F34d257)
107
104
  as your starting point.
@@ -144,7 +141,7 @@ added as a result, with the exception of the first option in the list.
144
141
  ### Remove unused PSP's
145
142
 
146
143
  The example has Payment Service Providers integrated (Mollie, Braintree). Remove
147
- the ones you don't want to use.
144
+ the ones your Magento backend doesn't support.
148
145
 
149
146
  - Remove `"@graphcommerce/[psp]"` from package.json
150
147
  - Remove all [psp] references from `pages/checkout/payment.tsx`
@@ -158,7 +155,10 @@ the ones you don't want to use.
158
155
  Visit the development environment running at http://localhost:3000
159
156
  Visit the GraphQL Playground running at http://localhost:3000/api/graphql
160
157
 
161
- > 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
162
162
 
163
163
  ## Next steps
164
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
- `<SearchButton onClick={onSearchStart} label=' ' />` with:
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()`
@@ -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
- Recommended extensions
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
- - [MDX ↗](https://marketplace.visualstudio.com/items?itemName=silvenon.mdx)
41
- - [Markdown Preview Github Styling ↗](https://marketplace.visualstudio.com/items?itemName=bierner.markdown-preview-github-styles)
42
- - [Yaml ↗](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
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.4.2",
5
+ "version": "4.5.1",
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
- - [ ] Documentation and installation guide
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,116 @@
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
+ This guide describes how to upgrade your GraphCommerce project files and its
9
+ dependencies, while keeping your customizations.
10
+
11
+ ### After you've finished this upgrading guide, you'll have accomplished the following:
12
+
13
+ - Created a changes.patch file and applied it to your project
14
+ - Upgraded all dependencies to the latest version
15
+ - Incorporated all the latest changes in your project, while keeping your
16
+ customizations
17
+
18
+ ## Step 1: Creating and applying a patch file
19
+
20
+ 1. In package.json, find your version:
21
+
22
+ ```json
23
+ // Example from package.json
24
+
25
+ {
26
+ "dependencies": {
27
+ //...
28
+ "@graphcommerce/next-ui": "^4.2.0"
29
+ //...
30
+ }
31
+ }
32
+ ```
33
+
34
+ 2. Download a fresh copy of the repository:
35
+
36
+ ```bash
37
+ git clone git@github.com:graphcommerce-org/graphcommerce.git upgrade
38
+ ```
39
+
40
+ 3. Navigate to the /upgrade directory you've just created. Run the following
41
+ command, but replace `OLD_VERSION` with your version of
42
+ `@graphcommerce/next-ui`:
43
+
44
+ ```bash
45
+ git diff --relative=examples/magento-graphcms "@graphcommerce/next-ui@OLD_VERSION" examples/magento-graphcms ':!examples/magento-graphcms/CHANGELOG.md' > changes.patch
46
+ ```
47
+
48
+ 4. Move the `changes.patch` file from the /upgrade directory to the root of your
49
+ project.
50
+
51
+ 5. Apply the patch to your project (It's recommended to apply changes on a new
52
+ branch):
53
+
54
+ ```bash
55
+ git apply --reject --ignore-whitespace --exclude=README.md changes.patch
56
+ ```
57
+
58
+ ## Step 2: Resolving issues
59
+
60
+ ### Resolving package.json issues
61
+
62
+ If running the upgrade steps results in a `package.json.rej` file and the diff
63
+ is large, it can be easier to manually update the `package.json` file.
64
+
65
+ Compare your local /package.json with the example's
66
+ `/upgrade/examples/magento-graphcms/package.json` you just downloaded and:
67
+
68
+ 1. Replace your local `dependencies` with the example's `dependencies`. Keep any
69
+ additional installed local dependencies and
70
+ [remove PSP's](./getting-started/create.md#remove-unused-psps) your backend
71
+ doesn't support.
72
+ 2. Replace your local `devDependencies` with the example's `devDependencies`
73
+ 3. Replace your local `scripts` with the example's `scripts_local`
74
+
75
+ After updating the package.json file, run the following to install the latest
76
+ packages:
77
+
78
+ - `rm yarn.lock && yarn` Remove lock and install the dependencies
79
+ - `yarn codegen` Converts all .graphql files to typescript files
80
+ - `yarn dev` Run the app
81
+
82
+ ### Resolving diff issues
83
+
84
+ When you run `git apply ...` (step 4), git will try and apply all the diffs from
85
+ the patch file to your project files. When applying a diff fails, a
86
+ [reject ↗](https://git-scm.com/docs/git-apply#Documentation/git-apply.txt---reject)
87
+ `.rej` file will be created for _each_ file that could not be upgraded.
88
+
89
+ It can very well be that some files can't be updated automatically, because of
90
+ modifications you made. The CLI will show you the location of these files, as
91
+ well as the number of hunks:
92
+
93
+ ```
94
+ Applying patch pages/_app.tsx with 2 rejects...
95
+ Rejected hunk #1.
96
+ Rejected hunk #2.
97
+ ```
98
+
99
+ The suggested changes have to be reviewed _manually_ (a diff tool can provide
100
+ insight, but won't be able to apply diffs). Manually apply the suggested changes
101
+ you want. Discard the .rej files of the suggested changes you don't want. Before
102
+ you commit, make sure to delete all the .rej files:
103
+
104
+ ```bash
105
+ find . -type f -name '*.rej' -delete
106
+ ```
107
+
108
+ After resolving the diff issues, run and validate your local environment:
109
+
110
+ - `yarn codegen` should run without errors
111
+ - `yarn tsc:lint` should run without errors
112
+ - `yarn dev` should run without errors
113
+
114
+ ## Next steps
115
+
116
+ - Learn how to [contribute to GraphCommerce](./contributing.md)