chore(deps): bump js-yaml to 5.3.0 - #12486
Conversation
Supersedes #12345, which only moves the version and so is red on `build`, `lint`, `test` and `config-examples`. v5 is a breaking release and the two call sites have to move with it. `scripts/validate-config-examples.mjs` now imports js-yaml as a namespace. v5 dropped the CommonJS default export, so `import yaml from 'js-yaml'` failed to load at all. That was also behind the three test failures: `yaml` was `undefined`, `yaml.load` threw a `TypeError`, the script caught it and reported "invalid YAML", so an example that should have failed AJV schema validation failed at the parse step instead. All three pass on the import fix alone — no v5 parsing behaviour change is involved. `OptionsTable.tsx` drops `noCompatMode: true`, which v5 removed. It suppressed YAML-1.1-compat quoting of `yes`/`no`/`on`/`off` and base-60 values. None of the 136 defaults in the schema are one of those, so this is a no-op today; v5 quotes them by default and offers no way to opt out, so a future default of `no` would start rendering as `"no"`. `OptionsTable.tsx` also renames `quotingType: '"'` to `quoteStyle: 'double'`, and this is the reason the bump is not mechanical. v5 renamed that option *and* flipped its default to `'single'`, so just deleting the two options `tsc` rejects silently reflows four published defaults. The worst is `post_check.title`, whose value contains single quotes: before "'{{ check_rule_name }}'{% if check_status == 'success' %} …" after '''{{ check_rule_name }}''{% if check_status == ''success'' %} …' Equivalent YAML, unreadable in a table people copy-paste from. `@types/js-yaml` is dropped rather than bumped: v5 ships its own types, so the stub is now a mismatched duplicate. This goes to 5.3.0 rather than the 5.2.3 in #12345 because `^5.2.3` resolves to 5.3.0 anyway, and 5.3.0 only adds a custom-tag API this repo does not touch — `dump` output is byte-identical between the two. Verification: built the site on `main` and on this branch and diffed the output — all 385 pages are byte-identical, so nothing readers see moves. Every schema default also renders identically through `dumpDefault`. `pnpm check`, `pnpm test` (172), `pnpm check:config-examples` (122 examples) and `pnpm check:internal-leaks` are green, and a full build with OG generation on produces 137 cards, same as `main`. Change-Id: I67baaa318cc15d45ff7f1d6dcf4e8bff693a2cb2
Merge Protections🟢 All 6 merge protections satisfied — ready to merge. Show 6 satisfied protections🟢 🤖 Continuous Integration
🟢 👀 Review Requirements
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 Reviews
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
There was a problem hiding this comment.
Pull request overview
Updates the repo to js-yaml@5.3.0 (a breaking major), and aligns the two runtime call sites with the v5 ESM export shape and dumper option changes, while removing the now-redundant @types/js-yaml package.
Changes:
- Bump
js-yamlto^5.3.0and update the lockfile accordingly. - Fix ESM import style in
scripts/validate-config-examples.mjsto use a namespace import compatible with v5. - Update
OptionsTable.tsx’sdump()options for v5 (removenoCompatMode, switch toquoteStyle), preserving the intended output formatting.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/components/Tables/OptionsTable.tsx | Adjust yaml.dump() options for js-yaml v5, keeping double-quote rendering for readable template defaults. |
| scripts/validate-config-examples.mjs | Switch to import * as yaml from 'js-yaml' to match v5’s lack of default ESM export. |
| package.json | Bump js-yaml to v5 and remove @types/js-yaml now that v5 ships types. |
| pnpm-lock.yaml | Lockfile updates reflecting js-yaml@5.3.0 and removal of @types/js-yaml. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Merge Queue Status
This pull request spent 3 minutes 37 seconds in the queue, including 2 minutes 41 seconds running CI. Required conditions to merge
|
Supersedes #12345, which only moves the version and so is red on
build,lint,testandconfig-examples. v5 is a breaking release and the twocall sites have to move with it.
scripts/validate-config-examples.mjsnow imports js-yaml as a namespace.v5 dropped the CommonJS default export, so
import yaml from 'js-yaml'failedto load at all. That was also behind the three test failures:
yamlwasundefined,yaml.loadthrew aTypeError, the script caught it and reported"invalid YAML", so an example that should have failed AJV schema validation
failed at the parse step instead. All three pass on the import fix alone — no
v5 parsing behaviour change is involved.
OptionsTable.tsxdropsnoCompatMode: true, which v5 removed. It suppressedYAML-1.1-compat quoting of
yes/no/on/offand base-60 values. None ofthe 136 defaults in the schema are one of those, so this is a no-op today; v5
quotes them by default and offers no way to opt out, so a future default of
nowould start rendering as"no".OptionsTable.tsxalso renamesquotingType: '"'toquoteStyle: 'double',and this is the reason the bump is not mechanical. v5 renamed that option and
flipped its default to
'single', so just deleting the two optionstscrejects silently reflows four published defaults. The worst is
post_check.title, whose value contains single quotes:Equivalent YAML, unreadable in a table people copy-paste from.
@types/js-yamlis dropped rather than bumped: v5 ships its own types, so thestub is now a mismatched duplicate.
This goes to 5.3.0 rather than the 5.2.3 in #12345 because
^5.2.3resolves to5.3.0 anyway, and 5.3.0 only adds a custom-tag API this repo does not touch —
dumpoutput is byte-identical between the two.Verification: built the site on
mainand on this branch and diffed theoutput — all 385 pages are byte-identical, so nothing readers see moves. Every
schema default also renders identically through
dumpDefault.pnpm check,pnpm test(172),pnpm check:config-examples(122 examples) andpnpm check:internal-leaksare green, and a full build with OG generation onproduces 137 cards, same as
main.