@code-pushup/js-packages-plugin 0.48.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +2 -2
  2. package/bin.js +104 -379
  3. package/index.js +200 -330
  4. package/package.json +6 -31
  5. package/src/lib/config.d.ts +5 -5
  6. package/src/lib/constants.d.ts +2 -2
  7. package/src/lib/js-packages-plugin.d.ts +2 -2
  8. package/src/lib/package-managers/derive-package-manager.d.ts +3 -0
  9. package/src/lib/package-managers/derive-yarn.d.ts +1 -0
  10. package/src/lib/package-managers/index.d.ts +1 -1
  11. package/src/lib/package-managers/npm/audit-result.d.ts +2 -2
  12. package/src/lib/package-managers/npm/npm.d.ts +1 -1
  13. package/src/lib/package-managers/npm/outdated-result.d.ts +1 -1
  14. package/src/lib/package-managers/npm/types.d.ts +3 -3
  15. package/src/lib/package-managers/package-managers.d.ts +2 -2
  16. package/src/lib/package-managers/pnpm/audit-result.d.ts +1 -1
  17. package/src/lib/package-managers/pnpm/outdated-result.d.ts +1 -1
  18. package/src/lib/package-managers/pnpm/pnpm.d.ts +1 -1
  19. package/src/lib/package-managers/pnpm/types.d.ts +2 -2
  20. package/src/lib/package-managers/types.d.ts +3 -3
  21. package/src/lib/package-managers/yarn-classic/audit-result.d.ts +1 -1
  22. package/src/lib/package-managers/yarn-classic/constants.d.ts +2 -2
  23. package/src/lib/package-managers/yarn-classic/outdated-result.d.ts +1 -1
  24. package/src/lib/package-managers/yarn-classic/types.d.ts +1 -1
  25. package/src/lib/package-managers/yarn-classic/yarn-classic.d.ts +1 -1
  26. package/src/lib/package-managers/yarn-modern/audit-result.d.ts +1 -1
  27. package/src/lib/package-managers/yarn-modern/outdated-result.d.ts +1 -1
  28. package/src/lib/package-managers/yarn-modern/types.d.ts +2 -2
  29. package/src/lib/package-managers/yarn-modern/yarn-modern.d.ts +1 -1
  30. package/src/lib/runner/audit/constants.d.ts +1 -1
  31. package/src/lib/runner/audit/transform.d.ts +2 -2
  32. package/src/lib/runner/audit/utils.d.ts +1 -1
  33. package/src/lib/runner/index.d.ts +1 -1
  34. package/src/lib/runner/outdated/transform.d.ts +3 -3
  35. package/src/lib/runner/utils.d.ts +2 -2
  36. package/src/lib/utils.d.ts +10 -0
package/README.md CHANGED
@@ -45,7 +45,7 @@ It supports the following package managers:
45
45
  // ...
46
46
  plugins: [
47
47
  // ...
48
- await jsPackagesPlugin({ packageManager: 'npm' }), // replace with your package manager
48
+ await jsPackagesPlugin(), // the package manager is automatically derived from your file system. Use { packageManager: 'npm' } to configure it.
49
49
  ],
50
50
  };
51
51
  ```
@@ -59,7 +59,7 @@ It supports the following package managers:
59
59
  // ...
60
60
  plugins: [
61
61
  // ...
62
- await jsPackagesPlugin({ packageManager: ['yarn-classic'], checks: ['audit'], dependencyGroups: ['prod'] }),
62
+ await jsPackagesPlugin({ packageManager: 'yarn-classic', checks: ['audit'], dependencyGroups: ['prod'] }),
63
63
  ],
64
64
  };
65
65
  ```
package/bin.js CHANGED
@@ -670,6 +670,8 @@ var auditResultSchema = scorableWithPluginMetaSchema.merge(
670
670
  );
671
671
  var reportsDiffSchema = z15.object({
672
672
  commits: makeComparisonSchema(commitSchema).nullable().describe("Commits identifying compared reports"),
673
+ portalUrl: urlSchema.optional().describe("Link to comparison page in Code PushUp portal"),
674
+ label: z15.string().optional().describe("Label (e.g. project name)"),
673
675
  categories: makeArraysComparisonSchema(
674
676
  categoryDiffSchema,
675
677
  categoryResultSchema,
@@ -698,11 +700,74 @@ var reportsDiffSchema = z15.object({
698
700
  );
699
701
 
700
702
  // packages/utils/src/lib/execute-process.ts
701
- import { spawn } from "node:child_process";
703
+ import {
704
+ spawn
705
+ } from "node:child_process";
706
+
707
+ // packages/utils/src/lib/reports/utils.ts
708
+ import ansis from "ansis";
709
+ import { md } from "build-md";
710
+
711
+ // packages/utils/src/lib/reports/constants.ts
712
+ var TERMINAL_WIDTH = 80;
713
+
714
+ // packages/utils/src/lib/reports/utils.ts
715
+ function calcDuration(start, stop) {
716
+ return Math.round((stop ?? performance.now()) - start);
717
+ }
718
+
719
+ // packages/utils/src/lib/execute-process.ts
720
+ var ProcessError = class extends Error {
721
+ code;
722
+ stderr;
723
+ stdout;
724
+ constructor(result) {
725
+ super(result.stderr);
726
+ this.code = result.code;
727
+ this.stderr = result.stderr;
728
+ this.stdout = result.stdout;
729
+ }
730
+ };
731
+ function executeProcess(cfg) {
732
+ const { command, args, observer, ignoreExitCode = false, ...options } = cfg;
733
+ const { onStdout, onStderr, onError, onComplete } = observer ?? {};
734
+ const date = (/* @__PURE__ */ new Date()).toISOString();
735
+ const start = performance.now();
736
+ return new Promise((resolve, reject) => {
737
+ const spawnedProcess = spawn(command, args ?? [], {
738
+ shell: true,
739
+ ...options
740
+ });
741
+ let stdout = "";
742
+ let stderr = "";
743
+ spawnedProcess.stdout.on("data", (data) => {
744
+ stdout += String(data);
745
+ onStdout?.(String(data), spawnedProcess);
746
+ });
747
+ spawnedProcess.stderr.on("data", (data) => {
748
+ stderr += String(data);
749
+ onStderr?.(String(data), spawnedProcess);
750
+ });
751
+ spawnedProcess.on("error", (err) => {
752
+ stderr += err.toString();
753
+ });
754
+ spawnedProcess.on("close", (code2) => {
755
+ const timings = { date, duration: calcDuration(start) };
756
+ if (code2 === 0 || ignoreExitCode) {
757
+ onComplete?.();
758
+ resolve({ code: code2, stdout, stderr, ...timings });
759
+ } else {
760
+ const errorMsg = new ProcessError({ code: code2, stdout, stderr, ...timings });
761
+ onError?.(errorMsg);
762
+ reject(errorMsg);
763
+ }
764
+ });
765
+ });
766
+ }
702
767
 
703
768
  // packages/utils/src/lib/file-system.ts
769
+ import { bold, gray } from "ansis";
704
770
  import { bundleRequire } from "bundle-require";
705
- import chalk2 from "chalk";
706
771
  import { mkdir, readFile, readdir, rm, stat } from "node:fs/promises";
707
772
  import { join } from "node:path";
708
773
 
@@ -731,12 +796,7 @@ function isPromiseRejectedResult(result) {
731
796
  // packages/utils/src/lib/logging.ts
732
797
  import isaacs_cliui from "@isaacs/cliui";
733
798
  import { cliui } from "@poppinss/cliui";
734
- import chalk from "chalk";
735
-
736
- // packages/utils/src/lib/reports/constants.ts
737
- var TERMINAL_WIDTH = 80;
738
-
739
- // packages/utils/src/lib/logging.ts
799
+ import { underline } from "ansis";
740
800
  var singletonUiInstance;
741
801
  function ui() {
742
802
  if (singletonUiInstance === void 0) {
@@ -805,37 +865,8 @@ async function crawlFileSystem(options) {
805
865
  return resultsNestedArray.flat();
806
866
  }
807
867
 
808
- // packages/utils/src/lib/text-formats/constants.ts
809
- var NEW_LINE = "\n";
810
- var TAB = " ";
811
-
812
- // packages/utils/src/lib/text-formats/html/details.ts
813
- function details(title, content, cfg = { open: false }) {
814
- return `<details${cfg.open ? " open" : ""}>${NEW_LINE}<summary>${title}</summary>${NEW_LINE}${// ⚠️ The blank line is needed to ensure Markdown in content is rendered correctly.
815
- NEW_LINE}${content}${NEW_LINE}${// @TODO in the future we could consider adding it only if the content ends with a code block
816
- // ⚠️ The blank line ensure Markdown in content is rendered correctly.
817
- NEW_LINE}</details>${// ⚠️ The blank line is needed to ensure Markdown after details is rendered correctly.
818
- NEW_LINE}`;
819
- }
820
-
821
- // packages/utils/src/lib/text-formats/html/font-style.ts
822
- var boldElement = "b";
823
- function bold(text) {
824
- return `<${boldElement}>${text}</${boldElement}>`;
825
- }
826
- var italicElement = "i";
827
- function italic(text) {
828
- return `<${italicElement}>${text}</${italicElement}>`;
829
- }
830
- var codeElement = "code";
831
- function code(text) {
832
- return `<${codeElement}>${text}</${codeElement}>`;
833
- }
834
-
835
- // packages/utils/src/lib/text-formats/html/link.ts
836
- function link(href, text) {
837
- return `<a href="${href}">${text || href}</a>`;
838
- }
868
+ // packages/utils/src/lib/git/git.ts
869
+ import { simpleGit } from "simple-git";
839
870
 
840
871
  // packages/utils/src/lib/transform.ts
841
872
  import { platform } from "node:os";
@@ -855,316 +886,6 @@ function fromJsonLines(jsonLines) {
855
886
  const unifiedNewLines = toUnixNewlines(jsonLines).trim();
856
887
  return JSON.parse(`[${unifiedNewLines.split("\n").join(",")}]`);
857
888
  }
858
- function capitalize(text) {
859
- return `${text.charAt(0).toLocaleUpperCase()}${text.slice(
860
- 1
861
- )}`;
862
- }
863
- function apostrophize(text, upperCase) {
864
- const lastCharMatch = text.match(/(\w)\W*$/);
865
- const lastChar = lastCharMatch?.[1] ?? "";
866
- return `${text}'${lastChar.toLocaleLowerCase() === "s" ? "" : upperCase ? "S" : "s"}`;
867
- }
868
-
869
- // packages/utils/src/lib/text-formats/table.ts
870
- function rowToStringArray({ rows, columns = [] }) {
871
- if (Array.isArray(rows.at(0)) && typeof columns.at(0) === "object") {
872
- throw new TypeError(
873
- "Column can`t be object when rows are primitive values"
874
- );
875
- }
876
- return rows.map((row) => {
877
- if (Array.isArray(row)) {
878
- return row.map(String);
879
- }
880
- const objectRow = row;
881
- if (columns.length === 0 || typeof columns.at(0) === "string") {
882
- return Object.values(objectRow).map(
883
- (value) => value == null ? "" : String(value)
884
- );
885
- }
886
- return columns.map(
887
- ({ key }) => objectRow[key] == null ? "" : String(objectRow[key])
888
- );
889
- });
890
- }
891
- function columnsToStringArray({
892
- rows,
893
- columns = []
894
- }) {
895
- const firstRow = rows.at(0);
896
- const primitiveRows = Array.isArray(firstRow);
897
- if (typeof columns.at(0) === "string" && !primitiveRows) {
898
- throw new Error("invalid union type. Caught by model parsing.");
899
- }
900
- if (columns.length === 0) {
901
- if (Array.isArray(firstRow)) {
902
- return firstRow.map((_, idx) => String(idx));
903
- }
904
- return Object.keys(firstRow);
905
- }
906
- if (typeof columns.at(0) === "string") {
907
- return columns.map(String);
908
- }
909
- const cols = columns;
910
- return cols.map(({ label, key }) => label ?? capitalize(key));
911
- }
912
- function getColumnAlignmentForKeyAndIndex(targetKey, targetIdx, columns = []) {
913
- const column = columns.at(targetIdx) ?? columns.find((col) => col.key === targetKey);
914
- if (typeof column === "string") {
915
- return column;
916
- } else if (typeof column === "object") {
917
- return column.align ?? "center";
918
- } else {
919
- return "center";
920
- }
921
- }
922
- function getColumnAlignmentForIndex(targetIdx, columns = []) {
923
- const column = columns.at(targetIdx);
924
- if (column == null) {
925
- return "center";
926
- } else if (typeof column === "string") {
927
- return column;
928
- } else if (typeof column === "object") {
929
- return column.align ?? "center";
930
- } else {
931
- return "center";
932
- }
933
- }
934
- function getColumnAlignments(tableData) {
935
- const { rows, columns = [] } = tableData;
936
- if (rows.at(0) == null) {
937
- throw new Error("first row can`t be undefined.");
938
- }
939
- if (Array.isArray(rows.at(0))) {
940
- const firstPrimitiveRow = rows.at(0);
941
- return Array.from({ length: firstPrimitiveRow.length }).map(
942
- (_, idx) => getColumnAlignmentForIndex(idx, columns)
943
- );
944
- }
945
- const biggestRow = [...rows].sort((a, b) => Object.keys(a).length - Object.keys(b).length).at(-1);
946
- if (columns.length > 0) {
947
- return columns.map(
948
- (column, idx) => typeof column === "string" ? column : getColumnAlignmentForKeyAndIndex(
949
- column.key,
950
- idx,
951
- columns
952
- )
953
- );
954
- }
955
- return Object.keys(biggestRow ?? {}).map((_) => "center");
956
- }
957
-
958
- // packages/utils/src/lib/text-formats/html/table.ts
959
- function wrap(elem, content) {
960
- return `<${elem}>${content}</${elem}>${NEW_LINE}`;
961
- }
962
- function wrapRow(content) {
963
- const elem = "tr";
964
- return `<${elem}>${NEW_LINE}${content}</${elem}>${NEW_LINE}`;
965
- }
966
- function table(tableData) {
967
- if (tableData.rows.length === 0) {
968
- throw new Error("Data can't be empty");
969
- }
970
- const tableHeaderCols = columnsToStringArray(tableData).map((s) => wrap("th", s)).join("");
971
- const tableHeaderRow = wrapRow(tableHeaderCols);
972
- const tableBody = rowToStringArray(tableData).map((arr) => {
973
- const columns = arr.map((s) => wrap("td", s)).join("");
974
- return wrapRow(columns);
975
- }).join("");
976
- return wrap("table", `${NEW_LINE}${tableHeaderRow}${tableBody}`);
977
- }
978
-
979
- // packages/utils/src/lib/text-formats/md/font-style.ts
980
- var boldWrap = "**";
981
- function bold2(text) {
982
- return `${boldWrap}${text}${boldWrap}`;
983
- }
984
- var italicWrap = "_";
985
- function italic2(text) {
986
- return `${italicWrap}${text}${italicWrap}`;
987
- }
988
- var strikeThroughWrap = "~";
989
- function strikeThrough(text) {
990
- return `${strikeThroughWrap}${text}${strikeThroughWrap}`;
991
- }
992
- var codeWrap = "`";
993
- function code2(text) {
994
- return `${codeWrap}${text}${codeWrap}`;
995
- }
996
-
997
- // packages/utils/src/lib/text-formats/md/headline.ts
998
- function headline(text, hierarchy = 1) {
999
- return `${"#".repeat(hierarchy)} ${text}${NEW_LINE}`;
1000
- }
1001
- function h(text, hierarchy = 1) {
1002
- return headline(text, hierarchy);
1003
- }
1004
- function h1(text) {
1005
- return headline(text, 1);
1006
- }
1007
- function h2(text) {
1008
- return headline(text, 2);
1009
- }
1010
- function h3(text) {
1011
- return headline(text, 3);
1012
- }
1013
- function h4(text) {
1014
- return headline(text, 4);
1015
- }
1016
- function h5(text) {
1017
- return headline(text, 5);
1018
- }
1019
- function h6(text) {
1020
- return headline(text, 6);
1021
- }
1022
-
1023
- // packages/utils/src/lib/text-formats/md/image.ts
1024
- function image(src, alt) {
1025
- return `![${alt}](${src})`;
1026
- }
1027
-
1028
- // packages/utils/src/lib/text-formats/md/link.ts
1029
- function link2(href, text) {
1030
- return `[${text || href}](${href})`;
1031
- }
1032
-
1033
- // packages/utils/src/lib/text-formats/md/list.ts
1034
- function li(text, order = "unordered") {
1035
- const style = order === "unordered" ? "-" : "- [ ]";
1036
- return `${style} ${text}`;
1037
- }
1038
- function indentation(text, level = 1) {
1039
- return `${TAB.repeat(level)}${text}`;
1040
- }
1041
-
1042
- // packages/utils/src/lib/text-formats/md/paragraphs.ts
1043
- function paragraphs(...sections) {
1044
- return sections.filter(Boolean).join(`${NEW_LINE}${NEW_LINE}`);
1045
- }
1046
-
1047
- // packages/utils/src/lib/text-formats/md/section.ts
1048
- function section(...contents) {
1049
- return `${lines(...contents)}${NEW_LINE}`;
1050
- }
1051
- function lines(...contents) {
1052
- const filteredContent = contents.filter(
1053
- (value) => value != null && value !== "" && value !== false
1054
- );
1055
- return `${filteredContent.join(NEW_LINE)}`;
1056
- }
1057
-
1058
- // packages/utils/src/lib/text-formats/md/table.ts
1059
- var alignString = /* @__PURE__ */ new Map([
1060
- ["left", ":--"],
1061
- ["center", ":--:"],
1062
- ["right", "--:"]
1063
- ]);
1064
- function tableRow(rows) {
1065
- return `|${rows.join("|")}|`;
1066
- }
1067
- function table2(data) {
1068
- if (data.rows.length === 0) {
1069
- throw new Error("Data can't be empty");
1070
- }
1071
- const alignmentRow = getColumnAlignments(data).map(
1072
- (s) => alignString.get(s) ?? String(alignString.get("center"))
1073
- );
1074
- return section(
1075
- `${lines(
1076
- tableRow(columnsToStringArray(data)),
1077
- tableRow(alignmentRow),
1078
- ...rowToStringArray(data).map(tableRow)
1079
- )}`
1080
- );
1081
- }
1082
-
1083
- // packages/utils/src/lib/text-formats/index.ts
1084
- var md = {
1085
- bold: bold2,
1086
- italic: italic2,
1087
- strikeThrough,
1088
- code: code2,
1089
- link: link2,
1090
- image,
1091
- headline,
1092
- h,
1093
- h1,
1094
- h2,
1095
- h3,
1096
- h4,
1097
- h5,
1098
- h6,
1099
- indentation,
1100
- lines,
1101
- li,
1102
- section,
1103
- paragraphs,
1104
- table: table2
1105
- };
1106
- var html = {
1107
- bold,
1108
- italic,
1109
- code,
1110
- link,
1111
- details,
1112
- table
1113
- };
1114
-
1115
- // packages/utils/src/lib/reports/utils.ts
1116
- var { image: image2, bold: boldMd } = md;
1117
- function calcDuration(start, stop) {
1118
- return Math.round((stop ?? performance.now()) - start);
1119
- }
1120
-
1121
- // packages/utils/src/lib/execute-process.ts
1122
- var ProcessError = class extends Error {
1123
- code;
1124
- stderr;
1125
- stdout;
1126
- constructor(result) {
1127
- super(result.stderr);
1128
- this.code = result.code;
1129
- this.stderr = result.stderr;
1130
- this.stdout = result.stdout;
1131
- }
1132
- };
1133
- function executeProcess(cfg) {
1134
- const { observer, cwd, command, args, ignoreExitCode = false } = cfg;
1135
- const { onStdout, onError, onComplete } = observer ?? {};
1136
- const date = (/* @__PURE__ */ new Date()).toISOString();
1137
- const start = performance.now();
1138
- return new Promise((resolve, reject) => {
1139
- const process2 = spawn(command, args, { cwd, shell: true });
1140
- let stdout = "";
1141
- let stderr = "";
1142
- process2.stdout.on("data", (data) => {
1143
- stdout += String(data);
1144
- onStdout?.(String(data));
1145
- });
1146
- process2.stderr.on("data", (data) => {
1147
- stderr += String(data);
1148
- });
1149
- process2.on("error", (err) => {
1150
- stderr += err.toString();
1151
- });
1152
- process2.on("close", (code3) => {
1153
- const timings = { date, duration: calcDuration(start) };
1154
- if (code3 === 0 || ignoreExitCode) {
1155
- onComplete?.();
1156
- resolve({ code: code3, stdout, stderr, ...timings });
1157
- } else {
1158
- const errorMsg = new ProcessError({ code: code3, stdout, stderr, ...timings });
1159
- onError?.(errorMsg);
1160
- reject(errorMsg);
1161
- }
1162
- });
1163
- });
1164
- }
1165
-
1166
- // packages/utils/src/lib/git/git.ts
1167
- import { simpleGit } from "simple-git";
1168
889
 
1169
890
  // packages/utils/src/lib/git/git.commits-and-tags.ts
1170
891
  import { simpleGit as simpleGit2 } from "simple-git";
@@ -1173,34 +894,32 @@ import { simpleGit as simpleGit2 } from "simple-git";
1173
894
  import { rcompare, valid } from "semver";
1174
895
 
1175
896
  // packages/utils/src/lib/progress.ts
1176
- import chalk3 from "chalk";
897
+ import { black, bold as bold2, gray as gray2, green } from "ansis";
1177
898
  import { MultiProgressBars } from "multi-progress-bars";
1178
899
 
900
+ // packages/utils/src/lib/reports/generate-md-report.ts
901
+ import { MarkdownDocument as MarkdownDocument3, md as md4 } from "build-md";
902
+
1179
903
  // packages/utils/src/lib/reports/formatting.ts
1180
- var { headline: headline2, lines: lines2, link: link3, section: section2, table: table3 } = md;
904
+ import {
905
+ MarkdownDocument,
906
+ md as md2
907
+ } from "build-md";
1181
908
 
1182
909
  // packages/utils/src/lib/reports/generate-md-report-categoy-section.ts
1183
- var { link: link4, section: section3, h2: h22, lines: lines3, li: li2, bold: boldMd2, h3: h32, indentation: indentation2 } = md;
1184
-
1185
- // packages/utils/src/lib/reports/generate-md-report.ts
1186
- var { h1: h12, h2: h23, h3: h33, lines: lines4, link: link5, section: section4, code: codeMd } = md;
1187
- var { bold: boldHtml, details: details2 } = html;
910
+ import { MarkdownDocument as MarkdownDocument2, md as md3 } from "build-md";
1188
911
 
1189
912
  // packages/utils/src/lib/reports/generate-md-reports-diff.ts
1190
- var {
1191
- h1: h13,
1192
- h2: h24,
1193
- lines: lines5,
1194
- link: link6,
1195
- bold: boldMd3,
1196
- italic: italicMd,
1197
- table: table4,
1198
- section: section5
1199
- } = md;
1200
- var { details: details3 } = html;
913
+ import {
914
+ MarkdownDocument as MarkdownDocument5,
915
+ md as md6
916
+ } from "build-md";
917
+
918
+ // packages/utils/src/lib/reports/generate-md-reports-diff-utils.ts
919
+ import { MarkdownDocument as MarkdownDocument4, md as md5 } from "build-md";
1201
920
 
1202
921
  // packages/utils/src/lib/reports/log-stdout-summary.ts
1203
- import chalk4 from "chalk";
922
+ import { bold as bold4, cyan, cyanBright, green as green2, red } from "ansis";
1204
923
 
1205
924
  // packages/plugin-js-packages/src/lib/config.ts
1206
925
  import { z as z16 } from "zod";
@@ -1256,9 +975,7 @@ var jsPackagesPluginConfigSchema = z16.object({
1256
975
  checks: z16.array(packageCommandSchema, {
1257
976
  description: "Package manager commands to be run. Defaults to both audit and outdated."
1258
977
  }).min(1).default(["audit", "outdated"]),
1259
- packageManager: packageManagerIdSchema.describe(
1260
- "Package manager to be used."
1261
- ),
978
+ packageManager: packageManagerIdSchema.describe("Package manager to be used.").optional(),
1262
979
  dependencyGroups: z16.array(dependencyGroupSchema).min(1).default(["prod", "dev"]),
1263
980
  auditLevelMapping: z16.record(packageAuditLevelSchema, issueSeveritySchema, {
1264
981
  description: "Mapping of audit levels to issue severity. Custom mapping or overrides may be entered manually, otherwise has a default preset."
@@ -1787,6 +1504,9 @@ var packageManagers = {
1787
1504
  pnpm: pnpmPackageManager
1788
1505
  };
1789
1506
 
1507
+ // packages/plugin-js-packages/src/lib/runner/audit/transform.ts
1508
+ import { md as md7 } from "build-md";
1509
+
1790
1510
  // packages/plugin-js-packages/src/lib/runner/audit/constants.ts
1791
1511
  var auditScoreModifiers = {
1792
1512
  critical: 1,
@@ -1837,14 +1557,16 @@ function vulnerabilitiesToIssues(vulnerabilities, auditLevelMapping) {
1837
1557
  return [];
1838
1558
  }
1839
1559
  return vulnerabilities.map((detail) => {
1840
- const versionRange = detail.versionRange === "*" ? "**all** versions" : `versions **${detail.versionRange}**`;
1841
- const directDependency = typeof detail.directDependency === "string" && detail.directDependency !== "" ? `\`${detail.directDependency}\`` : "";
1842
- const depHierarchy = directDependency === "" ? `\`${detail.name}\` dependency` : `${apostrophize(directDependency)} dependency \`${detail.name}\``;
1843
- const vulnerabilitySummary = `has a **${detail.severity}** vulnerability in ${versionRange}.`;
1560
+ const versionRange = detail.versionRange === "*" ? md7`${md7.bold("all")} versions` : md7`versions ${md7.bold(detail.versionRange)}`;
1561
+ const directDependency = typeof detail.directDependency === "string" && detail.directDependency !== "" ? md7.code(detail.directDependency) : "";
1562
+ const depHierarchy = directDependency ? md7`${directDependency}'s dependency ${md7.code(detail.name)}` : md7`${md7.code(detail.name)} dependency`;
1563
+ const vulnerabilitySummary = md7`has a ${md7.bold(
1564
+ detail.severity
1565
+ )} vulnerability in ${versionRange}.`;
1844
1566
  const fixInfo = detail.fixInformation ? ` ${detail.fixInformation}` : "";
1845
- const additionalInfo = detail.title != null && detail.url != null ? ` More information: [${detail.title}](${detail.url})` : "";
1567
+ const additionalInfo = detail.title != null && detail.url != null ? md7` More information: ${md7.link(detail.url, detail.title)}` : "";
1846
1568
  return {
1847
- message: `${depHierarchy} ${vulnerabilitySummary}${fixInfo}${additionalInfo}`,
1569
+ message: md7`${depHierarchy} ${vulnerabilitySummary}${fixInfo}${additionalInfo}`.toString(),
1848
1570
  severity: auditLevelMapping[detail.severity]
1849
1571
  };
1850
1572
  });
@@ -1861,6 +1583,7 @@ var PLUGIN_CONFIG_PATH = join2(
1861
1583
  );
1862
1584
 
1863
1585
  // packages/plugin-js-packages/src/lib/runner/outdated/transform.ts
1586
+ import { md as md8 } from "build-md";
1864
1587
  import { clean, diff, neq } from "semver";
1865
1588
 
1866
1589
  // packages/plugin-js-packages/src/lib/runner/outdated/constants.ts
@@ -1931,9 +1654,11 @@ function outdatedToIssues(dependencies) {
1931
1654
  return dependencies.map((dep) => {
1932
1655
  const { name, current, latest, url } = dep;
1933
1656
  const outdatedLevel = diff(current, latest);
1934
- const packageReference = url == null ? `\`${name}\`` : `[\`${name}\`](${url})`;
1657
+ const packageReference = url == null ? md8.code(name) : md8.link(url, md8.code(name));
1935
1658
  return {
1936
- message: `Package ${packageReference} requires a **${outdatedLevel}** update from **${current}** to **${latest}**.`,
1659
+ message: md8`Package ${packageReference} requires a ${md8.bold(
1660
+ outdatedLevel
1661
+ )} update from ${md8.bold(current)} to ${md8.bold(latest)}.`.toString(),
1937
1662
  severity: outdatedSeverity[outdatedLevel]
1938
1663
  };
1939
1664
  });