Skip to content

create anew compiled file for spark to fix the ordering#174

Merged
lastHokage merged 7 commits into
mainfrom
feat/SP-6306
Jun 23, 2026
Merged

create anew compiled file for spark to fix the ordering#174
lastHokage merged 7 commits into
mainfrom
feat/SP-6306

Conversation

@lastHokage

@lastHokage lastHokage commented Jun 3, 2026

Copy link
Copy Markdown
Contributor
  • Add a new validation keyword for mapping the content-tree to spark node
  • Create a new build command that is going to generate an specific file just for spark
  • Change the order of the carousel-card to match the design
  • Migrated the Title and Standfirst properties to the Carousel node, and deleted the CarouselHeading node.

Comment thread build.bash
typescript-json-schema --validationKeywords sparkGenerateStoryblock sparkRepeater minItem maxItem --noExtraProps --required content-tree.ts ContentTree.transit.Root > schemas/transit-tree.schema.json
typescript-json-schema --noExtraProps --required content-tree.ts ContentTree.transit.Root > schemas/transit-tree.schema.json
typescript-json-schema --noExtraProps --required content-tree.ts ContentTree.transit.Body > schemas/body-tree.schema.json
typescript-json-schema --validationKeywords sparkMapNodeType sparkGenerateStoryblock sparkRepeater minItem maxItem --propOrder --noExtraProps --required content-tree.ts ContentTree.transit.Root > schemas/spark-transit-tree.schema.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

☝️ We want to retain field order in Spark so that title appears near the top and not near the bottom of the generated story blocks. To do that, we need to preserve property order in the schema for Spark.

@katiefenn katiefenn marked this pull request as ready for review June 4, 2026 09:45
@katiefenn katiefenn requested review from a team as code owners June 4, 2026 09:45
Katie Fenn and others added 2 commits June 5, 2026 13:39
- The existing test suite had tests covering the existing schemas -
  content-tree, transit-tree and body-tree. However, the preceding
  commits also added a new schema - spark-transit-tree, which has more
  custom validation keywords and a requirement for property ordering.
- This commit adds coverage for the new schema type and adds the
  supporting validation config for sparkMapNodeType and propertyOrder.
Comment thread test.bash
done
for datafile in tests/schema/"$schema"/invalid/*; do
"$AJV" test --invalid --allow-union-types -c "$AJV_CUSTOM_KEYWORDS" -s schemas/spark-transit-tree.schema.json -d "$datafile"
done

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

☝️ I found that the new spark-transit-tree.schema.json schema didn't have any test coverage. When I added it, I decided that we should only apply the custom keyword settings to this schema, and not to the others.

Comment thread SPEC.md
}
```
**CarouselHeading** is the main header for a carousel component

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

☝️ Remove the CarouselHeading node, because we've decided not to pursue more complex Beta Component features needed to auto-generate fields for it.

Comment thread SPEC.md
/**
@sparkMapNodeType textInput
*/
standfirst?: string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

☝️ Migrate the Title and Standfirst properties to the Carousel, rather than the CarouselHeading. Also, make both of these fields optional.

@lastHokage lastHokage merged commit 59cb65d into main Jun 23, 2026
6 checks passed
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.

4 participants