feat: [WIP] migrate remark ecosystem from v8 to v13+#227
feat: [WIP] migrate remark ecosystem from v8 to v13+#227akabekobeko wants to merge 1 commit intomainfrom
Conversation
Migrate the entire remark/unified/rehype pipeline from remark-parse 8 (legacy tokenizer API) to remark-parse 11+ (micromark-based). This includes updating all plugins to the new APIs, replacing deprecated packages, and updating test expectations for new parser behavior. Key changes: - unified 9→11, remark-parse 8→11, mdast-util-to-hast 11→13 - Replace remark-attr with custom md-attr-parser transformer - Replace remark-shortcodes with custom [[toc]] transformer - Replace remark-footnotes with remark-gfm + custom inline footnote transformer - Update all handlers to v13 State API (state.all/state.patch) - Fix hastscript v9 property interpretation in document.ts - Fix refractor v4 Root node extraction in code.ts - Add image attribute support to attr plugin - Update footnote Pandoc transformer selectors for v13 format - Remove defs.test.ts (tested obsolete Parser.prototype API) - Update test expectations for remark 13+ behavior changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
memo: これをベースによりよい対応がないか試してゆく予定です。 |
|
@akabekobeko じつは
を作っています。これらを |
Claude Code 的にはガードレールとして具体的な仕様やテストがあると、かなりの精度で整合をとってくれます。そのため本 PR にテストなどの commit をのせるか、コメントに記載いただければ私の方で試してみます! なお各構文を npm として個別公開した場合は、そちらへの移行も検討します。 |
|
@akabekobeko
これらはいずれも、wooorm氏による公式のプラグインと同じ3層(micromark-extension-*/mdast-util-*/remark-*)で構成してモノレポにしています。今後万が一wooorm氏が大きなアーキテクチャ変更を行った際に、移行ガイドに従いやすくしたいと思っているためです。個々のパッケージはできるだけミニマムにしているつもりですが、まとめるには多い依存関係がそれぞれにあります。 ですので、npmに、@vivliostyle/micromark-extension-{attribute,sectionize,ruby}/@vivliostyle/mdast-util-{attribute,sectionize,ruby}/@vivliostyle/remark-{attribute,sectionize,ruby}は公開させていただきたいです。 リポジトリとしては以下のどちらかの形がよいと思います。
いかがでしょうか? |
|
@u1f992
の案では以下がよさそうですね!
モノレポとした場合、npm publish 運用も検討が必要そうです。これはこれで Issue と PR を分けた方がよいですね。 |
|
@akabekobeko でしたら、とりあえずVFM 1パッケージのみのモノレポ化を進めていただいて、そこにパッケージを足すPRを出すのでレビューしていただき、揃ったら移行を始めるという感じでいかがでしょうか! 整理進めた結果3×3パッケージは細かく分けすぎで、@vivliostyle/remark-{attribute,sectionize,ruby}の3パッケージにまとめて、micromarkプラグインとmdastユーティリティとremarkプラグインをまとめてエクスポートしようと考えています。 |
よさそうですね! |
Migrate the entire remark/unified/rehype pipeline from remark-parse 8 (legacy tokenizer API) to remark-parse 11+ (micromark-based). This includes updating all plugins to the new APIs, replacing deprecated packages, and updating test expectations for new parser behavior.
Key changes: