reverse eng the component files and updating and creating the block s…#3
Conversation
…ub-folder json files
|
Cursor AI prompt used : I want to reverse engineer the @component-models.json , @component-definition.json , and @component-filters.json files as they have been manually changed by previous developers. These three files should be generated by compiling the "definitions", "models", and "filters" section of each .json file for each _.json file in the /blocks sub-directory for each block type. And also if needed create appropriate _.json file in the /blocks sub-directory for each block type. Summary of AI Result Reverse Engineering Complete |
roperev
left a comment
There was a problem hiding this comment.
If you can update that _faq-accordion.json to add the definitions first, then the change can be approved.
There was a problem hiding this comment.
Swapna, this file seems to be missing the "definitions" portion on line 2. It might not exist in the component-definition.json file, could need to be created in the same structure/format as the other block level _json files by hand. It should have something like (the comment field is killing the line spacing below but you can see the concept):
{
"title": "FAQ Accordion Block",
"id": "faq-accordion-block",
"plugins": {
"xwalk": {
"page": {
"resourceType": "core/franklin/components/block/v1/block",
"template": {
"name": "FAQ Accordion Block",
"model": "faq-accordion-block",
"filter": "faq-accordion-block"
}
}
}
}
},
{
"title": "FAQ Accordion Item",
"id": "faq-accordion-item",
"plugins": {
"xwalk": {
"page": {
"resourceType": "core/franklin/components/block/v1/block/item",
"template": {
"name": "FAQ Accordion Item",
"model": "faq-accordion-item"
}
}
}
}
}
There was a problem hiding this comment.
This has a lot of changes, which is expected, however the diff is tricky to follow because a lot of items have changed order due to the compilation (npm build:json) process, and the diff matches on some line-by-line items (such as lines like "component": "richtext", for example, which is common to many items in the _jsons). Syntactically this looks correct. We may have to revisit the content of this file in the future if we discover that some block items are not being represented now in this file, though I trust Cursor decompiled everything present to the best of its ability.
There was a problem hiding this comment.
Notes :
Revert the component*.json file
Re-run the AI prompt with below changes
Make changes to the prompt : Keep the AI prompt. and re-add to consider json files under /model exclude the compnent*.json files. And re-run
…m block and model folder
Cursor prompt used :I want to reverse engineer the @component-models.json , @component-definition.json , and @component-filters.json files as they have been manually changed by previous developers. These three files should be generated by compiling the "definitions", "models", and "filters" section -- From each .json files from /models please make sure to exclude this 3 files _component-models.json , _component-definition.json , and _component-filters.json And also if needed create appropriate _.json file in the /blocks sub-directory for each block type and /models I want to take what currently in the three root level component-.json files, and move the content for each block BACK into the smaller individual json files. Basically refactor all block level _.json files and models level with json files with the root level files as the source of truth. When complete, I expect that building this project will result in identical component-.json files as currently exist. Summary of AI Result:What Was Done: Refactored all individual files to match the content from the root files: Updated Model Files (/models): Updated Root Files: Short summary : |
roperev
left a comment
There was a problem hiding this comment.
@sthirumal This looks more comprehensive, however:

I'd just move the content of those 4 "extra" files out of the /models/ folder by hand into the corresponding "parent" item block. Like the faq-accordion-item, should just be more JSON at the end of the existing _faq-accordion.json file, not an entirely separate file. No additional files should be added to the /model/ folder aside from what's already there, only in /blocks/
- Modified faq-accordion, overview-rte, and secondary-navbar JSON configurations - Moved and created pl-swipper-blogs block with CSS and JS files - Added pl-swipper-blogs filter definition to component-filters.json - Updated component definition and models - Removed obsolete model files for faq-accordion-item, overview-rte-item, and secondary-nav-item
|
Following is summary of changes :- Perfect! ✅ The changes have been successfully committed. The commit includes: Thank you, |
roperev
left a comment
There was a problem hiding this comment.
I think this all looks correct now, at least as close as we can reasonably get it for our initial attempt. Good work! Approved.
Resverse engineer the component files and update and create of json file of block subfolder
Fix #1
Test URLs: