Skip to content

Commit 7517e3b

Browse files
authored
fix(marketplace): minor export-csv fixes (#566)
* fix(marketplace): minor export-csv fixes * fix typo
1 parent 5a99fdd commit 7517e3b

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/marketplace-cli': patch
3+
---
4+
5+
(export-csv) Always escape newlines in each CSV cell and add more columns

workspaces/marketplace/packages/cli/src/commands/export-csv/index.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CSVGenerator<T> {
6464
return `"${removedNewLines.replace(/"/g, '""')}"`;
6565
}
6666

67-
return cell;
67+
return removedNewLines;
6868
};
6969

7070
/** Add a row to the CSV */
@@ -201,14 +201,24 @@ export default async ({
201201
const pluginCSV = new CSVGenerator<MarketplacePlugin>({
202202
name: p => p?.metadata?.name,
203203
title: p => p?.metadata?.title,
204-
description: p => p?.metadata?.description,
205204
author: p =>
206205
p?.spec?.developer ||
207206
p?.spec?.author ||
208207
p?.spec?.owner ||
209-
(p?.spec?.authors || []).join(','),
208+
(p?.spec?.authors || [])?.map(a => a.name).join(', '),
210209
categories: p => ((p?.spec?.categories as string[]) || []).join(', '),
211210
lifecycle: p => p?.spec?.lifecycle,
211+
metadataDescription: p => p?.metadata?.description,
212+
specDescription: p => p?.spec?.description,
213+
support: p => p?.spec?.support,
214+
publisher: p => p?.spec?.publisher,
215+
highlights: p => (p?.spec?.highlights || []).join(', '),
216+
'certified-by': p =>
217+
p?.metadata?.annotations?.['extensions.backstage.io/certified-by'],
218+
'verified-by': p =>
219+
p?.metadata?.annotations?.['extensions.backstage.io/verified-by'],
220+
'pre-installed': p =>
221+
p?.metadata?.annotations?.['extensions.backstage.io/pre-installed'],
212222
packages: p => (p?.spec?.packages || []).join(', '),
213223
'backend packages': p =>
214224
getPackagesOfType(p?.spec?.packages || [], packages, [

0 commit comments

Comments
 (0)