@uapkg/diagnostics-format 1.2.0 → 1.3.1

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 (145) hide show
  1. package/dist/contracts/FormatterTypes.d.ts +13 -10
  2. package/dist/contracts/FormatterTypes.d.ts.map +1 -1
  3. package/dist/contracts/FormatterTypes.js +1 -2
  4. package/dist/defaults/defaultFormatters.d.ts +5 -2
  5. package/dist/defaults/defaultFormatters.d.ts.map +1 -1
  6. package/dist/defaults/defaultFormatters.js +30 -23
  7. package/dist/defaults/defaultFormatters.js.map +1 -1
  8. package/dist/formatters/PlainTextFormatter.d.ts +5 -2
  9. package/dist/formatters/PlainTextFormatter.d.ts.map +1 -1
  10. package/dist/formatters/PlainTextFormatter.js +13 -12
  11. package/dist/formatters/PlainTextFormatter.js.map +1 -1
  12. package/dist/formatters/config/configFormatters.d.ts +5 -2
  13. package/dist/formatters/config/configFormatters.d.ts.map +1 -1
  14. package/dist/formatters/config/configFormatters.js +50 -56
  15. package/dist/formatters/config/configFormatters.js.map +1 -1
  16. package/dist/formatters/installer/installerFormatters.d.ts +5 -2
  17. package/dist/formatters/installer/installerFormatters.d.ts.map +1 -1
  18. package/dist/formatters/installer/installerFormatters.js +51 -47
  19. package/dist/formatters/installer/installerFormatters.js.map +1 -1
  20. package/dist/formatters/manifest/manifestFormatters.d.ts +5 -2
  21. package/dist/formatters/manifest/manifestFormatters.d.ts.map +1 -1
  22. package/dist/formatters/manifest/manifestFormatters.js +40 -45
  23. package/dist/formatters/manifest/manifestFormatters.js.map +1 -1
  24. package/dist/formatters/pack/packFormatters.d.ts +5 -2
  25. package/dist/formatters/pack/packFormatters.d.ts.map +1 -1
  26. package/dist/formatters/pack/packFormatters.js +9 -9
  27. package/dist/formatters/pack/packFormatters.js.map +1 -1
  28. package/dist/formatters/postinstall/postinstallFormatters.d.ts +5 -2
  29. package/dist/formatters/postinstall/postinstallFormatters.d.ts.map +1 -1
  30. package/dist/formatters/postinstall/postinstallFormatters.js +35 -36
  31. package/dist/formatters/postinstall/postinstallFormatters.js.map +1 -1
  32. package/dist/formatters/publishing/publishingFormatters.d.ts +14 -0
  33. package/dist/formatters/publishing/publishingFormatters.d.ts.map +1 -0
  34. package/dist/formatters/publishing/publishingFormatters.js +45 -0
  35. package/dist/formatters/publishing/publishingFormatters.js.map +1 -0
  36. package/dist/formatters/registry/registryFormatters.d.ts +5 -2
  37. package/dist/formatters/registry/registryFormatters.d.ts.map +1 -1
  38. package/dist/formatters/registry/registryFormatters.js +33 -34
  39. package/dist/formatters/registry/registryFormatters.js.map +1 -1
  40. package/dist/formatters/registryTools/registryToolsFormatters.d.ts +5 -2
  41. package/dist/formatters/registryTools/registryToolsFormatters.d.ts.map +1 -1
  42. package/dist/formatters/registryTools/registryToolsFormatters.js +160 -135
  43. package/dist/formatters/registryTools/registryToolsFormatters.js.map +1 -1
  44. package/dist/formatters/resolver/resolverFormatters.d.ts +5 -2
  45. package/dist/formatters/resolver/resolverFormatters.d.ts.map +1 -1
  46. package/dist/formatters/resolver/resolverFormatters.js +20 -18
  47. package/dist/formatters/resolver/resolverFormatters.js.map +1 -1
  48. package/dist/formatters/safety/safetyFormatters.d.ts +5 -2
  49. package/dist/formatters/safety/safetyFormatters.d.ts.map +1 -1
  50. package/dist/formatters/safety/safetyFormatters.js +28 -26
  51. package/dist/formatters/safety/safetyFormatters.js.map +1 -1
  52. package/dist/formatters/spec/specFormatters.d.ts +5 -2
  53. package/dist/formatters/spec/specFormatters.d.ts.map +1 -1
  54. package/dist/formatters/spec/specFormatters.js +32 -19
  55. package/dist/formatters/spec/specFormatters.js.map +1 -1
  56. package/dist/index.d.ts +15 -14
  57. package/dist/index.js +15 -16
  58. package/dist/ink/components/configInkComponents.d.ts +5 -2
  59. package/dist/ink/components/configInkComponents.d.ts.map +1 -1
  60. package/dist/ink/components/configInkComponents.js +93 -18
  61. package/dist/ink/components/configInkComponents.js.map +1 -1
  62. package/dist/ink/components/installerInkComponents.d.ts +5 -2
  63. package/dist/ink/components/installerInkComponents.d.ts.map +1 -1
  64. package/dist/ink/components/installerInkComponents.js +170 -24
  65. package/dist/ink/components/installerInkComponents.js.map +1 -1
  66. package/dist/ink/components/manifestInkComponents.d.ts +5 -2
  67. package/dist/ink/components/manifestInkComponents.d.ts.map +1 -1
  68. package/dist/ink/components/manifestInkComponents.js +139 -34
  69. package/dist/ink/components/manifestInkComponents.js.map +1 -1
  70. package/dist/ink/components/packInkComponents.d.ts +5 -2
  71. package/dist/ink/components/packInkComponents.d.ts.map +1 -1
  72. package/dist/ink/components/packInkComponents.js +22 -7
  73. package/dist/ink/components/packInkComponents.js.map +1 -1
  74. package/dist/ink/components/postinstallInkComponents.d.ts +5 -2
  75. package/dist/ink/components/postinstallInkComponents.d.ts.map +1 -1
  76. package/dist/ink/components/postinstallInkComponents.js +124 -21
  77. package/dist/ink/components/postinstallInkComponents.js.map +1 -1
  78. package/dist/ink/components/publishingInkComponents.d.ts +6 -0
  79. package/dist/ink/components/publishingInkComponents.d.ts.map +1 -0
  80. package/dist/ink/components/publishingInkComponents.js +55 -0
  81. package/dist/ink/components/publishingInkComponents.js.map +1 -0
  82. package/dist/ink/components/registryInkComponents.d.ts +5 -2
  83. package/dist/ink/components/registryInkComponents.d.ts.map +1 -1
  84. package/dist/ink/components/registryInkComponents.js +109 -24
  85. package/dist/ink/components/registryInkComponents.js.map +1 -1
  86. package/dist/ink/components/resolverInkComponents.d.ts +5 -2
  87. package/dist/ink/components/resolverInkComponents.d.ts.map +1 -1
  88. package/dist/ink/components/resolverInkComponents.js +97 -18
  89. package/dist/ink/components/resolverInkComponents.js.map +1 -1
  90. package/dist/ink/components/safetyInkComponents.d.ts +5 -2
  91. package/dist/ink/components/safetyInkComponents.d.ts.map +1 -1
  92. package/dist/ink/components/safetyInkComponents.js +72 -12
  93. package/dist/ink/components/safetyInkComponents.js.map +1 -1
  94. package/dist/ink/components/specInkComponents.d.ts +5 -2
  95. package/dist/ink/components/specInkComponents.d.ts.map +1 -1
  96. package/dist/ink/components/specInkComponents.js +44 -12
  97. package/dist/ink/components/specInkComponents.js.map +1 -1
  98. package/dist/ink/contracts/InkTypes.d.ts +15 -9
  99. package/dist/ink/contracts/InkTypes.d.ts.map +1 -1
  100. package/dist/ink/contracts/InkTypes.js +1 -2
  101. package/dist/ink/defaults/defaultInkComponents.d.ts +5 -2
  102. package/dist/ink/defaults/defaultInkComponents.d.ts.map +1 -1
  103. package/dist/ink/defaults/defaultInkComponents.js +35 -28
  104. package/dist/ink/defaults/defaultInkComponents.js.map +1 -1
  105. package/dist/ink/index.d.ts +17 -16
  106. package/dist/ink/index.js +17 -28
  107. package/dist/ink/primitives/HintLine.d.ts +7 -4
  108. package/dist/ink/primitives/HintLine.d.ts.map +1 -1
  109. package/dist/ink/primitives/HintLine.js +22 -9
  110. package/dist/ink/primitives/HintLine.js.map +1 -1
  111. package/dist/ink/primitives/PlainTextBody.d.ts +6 -3
  112. package/dist/ink/primitives/PlainTextBody.d.ts.map +1 -1
  113. package/dist/ink/primitives/PlainTextBody.js +13 -8
  114. package/dist/ink/primitives/PlainTextBody.js.map +1 -1
  115. package/dist/ink/primitives/SeverityBadge.d.ts +8 -5
  116. package/dist/ink/primitives/SeverityBadge.d.ts.map +1 -1
  117. package/dist/ink/primitives/SeverityBadge.js +28 -11
  118. package/dist/ink/primitives/SeverityBadge.js.map +1 -1
  119. package/dist/ink/registry/DiagnosticInkRegistry.d.ts +11 -8
  120. package/dist/ink/registry/DiagnosticInkRegistry.d.ts.map +1 -1
  121. package/dist/ink/registry/DiagnosticInkRegistry.js +32 -29
  122. package/dist/ink/registry/DiagnosticInkRegistry.js.map +1 -1
  123. package/dist/ink/views/DiagnosticView.d.ts +10 -7
  124. package/dist/ink/views/DiagnosticView.d.ts.map +1 -1
  125. package/dist/ink/views/DiagnosticView.js +42 -17
  126. package/dist/ink/views/DiagnosticView.js.map +1 -1
  127. package/dist/ink/views/DiagnosticsListView.d.ts +10 -7
  128. package/dist/ink/views/DiagnosticsListView.d.ts.map +1 -1
  129. package/dist/ink/views/DiagnosticsListView.js +24 -16
  130. package/dist/ink/views/DiagnosticsListView.js.map +1 -1
  131. package/dist/registry/FormatterRegistry.d.ts +18 -15
  132. package/dist/registry/FormatterRegistry.d.ts.map +1 -1
  133. package/dist/registry/FormatterRegistry.js +38 -40
  134. package/dist/registry/FormatterRegistry.js.map +1 -1
  135. package/dist/utils/indent.d.ts +5 -2
  136. package/dist/utils/indent.d.ts.map +1 -1
  137. package/dist/utils/indent.js +9 -8
  138. package/dist/utils/indent.js.map +1 -1
  139. package/package.json +15 -17
  140. package/dist/contracts/FormatterTypes.js.map +0 -1
  141. package/dist/index.d.ts.map +0 -1
  142. package/dist/index.js.map +0 -1
  143. package/dist/ink/contracts/InkTypes.js.map +0 -1
  144. package/dist/ink/index.d.ts.map +0 -1
  145. package/dist/ink/index.js.map +0 -1
@@ -1,30 +1,36 @@
1
- import type { Diagnostic, DiagnosticCode } from '@uapkg/diagnostics';
2
- import type { ComponentType } from 'react';
1
+ import { Diagnostic, DiagnosticCode } from "@uapkg/diagnostics";
2
+ import { ComponentType } from "react";
3
+ //#region src/ink/contracts/InkTypes.d.ts
3
4
  /**
4
5
  * Props every family-body component receives. Each component renders only
5
6
  * the **body** of a diagnostic — icon, code header, and hint are rendered
6
7
  * by {@link DiagnosticView}. Bodies are pure (data-in → element-out) and
7
8
  * must never touch config, fs, or stdout.
8
9
  */
9
- export interface DiagnosticBodyProps {
10
- readonly diagnostic: Diagnostic;
10
+ interface DiagnosticBodyProps {
11
+ readonly diagnostic: Diagnostic;
11
12
  }
12
13
  /** A React/Ink component that renders a diagnostic body. */
13
- export type DiagnosticBodyComponent = ComponentType<DiagnosticBodyProps>;
14
+ type DiagnosticBodyComponent = ComponentType<DiagnosticBodyProps> & {
15
+ /** The body renders the hint itself to control its position among resources. */
16
+ rendersHint?: boolean;
17
+ };
14
18
  /**
15
19
  * Map of diagnostic code → body component. Any code **not** present in the
16
20
  * map falls back to {@link PlainTextBody}, which renders the same prose
17
21
  * `formatPlainText` would emit — just wrapped in `<Text>`.
18
22
  */
19
- export type DiagnosticInkComponentMap = Partial<Record<DiagnosticCode, DiagnosticBodyComponent>>;
23
+ type DiagnosticInkComponentMap = Partial<Record<DiagnosticCode, DiagnosticBodyComponent>>;
20
24
  /**
21
25
  * Contract for a lookup service that maps diagnostic codes to Ink bodies.
22
26
  *
23
27
  * The registry is the Ink analog of `FormatterRegistry` — same spirit
24
28
  * (code → renderer), different codomain (React element vs. string).
25
29
  */
26
- export interface IDiagnosticInkRegistry {
27
- register(code: DiagnosticCode, component: DiagnosticBodyComponent): void;
28
- resolve(code: DiagnosticCode): DiagnosticBodyComponent | undefined;
30
+ interface IDiagnosticInkRegistry {
31
+ register(code: DiagnosticCode, component: DiagnosticBodyComponent): void;
32
+ resolve(code: DiagnosticCode): DiagnosticBodyComponent | undefined;
29
33
  }
34
+ //#endregion
35
+ export { DiagnosticBodyComponent, DiagnosticBodyProps, DiagnosticInkComponentMap, IDiagnosticInkRegistry };
30
36
  //# sourceMappingURL=InkTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InkTypes.d.ts","sourceRoot":"","sources":["../../../src/ink/contracts/InkTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CACjC;AAED,4DAA4D;AAC5D,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAAC,CAAC,CAAC;AAEjG;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACzE,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,uBAAuB,GAAG,SAAS,CAAC;CACpE"}
1
+ {"version":3,"file":"InkTypes.d.ts","names":[],"sources":["../../../src/ink/contracts/InkTypes.ts"],"mappings":";;;;;;;;;UASiB;WACN,YAAY;;;KAIX,0BAA0B,cAAc;;EAElD;;;;;;;KAQU,4BAA4B,QAAQ,OAAO,gBAAgB;;;;;;;UAQtD;EACf,SAAS,MAAM,gBAAgB,WAAW;EAC1C,QAAQ,MAAM,iBAAiB"}
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=InkTypes.js.map
1
+ export { };
@@ -1,4 +1,5 @@
1
- import type { DiagnosticInkComponentMap } from '../contracts/InkTypes.js';
1
+ import { DiagnosticInkComponentMap } from "../contracts/InkTypes.js";
2
+ //#region src/ink/defaults/defaultInkComponents.d.ts
2
3
  /**
3
4
  * Aggregated default Ink component map — one entry per well-known diagnostic
4
5
  * code. Unknown codes fall back to {@link PlainTextBody} inside
@@ -9,5 +10,7 @@ import type { DiagnosticInkComponentMap } from '../contracts/InkTypes.js';
9
10
  * 1. Pass a spread: `{ ...defaultInkComponents, MY_CODE: MyBody }`, or
10
11
  * 2. Instantiate a {@link DiagnosticInkRegistry} and `.register()` after.
11
12
  */
12
- export declare const defaultInkComponents: DiagnosticInkComponentMap;
13
+ declare const defaultInkComponents: DiagnosticInkComponentMap;
14
+ //#endregion
15
+ export { defaultInkComponents };
13
16
  //# sourceMappingURL=defaultInkComponents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultInkComponents.d.ts","sourceRoot":"","sources":["../../../src/ink/defaults/defaultInkComponents.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,yBAUlC,CAAC"}
1
+ {"version":3,"file":"defaultInkComponents.d.ts","names":[],"sources":["../../../src/ink/defaults/defaultInkComponents.ts"],"mappings":";;;;;;;;;;;;cAsBa,sBAAsB"}
@@ -1,31 +1,38 @@
1
- import { configInkComponents } from '../components/configInkComponents.js';
2
- import { installerInkComponents } from '../components/installerInkComponents.js';
3
- import { manifestInkComponents } from '../components/manifestInkComponents.js';
4
- import { packInkComponents } from '../components/packInkComponents.js';
5
- import { postinstallInkComponents } from '../components/postinstallInkComponents.js';
6
- import { registryInkComponents } from '../components/registryInkComponents.js';
7
- import { resolverInkComponents } from '../components/resolverInkComponents.js';
8
- import { safetyInkComponents } from '../components/safetyInkComponents.js';
9
- import { specInkComponents } from '../components/specInkComponents.js';
1
+ import { installerInkComponents } from "../components/installerInkComponents.js";
2
+ import { manifestInkComponents } from "../components/manifestInkComponents.js";
3
+ import { postinstallInkComponents } from "../components/postinstallInkComponents.js";
4
+ import { publishingInkComponents } from "../components/publishingInkComponents.js";
5
+ import { registryInkComponents } from "../components/registryInkComponents.js";
6
+ import { resolverInkComponents } from "../components/resolverInkComponents.js";
7
+ import { safetyInkComponents } from "../components/safetyInkComponents.js";
8
+ import { specInkComponents } from "../components/specInkComponents.js";
9
+ import { configInkComponents } from "../components/configInkComponents.js";
10
+ import { packInkComponents } from "../components/packInkComponents.js";
11
+
12
+ //#region src/ink/defaults/defaultInkComponents.ts
10
13
  /**
11
- * Aggregated default Ink component map — one entry per well-known diagnostic
12
- * code. Unknown codes fall back to {@link PlainTextBody} inside
13
- * {@link DiagnosticView}, so the registry is always safe to call.
14
- *
15
- * Consumers that want custom behavior can either:
16
- *
17
- * 1. Pass a spread: `{ ...defaultInkComponents, MY_CODE: MyBody }`, or
18
- * 2. Instantiate a {@link DiagnosticInkRegistry} and `.register()` after.
19
- */
20
- export const defaultInkComponents = {
21
- ...configInkComponents,
22
- ...installerInkComponents,
23
- ...manifestInkComponents,
24
- ...packInkComponents,
25
- ...postinstallInkComponents,
26
- ...registryInkComponents,
27
- ...resolverInkComponents,
28
- ...safetyInkComponents,
29
- ...specInkComponents,
14
+ * Aggregated default Ink component map — one entry per well-known diagnostic
15
+ * code. Unknown codes fall back to {@link PlainTextBody} inside
16
+ * {@link DiagnosticView}, so the registry is always safe to call.
17
+ *
18
+ * Consumers that want custom behavior can either:
19
+ *
20
+ * 1. Pass a spread: `{ ...defaultInkComponents, MY_CODE: MyBody }`, or
21
+ * 2. Instantiate a {@link DiagnosticInkRegistry} and `.register()` after.
22
+ */
23
+ const defaultInkComponents = {
24
+ ...configInkComponents,
25
+ ...installerInkComponents,
26
+ ...manifestInkComponents,
27
+ ...packInkComponents,
28
+ ...postinstallInkComponents,
29
+ ...publishingInkComponents,
30
+ ...registryInkComponents,
31
+ ...resolverInkComponents,
32
+ ...safetyInkComponents,
33
+ ...specInkComponents
30
34
  };
35
+
36
+ //#endregion
37
+ export { defaultInkComponents };
31
38
  //# sourceMappingURL=defaultInkComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultInkComponents.js","sourceRoot":"","sources":["../../../src/ink/defaults/defaultInkComponents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA8B;IAC7D,GAAG,mBAAmB;IACtB,GAAG,sBAAsB;IACzB,GAAG,qBAAqB;IACxB,GAAG,iBAAiB;IACpB,GAAG,wBAAwB;IAC3B,GAAG,qBAAqB;IACxB,GAAG,qBAAqB;IACxB,GAAG,mBAAmB;IACtB,GAAG,iBAAiB;CACrB,CAAC"}
1
+ {"version":3,"file":"defaultInkComponents.js","names":[],"sources":["../../../src/ink/defaults/defaultInkComponents.ts"],"sourcesContent":["import { configInkComponents } from '../components/configInkComponents.js';\nimport { installerInkComponents } from '../components/installerInkComponents.js';\nimport { manifestInkComponents } from '../components/manifestInkComponents.js';\nimport { packInkComponents } from '../components/packInkComponents.js';\nimport { postinstallInkComponents } from '../components/postinstallInkComponents.js';\nimport { publishingInkComponents } from '../components/publishingInkComponents.js';\nimport { registryInkComponents } from '../components/registryInkComponents.js';\nimport { resolverInkComponents } from '../components/resolverInkComponents.js';\nimport { safetyInkComponents } from '../components/safetyInkComponents.js';\nimport { specInkComponents } from '../components/specInkComponents.js';\nimport type { DiagnosticInkComponentMap } from '../contracts/InkTypes.js';\n\n/**\n * Aggregated default Ink component map — one entry per well-known diagnostic\n * code. Unknown codes fall back to {@link PlainTextBody} inside\n * {@link DiagnosticView}, so the registry is always safe to call.\n *\n * Consumers that want custom behavior can either:\n *\n * 1. Pass a spread: `{ ...defaultInkComponents, MY_CODE: MyBody }`, or\n * 2. Instantiate a {@link DiagnosticInkRegistry} and `.register()` after.\n */\nexport const defaultInkComponents: DiagnosticInkComponentMap = {\n ...configInkComponents,\n ...installerInkComponents,\n ...manifestInkComponents,\n ...packInkComponents,\n ...postinstallInkComponents,\n ...publishingInkComponents,\n ...registryInkComponents,\n ...resolverInkComponents,\n ...safetyInkComponents,\n ...specInkComponents,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,uBAAkD;CAC7D,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL"}
@@ -1,16 +1,17 @@
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
1
+ import { DiagnosticBodyComponent, DiagnosticBodyProps, DiagnosticInkComponentMap, IDiagnosticInkRegistry } from "./contracts/InkTypes.js";
2
+ import { installerInkComponents } from "./components/installerInkComponents.js";
3
+ import { manifestInkComponents } from "./components/manifestInkComponents.js";
4
+ import { postinstallInkComponents } from "./components/postinstallInkComponents.js";
5
+ import { publishingInkComponents } from "./components/publishingInkComponents.js";
6
+ import { registryInkComponents } from "./components/registryInkComponents.js";
7
+ import { resolverInkComponents } from "./components/resolverInkComponents.js";
8
+ import { safetyInkComponents } from "./components/safetyInkComponents.js";
9
+ import { specInkComponents } from "./components/specInkComponents.js";
10
+ import { defaultInkComponents } from "./defaults/defaultInkComponents.js";
11
+ import { HintLine } from "./primitives/HintLine.js";
12
+ import { PlainTextBody } from "./primitives/PlainTextBody.js";
13
+ import { SeverityBadge } from "./primitives/SeverityBadge.js";
14
+ import { DiagnosticInkRegistry, createInkRegistry } from "./registry/DiagnosticInkRegistry.js";
15
+ import { DiagnosticsListView, DiagnosticsListViewProps } from "./views/DiagnosticsListView.js";
16
+ import { DiagnosticView, DiagnosticViewProps } from "./views/DiagnosticView.js";
17
+ export { type DiagnosticBodyComponent, type DiagnosticBodyProps, type DiagnosticInkComponentMap, DiagnosticInkRegistry, DiagnosticView, type DiagnosticViewProps, DiagnosticsListView, type DiagnosticsListViewProps, HintLine, type IDiagnosticInkRegistry, PlainTextBody, SeverityBadge, createInkRegistry, defaultInkComponents, installerInkComponents, manifestInkComponents, postinstallInkComponents, publishingInkComponents, registryInkComponents, resolverInkComponents, safetyInkComponents, specInkComponents };
package/dist/ink/index.js CHANGED
@@ -1,28 +1,17 @@
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
1
+ import { installerInkComponents } from "./components/installerInkComponents.js";
2
+ import { manifestInkComponents } from "./components/manifestInkComponents.js";
3
+ import { postinstallInkComponents } from "./components/postinstallInkComponents.js";
4
+ import { publishingInkComponents } from "./components/publishingInkComponents.js";
5
+ import { registryInkComponents } from "./components/registryInkComponents.js";
6
+ import { resolverInkComponents } from "./components/resolverInkComponents.js";
7
+ import { safetyInkComponents } from "./components/safetyInkComponents.js";
8
+ import { specInkComponents } from "./components/specInkComponents.js";
9
+ import { defaultInkComponents } from "./defaults/defaultInkComponents.js";
10
+ import { HintLine } from "./primitives/HintLine.js";
11
+ import { PlainTextBody } from "./primitives/PlainTextBody.js";
12
+ import { SeverityBadge } from "./primitives/SeverityBadge.js";
13
+ import { DiagnosticInkRegistry, createInkRegistry } from "./registry/DiagnosticInkRegistry.js";
14
+ import { DiagnosticView } from "./views/DiagnosticView.js";
15
+ import { DiagnosticsListView } from "./views/DiagnosticsListView.js";
16
+
17
+ export { DiagnosticInkRegistry, DiagnosticView, DiagnosticsListView, HintLine, PlainTextBody, SeverityBadge, createInkRegistry, defaultInkComponents, installerInkComponents, manifestInkComponents, postinstallInkComponents, publishingInkComponents, registryInkComponents, resolverInkComponents, safetyInkComponents, specInkComponents };
@@ -1,10 +1,13 @@
1
- import type { ReactElement } from 'react';
2
- export interface HintLineProps {
3
- readonly hint: string;
1
+ import { ReactElement } from "react";
2
+ //#region src/ink/primitives/HintLine.d.ts
3
+ interface HintLineProps {
4
+ readonly hint: string;
4
5
  }
5
6
  /**
6
7
  * Bottom-of-diagnostic actionable hint. Always indented and tinted so it
7
8
  * stands apart from the body. Renders nothing when the hint is empty.
8
9
  */
9
- export declare function HintLine({ hint }: HintLineProps): ReactElement | null;
10
+ declare function HintLine({ hint }: HintLineProps): ReactElement | null;
11
+ //#endregion
12
+ export { HintLine, HintLineProps };
10
13
  //# sourceMappingURL=HintLine.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"HintLine.d.ts","names":[],"sources":["../../../src/ink/primitives/HintLine.tsx"],"mappings":";;UAGiB;WACN;;;;;;iBAOK,WAAW,QAAQ,gBAAgB"}
@@ -1,12 +1,25 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from 'ink';
1
+ import { Box, Text } from "ink";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+
4
+ //#region src/ink/primitives/HintLine.tsx
3
5
  /**
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 })] }));
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
+ function HintLine({ hint }) {
10
+ if (!hint || hint.length === 0) return null;
11
+ return /* @__PURE__ */ jsxs(Box, {
12
+ marginLeft: 2,
13
+ children: [/* @__PURE__ */ jsx(Text, {
14
+ color: "magentaBright",
15
+ children: "→ "
16
+ }), /* @__PURE__ */ jsx(Text, {
17
+ color: "white",
18
+ children: hint
19
+ })]
20
+ });
11
21
  }
22
+
23
+ //#endregion
24
+ export { HintLine };
12
25
  //# sourceMappingURL=HintLine.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"HintLine.js","names":[],"sources":["../../../src/ink/primitives/HintLine.tsx"],"sourcesContent":["import { Box, Text } from 'ink';\nimport type { ReactElement } from 'react';\n\nexport interface HintLineProps {\n readonly hint: string;\n}\n\n/**\n * Bottom-of-diagnostic actionable hint. Always indented and tinted so it\n * stands apart from the body. Renders nothing when the hint is empty.\n */\nexport function HintLine({ hint }: HintLineProps): ReactElement | null {\n if (!hint || hint.length === 0) return null;\n return (\n <Box marginLeft={2}>\n <Text color=\"magentaBright\">→ </Text>\n <Text color=\"white\">{hint}</Text>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;AAWA,SAAgB,SAAS,EAAE,QAA4C;CACrE,IAAI,CAAC,QAAQ,KAAK,WAAW,GAAG,OAAO;CACvC,OACE,qBAAC,KAAD;EAAK,YAAY;YAAjB,CACE,oBAAC,MAAD;GAAM,OAAM;aAAgB;EAAQ,IACpC,oBAAC,MAAD;GAAM,OAAM;aAAS;EAAW,EAC7B;;AAET"}
@@ -1,9 +1,12 @@
1
- import type { ReactElement } from 'react';
2
- import type { DiagnosticBodyProps } from '../contracts/InkTypes.js';
1
+ import { DiagnosticBodyProps } from "../contracts/InkTypes.js";
2
+ import { ReactElement } from "react";
3
+ //#region src/ink/primitives/PlainTextBody.d.ts
3
4
  /**
4
5
  * Fallback body used when no family-specific component is registered for a
5
6
  * diagnostic code. Writes the diagnostic message verbatim so the Ink render
6
7
  * stays in structural parity with the plain-text formatter.
7
8
  */
8
- export declare function PlainTextBody({ diagnostic }: DiagnosticBodyProps): ReactElement;
9
+ declare function PlainTextBody({ diagnostic }: DiagnosticBodyProps): ReactElement;
10
+ //#endregion
11
+ export { PlainTextBody };
9
12
  //# sourceMappingURL=PlainTextBody.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"PlainTextBody.d.ts","names":[],"sources":["../../../src/ink/primitives/PlainTextBody.tsx"],"mappings":";;;;;;;;iBASgB,gBAAgB,cAAc,sBAAsB"}
@@ -1,11 +1,16 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Text } from 'ink';
1
+ import { Text } from "ink";
2
+ import { jsx } from "react/jsx-runtime";
3
+
4
+ //#region src/ink/primitives/PlainTextBody.tsx
3
5
  /**
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 });
6
+ * Fallback body used when no family-specific component is registered for a
7
+ * diagnostic code. Writes the diagnostic message verbatim so the Ink render
8
+ * stays in structural parity with the plain-text formatter.
9
+ */
10
+ function PlainTextBody({ diagnostic }) {
11
+ return /* @__PURE__ */ jsx(Text, { children: diagnostic.message });
10
12
  }
13
+
14
+ //#endregion
15
+ export { PlainTextBody };
11
16
  //# sourceMappingURL=PlainTextBody.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"PlainTextBody.js","names":[],"sources":["../../../src/ink/primitives/PlainTextBody.tsx"],"sourcesContent":["import { Text } from 'ink';\nimport type { ReactElement } from 'react';\nimport type { DiagnosticBodyProps } from '../contracts/InkTypes.js';\n\n/**\n * Fallback body used when no family-specific component is registered for a\n * diagnostic code. Writes the diagnostic message verbatim so the Ink render\n * stays in structural parity with the plain-text formatter.\n */\nexport function PlainTextBody({ diagnostic }: DiagnosticBodyProps): ReactElement {\n return <Text>{diagnostic.message}</Text>;\n}\n"],"mappings":";;;;;;;;;AASA,SAAgB,cAAc,EAAE,cAAiD;CAC/E,OAAO,oBAAC,MAAD,YAAO,WAAW,QAAc;AACzC"}
@@ -1,11 +1,14 @@
1
- import type { Diagnostic } from '@uapkg/diagnostics';
2
- import type { ReactElement } from 'react';
3
- export interface SeverityBadgeProps {
4
- readonly level: Diagnostic['level'];
1
+ import { Diagnostic } from "@uapkg/diagnostics";
2
+ import { ReactElement } from "react";
3
+ //#region src/ink/primitives/SeverityBadge.d.ts
4
+ interface SeverityBadgeProps {
5
+ readonly level: Diagnostic['level'];
5
6
  }
6
7
  /**
7
8
  * A single colored severity icon. Pure presentation — no diagnostic-specific
8
9
  * logic lives here. Used as a prefix by {@link DiagnosticView}.
9
10
  */
10
- export declare function SeverityBadge({ level }: SeverityBadgeProps): ReactElement;
11
+ declare function SeverityBadge({ level }: SeverityBadgeProps): ReactElement;
12
+ //#endregion
13
+ export { SeverityBadge, SeverityBadgeProps };
11
14
  //# sourceMappingURL=SeverityBadge.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"SeverityBadge.d.ts","names":[],"sources":["../../../src/ink/primitives/SeverityBadge.tsx"],"mappings":";;;UAUiB;WACN,OAAO;;;;;;iBAOF,gBAAgB,SAAS,qBAAqB"}
@@ -1,16 +1,33 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Text } from 'ink';
1
+ import { Text } from "ink";
2
+ import { jsx } from "react/jsx-runtime";
3
+
4
+ //#region src/ink/primitives/SeverityBadge.tsx
3
5
  const LEVEL_CONFIG = {
4
- error: { icon: '✖', color: 'red' },
5
- warning: { icon: '⚠', color: 'yellow' },
6
- info: { icon: 'ℹ', color: 'cyan' },
6
+ error: {
7
+ icon: "✖",
8
+ color: "red"
9
+ },
10
+ warning: {
11
+ icon: "⚠",
12
+ color: "yellow"
13
+ },
14
+ info: {
15
+ icon: "ℹ",
16
+ color: "cyan"
17
+ }
7
18
  };
8
19
  /**
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 });
20
+ * A single colored severity icon. Pure presentation — no diagnostic-specific
21
+ * logic lives here. Used as a prefix by {@link DiagnosticView}.
22
+ */
23
+ function SeverityBadge({ level }) {
24
+ const { icon, color } = LEVEL_CONFIG[level];
25
+ return /* @__PURE__ */ jsx(Text, {
26
+ color,
27
+ children: icon
28
+ });
15
29
  }
30
+
31
+ //#endregion
32
+ export { SeverityBadge };
16
33
  //# sourceMappingURL=SeverityBadge.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"SeverityBadge.js","names":[],"sources":["../../../src/ink/primitives/SeverityBadge.tsx"],"sourcesContent":["import type { Diagnostic } from '@uapkg/diagnostics';\nimport { Text } from 'ink';\nimport type { ReactElement } from 'react';\n\nconst LEVEL_CONFIG: Record<Diagnostic['level'], { readonly icon: string; readonly color: string }> = {\n error: { icon: '✖', color: 'red' },\n warning: { icon: '⚠', color: 'yellow' },\n info: { icon: 'ℹ', color: 'cyan' },\n};\n\nexport interface SeverityBadgeProps {\n readonly level: Diagnostic['level'];\n}\n\n/**\n * A single colored severity icon. Pure presentation — no diagnostic-specific\n * logic lives here. Used as a prefix by {@link DiagnosticView}.\n */\nexport function SeverityBadge({ level }: SeverityBadgeProps): ReactElement {\n const { icon, color } = LEVEL_CONFIG[level];\n return <Text color={color}>{icon}</Text>;\n}\n"],"mappings":";;;;AAIA,MAAM,eAA+F;CACnG,OAAO;EAAE,MAAM;EAAK,OAAO;CAAM;CACjC,SAAS;EAAE,MAAM;EAAK,OAAO;CAAS;CACtC,MAAM;EAAE,MAAM;EAAK,OAAO;CAAO;AACnC;;;;;AAUA,SAAgB,cAAc,EAAE,SAA2C;CACzE,MAAM,EAAE,MAAM,UAAU,aAAa;CACrC,OAAO,oBAAC,MAAD;EAAa;YAAQ;CAAW;AACzC"}
@@ -1,5 +1,6 @@
1
- import type { DiagnosticCode } from '@uapkg/diagnostics';
2
- import type { DiagnosticBodyComponent, DiagnosticInkComponentMap, IDiagnosticInkRegistry } from '../contracts/InkTypes.js';
1
+ import { DiagnosticBodyComponent, DiagnosticInkComponentMap, IDiagnosticInkRegistry } from "../contracts/InkTypes.js";
2
+ import { DiagnosticCode } from "@uapkg/diagnostics";
3
+ //#region src/ink/registry/DiagnosticInkRegistry.d.ts
3
4
  /**
4
5
  * Lookup service for Ink diagnostic-body components.
5
6
  *
@@ -9,14 +10,16 @@ import type { DiagnosticBodyComponent, DiagnosticInkComponentMap, IDiagnosticInk
9
10
  * The registry only *resolves* components — the composing {@link DiagnosticView}
10
11
  * is responsible for fallback behavior when `resolve()` returns undefined.
11
12
  */
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;
13
+ declare class DiagnosticInkRegistry implements IDiagnosticInkRegistry {
14
+ private readonly components;
15
+ constructor(seed?: DiagnosticInkComponentMap);
16
+ register(code: DiagnosticCode, component: DiagnosticBodyComponent): void;
17
+ resolve(code: DiagnosticCode): DiagnosticBodyComponent | undefined;
17
18
  }
18
19
  /**
19
20
  * Factory helper so consumers don't have to `new` the class directly.
20
21
  */
21
- export declare function createInkRegistry(seed?: DiagnosticInkComponentMap): DiagnosticInkRegistry;
22
+ declare function createInkRegistry(seed?: DiagnosticInkComponentMap): DiagnosticInkRegistry;
23
+ //#endregion
24
+ export { DiagnosticInkRegistry, createInkRegistry };
22
25
  //# sourceMappingURL=DiagnosticInkRegistry.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"DiagnosticInkRegistry.d.ts","names":[],"sources":["../../../src/ink/registry/DiagnosticInkRegistry.ts"],"mappings":";;;;;;;;;;;;cAgBa,iCAAiC;mBAC3B;EAEjB,YAAmB,OAAM;EAQlB,SAAS,MAAM,gBAAgB,WAAW;EAI1C,QAAQ,MAAM,iBAAiB;;;;;iBAQxB,kBAAkB,OAAO,4BAA4B"}
@@ -1,33 +1,36 @@
1
+ //#region src/ink/registry/DiagnosticInkRegistry.ts
1
2
  /**
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
- }
3
+ * Lookup service for Ink diagnostic-body components.
4
+ *
5
+ * - One-shot register: seed with a map at construction.
6
+ * - Extensible: callers can `register(code, component)` for bespoke overrides.
7
+ *
8
+ * The registry only *resolves* components — the composing {@link DiagnosticView}
9
+ * is responsible for fallback behavior when `resolve()` returns undefined.
10
+ */
11
+ var DiagnosticInkRegistry = class {
12
+ components;
13
+ constructor(seed = {}) {
14
+ this.components = /* @__PURE__ */ new Map();
15
+ for (const key of Object.keys(seed)) {
16
+ const component = seed[key];
17
+ if (component) 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
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);
28
+ * Factory helper so consumers don't have to `new` the class directly.
29
+ */
30
+ function createInkRegistry(seed) {
31
+ return new DiagnosticInkRegistry(seed);
32
32
  }
33
+
34
+ //#endregion
35
+ export { DiagnosticInkRegistry, createInkRegistry };
33
36
  //# sourceMappingURL=DiagnosticInkRegistry.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"DiagnosticInkRegistry.js","names":[],"sources":["../../../src/ink/registry/DiagnosticInkRegistry.ts"],"sourcesContent":["import type { DiagnosticCode } from '@uapkg/diagnostics';\nimport type {\n DiagnosticBodyComponent,\n DiagnosticInkComponentMap,\n IDiagnosticInkRegistry,\n} from '../contracts/InkTypes.js';\n\n/**\n * Lookup service for Ink diagnostic-body components.\n *\n * - One-shot register: seed with a map at construction.\n * - Extensible: callers can `register(code, component)` for bespoke overrides.\n *\n * The registry only *resolves* components — the composing {@link DiagnosticView}\n * is responsible for fallback behavior when `resolve()` returns undefined.\n */\nexport class DiagnosticInkRegistry implements IDiagnosticInkRegistry {\n private readonly components: Map<DiagnosticCode, DiagnosticBodyComponent>;\n\n public constructor(seed: DiagnosticInkComponentMap = {}) {\n this.components = new Map();\n for (const key of Object.keys(seed) as DiagnosticCode[]) {\n const component = seed[key];\n if (component) this.components.set(key, component);\n }\n }\n\n public register(code: DiagnosticCode, component: DiagnosticBodyComponent): void {\n this.components.set(code, component);\n }\n\n public resolve(code: DiagnosticCode): DiagnosticBodyComponent | undefined {\n return this.components.get(code);\n }\n}\n\n/**\n * Factory helper so consumers don't have to `new` the class directly.\n */\nexport function createInkRegistry(seed?: DiagnosticInkComponentMap): DiagnosticInkRegistry {\n return new DiagnosticInkRegistry(seed);\n}\n"],"mappings":";;;;;;;;;;AAgBA,IAAa,wBAAb,MAAqE;CACnE,AAAiB;CAEjB,AAAO,YAAY,OAAkC,CAAC,GAAG;EACvD,KAAK,6BAAa,IAAI,IAAI;EAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI,GAAuB;GACvD,MAAM,YAAY,KAAK;GACvB,IAAI,WAAW,KAAK,WAAW,IAAI,KAAK,SAAS;EACnD;CACF;CAEA,AAAO,SAAS,MAAsB,WAA0C;EAC9E,KAAK,WAAW,IAAI,MAAM,SAAS;CACrC;CAEA,AAAO,QAAQ,MAA2D;EACxE,OAAO,KAAK,WAAW,IAAI,IAAI;CACjC;AACF;;;;AAKA,SAAgB,kBAAkB,MAAyD;CACzF,OAAO,IAAI,sBAAsB,IAAI;AACvC"}
@@ -1,9 +1,10 @@
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;
1
+ import { IDiagnosticInkRegistry } from "../contracts/InkTypes.js";
2
+ import { Diagnostic } from "@uapkg/diagnostics";
3
+ import { ReactElement } from "react";
4
+ //#region src/ink/views/DiagnosticView.d.ts
5
+ interface DiagnosticViewProps {
6
+ readonly diagnostic: Diagnostic;
7
+ readonly registry: IDiagnosticInkRegistry;
7
8
  }
8
9
  /**
9
10
  * Renders one diagnostic in three layers:
@@ -15,5 +16,7 @@ export interface DiagnosticViewProps {
15
16
  *
16
17
  * This component is pure — it neither reads config nor talks to I/O.
17
18
  */
18
- export declare function DiagnosticView({ diagnostic, registry }: DiagnosticViewProps): ReactElement;
19
+ declare function DiagnosticView({ diagnostic, registry }: DiagnosticViewProps): ReactElement;
20
+ //#endregion
21
+ export { DiagnosticView, DiagnosticViewProps };
19
22
  //# sourceMappingURL=DiagnosticView.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"DiagnosticView.d.ts","names":[],"sources":["../../../src/ink/views/DiagnosticView.tsx"],"mappings":";;;;UAQiB;WACN,YAAY;WACZ,UAAU;;;;;;;;;;;;iBAaL,iBAAiB,YAAY,YAAY,sBAAsB"}