@uapkg/diagnostics-format 1.1.8 → 1.1.9

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 (133) hide show
  1. package/dist/contracts/FormatterTypes.d.ts +21 -0
  2. package/dist/contracts/FormatterTypes.d.ts.map +1 -0
  3. package/dist/contracts/FormatterTypes.js +2 -0
  4. package/dist/contracts/FormatterTypes.js.map +1 -0
  5. package/dist/defaults/defaultFormatters.d.ts +6 -0
  6. package/dist/defaults/defaultFormatters.d.ts.map +1 -0
  7. package/dist/defaults/defaultFormatters.js +24 -0
  8. package/dist/defaults/defaultFormatters.js.map +1 -0
  9. package/dist/formatters/PlainTextFormatter.d.ts +9 -0
  10. package/dist/formatters/PlainTextFormatter.d.ts.map +1 -0
  11. package/dist/formatters/PlainTextFormatter.js +15 -0
  12. package/dist/formatters/PlainTextFormatter.js.map +1 -0
  13. package/dist/formatters/config/configFormatters.d.ts +3 -0
  14. package/dist/formatters/config/configFormatters.d.ts.map +1 -0
  15. package/dist/formatters/config/configFormatters.js +68 -0
  16. package/dist/formatters/config/configFormatters.js.map +1 -0
  17. package/dist/formatters/installer/installerFormatters.d.ts +3 -0
  18. package/dist/formatters/installer/installerFormatters.d.ts.map +1 -0
  19. package/dist/formatters/installer/installerFormatters.js +63 -0
  20. package/dist/formatters/installer/installerFormatters.js.map +1 -0
  21. package/dist/formatters/manifest/manifestFormatters.d.ts +3 -0
  22. package/dist/formatters/manifest/manifestFormatters.d.ts.map +1 -0
  23. package/dist/formatters/manifest/manifestFormatters.js +57 -0
  24. package/dist/formatters/manifest/manifestFormatters.js.map +1 -0
  25. package/dist/formatters/pack/packFormatters.d.ts +3 -0
  26. package/dist/formatters/pack/packFormatters.d.ts.map +1 -0
  27. package/dist/formatters/pack/packFormatters.js +12 -0
  28. package/dist/formatters/pack/packFormatters.js.map +1 -0
  29. package/dist/formatters/postinstall/postinstallFormatters.d.ts +3 -0
  30. package/dist/formatters/postinstall/postinstallFormatters.d.ts.map +1 -0
  31. package/dist/formatters/postinstall/postinstallFormatters.js +50 -0
  32. package/dist/formatters/postinstall/postinstallFormatters.js.map +1 -0
  33. package/dist/formatters/registry/registryFormatters.d.ts +3 -0
  34. package/dist/formatters/registry/registryFormatters.d.ts.map +1 -0
  35. package/dist/formatters/registry/registryFormatters.js +42 -0
  36. package/dist/formatters/registry/registryFormatters.js.map +1 -0
  37. package/dist/formatters/resolver/resolverFormatters.d.ts +3 -0
  38. package/dist/formatters/resolver/resolverFormatters.d.ts.map +1 -0
  39. package/dist/formatters/resolver/resolverFormatters.js +24 -0
  40. package/dist/formatters/resolver/resolverFormatters.js.map +1 -0
  41. package/dist/formatters/safety/safetyFormatters.d.ts +3 -0
  42. package/dist/formatters/safety/safetyFormatters.d.ts.map +1 -0
  43. package/dist/formatters/safety/safetyFormatters.js +34 -0
  44. package/dist/formatters/safety/safetyFormatters.js.map +1 -0
  45. package/dist/formatters/spec/specFormatters.d.ts +3 -0
  46. package/dist/formatters/spec/specFormatters.d.ts.map +1 -0
  47. package/dist/formatters/spec/specFormatters.js +27 -0
  48. package/dist/formatters/spec/specFormatters.js.map +1 -0
  49. package/dist/index.d.ts +13 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +15 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/ink/components/configInkComponents.d.ts +3 -0
  54. package/dist/ink/components/configInkComponents.d.ts.map +1 -0
  55. package/dist/ink/components/configInkComponents.js +30 -0
  56. package/dist/ink/components/configInkComponents.js.map +1 -0
  57. package/dist/ink/components/installerInkComponents.d.ts +3 -0
  58. package/dist/ink/components/installerInkComponents.d.ts.map +1 -0
  59. package/dist/ink/components/installerInkComponents.js +40 -0
  60. package/dist/ink/components/installerInkComponents.js.map +1 -0
  61. package/dist/ink/components/manifestInkComponents.d.ts +3 -0
  62. package/dist/ink/components/manifestInkComponents.d.ts.map +1 -0
  63. package/dist/ink/components/manifestInkComponents.js +56 -0
  64. package/dist/ink/components/manifestInkComponents.js.map +1 -0
  65. package/dist/ink/components/packInkComponents.d.ts +3 -0
  66. package/dist/ink/components/packInkComponents.d.ts.map +1 -0
  67. package/dist/ink/components/packInkComponents.js +10 -0
  68. package/dist/ink/components/packInkComponents.js.map +1 -0
  69. package/dist/ink/components/postinstallInkComponents.d.ts +3 -0
  70. package/dist/ink/components/postinstallInkComponents.d.ts.map +1 -0
  71. package/dist/ink/components/postinstallInkComponents.js +35 -0
  72. package/dist/ink/components/postinstallInkComponents.js.map +1 -0
  73. package/dist/ink/components/registryInkComponents.d.ts +3 -0
  74. package/dist/ink/components/registryInkComponents.d.ts.map +1 -0
  75. package/dist/ink/components/registryInkComponents.js +40 -0
  76. package/dist/ink/components/registryInkComponents.js.map +1 -0
  77. package/dist/ink/components/resolverInkComponents.d.ts +3 -0
  78. package/dist/ink/components/resolverInkComponents.d.ts.map +1 -0
  79. package/dist/ink/components/resolverInkComponents.js +30 -0
  80. package/dist/ink/components/resolverInkComponents.js.map +1 -0
  81. package/dist/ink/components/safetyInkComponents.d.ts +3 -0
  82. package/dist/ink/components/safetyInkComponents.d.ts.map +1 -0
  83. package/dist/ink/components/safetyInkComponents.js +20 -0
  84. package/dist/ink/components/safetyInkComponents.js.map +1 -0
  85. package/dist/ink/components/specInkComponents.d.ts +3 -0
  86. package/dist/ink/components/specInkComponents.d.ts.map +1 -0
  87. package/dist/ink/components/specInkComponents.js +20 -0
  88. package/dist/ink/components/specInkComponents.js.map +1 -0
  89. package/dist/ink/contracts/InkTypes.d.ts +30 -0
  90. package/dist/ink/contracts/InkTypes.d.ts.map +1 -0
  91. package/dist/ink/contracts/InkTypes.js +2 -0
  92. package/dist/ink/contracts/InkTypes.js.map +1 -0
  93. package/dist/ink/defaults/defaultInkComponents.d.ts +13 -0
  94. package/dist/ink/defaults/defaultInkComponents.d.ts.map +1 -0
  95. package/dist/ink/defaults/defaultInkComponents.js +31 -0
  96. package/dist/ink/defaults/defaultInkComponents.js.map +1 -0
  97. package/dist/ink/index.d.ts +16 -0
  98. package/dist/ink/index.d.ts.map +1 -0
  99. package/dist/ink/index.js +28 -0
  100. package/dist/ink/index.js.map +1 -0
  101. package/dist/ink/primitives/HintLine.d.ts +10 -0
  102. package/dist/ink/primitives/HintLine.d.ts.map +1 -0
  103. package/dist/ink/primitives/HintLine.js +12 -0
  104. package/dist/ink/primitives/HintLine.js.map +1 -0
  105. package/dist/ink/primitives/PlainTextBody.d.ts +9 -0
  106. package/dist/ink/primitives/PlainTextBody.d.ts.map +1 -0
  107. package/dist/ink/primitives/PlainTextBody.js +11 -0
  108. package/dist/ink/primitives/PlainTextBody.js.map +1 -0
  109. package/dist/ink/primitives/SeverityBadge.d.ts +11 -0
  110. package/dist/ink/primitives/SeverityBadge.d.ts.map +1 -0
  111. package/dist/ink/primitives/SeverityBadge.js +16 -0
  112. package/dist/ink/primitives/SeverityBadge.js.map +1 -0
  113. package/dist/ink/registry/DiagnosticInkRegistry.d.ts +22 -0
  114. package/dist/ink/registry/DiagnosticInkRegistry.d.ts.map +1 -0
  115. package/dist/ink/registry/DiagnosticInkRegistry.js +33 -0
  116. package/dist/ink/registry/DiagnosticInkRegistry.js.map +1 -0
  117. package/dist/ink/views/DiagnosticView.d.ts +19 -0
  118. package/dist/ink/views/DiagnosticView.d.ts.map +1 -0
  119. package/dist/ink/views/DiagnosticView.js +20 -0
  120. package/dist/ink/views/DiagnosticView.js.map +1 -0
  121. package/dist/ink/views/DiagnosticsListView.d.ts +14 -0
  122. package/dist/ink/views/DiagnosticsListView.d.ts.map +1 -0
  123. package/dist/ink/views/DiagnosticsListView.js +19 -0
  124. package/dist/ink/views/DiagnosticsListView.js.map +1 -0
  125. package/dist/registry/FormatterRegistry.d.ts +24 -0
  126. package/dist/registry/FormatterRegistry.d.ts.map +1 -0
  127. package/dist/registry/FormatterRegistry.js +44 -0
  128. package/dist/registry/FormatterRegistry.js.map +1 -0
  129. package/dist/utils/indent.d.ts +5 -0
  130. package/dist/utils/indent.d.ts.map +1 -0
  131. package/dist/utils/indent.js +13 -0
  132. package/dist/utils/indent.js.map +1 -0
  133. package/package.json +2 -2
