Skip to content

feat!: faststore v4 - #3111

Merged
eduardoformiga merged 66 commits into
devfrom
canary-v2
May 6, 2026
Merged

eduardoformiga merged 66 commits into
devfrom
canary-v2

Conversation

@ommeirelles

@ommeirelles ommeirelles commented Nov 11, 2025 •

Copy link
Copy Markdown
Contributor

New canary branch with reduced v4 scope

@ommeirelles
ommeirelles requested a review from a team as a code owner November 11, 2025 13:59
@ommeirelles
ommeirelles requested review from emersonlaurentino and hellofanny and removed request for a team November 11, 2025 13:59
@ommeirelles
ommeirelles force-pushed the canary-v2 branch 2 times, most recently from 35f28db to 4856212 Compare November 11, 2025 14:21
@ommeirelles ommeirelles changed the title feat(WIP): new canary feat: new canary Nov 11, 2025
matheusps and others added 8 commits November 18, 2025 15:58
Merge the changes from main
## What's the purpose of this pull request?

With these changes, if merchants remove the footer logo the entire
footer component will not be hid anymore, it will throw a console error
but the component should be displayed with no logo.
#3077)

## What's the purpose of this pull request?

This PR fixes the `border-radius` of the Slider thumb in Firefox. The
current CSS rule for Mozilla uses an inexistent variable, making the
browser render a square instead of a circle:

<img width="1028" height="181" alt="image"
src="https://github.com/user-attachments/assets/50c08d79-a6a9-4d31-b2e7-5ef9e287080f"
/>

## How it works?

The `--fs-slider-thumb-radius` variable is replaced by
`--fs-slider-thumb-border-radius`, the one that is defined in the
default thumb variables.

## How to test it?

- Use the `Local Install Instructions` from the [CodeSandbox
CI](https://ci.codesandbox.io/status/vtex/faststore/pr/3077) to add this
version in the `package.json` of a store.
- Import the `Slider` atom (and styles) in a component following the
docs: https://developers.vtex.com/docs/guides/faststore/atoms-slider
- Run the store in development mode and browse it in Mozilla Firefox.

### Starters Deploy Preview

I'm unable to generate a preview link but here's a screenshot from
localhost:

<img width="1287" height="617" alt="image"
src="https://github.com/user-attachments/assets/f0a5a5e9-d657-41db-9415-303b5d17fefd"
/>

## Checklist

**PR Title and Commit Messages**

- [x] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..
_(No permissions. It's a bug though.)_

**Dependencies**

- [N/A] Committed the `pnpm-lock.yaml` file when there were changes to
the packages

**Documentation**

- [x] PR description
- [N/A] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)
- Add RTL Support

---------

Co-authored-by: Larícia Mota <[email protected]>
Co-authored-by: Leandro Rodrigues <[email protected]>
Co-authored-by: Eduardo Formiga <[email protected]>
Co-authored-by: vtexgithubbot <[email protected]>
Co-authored-by: Lucas Feijó <[email protected]>
ommeirelles and others added 2 commits December 2, 2025 14:55
## What's the purpose of this pull request?

Upgrading next version to 15

---------

Co-authored-by: Larícia Mota <[email protected]>
Co-authored-by: Matheus P. Silva <[email protected]>
Co-authored-by: Leandro Rodrigues <[email protected]>
Co-authored-by: Eduardo Formiga <[email protected]>
Co-authored-by: vtexgithubbot <[email protected]>
Co-authored-by: Lucas Feijó <[email protected]>
Co-authored-by: Luiz Falcão <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
@codesandbox-ci

codesandbox-ci Bot commented Dec 3, 2025 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

ommeirelles and others added 4 commits December 9, 2025 15:53
Externalizing crypto module from vite to correct import it
Added run scripts to run core package. 

- dev script
build script cant be commited as CI would fail cause it needs the cli do
be build before, and the cli only runs after the core as it is a direct
dep.
So turbo doesn't allow circular dependency on scripts
@coderabbitai

coderabbitai Bot commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 281 files, which is 131 over the limit of 150.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3a0e7d10-ab31-404c-b1a5-8891400649c9

📥 Commits

Reviewing files that changed from the base of the PR and between 5a04cd8 and 400b098.

⛔ Files ignored due to path filters (19)
  • .codesandbox/ci.json is excluded by none and included by none
  • .github/workflows/ci.yml is excluded by none and included by none
  • .github/workflows/packages-preview.yml is excluded by none and included by none
  • .github/workflows/release-dev.yml is excluded by none and included by none
  • .github/workflows/release.yml is excluded by none and included by none
  • .gitignore is excluded by none and included by none
  • .vscode/settings.json is excluded by none and included by none
  • AGENTS.md is excluded by none and included by none
  • makefile is excluded by none and included by none
  • package.json is excluded by none and included by none
  • packages/api/src/__generated__/schema.ts is excluded by !**/__generated__/** and included by packages/**
  • packages/api/test/integration/__snapshots__/mutations.test.ts.snap is excluded by !**/*.snap and included by packages/**
  • packages/api/test/integration/__snapshots__/queries.test.ts.snap is excluded by !**/*.snap and included by packages/**
  • packages/cli/src/__mocks__/monorepo/node_modules/@vtex/faststore-core/.gitkeep is excluded by !**/node_modules/**, !**/node_modules/** and included by packages/**
  • packages/cli/src/__mocks__/store/node_modules/@vtex/faststore-core/.gitkeep is excluded by !**/node_modules/**, !**/node_modules/** and included by packages/**
  • packages/core/@generated/gql.ts is excluded by !**/@generated/**, !**/@generated/** and included by packages/**
  • packages/core/@generated/graphql.ts is excluded by !**/@generated/**, !**/@generated/** and included by packages/**
  • packages/core/@generated/index.ts is excluded by !**/@generated/**, !**/@generated/** and included by packages/**
  • packages/core/public/icons.svg is excluded by !**/*.svg and included by packages/**
📒 Files selected for processing (281)
  • packages/api/jest.int.config.js
  • packages/api/jest.unit.config.js
  • packages/api/local/server.mjs
  • packages/api/local/server.ts
  • packages/api/package.json
  • packages/api/src/directives/index.ts
  • packages/api/src/index.ts
  • packages/api/src/observability/telemetry.ts
  • packages/api/src/platforms/vtex/clients/commerce/index.ts
  • packages/api/src/platforms/vtex/clients/commerce/types/OrderForm.ts
  • packages/api/src/platforms/vtex/clients/fetch.ts
  • packages/api/src/platforms/vtex/clients/index.ts
  • packages/api/src/platforms/vtex/clients/search/index.ts
  • packages/api/src/platforms/vtex/index.ts
  • packages/api/src/platforms/vtex/loaders/collection.ts
  • packages/api/src/platforms/vtex/loaders/index.ts
  • packages/api/src/platforms/vtex/loaders/salesChannel.ts
  • packages/api/src/platforms/vtex/loaders/simulation.ts
  • packages/api/src/platforms/vtex/loaders/sku.ts
  • packages/api/src/platforms/vtex/resolvers/aggregateOffer.ts
  • packages/api/src/platforms/vtex/resolvers/aggregateRating.ts
  • packages/api/src/platforms/vtex/resolvers/cancelOrder.ts
  • packages/api/src/platforms/vtex/resolvers/collection.ts
  • packages/api/src/platforms/vtex/resolvers/faceValue.ts
  • packages/api/src/platforms/vtex/resolvers/facet.ts
  • packages/api/src/platforms/vtex/resolvers/index.ts
  • packages/api/src/platforms/vtex/resolvers/objectOrString.ts
  • packages/api/src/platforms/vtex/resolvers/offer.ts
  • packages/api/src/platforms/vtex/resolvers/organization.ts
  • packages/api/src/platforms/vtex/resolvers/processOrderAuthorization.ts
  • packages/api/src/platforms/vtex/resolvers/product.ts
  • packages/api/src/platforms/vtex/resolvers/productGroup.ts
  • packages/api/src/platforms/vtex/resolvers/propertyValue.ts
  • packages/api/src/platforms/vtex/resolvers/query.ts
  • packages/api/src/platforms/vtex/resolvers/review.ts
  • packages/api/src/platforms/vtex/resolvers/searchResult.ts
  • packages/api/src/platforms/vtex/resolvers/seo.ts
  • packages/api/src/platforms/vtex/resolvers/shippingSLA.ts
  • packages/api/src/platforms/vtex/resolvers/skuVariations.ts
  • packages/api/src/platforms/vtex/resolvers/subscribeToNewsletter.ts
  • packages/api/src/platforms/vtex/resolvers/userOrder.ts
  • packages/api/src/platforms/vtex/resolvers/validateCart.ts
  • packages/api/src/platforms/vtex/resolvers/validateSession.ts
  • packages/api/src/platforms/vtex/typeDefs/address.graphql
  • packages/api/src/platforms/vtex/typeDefs/advertisement.graphql
  • packages/api/src/platforms/vtex/typeDefs/aggregateOffer.graphql
  • packages/api/src/platforms/vtex/typeDefs/aggregateRating.graphql
  • packages/api/src/platforms/vtex/typeDefs/author.graphql
  • packages/api/src/platforms/vtex/typeDefs/brand.graphql
  • packages/api/src/platforms/vtex/typeDefs/breadcrumb.graphql
  • packages/api/src/platforms/vtex/typeDefs/cart.graphql
  • packages/api/src/platforms/vtex/typeDefs/collection.graphql
  • packages/api/src/platforms/vtex/typeDefs/deliveryPromisesBadge.graphql
  • packages/api/src/platforms/vtex/typeDefs/facet.graphql
  • packages/api/src/platforms/vtex/typeDefs/image.graphql
  • packages/api/src/platforms/vtex/typeDefs/index.ts
  • packages/api/src/platforms/vtex/typeDefs/mutation.graphql
  • packages/api/src/platforms/vtex/typeDefs/newsletter.graphql
  • packages/api/src/platforms/vtex/typeDefs/objectOrString.graphql
  • packages/api/src/platforms/vtex/typeDefs/offer.graphql
  • packages/api/src/platforms/vtex/typeDefs/order.graphql
  • packages/api/src/platforms/vtex/typeDefs/orderCommercialAuthorizaton.graphql
  • packages/api/src/platforms/vtex/typeDefs/organization.graphql
  • packages/api/src/platforms/vtex/typeDefs/pageInfo.graphql
  • packages/api/src/platforms/vtex/typeDefs/password.graphql
  • packages/api/src/platforms/vtex/typeDefs/person.graphql
  • packages/api/src/platforms/vtex/typeDefs/pickupPoints.graphql
  • packages/api/src/platforms/vtex/typeDefs/product.graphql
  • packages/api/src/platforms/vtex/typeDefs/productGroup.graphql
  • packages/api/src/platforms/vtex/typeDefs/profile.graphql
  • packages/api/src/platforms/vtex/typeDefs/propertyValue.graphql
  • packages/api/src/platforms/vtex/typeDefs/query.graphql
  • packages/api/src/platforms/vtex/typeDefs/review.graphql
  • packages/api/src/platforms/vtex/typeDefs/seo.graphql
  • packages/api/src/platforms/vtex/typeDefs/session.graphql
  • packages/api/src/platforms/vtex/typeDefs/shipping.graphql
  • packages/api/src/platforms/vtex/typeDefs/skuVariants.graphql
  • packages/api/src/platforms/vtex/typeDefs/status.graphql
  • packages/api/src/platforms/vtex/typeDefs/userOrder.graphql
  • packages/api/src/platforms/vtex/utils/auth.ts
  • packages/api/src/platforms/vtex/utils/contex.ts
  • packages/api/src/platforms/vtex/utils/cookies.ts
  • packages/api/src/platforms/vtex/utils/md5.ts
  • packages/api/src/typeDefs/index.ts
  • packages/api/src/typings/globals.ts
  • packages/api/src/typings/index.ts
  • packages/api/test/integration/mutations.test.ts
  • packages/api/test/integration/queries.test.ts
  • packages/api/test/integration/schema.test.ts
  • packages/api/test/integration/vtex.aggregateOffer.test.ts
  • packages/api/test/integration/vtex.cookies.test.ts
  • packages/api/test/integration/vtex.shouldUpdateShippingData.test.ts
  • packages/api/test/integration/vtex.skuVariants.test.ts
  • packages/api/test/mocks/AllCollectionsQuery.ts
  • packages/api/test/mocks/CollectionQuery.ts
  • packages/api/test/mocks/SellersQuery.ts
  • packages/api/test/mocks/ShippingQuery.ts
  • packages/api/test/mocks/ValidateCartMutation.ts
  • packages/api/test/mocks/salesChannel.ts
  • packages/api/test/unit/platforms/vtex/clients/commerce.test.ts
  • packages/api/test/unit/platforms/vtex/utils/canonical.test.ts
  • packages/api/vite.config.mts
  • packages/api/vitest.config.ts
  • packages/cli/README.md
  • packages/cli/bin/dev
  • packages/cli/bin/dev.cmd
  • packages/cli/bin/dev.js
  • packages/cli/bin/run
  • packages/cli/bin/run.js
  • packages/cli/jest.config.js
  • packages/cli/package.json
  • packages/cli/src/commands/build.ts
  • packages/cli/src/commands/cache-graphql.ts
  • packages/cli/src/commands/cms-sync.ts
  • packages/cli/src/commands/create.ts
  • packages/cli/src/commands/dev.ts
  • packages/cli/src/commands/generate-graphql.ts
  • packages/cli/src/commands/generate-i18n.test.ts
  • packages/cli/src/commands/generate-i18n.ts
  • packages/cli/src/commands/generate-types.ts
  • packages/cli/src/commands/generate.ts
  • packages/cli/src/commands/prepare.ts
  • packages/cli/src/commands/start.ts
  • packages/cli/src/commands/test.ts
  • packages/cli/src/index.ts
  • packages/cli/src/utils/commands.ts
  • packages/cli/src/utils/config.ts
  • packages/cli/src/utils/dependencies.ts
  • packages/cli/src/utils/directory.test.ts
  • packages/cli/src/utils/directory.ts
  • packages/cli/src/utils/file.ts
  • packages/cli/src/utils/generate-types.ts
  • packages/cli/src/utils/generate.ts
  • packages/cli/src/utils/hcms.test.ts
  • packages/cli/src/utils/hcms.ts
  • packages/cli/src/utils/plugins.ts
  • packages/cli/src/utils/runCommandSync.ts
  • packages/cli/tsconfig.json
  • packages/cli/tsup.config.ts
  • packages/cli/vitest.config.ts
  • packages/components/jest.config.js
  • packages/components/jest.setup.ts
  • packages/components/package.json
  • packages/components/src/atoms/Link/Link.tsx
  • packages/components/src/atoms/List/List.tsx
  • packages/components/src/hooks/index.ts
  • packages/components/src/index.ts
  • packages/components/src/molecules/Accordion/Accordion.tsx
  • packages/components/src/molecules/Accordion/AccordionItem.tsx
  • packages/components/src/molecules/Popover/Popover.tsx
  • packages/components/src/molecules/ProductCard/ProductCardContent.tsx
  • packages/components/src/molecules/SearchDropdown/SearchDropdown.tsx
  • packages/components/src/molecules/SearchInputField/SearchInputField.tsx
  • packages/components/src/molecules/Toast/Toast.tsx
  • packages/components/src/organisms/Filter/FilterFacetRange.tsx
  • packages/components/src/organisms/OutOfStock/OutOfStock.tsx
  • packages/components/src/organisms/PriceRange/PriceRange.tsx
  • packages/components/src/organisms/ProductComparison/ProductComparisonSidebar.tsx
  • packages/components/src/organisms/SKUMatrix/SKUMatrixSidebar.tsx
  • packages/components/src/organisms/SlideOver/SlideOver.tsx
  • packages/components/test/molecules/Card/Card.test.tsx
  • packages/components/test/molecules/CheckboxField/CheckboxField.test.tsx
  • packages/components/tsconfig.json
  • packages/components/vite.config.mts
  • packages/components/vitest.config.mts
  • packages/components/vitest.setup.ts
  • packages/core/README.md
  • packages/core/api/index.ts
  • packages/core/cms/faststore/base.jsonc
  • packages/core/cms/faststore/components/cms_component__alert.jsonc
  • packages/core/cms/faststore/components/cms_component__bannernewsletter.jsonc
  • packages/core/cms/faststore/components/cms_component__bannertext.jsonc
  • packages/core/cms/faststore/components/cms_component__breadcrumb.jsonc
  • packages/core/cms/faststore/components/cms_component__cartsidebar.jsonc
  • packages/core/cms/faststore/components/cms_component__children.jsonc
  • packages/core/cms/faststore/components/cms_component__crosssellingshelf.jsonc
  • packages/core/cms/faststore/components/cms_component__emptystate.jsonc
  • packages/core/cms/faststore/components/cms_component__footer.jsonc
  • packages/core/cms/faststore/components/cms_component__hero.jsonc
  • packages/core/cms/faststore/components/cms_component__incentives.jsonc
  • packages/core/cms/faststore/components/cms_component__navbar.jsonc
  • packages/core/cms/faststore/components/cms_component__newsletter.jsonc
  • packages/core/cms/faststore/components/cms_component__productdetails.jsonc
  • packages/core/cms/faststore/components/cms_component__productgallery.jsonc
  • packages/core/cms/faststore/components/cms_component__productshelf.jsonc
  • packages/core/cms/faststore/components/cms_component__producttiles.jsonc
  • packages/core/cms/faststore/components/cms_component__regionbar.jsonc
  • packages/core/cms/faststore/components/cms_component__regionmodal.jsonc
  • packages/core/cms/faststore/components/cms_component__regionpopover.jsonc
  • packages/core/cms/faststore/components/cms_component__scrolltotopbutton.jsonc
  • packages/core/cms/faststore/components/cms_component__search.jsonc
  • packages/core/cms/faststore/content-types.json
  • packages/core/cms/faststore/pages/cms_content_type__globalsections.jsonc
  • packages/core/cms/faststore/pages/cms_content_type__home.jsonc
  • packages/core/cms/faststore/pages/cms_content_type__landingpage.jsonc
  • packages/core/cms/faststore/pages/cms_content_type__pdp.jsonc
  • packages/core/cms/faststore/pages/cms_content_type__plp.jsonc
  • packages/core/cms/faststore/pages/cms_content_type__search.jsonc
  • packages/core/cms/faststore/schema.json
  • packages/core/cms/faststore/sections.json
  • packages/core/discovery.config.default.js
  • packages/core/jest.config.js
  • packages/core/next-env.d.ts
  • packages/core/next.config.js
  • packages/core/package.json
  • packages/core/scripts/i18n.js
  • packages/core/src/components/account/MyAccountDrawer/OrganizationDrawer/OrganizationDrawer.tsx
  • packages/core/src/components/account/MyAccountDrawer/OrganizationDrawer/section.module.scss
  • packages/core/src/components/account/MyAccountDrawer/ProfileSummary/profile-summary.scss
  • packages/core/src/components/account/MyAccountLayout/styles.scss
  • packages/core/src/components/account/MyAccountMenu/styles.scss
  • packages/core/src/components/account/MyAccountUserDetails/styles.module.scss
  • packages/core/src/components/account/components/MyAccountAccordion/styles.scss
  • packages/core/src/components/account/components/MyAccountHeader/styles.scss
  • packages/core/src/components/account/components/MyAccountTable/styles.scss
  • packages/core/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/section.module.scss
  • packages/core/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/MyAccountListOrdersTable.tsx
  • packages/core/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/styles.scss
  • packages/core/src/components/account/orders/MyAccountListOrders/styles.module.scss
  • packages/core/src/components/account/orders/MyAccountOrderDetails/MyAccountBudgetsCard/styles.scss
  • packages/core/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/styles.scss
  • packages/core/src/components/account/orders/MyAccountOrderDetails/MyAccountMoreInformationCard/styles.scss
  • packages/core/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/styles.module.scss
  • packages/core/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/styles.scss
  • packages/core/src/components/account/orders/MyAccountOrderDetails/MyAccountStatusCard/styles.scss
  • packages/core/src/components/account/orders/MyAccountOrderDetails/section.module.scss
  • packages/core/src/components/account/profile/profile.module.scss
  • packages/core/src/components/account/section.module.scss
  • packages/core/src/components/account/security/styles.module.scss
  • packages/core/src/components/cart/CartSidebar/CartSidebar.tsx
  • packages/core/src/components/cart/CartSidebar/section.module.scss
  • packages/core/src/components/cart/EmptyCart/EmptyCart.tsx
  • packages/core/src/components/cms/GlobalSections.tsx
  • packages/core/src/components/cms/RenderSections.tsx
  • packages/core/src/components/cms/plp/Components.ts
  • packages/core/src/components/common/Alert/section.module.scss
  • packages/core/src/components/common/PreviewTag/section.module.scss
  • packages/core/src/components/common/Toast/section.module.scss
  • packages/core/src/components/localization/LocalizationSelector/LocalizationSelector.tsx
  • packages/core/src/components/localization/LocalizationSelector/index.ts
  • packages/core/src/components/localization/LocalizationSelector/section.module.scss
  • packages/core/src/components/localization/index.ts
  • packages/core/src/components/navigation/Navbar/Navbar.tsx
  • packages/core/src/components/navigation/NavbarSlider/NavbarSlider.tsx
  • packages/core/src/components/navigation/NavbarSlider/section.module.scss
  • packages/core/src/components/product/OutOfStock/OutOfStock.tsx
  • packages/core/src/components/product/ProductCard/ProductCard.tsx
  • packages/core/src/components/region/RegionModal/RegionModal.tsx
  • packages/core/src/components/region/RegionModal/section.module.scss
  • packages/core/src/components/region/RegionPopover/RegionPopover.tsx
  • packages/core/src/components/region/RegionPopover/section.module.scss
  • packages/core/src/components/region/RegionSlider/RegionSlider.tsx
  • packages/core/src/components/region/RegionSlider/section.module.scss
  • packages/core/src/components/search/Filter/FilterDeliveryMethodFacet.tsx
  • packages/core/src/components/search/Filter/FilterDesktop.tsx
  • packages/core/src/components/search/Filter/FilterSlider.tsx
  • packages/core/src/components/search/Filter/section.module.scss
  • packages/core/src/components/search/SearchDropdown/SearchDropdown.tsx
  • packages/core/src/components/search/SearchHistory/SearchHistory.tsx
  • packages/core/src/components/search/SearchInput/SearchInput.tsx
  • packages/core/src/components/search/SearchProductItem/SearchProductItem.tsx
  • packages/core/src/components/search/SearchTop/SearchTop.tsx
  • packages/core/src/components/search/Sort/Sort.tsx
  • packages/core/src/components/sections/Alert/Alert.tsx
  • packages/core/src/components/sections/BannerNewsletter/section.module.scss
  • packages/core/src/components/sections/BannerText/section.module.scss
  • packages/core/src/components/sections/Breadcrumb/Breadcrumb.tsx
  • packages/core/src/components/sections/Breadcrumb/section.module.scss
  • packages/core/src/components/sections/EmptyState/section.module.scss
  • packages/core/src/components/sections/Footer/Footer.tsx
  • packages/core/src/components/sections/Footer/section.module.scss
  • packages/core/src/components/sections/Hero/Hero.tsx
  • packages/core/src/components/sections/Hero/section.module.scss
  • packages/core/src/components/sections/Incentives/section.module.scss
  • packages/core/src/components/sections/Navbar/Navbar.tsx
  • packages/core/src/components/sections/Navbar/section.module.scss
  • packages/core/src/components/sections/Newsletter/section.module.scss
  • packages/core/src/components/sections/ProductDetails/ProductDetails.tsx
  • packages/core/src/components/sections/ProductDetails/section.module.scss
  • packages/core/src/components/sections/ProductGallery/EmptyGallery.tsx
  • packages/core/src/components/sections/ProductGallery/section.module.scss

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch canary-v2

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

hellofanny and others added 6 commits January 23, 2026 12:24
Updated dependencies:
- "@testing-library/jest-dom"
- "@lhci/cli": "^0.15.1",
- "@graphql-codegen/cli": 6.1.1 - Updated to V6 as it was triggering
warns in respect to their dependencies
- [REMOVED] @types/cypress - Its not necessary on our current version of
cypress anymore
- [REMOVED] "@storybook/addon-interactions": "^8.6.14" - Is part of core
storybook package now
- [REMOVED] "@storybook/test": "^8.6.14" - Is part of core storybook
package now

- Removed unnecessary storybook addons that is part of storybook@9.
- Migrate packages tests that used jest to vitest, Removed vite
configurations and created vitest.
- Updated pnpm to latest version stable.



[NOW]

<img width="1112" height="140" alt="image"
src="https://github.com/user-attachments/assets/89d318b8-7ba8-49e9-b1c6-9c3a17a8ff98"
/>


[BEFORE]

<img width="2615" height="350" alt="image"
src="https://github.com/user-attachments/assets/29d1cb09-5e58-4add-85fc-e8d72ba065ea"
/>


- Deps unable to fix: 
> [email protected], [email protected], [email protected],
[email protected], [email protected], [email protected], [email protected]


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Migrated component and SDK test suites from Jest to Vitest, added
Vitest configs and centralized setup, and updated tests to use Vitest
APIs and matchers.
* **Chores**
  * Upgraded Storybook to 10.2.3 and simplified addons.
* Updated development dependencies and package manager entries across
packages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Fixing sass dart deprecations usage.

This Fix deprecations warnings from sass on the new dart version. 

Caveats:
- include-media uses a lot of sass if and this is deprecated, as we cant
do anything to fix it right now the warning for this deprecation only
was disabled: `if-function`
- Next uses a load sass ja api depracated, as we cant change it this
warning was also disabled `legacy-js-api`
- Before we imported the utilities in every sass file. This increased
our style as we include in some files that didnt needed it. now this is
not true anymore, any sass usage that require a utility must import it
and prefix the mixins and variables with the module name. THIS RESULTS
IN A BREAKING CHANGE FOR CLIENTS THAT PRESUME THAT UTILITIES ARE PRESENT
AT ALL TIME.

BEFORE vs AFTER

<img width="1222" height="842" alt="image"
src="https://github.com/user-attachments/assets/e371ee89-86c6-418f-8b33-138fd8c6709f"
/>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated styling system to use the Sass module/meta loader and unified
how component styles and utilities are applied, improving consistency
across responsive and utility-driven styles.
* Adjusted Sass importer behavior to improve import resolution and
suppress certain deprecation warnings.

* **Dependencies**
* Upgraded Sass and include-media; reorganized dependency vs. dev/peer
placements across packages for clearer runtime vs. development usage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Larícia Mota <[email protected]>
## What's the purpose of this pull request?

Stores configured with i18n custom paths (e.g.
`https://store.com/europe/it`) returned **404** in production whenever
the URL did not match the canonical locale code (e.g. `/it-IT`). The
same URLs worked locally with `yarn dev`, but failed after `yarn build
&& yarn start` and on the standalone production deploy.

Three independent issues were colliding:

1. **`faststore start` was loading the wrong Next config.** `next start`
was being spawned without the `.faststore` directory, so Next loaded a
default config from the project root with `i18n = null`. Without `i18n`,
the proxy threw `TypeError` on locale rewrites.
2. **Partytown was missing from production builds.** `partytown copylib`
only ran via `predev`, so `/~partytown/partytown.js` was never copied
into `public/` during `build` and the asset 404'd in production.
3. **Hostname validation was broken in standalone mode.**
`request.nextUrl.hostname` resolves to the server bind address
(`0.0.0.0` from the `HOSTNAME` env var set by the Dockerfile), not the
client-facing host. The proxy compared this against binding hostnames
(e.g. `brandless.fast.store`), so all binding rules were skipped and the
catch-all returned 404.

## How it works?
**1. `packages/cli/src/commands/start.ts`** — pass `tmpDir` (the
`.faststore` directory) as a positional argument to `next start`, so it
loads the correct `next.config.js` with the `i18n` config derived from
`discovery.config.js`. Using a positional arg (instead of changing
`cwd`) keeps `next` resolvable from the project root via workspace
hoisting.

```ts
return spawn(`${packageManager} next start ${tmpDir} -p ${port}`, { ... })
```

**2. `packages/cli/src/utils/generate.ts`** — mirror `predev` with a
`prebuild` hook so Partytown is copied into `public/~partytown/` before
the build, ensuring it ships in the standalone output.

```ts
predev: 'na run partytown',
prebuild: 'na run partytown',
```

**3. `packages/core/src/proxy.ts`** — read the hostname from the `Host`
header instead of `request.nextUrl.hostname`, so binding lookup works
consistently in both `next start` and standalone (`node server.js`)
environments. `shouldValidateHostname` stays enabled.

```ts
const { pathname, search } = request.nextUrl
// In standalone, request.nextUrl.hostname is the server bind address
// (e.g. "0.0.0.0"), not the client-facing host. Use the Host header.
const hostname = request.headers.get('host')
```

## How to test it?

The PR is already deployed on `brandless.fast.store`, where both fixes
can be verified:

- Open <https://brandless.fast.store/europe/it> → page renders correctly
(no 404), confirming the custom path is resolved.
- DevTools → Network → `GET /~partytown/partytown.js` → **200 OK**,
confirming Partytown is shipped with the build.
- Response of the page request includes the `x-middleware-rewrite`
header pointing to the locale-prefixed path (e.g. `/it-IT/...`).
<img width="469" height="134" alt="image"
src="https://github.com/user-attachments/assets/49413f43-bbb5-48ba-8fba-0893d3b2bb8a"
/>

- Canonical locale paths (`/it-IT`, `/en-GB`, `/pt-BR`) keep returning
200 — no regression.

## References

- Jira: [SFS-3110 — i18n custom
paths](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-3110)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

* **Refactor**
* Centralized hostname extraction logic across API endpoints for
improved consistency and reliability.

* **Tests**
* Added comprehensive test suite for hostname normalization utility
covering edge cases and fallback scenarios.

* **Chores**
  * Added partytown prebuild script to the build process.
  * Improved CLI start command execution with better process handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@eduardoformiga eduardoformiga changed the title feat: new canary feat!: new canary Apr 29, 2026
hellofanny and others added 4 commits May 1, 2026 12:26
## What's the purpose of this pull request?

Locale switching already worked on live pages backed by the Content
Platform data plane, but preview still fetched locale-agnostic content.
That made localized preview sessions fall back to default-locale content
even when the route and session had already switched locale. This change
threads the active Next.js locale through FastStore preview fetching so
preview content can resolve the same locale-aware way as live routes.

## How it works?

The preview content pipeline now accepts an optional `locale` in
FastStore content params and passes it through shared CMS helpers, page
loaders, and Content Platform fetches. `ContentService` now forwards
locale directly in Content Platform request params, and the shared
global sections, landing page, search, and my account loaders now
forward `context.locale` whenever preview content is requested. The
preview API also accepts an optional `locale` while validating preview
content, but preview cookies remain locator-based so locale still comes
from the route/request context instead of preview payload state.

## How to test it?

- Start FastStore with the companion `client-cp` and `content-platform`
locale-preview changes available.
- To test locally, you can start start the Control Plane API and set the
`controlPlaneApiUrl` in the ClientCP construction on
https://github.com/vtex/faststore/blob/feat/locales-on-preview-flow/packages/core/src/server/content/service.ts
to your localhost URL.
- Enable preview for localized content such as `home`, `landingPage`,
`plp`, or `pdp`.
- Open the preview page in the default locale and confirm content
renders as expected.
- Switch to another locale using the locale-prefixed route or the
language selector and confirm the preview content changes to the
selected locale.
- Verify localized preview content is applied to shared global sections
as well as the main page content.
- Verify preview still works for home, landing pages, PLP, PDP, search,
and the account pages that reuse global sections.
- Call `/api/preview` with `locale=<locale>` during preview activation
and confirm preview enablement still resolves the target content
correctly.

### Starters Deploy Preview


## References

- [CP-1182](https://vtex-dev.atlassian.net/browse/CP-1182)
- Companion `@vtex/client-cp` changes to forward `locale` on
control-plane preview requests.
- Companion `content-platform` control-plane changes to resolve
localized preview payloads and localized preview slugs.

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description
- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)


[CP-1182]:
https://vtex-dev.atlassian.net/browse/CP-1182?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Locale-aware content retrieval propagated to pages, templates, and
preview flows for improved multilingual rendering.

* **Refactor**
* Unified content request context to consolidate preview and locale
handling across content fetches and helpers.

* **Chores**
  * Updated core client dependency to a newer release.

* **Tests**
* Added tests for slug-to-parameter mapping and locale
precedence/propagation in content option generation and preview
handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

In Next.js Version 14, domains configuration has been deprecated in
favour of remotePatterns.

## How it works?

Migrate from images.domains to images.remotePatterns in `next.config.js`
file

## How to test it?

Locally and in the preview deployment, remote images behave the same as
before the images.remotePatterns change (load correctly, no
regressions).

### Starters Deploy Preview

https://sfj-cfc4309--brandless.preview.vtex.app/
[PR](vtex-sites/brandless.store#160)

## References

https://nextjs.org/docs/messages/next-image-unconfigured-host

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated image configuration settings for enhanced compatibility and
security with image serving infrastructure.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@hellofanny hellofanny changed the title feat!: new canary feat!: faststore v4 May 4, 2026
@pkg-pr-new

pkg-pr-new Bot commented May 5, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@faststore/api

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/cli

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/components

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/core

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/diagnostics

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/lighthouse

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/sdk

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/ui

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

commit: 400b098

eduardoformiga and others added 2 commits May 5, 2026 19:36
…alization flag (#3296)

## What's the purpose of this pull request?

This pull request introduces a conditional check for localization
settings in the `validateSession` function to ensure that
localization-related session updates only occur when localization is
enabled. This helps prevent unnecessary or incorrect modifications to
session data when localization is not in use.

Session validation improvements:

* Added a check for `storeConfig.localization?.enabled` before updating
session currency and channel based on localization settings in
`validateSession` in `session/index.ts`.
[[1]](diffhunk://#diff-290ea657fb800da722fad84e0fc08d57ce2ad6614f0751450af0c10f7a813ddeR143)
[[2]](diffhunk://#diff-290ea657fb800da722fad84e0fc08d57ce2ad6614f0751450af0c10f7a813ddeR159)



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Enhanced session validation performance by optimizing localization
enrichment logic to execute conditionally based on configuration
settings.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?
 
This pull request introduces improvements to the sorting component and
fixes to landing page retrieval logic. The main changes include
providing default sort options, making the sort label and options
optional, and correcting how landing pages are matched and queried by
slug.

Enhancements to sorting functionality:

* Added a `DEFAULT_OPTIONS` object for sort options, making the `label`
and `options` props of the `Sort` component optional and providing
sensible defaults if they are not specified.
(`packages/core/src/components/search/Sort/Sort.tsx`)
* Ensured that the sort options fallback to defaults if a custom label
or options are not provided, improving component usability and
robustness. (`packages/core/src/components/search/Sort/Sort.tsx`)

Bug fixes for landing page slug matching:

* Fixed the landing page lookup to correctly compare slugs by prepending
a `/` to the input slug, ensuring accurate page retrieval.
(`packages/core/src/components/templates/LandingPage/LandingPage.tsx`)
* Corrected the filter structure in the landing page query to nest the
slug filter inside a `filters` object, aligning with expected API
requirements.
(`packages/core/src/components/templates/LandingPage/LandingPage.tsx`)



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Fixed landing page slug matching to ensure correct URL path resolution
and page loading.

* **Refactor**
* Improved Sort control flexibility with sensible defaults and support
for partial customization of sort options.

* **Chores**
* Standardized CMS content filtering and fetch behavior for more
reliable content loading.
  * Tightened content API typings for consistent filter handling.

* **Style**
* Centered preview icon layout and removed fixed sizing for improved
visual alignment.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: fanny <[email protected]>
@eduardoformiga
eduardoformiga merged commit 6b3c16b into dev May 6, 2026
4 checks passed
@eduardoformiga
eduardoformiga deleted the canary-v2 branch May 6, 2026 20:30
lemagnetic added a commit that referenced this pull request May 28, 2026
## What's the purpose of this pull request?

Fixes the multi-language race condition where the `LocalizationSelector`
would briefly flicker (or stay stuck on the wrong value) right after
page load, because IDB-hydrated sessions could overwrite the URL-derived
locale before the session reached a stable state.

This was previously mitigated by a workaround in the V4 Canary (#3111)
that rewrote `session.locale/currency/channel` inside `validateSession`
before sending the mutation. That kept the backend in sync but still
allowed a visible flicker, since the local store transiently held the
stale value. This PR removes the workaround and addresses the root
cause.

## How it works?

Two coordinated changes inside `packages/core/src/sdk/session/`:

1. **`getInitialSession()`** seeds `defaultStore` with the URL-derived
`locale` / `currency` / `salesChannel` at module load (instead of the
default values from `discovery.config.session`). First-visit and SSR are
unaffected.

2. **`installLocaleCorrector()`** registers a one-shot subscriber AFTER
the `optimistic` middleware. When the persisted middleware later
hydrates from IDB with a stale locale, the corrector re-enters
`store.set(corrected)` synchronously. The base store's
`cancelations.forEach(cancel)` flips the `cancel` flag on the
just-enqueued `validateSession(stale)` handler — so it bails before
reaching the network — and a fresh handler is enqueued with the
corrected locale. The result: **exactly one `validateSession` call**,
with the right locale, and no flicker in `useSession()`.

Both helpers were extracted to
`packages/core/src/sdk/session/initialSession.ts` to keep them
framework-free and unit-testable.

The workaround block inside `validateSession` (PR #3111) is no longer
needed and was removed.

## How to test it?

1. Enable localization in a starter / local environment (e.g. via the
`faststore-core-i18n-setup` skill or by setting `localization.enabled =
true` in `discovery.config.js` with at least two locale bindings).
2. Open the storefront on a non-default binding (e.g. `/en-US/`) in a
fresh browser tab or after clearing IDB (`fs::session`).
3. Open DevTools → Network and filter by `ValidateSession`. Expected:
**a single mutation** with the URL-aligned locale. Before the fix, two
were issued (one with the default/stale locale, one with the URL
locale).
4. Watch the `LocalizationSelector` in the header — it should render the
correct locale immediately, with no transient flicker.
5. Switch locales via the selector and confirm the value stays
consistent after navigation, and that hard-reload on the new binding
doesn't trigger the issue again.

Automated coverage:

```bash
cd packages/core
pnpm vitest run test/sdk/session/getInitialSession.browser.test.ts
pnpm vitest run test/sdk/session/installLocaleCorrector.browser.test.ts
```

- `getInitialSession.browser.test.ts` (6 tests) — URL-aware seeding,
channel merge, fallback paths.
- `installLocaleCorrector.browser.test.ts` (6 tests) — the cancellation
property, one-shot behavior, unsubscribe.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Improved automatic locale and currency detection from the current URL
for more accurate regional content and pricing.
* Session initialization now respects URL-derived localization so users
see correct locale, currency, and sales channel on load.

* **Bug Fixes**
* Prevents stale persisted sessions from overriding URL-aware
localization; corrections apply once and preserve other session data.

* **Tests**
* Added browser-focused tests covering initialization, hydration
correction, and edge cases (malformed session data).

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/vtex/faststore/pull/3281?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

tested in https://brandless.fast.store/

References
Task
https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-3145

---------

Co-authored-by: Leandro Rodrigues <[email protected]>
hellofanny added a commit that referenced this pull request Aug 10, 2026
## What's the purpose of this pull request?

Restores the `account, path, port` positional argument order on the
`faststore dev` command, matching `build` (`account, path`), `serve`
(`account, path, port`) and the [FastStore Platform
Spec](https://github.com/vtex/faststore-platform/blob/main/docs/specification.md).

The inversion was an unintended side effect of the oclif migration in
#3111: `static args` went from an array to an object, and since
positional order now follows key order, `path` ended up ahead of
`account` — on `dev` only. `build` and `serve` were migrated in the same
commit and kept the original order (introduced deliberately in #2491 to
comply with the spec).

The impact is on the FastStore Platform CLI, which calls the module
commands positionally:

```ts
// vtex/faststore-platform packages/cli/src/commands/dev.ts
return dev.run([account, path, port?.toString() ?? ''])
```

With the current v4 order, the account name lands in `args.path`, so
`getBasePath()` resolves the base path to a directory named after the
account. `build.run([account, path])` and `serve.run([account, path,
port])` are unaffected because those commands kept the correct order.

## Is this a breaking change?

No known consumer depends on the current v4 order:

- **Stores:** a code search for `"faststore dev"` in `package.json`
across GitHub returns 50+ stores, all using `"dev": "faststore dev"`
with no positional arguments. Since all three args are optional, those
are unaffected.
- **Programmatic callers:** searching for `loadedCli` across the `vtex`
org returns only `vtex/faststore-platform`, which already uses the spec
order for `dev`, `build` and `serve`.
- **This monorepo:** nothing invokes `faststore dev` with positional
arguments. `@faststore/core`'s `dev` script is `next dev`, and the
internal spawns inside `dev.ts` target `generate-types`, `cache-graphql`
and `generate-i18n` with an explicit `basePath`.
- **CI/CD:** pipelines run `build` and `serve`, never `dev`.

Passing a path as the single positional (`faststore dev ./store`) never
worked on v3 either, since `account` has always been the first argument
there.

`account` remains a noop — `run()` only reads `args.path` and
`args.port` — so this changes nothing beyond the positional mapping.

## How to test it?

Install the version generated by the codesandbox check in a monorepo
store and run `fsp dev <account>`. The dev server should start at the
module path declared in `faststore.json` instead of failing to resolve a
directory named after the account.

For a single store, `yarn dev` (i.e. `faststore dev` with no arguments)
should behave exactly as before.

## References

- Spec:
https://github.com/vtex/faststore-platform/blob/main/docs/specification.md
- Order introduced in #2491
- Order accidentally inverted in #3111


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Updated the `faststore dev` command documentation to list `ACCOUNT`
before `PATH`.
* Revised the command usage, heading, index, and argument descriptions.

* **Bug Fixes**
* Corrected positional argument ordering for the `faststore dev`
command: `ACCOUNT`, `PATH`, then `PORT`.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Cursor <[email protected]>
lemagnetic added a commit that referenced this pull request Nov 4, 2026
…3524)

## What's the purpose of this pull request?

Since v4, the `@auth` and `@cacheControl` directives have **no effect on
fields declared by a store** in its GraphQL extensions
(`src/graphql/{vtex,thirdParty}/typeDefs`). The annotation compiles and
shows up in the schema, but the store resolver is never wrapped:

- `@auth` doesn't validate the shopper session, so the field answers any
caller;
- `@cacheControl` doesn't contribute to the response `cache-control`
header, so the route falls back to its default rule even when the field
is annotated `private`.

Native FastStore fields are not affected. In v3 both directives worked
on store fields, and the public guides (*Authentication in API
extensions*, *Displaying an order summary for the signed-in shopper*)
rely on that behavior.

The regression came with the v4 schema assembly
([#3111](#3111)):
`GraphqlVtexSchema` applies the directive transformers to the native
schema and merges the store schema **afterwards**, so store fields are
never visited by the transformers.

## How it works?

**`packages/api/src/platforms/vtex/index.ts` — `GraphqlVtexSchema`**

1. Build the native executable schema with the directive definitions but
**without** applying the transformers.
2. If a store schema is passed, merge it (`mergeSchemas`, unchanged).
3. Apply the transformers (`cacheControl`, then `auth`, same order as
before so `@auth` runs first at request time) **once**, on the final
schema.

This is the v3 semantics (one transformation over native + store
fields). Two wrong variants were ruled out, and the tests catch both:

- transforming the store schema before the merge: it carries the native
type definitions but no native resolvers, so its wrappers would override
the real native resolvers;
- transforming again after the merge while keeping the pre-merge
transformation: native fields would be wrapped twice (`@auth` would call
VTEX ID twice per field).

**`packages/api/src/directives/{auth,cacheControl}.ts`**

The wrappers called `originalResolver?.(...)`, so an annotated field
with no explicit resolver always resolved to `undefined`. They now fall
back to `defaultFieldResolver`. Native annotated fields all have
resolvers (no change); this keeps store fields read from the parent
object (e.g. a field of a store-owned type) working once the directives
apply.

**No public API change**: `GraphqlVtexSchema` keeps its signature and
call sites (`@faststore/core`, CLI type generation, api local server and
tests are untouched). `withDirectives` stays exported and unchanged.

### ⚠️ Behavior change for stores

Stores that already annotate their fields will see the annotations take
effect after upgrading, as in v3 and as documented:

- `@auth` fields start returning `401 UnauthorizedError` to signed-out
callers;
- `@cacheControl` fields start driving the `cache-control` header (still
forced `private` when the auth cookie is present).

This should go in the release notes.

### Authentication mechanism change — explicit human approval required

Per `AGENTS.md` (Security & Data Handling) and `packages/api/AGENTS.md`,
changes to authentication mechanisms require explicit human approval
recorded in the PR description.

- [ ] Approved by: _reviewer name / date_


## How to test it?

**Automated** — new `packages/api/test/integration/directives.test.ts`
builds the final schema the same way `getFinalAPISchema` does in
`@faststore/core` (native type defs + store type defs, store resolvers
only, then `GraphqlVtexSchema(storeSchema)`) and checks:

- store `@auth`: rejected without session (resolver not called),
resolves with session;
- store field with `@auth` and no resolver: returns the parent value
once authorized;
- store `@cacheControl`: sets the field policy; aggregates with a native
field (min values, most restrictive scope);
- `@auth` runs before `@cacheControl` on the same field;
- native `validateUser` (with and without a store schema): keeps its
resolver, rejects without session, validates the session **exactly
once**.

```bash
cd packages/api
pnpm vitest run test/integration/directives.test.ts
pnpm test
```

Results:

- on the current `dev` code, the 6 store tests fail and the 4 native
tests pass (bug reproduced);
- with the fix, all 10 pass and the full api suite is green (362 unit,
88 integration, no snapshot changes);
- the tests fail against each of the wrong variants described above.

**Manual (store)** — in a store using the CodeSandbox build of this PR,
add to `src/graphql/thirdParty/typeDefs`:

```graphql
extend type Query {
  directiveProbeAuth: String @auth
  directiveProbeCache: String
    @CacheControl(scope: "private", sMaxAge: 7, staleWhileRevalidate: 11)
}
```

with resolvers returning any string, run `faststore dev` and `POST
/api/graphql` without cookies:

| Request | Before (4.10.x) | Expected with this PR |
| --- | --- | --- |
| `{ directiveProbeAuth }` | `200` with the resolver value | `401
UnauthorizedError` |
| `{ directiveProbeCache }` | `cache-control: no-cache, no-store` |
`cache-control: private, s-maxage=7, stale-while-revalidate=11` |
| `{ listCreditCards { ... } }` (native control) | `401` | `401`
(unchanged) |

### Starters Deploy Preview

Validated on brandless.store with the CodeSandbox build of this PR
(`50f91f6a`) against 4.10.0: all results matched the expected table
above. Full before/after results:
#3524 (comment)

## References

- Jira: SO-696
- Regression origin:
[#3111](#3111) (v4 schema
assembly); design introduced on `canary` in
[#3063](#3063)
- v3 reference: `getFinalAPISchema` in
`packages/core/src/server/index.ts` applied `[cacheControlDirective,
authDirective]` to the single native + store schema (last unaffected tag
`v3.100.5`)

---------

Co-authored-by: Cursor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants