warehouse icon indicating copy to clipboard operation
warehouse copied to clipboard

Replace typescript

Open segayuu opened this issue 4 years ago • 11 comments

One of the reasons why warehouse is hardly maintained is that it doesn't understand the type. However, the warehouse package is too complex to be typed with DefinitelyTyped, and it is quite possible to make typing errors.

segayuu avatar Sep 26 '19 08:09 segayuu

@segayuu IMHO we should release warehouse v3.0 and upgrade hexo's dependency v3.0 before migrate to TypeScript.

yoshinorin avatar Sep 26 '19 10:09 yoshinorin

I just added warehouse@3 as part of hexo v4 milestone.

curbengh avatar Sep 26 '19 11:09 curbengh

@segayuu What point of view should we check? Just migrate js to ts? For example, some instance member can specify private. Should we review such code?

yoshinorin avatar Sep 29 '19 14:09 yoshinorin

The purpose of this PR is to set noImplicityAny to true, and strict typing from that achievement is an arbitrary position. If the private attribute is added, it is necessary to modify the test file implementation.

segayuu avatar Sep 29 '19 14:09 segayuu

Do we have updates on this pr?

For now I think that hexo-warehouse is the best json db for tiny apps :p Waiting for ts updates.

YuJianghao avatar Nov 13 '20 15:11 YuJianghao

I think the same @YuJianghao

tmirun avatar Dec 31 '20 20:12 tmirun

@hexojs/core I have been trying to migrate to TypeScript since last week.

I think maybe we can migrate it just a little bit more. But, some tests have errors. I assume it causes by rfdc in src/model.ts. (Maybe deepcopy does not works well)

https://github.com/hexojs/warehouse/pull/60/files#diff-6bfea2ec3c1d21c90d6e1ecd704f380a6eeb44521e1da1a87b6a48ea691b6a43R2-R3

Dose someone would you help?

Thank you :)


P.S: solved

yoshinorin avatar Jun 22 '22 06:06 yoshinorin

@hexojs/core Now all tests are green.

yoshinorin avatar Jun 22 '22 09:06 yoshinorin

@hexojs/core Now ready for review. Does someone would you please review?

I think we can improve our code more type safely and robustly. However, I think we need more time to do it. Also, I will fix if the current PR has a critical problem. But, IMHO I want to merge this PR once and improve our code step by step.

Thank you :)

yoshinorin avatar Jul 23 '22 21:07 yoshinorin

Updated: Merge the master branch to this PR branch.

yoshinorin avatar Aug 10 '22 10:08 yoshinorin

@hexojs/core Can we merge this? or need more review?

yoshinorin avatar Oct 05 '22 14:10 yoshinorin