Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Oct 31, 2025

Summary by CodeRabbit

  • Refactor

    • Removed the attributes plugin from the Doom package, eliminating the markdown attribute parsing functionality and its associated dependencies.
  • Chores

    • Removed md-attr-parser dependency and related type definitions.

Copilot AI review requested due to automatic review settings October 31, 2025 08:34
@changeset-bot
Copy link

changeset-bot bot commented Oct 31, 2025

🦋 Changeset detected

Latest commit: 5da53af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/doom Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Oct 31, 2025

Walkthrough

This PR removes the attributes plugin feature from @alauda/doom. The changeset declares a minor version bump, removing the md-attr-parser dependency, all type declarations, plugin registration, and implementation files for processing custom markdown attributes.

Changes

Cohort / File(s) Summary
Changeset and Dependency Management
.changeset/curvy-months-swim.md, packages/doom/package.json, packages/doom/shim.d.ts
Added changeset for minor release; removed md-attr-parser dependency and its TypeScript type declaration
Plugin Registration
packages/doom/src/cli/load-config.ts, packages/doom/src/plugins/attributes/index.ts
Removed attributesPlugin import and invocation from configuration; deleted the main plugin factory function
Plugin Implementation
packages/doom/src/plugins/attributes/remark-attributes/*
Removed all remark-attributes implementation files: attributes-transformer.ts (AST transformation logic), index.ts (plugin coordinator), mdast-attributes.ts (mdast extension), micromark-attributes.ts (micromark tokenizer), and types.ts (extension type definitions)

Sequence Diagram

sequenceDiagram
    participant Config as Load Config
    participant Plugin as Attributes Plugin
    participant Remark as Remark Pipeline
    participant AST as Markdown AST

    Note over Config,AST: BEFORE: Attributes Processing Enabled
    Config->>Plugin: Load attributesPlugin()
    Plugin->>Remark: Register remarkAttributes
    Remark->>Remark: Parse micromark-attributes syntax
    Remark->>AST: Transform attrs nodes via attributesTransformer
    AST->>AST: Apply md-attr-parser to merge attributes

    Note over Config,AST: AFTER: Attributes Plugin Removed
    Config->>Remark: Skip plugin registration
    Remark->>Remark: Standard markdown parsing only
    Remark->>AST: No attrs node support or transformation
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas requiring attention:
    • Verify no other code paths or plugins depend on the removed attributesPlugin or related exports
    • Confirm the removal is intentional (marked as "bad attributes plugin" in changeset)
    • Check for any remaining references to md-attr-parser or removed type declarations in other packages
    • Validate that the plugin removal doesn't break existing markdown processing for users relying on custom attribute syntax

Possibly related PRs

Suggested labels

breaking, dependencies

Poem

🐰 A plugin once parsed with care,
Custom attributes everywhere,
But now it's gone, refactored away,
Simplifying markdown's day!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "refactor: remove bad attributes plugin" accurately and specifically describes the main change across the entire changeset. All modifications—spanning dependency removal, type declarations, plugin implementations, and related utilities—are cohesively focused on eliminating the attributes plugin functionality from the @alauda/doom package. The title is clear, concise, and provides sufficient context for a developer scanning the commit history to understand the primary intent without confusion.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/remove_attributes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: JounQin <admin@1stg.me>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 31, 2025

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@207.tgz
yarn add https://pkg.pr.new/@alauda/doom-export@207.tgz

commit: 5da53af

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes a poorly functioning attributes plugin and its associated dependencies from the codebase. The refactor eliminates the entire attributes plugin infrastructure including its remark integration, TypeScript types, and micromark extensions.

Key changes:

  • Removes the md-attr-parser dependency from package management files
  • Deletes all attributes plugin source code and type definitions
  • Removes the plugin from the configuration system

Reviewed Changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Removes md-attr-parser dependency entry
packages/doom/package.json Removes md-attr-parser from dependencies
packages/doom/shim.d.ts Removes type declarations for md-attr-parser module
packages/doom/src/cli/load-config.ts Removes attributes plugin from configuration
packages/doom/src/plugins/attributes/ Complete deletion of attributes plugin implementation files
.changeset/curvy-months-swim.md Documents the refactor as a minor version change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.changeset/curvy-months-swim.md (1)

1-5: Changeset format is correct, but consider adding migration guidance if applicable.

The changeset file follows the correct format and provides a clear description. However, if attributesPlugin was previously documented as part of the public API, consider adding a note to the changelog about the removal and any migration path for users currently using this plugin.

If the plugin was public, consider enriching the changeset description:

-refactor: remove bad attributes plugin
+refactor: remove bad attributes plugin

+This change removes the attributes plugin feature from @alauda/doom. If you were using this plugin, please remove any `attributesPlugin` registrations from your configuration.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb78573 and 5da53af.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (10)
  • .changeset/curvy-months-swim.md (1 hunks)
  • packages/doom/package.json (0 hunks)
  • packages/doom/shim.d.ts (0 hunks)
  • packages/doom/src/cli/load-config.ts (0 hunks)
  • packages/doom/src/plugins/attributes/index.ts (0 hunks)
  • packages/doom/src/plugins/attributes/remark-attributes/attributes-transformer.ts (0 hunks)
  • packages/doom/src/plugins/attributes/remark-attributes/index.ts (0 hunks)
  • packages/doom/src/plugins/attributes/remark-attributes/mdast-attributes.ts (0 hunks)
  • packages/doom/src/plugins/attributes/remark-attributes/micromark-attributes.ts (0 hunks)
  • packages/doom/src/plugins/attributes/remark-attributes/types.ts (0 hunks)
💤 Files with no reviewable changes (9)
  • packages/doom/src/plugins/attributes/index.ts
  • packages/doom/src/plugins/attributes/remark-attributes/attributes-transformer.ts
  • packages/doom/src/plugins/attributes/remark-attributes/mdast-attributes.ts
  • packages/doom/src/plugins/attributes/remark-attributes/micromark-attributes.ts
  • packages/doom/shim.d.ts
  • packages/doom/src/plugins/attributes/remark-attributes/types.ts
  • packages/doom/package.json
  • packages/doom/src/plugins/attributes/remark-attributes/index.ts
  • packages/doom/src/cli/load-config.ts
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: JounQin
Repo: alauda/doom PR: 30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `rspress/core/theme` work without any ESLint errors.
📚 Learning: 2025-05-29T10:22:30.004Z
Learnt from: JounQin
Repo: alauda/doom PR: 34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:22:30.004Z
Learning: In the alauda/doom project, the team prefers throwing descriptive errors for invalid configuration rather than using optional chaining or graceful fallbacks. This fail-fast approach helps catch configuration issues early during development.

Applied to files:

  • .changeset/curvy-months-swim.md
📚 Learning: 2025-07-09T02:33:05.638Z
Learnt from: JounQin
Repo: alauda/doom PR: 117
File: src/remark-lint/no-heading-punctuation.ts:4-4
Timestamp: 2025-07-09T02:33:05.638Z
Learning: In the alauda/doom project, JounQin prefers to keep the `toString` import from `mdast-util-to-string` as is, even though it shadows the global toString property. Variable shadowing warnings for this specific case should not be flagged as issues.

Applied to files:

  • .changeset/curvy-months-swim.md
🔇 Additional comments (1)
.changeset/curvy-months-swim.md (1)

2-2: No version bump adjustment needed—minor is appropriate.

The attributesPlugin is not exposed in the package's public exports (checked via package.json exports field), is not documented in the README, and is not re-exported from index files. Removing an unexported, internal plugin is not a breaking change and correctly uses a minor version bump per semantic versioning.

@JounQin JounQin merged commit 39e0f2f into main Oct 31, 2025
14 checks passed
@JounQin JounQin deleted the refactor/remove_attributes branch October 31, 2025 08:39
github-actions bot pushed a commit that referenced this pull request Oct 31, 2025
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.

2 participants