Skip to content

chore: change dependencies version#5202

Merged
yoshinorin merged 2 commits intohexojs:v7.0.0from
Pcrab:dep-update
May 31, 2023
Merged

chore: change dependencies version#5202
yoshinorin merged 2 commits intohexojs:v7.0.0from
Pcrab:dep-update

Conversation

@Pcrab
Copy link
Contributor

@Pcrab Pcrab commented May 11, 2023

What does it do?

npm and yarn

Since hexo-front-matter release v4.1.0, it uses typescript and requires exactly two parameters:

declare function parse(str: string, options: yaml.LoadOptions): any;

However, in hexo, it calls the parse function mostly with only one parameter:

import { parse as yfmParse } from 'hexo-front-matter';
Object.assign(data, yfmParse(content));

Although in package.json its version is defined as ^4.0.0, npm and yarn will automatically install its latest version v4.1.0, which makes the build fail.

pnpm

If we use pnpm, it will use moize v6.1.0, not its latest version v6.1.6, together with micro-memoiz v4.1.2.

micro-memoize used to contain its src folder but was removed in v4.1.0.

In moize its type definition contains:

import { MicroMemoize } from 'micro-memoize/src/types';

which no longer works with the latest micro-memoiz. This is fixed in v6.1.6.

Screenshots

with npm:

image

with pnpm:

image

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@Pcrab Pcrab changed the title refactor: migrate typescript (#5092) chore: change dependencies version May 11, 2023
@Pcrab
Copy link
Contributor Author

Pcrab commented May 11, 2023

The former one should be fixed in hexojs/hexo-front-matter#67, but since hexo-front-matter hasn't released a new version to include this change yet, we should still stick to v4.0.0 here to prevent type error.

@github-actions
Copy link

How to test

git clone -b dep-update https://github.com/Pcrab/hexo.git
cd hexo
npm install
npm test

Copy link
Member

@yoshinorin yoshinorin left a comment

Choose a reason for hiding this comment

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

@Pcrab
Thank you :)
We will release a new version of hexo-front-matter.

@yoshinorin yoshinorin merged commit f791362 into hexojs:v7.0.0 May 31, 2023
@Pcrab Pcrab deleted the dep-update branch June 1, 2023 00:47
@yoshinorin yoshinorin added this to the 7.0.0 milestone Jun 2, 2023
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.

3 participants