Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parsers): correctly stringify keys longer than 1024 chars #4275

Merged
merged 5 commits into from Mar 29, 2022

Conversation

elado
Copy link
Contributor

@elado elado commented Mar 26, 2022

Fixes #4270

When keys are longer than 1024 chars Syml (yarn's internal Yaml stringifyer/parser) outputs invalid yaml 1.2 format.
All keys are formatted as

key: value

But long keys must be

? long-key
: value

This PR makes long keys Yaml 1.2 spec compliant.

...

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@merceyz merceyz changed the title Fix Yaml/Syml stringify with keys longer than 1024 chars fix(parsers): correctly stringify keys longer than 1024 chars Mar 26, 2022
elado and others added 2 commits March 27, 2022 10:13
Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
@arcanis arcanis merged commit 577e022 into yarnpkg:master Mar 29, 2022
@arcanis
Copy link
Member

arcanis commented Mar 29, 2022

Thanks!

merceyz pushed a commit that referenced this pull request May 12, 2022
* Fix Yaml/Syml stringify with keys longer than 1024 chars

* yarn version check

* Update packages/yarnpkg-parsers/sources/syml.ts

Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>

* formatting

* Update syml.ts

Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Co-authored-by: Maël Nison <nison.mael@gmail.com>
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.

[Bug?]: Yarn generates invalid yaml with keys longer than 1024 chars
3 participants