Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Jan 19, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

… serialisation (#6353)

Adds a new feature that allows configuring the maximum line width for
YAML serialization in collections, which previously defaulted to 80
characters. Now, the line width is configurable via the
`yamlMaxLineWidth` property, defaulting to `-1` (disabled), preventing
automatic line wrapping and folded scalar syntax in YAML output. The
changes also update the relevant test cases and type definitions to
support this new option.

This resolves #6351 

**YAML line width configurability:**

* Added a new `yamlMaxLineWidth` property to the `BaseCollection`
interface, allowing users to set the maximum line width for YAML
serialization. The default is `-1`, which disables line wrapping and
prevents the use of folded scalar syntax (`>-`).
(`packages/@tinacms/schema-tools/src/types/index.ts`)
* Updated the `stringifyFile` function to use the `yamlMaxLineWidth`
value when serializing frontmatter and YAML files, ensuring that the
configured line width is respected.
(`packages/@tinacms/graphql/src/database/util.ts`)
[[1]](diffhunk://#diff-bb6cbeab4b683efa863cd5b9e93b4ad7d1da2b9a6182c50c33a4fa8e0102ebcaR86)
[[2]](diffhunk://#diff-bb6cbeab4b683efa863cd5b9e93b4ad7d1da2b9a6182c50c33a4fa8e0102ebcaR114-R128)
[[3]](diffhunk://#diff-bb6cbeab4b683efa863cd5b9e93b4ad7d1da2b9a6182c50c33a4fa8e0102ebcaL127-R139)
* Modified the `Database` class to pass the `yamlMaxLineWidth` property
from the collection configuration to the markdown/YAML stringification
logic. (`packages/@tinacms/graphql/src/database/index.ts`)

**Testing and documentation:**

* Added and updated tests to verify that long strings are not wrapped by
default and are only wrapped when `yamlMaxLineWidth` is explicitly set
(including for standalone YAML files).
(`packages/@tinacms/graphql/src/database/util.test.ts`)
* Updated example/test markdown files to reflect the new default
behavior, showing long strings on a single line without folded scalar
syntax.
(`packages/@tinacms/graphql/tests/document-creation-mutation/comprehensive-post-content.md`,
`packages/@tinacms/graphql/tests/document-creation-mutation/create-collection-post-content.md`)
[[1]](diffhunk://#diff-68e460a45f542c1c61ab7c7fe46f2c31014f5285e8eca533fe4058d63e441e18L3-R4)
[[2]](diffhunk://#diff-64c762b361f216a4229e0f7d26ee13de959fc1ab1d853f31763b63b6c2cade38L3-R4)

---------

Co-authored-by: Jack Pettit [SSW] <57518417+JackDevAU@users.noreply.github.com>
@pull pull bot locked and limited conversation to collaborators Jan 19, 2026
@pull pull bot added the ⤵️ pull label Jan 19, 2026
@pull pull bot merged commit 1d4fb88 into code:main Jan 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant