Skip to content

chore(core): align base CMS schema id to vtex.faststore - #3434

Merged
eduardoformiga merged 3 commits into
devfrom
chore/cms-base-schema-vtex-faststore
Aug 4, 2026
Merged

eduardoformiga merged 3 commits into
devfrom
chore/cms-base-schema-vtex-faststore

Conversation

@eduardoformiga

@eduardoformiga eduardoformiga commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

What's the purpose of this pull request?

The FastStore base CMS schema is published to the VTEX Schema Registry, and merchants pull it by default under the id vtex.faststore (the toolbelt default for vtex content generate-schema). However, packages/core/cms/faststore/base.jsonc had drifted to $id: vtex.faststore4, which did not match the schema merchants actually consume. This PR aligns the local base file with the registry schema and stops committing the generated schema.json.

How it works?

  • base.jsonc: $id changed from vtex.faststore4 to vtex.faststore.
  • The base schema was regenerated from the local base + components + pages and published to the Schema Registry as [email protected] (previous published version was 4.0.1).
  • Removed the generated packages/core/cms/faststore/schema.json: it is an autogen artifact produced by vtex content generate-schema and now lives in the Schema Registry. Added it to .gitignore alongside the other autogen files.

How to test it?

  • cd packages/core
  • vtex content generate-schema cms/faststore/components cms/faststore/pages -l cms/faststore/base.jsonc -o cms/faststore/schema.json
  • Confirm the output logs Using .../base.jsonc as the base schema. and generation succeeds.
  • Retrieve the published schema: GET https://api.vtexcommercestable.com.br/api/content-platform/schemas/[email protected]

References

Checklist

  • PR title and commit messages follow the Conventional Commits specification
  • PR description
  • Added a label according to the PR goal

Made with Cursor

Summary by CodeRabbit

New Features

  • Introduced RecommendationShelf component with campaign tracking, product context settings, carousel configuration, and product-card customization options for flexible recommendation displays.

Chores

  • Updated internal schema identifier for the CMS configuration to ensure consistency.

Set the base.jsonc $id from `vtex.faststore4` to `vtex.faststore` so it
matches the base schema in the Schema Registry (published as
[email protected]), which merchants pull by default via the toolbelt.

Stop committing the generated cms/faststore/schema.json: it is produced by
`vtex content generate-schema` and now lives in the Schema Registry, so it
is treated as an autogen artifact and added to .gitignore.
@eduardoformiga
eduardoformiga requested a review from a team as a code owner August 4, 2026 15:07
@eduardoformiga
eduardoformiga requested review from hellofanny and renatamottam and removed request for a team August 4, 2026 15:07
@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR updates the FastStore CMS schema identifier and adds the RecommendationShelf component schema. It also simplifies base definitions and registers RecommendationShelf in the allowed component list.

Changes

FastStore CMS Schema

Layer / File(s) Summary
RecommendationShelf schema contract
packages/core/cms/faststore/schema.json
Adds RecommendationShelf with campaign VRN validation, recommendation enablement, item context, carousel settings, and product-card settings.
Schema definitions and component registration
packages/core/cms/faststore/schema.json
Moves simplified $defs definitions to the schema end and adds RecommendationShelf to $ALLOW_ALL_COMPONENTS.
Schema identifier update
packages/core/cms/faststore/base.jsonc
Changes the $id value from vtex.faststore4 to vtex.faststore.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • vtex/faststore#3403: Adds the same RecommendationShelf schema and allowed component entry.
  • vtex/faststore#3414: Uses RecommendationShelf.enableRecommendations in recommendation runtime behavior.
  • vtex/faststore#3290: Updates FastStore CMS base definitions by removing component metadata fields.

Suggested reviewers: renatamottam, lariciamota, lemagnetic

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: aligning the FastStore base CMS schema ID with vtex.faststore.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/cms-base-schema-vtex-faststore

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

@codesandbox-ci

codesandbox-ci Bot commented Aug 4, 2026 •

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.

Revert the removal of cms/faststore/schema.json and its .gitignore entry.
The generated schema is kept committed as the quick reference / double-check
source for the base CMS schema published to the Schema Registry
([email protected]). Regenerated via `vtex content generate-schema`.
Comment thread .gitignore Resolved
@pkg-pr-new

pkg-pr-new Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@faststore/api

npm i https://pkg.pr.new/vtex/faststore/@faststore/api@65620be

@faststore/cli

npm i https://pkg.pr.new/vtex/faststore/@faststore/cli@65620be

@faststore/components

npm i https://pkg.pr.new/vtex/faststore/@faststore/components@65620be

@faststore/core

npm i https://pkg.pr.new/vtex/faststore/@faststore/core@65620be

@faststore/diagnostics

npm i https://pkg.pr.new/vtex/faststore/@faststore/diagnostics@65620be

@faststore/lighthouse

npm i https://pkg.pr.new/vtex/faststore/@faststore/lighthouse@65620be

@faststore/sdk

npm i https://pkg.pr.new/vtex/faststore/@faststore/sdk@65620be

@faststore/ui

npm i https://pkg.pr.new/vtex/faststore/@faststore/ui@65620be

commit: 65620be

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/core/cms/faststore/schema.json`:
- Around line 3908-3919: Update the schema definitions for itemsPerPageDesktop
and itemsPerPageMobile to use type "integer" instead of "number", preserving
their existing defaults and metadata.
- Around line 3944-3961: Add readOnly, writeOnly, deprecated, and $abstract
properties with false values to the RecommendationShelf definition in
cms_component__recommendationshelf.jsonc, then regenerate schema.json so the
generated component metadata matches the source.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5a4ea5c5-6e5c-4275-a244-2b8b1cc72ba0

📥 Commits

Reviewing files that changed from the base of the PR and between b93dae0 and c5031dc.

📒 Files selected for processing (1)
  • packages/core/cms/faststore/schema.json

Comment on lines +3908 to +3919
"itemsPerPageDesktop": {
"title": "Items per page (desktop)",
"description": "Number of products shown per page on desktop viewports.",
"type": "number",
"default": 4
},
"itemsPerPageMobile": {
"title": "Items per page (mobile)",
"description": "Number of products shown per page on mobile and tablet viewports.",
"type": "number",
"default": 2
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use "type": "integer" for the items-per-page fields.

"type": "number" accepts 2.5. A fractional page size is not valid for a carousel. Every comparable field in this schema uses integer, for example itemsPerPage in ProductShelf at Line 3670.

♻️ Proposed fix
             "itemsPerPageDesktop": {
               "title": "Items per page (desktop)",
               "description": "Number of products shown per page on desktop viewports.",
-              "type": "number",
+              "type": "integer",
               "default": 4
             },
             "itemsPerPageMobile": {
               "title": "Items per page (mobile)",
               "description": "Number of products shown per page on mobile and tablet viewports.",
-              "type": "number",
+              "type": "integer",
               "default": 2
             },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"itemsPerPageDesktop": {
"title": "Items per page (desktop)",
"description": "Number of products shown per page on desktop viewports.",
"type": "number",
"default": 4
},
"itemsPerPageMobile": {
"title": "Items per page (mobile)",
"description": "Number of products shown per page on mobile and tablet viewports.",
"type": "number",
"default": 2
},
"itemsPerPageDesktop": {
"title": "Items per page (desktop)",
"description": "Number of products shown per page on desktop viewports.",
"type": "integer",
"default": 4
},
"itemsPerPageMobile": {
"title": "Items per page (mobile)",
"description": "Number of products shown per page on mobile and tablet viewports.",
"type": "integer",
"default": 2
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/cms/faststore/schema.json` around lines 3908 - 3919, Update the
schema definitions for itemsPerPageDesktop and itemsPerPageMobile to use type
"integer" instead of "number", preserving their existing defaults and metadata.

Comment on lines +3944 to +3961
"productCardConfiguration": {
"title": "Product Card Configuration",
"type": "object",
"properties": {
"showDiscountBadge": {
"title": "Show discount badge?",
"type": "boolean",
"default": true
},
"bordered": {
"title": "Cards should be bordered?",
"type": "boolean",
"default": true
}
}
}
}
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm which components lack the trailing metadata keys.
set -euo pipefail

f=$(fd -p 'cms/faststore/schema.json' -t f | head -1)
echo "file: $f"

python - "$f" <<'PY'
import json, sys
d = json.load(open(sys.argv[1]))
keys = ("readOnly", "writeOnly", "deprecated", "$abstract")
for name, c in d.get("components", {}).items():
    missing = [k for k in keys if k not in c]
    if missing:
        print(f"{name}: missing {missing}")
PY

Repository: vtex/faststore

Length of output: 280


🏁 Script executed:

#!/bin/bash
set -euo pipefail

f=packages/core/cms/faststore/schema.json
printf '%s\n' '--- component key counts ---'
python3 - "$f" <<'PY'
import json, sys
d = json.load(open(sys.argv[1]))
keys = ("readOnly", "writeOnly", "deprecated", "$abstract")
components = d["components"]
for name in ("ProductTiles", "RecommendationShelf", "ShoppingAssistant"):
    c = components[name]
    print(name, list(c), "missing:", [k for k in keys if k not in c])
print("component count:", len(components))
print("components missing any metadata:", sum(any(k not in c for k in keys) for c in components.values()))
PY

printf '%s\n' '--- relevant schema lines ---'
sed -n '3845,3970p;4380,4410p' "$f"

printf '%s\n' '--- version references ---'
rg -n 'vtex\.faststore|4\.5\.0|RecommendationShelf' package.json packages package-lock.json yarn.lock pnpm-lock.yaml 2>/dev/null | head -80 || true

Repository: vtex/faststore

Length of output: 16842


🌐 Web query:

vtex faststore 4.5.0 packages/core/cms/faststore/schema.json RecommendationShelf

💡 Result:

The RecommendationShelf component in VTEX FastStore is a native section used to display product recommendations [1]. Its schema definition is managed within the packages/core/cms/faststore/schema.json file [2], which is an auto-generated file that should not be edited directly [3]. Key details regarding the RecommendationShelf and its schema: 1. Management: The schema.json file is generated by running the vtex content generate-schema command [3][4]. Developers should modify the underlying JSONC files in packages/core/cms/faststore/components/ and then regenerate the schema to ensure changes are correctly reflected [3]. 2. Configuration: The RecommendationShelf includes configurable properties such as itemsContext (allowing selection between 'PDP' or 'CART' for recommendation context) and various carousel settings like itemsPerPageDesktop, itemsPerPageMobile, variant, infiniteMode, and controls [2]. 3. Integration: The component relies on the VTEX Recommendations BFF API, requiring a campaign VRN (Virtual Resource Name) to identify the specific recommendation strategy used [5]. 4. Best Practices: If you are working in a FastStore project, ensure you use the standard component pattern where the $componentKey is defined in the JSONC file and updated via the CLI to maintain consistency in schema.json [3]. For detailed implementation or to view the current structure, you should inspect the relevant JSONC component file in your local packages/core/cms/faststore/components/ directory rather than manually editing schema.json [3].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- source component definition ---'
f=$(fd -i -p 'cms/faststore/components' -t f | rg 'recommendationshelf\.jsonc$' | head -1)
echo "file: $f"
cat -n "$f"

printf '%s\n' '--- schema generation references ---'
rg -n -i 'generate-schema|schema\.json|readOnly|writeOnly|\$abstract' packages/core packages/cli packages 2>/dev/null | rg 'cms|schema|generate|readOnly|writeOnly|\$abstract' | head -160

printf '%s\n' '--- repository and package versions ---'
git remote -v | head -4
git tag --list 'v4.5.0*' | tail -20
for f in packages/core/package.json package.json; do
  if test -f "$f"; then
    echo "--- $f"
    rg -n '"version"|"name"' "$f" | head -12
  fi
done

printf '%s\n' '--- source and generated-file history summary ---'
git log -8 --oneline -- packages/core/cms/faststore/schema.json packages/core/cms/faststore/components/cms_component__recommendationshelf.jsonc

Repository: vtex/faststore

Length of output: 21589


🌐 Web query:

site:github.com/vtex/faststore "[email protected]" "RecommendationShelf"

💡 Result:

