faces-cli 1.4.4 → 1.4.5
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/catalog.d.ts
CHANGED
package/dist/catalog.js
CHANGED
|
@@ -15,7 +15,7 @@ function serializeFrontmatter(fm) {
|
|
|
15
15
|
lines.push(`name: ${quoteYaml(fm.name)}`);
|
|
16
16
|
if (fm.description)
|
|
17
17
|
lines.push(`description: ${quoteYaml(fm.description)}`);
|
|
18
|
-
lines.push(`
|
|
18
|
+
lines.push(`alias: ${quoteYaml(fm.alias)}`);
|
|
19
19
|
if (fm.attributes && Object.keys(fm.attributes).length > 0) {
|
|
20
20
|
lines.push('attributes:');
|
|
21
21
|
for (const [k, v] of Object.entries(fm.attributes)) {
|
|
@@ -61,14 +61,14 @@ function parseFrontmatter(content) {
|
|
|
61
61
|
fm.name = val;
|
|
62
62
|
else if (key === 'description')
|
|
63
63
|
fm.description = val;
|
|
64
|
-
else if (key === '
|
|
65
|
-
fm.
|
|
64
|
+
else if (key === 'alias')
|
|
65
|
+
fm.alias = val;
|
|
66
66
|
else if (key === 'attributes')
|
|
67
67
|
inAttributes = true;
|
|
68
68
|
}
|
|
69
69
|
if (Object.keys(attributes).length > 0)
|
|
70
70
|
fm.attributes = attributes;
|
|
71
|
-
if (!fm.name || !fm.
|
|
71
|
+
if (!fm.name || !fm.alias)
|
|
72
72
|
return { frontmatter: null, body: content };
|
|
73
73
|
return { frontmatter: fm, body };
|
|
74
74
|
}
|
|
@@ -98,7 +98,7 @@ export class CatalogService {
|
|
|
98
98
|
}
|
|
99
99
|
const fm = {
|
|
100
100
|
name: faceData.name,
|
|
101
|
-
|
|
101
|
+
alias: username,
|
|
102
102
|
};
|
|
103
103
|
if (description) {
|
|
104
104
|
fm.description = description;
|
|
@@ -56,7 +56,7 @@ export default class CatalogDoctor extends BaseCommand {
|
|
|
56
56
|
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
57
57
|
if (match) {
|
|
58
58
|
// Quick parse for name and description
|
|
59
|
-
const fm = {
|
|
59
|
+
const fm = { alias: dirent.name };
|
|
60
60
|
for (const line of match[1].split('\n')) {
|
|
61
61
|
if (line.startsWith(' '))
|
|
62
62
|
continue;
|
|
@@ -22,13 +22,13 @@ export default class CatalogList extends BaseCommand {
|
|
|
22
22
|
this.log('(no faces in catalog — run faces catalog:doctor --fix)');
|
|
23
23
|
return entries;
|
|
24
24
|
}
|
|
25
|
-
const nameWidth = Math.max(...entries.map((e) => String(e.
|
|
25
|
+
const nameWidth = Math.max(...entries.map((e) => String(e.alias ?? '').length));
|
|
26
26
|
const displayWidth = Math.max(...entries.map((e) => String(e.name ?? '').length));
|
|
27
27
|
for (const e of entries) {
|
|
28
|
-
const
|
|
28
|
+
const alias = String(e.alias ?? '').padEnd(nameWidth);
|
|
29
29
|
const name = String(e.name ?? '').padEnd(displayWidth);
|
|
30
30
|
const desc = e.description ? ` ${String(e.description).slice(0, 60)}...` : '';
|
|
31
|
-
this.log(`${
|
|
31
|
+
this.log(`${alias} ${name}${desc}`);
|
|
32
32
|
}
|
|
33
33
|
return entries;
|
|
34
34
|
}
|
package/oclif.manifest.json
CHANGED