@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.
- 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,56 +1,161 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box, Text } from "ink";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/ink/components/manifestInkComponents.tsx
|
|
3
5
|
function buildLockfileIssueKey(issue) {
|
|
4
|
-
|
|
6
|
+
return `${issue.severity}:${issue.code}:${issue.packageName ?? ""}:${issue.message}`;
|
|
5
7
|
}
|
|
6
|
-
function FileIssues({ filePath, issues
|
|
7
|
-
|
|
8
|
+
function FileIssues({ filePath, issues }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
10
|
+
flexDirection: "column",
|
|
11
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: ["File: ", /* @__PURE__ */ jsx(Text, {
|
|
12
|
+
color: "cyan",
|
|
13
|
+
children: filePath
|
|
14
|
+
})] }), issues.map((issue) => /* @__PURE__ */ jsxs(Text, { children: [" • ", issue] }, issue))]
|
|
15
|
+
});
|
|
8
16
|
}
|
|
9
17
|
function ManifestInvalid({ diagnostic }) {
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
const data = diagnostic.data;
|
|
19
|
+
return /* @__PURE__ */ jsx(FileIssues, {
|
|
20
|
+
filePath: data.filePath,
|
|
21
|
+
issues: data.issues
|
|
22
|
+
});
|
|
12
23
|
}
|
|
13
24
|
function LockfileInvalid({ diagnostic }) {
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
const data = diagnostic.data;
|
|
26
|
+
return /* @__PURE__ */ jsx(FileIssues, {
|
|
27
|
+
filePath: data.filePath,
|
|
28
|
+
issues: data.issues
|
|
29
|
+
});
|
|
16
30
|
}
|
|
17
31
|
function ForbiddenOverrides({ diagnostic }) {
|
|
18
|
-
|
|
19
|
-
|
|
32
|
+
const data = diagnostic.data;
|
|
33
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx(Text, {
|
|
35
|
+
color: "cyan",
|
|
36
|
+
children: data.manifestKind
|
|
37
|
+
}),
|
|
38
|
+
" manifest at ",
|
|
39
|
+
/* @__PURE__ */ jsx(Text, {
|
|
40
|
+
color: "cyan",
|
|
41
|
+
children: data.filePath
|
|
42
|
+
}),
|
|
43
|
+
" cannot declare overrides."
|
|
44
|
+
] });
|
|
20
45
|
}
|
|
21
46
|
function UnresolvedRegistry({ diagnostic }) {
|
|
22
|
-
|
|
23
|
-
|
|
47
|
+
const data = diagnostic.data;
|
|
48
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
49
|
+
"Dependency ",
|
|
50
|
+
/* @__PURE__ */ jsx(Text, {
|
|
51
|
+
color: "cyan",
|
|
52
|
+
children: data.dependencyName
|
|
53
|
+
}),
|
|
54
|
+
" references registry",
|
|
55
|
+
" ",
|
|
56
|
+
/* @__PURE__ */ jsx(Text, {
|
|
57
|
+
color: "yellow",
|
|
58
|
+
children: data.registryName
|
|
59
|
+
}),
|
|
60
|
+
", but no such registry is configured."
|
|
61
|
+
] });
|
|
24
62
|
}
|
|
25
63
|
function ManifestReadError({ diagnostic }) {
|
|
26
|
-
|
|
27
|
-
|
|
64
|
+
const data = diagnostic.data;
|
|
65
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
66
|
+
flexDirection: "column",
|
|
67
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
68
|
+
"Could not read ",
|
|
69
|
+
/* @__PURE__ */ jsx(Text, {
|
|
70
|
+
color: "cyan",
|
|
71
|
+
children: data.filePath
|
|
72
|
+
}),
|
|
73
|
+
"."
|
|
74
|
+
] }), /* @__PURE__ */ jsx(Text, {
|
|
75
|
+
color: "gray",
|
|
76
|
+
children: data.reason
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
28
79
|
}
|
|
29
80
|
function ManifestWriteError({ diagnostic }) {
|
|
30
|
-
|
|
31
|
-
|
|
81
|
+
const data = diagnostic.data;
|
|
82
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
83
|
+
flexDirection: "column",
|
|
84
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
85
|
+
"Could not write ",
|
|
86
|
+
/* @__PURE__ */ jsx(Text, {
|
|
87
|
+
color: "cyan",
|
|
88
|
+
children: data.filePath
|
|
89
|
+
}),
|
|
90
|
+
"."
|
|
91
|
+
] }), /* @__PURE__ */ jsx(Text, {
|
|
92
|
+
color: "gray",
|
|
93
|
+
children: data.reason
|
|
94
|
+
})]
|
|
95
|
+
});
|
|
32
96
|
}
|
|
33
97
|
function LockfileMissing({ diagnostic }) {
|
|
34
|
-
|
|
35
|
-
|
|
98
|
+
const data = diagnostic.data;
|
|
99
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
100
|
+
"Lockfile not found at ",
|
|
101
|
+
/* @__PURE__ */ jsx(Text, {
|
|
102
|
+
color: "cyan",
|
|
103
|
+
children: data.filePath
|
|
104
|
+
}),
|
|
105
|
+
"."
|
|
106
|
+
] });
|
|
36
107
|
}
|
|
37
108
|
function DependencyNotFound({ diagnostic }) {
|
|
38
|
-
|
|
39
|
-
|
|
109
|
+
const data = diagnostic.data;
|
|
110
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
111
|
+
"Package ",
|
|
112
|
+
/* @__PURE__ */ jsx(Text, {
|
|
113
|
+
color: "cyan",
|
|
114
|
+
children: data.packageName
|
|
115
|
+
}),
|
|
116
|
+
" is not declared and will not be removed."
|
|
117
|
+
] });
|
|
40
118
|
}
|
|
41
119
|
function LockfileOutOfSync({ diagnostic }) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
120
|
+
const data = diagnostic.data;
|
|
121
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
122
|
+
flexDirection: "column",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ jsx(Text, { children: "Lockfile is out of sync with the following errors:" }),
|
|
125
|
+
data.issues.map((issue, index) => /* @__PURE__ */ jsxs(Text, { children: [
|
|
126
|
+
" ",
|
|
127
|
+
index + 1,
|
|
128
|
+
". [",
|
|
129
|
+
issue.severity.toUpperCase(),
|
|
130
|
+
" ",
|
|
131
|
+
issue.code,
|
|
132
|
+
"] ",
|
|
133
|
+
issue.message
|
|
134
|
+
] }, buildLockfileIssueKey(issue))),
|
|
135
|
+
data.additionalIssues > 0 ? /* @__PURE__ */ jsxs(Text, { children: [
|
|
136
|
+
"There are ",
|
|
137
|
+
data.additionalIssues,
|
|
138
|
+
" additional errors."
|
|
139
|
+
] }) : null,
|
|
140
|
+
/* @__PURE__ */ jsxs(Text, { children: ["View full list at: ", /* @__PURE__ */ jsx(Text, {
|
|
141
|
+
color: "cyan",
|
|
142
|
+
children: data.logFilePath
|
|
143
|
+
})] })
|
|
144
|
+
]
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const manifestInkComponents = {
|
|
148
|
+
MANIFEST_INVALID: ManifestInvalid,
|
|
149
|
+
LOCKFILE_INVALID: LockfileInvalid,
|
|
150
|
+
LOCKFILE_MISSING: LockfileMissing,
|
|
151
|
+
LOCKFILE_OUT_OF_SYNC: LockfileOutOfSync,
|
|
152
|
+
FORBIDDEN_OVERRIDES: ForbiddenOverrides,
|
|
153
|
+
UNRESOLVED_REGISTRY: UnresolvedRegistry,
|
|
154
|
+
MANIFEST_READ_ERROR: ManifestReadError,
|
|
155
|
+
MANIFEST_WRITE_ERROR: ManifestWriteError,
|
|
156
|
+
DEPENDENCY_NOT_FOUND: DependencyNotFound
|
|
55
157
|
};
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
export { manifestInkComponents };
|
|
56
161
|
//# sourceMappingURL=manifestInkComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifestInkComponents.js","
|
|
1
|
+
{"version":3,"file":"manifestInkComponents.js","names":[],"sources":["../../../src/ink/components/manifestInkComponents.tsx"],"sourcesContent":["import type {\n DependencyNotFoundDiagnostic,\n ForbiddenOverridesDiagnostic,\n LockfileInvalidDiagnostic,\n LockfileMissingDiagnostic,\n LockfileOutOfSyncDiagnostic,\n ManifestInvalidDiagnostic,\n ManifestReadErrorDiagnostic,\n ManifestWriteErrorDiagnostic,\n UnresolvedRegistryDiagnostic,\n} from '@uapkg/diagnostics';\nimport { Box, Text } from 'ink';\nimport type { ReactElement } from 'react';\nimport type { DiagnosticBodyProps, DiagnosticInkComponentMap } from '../contracts/InkTypes.js';\n\nfunction buildLockfileIssueKey(issue: {\n readonly severity: string;\n readonly code: string;\n readonly message: string;\n readonly packageName?: string;\n}): string {\n return `${issue.severity}:${issue.code}:${issue.packageName ?? ''}:${issue.message}`;\n}\n\nfunction FileIssues({\n filePath,\n issues,\n}: {\n readonly filePath: string;\n readonly issues: readonly string[];\n}): ReactElement {\n return (\n <Box flexDirection=\"column\">\n <Text>\n File: <Text color=\"cyan\">{filePath}</Text>\n </Text>\n {issues.map((issue) => (\n <Text key={issue}> • {issue}</Text>\n ))}\n </Box>\n );\n}\n\nfunction ManifestInvalid({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as ManifestInvalidDiagnostic).data;\n return <FileIssues filePath={data.filePath} issues={data.issues} />;\n}\n\nfunction LockfileInvalid({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as LockfileInvalidDiagnostic).data;\n return <FileIssues filePath={data.filePath} issues={data.issues} />;\n}\n\nfunction ForbiddenOverrides({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as ForbiddenOverridesDiagnostic).data;\n return (\n <Text>\n <Text color=\"cyan\">{data.manifestKind}</Text> manifest at <Text color=\"cyan\">{data.filePath}</Text> cannot declare\n overrides.\n </Text>\n );\n}\n\nfunction UnresolvedRegistry({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as UnresolvedRegistryDiagnostic).data;\n return (\n <Text>\n Dependency <Text color=\"cyan\">{data.dependencyName}</Text> references registry{' '}\n <Text color=\"yellow\">{data.registryName}</Text>, but no such registry is configured.\n </Text>\n );\n}\n\nfunction ManifestReadError({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as ManifestReadErrorDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Could not read <Text color=\"cyan\">{data.filePath}</Text>.\n </Text>\n <Text color=\"gray\">{data.reason}</Text>\n </Box>\n );\n}\n\nfunction ManifestWriteError({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as ManifestWriteErrorDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Could not write <Text color=\"cyan\">{data.filePath}</Text>.\n </Text>\n <Text color=\"gray\">{data.reason}</Text>\n </Box>\n );\n}\n\nfunction LockfileMissing({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as LockfileMissingDiagnostic).data;\n return (\n <Text>\n Lockfile not found at <Text color=\"cyan\">{data.filePath}</Text>.\n </Text>\n );\n}\n\nfunction DependencyNotFound({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as DependencyNotFoundDiagnostic).data;\n return (\n <Text>\n Package <Text color=\"cyan\">{data.packageName}</Text> is not declared and will not be removed.\n </Text>\n );\n}\n\nfunction LockfileOutOfSync({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as LockfileOutOfSyncDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>Lockfile is out of sync with the following errors:</Text>\n {data.issues.map((issue, index) => (\n <Text key={buildLockfileIssueKey(issue)}>\n {' '}\n {index + 1}. [{issue.severity.toUpperCase()} {issue.code}] {issue.message}\n </Text>\n ))}\n {data.additionalIssues > 0 ? <Text>There are {data.additionalIssues} additional errors.</Text> : null}\n <Text>\n View full list at: <Text color=\"cyan\">{data.logFilePath}</Text>\n </Text>\n </Box>\n );\n}\n\nexport const manifestInkComponents: DiagnosticInkComponentMap = {\n MANIFEST_INVALID: ManifestInvalid,\n LOCKFILE_INVALID: LockfileInvalid,\n LOCKFILE_MISSING: LockfileMissing,\n LOCKFILE_OUT_OF_SYNC: LockfileOutOfSync,\n FORBIDDEN_OVERRIDES: ForbiddenOverrides,\n UNRESOLVED_REGISTRY: UnresolvedRegistry,\n MANIFEST_READ_ERROR: ManifestReadError,\n MANIFEST_WRITE_ERROR: ManifestWriteError,\n DEPENDENCY_NOT_FOUND: DependencyNotFound,\n};\n"],"mappings":";;;;AAeA,SAAS,sBAAsB,OAKpB;CACT,OAAO,GAAG,MAAM,SAAS,GAAG,MAAM,KAAK,GAAG,MAAM,eAAe,GAAG,GAAG,MAAM;AAC7E;AAEA,SAAS,WAAW,EAClB,UACA,UAIe;CACf,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD,aAAM,UACE,oBAAC,MAAD;GAAM,OAAM;aAAQ;EAAe,EACrC,MACL,OAAO,KAAK,UACX,qBAAC,MAAD,aAAkB,OAAI,KAAY,KAAvB,KAAuB,CACnC,CACE;;AAET;AAEA,SAAS,gBAAgB,EAAE,cAAiD;CAC1E,MAAM,OAAQ,WAAyC;CACvD,OAAO,oBAAC,YAAD;EAAY,UAAU,KAAK;EAAU,QAAQ,KAAK;CAAS;AACpE;AAEA,SAAS,gBAAgB,EAAE,cAAiD;CAC1E,MAAM,OAAQ,WAAyC;CACvD,OAAO,oBAAC,YAAD;EAAY,UAAU,KAAK;EAAU,QAAQ,KAAK;CAAS;AACpE;AAEA,SAAS,mBAAmB,EAAE,cAAiD;CAC7E,M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AAS,kBAAkB,EAAE,cAAiD;CAC5E,MAAM,OAAQ,WAA2C;CACzD,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB;GACE,oBAAC,MAAD,YAAM,qDAAwD;GAC7D,KAAK,OAAO,KAAK,OAAO,UACvB,qBAAC,MAAD;IACG;IACA,QAAQ;IAAE;IAAI,MAAM,SAAS,YAAY;IAAE;IAAE,MAAM;IAAK;IAAG,MAAM;GAC9D,KAHK,sBAAsB,KAAK,CAGhC,CACP;GACA,KAAK,mBAAmB,IAAI,qBAAC,MAAD;IAAM;IAAW,KAAK;IAAiB;GAAyB,OAAI;GACjG,qBAAC,MAAD,aAAM,uBACe,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAkB,EAC1D;EACH;;AAET;AAEA,MAAa,wBAAmD;CAC9D,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAClB,sBAAsB;CACtB,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CACrB,sBAAsB;CACtB,sBAAsB;AACxB"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { DiagnosticInkComponentMap } from "../contracts/InkTypes.js";
|
|
2
|
+
//#region src/ink/components/packInkComponents.d.ts
|
|
3
|
+
declare const packInkComponents: DiagnosticInkComponentMap;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { packInkComponents };
|
|
3
6
|
//# sourceMappingURL=packInkComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packInkComponents.d.ts","
|
|
1
|
+
{"version":3,"file":"packInkComponents.d.ts","names":[],"sources":["../../../src/ink/components/packInkComponents.tsx"],"mappings":";;cAca,mBAAmB"}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Text } from "ink";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/ink/components/packInkComponents.tsx
|
|
3
5
|
function UpluginMissing({ diagnostic }) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
const data = diagnostic.data;
|
|
7
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
8
|
+
"No ",
|
|
9
|
+
/* @__PURE__ */ jsx(Text, {
|
|
10
|
+
color: "yellow",
|
|
11
|
+
children: "*.uplugin"
|
|
12
|
+
}),
|
|
13
|
+
" file found in ",
|
|
14
|
+
/* @__PURE__ */ jsx(Text, {
|
|
15
|
+
color: "cyan",
|
|
16
|
+
children: data.pluginRoot
|
|
17
|
+
}),
|
|
18
|
+
"."
|
|
19
|
+
] });
|
|
6
20
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
const packInkComponents = { UPLUGIN_MISSING: UpluginMissing };
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { packInkComponents };
|
|
10
25
|
//# sourceMappingURL=packInkComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packInkComponents.js","
|
|
1
|
+
{"version":3,"file":"packInkComponents.js","names":[],"sources":["../../../src/ink/components/packInkComponents.tsx"],"sourcesContent":["import type { UpluginMissingDiagnostic } from '@uapkg/diagnostics';\nimport { Text } from 'ink';\nimport type { ReactElement } from 'react';\nimport type { DiagnosticBodyProps, DiagnosticInkComponentMap } from '../contracts/InkTypes.js';\n\nfunction UpluginMissing({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as UpluginMissingDiagnostic).data;\n return (\n <Text>\n No <Text color=\"yellow\">*.uplugin</Text> file found in <Text color=\"cyan\">{data.pluginRoot}</Text>.\n </Text>\n );\n}\n\nexport const packInkComponents: DiagnosticInkComponentMap = {\n UPLUGIN_MISSING: UpluginMissing,\n};\n"],"mappings":";;;;AAKA,SAAS,eAAe,EAAE,cAAiD;CACzE,MAAM,OAAQ,WAAwC;CACtD,OACE,qBAAC,MAAD;EAAM;EACD,oBAAC,MAAD;GAAM,OAAM;aAAS;EAAe;EAAC;EAAe,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAiB;EAAC;CAC9F;AAEV;AAEA,MAAa,oBAA+C,EAC1D,iBAAiB,eACnB"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { DiagnosticInkComponentMap } from "../contracts/InkTypes.js";
|
|
2
|
+
//#region src/ink/components/postinstallInkComponents.d.ts
|
|
3
|
+
declare const postinstallInkComponents: DiagnosticInkComponentMap;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { postinstallInkComponents };
|
|
3
6
|
//# sourceMappingURL=postinstallInkComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstallInkComponents.d.ts","
|
|
1
|
+
{"version":3,"file":"postinstallInkComponents.d.ts","names":[],"sources":["../../../src/ink/components/postinstallInkComponents.tsx"],"mappings":";;cA+Fa,0BAA0B"}
|
|
@@ -1,35 +1,138 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box, Text } from "ink";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/ink/components/postinstallInkComponents.tsx
|
|
3
5
|
function PolicyDenied({ diagnostic }) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
const data = diagnostic.data;
|
|
7
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
8
|
+
/* @__PURE__ */ jsx(Text, {
|
|
9
|
+
color: "cyan",
|
|
10
|
+
children: data.packageName
|
|
11
|
+
}),
|
|
12
|
+
" (registry ",
|
|
13
|
+
/* @__PURE__ */ jsx(Text, {
|
|
14
|
+
color: "cyan",
|
|
15
|
+
children: data.registry
|
|
16
|
+
}),
|
|
17
|
+
") was skipped by policy ",
|
|
18
|
+
/* @__PURE__ */ jsx(Text, {
|
|
19
|
+
color: "yellow",
|
|
20
|
+
children: data.policy
|
|
21
|
+
}),
|
|
22
|
+
" (from ",
|
|
23
|
+
/* @__PURE__ */ jsx(Text, {
|
|
24
|
+
color: "gray",
|
|
25
|
+
children: data.resolvedFrom
|
|
26
|
+
}),
|
|
27
|
+
")."
|
|
28
|
+
] });
|
|
6
29
|
}
|
|
7
30
|
function LoadFailed({ diagnostic }) {
|
|
8
|
-
|
|
9
|
-
|
|
31
|
+
const data = diagnostic.data;
|
|
32
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
33
|
+
flexDirection: "column",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
36
|
+
"Failed to load postinstall for ",
|
|
37
|
+
/* @__PURE__ */ jsx(Text, {
|
|
38
|
+
color: "cyan",
|
|
39
|
+
children: data.packageName
|
|
40
|
+
}),
|
|
41
|
+
"."
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsxs(Text, { children: ["Entry: ", /* @__PURE__ */ jsx(Text, {
|
|
44
|
+
color: "cyan",
|
|
45
|
+
children: data.entryFile
|
|
46
|
+
})] }),
|
|
47
|
+
/* @__PURE__ */ jsx(Text, {
|
|
48
|
+
color: "gray",
|
|
49
|
+
children: data.reason
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
10
53
|
}
|
|
11
54
|
function InvalidExport({ diagnostic }) {
|
|
12
|
-
|
|
13
|
-
|
|
55
|
+
const data = diagnostic.data;
|
|
56
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
57
|
+
flexDirection: "column",
|
|
58
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
59
|
+
"Export is invalid in ",
|
|
60
|
+
/* @__PURE__ */ jsx(Text, {
|
|
61
|
+
color: "cyan",
|
|
62
|
+
children: data.entryFile
|
|
63
|
+
}),
|
|
64
|
+
":"
|
|
65
|
+
] }), data.issues.map((issue) => /* @__PURE__ */ jsxs(Text, { children: [" • ", issue] }, issue))]
|
|
66
|
+
});
|
|
14
67
|
}
|
|
15
68
|
function DuplicateEntry({ diagnostic }) {
|
|
16
|
-
|
|
17
|
-
|
|
69
|
+
const data = diagnostic.data;
|
|
70
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
71
|
+
flexDirection: "column",
|
|
72
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
73
|
+
color: "cyan",
|
|
74
|
+
children: data.packageName
|
|
75
|
+
}), " has multiple postinstall entry files:"] }), data.candidates.map((c) => /* @__PURE__ */ jsxs(Text, { children: [
|
|
76
|
+
" ",
|
|
77
|
+
"• ",
|
|
78
|
+
/* @__PURE__ */ jsx(Text, {
|
|
79
|
+
color: "yellow",
|
|
80
|
+
children: c
|
|
81
|
+
})
|
|
82
|
+
] }, c))]
|
|
83
|
+
});
|
|
18
84
|
}
|
|
19
85
|
function MarkerCorrupt({ diagnostic }) {
|
|
20
|
-
|
|
21
|
-
|
|
86
|
+
const data = diagnostic.data;
|
|
87
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
88
|
+
flexDirection: "column",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsxs(Text, { children: ["File: ", /* @__PURE__ */ jsx(Text, {
|
|
91
|
+
color: "cyan",
|
|
92
|
+
children: data.file
|
|
93
|
+
})] }),
|
|
94
|
+
/* @__PURE__ */ jsxs(Text, { children: ["Plugin: ", /* @__PURE__ */ jsx(Text, {
|
|
95
|
+
color: "cyan",
|
|
96
|
+
children: data.packageName
|
|
97
|
+
})] }),
|
|
98
|
+
/* @__PURE__ */ jsx(Text, {
|
|
99
|
+
color: "gray",
|
|
100
|
+
children: data.reason
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
});
|
|
22
104
|
}
|
|
23
105
|
function EsbuildError({ diagnostic }) {
|
|
24
|
-
|
|
25
|
-
|
|
106
|
+
const data = diagnostic.data;
|
|
107
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
108
|
+
flexDirection: "column",
|
|
109
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
110
|
+
"esbuild failed on ",
|
|
111
|
+
/* @__PURE__ */ jsx(Text, {
|
|
112
|
+
color: "cyan",
|
|
113
|
+
children: data.entryFile
|
|
114
|
+
}),
|
|
115
|
+
" for ",
|
|
116
|
+
/* @__PURE__ */ jsx(Text, {
|
|
117
|
+
color: "cyan",
|
|
118
|
+
children: data.packageName
|
|
119
|
+
}),
|
|
120
|
+
"."
|
|
121
|
+
] }), /* @__PURE__ */ jsx(Text, {
|
|
122
|
+
color: "gray",
|
|
123
|
+
children: data.reason
|
|
124
|
+
})]
|
|
125
|
+
});
|
|
26
126
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
127
|
+
const postinstallInkComponents = {
|
|
128
|
+
POSTINSTALL_POLICY_DENIED: PolicyDenied,
|
|
129
|
+
POSTINSTALL_LOAD_FAILED: LoadFailed,
|
|
130
|
+
POSTINSTALL_INVALID_EXPORT: InvalidExport,
|
|
131
|
+
POSTINSTALL_DUPLICATE_ENTRY: DuplicateEntry,
|
|
132
|
+
POSTINSTALL_MARKER_CORRUPT: MarkerCorrupt,
|
|
133
|
+
POSTINSTALL_ESBUILD_ERROR: EsbuildError
|
|
34
134
|
};
|
|
135
|
+
|
|
136
|
+
//#endregion
|
|
137
|
+
export { postinstallInkComponents };
|
|
35
138
|
//# sourceMappingURL=postinstallInkComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstallInkComponents.js","
|
|
1
|
+
{"version":3,"file":"postinstallInkComponents.js","names":[],"sources":["../../../src/ink/components/postinstallInkComponents.tsx"],"sourcesContent":["import type {\n PostinstallDuplicateEntryDiagnostic,\n PostinstallEsbuildErrorDiagnostic,\n PostinstallInvalidExportDiagnostic,\n PostinstallLoadFailedDiagnostic,\n PostinstallMarkerCorruptDiagnostic,\n PostinstallPolicyDeniedDiagnostic,\n} from '@uapkg/diagnostics';\nimport { Box, Text } from 'ink';\nimport type { ReactElement } from 'react';\nimport type { DiagnosticBodyProps, DiagnosticInkComponentMap } from '../contracts/InkTypes.js';\n\nfunction PolicyDenied({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as PostinstallPolicyDeniedDiagnostic).data;\n return (\n <Text>\n <Text color=\"cyan\">{data.packageName}</Text> (registry <Text color=\"cyan\">{data.registry}</Text>) was skipped by\n policy <Text color=\"yellow\">{data.policy}</Text> (from <Text color=\"gray\">{data.resolvedFrom}</Text>).\n </Text>\n );\n}\n\nfunction LoadFailed({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as PostinstallLoadFailedDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Failed to load postinstall for <Text color=\"cyan\">{data.packageName}</Text>.\n </Text>\n <Text>\n Entry: <Text color=\"cyan\">{data.entryFile}</Text>\n </Text>\n <Text color=\"gray\">{data.reason}</Text>\n </Box>\n );\n}\n\nfunction InvalidExport({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as PostinstallInvalidExportDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Export is invalid in <Text color=\"cyan\">{data.entryFile}</Text>:\n </Text>\n {data.issues.map((issue) => (\n <Text key={issue}> • {issue}</Text>\n ))}\n </Box>\n );\n}\n\nfunction DuplicateEntry({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as PostinstallDuplicateEntryDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n <Text color=\"cyan\">{data.packageName}</Text> has multiple postinstall entry files:\n </Text>\n {data.candidates.map((c) => (\n <Text key={c}>\n {' '}\n • <Text color=\"yellow\">{c}</Text>\n </Text>\n ))}\n </Box>\n );\n}\n\nfunction MarkerCorrupt({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as PostinstallMarkerCorruptDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n File: <Text color=\"cyan\">{data.file}</Text>\n </Text>\n <Text>\n Plugin: <Text color=\"cyan\">{data.packageName}</Text>\n </Text>\n <Text color=\"gray\">{data.reason}</Text>\n </Box>\n );\n}\n\nfunction EsbuildError({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as PostinstallEsbuildErrorDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n esbuild failed on <Text color=\"cyan\">{data.entryFile}</Text> for <Text color=\"cyan\">{data.packageName}</Text>.\n </Text>\n <Text color=\"gray\">{data.reason}</Text>\n </Box>\n );\n}\n\nexport const postinstallInkComponents: DiagnosticInkComponentMap = {\n POSTINSTALL_POLICY_DENIED: PolicyDenied,\n POSTINSTALL_LOAD_FAILED: LoadFailed,\n POSTINSTALL_INVALID_EXPORT: InvalidExport,\n POSTINSTALL_DUPLICATE_ENTRY: DuplicateEntry,\n POSTINSTALL_MARKER_CORRUPT: MarkerCorrupt,\n POSTINSTALL_ESBUILD_ERROR: EsbuildError,\n};\n"],"mappings":";;;;AAYA,SAAS,aAAa,EAAE,cAAiD;CACvE,MAAM,OAAQ,WAAiD;CAC/D,OACE,qBAAC,MAAD;EACE,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAkB;EAAC;EAAW,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAe;EAAC;EACzF,oBAAC,MAAD;GAAM,OAAM;aAAU,KAAK;EAAa;EAAC;EAAO,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAmB;EAAC;CAChG;AAEV;AAEA,SAAS,WAAW,EAAE,cAAiD;CACrE,MAAM,OAAQ,WAA+C;CAC7D,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB;GACE,qBAAC,MAAD;IAAM;IAC2B,oBAAC,MAAD;KAAM,OAAM;eAAQ,KAAK;IAAkB;IAAC;GACvE;GACN,qBAAC,MAAD,aAAM,WACG,oBAAC,MAAD;IAAM,OAAM;cA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K;GAAkB;GAAC;EACzG,MACN,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAa,EACnC;;AAET;AAEA,MAAa,2BAAsD;CACjE,2BAA2B;CAC3B,yBAAyB;CACzB,4BAA4B;CAC5B,6BAA6B;CAC7B,4BAA4B;CAC5B,2BAA2B;AAC7B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DiagnosticInkComponentMap } from "../contracts/InkTypes.js";
|
|
2
|
+
//#region src/ink/components/publishingInkComponents.d.ts
|
|
3
|
+
declare const publishingInkComponents: DiagnosticInkComponentMap;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { publishingInkComponents };
|
|
6
|
+
//# sourceMappingURL=publishingInkComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishingInkComponents.d.ts","names":[],"sources":["../../../src/ink/components/publishingInkComponents.tsx"],"mappings":";;cAiDa,yBAAyB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { publishFactLabels, publishResourceLabel } from "../../formatters/publishing/publishingFormatters.js";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/ink/components/publishingInkComponents.tsx
|
|
6
|
+
const PublishRequestFailed = ({ diagnostic }) => {
|
|
7
|
+
const d = diagnostic;
|
|
8
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
9
|
+
flexDirection: "column",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx(Text, { children: d.message }),
|
|
12
|
+
d.data.facts.map((fact) => /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsxs(Text, {
|
|
13
|
+
color: "gray",
|
|
14
|
+
children: [publishFactLabels[fact.kind], ": "]
|
|
15
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
16
|
+
color: "cyan",
|
|
17
|
+
children: fact.value
|
|
18
|
+
})] }, `${fact.kind}:${fact.value}`)),
|
|
19
|
+
d.data.serverCode !== void 0 ? /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
20
|
+
color: "gray",
|
|
21
|
+
children: "Server code: "
|
|
22
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
23
|
+
color: "yellow",
|
|
24
|
+
children: d.data.serverCode
|
|
25
|
+
})] }) : null,
|
|
26
|
+
d.data.status !== void 0 ? /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
27
|
+
color: "gray",
|
|
28
|
+
children: "HTTP status: "
|
|
29
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
30
|
+
color: "yellow",
|
|
31
|
+
children: d.data.status
|
|
32
|
+
})] }) : null,
|
|
33
|
+
d.hint ? /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
34
|
+
color: "magentaBright",
|
|
35
|
+
children: "→ "
|
|
36
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
37
|
+
color: "white",
|
|
38
|
+
children: d.hint
|
|
39
|
+
})] }) : null,
|
|
40
|
+
d.data.resources.map((resource) => /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsxs(Text, {
|
|
41
|
+
color: "gray",
|
|
42
|
+
children: [publishResourceLabel(resource), ": "]
|
|
43
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
44
|
+
color: resource.kind === "command" ? "cyanBright" : "blueBright",
|
|
45
|
+
children: resource.kind === "command" ? resource.command : resource.url
|
|
46
|
+
})] }, `${resource.kind}:${resource.kind === "command" ? resource.command : resource.url}`))
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
PublishRequestFailed.rendersHint = true;
|
|
51
|
+
const publishingInkComponents = { PUBLISH_REQUEST_FAILED: PublishRequestFailed };
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
export { publishingInkComponents };
|
|
55
|
+
//# sourceMappingURL=publishingInkComponents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishingInkComponents.js","names":[],"sources":["../../../src/ink/components/publishingInkComponents.tsx"],"sourcesContent":["import type { PublishRequestFailedDiagnostic } from '@uapkg/diagnostics';\nimport { Box, Text } from 'ink';\nimport type { ReactElement } from 'react';\nimport { publishFactLabels, publishResourceLabel } from '../../formatters/publishing/publishingFormatters.js';\nimport type { DiagnosticBodyComponent, DiagnosticBodyProps, DiagnosticInkComponentMap } from '../contracts/InkTypes.js';\n\nconst PublishRequestFailed: DiagnosticBodyComponent = ({ diagnostic }: DiagnosticBodyProps): ReactElement => {\n const d = diagnostic as PublishRequestFailedDiagnostic;\n return (\n <Box flexDirection=\"column\">\n <Text>{d.message}</Text>\n {d.data.facts.map((fact) => (\n <Text key={`${fact.kind}:${fact.value}`}>\n <Text color=\"gray\">{publishFactLabels[fact.kind]}: </Text>\n <Text color=\"cyan\">{fact.value}</Text>\n </Text>\n ))}\n {d.data.serverCode !== undefined ? (\n <Text>\n <Text color=\"gray\">Server code: </Text>\n <Text color=\"yellow\">{d.data.serverCode}</Text>\n </Text>\n ) : null}\n {d.data.status !== undefined ? (\n <Text>\n <Text color=\"gray\">HTTP status: </Text>\n <Text color=\"yellow\">{d.data.status}</Text>\n </Text>\n ) : null}\n {d.hint ? (\n <Text>\n <Text color=\"magentaBright\">→ </Text>\n <Text color=\"white\">{d.hint}</Text>\n </Text>\n ) : null}\n {d.data.resources.map((resource) => (\n <Text key={`${resource.kind}:${resource.kind === 'command' ? resource.command : resource.url}`}>\n <Text color=\"gray\">{publishResourceLabel(resource)}: </Text>\n <Text color={resource.kind === 'command' ? 'cyanBright' : 'blueBright'}>\n {resource.kind === 'command' ? resource.command : resource.url}\n </Text>\n </Text>\n ))}\n </Box>\n );\n};\n\nPublishRequestFailed.rendersHint = true;\n\nexport const publishingInkComponents: DiagnosticInkComponentMap = {\n PUBLISH_REQUEST_FAILED: PublishRequestFailed,\n};\n"],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1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { DiagnosticInkComponentMap } from "../contracts/InkTypes.js";
|
|
2
|
+
//#region src/ink/components/registryInkComponents.d.ts
|
|
3
|
+
declare const registryInkComponents: DiagnosticInkComponentMap;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { registryInkComponents };
|
|
3
6
|
//# sourceMappingURL=registryInkComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registryInkComponents.d.ts","
|
|
1
|
+
{"version":3,"file":"registryInkComponents.d.ts","names":[],"sources":["../../../src/ink/components/registryInkComponents.tsx"],"mappings":";;cA8Ga,uBAAuB"}
|