In the VTEX FastStore framework, the RecommendationShelf is a component used to display product recommendations. Based on the development history of the vtex/faststore repository, this component has undergone significant evolution, particularly within the FastStore v4 ecosystem [1][2][3][4]. Key details regarding the RecommendationShelf include: Functionality and Configuration: The component is designed to fetch and display recommendations. Recent enhancements allow for greater flexibility in its configuration, such as: - Context Selection: It supports an itemsContext prop, which allows the shelf to distinguish between Product Detail Page (PDP) and Cart contexts when fetching recommendations [1]. - Carousel Settings: Developers can configure carousel behavior directly, including settings for itemsPerPageDesktop, itemsPerPageMobile, variant, infiniteMode, and controls [1]. Technical Implementation: - Architecture: The component relies on the VtexCommerce client, where recommendation logic is integrated under the commerce.recommendation namespace [3]. - Data Fetching: Recent fixes have ensured proper handling of API options, such as the inclusion of storeCookies in fetchAPI calls for recommendations [2]. - Styling: The component follows the standard FastStore section pattern, utilizing section.module.scss with a root.section class and specific data-fs-recommendation-shelf-item attributes for styling [3]. For implementation details specific to version 4.5.0, please consult the official FastStore documentation or the repository's CHANGELOG for specific version-locked release notes [5][6]. Since FastStore components are often part of the @faststore/core package, you can check the component source code within your project's node_modules or directly in the official GitHub repository for the most precise type definitions and props available in that specific release [6][7].

Citations:


🌐 Web query:

site:github.com/vtex/faststore/blob "RecommendationShelf" "readOnly" "schema.json"

💡 Result:

In the context of FastStore, the RecommendationShelf component and its schema configurations are managed within the project structure, specifically utilizing JSON schemas to define component properties for the CMS. While specific documentation regarding a readOnly property on the RecommendationShelf in a schema.json file is not explicitly detailed in the provided search results, the readOnly keyword is a standard feature in JSON Schema specifications. It is used to indicate that a field's value should not be modified by the user or client, often implying that the value is managed or generated by the system (e.g., the platform or CMS). If you are encountering a readOnly property within a schema definition for a FastStore section like RecommendationShelf, it generally serves to protect specific configuration fields from being overwritten or edited via the CMS interface. For further technical specifics on component schemas, refer to the FastStore documentation on section configurations or the component definitions located within the packages/components and packages/core directories of the FastStore repository [1][2].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- source component metadata coverage ---'
python3 - <<'PY'
import json, pathlib, re

schema = json.load(open("packages/core/cms/faststore/schema.json"))
expected = ("readOnly", "writeOnly", "deprecated", "$abstract")
files = sorted(pathlib.Path("packages/core/cms/faststore/components").rglob("*.jsonc"))
for p in files:
    text = p.read_text()
    m = re.search(r'"\\$componentKey"\s*:\s*"([^"]+)"', text)
    if not m:
        continue
    name = m.group(1)
    missing_source = [k for k in expected if not re.search(r'"' + re.escape(k) + r'"\s*:', text)]
    missing_schema = [k for k in expected if k not in schema["components"].get(name, {})]
    if missing_source or missing_schema:
        print(name, p, "source_missing=", missing_source, "schema_missing=", missing_schema)
PY

printf '%s\n' '--- generator and artifact history ---'
git log -8 --oneline -- packages/core/cms/faststore/schema.json
git log -8 --oneline -- packages/core/cms/faststore/components/cms_component__recommendationshelf.jsonc

printf '%s\n' '--- relevant commit metadata ---'
curl -fsSL 'https://api.github.com/repos/vtex/faststore/commits/7b4e2d274d8acb07b74f6a29c34e806eff311b1f' |
  python3 -c 'import json,sys; d=json.load(sys.stdin); print(d.get("sha")); print(d.get("commit",{}).get("message","").splitlines()[0])'

Repository: vtex/faststore

Length of output: 1860


🌐 Web query:

VTEX Content Platform generate-schema JSONC readOnly writeOnly deprecated $abstract default component

💡 Result:

