(p: string)
| 111 | // Computes a tailored "use X instead of Y" suggestion from the user's actual path |
| 112 | // rather than a hardcoded example (review feedback on #20895). |
| 113 | function marketplaceSourceHint(p: string): string { |
| 114 | // Strip leading ../ segments: the '..' a user added to "climb out of |
| 115 | // .claude-plugin/" is unnecessary since paths already start at the repo root. |
| 116 | // If '..' appears mid-path (rare), fall back to a generic example. |
| 117 | const stripped = p.replace(/^(\.\.\/)+/, '') |
| 118 | const corrected = stripped !== p ? `./${stripped}` : './plugins/my-plugin' |
| 119 | return ( |
| 120 | 'Plugin source paths are resolved relative to the marketplace root (the directory ' + |
| 121 | 'containing .claude-plugin/), not relative to marketplace.json. ' + |
| 122 | `Use "${corrected}" instead of "${p}".` |
| 123 | ) |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Validate a plugin manifest file (plugin.json) |
no outgoing calls
no test coverage detected