@aikdna/kdna-cli 0.19.0 → 0.19.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/package.json +1 -1
- package/src/cmds/registry.js +11 -5
- package/src/search.js +4 -5
package/package.json
CHANGED
package/src/cmds/registry.js
CHANGED
|
@@ -13,8 +13,10 @@ function cmdList(showAvailable, jsonMode = false, _locale = null) {
|
|
|
13
13
|
error('No registry found.');
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
const installableDomains = domains.filter((d) => d.yanked !== true);
|
|
17
|
+
|
|
16
18
|
if (jsonMode) {
|
|
17
|
-
const result =
|
|
19
|
+
const result = installableDomains.map((d) => ({
|
|
18
20
|
name: d.name || d.id || null,
|
|
19
21
|
version: d.version || null,
|
|
20
22
|
type: d.type || 'domain',
|
|
@@ -27,16 +29,20 @@ function cmdList(showAvailable, jsonMode = false, _locale = null) {
|
|
|
27
29
|
process.exit(EXIT.OK);
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
console.log('Available KDNA domains:');
|
|
32
|
+
console.log('Available installable KDNA domains:');
|
|
31
33
|
console.log(`Registry: ${REGISTRY_CACHE}`);
|
|
32
34
|
console.log('');
|
|
33
|
-
|
|
35
|
+
if (!installableDomains.length) {
|
|
36
|
+
console.log(' No non-yanked registry entries are currently installable.');
|
|
37
|
+
console.log('');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
for (const d of installableDomains) {
|
|
34
41
|
const name = d.name || d.id || '?';
|
|
35
42
|
const installed = listInstalled().some((entry) => entry.full === name) ? '[installed]' : '';
|
|
36
|
-
const yanked = d.yanked ? '[yanked] ' : '';
|
|
37
43
|
const dep = d.deprecated ? '[deprecated] ' : '';
|
|
38
44
|
console.log(
|
|
39
|
-
` ${name.padEnd(36)} ${(d.version || '?').padEnd(8)} ${(d.type || 'domain').padEnd(8)} ${(d.status || '').padEnd(14)} ${
|
|
45
|
+
` ${name.padEnd(36)} ${(d.version || '?').padEnd(8)} ${(d.type || 'domain').padEnd(8)} ${(d.status || '').padEnd(14)} ${dep}${installed}`,
|
|
40
46
|
);
|
|
41
47
|
if (d.description) console.log(` ${d.description}`);
|
|
42
48
|
console.log('');
|
package/src/search.js
CHANGED
|
@@ -36,14 +36,14 @@ function cmdSearch(query, json) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const resolver = new RegistryResolver({ allowNetwork: true });
|
|
39
|
-
const domains = resolver.listAllDomains() || [];
|
|
39
|
+
const domains = (resolver.listAllDomains() || []).filter((d) => d.yanked !== true);
|
|
40
40
|
|
|
41
41
|
if (!domains.length) {
|
|
42
42
|
if (json) {
|
|
43
43
|
console.log(JSON.stringify([]));
|
|
44
44
|
process.exit(EXIT.OK);
|
|
45
45
|
}
|
|
46
|
-
console.log('No registry entries found. Run: kdna registry refresh');
|
|
46
|
+
console.log('No installable registry entries found. Run: kdna registry refresh');
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -74,7 +74,7 @@ function cmdSearch(query, json) {
|
|
|
74
74
|
keywords: d.keywords || [],
|
|
75
75
|
domain_field: d.domain_field || [],
|
|
76
76
|
judgment_patterns: d.judgment_patterns || [],
|
|
77
|
-
yanked:
|
|
77
|
+
yanked: false,
|
|
78
78
|
deprecated: d.deprecated || false,
|
|
79
79
|
score,
|
|
80
80
|
}));
|
|
@@ -86,10 +86,9 @@ function cmdSearch(query, json) {
|
|
|
86
86
|
console.log('');
|
|
87
87
|
|
|
88
88
|
for (const { d, score } of matches) {
|
|
89
|
-
const yanked = d.yanked ? ' [yanked]' : '';
|
|
90
89
|
const dep = d.deprecated ? ' [deprecated]' : '';
|
|
91
90
|
console.log(
|
|
92
|
-
` ${(d.name || d.id || '?').padEnd(36)} v${d.version || '?'} ${(d.type || 'domain').padEnd(8)} score:${score}${
|
|
91
|
+
` ${(d.name || d.id || '?').padEnd(36)} v${d.version || '?'} ${(d.type || 'domain').padEnd(8)} score:${score}${dep}`,
|
|
93
92
|
);
|
|
94
93
|
if (d.description) console.log(` ${d.description}`);
|
|
95
94
|
if (d.core_insight) console.log(` » ${d.core_insight}`);
|