@@ -101,6 +101,25 @@ function normalizeText(value, fallback = "") {
101101 return typeof value === "string" ? value . trim ( ) : fallback ;
102102}
103103
104+ /**
105+ * Normalize an author value (npm string form or { name, url } object) to
106+ * { name, url? } | null. Returns null when no usable name is present.
107+ */
108+ function normalizeAuthor ( value ) {
109+ if ( ! value ) return null ;
110+ if ( typeof value === "string" ) {
111+ const name = value . trim ( ) ;
112+ return name ? { name } : null ;
113+ }
114+ if ( typeof value === "object" ) {
115+ const name = normalizeText ( value . name ) ;
116+ if ( ! name ) return null ;
117+ const url = normalizeText ( value . url ) ;
118+ return url ? { name, url } : { name } ;
119+ }
120+ return null ;
121+ }
122+
104123/**
105124 * Find the latest git-modified date for any file under a directory.
106125 */
@@ -1002,6 +1021,10 @@ function generateCanvasManifest(gitDates, commitSha) {
10021021 const packageJson = fs . existsSync ( packageJsonPath )
10031022 ? JSON . parse ( fs . readFileSync ( packageJsonPath , "utf-8" ) )
10041023 : { } ;
1024+ const canvasJsonPath = path . join ( extensionDir , "canvas.json" ) ;
1025+ const canvasJson = fs . existsSync ( canvasJsonPath )
1026+ ? JSON . parse ( fs . readFileSync ( canvasJsonPath , "utf-8" ) )
1027+ : { } ;
10051028 const keywords = Array . isArray ( packageJson . keywords )
10061029 ? [ ...new Set ( packageJson . keywords . filter ( ( keyword ) => typeof keyword === "string" ) . map ( ( keyword ) => keyword . trim ( ) ) . filter ( Boolean ) ) ] . sort ( ( a , b ) => a . localeCompare ( b ) )
10071030 : [ ] ;
@@ -1044,6 +1067,7 @@ function generateCanvasManifest(gitDates, commitSha) {
10441067 installUrl,
10451068 sourceUrl : null ,
10461069 external : false ,
1070+ author : normalizeAuthor ( canvasJson . author ) ,
10471071 keywords,
10481072 } ) ;
10491073 }
@@ -1116,6 +1140,7 @@ function generateCanvasManifest(gitDates, commitSha) {
11161140 installUrl,
11171141 sourceUrl : sourceUrl || null ,
11181142 external : true ,
1143+ author : normalizeAuthor ( ext ?. author ) ,
11191144 keywords,
11201145 } ) ;
11211146 }
@@ -1199,6 +1224,7 @@ function writePerExtensionCanvasManifests(canvasManifestData) {
11991224 name : item . name ,
12001225 description : item . description || "Canvas extension" ,
12011226 version : item . version || "1.0.0" ,
1227+ ...( item . author ? { author : item . author } : { } ) ,
12021228 keywords : Array . isArray ( item . keywords )
12031229 ? [ ...new Set ( item . keywords ) ] . sort ( ( a , b ) => a . localeCompare ( b ) )
12041230 : [ ] ,
0 commit comments