In the VTEX Content Platform, the generate-schema command is a function of the @vtex/cli-plugin-content package [1][2]. It aggregates individual JSONC component and content-type definitions into a unified schema file for the CMS [1][3]. Regarding the specific JSON Schema keywords and concepts you mentioned: JSONC (JSON with Comments) is the preferred file format for authoring individual component and content-type schemas (e.g., cms_componentComponentName.jsonc) [3][4]. The generation process converts these into the final schema structure required for the registry [1][5]. In the context of these schemas, the following keywords and concepts are used to define component behavior and metadata: $componentKey: A mandatory unique identifier for a component [3][6]. $componentTitle: The display name of the component as seen in the CMS interface [3][6]. $abstract: Used to define base or template schemas that are not intended to be used directly as sections but serve as a foundation for other components to inherit from using $extends [3][7][6]. $extends: Used to inherit properties from a base schema (e.g., #/$defs/base-component) [3][6]. default: Defines the default value for a property in the CMS form [8][9]. readOnly: A standard JSON Schema keyword that, when applied to a field, prevents the CMS editor from modifying that specific property [9]. writeOnly: Typically used to indicate that a field is for input only (e.g., credentials or secrets) and is not intended for retrieval or display in the UI. deprecated: Used to mark a schema field or component as obsolete, often providing a warning or signaling that it should no longer be used [9]. To use these in your project, create the.jsonc files in the appropriate directories (default paths are cms/faststore/components and cms/faststore/pages) and run: vtex content generate-schema -o cms/faststore/schema.json [1][5][2] You must then upload the generated file to the Registry using vtex content upload-schema to make the changes visible in the CMS admin [5][3]. Top results: [1][5][3][6]

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- corrected source/schema comparison ---'
python3 - <<'PY'
import json, pathlib, re

schema = json.load(open("packages/core/cms/faststore/schema.json"))
expected = ("readOnly", "writeOnly", "deprecated", "$abstract")
for p in sorted(pathlib.Path("packages/core/cms/faststore/components").rglob("*.jsonc")):
    text = p.read_text()
    m = re.search(r'"\$componentKey"\s*:\s*"([^"]+)"', text)
    if not m:
        continue
    name = m.group(1)
    source_missing = [k for k in expected if not re.search(r'"' + re.escape(k) + r'"\s*:', text)]
    schema_missing = [k for k in expected if k not in schema["components"].get(name, {})]
    if source_missing or schema_missing:
        print(f"{name}: source={source_missing}, schema={schema_missing}, file={p}")
PY

printf '%s\n' '--- current worktree and relevant commits ---'
git status --short
git show --stat --oneline 7b4e2d27
git show --format=fuller --no-ext-diff 7b4e2d27 -- packages/core/cms/faststore/components/cms_component__recommendationshelf.jsonc | sed -n '1,180p'
git show --format= --no-ext-diff 7b4e2d27^:packages/core/cms/faststore/schema.json 2>/dev/null | rg -n -A8 -B3 '"RecommendationShelf"' | head -40 || true

Repository: vtex/faststore

Length of output: 1502


🌐 Web query:

site:github.com/vtex/faststore/releases/tag "4.5.0" FastStore

💡 Result:

FastStore is a digital commerce toolkit for frontend developers designed to build high-performance, headless storefronts [1]. As of August 4, 2026, FastStore has progressed into its version 4 release cycle, which introduced major architectural improvements, performance optimizations, and native localization capabilities [1]. While there are specific release notes for versions up to 4.4.0 [2], there is no official release for a version "4.5.0" in the publicly available repository history as of today's date. Development typically proceeds through minor and patch versions, and current documented releases include versions such as 4.4.0 [2]. Developers should refer to the official FastStore GitHub repository for the most up-to-date information on upcoming or released versions [2].

Citations:


Add the standard metadata to the source component and regenerate the schema.

RecommendationShelf is the only component missing readOnly, writeOnly, deprecated, and $abstract in both the source JSONC and generated schema. Add these keys with false values to cms_component__recommendationshelf.jsonc, then regenerate schema.json.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/cms/faststore/schema.json` around lines 3944 - 3961, Add
readOnly, writeOnly, deprecated, and $abstract properties with false values to
the RecommendationShelf definition in cms_component__recommendationshelf.jsonc,
then regenerate schema.json so the generated component metadata matches the
source.

@sonar-workflows

Copy link
Copy Markdown

@eduardoformiga
eduardoformiga merged commit d98324d into dev Aug 4, 2026
10 checks passed
@eduardoformiga
eduardoformiga deleted the chore/cms-base-schema-vtex-faststore branch August 4, 2026 15:47
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.

2 participants