@vtex/faststore 0.0.2 → 0.0.4

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +11 -5
  3. package/dist/catalog.json +556 -265
  4. package/dist/components.d.ts +3 -1
  5. package/dist/components.js +5 -3
  6. package/dist/content-types.json +16 -0
  7. package/dist/core/dist/actions/registry.d.ts +1 -1
  8. package/dist/core/dist/actions/registry.js +1 -1
  9. package/dist/core/dist/actions/registry.js.map +1 -1
  10. package/dist/docs/cart.md +2 -2
  11. package/dist/docs/my-account-profile.md +208 -0
  12. package/dist/docs/session.md +12 -6
  13. package/dist/docs/sign-in-redirect.md +137 -0
  14. package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +2 -2
  15. package/dist/matter/access-code-sign-in/access-code-sign-in.js +5 -2
  16. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
  17. package/dist/matter/buy-button/buy-button.d.ts +1 -1
  18. package/dist/matter/buy-button/buy-button.js +3 -1
  19. package/dist/matter/buy-button/buy-button.js.map +1 -1
  20. package/dist/matter/cart/cart.d.ts +6 -6
  21. package/dist/matter/cart/cart.js +13 -6
  22. package/dist/matter/cart/cart.js.map +1 -1
  23. package/dist/matter/cart-item/cart-item.d.ts +2 -2
  24. package/dist/matter/cart-item/cart-item.js +5 -2
  25. package/dist/matter/cart-item/cart-item.js.map +1 -1
  26. package/dist/matter/client-preferences/client-preferences.js +3 -1
  27. package/dist/matter/client-preferences/client-preferences.js.map +1 -1
  28. package/dist/matter/client-profile/client-profile.d.ts +1 -1
  29. package/dist/matter/client-profile/client-profile.js +3 -1
  30. package/dist/matter/client-profile/client-profile.js.map +1 -1
  31. package/dist/matter/client-profile-form/client-profile-form.d.ts +1 -1
  32. package/dist/matter/client-profile-form/client-profile-form.js +3 -1
  33. package/dist/matter/client-profile-form/client-profile-form.js.map +1 -1
  34. package/dist/matter/delivery-options/delivery-options-accordion.d.ts +1 -1
  35. package/dist/matter/delivery-options/delivery-options-accordion.js +3 -1
  36. package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
  37. package/dist/matter/delivery-options/delivery-options-controller.d.ts +1 -1
  38. package/dist/matter/delivery-options/delivery-options-controller.js +3 -1
  39. package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
  40. package/dist/matter/delivery-options/delivery-options.d.ts +1 -1
  41. package/dist/matter/delivery-options/delivery-options.js +3 -1
  42. package/dist/matter/delivery-options/delivery-options.js.map +1 -1
  43. package/dist/matter/email-identification/email-identification.d.ts +1 -1
  44. package/dist/matter/email-identification/email-identification.js +3 -1
  45. package/dist/matter/email-identification/email-identification.js.map +1 -1
  46. package/dist/matter/identity-summary/identity-summary.d.ts +1 -1
  47. package/dist/matter/identity-summary/identity-summary.js +3 -1
  48. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  49. package/dist/matter/my-account-profile/my-account-profile.d.ts +291 -0
  50. package/dist/matter/my-account-profile/my-account-profile.js +856 -0
  51. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -0
  52. package/dist/matter/product-list/product-list.d.ts +1 -1
  53. package/dist/matter/product-list/product-list.js +3 -1
  54. package/dist/matter/product-list/product-list.js.map +1 -1
  55. package/dist/matter/region/region.d.ts +1 -1
  56. package/dist/matter/region/region.js +5 -2
  57. package/dist/matter/region/region.js.map +1 -1
  58. package/dist/matter/session/session.js +1 -1
  59. package/dist/matter/session/session.js.map +1 -1
  60. package/dist/matter/shipping-address/shipping-address.d.ts +1 -1
  61. package/dist/matter/shipping-address/shipping-address.js +4 -2
  62. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  63. package/dist/matter/sign-in-form/sign-in-form.d.ts +1 -1
  64. package/dist/matter/sign-in-form/sign-in-form.js +3 -1
  65. package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
  66. package/dist/matter/sign-in-redirect/sign-in-redirect.d.ts +45 -0
  67. package/dist/matter/sign-in-redirect/sign-in-redirect.js +127 -0
  68. package/dist/matter/sign-in-redirect/sign-in-redirect.js.map +1 -0
  69. package/dist/sdk/actions/actions-override-context.js +37 -0
  70. package/dist/sdk/actions/actions-override-context.js.map +1 -0
  71. package/dist/sdk/actions/cart-action-provider.d.ts +8 -6
  72. package/dist/sdk/actions/cart-action-provider.js +10 -8
  73. package/dist/sdk/actions/cart-action-provider.js.map +1 -1
  74. package/dist/sdk/actions/identity-action-provider.d.ts +2 -2
  75. package/dist/sdk/actions/identity-action-provider.js +4 -4
  76. package/dist/sdk/actions/identity-action-provider.js.map +1 -1
  77. package/dist/sdk/actions/inject-actions.d.ts +1 -5
  78. package/dist/sdk/actions/inject-actions.js +23 -21
  79. package/dist/sdk/actions/inject-actions.js.map +1 -1
  80. package/dist/sdk/actions/region-action-provider.d.ts +4 -3
  81. package/dist/sdk/actions/region-action-provider.js +6 -5
  82. package/dist/sdk/actions/region-action-provider.js.map +1 -1
  83. package/dist/sdk/actions/session-action-provider.d.ts +4 -3
  84. package/dist/sdk/actions/session-action-provider.js +6 -5
  85. package/dist/sdk/actions/session-action-provider.js.map +1 -1
  86. package/dist/sdk/actions/shipping-action-provider.d.ts +4 -3
  87. package/dist/sdk/actions/shipping-action-provider.js +6 -5
  88. package/dist/sdk/actions/shipping-action-provider.js.map +1 -1
  89. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  90. package/dist/sdk/client/create-client.js +24 -2
  91. package/dist/sdk/client/create-client.js.map +1 -1
  92. package/dist/sdk/content/create-content-runtime.js +1 -1
  93. package/dist/utils/safe-href.js +74 -4
  94. package/dist/utils/safe-href.js.map +1 -1
  95. package/package.json +1 -18
