Repository navigation
feat(apps-nuvemshop): Nuvemshop Storefront API app - #628
Merged
Merged
Conversation
New commerce app over the headless Nuvemshop/Tiendanube Storefront API (v2026-11): catalog, search, categories, single-variant shipping quote and hosted checkout. - client: tokenless or bearer token; GETs through createFetchCache, egress through createNuvemshopFetch by default (no site wiring); always requests the full product/category field sets (the API defaults to id,name,handle); buyer IP forwarded on POSTs only with a token. - loaders: productListingPage, productDetailsPage, productList, suggestions, categories, shippingOptions; action createCheckout -> checkout_url. - PLP facets (variant attributes + price), 8 sorts and pagination are computed in memory over a 200-product window until the API exposes the core's filters. URLs mirror the Nuvemshop theme (/produtos/<handle>/, /<cat>/<sub>/, ?Cor=..., ?variant=). - hooks/useCart: localStorage cart (the API has no server cart) that hands off to createCheckout. - Tests are written against captured API fixtures typed with the API types, so a response shape drift fails tsc. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
/search/products takes no sort_by, so the option silently kept relevance order. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The Nuvemshop theme ORs multiple values of one filter as ?Cor=Vermelho|Preto (repeated params keep only the last). Match it so migrated links keep filtering; counts now equal the theme on 12/12 live search/category cases. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…shipping) Reviewed against TiendaNube/base-theme and the live demo theme: - Sort uses the theme's ?sort_by= and values (alpha-*, created-*, best-selling, price-*) plus discount-descending. Category default is newest-first (configurable `defaultSort`; the API doesn't expose the category's sort and returns oldest-first) and ties break newest-first. Top-8 order now equals the theme on 14/14 category x sort cases. "user" (manual order) isn't in the API, so it falls back to the default. Search keeps API relevance and offers "Relevância". - relatedProducts loader: the theme's fallback rule (same category, without itself, in-stock first, refilled with out-of-stock, max 8). - free_shipping is now exposed (the theme's shipping label). - suggestions default to 6 products, like the theme. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
New commerce app
@decocms/apps-nuvemshopover the headless Nuvemshop / Tiendanube Storefront API (v2026-11, OpenAPI 0.5.0). It has the same shape as the other commerce apps: adeco-nuvemshopblock,configure, a registry entry and a manifest.loaders/productListingPage/<cat>/<sub>/), search (?q=), facets, sort and paginationloaders/productDetailsPage?variant=selects the variant; breadcrumb and SEOloaders/productListloaders/suggestions,loaders/categoriesloaders/shippingOptionsactions/createCheckoutcheckout_urlhooks/useCartlocalStorage(the API has no server-side cart) that hands off tocreateCheckoutDesign notes
id,name,handleunlessfields=is sent, so the client always requests the full product and category field sets. Leavingparentout silently flattens the category tree; the live smoke test caught this. The variantcostfield is never requested or mapped.createNuvemshopFetchby default, like Salesforce, so sites need nosetXFetchwiring. GETs go throughcreateFetchCache. The app is added to the instrumentation guardrail and to the biome bare-fetchban.X-LinkedStore-Buyer-IP(fromcf-connecting-ip) so each buyer gets their own bucket.ponytail:with its limit: it is only correct while a category or search fits in 200 products./produtos/<handle>/,?Cor=Vermelho,min_price), so links and SEO survive a migration.Tests
The tests were written first, against API responses captured from the demo store. The fixtures are assigned to the API types, so if the response shape drifts,
tscfails (verified by temporarily breaking a type). Expected outputs are hand-written commerce objects, not snapshots. The suite has 59 tests and the package passestsc; this PR adds no new biome errors.Live checks against the real API, not committed:
configure → setupApps → /deco/invokeforproductListandcreateCheckout, ending on the hosted checkout page (HTTP 200).Already failing on
mainand not touched here: theblocks-clitypecheck, biome format drift inapps-commerce/apps-algolia/tanstack, and per-packageknip.Before release
@decocms/apps-nuvemshop.🤖 Generated with Claude Code
Summary by cubic
Adds
@decocms/apps-nuvemshop, a new commerce app over the Nuvemshop/Tiendanube Storefront API covering catalog, search, categories, shipping quotes, and hosted checkout. It follows the shape of the other commerce apps and is wired into the instrumentation guardrail, the biome fetch ban, the README, and the repo lockfile.What's included
?sort_by=values (plus discount), with newest-first as the configurable category default and only "Relevância" on search. PDP with?variant=selection, breadcrumb, and SEO; plus shelves, suggestions (6 like the theme), related products via the theme's fallback rule, and single-variant shipping quotes that exposefree_shipping.createCheckouttakes line items plus an optional coupon and returns the hostedcheckout_url.useCartkeeps the cart inlocalStorage(the API has no server cart) and hands it tocreateCheckout.createFetchCache; egress uses the instrumentedcreateNuvemshopFetchby default, so sites need nosetXFetchwiring.Notes
/produtos/<handle>/,?Cor=Vermelho|Preto): filter values are pipe-joined rather than repeated, matching the theme's OR semantics so migrated links keep filtering.tsc(59 tests).Written for commit b0db795. Summary will update on new commits.