MCPcopy Index your code
hub / github.com/codeaashu/claude-code / marketplaceSourceHint

Function marketplaceSourceHint

src/utils/plugins/validatePlugin.ts:113–124  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

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).
113function 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)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected