fix: migrate YAML parsing from js-yaml to yaml - #5809
Open
stevenjoezhang wants to merge 1 commit into
Open
Conversation
How to testgit clone -b fix/issue-5801-migrate-yaml https://github.com/hexojs/hexo.git
cd hexo
npm install
npm test |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
This was referenced Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
Fixes #5801.
This migrates Hexo's direct YAML parsing and stringification from
js-yamltoyaml, and removes the direct dependencies onjs-yaml,js-yaml-js-types, and@types/js-yaml.js-yaml-js-typesextends the schema with!!js/function, allowing YAML input to construct executable functions. The new shared parser rejects unresolved tags such as!!js/function, while preserving the existing behavior for:Date<<)!!js/regexpYAML parsing and stringification in the renderer, multi-config handling, config command, and scaffold front matter have been migrated. Related tests now use
yamlas well.js-yamlremains a transitive dependency ofhexo-front-matter@4.2.1. Upgrading tohexo-front-matter@5is kept separate because it is tied to the timezone migration. The vulnerablejs-yaml-js-typesdependency is removed entirely.Local validation:
npm run buildnpm run eslintScreenshots
N/A — internal parser and dependency changes only.
Pull request tasks