Skip to content

feat(vtex): native Tier B surface (no compat layer) - #23

Merged
vibe-dex merged 6 commits into
mainfrom
feat/tier-b-vtex-surface
Apr 27, 2026
Merged

vibe-dex merged 6 commits into
mainfrom
feat/tier-b-vtex-surface

Conversation

@vibe-dex

@vibe-dex vibe-dex commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the missing Tier B VTEX surface needed by sites migrating from deco-cx/apps to apps-start, as native exports — no compatibility layer.

The first commit on this branch initially mirrored deco-cx/apps's directory layout (vtex/loaders/intelligentSearch/*, legacy/*, paths/*) as thin re-export wrappers. That approach was rejected: we want a clean cut-off, not technical debt that accrues every site migration.

This branch now exposes the same functionality at the canonical apps-start paths so sites adapt forward to the new framework instead of the framework retrofitting to old paths.

Native exports added

  • vtex/inline-loaders/productListingPage — LabelledFuzzy type + mapLabelledFuzzyToFuzzy() helper (lives next to the loader whose fuzzy param it feeds).
  • vtex/inline-loaders/productList — CollectionProps / QueryProps / ProductIDProps / FacetsProps interfaces exported (so site code can type its prop unions).
  • vtex/loaders/legacy — getFirstItemAvailable exported (was an internal helper; now a public surface for sites that need it).
  • vtex/utils/fetch — fetchSafe / fetchAPI / HttpError with VTEX-style query-string sanitization (utm_*/ft/map). Canonical helper for ad-hoc VTEX fetches outside the typed client.
  • vtex/actions/analytics/sendEvent — IS analytics action, signature (props, req) => Promise<null>. Reads IS cookies (vtex_session/vtex_anonymous) directly from the request headers (no ctx.bag).

Dropped (intentionally)

  • Path loaders (vtex/loaders/paths/PDPDefaultPath, PLPDefaultPath) — TanStack Start resolves paths at request time from CMS pages, so static-path enumeration is not a framework concern. Sites that previously consumed these for sitemap seeds should query the catalog/IS APIs directly or rely on CMS routing.

Migration impact for sites

Sites moving from deco-cx/apps must rewrite imports:

Old (Fresh) New (apps-start)
@decocms/apps/vtex/loaders/intelligentSearch/productList @decocms/apps/vtex/inline-loaders/productList
@decocms/apps/vtex/loaders/intelligentSearch/productListingPage @decocms/apps/vtex/inline-loaders/productListingPage
@decocms/apps/vtex/loaders/legacy/productListingPage (re-export) @decocms/apps/vtex/loaders/legacy (canonical)
@decocms/apps/vtex/utils/fetchVTEX @decocms/apps/vtex/utils/fetch
@decocms/apps/vtex/loaders/paths/* removed; not needed in TanStack stack

The deco-migrate script will be extended to perform these rewrites automatically (follow-up PR on decocms/deco-start).

Test plan

  • npm run typecheck — passes
  • npm test — 234 tests pass
  • Manifests regenerated (npm run generate:manifests)
  • Local npm link against baggagio-tanstack — framework imports resolve
  • Verify casaevideo-storefront still builds clean against this branch (no regressions)

Adds the canonical Fresh-era VTEX import paths that sites migrating from
deco-cx/apps expect, layered as thin compat wrappers over the existing
apps-start primitives so we don't fork business logic:

- vtex/loaders/intelligentSearch/productList (re-exports props + default)
- vtex/loaders/intelligentSearch/productListingPage (LabelledFuzzy +
  mapLabelledFuzzyToFuzzy + default)
- vtex/loaders/legacy/productListingPage (re-exports getFirstItemAvailable
  and the legacyProductListingPage loader)
- vtex/loaders/paths/PDPDefaultPath, PLPDefaultPath (sitemap seeds)
- vtex/utils/fetchVTEX (fetchSafe / fetchAPI / HttpError with URL sanitization)
- vtex/actions/analytics/sendEvent (IS analytics, adapted to read IS cookies
  from the request instead of ctx.bag)

Also exports getFirstItemAvailable from vtex/loaders/legacy.ts and adds the
nested-path globs to package.json exports map. Manifest regenerated.

Tests: 230 pass (5 new), typecheck clean, biome clean on changed files.
Made-with: Cursor
Clean cut-off from deco-cx/apps Fresh-era paths. The new framework's
canonical paths (vtex/inline-loaders/*, vtex/loaders/legacy.ts) are the
only public API; we do not re-export old layouts.

Removed (compat layer):
- vtex/loaders/intelligentSearch/{productList,productListingPage}.ts
- vtex/loaders/legacy/productListingPage.ts
- vtex/loaders/paths/{PDPDefaultPath,PLPDefaultPath}.ts
- vtex/utils/fetchVTEX.ts (renamed)

Added natively:
- LabelledFuzzy type + mapLabelledFuzzyToFuzzy helper exported from
  vtex/inline-loaders/productListingPage.ts (lives next to the loader
  whose `fuzzy` param it feeds).
- CollectionProps / QueryProps / ProductIDProps / FacetsProps interfaces
  exported from vtex/inline-loaders/productList.ts.
- vtex/utils/fetch.ts — fetchSafe/fetchAPI/HttpError with VTEX-style
  query-string sanitization (utm_*/ft/map). Canonical helper for ad-hoc
  VTEX fetches outside the typed client.
- vtex/actions/analytics/sendEvent.ts — IS analytics action, signature
  trimmed to (props, req) for the TanStack stack (no ctx.bag).

Path loaders (PDPDefaultPath/PLPDefaultPath) are dropped entirely:
TanStack Start resolves paths at request time from CMS pages, so
static-path enumeration is no longer a framework concern.

Sites migrating from deco-cx/apps must update their imports to the
native paths. The deco-migrate script will be extended to perform
this rewrite automatically.

Made-with: Cursor
@vibe-dex vibe-dex changed the title feat(vtex): port Tier B compatibility surface from deco-cx/apps feat(vtex): native Tier B surface (no compat layer) Apr 27, 2026
Pure mechanical fix from `biome check --write`:
- shopify/manifest.gen.ts: alphabetize imports
- vtex/manifest.gen.ts: alphabetize imports
- vtex/inline-loaders/productListingPage.ts: alphabetize imports
- vtex/utils/fetch.ts + tests: minor formatting

Unblocks the Tier B VTEX surface PR — bagaggio (and other sites)
need `mapLabelledFuzzyToFuzzy`, `LabelledFuzzy`, `getFirstItemAvailable`,
`CollectionProps`/`FacetsProps`/etc. and `sendEvent` to compile.

Verified locally: `biome check .` → 0 errors, `vitest run` → 234/234,
`tsc --noEmit` → clean.

Made-with: Cursor
- Merge main (which already shipped 1.5.0 with the canonical minicart hoist)
  into the Tier B surface branch.
- Run `npm run generate:manifests` then `npx biome check --write` to
  re-sort imports in the post-merge files (vtex/hooks/useCart.ts,
  vtex/inline-loaders/minicart.ts, vtex/utils/minicart.ts,
  vtex/utils/__tests__/minicart.test.ts) plus regenerate manifests.
- Revert the temporary CI probe — the discrepancy was that GitHub
  Actions tests the merge of the PR with main, while local was on
  the unmerged branch, so the post-merge files weren't sorted.

Verified: `npm run lint` → 0 errors / 149 warnings,
`npx tsc --noEmit` clean, `vitest run` → 244/244.

Made-with: Cursor
@vibe-dex
vibe-dex merged commit 5a43972 into main Apr 27, 2026
2 checks passed
vibe-dex added a commit that referenced this pull request Apr 28, 2026
Custom releaseRules silently overrode the angular preset's BREAKING
CHANGE handling. Without an explicit
`{ "breaking": true, "release": "major" }` rule, every commit —
including `feat!:` with `BREAKING CHANGE:` footers — just matched
`{ "type": "feat", "release": "minor" }` and stopped there. The notes
still landed in changelogs, but the version bump never escalated to
major.

Adds the breaking rule as the first entry to restore expected semver
behavior on future releases. No retroactive re-publish for PR #23
(Tier B compat-wrapper drop) — the historical 1.5 → 1.6 bump that
should have been a major stays as-is.

Direct push to main per agreement; this is a build-system fix with
no release-triggering content (chore on releaserc, no version change).

Made-with: Cursor
vibe-dex added a commit to decocms/blocks that referenced this pull request May 1, 2026
…#93)

Following the apps-start clean cut-off (no compat layer with deco-cx/apps),
add explicit rewrites so future site migrations land directly on the
canonical apps-start paths.

Rewrites added (before the existing catch-all `apps/vtex/loaders/*`):
- apps/vtex/loaders/intelligentSearch/{productList,productListingPage,
    productDetailsPage,suggestions}     →  @decocms/apps/vtex/inline-loaders/*
- apps/vtex/loaders/legacy/{productList,productListingPage,
    productDetailsPage,search,category} →  @decocms/apps/vtex/loaders/legacy
- apps/vtex/loaders/paths/*              →  removed (no static paths in TanStack)
- apps/vtex/utils/fetchVTEX              →  @decocms/apps/vtex/utils/fetch
                                            (was incorrectly mapped to vtex/client)

Companion to decocms/apps-start#23.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant