Commit 27826fc
feat: add middlewareModule to nuxt and next storefront packages (#7058)
* refactor: rename module dir to modules
* feat: new SDK module - moduleFromEndpoints
* feat: default behaviour of HTTP Client
* remove isomorphic-fetch from depts
* full implementation of HTTP client
* feat: add customizable error handler
* await error handler
* refactor: improve tsdocs
* fix: issue with custom methods in new module
* test: additonal tests
* fix issue with losing tsdocs
* prerelease
* fix header type
* revert last fix
* chore: bump package
* refactor: use moduleFromEndpoints in next
* refactor: update shared
* refactor: update nuxt package
* refactor: easeier setup
* chore: fix version
* Update packages/sdk/src/__tests__/integration/modules/moduleFromEndpoints.spec.ts
Co-authored-by: Tomasz Góral <[email protected]>
* feat: HTTP Client for moduleForEndpoints (#7053)
* feat: default behaviour of HTTP Client
* remove isomorphic-fetch from depts
* full implementation of HTTP client
* test: update tests based on the review
* fix issue with URL class and urls as paths
* add test for axios
* add computed headers to http client
* update tsdocs
* feat: add customizable error handler (#7054)
* feat: default behaviour of HTTP Client
* remove isomorphic-fetch from depts
* full implementation of HTTP client
* feat: add customizable error handler
* await error handler
* update error handler due to feedback
* update tsdocs
* refactor default http client
* use unknown instead of any
* add method name to error handler
* update tsdocs
* apply review suggestions
* refactor: simplification & improve tsdocs (#7055)
* feat: default behaviour of HTTP Client
* remove isomorphic-fetch from depts
* full implementation of HTTP client
* feat: add customizable error handler
* await error handler
* refactor: improve tsdocs
* test non-object params
* add comment
* add module types to api extractor
* fix: issue with custom methods in new module (#7056)
* feat: default behaviour of HTTP Client
* remove isomorphic-fetch from depts
* full implementation of HTTP client
* feat: add customizable error handler
* await error handler
* refactor: improve tsdocs
* fix: issue with custom methods in new module
* test: additonal tests
* fix issue with losing tsdocs
* rename file
* missing import
* include credentials
* Update packages/sdk/src/modules/moduleFromEndpoints/types.ts
Co-authored-by: Łukasz Śliwa <[email protected]>
---------
Co-authored-by: Łukasz Śliwa <[email protected]>
* bump version
* use new version
* refactor: use getRequestHeaders naming for both nuxt and next
* update tsdocs
* rename module to middlewareModule
* bump sdk package
* use middlewareModule naming
* use strict mode in storefront packages
* deprecate getCookieHeader
* refactor
* first try to fix the yarn.lock
* add prettier
* revert
* update sdk package
* exit pre mode and refactor
* add prettier
* add changelogs and bump packages
* apply review suggestions
* apply review suggestions pt2
---------
Co-authored-by: Tomasz Góral <[email protected]>
Co-authored-by: Łukasz Śliwa <[email protected]>1 parent f5bac3c commit 27826fc
File tree
21 files changed
+152
-881
lines changed- packages/storefront
- packages
- next
- __tests__/apps
- app-router
- pages-router
- src/sdk
- nuxt
- __tests__/app
- src
- runtime
21 files changed
+152
-881
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
3 | 29 | | |
4 | 30 | | |
5 | 31 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
23 | 19 | | |
24 | | - | |
| 20 | + | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
| |||
31 | 27 | | |
32 | 28 | | |
33 | 29 | | |
34 | | - | |
35 | | - | |
| 30 | + | |
| 31 | + | |
36 | 32 | | |
37 | | - | |
38 | | - | |
| 33 | + | |
| 34 | + | |
39 | 35 | | |
40 | 36 | | |
41 | | - | |
| 37 | + | |
42 | 38 | | |
43 | 39 | | |
44 | 40 | | |
| |||
58 | 54 | | |
59 | 55 | | |
60 | 56 | | |
| 57 | + | |
61 | 58 | | |
62 | 59 | | |
63 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
3 | 40 | | |
4 | 41 | | |
5 | 42 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
0 commit comments