Fix path for Chrome DevTools external plugin (#1784)

* Fixing path on chrome devtools external pluginPath is to the folder in the repo where the plugin structure starts, not where the plugin.json file lives.

* Updating validation scripts and guidance to avoid this mistake again
This commit is contained in:
Aaron Powell
2026-05-21 15:51:17 +10:00
committed by GitHub
parent 8a43097de6
commit a303e17975
7 changed files with 32 additions and 28 deletions
+1 -1
View File
@@ -1055,7 +1055,7 @@ async function openPluginModal(
function getExternalPluginUrl(plugin: Plugin): string {
if (plugin.source?.source === "github" && plugin.source.repo) {
const base = `https://github.com/${plugin.source.repo}`;
return plugin.source.path
return plugin.source.path && plugin.source.path !== "/"
? `${base}/tree/main/${plugin.source.path}`
: base;
}
+1 -1
View File
@@ -49,7 +49,7 @@ export function sortPlugins<T extends RenderablePlugin>(
function getExternalPluginUrl(plugin: RenderablePlugin): string {
if (plugin.source?.source === 'github' && plugin.source.repo) {
const base = `https://github.com/${plugin.source.repo}`;
return plugin.source.path ? `${base}/tree/main/${plugin.source.path}` : base;
return plugin.source.path && plugin.source.path !== '/' ? `${base}/tree/main/${plugin.source.path}` : base;
}
return sanitizeUrl(plugin.repository || plugin.homepage);