package/CHANGELOG.md CHANGED
@@ -4,6 +4,51 @@ Every published version of `@vtex/faststore` has a section here. From `0.0.2` on
4
4
  written when its release pull request opens, and reviewed alongside the API delta that justifies the
5
5
  version.
6
6
 
7
+ ## 0.0.4
8
+
9
+ `./components` adds `MyAccountProfile`, the signed-in shopper's profile editor. `Root` loads the saved
10
+ profile, renders its `Skeleton` until the data resolves, and renders nothing for an anonymous
11
+ shopper. Save validates every field, sends only the changed ones in one
12
+ `$actions.identity.customerProfileUpdate`, and focuses the first invalid field; Cancel restores the
13
+ saved values. The frame parts are `EditButton`, `SaveButton`, `CancelButton` and `Email`, and the
14
+ field controls are `FirstNameControl`, `LastNameControl`, `PhoneControl`, `BirthDateControl`,
15
+ `GenderControl` and `TaxIdControl`. Each part has its own `*Definition` and `*Props` export, and
16
+ `useMyAccountProfile`, `MyAccountProfileContextValue` and `MyAccountProfileData` come with them.
17
+ Nothing is removed from `./components`.
18
+
19
+ The peer dependencies are no longer optional: `@apollo/client`, `@apollo/client-integration-nextjs`,
20
+ `next`, `react` and `react-dom` are required. `./client`, `./components` and `./internal/server`
21
+ import them directly, and a store outside this repository that never declared `@apollo/client` itself
22
+ failed with `Can't resolve '@apollo/client/react'` because package managers skip optional peers.
23
+ npm 7+ and pnpm 8+ now install them for you. `.`, `./client` and `./graphql` have no signature change,
24
+ so for them this is the only difference.
25
+
26
+ ## 0.0.3
27
+
28
+ `./components` adds `SignInRedirect`, the component a store's `/login` page renders to hand the
29
+ shopper over to the platform login. It comes with `SignInRedirectLoading`, the
30
+ `SignInRedirectContent` content type for the waiting message, `SignInRedirectDefinition`, and the
31
+ `SignInRedirectProps` and `SignInRedirectLoadingProps` types.
32
+
33
+ Five `./components` signatures now take their props as `Readonly<...>`: `ClientProfileFormRoot`,
34
+ `ClientProfilePhoneControl`, `DeliveryOptionsController`, `IdentitySummaryRoot` and
35
+ `ShippingAddressRoot`. Nothing changes for code that renders them.
36
+
37
+ Action providers now deliver `$actions` through context instead of `cloneElement`, so a child that
38
+ crosses the React Server Components boundary as a lazy reference receives its actions. The
39
+ signatures are unchanged.
40
+
41
+ The GraphQL client that `./internal/server` builds forwards the shopper's `Cookie` header into
42
+ server-rendered queries, so a signed-in shopper's server render is no longer anonymous. A
43
+ caller-supplied `Cookie` header wins, and outside a Next.js request the client sends none.
44
+
45
+ `dist/catalog.json` is now built by `@vtex/faststore-catalog`, and its `docPath` values are relative
46
+ to the package (`src/...`). `.`, `./client` and `./graphql` are unchanged.
47
+
48
+ This is the first version released in two sets at once (ADR-0004). The Public set goes to npmjs,
49
+ including the first real `@vtex/faststore-catalog` version, and the Internal set goes to
50
+ CodeArtifact, including the first `@vtex/sukima` that carries the command and the library together.
51
+
7
52
  ## 0.0.2
8
53
 
9
54
  No change to the public API surface across the four snapshotted entries (`.`, `./client`,
package/README.md CHANGED
@@ -14,8 +14,10 @@ The version line is `0.0.x`. Under semver every patch may break, and a caret ran
14
14
  Nothing here is a compatibility promise yet: 138 types are reachable through the public entries without being
15
15
  named in them, and the authoring loop this SDK belongs to is not finished.
16
16
 
17
- This release makes the SDK installable and importable. It does not yet make an extension package buildable
18
- outside the FastStore repository — the catalog build runs through the `faststore` CLI, which is not published.
17
+ This release makes the SDK installable and importable, and it publishes the catalog build alongside it as
18
+ `@vtex/faststore-catalog`. It does not yet make an extension package buildable outside the FastStore
19
+ repository: what is still missing is the `faststore` CLI that wires that build into an extension's `build`
20
+ script, and it is not published.
19
21
 
20
22
  ## Entry points
21
23
 
@@ -64,7 +66,7 @@ These carry no snapshot. Treat their shape as unstable while the package is pre-
64
66
 
65
67
  ## Peer dependencies
66
68
 
67
- All five are optional:
69
+ All five are required:
68
70
 
69
71
  | Peer | Range |
70
72
  | --- | --- |
@@ -77,8 +79,12 @@ All five are optional:
77
79
  They are peers rather than dependencies so the app resolves one copy of each. Two copies of `@apollo/client`
78
80
  mean two caches, and the reactive state behind the hooks would split across them.
79
81
 
80
- They are optional because the entries are audience-split: an API Extension that only imports `./graphql` needs
81
- none of them. Install whatever your entries require.
82
+ None is marked optional. `./client`, `./components`, and `./internal/server` import `@apollo/client`,
83
+ `@apollo/client-integration-nextjs`, and `next` directly, so a store using any of those entries cannot run
84
+ without them. Package managers that auto-install peers (npm 7+, pnpm 8+) install them for you.
85
+
86
+ An API Extension that imports only `./graphql` never uses any of them; installing them anyway costs disk,
87
+ not correctness.
82
88
 
83
89
  ## Styling
84
90