Repository navigation
chore(core): align base CMS schema id to vtex.faststore - #3434
Conversation
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.
WalkthroughThis PR updates the FastStore CMS schema identifier and adds the ChangesFastStore CMS Schema
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
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`.
@faststore/api
@faststore/cli
@faststore/components
@faststore/core
@faststore/diagnostics
@faststore/lighthouse
@faststore/sdk
@faststore/ui
commit: |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
packages/core/cms/faststore/schema.json
| "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 | ||
| }, |
There was a problem hiding this comment.
🎯 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.
| "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.
| "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 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, |
There was a problem hiding this comment.
🗄️ 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}")
PYRepository: 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 || trueRepository: 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:
- 1: https://ci.codesandbox.io/status/vtex/faststore/pr/3291
- 2: 7b4e2d2
- 3: https://github.com/vtex/skills/blob/main/skills/faststore-storefront/references/cms-schema-and-section-registration.md
- 4: https://developers.vtex.com/docs/guides/faststore/getting-started-upgrading-faststore-to-v4
- 5: https://developers.vtex.com/docs/guides/integrating-product-recommendations-in-headless-or-faststore-web-stores
🏁 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.jsoncRepository: 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:
- 1: 7b4e2d2
- 2: 0e36d26
- 3: daa57c5
- 4: https://github.com/vtex/faststore/releases/tag/v4.0.0
- 5: https://github.com/vtex/faststore/releases
- 6: https://github.com/vtex/faststore/blob/dev/README.md
- 7: https://github.com/vtex/faststore
🌐 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:
- 1: https://github.com/vtex/faststore/blob/dev/AGENTS.md
- 2: https://github.com/vtex/faststore/blob/dev/README.md
🏁 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:
- 1: https://developers.vtex.com/docs/guides/content-plugin
- 2: https://npmx.dev/package/@vtex/cli-plugin-content
- 3: https://developers.vtex.com/docs/guides/understanding-cms-architecture-and-schema-declarations
- 4: https://developers.vtex.com/docs/guides/local-setup-and-development
- 5: https://github.com/vtex/skills/blob/main/skills/faststore-storefront/references/cms-schema-and-section-registration.md
- 6: https://developers.vtex.com/docs/guides/understanding-components-and-sections
- 7: https://developers.vtex.com/docs/guides/cms-for-faststore-storefronts
- 8: https://developers.vtex.com/docs/guides/vtex-io-documentation-site-editor-schema-examples
- 9: https://developers.vtex.com/docs/guides/faststore/integration-structuring-content-types-and-sections
🏁 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 || trueRepository: 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:
- 1: https://github.com/vtex/faststore/releases/tag/v4.0.0
- 2: https://github.com/vtex/faststore/releases
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.
|

0 New Issues
0 Fixed Issues
0 Accepted Issues
No data about coverage (29.30% Estimated after merge)
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 forvtex content generate-schema). However,packages/core/cms/faststore/base.jsonchad 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 generatedschema.json.How it works?
base.jsonc:$idchanged fromvtex.faststore4tovtex.faststore.[email protected](previous published version was4.0.1).packages/core/cms/faststore/schema.json: it is an autogen artifact produced byvtex content generate-schemaand now lives in the Schema Registry. Added it to.gitignorealongside the other autogen files.How to test it?
cd packages/corevtex content generate-schema cms/faststore/components cms/faststore/pages -l cms/faststore/base.jsonc -o cms/faststore/schema.jsonUsing .../base.jsonc as the base schema.and generation succeeds.GET https://api.vtexcommercestable.com.br/api/content-platform/schemas/[email protected]References
Checklist
Made with Cursor
Summary by CodeRabbit
New Features
Chores