@uapkg/diagnostics-format 1.3.0 → 1.3.2
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.
- package/dist/contracts/FormatterTypes.d.ts +13 -10
- package/dist/contracts/FormatterTypes.d.ts.map +1 -1
- package/dist/contracts/FormatterTypes.js +1 -2
- package/dist/defaults/defaultFormatters.d.ts +5 -2
- package/dist/defaults/defaultFormatters.d.ts.map +1 -1
- package/dist/defaults/defaultFormatters.js +30 -23
- package/dist/defaults/defaultFormatters.js.map +1 -1
- package/dist/formatters/PlainTextFormatter.d.ts +5 -2
- package/dist/formatters/PlainTextFormatter.d.ts.map +1 -1
- package/dist/formatters/PlainTextFormatter.js +13 -12
- package/dist/formatters/PlainTextFormatter.js.map +1 -1
- package/dist/formatters/config/configFormatters.d.ts +5 -2
- package/dist/formatters/config/configFormatters.d.ts.map +1 -1
- package/dist/formatters/config/configFormatters.js +50 -56
- package/dist/formatters/config/configFormatters.js.map +1 -1
- package/dist/formatters/installer/installerFormatters.d.ts +5 -2
- package/dist/formatters/installer/installerFormatters.d.ts.map +1 -1
- package/dist/formatters/installer/installerFormatters.js +51 -47
- package/dist/formatters/installer/installerFormatters.js.map +1 -1
- package/dist/formatters/manifest/manifestFormatters.d.ts +5 -2
- package/dist/formatters/manifest/manifestFormatters.d.ts.map +1 -1
- package/dist/formatters/manifest/manifestFormatters.js +40 -45
- package/dist/formatters/manifest/manifestFormatters.js.map +1 -1
- package/dist/formatters/pack/packFormatters.d.ts +5 -2
- package/dist/formatters/pack/packFormatters.d.ts.map +1 -1
- package/dist/formatters/pack/packFormatters.js +9 -9
- package/dist/formatters/pack/packFormatters.js.map +1 -1
- package/dist/formatters/postinstall/postinstallFormatters.d.ts +5 -2
- package/dist/formatters/postinstall/postinstallFormatters.d.ts.map +1 -1
- package/dist/formatters/postinstall/postinstallFormatters.js +35 -36
- package/dist/formatters/postinstall/postinstallFormatters.js.map +1 -1
- package/dist/formatters/publishing/publishingFormatters.d.ts +14 -0
- package/dist/formatters/publishing/publishingFormatters.d.ts.map +1 -0
- package/dist/formatters/publishing/publishingFormatters.js +45 -0
- package/dist/formatters/publishing/publishingFormatters.js.map +1 -0
- package/dist/formatters/registry/registryFormatters.d.ts +5 -2
- package/dist/formatters/registry/registryFormatters.d.ts.map +1 -1
- package/dist/formatters/registry/registryFormatters.js +33 -34
- package/dist/formatters/registry/registryFormatters.js.map +1 -1
- package/dist/formatters/registryTools/registryToolsFormatters.d.ts +5 -2
- package/dist/formatters/registryTools/registryToolsFormatters.d.ts.map +1 -1
- package/dist/formatters/registryTools/registryToolsFormatters.js +160 -135
- package/dist/formatters/registryTools/registryToolsFormatters.js.map +1 -1
- package/dist/formatters/resolver/resolverFormatters.d.ts +5 -2
- package/dist/formatters/resolver/resolverFormatters.d.ts.map +1 -1
- package/dist/formatters/resolver/resolverFormatters.js +20 -18
- package/dist/formatters/resolver/resolverFormatters.js.map +1 -1
- package/dist/formatters/safety/safetyFormatters.d.ts +5 -2
- package/dist/formatters/safety/safetyFormatters.d.ts.map +1 -1
- package/dist/formatters/safety/safetyFormatters.js +28 -26
- package/dist/formatters/safety/safetyFormatters.js.map +1 -1
- package/dist/formatters/spec/specFormatters.d.ts +5 -2
- package/dist/formatters/spec/specFormatters.d.ts.map +1 -1
- package/dist/formatters/spec/specFormatters.js +32 -19
- package/dist/formatters/spec/specFormatters.js.map +1 -1
- package/dist/index.d.ts +15 -14
- package/dist/index.js +15 -16
- package/dist/ink/components/configInkComponents.d.ts +5 -2
- package/dist/ink/components/configInkComponents.d.ts.map +1 -1
- package/dist/ink/components/configInkComponents.js +93 -18
- package/dist/ink/components/configInkComponents.js.map +1 -1
- package/dist/ink/components/installerInkComponents.d.ts +5 -2
- package/dist/ink/components/installerInkComponents.d.ts.map +1 -1
- package/dist/ink/components/installerInkComponents.js +170 -24
- package/dist/ink/components/installerInkComponents.js.map +1 -1
- package/dist/ink/components/manifestInkComponents.d.ts +5 -2
- package/dist/ink/components/manifestInkComponents.d.ts.map +1 -1
- package/dist/ink/components/manifestInkComponents.js +139 -34
- package/dist/ink/components/manifestInkComponents.js.map +1 -1
- package/dist/ink/components/packInkComponents.d.ts +5 -2
- package/dist/ink/components/packInkComponents.d.ts.map +1 -1
- package/dist/ink/components/packInkComponents.js +22 -7
- package/dist/ink/components/packInkComponents.js.map +1 -1
- package/dist/ink/components/postinstallInkComponents.d.ts +5 -2
- package/dist/ink/components/postinstallInkComponents.d.ts.map +1 -1
- package/dist/ink/components/postinstallInkComponents.js +124 -21
- package/dist/ink/components/postinstallInkComponents.js.map +1 -1
- package/dist/ink/components/publishingInkComponents.d.ts +6 -0
- package/dist/ink/components/publishingInkComponents.d.ts.map +1 -0
- package/dist/ink/components/publishingInkComponents.js +55 -0
- package/dist/ink/components/publishingInkComponents.js.map +1 -0
- package/dist/ink/components/registryInkComponents.d.ts +5 -2
- package/dist/ink/components/registryInkComponents.d.ts.map +1 -1
- package/dist/ink/components/registryInkComponents.js +109 -24
- package/dist/ink/components/registryInkComponents.js.map +1 -1
- package/dist/ink/components/resolverInkComponents.d.ts +5 -2
- package/dist/ink/components/resolverInkComponents.d.ts.map +1 -1
- package/dist/ink/components/resolverInkComponents.js +97 -18
- package/dist/ink/components/resolverInkComponents.js.map +1 -1
- package/dist/ink/components/safetyInkComponents.d.ts +5 -2
- package/dist/ink/components/safetyInkComponents.d.ts.map +1 -1
- package/dist/ink/components/safetyInkComponents.js +72 -12
- package/dist/ink/components/safetyInkComponents.js.map +1 -1
- package/dist/ink/components/specInkComponents.d.ts +5 -2
- package/dist/ink/components/specInkComponents.d.ts.map +1 -1
- package/dist/ink/components/specInkComponents.js +44 -12
- package/dist/ink/components/specInkComponents.js.map +1 -1
- package/dist/ink/contracts/InkTypes.d.ts +15 -9
- package/dist/ink/contracts/InkTypes.d.ts.map +1 -1
- package/dist/ink/contracts/InkTypes.js +1 -2
- package/dist/ink/defaults/defaultInkComponents.d.ts +5 -2
- package/dist/ink/defaults/defaultInkComponents.d.ts.map +1 -1
- package/dist/ink/defaults/defaultInkComponents.js +35 -28
- package/dist/ink/defaults/defaultInkComponents.js.map +1 -1
- package/dist/ink/index.d.ts +17 -16
- package/dist/ink/index.js +17 -28
- package/dist/ink/primitives/HintLine.d.ts +7 -4
- package/dist/ink/primitives/HintLine.d.ts.map +1 -1
- package/dist/ink/primitives/HintLine.js +22 -9
- package/dist/ink/primitives/HintLine.js.map +1 -1
- package/dist/ink/primitives/PlainTextBody.d.ts +6 -3
- package/dist/ink/primitives/PlainTextBody.d.ts.map +1 -1
- package/dist/ink/primitives/PlainTextBody.js +13 -8
- package/dist/ink/primitives/PlainTextBody.js.map +1 -1
- package/dist/ink/primitives/SeverityBadge.d.ts +8 -5
- package/dist/ink/primitives/SeverityBadge.d.ts.map +1 -1
- package/dist/ink/primitives/SeverityBadge.js +28 -11
- package/dist/ink/primitives/SeverityBadge.js.map +1 -1
- package/dist/ink/registry/DiagnosticInkRegistry.d.ts +11 -8
- package/dist/ink/registry/DiagnosticInkRegistry.d.ts.map +1 -1
- package/dist/ink/registry/DiagnosticInkRegistry.js +32 -29
- package/dist/ink/registry/DiagnosticInkRegistry.js.map +1 -1
- package/dist/ink/views/DiagnosticView.d.ts +10 -7
- package/dist/ink/views/DiagnosticView.d.ts.map +1 -1
- package/dist/ink/views/DiagnosticView.js +42 -17
- package/dist/ink/views/DiagnosticView.js.map +1 -1
- package/dist/ink/views/DiagnosticsListView.d.ts +10 -7
- package/dist/ink/views/DiagnosticsListView.d.ts.map +1 -1
- package/dist/ink/views/DiagnosticsListView.js +24 -16
- package/dist/ink/views/DiagnosticsListView.js.map +1 -1
- package/dist/registry/FormatterRegistry.d.ts +18 -15
- package/dist/registry/FormatterRegistry.d.ts.map +1 -1
- package/dist/registry/FormatterRegistry.js +38 -40
- package/dist/registry/FormatterRegistry.js.map +1 -1
- package/dist/utils/indent.d.ts +5 -2
- package/dist/utils/indent.d.ts.map +1 -1
- package/dist/utils/indent.js +9 -8
- package/dist/utils/indent.js.map +1 -1
- package/package.json +15 -17
- package/dist/contracts/FormatterTypes.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/ink/contracts/InkTypes.js.map +0 -1
- package/dist/ink/index.d.ts.map +0 -1
- package/dist/ink/index.js.map +0 -1
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Diagnostic, DiagnosticCode } from "@uapkg/diagnostics";
|
|
2
|
+
//#region src/contracts/FormatterTypes.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* A function that converts a single diagnostic into a human-readable string.
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
type DiagnosticFormatterFn = (diagnostic: Diagnostic) => string;
|
|
6
7
|
/**
|
|
7
8
|
* A lookup of formatter functions keyed by diagnostic code.
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
type FormatterMap = Partial<Record<DiagnosticCode, DiagnosticFormatterFn>>;
|
|
10
11
|
/**
|
|
11
12
|
* Contract for a formatter registry that maps diagnostic codes to formatters.
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
interface IFormatterRegistry {
|
|
15
|
+
/** Register a formatter for a specific code. */
|
|
16
|
+
register(code: DiagnosticCode, formatter: DiagnosticFormatterFn): void;
|
|
17
|
+
/** Format a single diagnostic. */
|
|
18
|
+
format(diagnostic: Diagnostic): string;
|
|
19
|
+
/** Format an array of diagnostics, one per line. */
|
|
20
|
+
formatAll(diagnostics: readonly Diagnostic[]): string;
|
|
20
21
|
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { DiagnosticFormatterFn, FormatterMap, IFormatterRegistry };
|
|
21
24
|
//# sourceMappingURL=FormatterTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatterTypes.d.ts","
|
|
1
|
+
{"version":3,"file":"FormatterTypes.d.ts","names":[],"sources":["../../src/contracts/FormatterTypes.ts"],"mappings":";;;;;KAKY,yBAAyB,YAAY;;;;KAKrC,eAAe,QAAQ,OAAO,gBAAgB;;;;UAKzC;;EAEf,SAAS,MAAM,gBAAgB,WAAW;;EAG1C,OAAO,YAAY;;EAGnB,UAAU,sBAAsB"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=FormatterTypes.js.map
|
|
1
|
+
export { };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FormatterMap } from "../contracts/FormatterTypes.js";
|
|
2
|
+
//#region src/defaults/defaultFormatters.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* Merged map of all built-in formatters across families.
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
declare const defaultFormatters: FormatterMap;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { defaultFormatters };
|
|
6
9
|
//# sourceMappingURL=defaultFormatters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultFormatters.d.ts","
|
|
1
|
+
{"version":3,"file":"defaultFormatters.d.ts","names":[],"sources":["../../src/defaults/defaultFormatters.ts"],"mappings":";;;;;cAgBa,mBAAmB"}
|
|
@@ -1,26 +1,33 @@
|
|
|
1
|
-
import { configFormatters } from
|
|
2
|
-
import { installerFormatters } from
|
|
3
|
-
import { manifestFormatters } from
|
|
4
|
-
import { packFormatters } from
|
|
5
|
-
import { postinstallFormatters } from
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { configFormatters } from "../formatters/config/configFormatters.js";
|
|
2
|
+
import { installerFormatters } from "../formatters/installer/installerFormatters.js";
|
|
3
|
+
import { manifestFormatters } from "../formatters/manifest/manifestFormatters.js";
|
|
4
|
+
import { packFormatters } from "../formatters/pack/packFormatters.js";
|
|
5
|
+
import { postinstallFormatters } from "../formatters/postinstall/postinstallFormatters.js";
|
|
6
|
+
import { publishingFormatters } from "../formatters/publishing/publishingFormatters.js";
|
|
7
|
+
import { registryFormatters } from "../formatters/registry/registryFormatters.js";
|
|
8
|
+
import { registryToolsFormatters } from "../formatters/registryTools/registryToolsFormatters.js";
|
|
9
|
+
import { resolverFormatters } from "../formatters/resolver/resolverFormatters.js";
|
|
10
|
+
import { safetyFormatters } from "../formatters/safety/safetyFormatters.js";
|
|
11
|
+
import { specFormatters } from "../formatters/spec/specFormatters.js";
|
|
12
|
+
|
|
13
|
+
//#region src/defaults/defaultFormatters.ts
|
|
11
14
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
* Merged map of all built-in formatters across families.
|
|
16
|
+
*/
|
|
17
|
+
const defaultFormatters = {
|
|
18
|
+
...resolverFormatters,
|
|
19
|
+
...configFormatters,
|
|
20
|
+
...registryFormatters,
|
|
21
|
+
...registryToolsFormatters,
|
|
22
|
+
...manifestFormatters,
|
|
23
|
+
...packFormatters,
|
|
24
|
+
...installerFormatters,
|
|
25
|
+
...postinstallFormatters,
|
|
26
|
+
...publishingFormatters,
|
|
27
|
+
...safetyFormatters,
|
|
28
|
+
...specFormatters
|
|
25
29
|
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { defaultFormatters };
|
|
26
33
|
//# sourceMappingURL=defaultFormatters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultFormatters.js","
|
|
1
|
+
{"version":3,"file":"defaultFormatters.js","names":[],"sources":["../../src/defaults/defaultFormatters.ts"],"sourcesContent":["import type { FormatterMap } from '../contracts/FormatterTypes.js';\nimport { configFormatters } from '../formatters/config/configFormatters.js';\nimport { installerFormatters } from '../formatters/installer/installerFormatters.js';\nimport { manifestFormatters } from '../formatters/manifest/manifestFormatters.js';\nimport { packFormatters } from '../formatters/pack/packFormatters.js';\nimport { postinstallFormatters } from '../formatters/postinstall/postinstallFormatters.js';\nimport { publishingFormatters } from '../formatters/publishing/publishingFormatters.js';\nimport { registryFormatters } from '../formatters/registry/registryFormatters.js';\nimport { registryToolsFormatters } from '../formatters/registryTools/registryToolsFormatters.js';\nimport { resolverFormatters } from '../formatters/resolver/resolverFormatters.js';\nimport { safetyFormatters } from '../formatters/safety/safetyFormatters.js';\nimport { specFormatters } from '../formatters/spec/specFormatters.js';\n\n/**\n * Merged map of all built-in formatters across families.\n */\nexport const defaultFormatters: FormatterMap = {\n ...resolverFormatters,\n ...configFormatters,\n ...registryFormatters,\n ...registryToolsFormatters,\n ...manifestFormatters,\n ...packFormatters,\n ...installerFormatters,\n ...postinstallFormatters,\n ...publishingFormatters,\n ...safetyFormatters,\n ...specFormatters,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAa,oBAAkC;CAC7C,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Diagnostic } from "@uapkg/diagnostics";
|
|
2
|
+
//#region src/formatters/PlainTextFormatter.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* Default plain-text formatter for any diagnostic.
|
|
4
5
|
*
|
|
5
6
|
* Format: `[LEVEL CODE]: message`
|
|
6
7
|
* If a hint is present: ` → hint`
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
+
declare function formatPlainText(diagnostic: Diagnostic): string;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { formatPlainText };
|
|
9
12
|
//# sourceMappingURL=PlainTextFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlainTextFormatter.d.ts","
|
|
1
|
+
{"version":3,"file":"PlainTextFormatter.d.ts","names":[],"sources":["../../src/formatters/PlainTextFormatter.ts"],"mappings":";;;;;;;;iBAQgB,gBAAgB,YAAY"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
//#region src/formatters/PlainTextFormatter.ts
|
|
1
2
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
line += `\n → ${diagnostic.hint}`;
|
|
12
|
-
}
|
|
13
|
-
return line;
|
|
3
|
+
* Default plain-text formatter for any diagnostic.
|
|
4
|
+
*
|
|
5
|
+
* Format: `[LEVEL CODE]: message`
|
|
6
|
+
* If a hint is present: ` → hint`
|
|
7
|
+
*/
|
|
8
|
+
function formatPlainText(diagnostic) {
|
|
9
|
+
let line = `[${diagnostic.level.toUpperCase()} ${diagnostic.code}]: ${diagnostic.message}`;
|
|
10
|
+
if (diagnostic.hint) line += `\n → ${diagnostic.hint}`;
|
|
11
|
+
return line;
|
|
14
12
|
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { formatPlainText };
|
|
15
16
|
//# sourceMappingURL=PlainTextFormatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlainTextFormatter.js","
|
|
1
|
+
{"version":3,"file":"PlainTextFormatter.js","names":[],"sources":["../../src/formatters/PlainTextFormatter.ts"],"sourcesContent":["import type { Diagnostic } from '@uapkg/diagnostics';\n\n/**\n * Default plain-text formatter for any diagnostic.\n *\n * Format: `[LEVEL CODE]: message`\n * If a hint is present: ` → hint`\n */\nexport function formatPlainText(diagnostic: Diagnostic): string {\n const tag = diagnostic.level.toUpperCase();\n let line = `[${tag} ${diagnostic.code}]: ${diagnostic.message}`;\n if (diagnostic.hint) {\n line += `\\n → ${diagnostic.hint}`;\n }\n return line;\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,gBAAgB,YAAgC;CAE9D,IAAI,OAAO,IADC,WAAW,MAAM,YACZ,EAAE,GAAG,WAAW,KAAK,KAAK,WAAW;CACtD,IAAI,WAAW,MACb,QAAQ,SAAS,WAAW;CAE9B,OAAO;AACT"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { FormatterMap } from "../../contracts/FormatterTypes.js";
|
|
2
|
+
//#region src/formatters/config/configFormatters.d.ts
|
|
3
|
+
declare const configFormatters: FormatterMap;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { configFormatters };
|
|
3
6
|
//# sourceMappingURL=configFormatters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configFormatters.d.ts","
|
|
1
|
+
{"version":3,"file":"configFormatters.d.ts","names":[],"sources":["../../../src/formatters/config/configFormatters.ts"],"mappings":";;cAoEa,kBAAkB"}
|
|
@@ -1,68 +1,62 @@
|
|
|
1
|
+
//#region src/formatters/config/configFormatters.ts
|
|
1
2
|
function formatInvalidJson(diagnostic) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return lines.join('\n');
|
|
3
|
+
const data = diagnostic.data;
|
|
4
|
+
const lines = [
|
|
5
|
+
`[WARNING CONFIG_INVALID_JSON]: ${diagnostic.message}`,
|
|
6
|
+
` File: ${data.filePath}`,
|
|
7
|
+
` Reason: ${data.reason}`
|
|
8
|
+
];
|
|
9
|
+
if (diagnostic.hint) lines.push(` → ${diagnostic.hint}`);
|
|
10
|
+
return lines.join("\n");
|
|
11
11
|
}
|
|
12
12
|
function formatTypeMismatch(diagnostic) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
lines.push(` → ${diagnostic.hint}`);
|
|
25
|
-
return lines.join('\n');
|
|
13
|
+
const data = diagnostic.data;
|
|
14
|
+
const lines = [
|
|
15
|
+
`[WARNING CONFIG_TYPE_MISMATCH]: ${diagnostic.message}`,
|
|
16
|
+
` Path: ${data.path}`,
|
|
17
|
+
` Expected: ${data.expectedType}`,
|
|
18
|
+
` Actual: ${data.actualType}`,
|
|
19
|
+
` Source: ${data.source}`
|
|
20
|
+
];
|
|
21
|
+
if (data.filePath) lines.push(` File: ${data.filePath}`);
|
|
22
|
+
if (diagnostic.hint) lines.push(` → ${diagnostic.hint}`);
|
|
23
|
+
return lines.join("\n");
|
|
26
24
|
}
|
|
27
25
|
function formatUnknownKey(diagnostic) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
lines.push(` → ${diagnostic.hint}`);
|
|
38
|
-
return lines.join('\n');
|
|
26
|
+
const data = diagnostic.data;
|
|
27
|
+
const lines = [
|
|
28
|
+
`[WARNING CONFIG_UNKNOWN_KEY]: ${diagnostic.message}`,
|
|
29
|
+
` Path: ${data.path}`,
|
|
30
|
+
` Source: ${data.source}`
|
|
31
|
+
];
|
|
32
|
+
if (data.filePath) lines.push(` File: ${data.filePath}`);
|
|
33
|
+
if (diagnostic.hint) lines.push(` → ${diagnostic.hint}`);
|
|
34
|
+
return lines.join("\n");
|
|
39
35
|
}
|
|
40
36
|
function formatUnresolvedRegistry(diagnostic) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
];
|
|
46
|
-
if (diagnostic.hint)
|
|
47
|
-
lines.push(` → ${diagnostic.hint}`);
|
|
48
|
-
return lines.join('\n');
|
|
37
|
+
const data = diagnostic.data;
|
|
38
|
+
const lines = [`[WARNING CONFIG_UNRESOLVED_DEFAULT_REGISTRY]: ${diagnostic.message}`, ` Registry: ${data.registryName}`];
|
|
39
|
+
if (diagnostic.hint) lines.push(` → ${diagnostic.hint}`);
|
|
40
|
+
return lines.join("\n");
|
|
49
41
|
}
|
|
50
42
|
function formatInvalidValue(diagnostic) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return lines.join('\n');
|
|
43
|
+
const data = diagnostic.data;
|
|
44
|
+
const lines = [
|
|
45
|
+
`[WARNING CONFIG_INVALID_VALUE]: ${diagnostic.message}`,
|
|
46
|
+
` Path: ${data.path}`,
|
|
47
|
+
` Rule: ${data.rule}`
|
|
48
|
+
];
|
|
49
|
+
if (diagnostic.hint) lines.push(` → ${diagnostic.hint}`);
|
|
50
|
+
return lines.join("\n");
|
|
60
51
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
const configFormatters = {
|
|
53
|
+
CONFIG_INVALID_JSON: formatInvalidJson,
|
|
54
|
+
CONFIG_TYPE_MISMATCH: formatTypeMismatch,
|
|
55
|
+
CONFIG_UNKNOWN_KEY: formatUnknownKey,
|
|
56
|
+
CONFIG_UNRESOLVED_DEFAULT_REGISTRY: formatUnresolvedRegistry,
|
|
57
|
+
CONFIG_INVALID_VALUE: formatInvalidValue
|
|
67
58
|
};
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { configFormatters };
|
|
68
62
|
//# sourceMappingURL=configFormatters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configFormatters.js","
|
|
1
|
+
{"version":3,"file":"configFormatters.js","names":[],"sources":["../../../src/formatters/config/configFormatters.ts"],"sourcesContent":["import type {\n ConfigInvalidJsonDiagnostic,\n ConfigInvalidValueDiagnostic,\n ConfigTypeMismatchDiagnostic,\n ConfigUnknownKeyDiagnostic,\n ConfigUnresolvedDefaultRegistryDiagnostic,\n Diagnostic,\n} from '@uapkg/diagnostics';\nimport type { FormatterMap } from '../../contracts/FormatterTypes.js';\n\nfunction formatInvalidJson(diagnostic: Diagnostic): string {\n const data = (diagnostic as ConfigInvalidJsonDiagnostic).data;\n const lines = [\n `[WARNING CONFIG_INVALID_JSON]: ${diagnostic.message}`,\n ` File: ${data.filePath}`,\n ` Reason: ${data.reason}`,\n ];\n if (diagnostic.hint) lines.push(` → ${diagnostic.hint}`);\n return lines.join('\\n');\n}\n\nfunction formatTypeMismatch(diagnostic: Diagnostic): string {\n const data = (diagnostic as ConfigTypeMismatchDiagnostic).data;\n const lines = [\n `[WARNING CONFIG_TYPE_MISMATCH]: ${diagnostic.message}`,\n ` Path: ${data.path}`,\n ` Expected: ${data.expectedType}`,\n ` Actual: ${data.actualType}`,\n ` Source: ${data.source}`,\n ];\n if (data.filePath) lines.push(` File: ${data.filePath}`);\n if (diagnostic.hint) lines.push(` → ${diagnostic.hint}`);\n return lines.join('\\n');\n}\n\nfunction formatUnknownKey(diagnostic: Diagnostic): string {\n const data = (diagnostic as ConfigUnknownKeyDiagnostic).data;\n const lines = [\n `[WARNING CONFIG_UNKNOWN_KEY]: ${diagnostic.message}`,\n ` Path: ${data.path}`,\n ` Source: ${data.source}`,\n ];\n if (data.filePath) lines.push(` File: ${data.filePath}`);\n if (diagnostic.hint) lines.push(` → ${diagnostic.hint}`);\n return lines.join('\\n');\n}\n\nfunction formatUnresolvedRegistry(diagnostic: Diagnostic): string {\n const data = (diagnostic as ConfigUnresolvedDefaultRegistryDiagnostic).data;\n const lines = [\n `[WARNING CONFIG_UNRESOLVED_DEFAULT_REGISTRY]: ${diagnostic.message}`,\n ` Registry: ${data.registryName}`,\n ];\n if (diagnostic.hint) lines.push(` → ${diagnostic.hint}`);\n return lines.join('\\n');\n}\n\nfunction formatInvalidValue(diagnostic: Diagnostic): string {\n const data = (diagnostic as ConfigInvalidValueDiagnostic).data;\n const lines = [\n `[WARNING CONFIG_INVALID_VALUE]: ${diagnostic.message}`,\n ` Path: ${data.path}`,\n ` Rule: ${data.rule}`,\n ];\n if (diagnostic.hint) lines.push(` → ${diagnostic.hint}`);\n return lines.join('\\n');\n}\n\nexport const configFormatters: FormatterMap = {\n CONFIG_INVALID_JSON: formatInvalidJson,\n CONFIG_TYPE_MISMATCH: formatTypeMismatch,\n CONFIG_UNKNOWN_KEY: formatUnknownKey,\n CONFIG_UNRESOLVED_DEFAULT_REGISTRY: formatUnresolvedRegistry,\n CONFIG_INVALID_VALUE: formatInvalidValue,\n};\n"],"mappings":";AAUA,SAAS,kBAAkB,YAAgC;CACzD,MAAM,OAAQ,WAA2C;CACzD,MAAM,QAAQ;EACZ,kCAAkC,WAAW;EAC7C,WAAW,KAAK;EAChB,aAAa,KAAK;CACpB;CACA,IAAI,WAAW,MAAM,MAAM,KAAK,OAAO,WAAW,MAAM;CACxD,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,mBAAmB,YAAgC;CAC1D,MAAM,OAAQ,WAA4C;CAC1D,MAAM,QAAQ;EACZ,mCAAmC,WAAW;EAC9C,WAAW,KAAK;EAChB,eAAe,KAAK;EACpB,aAAa,KAAK;EAClB,aAAa,KAAK;CACpB;CACA,IAAI,KAAK,UAAU,MAAM,KAAK,WAAW,KAAK,UAAU;CACxD,IAAI,WAAW,MAAM,MAAM,KAAK,OAAO,WAAW,MAAM;CACxD,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,iBAAiB,YAAgC;CACxD,MAAM,OAAQ,WAA0C;CACxD,MAAM,QAAQ;EACZ,iCAAiC,WAAW;EAC5C,WAAW,KAAK;EAChB,aAAa,KAAK;CACpB;CACA,IAAI,KAAK,UAAU,MAAM,KAAK,WAAW,KAAK,UAAU;CACxD,IAAI,WAAW,MAAM,MAAM,KAAK,OAAO,WAAW,MAAM;CACxD,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,yBAAyB,YAAgC;CAChE,MAAM,OAAQ,WAAyD;CACvE,MAAM,QAAQ,CACZ,iDAAiD,WAAW,WAC5D,eAAe,KAAK,cACtB;CACA,IAAI,WAAW,MAAM,MAAM,KAAK,OAAO,WAAW,MAAM;CACxD,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,mBAAmB,YAAgC;CAC1D,MAAM,OAAQ,WAA4C;CAC1D,MAAM,QAAQ;EACZ,mCAAmC,WAAW;EAC9C,WAAW,KAAK;EAChB,WAAW,KAAK;CAClB;CACA,IAAI,WAAW,MAAM,MAAM,KAAK,OAAO,WAAW,MAAM;CACxD,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,MAAa,mBAAiC;CAC5C,qBAAqB;CACrB,sBAAsB;CACtB,oBAAoB;CACpB,oCAAoC;CACpC,sBAAsB;AACxB"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { FormatterMap } from "../../contracts/FormatterTypes.js";
|
|
2
|
+
//#region src/formatters/installer/installerFormatters.d.ts
|
|
3
|
+
declare const installerFormatters: FormatterMap;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { installerFormatters };
|
|
3
6
|
//# sourceMappingURL=installerFormatters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installerFormatters.d.ts","
|
|
1
|
+
{"version":3,"file":"installerFormatters.d.ts","names":[],"sources":["../../../src/formatters/installer/installerFormatters.ts"],"mappings":";;cAoEa,qBAAqB"}
|
|
@@ -1,63 +1,67 @@
|
|
|
1
|
+
//#region src/formatters/installer/installerFormatters.ts
|
|
1
2
|
function formatDownloadFailed(d) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return lines.join('\n');
|
|
3
|
+
const data = d.data;
|
|
4
|
+
const lines = [
|
|
5
|
+
`[ERROR DOWNLOAD_FAILED]: ${d.message}`,
|
|
6
|
+
` Package : ${data.packageName}`,
|
|
7
|
+
` URL : ${data.url}`,
|
|
8
|
+
` Attempt : ${data.attempt}`
|
|
9
|
+
];
|
|
10
|
+
if (d.hint) lines.push(` → ${d.hint}`);
|
|
11
|
+
return lines.join("\n");
|
|
12
12
|
}
|
|
13
13
|
function formatDownloadHttpStatus(d) {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const data = d.data;
|
|
15
|
+
return `[ERROR DOWNLOAD_HTTP_STATUS]: ${d.message}\n URL: ${data.url}\n Status: ${data.status}`;
|
|
16
16
|
}
|
|
17
17
|
function formatNetworkTimeout(d) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const data = d.data;
|
|
19
|
+
const lines = [
|
|
20
|
+
`[ERROR NETWORK_TIMEOUT]: ${d.message}`,
|
|
21
|
+
` URL: ${data.url}`,
|
|
22
|
+
` Timeout: ${data.timeoutSeconds}s`
|
|
23
|
+
];
|
|
24
|
+
if (d.hint) lines.push(` → ${d.hint}`);
|
|
25
|
+
return lines.join("\n");
|
|
23
26
|
}
|
|
24
27
|
function formatNetworkRetriesExhausted(d) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return lines.join('\n');
|
|
28
|
+
const data = d.data;
|
|
29
|
+
const lines = [
|
|
30
|
+
`[ERROR NETWORK_RETRIES_EXHAUSTED]: ${d.message}`,
|
|
31
|
+
` URL: ${data.url}`,
|
|
32
|
+
` Attempts: ${data.attempts}`
|
|
33
|
+
];
|
|
34
|
+
if (d.hint) lines.push(` → ${d.hint}`);
|
|
35
|
+
return lines.join("\n");
|
|
34
36
|
}
|
|
35
37
|
function formatIntegrityMismatch(d) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return lines.join('\n');
|
|
38
|
+
const data = d.data;
|
|
39
|
+
const lines = [
|
|
40
|
+
`[ERROR INTEGRITY_MISMATCH]: ${d.message}`,
|
|
41
|
+
` Expected: ${data.expected}`,
|
|
42
|
+
` Actual : ${data.actual}`
|
|
43
|
+
];
|
|
44
|
+
if (d.hint) lines.push(` → ${d.hint}`);
|
|
45
|
+
return lines.join("\n");
|
|
45
46
|
}
|
|
46
47
|
function formatExtractionFailed(d) {
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
const data = d.data;
|
|
49
|
+
return `[ERROR EXTRACTION_FAILED]: ${d.message}\n Path: ${data.path}`;
|
|
49
50
|
}
|
|
50
51
|
function formatDiskRemoveFailed(d) {
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
const data = d.data;
|
|
53
|
+
return `[ERROR DISK_REMOVE_FAILED]: ${d.message}\n Path: ${data.path}`;
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
const installerFormatters = {
|
|
56
|
+
DOWNLOAD_FAILED: formatDownloadFailed,
|
|
57
|
+
DOWNLOAD_HTTP_STATUS: formatDownloadHttpStatus,
|
|
58
|
+
NETWORK_TIMEOUT: formatNetworkTimeout,
|
|
59
|
+
NETWORK_RETRIES_EXHAUSTED: formatNetworkRetriesExhausted,
|
|
60
|
+
INTEGRITY_MISMATCH: formatIntegrityMismatch,
|
|
61
|
+
EXTRACTION_FAILED: formatExtractionFailed,
|
|
62
|
+
DISK_REMOVE_FAILED: formatDiskRemoveFailed
|
|
62
63
|
};
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
export { installerFormatters };
|
|
63
67
|
//# sourceMappingURL=installerFormatters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installerFormatters.js","
|
|
1
|
+
{"version":3,"file":"installerFormatters.js","names":[],"sources":["../../../src/formatters/installer/installerFormatters.ts"],"sourcesContent":["import type {\n Diagnostic,\n DiskRemoveFailedDiagnostic,\n DownloadFailedDiagnostic,\n DownloadHttpStatusDiagnostic,\n ExtractionFailedDiagnostic,\n IntegrityMismatchDiagnostic,\n NetworkRetriesExhaustedDiagnostic,\n NetworkTimeoutDiagnostic,\n} from '@uapkg/diagnostics';\nimport type { FormatterMap } from '../../contracts/FormatterTypes.js';\n\nfunction formatDownloadFailed(d: Diagnostic): string {\n const data = (d as DownloadFailedDiagnostic).data;\n const lines = [\n `[ERROR DOWNLOAD_FAILED]: ${d.message}`,\n ` Package : ${data.packageName}`,\n ` URL : ${data.url}`,\n ` Attempt : ${data.attempt}`,\n ];\n if (d.hint) lines.push(` → ${d.hint}`);\n return lines.join('\\n');\n}\n\nfunction formatDownloadHttpStatus(d: Diagnostic): string {\n const data = (d as DownloadHttpStatusDiagnostic).data;\n return `[ERROR DOWNLOAD_HTTP_STATUS]: ${d.message}\\n URL: ${data.url}\\n Status: ${data.status}`;\n}\n\nfunction formatNetworkTimeout(d: Diagnostic): string {\n const data = (d as NetworkTimeoutDiagnostic).data;\n const lines = [`[ERROR NETWORK_TIMEOUT]: ${d.message}`, ` URL: ${data.url}`, ` Timeout: ${data.timeoutSeconds}s`];\n if (d.hint) lines.push(` → ${d.hint}`);\n return lines.join('\\n');\n}\n\nfunction formatNetworkRetriesExhausted(d: Diagnostic): string {\n const data = (d as NetworkRetriesExhaustedDiagnostic).data;\n const lines = [\n `[ERROR NETWORK_RETRIES_EXHAUSTED]: ${d.message}`,\n ` URL: ${data.url}`,\n ` Attempts: ${data.attempts}`,\n ];\n if (d.hint) lines.push(` → ${d.hint}`);\n return lines.join('\\n');\n}\n\nfunction formatIntegrityMismatch(d: Diagnostic): string {\n const data = (d as IntegrityMismatchDiagnostic).data;\n const lines = [\n `[ERROR INTEGRITY_MISMATCH]: ${d.message}`,\n ` Expected: ${data.expected}`,\n ` Actual : ${data.actual}`,\n ];\n if (d.hint) lines.push(` → ${d.hint}`);\n return lines.join('\\n');\n}\n\nfunction formatExtractionFailed(d: Diagnostic): string {\n const data = (d as ExtractionFailedDiagnostic).data;\n return `[ERROR EXTRACTION_FAILED]: ${d.message}\\n Path: ${data.path}`;\n}\n\nfunction formatDiskRemoveFailed(d: Diagnostic): string {\n const data = (d as DiskRemoveFailedDiagnostic).data;\n return `[ERROR DISK_REMOVE_FAILED]: ${d.message}\\n Path: ${data.path}`;\n}\n\nexport const installerFormatters: FormatterMap = {\n DOWNLOAD_FAILED: formatDownloadFailed,\n DOWNLOAD_HTTP_STATUS: formatDownloadHttpStatus,\n NETWORK_TIMEOUT: formatNetworkTimeout,\n NETWORK_RETRIES_EXHAUSTED: formatNetworkRetriesExhausted,\n INTEGRITY_MISMATCH: formatIntegrityMismatch,\n EXTRACTION_FAILED: formatExtractionFailed,\n DISK_REMOVE_FAILED: formatDiskRemoveFailed,\n};\n"],"mappings":";AAYA,SAAS,qBAAqB,GAAuB;CACnD,MAAM,OAAQ,EAA+B;CAC7C,MAAM,QAAQ;EACZ,4BAA4B,EAAE;EAC9B,eAAe,KAAK;EACpB,eAAe,KAAK;EACpB,eAAe,KAAK;CACtB;CACA,IAAI,EAAE,MAAM,MAAM,KAAK,OAAO,EAAE,MAAM;CACtC,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,yBAAyB,GAAuB;CACvD,MAAM,OAAQ,EAAmC;CACjD,OAAO,iCAAiC,EAAE,QAAQ,WAAW,KAAK,IAAI,cAAc,KAAK;AAC3F;AAEA,SAAS,qBAAqB,GAAuB;CACnD,MAAM,OAAQ,EAA+B;CAC7C,MAAM,QAAQ;EAAC,4BAA4B,EAAE;EAAW,UAAU,KAAK;EAAO,cAAc,KAAK,eAAe;CAAE;CAClH,IAAI,EAAE,MAAM,MAAM,KAAK,OAAO,EAAE,MAAM;CACtC,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,8BAA8B,GAAuB;CAC5D,MAAM,OAAQ,EAAwC;CACtD,MAAM,QAAQ;EACZ,sCAAsC,EAAE;EACxC,UAAU,KAAK;EACf,eAAe,KAAK;CACtB;CACA,IAAI,EAAE,MAAM,MAAM,KAAK,OAAO,EAAE,MAAM;CACtC,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,wBAAwB,GAAuB;CACtD,MAAM,OAAQ,EAAkC;CAChD,MAAM,QAAQ;EACZ,+BAA+B,EAAE;EACjC,eAAe,KAAK;EACpB,eAAe,KAAK;CACtB;CACA,IAAI,EAAE,MAAM,MAAM,KAAK,OAAO,EAAE,MAAM;CACtC,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,uBAAuB,GAAuB;CACrD,MAAM,OAAQ,EAAiC;CAC/C,OAAO,8BAA8B,EAAE,QAAQ,YAAY,KAAK;AAClE;AAEA,SAAS,uBAAuB,GAAuB;CACrD,MAAM,OAAQ,EAAiC;CAC/C,OAAO,+BAA+B,EAAE,QAAQ,YAAY,KAAK;AACnE;AAEA,MAAa,sBAAoC;CAC/C,iBAAiB;CACjB,sBAAsB;CACtB,iBAAiB;CACjB,2BAA2B;CAC3B,oBAAoB;CACpB,mBAAmB;CACnB,oBAAoB;AACtB"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { FormatterMap } from "../../contracts/FormatterTypes.js";
|
|
2
|
+
//#region src/formatters/manifest/manifestFormatters.d.ts
|
|
3
|
+
declare const manifestFormatters: FormatterMap;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { manifestFormatters };
|
|
3
6
|
//# sourceMappingURL=manifestFormatters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifestFormatters.d.ts","
|
|
1
|
+
{"version":3,"file":"manifestFormatters.d.ts","names":[],"sources":["../../../src/formatters/manifest/manifestFormatters.ts"],"mappings":";;cA2Da,oBAAoB"}
|
|
@@ -1,57 +1,52 @@
|
|
|
1
|
+
//#region src/formatters/manifest/manifestFormatters.ts
|
|
1
2
|
function formatManifestInvalid(d) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (d.hint)
|
|
8
|
-
lines.push(` → ${d.hint}`);
|
|
9
|
-
return lines.join('\n');
|
|
3
|
+
const data = d.data;
|
|
4
|
+
const lines = [`[ERROR MANIFEST_INVALID]: ${d.message}`, ` File: ${data.filePath}`];
|
|
5
|
+
for (const issue of data.issues) lines.push(` - ${issue}`);
|
|
6
|
+
if (d.hint) lines.push(` → ${d.hint}`);
|
|
7
|
+
return lines.join("\n");
|
|
10
8
|
}
|
|
11
9
|
function formatForbiddenOverrides(d) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return lines.join('\n');
|
|
10
|
+
const data = d.data;
|
|
11
|
+
const lines = [
|
|
12
|
+
`[ERROR FORBIDDEN_OVERRIDES]: ${d.message}`,
|
|
13
|
+
` Kind: ${data.manifestKind}`,
|
|
14
|
+
` File: ${data.filePath}`
|
|
15
|
+
];
|
|
16
|
+
if (d.hint) lines.push(` → ${d.hint}`);
|
|
17
|
+
return lines.join("\n");
|
|
21
18
|
}
|
|
22
19
|
function formatLockfileMissing(d) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return lines.join('\n');
|
|
20
|
+
const data = d.data;
|
|
21
|
+
const lines = [`[${d.level.toUpperCase()} LOCKFILE_MISSING]: ${d.message}`, ` File: ${data.filePath}`];
|
|
22
|
+
if (d.hint) lines.push(` → ${d.hint}`);
|
|
23
|
+
return lines.join("\n");
|
|
28
24
|
}
|
|
29
25
|
function formatDependencyNotFound(d) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return lines.join('\n');
|
|
26
|
+
const data = d.data;
|
|
27
|
+
const lines = [`[INFO DEPENDENCY_NOT_FOUND]: ${d.message}`, ` Package: ${data.packageName}`];
|
|
28
|
+
if (d.hint) lines.push(` → ${d.hint}`);
|
|
29
|
+
return lines.join("\n");
|
|
35
30
|
}
|
|
36
31
|
function formatLockfileOutOfSync(d) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (d.hint)
|
|
47
|
-
lines.push(` → ${d.hint}`);
|
|
48
|
-
return lines.join('\n');
|
|
32
|
+
const data = d.data;
|
|
33
|
+
const lines = ["[ERROR LOCKFILE_OUT_OF_SYNC]: Lockfile is out of sync with the following errors:"];
|
|
34
|
+
data.issues.forEach((issue, index) => {
|
|
35
|
+
lines.push(` ${index + 1}. [${issue.severity.toUpperCase()} ${issue.code}] ${issue.message}`);
|
|
36
|
+
});
|
|
37
|
+
if (data.additionalIssues > 0) lines.push(` There are ${data.additionalIssues} additional errors.`);
|
|
38
|
+
lines.push(` View the full error list at: ${data.logFilePath}`);
|
|
39
|
+
if (d.hint) lines.push(` → ${d.hint}`);
|
|
40
|
+
return lines.join("\n");
|
|
49
41
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
const manifestFormatters = {
|
|
43
|
+
MANIFEST_INVALID: formatManifestInvalid,
|
|
44
|
+
FORBIDDEN_OVERRIDES: formatForbiddenOverrides,
|
|
45
|
+
LOCKFILE_MISSING: formatLockfileMissing,
|
|
46
|
+
DEPENDENCY_NOT_FOUND: formatDependencyNotFound,
|
|
47
|
+
LOCKFILE_OUT_OF_SYNC: formatLockfileOutOfSync
|
|
56
48
|
};
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { manifestFormatters };
|
|
57
52
|
//# sourceMappingURL=manifestFormatters.js.map
|