Skip to content

fix: use parent directory name for index.ts plugins in deduplication#9321

Closed
ShamanicArts wants to merge 1 commit intoanomalyco:devfrom
ShamanicArts:push-puytqkwxymxn
Closed

fix: use parent directory name for index.ts plugins in deduplication#9321
ShamanicArts wants to merge 1 commit intoanomalyco:devfrom
ShamanicArts:push-puytqkwxymxn

Conversation

@ShamanicArts
Copy link

Summary

  • Fixes plugin deduplication when multiple plugins use index.ts as their filename
  • When a plugin file is named index.ts or index.js, the parent directory name is used instead for deduplication

Problem

When configuring multiple local plugins with file:// URLs that use the common index.ts naming convention:

{
  "plugin": [
    "file:///path/to/my-plugin/index.ts",
    "file:///path/to/other-plugin/index.ts"
  ]
}

Both plugins resolve to the name index, causing the deduplication logic to keep only the last one.

Solution

The getPluginName function now checks if the filename is index and uses the parent directory name instead:

  • file:///path/to/my-plugin/index.tsmy-plugin
  • file:///path/to/other-plugin/index.tsother-plugin

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found

PR #8758: fix: use full URL for file:// plugin deduplication

This PR is related to the same deduplication issue for file:// plugins. While it appears to address the plugin deduplication problem differently (using full URL rather than parent directory name), it's addressing the same core issue of duplicate plugin detection when using local file:// URLs. You may want to check if these approaches should be unified or if PR #8758 is already resolved.

@ShamanicArts ShamanicArts marked this pull request as draft January 19, 2026 00:34
@ShamanicArts
Copy link
Author

claude PR before I wanted him too.

tut tut claude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant