From b78e058a44e435a6509c287bc958a5fcd68d1392 Mon Sep 17 00:00:00 2001 From: Rahul Varghese Date: Thu, 29 Oct 2026 03:12:45 +0530 Subject: [PATCH] SX0: the sfcc-commerce epic doc set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sfcc-commerce epic: epic.yaml (key SX, three milestones: the spec, the storefront on Workers, a baseline), the README, the design (the storefront, how each Vercel piece maps to Cloudflare — OpenNext on one Worker, the R2 incremental cache and the Durable Object tag cache and queue, Cache Components off because a Cache Components page hangs on workerd under the adapter while every "use cache" read is kept, and the spike that proved those reads reused and revalidated on OpenNext before anything was built on them; next build --webpack because Turbopack's Worker is over Workers Free's 3 MiB; the four SLAS coordinates inlined at build because a Worker's process.env holds only its own vars; a storefront that deploys before a store is connected; no guest login for a visitor without a cart; a revalidation route that refuses a wrong secret — the tests with a stand-in SCAPI + SLAS, the rename, and the alternatives rejected: a patched adapter, Turbopack, Salesforce's demo instance as the default, a shopper's token in the cache, the two secrets as build secrets, upstream's 200 to a wrong secret), the implementation plan, the risks, the as-built status, and the three task contracts. Co-Authored-By: Claude Orun-Task: SX-1 --- specs/epics/README.md | 1 + .../sfcc-commerce/IMPLEMENTATION-STATUS.md | 11 ++ specs/epics/sfcc-commerce/README.md | 40 +++++ specs/epics/sfcc-commerce/design.md | 168 ++++++++++++++++++ specs/epics/sfcc-commerce/epic.yaml | 30 ++++ .../sfcc-commerce/implementation-plan.md | 14 ++ .../sfcc-commerce/risks-and-open-questions.md | 18 ++ tasks/SX-1.TaskContract.yaml | 13 ++ tasks/SX-2.TaskContract.yaml | 19 ++ tasks/SX-3.TaskContract.yaml | 23 +++ 10 files changed, 337 insertions(+) create mode 100644 specs/epics/sfcc-commerce/IMPLEMENTATION-STATUS.md create mode 100644 specs/epics/sfcc-commerce/README.md create mode 100644 specs/epics/sfcc-commerce/design.md create mode 100644 specs/epics/sfcc-commerce/epic.yaml create mode 100644 specs/epics/sfcc-commerce/implementation-plan.md create mode 100644 specs/epics/sfcc-commerce/risks-and-open-questions.md create mode 100644 tasks/SX-1.TaskContract.yaml create mode 100644 tasks/SX-2.TaskContract.yaml create mode 100644 tasks/SX-3.TaskContract.yaml diff --git a/specs/epics/README.md b/specs/epics/README.md index 29155e3..235ea87 100644 --- a/specs/epics/README.md +++ b/specs/epics/README.md @@ -7,5 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace. | Epic | Cluster | Status | What it is | |------|---------|--------|------------| +| [`sfcc-commerce/`](./sfcc-commerce/) | **SX** | In progress (SX0) | Vercel's Next.js Commerce for Salesforce Commerce Cloud on Cloudflare Workers, its catalogue reads cached in R2 and revalidated by a secret-checked route, every shopper a SLAS guest — and an Orun baseline that instantiates it in one landing, live before a store is connected (SX2) | As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`. diff --git a/specs/epics/sfcc-commerce/IMPLEMENTATION-STATUS.md b/specs/epics/sfcc-commerce/IMPLEMENTATION-STATUS.md new file mode 100644 index 0000000..c702da6 --- /dev/null +++ b/specs/epics/sfcc-commerce/IMPLEMENTATION-STATUS.md @@ -0,0 +1,11 @@ +# sfcc-commerce — implementation status + +| Milestone | State | Landed | +|---|---|---| +| SX0 — the spec | ✅ | SX-1 | +| SX1 — the storefront on Workers | planned | SX-2 | +| SX2 — a baseline | planned | SX-3 | + +## Departures from the upstream template + +Recorded as they land, from SX1 on. diff --git a/specs/epics/sfcc-commerce/README.md b/specs/epics/sfcc-commerce/README.md new file mode 100644 index 0000000..c06b884 --- /dev/null +++ b/specs/epics/sfcc-commerce/README.md @@ -0,0 +1,40 @@ +# sfcc-commerce — Next.js Commerce for Salesforce Commerce Cloud on Cloudflare Workers + +**Vercel's Salesforce Commerce Cloud starter is Next.js Commerce on B2C +Commerce's Shopper APIs, every shopper signed in as a SLAS guest, with +Next.js 16's Cache Components on. The port keeps every one of its +`"use cache"` reads — their lifetimes and their tags — and moves them onto +Cloudflare: one Worker, its data cache in R2, its tag cache in Durable +Objects, and the revalidation route made to refuse a wrong secret. Cache +Components are the one thing the adapter cannot run yet; a spike proved the +fallback keeps the caching honest before anything was built on it. A +product built from it deploys before its owner connects a store, and sells +from theirs once they set its SLAS client and site.** + +| | | +|---|---| +| Status | In progress — SX0 on main | +| Upstream | [vercel-partner-solutions/nextjs-salesforce-commerce-cloud](https://github.com/vercel-partner-solutions/nextjs-salesforce-commerce-cloud) (MIT, `license.md`), at `a474b5e` (2026-08-18) | +| Reference | [commerce](https://github.com/sourceplane/commerce), [shopware-commerce](https://github.com/sourceplane/shopware-commerce), [saleor-commerce](https://github.com/sourceplane/saleor-commerce) — the same OpenNext, R2 and Durable Object shape for a Next.js Commerce storefront on a hosted commerce API, and the same unconnected state | +| Key | `SX` | + +## Read in this order + +1. [design.md](design.md) — the storefront, how each Vercel piece maps to + Cloudflare, the cache and the spike that proved it, build-time settings, + the unconnected store, the guest login, revalidation, the tests, and the + alternatives rejected. +2. [implementation-plan.md](implementation-plan.md) — the milestones and + what each one lands. +3. [risks-and-open-questions.md](risks-and-open-questions.md) — what is not + proven, and what was accepted. +4. [IMPLEMENTATION-STATUS.md](IMPLEMENTATION-STATUS.md) — what shipped, and + every departure from upstream. + +## Milestones + +| Milestone | What it lands | Task | +|---|---|---| +| SX0 — the spec | this doc set and the three task contracts | SX-1 | +| SX1 — the storefront on Workers | `apps/web`, the R2 root, `tests/web` | SX-2 | +| SX2 — a baseline | the card, the build document, the rename, the tiers | SX-3 | diff --git a/specs/epics/sfcc-commerce/design.md b/specs/epics/sfcc-commerce/design.md new file mode 100644 index 0000000..7aee638 --- /dev/null +++ b/specs/epics/sfcc-commerce/design.md @@ -0,0 +1,168 @@ +# sfcc-commerce — design + +## 1. The storefront + +Vercel's Next.js Commerce for Salesforce Commerce Cloud +(vercel-partner-solutions/nextjs-salesforce-commerce-cloud `a474b5e`): +Next.js 16.3 App Router with Cache Components on. Routes: the home page (a +three-item grid and a carousel, each one category's products), `/search` +and `/search/` with sorting, `/product/` with variants and +recommendations, fixed content pages (`lib/sfcc/content.ts`), a guest +checkout (`/checkout`: information, shipping, payment; then +`/checkout/confirmation`), Open Graph images (`next/og`), the sitemap and +robots.txt. Every SCAPI call goes through `commerce-sdk-isomorphic` 3.5 +(`lib/sfcc/index.ts`) with a SLAS guest token: a public client's +authorization-code + PKCE flow written with plain `fetch`, or a private +client's `helpers.loginGuestUserPrivate` with `SFCC_SECRET`. Five readers are +`"use cache"` functions with `cacheLife("days")` and the tags `collections` +and/or `products`. The cart is the instance's basket, its id and the guest +token kept in cookies, changed by server actions; the checkout adds the +shopper's details, a shipping method and a masked card to the basket and +creates the order. The revalidation route reads a `?secret=` and an +`x-sfcc-topic` header. Every setting is read from the environment at request +time. + +## 2. Vercel → Cloudflare + +| Vercel | Here | +|---|---| +| Next.js hosting | `@opennextjs/cloudflare` 1.20.11: one Worker (`.open-next/worker.js`) + Static Assets | +| Data Cache | R2 (`NEXT_INC_CACHE_R2_BUCKET`), a bucket per environment from `infra/terraform/cloudflare-r2` | +| Tag revalidation | the sharded Durable Object tag cache (`NEXT_TAG_CACHE_DO_SHARDED`) | +| Stale-while-revalidate | the Durable Object queue (`NEXT_CACHE_DO_QUEUE`) through `WORKER_SELF_REFERENCE` | +| Image Optimization | off — the instance's images are served as it sends them | +| Env vars | the four coordinates as optional build secrets, inlined; `SFCC_SECRET` and `SFCC_REVALIDATION_SECRET` as Worker secrets the deploy sets | +| `VERCEL_PROJECT_PRODUCTION_URL` | `NEXT_PUBLIC_SITE_URL`: the environment's `SITE_URL`, else its workers.dev URL | + +## 3. The cache + +The commerce baselines' shape, unchanged: R2 incremental cache, sharded +Durable Object tag cache, Durable Object queue — `open-next.config.ts`, the +bindings and the `migrations` in `wrangler.template.jsonc`. No database to +provision or seed, and strongly consistent per tag shard. + +## 4. Cache Components off, `"use cache"` kept — the spike + +On workerd through the adapter a Cache Components page answers 500 and then +hangs (opennextjs-cloudflare#1450). So `cacheComponents` is off and +`experimental.useCache` keeps every `"use cache"` read with its lifetime and +tags; routes render per request from cached reads. Because the template's +caching was unverified on OpenNext, a spike came first (a scratch copy of +upstream, the commerce fallback, a stand-in SCAPI + SLAS, `wrangler dev`): + +- a second visit to a product page read no product and no search — only one + SLAS authorize + token pair, which was `getCart` minting a guest token for + a visitor without a cart (§7); +- after a store change, `POST /api/revalidate?secret=…` with + `x-sfcc-topic: products/update` answered `revalidated: true`; the next + visit was served the old entry and re-read the product in the background + (`revalidateTag(tag, "max")`, stale-while-revalidate), and the one after + showed the change; +- the SDK runs on workerd (it takes `node-fetch`, since `nodejs_compat` sets + `process.versions.node`), and the PKCE login's WebCrypto and `Buffer` work; +- Turbopack's Worker is 3200.79 KiB gzipped, over Workers Free's 3 MiB; + `next build --webpack`'s is 2572.24 KiB. The build is webpack. + +The verdict was that the fallback keeps the caching honest, and the e2e now +asserts all of it on every tag (§9). Next is 16.3.8, the lowest 16.x the +adapter's peer range accepts; 16.4.x fails every request on it. + +## 5. Build-time settings + +On Vercel the starter reads `SFCC_CLIENT_ID`, `SFCC_ORGANIZATIONID`, +`SFCC_SHORTCODE`, `SFCC_SITEID`, `COMPANY_NAME` and the origin from +`process.env` per request. A Worker's `process.env` holds only its vars and +secrets, so `next.config.ts` `env` inlines those at build — the deploy builds +once per environment with that environment's values. None of the four is a +credential on its own: a public SLAS client is made to be named in a +browser. They reach the server bundle only: no client component reads them. +`SFCC_SECRET` and `SFCC_REVALIDATION_SECRET` are not inlined: OpenNext puts +the Worker's secrets on `process.env` per request, where the code reads them. + +## 6. Before a store, and after + +A baseline goes live with no key the platform cannot broker. With no +coordinates upstream builds `https://.api.commercecloud.salesforce.com/…` +and every page throws. Salesforce's public PWA Kit demo instance would work +as a default, but a product would then show a vendor's demo catalogue and +depend on it staying up, so it is documented (`.env.example`, the README's +"Connecting Salesforce Commerce Cloud") and not defaulted. Instead the +unconfigured state is explicit: `lib/sfcc/connection.ts` says whether the +build had all four coordinates; unconnected, every reader answers empty, the +guest login and so every cart or checkout write throw `SFCCNotConnected` +before a request, every page carries the note "No Salesforce Commerce Cloud +store is connected yet", `/` says "Connect your Salesforce Commerce Cloud +store" and how, and the sitemap lists the home and content pages alone. +`/api/health` reports the connection for the smoke and the record. The owner +sets the Orun secrets and redeploys. + +## 7. The guest login + +Upstream's `getCart` called `getGuestUserConfig` — which mints a SLAS guest +token when the visitor has none — before it checked for a cart, so every page +view by a visitor without a cart cost one SLAS login, cached nowhere (the +spike's one remaining read). The port checks the cookie first, in `getCart` +and `getCheckoutOrder`; the answer is the same (no cart), and a second visit +reads Salesforce not at all. A catalogue read that misses the cache still +logs a guest in, as upstream does: the cached entry is shared, so no +shopper's token is kept in it. + +## 8. Revalidation + +Upstream's route compared `?secret=` with `!==` and, when it did not match, +logged and answered 200. The port answers 503 while no +`SFCC_REVALIDATION_SECRET` is set, 401 for a missing or wrong secret +(SHA-256 digests compared without an early exit), and keeps upstream's +topics: `products/{create,update,delete}` revalidates `products`, +`collections/{create,update,delete}` `collections`, anything else answers +200 and drops nothing. The secret is an Orun secret: the build runs without +it (`env -u`), so it is in no bundle, and `tooling/wire/worker-secrets.mjs` +puts it — and `SFCC_SECRET` — on the environment's Worker after the build, +on deploy lanes only. B2C Commerce sends no cache webhook of its own, so the +README names the owner's ways to call it: a job step, a hook, a scheduled +call. + +## 9. Tests + +Upstream's check (`prettier --check`) is `@app/web`'s `test`. `tests/web` +covers the port's seams (23 tests): the store name; the connection — four +coordinates, every reader empty with no request, a cart write refused, and, +against the stand-in, a public client's PKCE login, a private client's +`client_credentials` login, a visitor without a cart costing no login, +search; `/api/health`; the URL helpers and the origin; the revalidation +route's 503, 401s, topics and tags. The e2e serves the bootstrapped product +twice: as born (the deploy's own smoke, every page with the note, health, +revalidation off, the sitemap, the Open Graph image), then rebuilt by the +stage lane's own build step with a stand-in SCAPI + SLAS connected +(`tests/web/fake-sfcc.mjs`, which the unit tests use too: it checks the PKCE verifier against the +challenge, refuses a shopper call without a token it issued or for another +site, answers from a three-product catalogue in six categories, and counts +every call) — catalogue pages, a second visit with no read at all (guest +login included), a change that stays cached until the secret revalidates +`products`, refusals that drop nothing, the products re-read and not the +categories, and neither server-side secret in the build output. +`SFCC_API_ORIGIN` points the SDK (its own `proxy` option) and the SLAS calls +at the stand-in; a product never sets it. + +## 10. The rename + +Slug `sfcc-commerce`, store name `ACME Store` (upstream's own) at the +`SITE_NAME` seam (`app/site.ts`), with `SOURCE_URL` beside it. The leak gate +fails any other spelling of the name under `app/`, `components/` or `lib/`. +The storefront's own words — Salesforce, SFCC, SLAS, SCAPI — are not the +identity and no rule touches them. + +## 11. Alternatives rejected + +- **Cache Components on, a patched adapter**: hacking around an open + upstream bug. +- **Turbopack**: its Worker is over Workers Free's 3 MiB. +- **Salesforce's demo instance as the default**: a vendor's catalogue in + somebody's store, gone when Salesforce moves it, and no connect state. +- **A shopper's token in the cache, or no guest login for cached reads**: + the shared entries would carry one shopper's token, or the reads would + have none. +- **The two secrets as build secrets**: they would be inlined into the + Worker's bundle. +- **Upstream's revalidation answer kept**: a wrong secret would be told it + succeeded. diff --git a/specs/epics/sfcc-commerce/epic.yaml b/specs/epics/sfcc-commerce/epic.yaml new file mode 100644 index 0000000..76798d7 --- /dev/null +++ b/specs/epics/sfcc-commerce/epic.yaml @@ -0,0 +1,30 @@ +# The epic's declaration. metadata.name equals the directory name; metadata.key +# is the task-key prefix this epic reserves (SX → SX-1, SX-2, …). Owner, target +# date and health are the platform's — never written here. +apiVersion: orun.io/v1 +kind: Epic +metadata: + name: sfcc-commerce + key: SX +spec: + title: "Next.js Commerce for Salesforce Commerce Cloud on Cloudflare Workers" + summary: "Vercel's Next.js Commerce for Salesforce Commerce Cloud — a home page with a grid and a carousel, categories, search, product pages with variants, a cart and a guest checkout on B2C Commerce's Shopper APIs, every shopper a SLAS guest and every catalogue read a \"use cache\" entry dropped by tag through a secret-checked route — runs as one Cloudflare Worker with Static Assets, its data cache in R2 and its tag cache and revalidation queue in Durable Objects, live before a Salesforce store is connected, and becomes an Orun baseline that takes a new storefront from nothing to live on stage and prod in one landing." + state: started + milestones: + - name: "SX0 — the spec" + exitCriteria: + - "the repository is born with its intent, CI, tooling and spec index, and this doc set and the task contracts are on main" + tasks: [SX-1] + - name: "SX1 — the storefront on Workers" + exitCriteria: + - "a spike proves the template's \"use cache\" reads reused and revalidated on OpenNext with Cache Components off, the SDK and the SLAS login on workerd, and the Worker's size" + - "apps/web is upstream's starter built by OpenNext into one Worker with Static Assets, the R2 incremental cache, the Durable Object tag cache and queue, Cache Components off and every \"use cache\" read kept" + - "typecheck, lint, upstream's check, tests/web and build are green with no store" + - "with no store connected every page answers with the connect note and / says \"Connect your Salesforce Commerce Cloud store\", never a 500; connected, wrangler dev serves the catalogue, reuses the cache and revalidates through the secret-checked route" + tasks: [SX-2] + - name: "SX2 — a baseline" + exitCriteria: + - "blueprint.yaml (the console card) and repo-blueprint.yaml (the build) take a new storefront from nothing to live on stage and prod in one landing, then record it" + - "a storefront built from it carries the product only, renamed throughout to its own name, repository, Worker and buckets, with upstream's licence intact" + - "Baseline CI is green: contract tests, the wiring path, generated component docs, the blueprint read by the pinned orun, the leak gate, the offline bootstrap and the end-to-end tier — the stage lane's steps in a staged tree, served as born, then connected to a stand-in SCAPI + SLAS and browsed" + tasks: [SX-3] diff --git a/specs/epics/sfcc-commerce/implementation-plan.md b/specs/epics/sfcc-commerce/implementation-plan.md new file mode 100644 index 0000000..e1810b2 --- /dev/null +++ b/specs/epics/sfcc-commerce/implementation-plan.md @@ -0,0 +1,14 @@ +# sfcc-commerce — implementation plan + +| Milestone | Lands | Done when | +|---|---|---| +| SX0 — the spec | the repository born (intent, CI, tooling, spec index), this doc set, SX-1…SX-3 | on main | +| SX1 — the storefront on Workers | `apps/web` (upstream at `a474b5e` plus the departures in IMPLEMENTATION-STATUS), `infra/terraform/cloudflare-r2`, `tests/web` | typecheck, lint, upstream's check, tests/web and build green with no store; served unconnected and connected under `wrangler dev` | +| SX2 — a baseline | `blueprint.yaml`, `repo-blueprint.yaml`, `.baseline/`, the rename engine and bootstrap helpers, the record renderer, the context pack, `testing/` with the stand-in SCAPI + SLAS, `baseline.yml`, `tag.yml` | Baseline CI green; `baseline-v1` tagged | + +Order inside SX1: the spike (Cache Components off, `useCache`, the R2/DO +caches, the SDK and the PKCE login on workerd, a cached read reused and +revalidated under `wrangler dev`, the Worker's size); the build-time +settings; the unconnected seam; the guest login only where a cart is; the +revalidation route; the Open Graph images on workerd; the workspace; the +tests. diff --git a/specs/epics/sfcc-commerce/risks-and-open-questions.md b/specs/epics/sfcc-commerce/risks-and-open-questions.md new file mode 100644 index 0000000..d9d5cd7 --- /dev/null +++ b/specs/epics/sfcc-commerce/risks-and-open-questions.md @@ -0,0 +1,18 @@ +# sfcc-commerce — risks and open questions + +| ID | Risk | State | Notes | +|---|---|---|---| +| SX-A | Not proven live: the repository and link, the minted tokens, a real `terraform apply` and `wrangler deploy`, the Worker secrets put on a real Worker, the probes, a real B2C Commerce instance | OPEN | Baseline CI proves everything else offline; one bootstrap with Salesforce's public demo instance connected closes it | +| SX-B | Size: the Worker is 2.53 MiB gzipped with webpack, half a MiB under Workers Free's 3 MiB; Turbopack's is 3.13 MiB | WATCH | `wrangler deploy --dry-run` after a build prints the size; a dependency upgrade could cross the line | +| SX-C | Cache Components off | ACCEPTED | opennextjs-cloudflare#1450; turning them back on needs no change to the `"use cache"` reads | +| SX-D | Next pinned to 16.3.8 (upstream 16.3.1) | ACCEPTED | The adapter's peer range starts at 16.3.8 on 16.x; 16.4.x fails every request on 1.20.11 | +| SX-E | Images unoptimized | ACCEPTED | B2C Commerce serves its own image sizes; the owner's image host is not known at build | +| SX-F | `revalidateTag(tag, "max")` is stale-while-revalidate | ACCEPTED | The first request after a revalidation may be served the old entry while the fresh one is read; the e2e allows ten visits | +| SX-G | The e2e's store is a stand-in: the calls the storefront makes, answered from a three-product catalogue; no item is added to a basket end to end, and no order placed | ACCEPTED | The stand-in answers the basket calls; a real instance is SX-A | +| SX-H | The store's name: the rename rewrites one line and the sweep does not look for it | ACCEPTED, gated | The leak gate fails any other spelling under `app/`, `components/` and `lib/`; the placement and e2e tiers check the branded product | +| SX-I | The checkout takes no payment: a `CREDIT_CARD` instrument with the card's type and masked number, then the order | OPEN — the owner's | Upstream's own demo checkout; stated in the product's README ("Checkout") | +| SX-J | Two coarse tags: revalidating `products` drops every product entry | ACCEPTED | Upstream's own tags; a finer scheme would change every reader | +| SX-K | The SLAS client id, organization, short code and site are inlined into the Worker's bundle | ACCEPTED | None is a credential on its own (a public client is meant to be named in a browser); no client bundle carries them; they are Orun secrets, never committed. `SFCC_SECRET` is a Worker secret | +| SX-L | Upstream's check failed upstream (prettier on six files at `a474b5e`): formatted once; upstream had no linter, and the workspace's ESLint allows unused arguments (upstream's server actions keep theirs) and found one dead line (`hasPayment`), removed | ACCEPTED | No behaviour changes | +| SX-M | A private SLAS client's login is proven against the stand-in in `tests/web`, on Node; the e2e browses as a public client on workerd | WATCH | The SDK's other calls run on workerd in the e2e; the first connected deployment with a private client closes it | +| SX-N | Every catalogue read that misses the cache logs a SLAS guest in first, as upstream does | ACCEPTED | A guest login per cache miss, not per visit; a shared entry must not hold a shopper's token | diff --git a/tasks/SX-1.TaskContract.yaml b/tasks/SX-1.TaskContract.yaml new file mode 100644 index 0000000..7e6e19d --- /dev/null +++ b/tasks/SX-1.TaskContract.yaml @@ -0,0 +1,13 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: SX-1 + title: "The sfcc-commerce epic doc set" +spec: + goal: The epic's README, design, plan, risks and status, and the three task contracts, are on main + affects: + - specs/epics/sfcc-commerce + - tasks + doneWhen: + - the doc set and SX-1, SX-2 and SX-3 are merged + gates: [] diff --git a/tasks/SX-2.TaskContract.yaml b/tasks/SX-2.TaskContract.yaml new file mode 100644 index 0000000..9b69f1d --- /dev/null +++ b/tasks/SX-2.TaskContract.yaml @@ -0,0 +1,19 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: SX-2 + title: "The storefront on Workers" +spec: + goal: Vercel's Next.js Commerce for Salesforce Commerce Cloud runs as one Cloudflare Worker with Static Assets, its catalogue reads cached in R2 and revalidated through the Durable Object tag cache by a secret-checked route, live before a store is connected + affects: + - apps/web + - infra/terraform/cloudflare-r2 + - tests/web + - pnpm-lock.yaml + - pnpm-workspace.yaml + - README.md + doneWhen: + - a spike proves the "use cache" reads reused and revalidated on OpenNext with Cache Components off + - pnpm typecheck, lint, test and build are green with no Salesforce store + - wrangler dev serves the unconnected storefront without a 500, and a connected one from cached reads revalidated through /api/revalidate + gates: [] diff --git a/tasks/SX-3.TaskContract.yaml b/tasks/SX-3.TaskContract.yaml new file mode 100644 index 0000000..9630c49 --- /dev/null +++ b/tasks/SX-3.TaskContract.yaml @@ -0,0 +1,23 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: SX-3 + title: "sfcc-commerce becomes an Orun baseline" +spec: + goal: A new storefront goes from nothing to live on stage and prod in one landing, its own name throughout, with Baseline CI proving it offline + affects: + - blueprint.yaml + - repo-blueprint.yaml + - .baseline + - testing + - tooling + - hooks + - docs/phases + - ai/context + - .github/workflows + - BOOTSTRAP.md + - README.md + doneWhen: + - Baseline CI is green on main + - baseline-v1 is tagged + gates: []