@@ -0,0 +1,16 @@
1
+ export { installerInkComponents } from './components/installerInkComponents.js';
2
+ export { manifestInkComponents } from './components/manifestInkComponents.js';
3
+ export { postinstallInkComponents } from './components/postinstallInkComponents.js';
4
+ export { registryInkComponents } from './components/registryInkComponents.js';
5
+ export { resolverInkComponents } from './components/resolverInkComponents.js';
6
+ export { safetyInkComponents } from './components/safetyInkComponents.js';
7
+ export { specInkComponents } from './components/specInkComponents.js';
8
+ export type { DiagnosticBodyComponent, DiagnosticBodyProps, DiagnosticInkComponentMap, IDiagnosticInkRegistry, } from './contracts/InkTypes.js';
9
+ export { defaultInkComponents } from './defaults/defaultInkComponents.js';
10
+ export { HintLine } from './primitives/HintLine.js';
11
+ export { PlainTextBody } from './primitives/PlainTextBody.js';
12
+ export { SeverityBadge } from './primitives/SeverityBadge.js';
13
+ export { createInkRegistry, DiagnosticInkRegistry } from './registry/DiagnosticInkRegistry.js';
14
+ export { DiagnosticsListView, type DiagnosticsListViewProps, } from './views/DiagnosticsListView.js';
15
+ export { DiagnosticView, type DiagnosticViewProps } from './views/DiagnosticView.js';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ink/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,YAAY,EACV,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC/F,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,28 @@
1
+ // ---------------------------------------------------------------------------
2
+ // @uapkg/diagnostics-format — Ink surface
3
+ //
4
+ // This is the "standardized component factory" subpath every consumer should
5
+ // import from when they want to render diagnostics as Ink elements.
6
+ //
7
+ // Plain-data helpers (formatters returning strings) remain exported from the
8
+ // package root; Ink helpers live here so consumers that don't ship a TTY UI
9
+ // pay zero React/Ink cost.
10
+ // ---------------------------------------------------------------------------
11
+ // Family component maps — exported individually so consumers can cherry-pick.
12
+ export { installerInkComponents } from './components/installerInkComponents.js';
13
+ export { manifestInkComponents } from './components/manifestInkComponents.js';
14
+ export { postinstallInkComponents } from './components/postinstallInkComponents.js';
15
+ export { registryInkComponents } from './components/registryInkComponents.js';
16
+ export { resolverInkComponents } from './components/resolverInkComponents.js';
17
+ export { safetyInkComponents } from './components/safetyInkComponents.js';
18
+ export { specInkComponents } from './components/specInkComponents.js';
19
+ export { defaultInkComponents } from './defaults/defaultInkComponents.js';
20
+ // Primitives.
21
+ export { HintLine } from './primitives/HintLine.js';
22
+ export { PlainTextBody } from './primitives/PlainTextBody.js';
23
+ export { SeverityBadge } from './primitives/SeverityBadge.js';
24
+ export { createInkRegistry, DiagnosticInkRegistry } from './registry/DiagnosticInkRegistry.js';
25
+ export { DiagnosticsListView, } from './views/DiagnosticsListView.js';
26
+ // Views.
27
+ export { DiagnosticView } from './views/DiagnosticView.js';
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ink/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0CAA0C;AAC1C,EAAE;AACF,6EAA6E;AAC7E,oEAAoE;AACpE,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,2BAA2B;AAC3B,8EAA8E;AAE9E,8EAA8E;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAOtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,cAAc;AACd,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC/F,OAAO,EACL,mBAAmB,GAEpB,MAAM,gCAAgC,CAAC;AACxC,SAAS;AACT,OAAO,EAAE,cAAc,EAA4B,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ReactElement } from 'react';
2
+ export interface HintLineProps {
3
+ readonly hint: string;
4
+ }
5
+ /**
6
+ * Bottom-of-diagnostic actionable hint. Always indented and tinted so it
7
+ * stands apart from the body. Renders nothing when the hint is empty.
8
+ */
9
+ export declare function HintLine({ hint }: HintLineProps): ReactElement | null;
10
+ //# sourceMappingURL=HintLine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HintLine.d.ts","sourceRoot":"","sources":["../../../src/ink/primitives/HintLine.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,aAAa,GAAG,YAAY,GAAG,IAAI,CAQrE"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from 'ink';
3
+ /**
4
+ * Bottom-of-diagnostic actionable hint. Always indented and tinted so it
5
+ * stands apart from the body. Renders nothing when the hint is empty.
6
+ */
7
+ export function HintLine({ hint }) {
8
+ if (!hint || hint.length === 0)
9
+ return null;
10
+ return (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { color: "magentaBright", children: "\u2192 " }), _jsx(Text, { color: "white", children: hint })] }));
11
+ }
12
+ //# sourceMappingURL=HintLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HintLine.js","sourceRoot":"","sources":["../../../src/ink/primitives/HintLine.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAOhC;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAiB;IAC9C,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,OAAO,CACL,MAAC,GAAG,IAAC,UAAU,EAAE,CAAC,aAChB,KAAC,IAAI,IAAC,KAAK,EAAC,eAAe,wBAAU,EACrC,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,IAAI,GAAQ,IAC7B,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { DiagnosticBodyProps } from '../contracts/InkTypes.js';
3
+ /**
4
+ * Fallback body used when no family-specific component is registered for a
5
+ * diagnostic code. Writes the diagnostic message verbatim so the Ink render
6
+ * stays in structural parity with the plain-text formatter.
7
+ */
8
+ export declare function PlainTextBody({ diagnostic }: DiagnosticBodyProps): ReactElement;
9
+ //# sourceMappingURL=PlainTextBody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlainTextBody.d.ts","sourceRoot":"","sources":["../../../src/ink/primitives/PlainTextBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,UAAU,EAAE,EAAE,mBAAmB,GAAG,YAAY,CAE/E"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Text } from 'ink';
3
+ /**
4
+ * Fallback body used when no family-specific component is registered for a
5
+ * diagnostic code. Writes the diagnostic message verbatim so the Ink render
6
+ * stays in structural parity with the plain-text formatter.
7
+ */
8
+ export function PlainTextBody({ diagnostic }) {
9
+ return _jsx(Text, { children: diagnostic.message });
10
+ }
11
+ //# sourceMappingURL=PlainTextBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlainTextBody.js","sourceRoot":"","sources":["../../../src/ink/primitives/PlainTextBody.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAI3B;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,UAAU,EAAuB;IAC/D,OAAO,KAAC,IAAI,cAAE,UAAU,CAAC,OAAO,GAAQ,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { Diagnostic } from '@uapkg/diagnostics';
2
+ import type { ReactElement } from 'react';
3
+ export interface SeverityBadgeProps {
4
+ readonly level: Diagnostic['level'];
5
+ }
6
+ /**
7
+ * A single colored severity icon. Pure presentation — no diagnostic-specific
8
+ * logic lives here. Used as a prefix by {@link DiagnosticView}.
9
+ */
10
+ export declare function SeverityBadge({ level }: SeverityBadgeProps): ReactElement;
11
+ //# sourceMappingURL=SeverityBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SeverityBadge.d.ts","sourceRoot":"","sources":["../../../src/ink/primitives/SeverityBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAQ1C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,EAAE,kBAAkB,GAAG,YAAY,CAGzE"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Text } from 'ink';
3
+ const LEVEL_CONFIG = {
4
+ error: { icon: '✖', color: 'red' },
5
+ warning: { icon: '⚠', color: 'yellow' },
6
+ info: { icon: 'ℹ', color: 'cyan' },
7
+ };
8
+ /**
9
+ * A single colored severity icon. Pure presentation — no diagnostic-specific
10
+ * logic lives here. Used as a prefix by {@link DiagnosticView}.
11
+ */
12
+ export function SeverityBadge({ level }) {
13
+ const { icon, color } = LEVEL_CONFIG[level];
14
+ return _jsx(Text, { color: color, children: icon });
15
+ }
16
+ //# sourceMappingURL=SeverityBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SeverityBadge.js","sourceRoot":"","sources":["../../../src/ink/primitives/SeverityBadge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,MAAM,YAAY,GAAmF;IACnG,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE;IAClC,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE;IACvC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE;CACnC,CAAC;AAMF;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAsB;IACzD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAC5C,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,YAAG,IAAI,GAAQ,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { DiagnosticCode } from '@uapkg/diagnostics';
2
+ import type { DiagnosticBodyComponent, DiagnosticInkComponentMap, IDiagnosticInkRegistry } from '../contracts/InkTypes.js';
3
+ /**
4
+ * Lookup service for Ink diagnostic-body components.
5
+ *
6
+ * - One-shot register: seed with a map at construction.
7
+ * - Extensible: callers can `register(code, component)` for bespoke overrides.
8
+ *
9
+ * The registry only *resolves* components — the composing {@link DiagnosticView}
10
+ * is responsible for fallback behavior when `resolve()` returns undefined.
11
+ */
12
+ export declare class DiagnosticInkRegistry implements IDiagnosticInkRegistry {
13
+ private readonly components;
14
+ constructor(seed?: DiagnosticInkComponentMap);
15
+ register(code: DiagnosticCode, component: DiagnosticBodyComponent): void;
16
+ resolve(code: DiagnosticCode): DiagnosticBodyComponent | undefined;
17
+ }
18
+ /**
19
+ * Factory helper so consumers don't have to `new` the class directly.
20
+ */
21
+ export declare function createInkRegistry(seed?: DiagnosticInkComponentMap): DiagnosticInkRegistry;
22
+ //# sourceMappingURL=DiagnosticInkRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagnosticInkRegistry.d.ts","sourceRoot":"","sources":["../../../src/ink/registry/DiagnosticInkRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,YAAW,sBAAsB;IAClE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+C;gBAEvD,IAAI,GAAE,yBAA8B;IAQhD,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,uBAAuB,GAAG,IAAI;IAIxE,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,uBAAuB,GAAG,SAAS;CAG1E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,yBAAyB,GAAG,qBAAqB,CAEzF"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Lookup service for Ink diagnostic-body components.
3
+ *
4
+ * - One-shot register: seed with a map at construction.
5
+ * - Extensible: callers can `register(code, component)` for bespoke overrides.
6
+ *
7
+ * The registry only *resolves* components — the composing {@link DiagnosticView}
8
+ * is responsible for fallback behavior when `resolve()` returns undefined.
9
+ */
10
+ export class DiagnosticInkRegistry {
11
+ components;
12
+ constructor(seed = {}) {
13
+ this.components = new Map();
14
+ for (const key of Object.keys(seed)) {
15
+ const component = seed[key];
16
+ if (component)
17
+ this.components.set(key, component);
18
+ }
19
+ }
20
+ register(code, component) {
21
+ this.components.set(code, component);
22
+ }
23
+ resolve(code) {
24
+ return this.components.get(code);
25
+ }
26
+ }
27
+ /**
28
+ * Factory helper so consumers don't have to `new` the class directly.
29
+ */
30
+ export function createInkRegistry(seed) {
31
+ return new DiagnosticInkRegistry(seed);
32
+ }
33
+ //# sourceMappingURL=DiagnosticInkRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagnosticInkRegistry.js","sourceRoot":"","sources":["../../../src/ink/registry/DiagnosticInkRegistry.ts"],"names":[],"mappings":"AAOA;;;;;;;;GAQG;AACH,MAAM,OAAO,qBAAqB;IACf,UAAU,CAA+C;IAE1E,YAAmB,OAAkC,EAAE;QACrD,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAqB,EAAE,CAAC;YACxD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YAC5B,IAAI,SAAS;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAEM,QAAQ,CAAC,IAAoB,EAAE,SAAkC;QACtE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACvC,CAAC;IAEM,OAAO,CAAC,IAAoB;QACjC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAgC;IAChE,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { Diagnostic } from '@uapkg/diagnostics';
2
+ import type { ReactElement } from 'react';
3
+ import type { IDiagnosticInkRegistry } from '../contracts/InkTypes.js';
4
+ export interface DiagnosticViewProps {
5
+ readonly diagnostic: Diagnostic;
6
+ readonly registry: IDiagnosticInkRegistry;
7
+ }
8
+ /**
9
+ * Renders one diagnostic in three layers:
10
+ *
11
+ * 1. Header — severity badge + code + message.
12
+ * 2. Body — family-specific component (resolved from {@link IDiagnosticInkRegistry})
13
+ * or {@link PlainTextBody} as a safe fallback.
14
+ * 3. Hint — the `hint` field when present.
15
+ *
16
+ * This component is pure — it neither reads config nor talks to I/O.
17
+ */
18
+ export declare function DiagnosticView({ diagnostic, registry }: DiagnosticViewProps): ReactElement;
19
+ //# sourceMappingURL=DiagnosticView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagnosticView.d.ts","sourceRoot":"","sources":["../../../src/ink/views/DiagnosticView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAKvE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;CAC3C;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,mBAAmB,GAAG,YAAY,CAiB1F"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from 'ink';
3
+ import { HintLine } from '../primitives/HintLine.js';
4
+ import { PlainTextBody } from '../primitives/PlainTextBody.js';
5
+ import { SeverityBadge } from '../primitives/SeverityBadge.js';
6
+ /**
7
+ * Renders one diagnostic in three layers:
8
+ *
9
+ * 1. Header — severity badge + code + message.
10
+ * 2. Body — family-specific component (resolved from {@link IDiagnosticInkRegistry})
11
+ * or {@link PlainTextBody} as a safe fallback.
12
+ * 3. Hint — the `hint` field when present.
13
+ *
14
+ * This component is pure — it neither reads config nor talks to I/O.
15
+ */
16
+ export function DiagnosticView({ diagnostic, registry }) {
17
+ const Body = registry.resolve(diagnostic.code) ?? PlainTextBody;
18
+ return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsx(SeverityBadge, { level: diagnostic.level }), _jsx(Text, { children: " " }), _jsx(Text, { bold: true, color: "whiteBright", children: diagnostic.code })] }), _jsx(Box, { marginLeft: 2, flexDirection: "column", children: _jsx(Body, { diagnostic: diagnostic }) }), diagnostic.hint ? _jsx(HintLine, { hint: diagnostic.hint }) : null] }));
19
+ }
20
+ //# sourceMappingURL=DiagnosticView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagnosticView.js","sourceRoot":"","sources":["../../../src/ink/views/DiagnosticView.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAO/D;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAuB;IAC1E,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC;IAChE,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,aACzC,MAAC,GAAG,eACF,KAAC,aAAa,IAAC,KAAK,EAAE,UAAU,CAAC,KAAK,GAAI,EAC1C,KAAC,IAAI,oBAAS,EACd,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,aAAa,YAC3B,UAAU,CAAC,IAAI,GACX,IACH,EACN,KAAC,GAAG,IAAC,UAAU,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,YACxC,KAAC,IAAI,IAAC,UAAU,EAAE,UAAU,GAAI,GAC5B,EACL,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,QAAQ,IAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,IACzD,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Diagnostic } from '@uapkg/diagnostics';
2
+ import type { ReactElement } from 'react';
3
+ import type { IDiagnosticInkRegistry } from '../contracts/InkTypes.js';
4
+ export interface DiagnosticsListViewProps {
5
+ readonly diagnostics: readonly Diagnostic[];
6
+ readonly registry: IDiagnosticInkRegistry;
7
+ }
8
+ /**
9
+ * Renders a list of diagnostics (already pre-sorted by the caller — usually
10
+ * severity-descending). Produces nothing for an empty input so the host
11
+ * Ink tree stays quiet.
12
+ */
13
+ export declare function DiagnosticsListView({ diagnostics, registry }: DiagnosticsListViewProps): ReactElement | null;
14
+ //# sourceMappingURL=DiagnosticsListView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagnosticsListView.d.ts","sourceRoot":"","sources":["../../../src/ink/views/DiagnosticsListView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;CAC3C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,wBAAwB,GAAG,YAAY,GAAG,IAAI,CAY5G"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box } from 'ink';
3
+ import { DiagnosticView } from './DiagnosticView.js';
4
+ /**
5
+ * Renders a list of diagnostics (already pre-sorted by the caller — usually
6
+ * severity-descending). Produces nothing for an empty input so the host
7
+ * Ink tree stays quiet.
8
+ */
9
+ export function DiagnosticsListView({ diagnostics, registry }) {
10
+ if (diagnostics.length === 0)
11
+ return null;
12
+ return (_jsx(Box, { flexDirection: "column", children: diagnostics.map((d, i) => {
13
+ // Diagnostics don't carry stable ids; the (code, message, index) triple
14
+ // is stable for a one-shot static render and unique within the list.
15
+ const key = `${d.code}:${i}:${d.message.length}`;
16
+ return _jsx(DiagnosticView, { diagnostic: d, registry: registry }, key);
17
+ }) }));
18
+ }
19
+ //# sourceMappingURL=DiagnosticsListView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagnosticsListView.js","sourceRoot":"","sources":["../../../src/ink/views/DiagnosticsListView.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAOrD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAE,WAAW,EAAE,QAAQ,EAA4B;IACrF,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,CACL,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,YACxB,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACxB,wEAAwE;YACxE,qEAAqE;YACrE,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACjD,OAAO,KAAC,cAAc,IAAW,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,IAAtC,GAAG,CAAuC,CAAC;QACzE,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { Diagnostic, DiagnosticCode } from '@uapkg/diagnostics';
2
+ import type { DiagnosticFormatterFn, FormatterMap, IFormatterRegistry } from '../contracts/FormatterTypes.js';
3
+ /**
4
+ * Registry that maps diagnostic codes to formatter functions.
5
+ * Falls back to a plain-text default when no specific formatter is registered.
6
+ */
7
+ export declare class FormatterRegistry implements IFormatterRegistry {
8
+ private readonly formatters;
9
+ private readonly fallback;
10
+ constructor(fallback?: DiagnosticFormatterFn);
11
+ /** Register a formatter for a single diagnostic code. */
12
+ register(code: DiagnosticCode, formatter: DiagnosticFormatterFn): void;
13
+ /** Bulk-register multiple formatters from a partial map. */
14
+ registerAll(map: FormatterMap): void;
15
+ /** Format a single diagnostic using the registered (or fallback) formatter. */
16
+ format(diagnostic: Diagnostic): string;
17
+ /** Format an array of diagnostics, joining with newlines. */
18
+ formatAll(diagnostics: readonly Diagnostic[]): string;
19
+ }
20
+ /**
21
+ * Create a new `FormatterRegistry` optionally pre-loaded with formatters.
22
+ */
23
+ export declare function createFormatterRegistry(initial?: FormatterMap, fallback?: DiagnosticFormatterFn): FormatterRegistry;
24
+ //# sourceMappingURL=FormatterRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatterRegistry.d.ts","sourceRoot":"","sources":["../../src/registry/FormatterRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAG9G;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoD;IAC/E,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;gBAErC,QAAQ,GAAE,qBAAuC;IAI7D,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB,GAAG,IAAI;IAItE,4DAA4D;IAC5D,WAAW,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI;IAQpC,+EAA+E;IAC/E,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;IAKtC,6DAA6D;IAC7D,SAAS,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM;CAGtD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,qBAAqB,GAAG,iBAAiB,CAMnH"}
@@ -0,0 +1,44 @@
1
+ import { formatPlainText } from '../formatters/PlainTextFormatter.js';
2
+ /**
3
+ * Registry that maps diagnostic codes to formatter functions.
4
+ * Falls back to a plain-text default when no specific formatter is registered.
5
+ */
6
+ export class FormatterRegistry {
7
+ formatters = new Map();
8
+ fallback;
9
+ constructor(fallback = formatPlainText) {
10
+ this.fallback = fallback;
11
+ }
12
+ /** Register a formatter for a single diagnostic code. */
13
+ register(code, formatter) {
14
+ this.formatters.set(code, formatter);
15
+ }
16
+ /** Bulk-register multiple formatters from a partial map. */
17
+ registerAll(map) {
18
+ for (const [code, fn] of Object.entries(map)) {
19
+ if (fn) {
20
+ this.formatters.set(code, fn);
21
+ }
22
+ }
23
+ }
24
+ /** Format a single diagnostic using the registered (or fallback) formatter. */
25
+ format(diagnostic) {
26
+ const fn = this.formatters.get(diagnostic.code) ?? this.fallback;
27
+ return fn(diagnostic);
28
+ }
29
+ /** Format an array of diagnostics, joining with newlines. */
30
+ formatAll(diagnostics) {
31
+ return diagnostics.map((d) => this.format(d)).join('\n');
32
+ }
33
+ }
34
+ /**
35
+ * Create a new `FormatterRegistry` optionally pre-loaded with formatters.
36
+ */
37
+ export function createFormatterRegistry(initial, fallback) {
38
+ const registry = new FormatterRegistry(fallback);
39
+ if (initial) {
40
+ registry.registerAll(initial);
41
+ }
42
+ return registry;
43
+ }
44
+ //# sourceMappingURL=FormatterRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatterRegistry.js","sourceRoot":"","sources":["../../src/registry/FormatterRegistry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IACX,UAAU,GAAG,IAAI,GAAG,EAAyC,CAAC;IAC9D,QAAQ,CAAwB;IAEjD,YAAY,WAAkC,eAAe;QAC3D,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,yDAAyD;IACzD,QAAQ,CAAC,IAAoB,EAAE,SAAgC;QAC7D,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACvC,CAAC;IAED,4DAA4D;IAC5D,WAAW,CAAC,GAAiB;QAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7C,IAAI,EAAE,EAAE,CAAC;gBACP,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAsB,EAAE,EAAE,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;IACH,CAAC;IAED,+EAA+E;IAC/E,MAAM,CAAC,UAAsB;QAC3B,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC;QACjE,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;IAED,6DAA6D;IAC7D,SAAS,CAAC,WAAkC;QAC1C,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAsB,EAAE,QAAgC;IAC9F,MAAM,QAAQ,GAAG,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,OAAO,EAAE,CAAC;QACZ,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Indent every line of `text` by `spaces` spaces. */
2
+ export declare function indent(text: string, spaces?: number): string;
3
+ /** Format an array of items as a bulleted list. */
4
+ export declare function bulletList(items: readonly string[], bullet?: string): string;
5
+ //# sourceMappingURL=indent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indent.d.ts","sourceRoot":"","sources":["../../src/utils/indent.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,MAAM,CAMvD;AAED,mDAAmD;AACnD,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,SAAO,GAAG,MAAM,CAE1E"}
@@ -0,0 +1,13 @@
1
+ /** Indent every line of `text` by `spaces` spaces. */
2
+ export function indent(text, spaces = 2) {
3
+ const pad = ' '.repeat(spaces);
4
+ return text
5
+ .split('\n')
6
+ .map((line) => `${pad}${line}`)
7
+ .join('\n');
8
+ }
9
+ /** Format an array of items as a bulleted list. */
10
+ export function bulletList(items, bullet = '- ') {
11
+ return items.map((item) => `${bullet}${item}`).join('\n');
12
+ }
13
+ //# sourceMappingURL=indent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indent.js","sourceRoot":"","sources":["../../src/utils/indent.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE,MAAM,GAAG,CAAC;IAC7C,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,IAAI;SACR,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,IAAI,EAAE,CAAC;SAC9B,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,UAAU,CAAC,KAAwB,EAAE,MAAM,GAAG,IAAI;IAChE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uapkg/diagnostics-format",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "ink": "6.8.0",
23
23
  "react": "19.2.4",
24
- "@uapkg/diagnostics": "^1.1.8"
24
+ "@uapkg/diagnostics": "^1.1.9"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/react": "19.2.14"