Repository navigation
Conversation
|
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. |
mateuspontes
left a comment
There was a problem hiding this comment.
Did you define the content-type without the anyOf? Or is something we're delegating to the frontend?
I'm adding that into the sync process! Since I need to know the full list of components in order to create the "allow all" definition. |
be27463 to
4505d4d
Compare
mateuspontes
left a comment
There was a problem hiding this comment.
Nice job! Let's wait for the FS team review
769e35e to
3cfb7cb
Compare
lariciamota
left a comment
There was a problem hiding this comment.
question: Will we have something like a codemod to help clients migrate to CP? To automatically make their customizations follow this new schema standard
Yes, eventually! We're not sure how that's going to work yet, but we should provide an easy migration path in the future. |
b749183 to
dda6839
Compare
|
Fixed the schema after reviews. curl --location 'https://vtex.vtexcommercebeta.com.br/api/content-platform/schemas/vtex/schemas/faststore/plp' \
--header 'Authorization: Bearer ****' \
--data '' |
lariciamota
left a comment
There was a problem hiding this comment.
Hi!
I've missed other sections: Search bar and Region popover
| @@ -0,0 +1,78 @@ | |||
| { | |||
There was a problem hiding this comment.
question: We've recently added a new tab in the Global Sections type called "Settings" so we can add some global settings there. Should it be added in this base file?
| @@ -0,0 +1,12 @@ | |||
| { | |||
| "login": { | |||
There was a problem hiding this comment.
question: why doesn't it require the "$extends": ["#/$defs/base-page-template"],?
| "slug": { | ||
| "$componentKey": "Slug", | ||
| "$componentTitle": "Slug", | ||
| "widget": { | ||
| "ui:widget": "slug" | ||
| }, |
There was a problem hiding this comment.
question: what is this slug property? In the landingPage content type we have nowadays there are only the SEO properties
| "slug": { | ||
| "$componentKey": "Slug", | ||
| "$componentTitle": "Slug", | ||
| "widget": { | ||
| "ui:widget": "slug" | ||
| }, | ||
| "default": "/", | ||
| "type": "string" |
There was a problem hiding this comment.
question: this slug is the "path", right? Should we add a required property for the required properties as we currently have?
| @@ -0,0 +1,13 @@ | |||
| { | |||
| "404": { | |||
| "$extends": ["#/$defs/base-page-template"], | |||
There was a problem hiding this comment.
question: what does the extends do? I ask because I thought the
"properties": {
"sections": {
"$ref": "#/$defs/$ALLOW_ALL_COMPONENTS"
}
}
wouldn't be needed here because the extends would already do that.
"base-page-template": {
"type": "object",
"properties": {
"sections": {
"$ref": "#/$defs/$ALLOW_ALL_COMPONENTS"
}
}
},
| @@ -0,0 +1,40 @@ | |||
| { | |||
| "$componentKey": "ProductGallery", | |||
There was a problem hiding this comment.
It's different from
, is it something else?| "$componentTitle": "Product Tiles", | ||
| "type": "object", | ||
| "$extends": ["#/$defs/base-component"], | ||
| "description": "Add custom shelves to your store", |
There was a problem hiding this comment.
| "description": "Add custom shelves to your store", | |
| "description": "Add custom highlights to your store", |
| @@ -0,0 +1,55 @@ | |||
| { | |||
| "$componentKey": "RegionBar", | |||
| "$componentTitle": "Region Select Bar", | |||
There was a problem hiding this comment.
| "$componentTitle": "Region Select Bar", | |
| "$componentTitle": "Region Bar", |
| "$componentKey": "RegionBar", | ||
| "$componentTitle": "Region Select Bar", | ||
| "$extends": ["#/$defs/base-component"], | ||
| "description": "Region Select Bar configuration", |
There was a problem hiding this comment.
| "description": "Region Select Bar configuration", | |
| "description": "Region Bar configuration", |
| "editLabel": { | ||
| "title": "Location edit label", | ||
| "type": "string", | ||
| "default": "Edit" |
There was a problem hiding this comment.
Another deprecated property, we could remove it or change it like that:
| "default": "Edit" | |
| "default": "", | |
| "description": "[Deprecated] This label should not be used anymore." |
…omponentKey (#2915) ## What's the purpose of this pull request? This PR makes it so FastStore Core is capable of rendering components based on data from the CMS, using `$componentKey`s to identity each component. It also adds the `$componentKey`s to each component, based on their new schemas (for Content Platform) added in [this PR](#2742). ## How it works? The implementation here is backwards compatible, so during the existing rendering flow a new check was added to look for the `$componentKey` property in a section's data. Also, for each component that renders a section, the `$componentKey` property was added, then, when indexing all available components, the new property will now be used if its present. To keep backwards compatibility, the `$componentKey`s are matching the names of the components. ## How to test it? Since this change should be totally backwards compatible, if you're testing this branch with any current store, fetching data from hCMS, you should see no change in behaviour and everything should still render normally. Running `@faststore/core` locally also should look normal. You can also test this by using this branch alongside the new CP client being used in #2807.
|
Closing it in favor of #3071 |
## What's the purpose of this pull request? This PR adds the schema definitions for components and content types that will be used by CMS (Content Platform). A big change introduced is regarding how we're allowing schema definitions for components to be broken into multiple json | jsonc files. A second significant change is the `base.jsonc` file. It's a special file used only by the Consumer. In this case, Faststore is a Consumer and must maintain this base file. This **must** not be sent to the clients. This PR replaces the #2742 ## How it works? This PR splits the sections.json and content-types.json file into many components. - packages/core/cms/faststore/components/.*jsonc - packages/core/cms/faststore/content-types/.*jsonc It also adds a base.jsonc exclusive for Faststore (it must not be shared with the Developer). - packages/core/cms/faststore/base.jsonc The content CLI (CMS) can combine the files, generate an output, and send it to the Schema Registry. - packages/core/cms/faststore/schema.json (final schema output) The Faststore is the base schema for all Merchants. 🚀 ## How to test it? Install the Content plugin and check the available commands ```bash vtex plugins install @vtex/cli-plugin-content ``` Migrate the **sections** from hCMS to the new CMS: ```bash vtex content split-components -i cms/faststore/sections.json -o cms/faststore/components ``` Migrate the **content-types** from hCMS to the new CMS: ```bash vtex content split-content-types -i packages/core/cms/faststore/content-types.json -s packages/core/cms/faststore/sections.json -o packages/core/cms/faststore/content-types ``` When you are ready, you can generate the final output: **IMPORTANT**: The Faststore Core Team is the only one that needs to add the `-l base.jsonc` to the output. Merchants will automatically use the base from the Schema Registry. ```bash vtex content generate-schema packages/core/cms/faststore/components packages/core/cms/faststore/content-types -l packages/core/cms/faststore/base.jsonc -o packages/core/cms/faststore/schema.json ``` Finally, send the output schema to the Schema Registry 🚀 IMPORTANT: This command is equivalent to the hCMS cms-sync function. ```bash vtex content upload-schema ``` ## References [Schema Registry for CMS (content platform)](https://github.com/vtex/content-platform/tree/main/services/schema-registry-api) [Content Plugin CLI](https://github.com/vtex/cli-plugin-content) [Split command](vtex/cli-plugin-content#13) **Documentation** - [x] For documentation changes, ping `@Mariana-Caetano` to review and update (Or submit a doc request) --------- Co-authored-by: Lucas Feijó <[email protected]>
## What's the purpose of this pull request? This PR adds the schema definitions for components and content types that will be used by CMS (Content Platform). A big change introduced is regarding how we're allowing schema definitions for components to be broken into multiple json | jsonc files. A second significant change is the `base.jsonc` file. It's a special file used only by the Consumer. In this case, Faststore is a Consumer and must maintain this base file. This **must** not be sent to the clients. This PR replaces the #2742 ## How it works? This PR splits the sections.json and content-types.json file into many components. - packages/core/cms/faststore/components/.*jsonc - packages/core/cms/faststore/content-types/.*jsonc It also adds a base.jsonc exclusive for Faststore (it must not be shared with the Developer). - packages/core/cms/faststore/base.jsonc The content CLI (CMS) can combine the files, generate an output, and send it to the Schema Registry. - packages/core/cms/faststore/schema.json (final schema output) The Faststore is the base schema for all Merchants. 🚀 ## How to test it? Install the Content plugin and check the available commands ```bash vtex plugins install @vtex/cli-plugin-content ``` Migrate the **sections** from hCMS to the new CMS: ```bash vtex content split-components -i cms/faststore/sections.json -o cms/faststore/components ``` Migrate the **content-types** from hCMS to the new CMS: ```bash vtex content split-content-types -i packages/core/cms/faststore/content-types.json -s packages/core/cms/faststore/sections.json -o packages/core/cms/faststore/content-types ``` When you are ready, you can generate the final output: **IMPORTANT**: The Faststore Core Team is the only one that needs to add the `-l base.jsonc` to the output. Merchants will automatically use the base from the Schema Registry. ```bash vtex content generate-schema packages/core/cms/faststore/components packages/core/cms/faststore/content-types -l packages/core/cms/faststore/base.jsonc -o packages/core/cms/faststore/schema.json ``` Finally, send the output schema to the Schema Registry 🚀 IMPORTANT: This command is equivalent to the hCMS cms-sync function. ```bash vtex content upload-schema ``` ## References [Schema Registry for CMS (content platform)](https://github.com/vtex/content-platform/tree/main/services/schema-registry-api) [Content Plugin CLI](https://github.com/vtex/cli-plugin-content) [Split command](vtex/cli-plugin-content#13) **Documentation** - [x] For documentation changes, ping `@Mariana-Caetano` to review and update (Or submit a doc request) --------- Co-authored-by: Lucas Feijó <[email protected]>
What's the purpose of this pull request?
This PR adds the schema definitions for components and content types that will be used by Content Platform.
A big change introduced is regarding how we're allowing schema definitions for components to be broken into multiple
json | jsoncfiles.How it works?
As it is right now, without further changes to FastStore Core, this basically does nothing 😅, it's just a bunch of definitions (that's why I'm tagging this as a chore). Future PRs will add actual support for them.
How to test it?
No need.
References
The schemas added here all follow the meta schema definitions we're also using in Content Platform: https://github.com/vtex/content-platform/blob/main/resources/meta-schema.jsonc.