Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions eng/generate-website-data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@ function normalizeText(value, fallback = "") {
return typeof value === "string" ? value.trim() : fallback;
}

/**
* Normalize an author value (npm string form or { name, url } object) to
* { name, url? } | null. Returns null when no usable name is present.
*/
function normalizeAuthor(value) {
if (!value) return null;
if (typeof value === "string") {
const name = value.trim();
return name ? { name } : null;
}
if (typeof value === "object") {
const name = normalizeText(value.name);
if (!name) return null;
const url = normalizeText(value.url);
return url ? { name, url } : { name };
}
return null;
}

/**
* Find the latest git-modified date for any file under a directory.
*/
Expand Down Expand Up @@ -1044,6 +1063,7 @@ function generateCanvasManifest(gitDates, commitSha) {
installUrl,
sourceUrl: null,
external: false,
author: normalizeAuthor(packageJson.author),
keywords,
});
}
Expand Down Expand Up @@ -1116,6 +1136,7 @@ function generateCanvasManifest(gitDates, commitSha) {
installUrl,
sourceUrl: sourceUrl || null,
external: true,
author: normalizeAuthor(ext?.author),
keywords,
});
}
Expand Down
1 change: 1 addition & 0 deletions extensions/accessibility-kanban/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"main": "extension.mjs",
"author": { "name": "Aaron Powell", "url": "https://github.com/aaronpowell" },
"dependencies": {
"@github/copilot-sdk": "latest"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/arcade-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "arcade-canvas",
"version": "1.0.0",
"main": "extension.mjs",
"author": "Dan Wahlin",
"author": { "name": "Dan Wahlin", "url": "https://github.com/DanWahlin" },
"license": "MIT",
"type": "module",
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions extensions/backlog-swipe-triage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"main": "extension.mjs",
"author": { "name": "James Montemagno", "url": "https://github.com/jamesmontemagno" },
"dependencies": {
"@github/copilot-sdk": "1.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/chromium-control-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "chromium-control-canvas",
"version": "1.0.0",
"main": "extension.mjs",
"author": "Andrea Griffiths",
"author": { "name": "Andrea Griffiths", "url": "https://github.com/AndreaGriffiths11" },
"license": "MIT",
"type": "module",
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions extensions/color-orb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"main": "extension.mjs",
"author": { "name": "Aaron Powell", "url": "https://github.com/aaronpowell" },
"dependencies": {
"@github/copilot-sdk": "latest"
},
Expand Down
1 change: 1 addition & 0 deletions extensions/diagram-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"main": "extension.mjs",
"author": { "name": "Aaron Powell", "url": "https://github.com/aaronpowell" },
"dependencies": {
"@github/copilot-sdk": "latest"
},
Expand Down
1 change: 1 addition & 0 deletions extensions/external.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"id": "coffilot",
"name": "Coffilot",
"description": "Java-focused Copilot canvas extension from jdubois.",
"author": { "name": "Julien Dubois", "url": "https://github.com/jdubois" },
"keywords": [
"java",
"canvas",
Expand Down
1 change: 1 addition & 0 deletions extensions/feedback-themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"main": "extension.mjs",
"author": { "name": "Aaron Powell", "url": "https://github.com/aaronpowell" },
"dependencies": {
"@github/copilot-sdk": "latest"
},
Expand Down
1 change: 1 addition & 0 deletions extensions/gesture-review/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"main": "extension.mjs",
"author": { "name": "Aaron Powell", "url": "https://github.com/aaronpowell" },
"dependencies": {
"@github/copilot-sdk": "latest"
},
Expand Down
1 change: 1 addition & 0 deletions extensions/release-notes-showcase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"main": "extension.mjs",
"author": { "name": "James Montemagno", "url": "https://github.com/jamesmontemagno" },
"dependencies": {
"@github/copilot-sdk": "1.0.1"
},
Expand Down
1 change: 1 addition & 0 deletions extensions/where-was-i/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"main": "extension.mjs",
"author": { "name": "Aaron Powell", "url": "https://github.com/aaronpowell" },
"description": "Reconstruct your dev context (branch, commits, uncommitted work, PR clues) and trigger a resume prompt to continue quickly.",
"keywords": [
"interrupt-recovery",
Expand Down
16 changes: 15 additions & 1 deletion website/src/scripts/pages/extensions-render.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { escapeHtml, getGitHubUrl, getLastUpdatedHtml } from "../utils";
import { escapeHtml, getGitHubUrl, getLastUpdatedHtml, sanitizeUrl } from "../utils";
import { renderEmptyStateHtml, renderSharedCardHtml } from "./card-render";

export interface RenderableExtension {
Expand Down Expand Up @@ -34,6 +34,7 @@ export interface RenderableExtension {
installUrl?: string | null;
sourceUrl?: string | null;
external?: boolean;
author?: { name: string; url?: string } | null;
}

export type ExtensionSortOption = "title" | "lastUpdated";
Expand Down Expand Up @@ -92,8 +93,21 @@ export function renderExtensionsHtml(items: RenderableExtension[]): string {
</div>
`;

const authorHtml = item.author?.name
? `<span class="resource-tag resource-author">by ${
item.author.url
? `<a href="${sanitizeUrl(
item.author.url
)}" target="_blank" rel="noopener noreferrer">${escapeHtml(
item.author.name
)}</a>`
Comment on lines +99 to +103
: escapeHtml(item.author.name)
}</span>`
: "";

const metaHtml = `
${item.external ? '<span class="resource-tag">External</span>' : ""}
${authorHtml}
${getLastUpdatedHtml(item.lastUpdated)}
`;

Expand Down
14 changes: 14 additions & 0 deletions website/src/scripts/pages/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
getGitHubUrl,
getQueryParam,
getQueryParamValues,
sanitizeUrl,
showToast,
updateQueryParams,
} from "../utils";
Expand Down Expand Up @@ -178,6 +179,19 @@ function openDetailsModal(
if (item.external) {
metaParts.push('<span class="resource-tag">External</span>');
}
if (item.author?.name) {
metaParts.push(
item.author.url
? `<span class="resource-author">by <a href="${sanitizeUrl(
item.author.url
)}" target="_blank" rel="noopener noreferrer">${escapeHtml(
item.author.name
)}</a></span>`
Comment on lines +185 to +189
: `<span class="resource-author">by ${escapeHtml(
item.author.name
)}</span>`
);
}
if (item.lastUpdated) {
metaParts.push(
`<span class="last-updated">Updated ${escapeHtml(
Expand Down
Loading