Skip to content

Conversation

@azu
Copy link
Owner

@azu azu commented Jul 7, 2025

Summary

  • Upgrade remark from v11.0.2 to v15.0.1 (major version upgrade)
  • Upgrade unist-util packages to latest ESM-compatible versions
  • Upgrade meow from v5.0.0 to v13.2.0 (major version upgrade)
  • Remove promise.allsettled dependency (now using native Promise.allSettled)

Breaking Changes Addressed

  • ESM Migration: Converted CommonJS require() to ESM imports in @power-doctest/markdown
  • remark v15: Updated to use new processor API and import syntax
  • unist-util packages: Fixed import statements for new ESM-only versions
  • meow v13: Updated CLI to use new API with importMeta support

Test Results

  • ✅ All 96 tests passing across 8 packages
  • ✅ Build successful for all packages
  • ✅ Linting passes without errors
  • ✅ TypeScript compilation successful

Migration Notes

The main challenge was adapting to the ESM-only ecosystem. Key changes:

  • Replaced createRequire() pattern with direct ESM imports
  • Updated function signatures for new unist-util APIs
  • Modernized CLI argument parsing with meow v13

🤖 Generated with Claude Code

- Upgrade remark from v11.0.2 to v15.0.1
- Upgrade unist-util packages to latest versions
- Upgrade meow from v5.0.0 to v13.2.0
- Remove promise.allsettled dependency (use native Promise.allSettled)

Breaking changes addressed:
- Convert require() to ESM imports in @power-doctest/markdown
- Update CLI to use meow v13 API with importMeta
- Fix type compatibility with new unist-util packages

All tests pass after migration to ESM modules.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@azu azu added the Type: Dependencies Dependency issues or Changes to dependency files label Jul 7, 2025
select.selectAll(`code[lang="javascript"]`, markdownAST),
);
return codeBlocks.map((codeBlock: UnistNode & { value: string | undefined }) => {
const processor = remark();
Copy link
Owner Author

Choose a reason for hiding this comment

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

We can move instancination to out of function.

Copy link
Owner Author

@azu azu left a comment

Choose a reason for hiding this comment

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

need to fix

Move the remark processor creation to module level to avoid creating
a new instance on every function call, improving performance.

Addresses review comment: #50 (comment)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@azu azu merged commit 2bd2a14 into master Jul 8, 2025
4 checks passed
@azu azu deleted the fix/dependency-updates branch July 8, 2025 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Dependencies Dependency issues or Changes to dependency files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants