@uapkg/diagnostics-format 1.3.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,40 +1,125 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box, Text } from "ink";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/ink/components/registryInkComponents.tsx
|
|
3
5
|
function NetworkError({ diagnostic }) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
const data = diagnostic.data;
|
|
7
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: ["URL: ", /* @__PURE__ */ jsx(Text, {
|
|
10
|
+
color: "gray",
|
|
11
|
+
children: data.url
|
|
12
|
+
})] }), /* @__PURE__ */ jsx(Text, {
|
|
13
|
+
color: "gray",
|
|
14
|
+
children: data.reason
|
|
15
|
+
})]
|
|
16
|
+
});
|
|
6
17
|
}
|
|
7
18
|
function GitError({ diagnostic }) {
|
|
8
|
-
|
|
9
|
-
|
|
19
|
+
const data = diagnostic.data;
|
|
20
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
21
|
+
flexDirection: "column",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ jsxs(Text, { children: ["Command: ", /* @__PURE__ */ jsx(Text, {
|
|
24
|
+
color: "gray",
|
|
25
|
+
children: data.command
|
|
26
|
+
})] }),
|
|
27
|
+
/* @__PURE__ */ jsxs(Text, { children: ["Exit: ", /* @__PURE__ */ jsx(Text, {
|
|
28
|
+
color: "yellow",
|
|
29
|
+
children: data.exitCode
|
|
30
|
+
})] }),
|
|
31
|
+
data.stderr ? /* @__PURE__ */ jsx(Text, {
|
|
32
|
+
color: "gray",
|
|
33
|
+
children: data.stderr
|
|
34
|
+
}) : null
|
|
35
|
+
]
|
|
36
|
+
});
|
|
10
37
|
}
|
|
11
38
|
function SchemaInvalid({ diagnostic }) {
|
|
12
|
-
|
|
13
|
-
|
|
39
|
+
const data = diagnostic.data;
|
|
40
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
41
|
+
flexDirection: "column",
|
|
42
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: ["File: ", /* @__PURE__ */ jsx(Text, {
|
|
43
|
+
color: "cyan",
|
|
44
|
+
children: data.filePath
|
|
45
|
+
})] }), data.issues.map((issue) => /* @__PURE__ */ jsxs(Text, { children: [" • ", issue] }, issue))]
|
|
46
|
+
});
|
|
14
47
|
}
|
|
15
48
|
function RegistryNotFound({ diagnostic }) {
|
|
16
|
-
|
|
17
|
-
|
|
49
|
+
const data = diagnostic.data;
|
|
50
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
51
|
+
"Registry ",
|
|
52
|
+
/* @__PURE__ */ jsx(Text, {
|
|
53
|
+
color: "cyan",
|
|
54
|
+
children: data.registryName
|
|
55
|
+
}),
|
|
56
|
+
" is not defined in configuration."
|
|
57
|
+
] });
|
|
18
58
|
}
|
|
19
59
|
function LockAcquisitionFailed({ diagnostic }) {
|
|
20
|
-
|
|
21
|
-
|
|
60
|
+
const data = diagnostic.data;
|
|
61
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
62
|
+
flexDirection: "column",
|
|
63
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: ["Lock path: ", /* @__PURE__ */ jsx(Text, {
|
|
64
|
+
color: "cyan",
|
|
65
|
+
children: data.lockPath
|
|
66
|
+
})] }), /* @__PURE__ */ jsxs(Text, { children: ["Held by PID ", /* @__PURE__ */ jsx(Text, {
|
|
67
|
+
color: "yellow",
|
|
68
|
+
children: data.ownerPid
|
|
69
|
+
})] })]
|
|
70
|
+
});
|
|
22
71
|
}
|
|
23
72
|
function CacheReadError({ diagnostic }) {
|
|
24
|
-
|
|
25
|
-
|
|
73
|
+
const data = diagnostic.data;
|
|
74
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
75
|
+
flexDirection: "column",
|
|
76
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: ["Cache: ", /* @__PURE__ */ jsx(Text, {
|
|
77
|
+
color: "cyan",
|
|
78
|
+
children: data.cachePath
|
|
79
|
+
})] }), /* @__PURE__ */ jsx(Text, {
|
|
80
|
+
color: "gray",
|
|
81
|
+
children: data.reason
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
26
84
|
}
|
|
27
85
|
function RegistryUnreachable({ diagnostic }) {
|
|
28
|
-
|
|
29
|
-
|
|
86
|
+
const data = diagnostic.data;
|
|
87
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
88
|
+
flexDirection: "column",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsxs(Text, { children: ["Registry: ", /* @__PURE__ */ jsx(Text, {
|
|
91
|
+
color: "cyan",
|
|
92
|
+
children: data.registryName
|
|
93
|
+
})] }),
|
|
94
|
+
/* @__PURE__ */ jsxs(Text, { children: ["URL: ", /* @__PURE__ */ jsx(Text, {
|
|
95
|
+
color: "cyan",
|
|
96
|
+
children: data.url
|
|
97
|
+
})] }),
|
|
98
|
+
data.httpStatus !== void 0 ? /* @__PURE__ */ jsxs(Text, { children: ["HTTP status: ", /* @__PURE__ */ jsx(Text, {
|
|
99
|
+
color: "yellow",
|
|
100
|
+
children: data.httpStatus
|
|
101
|
+
})] }) : null,
|
|
102
|
+
/* @__PURE__ */ jsx(Text, {
|
|
103
|
+
color: "gray",
|
|
104
|
+
children: data.cause
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ jsxs(Text, {
|
|
107
|
+
color: "gray",
|
|
108
|
+
children: ["Cache state: ", data.initialized ? "initialized" : "not initialized"]
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
});
|
|
30
112
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
113
|
+
const registryInkComponents = {
|
|
114
|
+
NETWORK_ERROR: NetworkError,
|
|
115
|
+
GIT_ERROR: GitError,
|
|
116
|
+
SCHEMA_INVALID: SchemaInvalid,
|
|
117
|
+
REGISTRY_NOT_FOUND: RegistryNotFound,
|
|
118
|
+
LOCK_ACQUISITION_FAILED: LockAcquisitionFailed,
|
|
119
|
+
CACHE_READ_ERROR: CacheReadError,
|
|
120
|
+
REGISTRY_UNREACHABLE: RegistryUnreachable
|
|
39
121
|
};
|
|
122
|
+
|
|
123
|
+
//#endregion
|
|
124
|
+
export { registryInkComponents };
|
|
40
125
|
//# sourceMappingURL=registryInkComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registryInkComponents.js","
|
|
1
|
+
{"version":3,"file":"registryInkComponents.js","names":[],"sources":["../../../src/ink/components/registryInkComponents.tsx"],"sourcesContent":["import type {\n CacheReadErrorDiagnostic,\n GitErrorDiagnostic,\n LockAcquisitionFailedDiagnostic,\n NetworkErrorDiagnostic,\n RegistryNotFoundDiagnostic,\n RegistryUnreachableDiagnostic,\n SchemaInvalidDiagnostic,\n} from '@uapkg/diagnostics';\nimport { Box, Text } from 'ink';\nimport type { ReactElement } from 'react';\nimport type { DiagnosticBodyProps, DiagnosticInkComponentMap } from '../contracts/InkTypes.js';\n\nfunction NetworkError({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as NetworkErrorDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n URL: <Text color=\"gray\">{data.url}</Text>\n </Text>\n <Text color=\"gray\">{data.reason}</Text>\n </Box>\n );\n}\n\nfunction GitError({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as GitErrorDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Command: <Text color=\"gray\">{data.command}</Text>\n </Text>\n <Text>\n Exit: <Text color=\"yellow\">{data.exitCode}</Text>\n </Text>\n {data.stderr ? <Text color=\"gray\">{data.stderr}</Text> : null}\n </Box>\n );\n}\n\nfunction SchemaInvalid({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as SchemaInvalidDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n File: <Text color=\"cyan\">{data.filePath}</Text>\n </Text>\n {data.issues.map((issue) => (\n <Text key={issue}> • {issue}</Text>\n ))}\n </Box>\n );\n}\n\nfunction RegistryNotFound({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as RegistryNotFoundDiagnostic).data;\n return (\n <Text>\n Registry <Text color=\"cyan\">{data.registryName}</Text> is not defined in configuration.\n </Text>\n );\n}\n\nfunction LockAcquisitionFailed({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as LockAcquisitionFailedDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Lock path: <Text color=\"cyan\">{data.lockPath}</Text>\n </Text>\n <Text>\n Held by PID <Text color=\"yellow\">{data.ownerPid}</Text>\n </Text>\n </Box>\n );\n}\n\nfunction CacheReadError({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as CacheReadErrorDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Cache: <Text color=\"cyan\">{data.cachePath}</Text>\n </Text>\n <Text color=\"gray\">{data.reason}</Text>\n </Box>\n );\n}\n\nfunction RegistryUnreachable({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as RegistryUnreachableDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Registry: <Text color=\"cyan\">{data.registryName}</Text>\n </Text>\n <Text>\n URL: <Text color=\"cyan\">{data.url}</Text>\n </Text>\n {data.httpStatus !== undefined ? (\n <Text>\n HTTP status: <Text color=\"yellow\">{data.httpStatus}</Text>\n </Text>\n ) : null}\n <Text color=\"gray\">{data.cause}</Text>\n <Text color=\"gray\">Cache state: {data.initialized ? 'initialized' : 'not initialized'}</Text>\n </Box>\n );\n}\n\nexport const registryInkComponents: DiagnosticInkComponentMap = {\n NETWORK_ERROR: NetworkError,\n GIT_ERROR: GitError,\n SCHEMA_INVALID: SchemaInvalid,\n REGISTRY_NOT_FOUND: RegistryNotFound,\n LOCK_ACQUISITION_FAILED: LockAcquisitionFailed,\n CACHE_READ_ERROR: CacheReadError,\n REGISTRY_UNREACHABLE: RegistryUnreachable,\n};\n"],"mappings":";;;;AAaA,SAAS,aAAa,EAAE,cAAiD;CACvE,MAAM,OAAQ,WAAsC;CACpD,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD,aAAM,SACC,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAU,EACpC,MACN,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAa,EACnC;;AAET;AAEA,SAAS,SAAS,EAAE,cAAiD;CACnE,MAAM,OAAQ,WAAkC;CAChD,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB;GACE,qBAAC,MAAD,aAAM,aACK,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAc,EAC5C;GACN,qBAAC,MAAD,aAAM,UACE,oBAAC,MAAD;IAAM,OAAM;cAAU,KAAK;GAAe,EAC5C;GACL,KAAK,SAAS,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAa,KAAI;EACtD;;AAET;AAEA,SAAS,cAAc,EAAE,cAAiD;CACxE,MAAM,OAAQ,WAAuC;CACrD,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD,aAAM,UACE,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAe,EAC1C,MACL,KAAK,OAAO,KAAK,UAChB,qBAAC,MAAD,aAAkB,OAAI,KAAY,KAAvB,KAAuB,CACnC,CACE;;AAET;AAEA,SAAS,iBAAiB,EAAE,cAAiD;CAC3E,MAAM,OAAQ,WAA0C;CACxD,OACE,qBAAC,MAAD;EAAM;EACK,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAmB;EAAC;CAClD;AAEV;AAEA,SAAS,sBAAsB,EAAE,cAAiD;CAChF,MAAM,OAAQ,WAA+C;CAC7D,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD,aAAM,eACO,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAe,EAC/C,MACN,qBAAC,MAAD,aAAM,gBACQ,oBAAC,MAAD;GAAM,OAAM;aAAU,KAAK;EAAe,EAClD,IACH;;AAET;AAEA,SAAS,eAAe,EAAE,cAAiD;CACzE,MAAM,OAAQ,WAAwC;CACtD,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD,aAAM,WACG,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAgB,EAC5C,MACN,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAa,EACnC;;AAET;AAEA,SAAS,oBAAoB,EAAE,cAAiD;CAC9E,MAAM,OAAQ,WAA6C;CAC3D,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB;GACE,qBAAC,MAAD,aAAM,cACM,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAmB,EAClD;GACN,qBAAC,MAAD,aAAM,SACC,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAU,EACpC;GACL,KAAK,eAAe,SACnB,qBAAC,MAAD,aAAM,iBACS,oBAAC,MAAD;IAAM,OAAM;cAAU,KAAK;GAAiB,EACrD,OACJ;GACJ,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAY;GACrC,qBAAC,MAAD;IAAM,OAAM;cAAZ,CAAmB,iBAAc,KAAK,cAAc,gBAAgB,iBAAwB;;EACzF;;AAET;AAEA,MAAa,wBAAmD;CAC9D,eAAe;CACf,WAAW;CACX,gBAAgB;CAChB,oBAAoB;CACpB,yBAAyB;CACzB,kBAAkB;CAClB,sBAAsB;AACxB"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { DiagnosticInkComponentMap } from "../contracts/InkTypes.js";
|
|
2
|
+
//#region src/ink/components/resolverInkComponents.d.ts
|
|
3
|
+
declare const resolverInkComponents: DiagnosticInkComponentMap;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { resolverInkComponents };
|
|
3
6
|
//# sourceMappingURL=resolverInkComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolverInkComponents.d.ts","
|
|
1
|
+
{"version":3,"file":"resolverInkComponents.d.ts","names":[],"sources":["../../../src/ink/components/resolverInkComponents.tsx"],"mappings":";;cA0Ea,uBAAuB"}
|
|
@@ -1,30 +1,109 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box, Text } from "ink";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/ink/components/resolverInkComponents.tsx
|
|
3
5
|
function VersionConflict({ diagnostic }) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
const data = diagnostic.data;
|
|
7
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
10
|
+
"Package ",
|
|
11
|
+
/* @__PURE__ */ jsx(Text, {
|
|
12
|
+
color: "cyan",
|
|
13
|
+
children: data.packageName
|
|
14
|
+
}),
|
|
15
|
+
" in registry ",
|
|
16
|
+
/* @__PURE__ */ jsx(Text, {
|
|
17
|
+
color: "cyan",
|
|
18
|
+
children: data.registry
|
|
19
|
+
}),
|
|
20
|
+
" ",
|
|
21
|
+
"resolved to conflicting versions:"
|
|
22
|
+
] }), data.versions.map((v) => /* @__PURE__ */ jsxs(Text, { children: [
|
|
23
|
+
" ",
|
|
24
|
+
"• ",
|
|
25
|
+
/* @__PURE__ */ jsx(Text, {
|
|
26
|
+
color: "yellow",
|
|
27
|
+
children: v
|
|
28
|
+
})
|
|
29
|
+
] }, v))]
|
|
30
|
+
});
|
|
6
31
|
}
|
|
7
32
|
function CircularDep({ diagnostic }) {
|
|
8
|
-
|
|
9
|
-
|
|
33
|
+
const data = diagnostic.data;
|
|
34
|
+
return /* @__PURE__ */ jsxs(Text, { children: ["Cycle: ", /* @__PURE__ */ jsx(Text, {
|
|
35
|
+
color: "yellow",
|
|
36
|
+
children: data.path.join(" → ")
|
|
37
|
+
})] });
|
|
10
38
|
}
|
|
11
39
|
function PackageNotFound({ diagnostic }) {
|
|
12
|
-
|
|
13
|
-
|
|
40
|
+
const data = diagnostic.data;
|
|
41
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
42
|
+
"Could not find ",
|
|
43
|
+
/* @__PURE__ */ jsx(Text, {
|
|
44
|
+
color: "cyan",
|
|
45
|
+
children: data.packageName
|
|
46
|
+
}),
|
|
47
|
+
" in registry ",
|
|
48
|
+
/* @__PURE__ */ jsx(Text, {
|
|
49
|
+
color: "cyan",
|
|
50
|
+
children: data.registry
|
|
51
|
+
}),
|
|
52
|
+
"."
|
|
53
|
+
] });
|
|
14
54
|
}
|
|
15
55
|
function VersionNotFound({ diagnostic }) {
|
|
16
|
-
|
|
17
|
-
|
|
56
|
+
const data = diagnostic.data;
|
|
57
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
58
|
+
flexDirection: "column",
|
|
59
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
60
|
+
"No version of ",
|
|
61
|
+
/* @__PURE__ */ jsx(Text, {
|
|
62
|
+
color: "cyan",
|
|
63
|
+
children: data.packageName
|
|
64
|
+
}),
|
|
65
|
+
" matches",
|
|
66
|
+
" ",
|
|
67
|
+
/* @__PURE__ */ jsx(Text, {
|
|
68
|
+
color: "yellow",
|
|
69
|
+
children: data.versionRange
|
|
70
|
+
}),
|
|
71
|
+
" (registry ",
|
|
72
|
+
/* @__PURE__ */ jsx(Text, {
|
|
73
|
+
color: "cyan",
|
|
74
|
+
children: data.registry
|
|
75
|
+
}),
|
|
76
|
+
")."
|
|
77
|
+
] }), data.availableVersions.length > 0 ? /* @__PURE__ */ jsxs(Text, { children: ["Available: ", data.availableVersions.join(", ")] }) : /* @__PURE__ */ jsx(Text, {
|
|
78
|
+
color: "gray",
|
|
79
|
+
children: "No versions are published yet."
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
18
82
|
}
|
|
19
83
|
function RegistryNameCollision({ diagnostic }) {
|
|
20
|
-
|
|
21
|
-
|
|
84
|
+
const data = diagnostic.data;
|
|
85
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
86
|
+
/* @__PURE__ */ jsx(Text, {
|
|
87
|
+
color: "cyan",
|
|
88
|
+
children: data.packageName
|
|
89
|
+
}),
|
|
90
|
+
" is required from multiple registries:",
|
|
91
|
+
" ",
|
|
92
|
+
/* @__PURE__ */ jsx(Text, {
|
|
93
|
+
color: "yellow",
|
|
94
|
+
children: data.registries.join(", ")
|
|
95
|
+
}),
|
|
96
|
+
"."
|
|
97
|
+
] });
|
|
22
98
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
99
|
+
const resolverInkComponents = {
|
|
100
|
+
VERSION_CONFLICT: VersionConflict,
|
|
101
|
+
CIRCULAR_DEP: CircularDep,
|
|
102
|
+
PACKAGE_NOT_FOUND: PackageNotFound,
|
|
103
|
+
VERSION_NOT_FOUND: VersionNotFound,
|
|
104
|
+
REGISTRY_NAME_COLLISION: RegistryNameCollision
|
|
29
105
|
};
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
export { resolverInkComponents };
|
|
30
109
|
//# sourceMappingURL=resolverInkComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolverInkComponents.js","
|
|
1
|
+
{"version":3,"file":"resolverInkComponents.js","names":[],"sources":["../../../src/ink/components/resolverInkComponents.tsx"],"sourcesContent":["import type {\n CircularDepDiagnostic,\n PackageNotFoundDiagnostic,\n RegistryNameCollisionDiagnostic,\n VersionConflictDiagnostic,\n VersionNotFoundDiagnostic,\n} from '@uapkg/diagnostics';\nimport { Box, Text } from 'ink';\nimport type { ReactElement } from 'react';\nimport type { DiagnosticBodyProps, DiagnosticInkComponentMap } from '../contracts/InkTypes.js';\n\nfunction VersionConflict({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as VersionConflictDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Package <Text color=\"cyan\">{data.packageName}</Text> in registry <Text color=\"cyan\">{data.registry}</Text>{' '}\n resolved to conflicting versions:\n </Text>\n {data.versions.map((v) => (\n <Text key={v}>\n {' '}\n • <Text color=\"yellow\">{v}</Text>\n </Text>\n ))}\n </Box>\n );\n}\n\nfunction CircularDep({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as CircularDepDiagnostic).data;\n return (\n <Text>\n Cycle: <Text color=\"yellow\">{data.path.join(' → ')}</Text>\n </Text>\n );\n}\n\nfunction PackageNotFound({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as PackageNotFoundDiagnostic).data;\n return (\n <Text>\n Could not find <Text color=\"cyan\">{data.packageName}</Text> in registry <Text color=\"cyan\">{data.registry}</Text>.\n </Text>\n );\n}\n\nfunction VersionNotFound({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as VersionNotFoundDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n No version of <Text color=\"cyan\">{data.packageName}</Text> matches{' '}\n <Text color=\"yellow\">{data.versionRange}</Text> (registry <Text color=\"cyan\">{data.registry}</Text>).\n </Text>\n {data.availableVersions.length > 0 ? (\n <Text>Available: {data.availableVersions.join(', ')}</Text>\n ) : (\n <Text color=\"gray\">No versions are published yet.</Text>\n )}\n </Box>\n );\n}\n\nfunction RegistryNameCollision({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as RegistryNameCollisionDiagnostic).data;\n return (\n <Text>\n <Text color=\"cyan\">{data.packageName}</Text> is required from multiple registries:{' '}\n <Text color=\"yellow\">{data.registries.join(', ')}</Text>.\n </Text>\n );\n}\n\nexport const resolverInkComponents: DiagnosticInkComponentMap = {\n VERSION_CONFLICT: VersionConflict,\n CIRCULAR_DEP: CircularDep,\n PACKAGE_NOT_FOUND: PackageNotFound,\n VERSION_NOT_FOUND: VersionNotFound,\n REGISTRY_NAME_COLLISION: RegistryNameCollision,\n};\n"],"mappings":";;;;AAWA,SAAS,gBAAgB,EAAE,cAAiD;CAC1E,MAAM,OAAQ,WAAyC;CACvD,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD;GAAM;GACI,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAkB;GAAC;GAAa,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAe;GAAE;GAAI;EAE3G,MACL,KAAK,SAAS,KAAK,MAClB,qBAAC,MAAD;GACG;GAAI;GACH,oBAAC,MAAD;IAAM,OAAM;cAAU;GAAQ;EAC5B,KAHK,CAGL,CACP,CACE;;AAET;AAEA,SAAS,YAAY,EAAE,cAAiD;CACtE,MAAM,OAAQ,WAAqC;CACnD,OACE,qBAAC,MAAD,aAAM,WACG,oBAAC,MAAD;EAAM,OAAM;YAAU,KAAK,KAAK,KAAK,KAAK;CAAQ,EACrD;AAEV;AAEA,SAAS,gBAAgB,EAAE,cAAiD;CAC1E,MAAM,OAAQ,WAAyC;CACvD,OACE,qBAAC,MAAD;EAAM;EACW,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAkB;EAAC;EAAa,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAe;EAAC;CAC7G;AAEV;AAEA,SAAS,gBAAgB,EAAE,cAAiD;CAC1E,MAAM,OAAQ,WAAyC;CACvD,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD;GAAM;GACU,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAkB;GAAC;GAAS;GACnE,oBAAC,MAAD;IAAM,OAAM;cAAU,KAAK;GAAmB;GAAC;GAAW,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAe;GAAC;EAC/F,MACL,KAAK,kBAAkB,SAAS,IAC/B,qBAAC,MAAD,aAAM,eAAY,KAAK,kBAAkB,KAAK,IAAI,CAAQ,OAE1D,oBAAC,MAAD;GAAM,OAAM;aAAO;EAAoC,EAEtD;;AAET;AAEA,SAAS,sBAAsB,EAAE,cAAiD;CAChF,MAAM,OAAQ,WAA+C;CAC7D,OACE,qBAAC,MAAD;EACE,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAkB;EAAC;EAAuC;EACnF,oBAAC,MAAD;GAAM,OAAM;aAAU,KAAK,WAAW,KAAK,IAAI;EAAQ;EAAC;CACpD;AAEV;AAEA,MAAa,wBAAmD;CAC9D,kBAAkB;CAClB,cAAc;CACd,mBAAmB;CACnB,mBAAmB;CACnB,yBAAyB;AAC3B"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { DiagnosticInkComponentMap } from "../contracts/InkTypes.js";
|
|
2
|
+
//#region src/ink/components/safetyInkComponents.d.ts
|
|
3
|
+
declare const safetyInkComponents: DiagnosticInkComponentMap;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { safetyInkComponents };
|
|
3
6
|
//# sourceMappingURL=safetyInkComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safetyInkComponents.d.ts","
|
|
1
|
+
{"version":3,"file":"safetyInkComponents.d.ts","names":[],"sources":["../../../src/ink/components/safetyInkComponents.tsx"],"mappings":";;cAmDa,qBAAqB"}
|
|
@@ -1,20 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box, Text } from "ink";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/ink/components/safetyInkComponents.tsx
|
|
3
5
|
function TargetExistsNoManifest({ diagnostic }) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
const data = diagnostic.data;
|
|
7
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
10
|
+
/* @__PURE__ */ jsx(Text, {
|
|
11
|
+
color: "cyan",
|
|
12
|
+
children: data.path
|
|
13
|
+
}),
|
|
14
|
+
" exists but has no ",
|
|
15
|
+
/* @__PURE__ */ jsx(Text, {
|
|
16
|
+
color: "cyan",
|
|
17
|
+
children: "uapkg.json"
|
|
18
|
+
}),
|
|
19
|
+
"."
|
|
20
|
+
] }), /* @__PURE__ */ jsxs(Text, { children: ["Package: ", /* @__PURE__ */ jsx(Text, {
|
|
21
|
+
color: "cyan",
|
|
22
|
+
children: data.packageName
|
|
23
|
+
})] })]
|
|
24
|
+
});
|
|
6
25
|
}
|
|
7
26
|
function PathNotProjectManifest({ diagnostic }) {
|
|
8
|
-
|
|
9
|
-
|
|
27
|
+
const data = diagnostic.data;
|
|
28
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
29
|
+
flexDirection: "column",
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
32
|
+
"Plugin ",
|
|
33
|
+
/* @__PURE__ */ jsx(Text, {
|
|
34
|
+
color: "cyan",
|
|
35
|
+
children: data.pluginName
|
|
36
|
+
}),
|
|
37
|
+
" requested a custom install path for",
|
|
38
|
+
" ",
|
|
39
|
+
/* @__PURE__ */ jsx(Text, {
|
|
40
|
+
color: "cyan",
|
|
41
|
+
children: data.dependencyName
|
|
42
|
+
}),
|
|
43
|
+
":"
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ jsxs(Text, { children: ["Requested: ", /* @__PURE__ */ jsx(Text, {
|
|
46
|
+
color: "yellow",
|
|
47
|
+
children: data.requestedPath
|
|
48
|
+
})] }),
|
|
49
|
+
/* @__PURE__ */ jsxs(Text, { children: ["Using: ", /* @__PURE__ */ jsx(Text, {
|
|
50
|
+
color: "green",
|
|
51
|
+
children: data.fallbackPath
|
|
52
|
+
})] })
|
|
53
|
+
]
|
|
54
|
+
});
|
|
10
55
|
}
|
|
11
56
|
function OverriddenByForce({ diagnostic }) {
|
|
12
|
-
|
|
13
|
-
|
|
57
|
+
const data = diagnostic.data;
|
|
58
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
59
|
+
"Policy ",
|
|
60
|
+
/* @__PURE__ */ jsx(Text, {
|
|
61
|
+
color: "yellow",
|
|
62
|
+
children: data.policy
|
|
63
|
+
}),
|
|
64
|
+
" bypassed for ",
|
|
65
|
+
/* @__PURE__ */ jsx(Text, {
|
|
66
|
+
color: "cyan",
|
|
67
|
+
children: data.packageName
|
|
68
|
+
}),
|
|
69
|
+
" via --force."
|
|
70
|
+
] });
|
|
14
71
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
72
|
+
const safetyInkComponents = {
|
|
73
|
+
SAFETY_TARGET_EXISTS_NO_MANIFEST: TargetExistsNoManifest,
|
|
74
|
+
SAFETY_PATH_NOT_PROJECT_MANIFEST: PathNotProjectManifest,
|
|
75
|
+
SAFETY_OVERRIDDEN_BY_FORCE: OverriddenByForce
|
|
19
76
|
};
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
export { safetyInkComponents };
|
|
20
80
|
//# sourceMappingURL=safetyInkComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safetyInkComponents.js","
|
|
1
|
+
{"version":3,"file":"safetyInkComponents.js","names":[],"sources":["../../../src/ink/components/safetyInkComponents.tsx"],"sourcesContent":["import type {\n SafetyOverriddenByForceDiagnostic,\n SafetyPathNotProjectManifestDiagnostic,\n SafetyTargetExistsNoManifestDiagnostic,\n} from '@uapkg/diagnostics';\nimport { Box, Text } from 'ink';\nimport type { ReactElement } from 'react';\nimport type { DiagnosticBodyProps, DiagnosticInkComponentMap } from '../contracts/InkTypes.js';\n\nfunction TargetExistsNoManifest({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as SafetyTargetExistsNoManifestDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n <Text color=\"cyan\">{data.path}</Text> exists but has no <Text color=\"cyan\">uapkg.json</Text>.\n </Text>\n <Text>\n Package: <Text color=\"cyan\">{data.packageName}</Text>\n </Text>\n </Box>\n );\n}\n\nfunction PathNotProjectManifest({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as SafetyPathNotProjectManifestDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Plugin <Text color=\"cyan\">{data.pluginName}</Text> requested a custom install path for{' '}\n <Text color=\"cyan\">{data.dependencyName}</Text>:\n </Text>\n <Text>\n Requested: <Text color=\"yellow\">{data.requestedPath}</Text>\n </Text>\n <Text>\n Using: <Text color=\"green\">{data.fallbackPath}</Text>\n </Text>\n </Box>\n );\n}\n\nfunction OverriddenByForce({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as SafetyOverriddenByForceDiagnostic).data;\n return (\n <Text>\n Policy <Text color=\"yellow\">{data.policy}</Text> bypassed for <Text color=\"cyan\">{data.packageName}</Text> via\n --force.\n </Text>\n );\n}\n\nexport const safetyInkComponents: DiagnosticInkComponentMap = {\n SAFETY_TARGET_EXISTS_NO_MANIFEST: TargetExistsNoManifest,\n SAFETY_PATH_NOT_PROJECT_MANIFEST: PathNotProjectManifest,\n SAFETY_OVERRIDDEN_BY_FORCE: OverriddenByForce,\n};\n"],"mappings":";;;;AASA,SAAS,uBAAuB,EAAE,cAAiD;CACjF,MAAM,OAAQ,WAAsD;CACpE,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD;GACE,oBAAC,MAAD;IAAM,OAAM;cAAQ,KAAK;GAAW;GAAC;GAAmB,oBAAC,MAAD;IAAM,OAAM;cAAO;GAAgB;GAAC;EACxF,MACN,qBAAC,MAAD,aAAM,aACK,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAkB,EAChD,IACH;;AAET;AAEA,SAAS,uBAAuB,EAAE,cAAiD;CACjF,MAAM,OAAQ,WAAsD;CACpE,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB;GACE,qBAAC,MAAD;IAAM;IACG,oBAAC,MAAD;KAAM,OAAM;eAAQ,KAAK;IAAiB;IAAC;IAAqC;IACvF,oBAAC,MAAD;KAAM,OAAM;eAAQ,KAAK;IAAqB;IAAC;GAC3C;GACN,qBAAC,MAAD,aAAM,eACO,oBAAC,MAAD;IAAM,OAAM;cAAU,KAAK;GAAoB,EACtD;GACN,qBAAC,MAAD,aAAM,WACG,oBAAC,MAAD;IAAM,OAAM;cAAS,KAAK;GAAmB,EAChD;EACH;;AAET;AAEA,SAAS,kBAAkB,EAAE,cAAiD;CAC5E,MAAM,OAAQ,WAAiD;CAC/D,OACE,qBAAC,MAAD;EAAM;EACG,oBAAC,MAAD;GAAM,OAAM;aAAU,KAAK;EAAa;EAAC;EAAc,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAkB;EAAC;CAEtG;AAEV;AAEA,MAAa,sBAAiD;CAC5D,kCAAkC;CAClC,kCAAkC;CAClC,4BAA4B;AAC9B"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { DiagnosticInkComponentMap } from "../contracts/InkTypes.js";
|
|
2
|
+
//#region src/ink/components/specInkComponents.d.ts
|
|
3
|
+
declare const specInkComponents: DiagnosticInkComponentMap;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { specInkComponents };
|
|
3
6
|
//# sourceMappingURL=specInkComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specInkComponents.d.ts","
|
|
1
|
+
{"version":3,"file":"specInkComponents.d.ts","names":[],"sources":["../../../src/ink/components/specInkComponents.tsx"],"mappings":";;cAiDa,mBAAmB"}
|
|
@@ -1,20 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box, Text } from "ink";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/ink/components/specInkComponents.tsx
|
|
3
5
|
function InvalidPackageSpec({ diagnostic }) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
const data = diagnostic.data;
|
|
7
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: ["Input: ", /* @__PURE__ */ jsx(Text, {
|
|
10
|
+
color: "yellow",
|
|
11
|
+
children: data.input
|
|
12
|
+
})] }), /* @__PURE__ */ jsx(Text, {
|
|
13
|
+
color: "gray",
|
|
14
|
+
children: data.reason
|
|
15
|
+
})]
|
|
16
|
+
});
|
|
6
17
|
}
|
|
7
18
|
function InvalidOrgName({ diagnostic }) {
|
|
8
|
-
|
|
9
|
-
|
|
19
|
+
const data = diagnostic.data;
|
|
20
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
21
|
+
flexDirection: "column",
|
|
22
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: ["Input: ", /* @__PURE__ */ jsx(Text, {
|
|
23
|
+
color: "yellow",
|
|
24
|
+
children: data.input
|
|
25
|
+
})] }), /* @__PURE__ */ jsxs(Text, { children: ["Bad org: ", /* @__PURE__ */ jsx(Text, {
|
|
26
|
+
color: "red",
|
|
27
|
+
children: data.org
|
|
28
|
+
})] })]
|
|
29
|
+
});
|
|
10
30
|
}
|
|
11
31
|
function InvalidVersionRange({ diagnostic }) {
|
|
12
|
-
|
|
13
|
-
|
|
32
|
+
const data = diagnostic.data;
|
|
33
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
34
|
+
flexDirection: "column",
|
|
35
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: ["Input: ", /* @__PURE__ */ jsx(Text, {
|
|
36
|
+
color: "yellow",
|
|
37
|
+
children: data.input
|
|
38
|
+
})] }), /* @__PURE__ */ jsxs(Text, { children: ["Bad range: ", /* @__PURE__ */ jsx(Text, {
|
|
39
|
+
color: "red",
|
|
40
|
+
children: data.range
|
|
41
|
+
})] })]
|
|
42
|
+
});
|
|
14
43
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
44
|
+
const specInkComponents = {
|
|
45
|
+
INVALID_PACKAGE_SPEC: InvalidPackageSpec,
|
|
46
|
+
INVALID_ORG_NAME: InvalidOrgName,
|
|
47
|
+
INVALID_VERSION_RANGE: InvalidVersionRange
|
|
19
48
|
};
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { specInkComponents };
|
|
20
52
|
//# sourceMappingURL=specInkComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specInkComponents.js","
|
|
1
|
+
{"version":3,"file":"specInkComponents.js","names":[],"sources":["../../../src/ink/components/specInkComponents.tsx"],"sourcesContent":["import type {\n InvalidOrgNameDiagnostic,\n InvalidPackageSpecDiagnostic,\n InvalidVersionRangeDiagnostic,\n} from '@uapkg/diagnostics';\nimport { Box, Text } from 'ink';\nimport type { ReactElement } from 'react';\nimport type { DiagnosticBodyProps, DiagnosticInkComponentMap } from '../contracts/InkTypes.js';\n\nfunction InvalidPackageSpec({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as InvalidPackageSpecDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Input: <Text color=\"yellow\">{data.input}</Text>\n </Text>\n <Text color=\"gray\">{data.reason}</Text>\n </Box>\n );\n}\n\nfunction InvalidOrgName({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as InvalidOrgNameDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Input: <Text color=\"yellow\">{data.input}</Text>\n </Text>\n <Text>\n Bad org: <Text color=\"red\">{data.org}</Text>\n </Text>\n </Box>\n );\n}\n\nfunction InvalidVersionRange({ diagnostic }: DiagnosticBodyProps): ReactElement {\n const data = (diagnostic as InvalidVersionRangeDiagnostic).data;\n return (\n <Box flexDirection=\"column\">\n <Text>\n Input: <Text color=\"yellow\">{data.input}</Text>\n </Text>\n <Text>\n Bad range: <Text color=\"red\">{data.range}</Text>\n </Text>\n </Box>\n );\n}\n\nexport const specInkComponents: DiagnosticInkComponentMap = {\n INVALID_PACKAGE_SPEC: InvalidPackageSpec,\n INVALID_ORG_NAME: InvalidOrgName,\n INVALID_VERSION_RANGE: InvalidVersionRange,\n};\n"],"mappings":";;;;AASA,SAAS,mBAAmB,EAAE,cAAiD;CAC7E,MAAM,OAAQ,WAA4C;CAC1D,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD,aAAM,WACG,oBAAC,MAAD;GAAM,OAAM;aAAU,KAAK;EAAY,EAC1C,MACN,oBAAC,MAAD;GAAM,OAAM;aAAQ,KAAK;EAAa,EACnC;;AAET;AAEA,SAAS,eAAe,EAAE,cAAiD;CACzE,MAAM,OAAQ,WAAwC;CACtD,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD,aAAM,WACG,oBAAC,MAAD;GAAM,OAAM;aAAU,KAAK;EAAY,EAC1C,MACN,qBAAC,MAAD,aAAM,aACK,oBAAC,MAAD;GAAM,OAAM;aAAO,KAAK;EAAU,EACvC,IACH;;AAET;AAEA,SAAS,oBAAoB,EAAE,cAAiD;CAC9E,MAAM,OAAQ,WAA6C;CAC3D,OACE,qBAAC,KAAD;EAAK,eAAc;YAAnB,CACE,qBAAC,MAAD,aAAM,WACG,oBAAC,MAAD;GAAM,OAAM;aAAU,KAAK;EAAY,EAC1C,MACN,qBAAC,MAAD,aAAM,eACO,oBAAC,MAAD;GAAM,OAAM;aAAO,KAAK;EAAY,EAC3C,IACH;;AAET;AAEA,MAAa,oBAA+C;CAC1D,sBAAsB;CACtB,kBAAkB;CAClB,uBAAuB;AACzB"}
|