@codemarc/blt 1.3.2 ā 1.3.3
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/commands/show/repo.d.ts +10 -0
- package/dist/commands/show/repo.d.ts.map +1 -0
- package/dist/commands/show/repo.js +87 -0
- package/dist/commands/show/repo.js.map +1 -0
- package/dist/commands/show.d.ts.map +1 -1
- package/dist/commands/show.js +9 -0
- package/dist/commands/show.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Logger } from "@caporal/core";
|
|
2
|
+
interface RepoOptions {
|
|
3
|
+
ssh?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Display valid repositories in the current working set
|
|
7
|
+
*/
|
|
8
|
+
export declare function showRepo(options: RepoOptions, logger: Logger): Promise<void>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../../src/commands/show/repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAsD5C,UAAU,WAAW;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAgBD;;GAEG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmClF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hardcoded list of valid repositories in the current working set
|
|
3
|
+
*/
|
|
4
|
+
const REPOSITORIES = [
|
|
5
|
+
{
|
|
6
|
+
name: "cli",
|
|
7
|
+
url: "https://github.com/codemarc/blt-cli.git",
|
|
8
|
+
sshUrl: "git@github.com:codemarc/blt-cli.git",
|
|
9
|
+
description: "BLT command line interface",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: "pos",
|
|
13
|
+
url: "https://github.com/bltcore-com/blt-core-pos.git",
|
|
14
|
+
sshUrl: "git@github.com:bltcore-com/blt-core-pos.git",
|
|
15
|
+
description: "core pos application",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "data",
|
|
19
|
+
url: "https://github.com/bltcore-com/blt-core-data.git",
|
|
20
|
+
sshUrl: "git@github.com:bltcore-com/blt-core-data.git",
|
|
21
|
+
description: "data schema & sample data",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "gateway",
|
|
25
|
+
url: "https://github.com/bltcore-com/blt-device-gateway.git",
|
|
26
|
+
sshUrl: "git@github.com:bltcore-com/blt-device-gateway.git",
|
|
27
|
+
description: "device gateway",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "devops",
|
|
31
|
+
url: "https://github.com/bltcore-com/blt-core-devops.git",
|
|
32
|
+
sshUrl: "git@github.com:bltcore-com/blt-core-devops.git",
|
|
33
|
+
description: "devops scripts",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "deploy",
|
|
37
|
+
url: "https://github.com/bltcore-com/deploy.git",
|
|
38
|
+
sshUrl: "git@github.com:bltcore-com/deploy.git",
|
|
39
|
+
description: "deployment scripts",
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
/**
|
|
43
|
+
* Render a table row for ASCII table display
|
|
44
|
+
*/
|
|
45
|
+
function renderRow(row, colWidths) {
|
|
46
|
+
return `| ${row.map((cell, i) => cell.padEnd(colWidths[i])).join(" | ")} |`;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Render a table divider row
|
|
50
|
+
*/
|
|
51
|
+
function renderDivider(colWidths) {
|
|
52
|
+
return `|-${colWidths.map((w) => "-".repeat(w)).join("-|-")}-|`;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Display valid repositories in the current working set
|
|
56
|
+
*/
|
|
57
|
+
export async function showRepo(options, logger) {
|
|
58
|
+
try {
|
|
59
|
+
console.log("\nš¦ Current Repositories\n");
|
|
60
|
+
const headers = ["Name", "Description", options.ssh ? "SSH URL" : "URL"];
|
|
61
|
+
const tableRows = [headers];
|
|
62
|
+
for (const repo of REPOSITORIES) {
|
|
63
|
+
tableRows.push([
|
|
64
|
+
repo.name,
|
|
65
|
+
repo.description || "",
|
|
66
|
+
options.ssh ? repo.sshUrl : repo.url,
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
// Calculate column widths
|
|
70
|
+
const colWidths = headers.map((_header, i) => Math.max(...tableRows.map((row) => row[i].toString().length)));
|
|
71
|
+
// Print table
|
|
72
|
+
console.log(renderRow(tableRows[0], colWidths));
|
|
73
|
+
console.log(renderDivider(colWidths));
|
|
74
|
+
for (let i = 1; i < tableRows.length; i++) {
|
|
75
|
+
console.log(renderRow(tableRows[i], colWidths));
|
|
76
|
+
}
|
|
77
|
+
console.log("");
|
|
78
|
+
// Print summary
|
|
79
|
+
console.log(`Total repositories: ${REPOSITORIES.length}\n`);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
83
|
+
logger.error(`Failed to display repositories: ${message}`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../../../src/commands/show/repo.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,YAAY,GAAiB;IACjC;QACE,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,yCAAyC;QAC9C,MAAM,EAAE,qCAAqC;QAC7C,WAAW,EAAE,4BAA4B;KAC1C;IAED;QACE,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,iDAAiD;QACtD,MAAM,EAAE,6CAA6C;QACrD,WAAW,EAAE,sBAAsB;KACpC;IAED;QACE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AC,CAAC;QACvE,MAAM,CAAC,KAAK,CAAC,mCAAmC,OAAO,EAAE,CAAC,CAAC;QAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../src/commands/show.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAU,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../src/commands/show.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAU,MAAM,eAAe,CAAC;AAMrD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAO,EAAE,OAAO,QA0EnD"}
|
package/dist/commands/show.js
CHANGED
|
@@ -2,6 +2,7 @@ import { showSchema } from "./show/schema";
|
|
|
2
2
|
import { showRows } from "./show/rows";
|
|
3
3
|
import { showEnv } from "./show/env";
|
|
4
4
|
import { showDb } from "./show/db";
|
|
5
|
+
import { showRepo } from "./show/repo";
|
|
5
6
|
/**
|
|
6
7
|
* Register show commands with the CLI program
|
|
7
8
|
*/
|
|
@@ -17,6 +18,7 @@ Available operations:
|
|
|
17
18
|
schema Get information about the schema
|
|
18
19
|
env Display blt core environment variables
|
|
19
20
|
db Display version from database (same format as version string)
|
|
21
|
+
repo Display valid repositories in the current working set
|
|
20
22
|
|
|
21
23
|
Run 'blt show <operation> --help' for more information on a specific command.
|
|
22
24
|
`;
|
|
@@ -60,5 +62,12 @@ Run 'blt show <operation> --help' for more information on a specific command.
|
|
|
60
62
|
.action(async ({ options, logger }) => {
|
|
61
63
|
await showDb(options, logger);
|
|
62
64
|
});
|
|
65
|
+
program
|
|
66
|
+
.command("show repo", "Display valid repositories in the current working set")
|
|
67
|
+
.hide()
|
|
68
|
+
.option("-s, --ssh", "Display SSH URLs instead of HTTPS URLs", { default: false })
|
|
69
|
+
.action(async ({ options, logger }) => {
|
|
70
|
+
await showRepo(options, logger);
|
|
71
|
+
});
|
|
63
72
|
}
|
|
64
73
|
//# sourceMappingURL=show.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show.js","sourceRoot":"","sources":["../../src/commands/show.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAgB;IACnD,MAAM,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"show.js","sourceRoot":"","sources":["../../src/commands/show.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAgB;IACnD,MAAM,YAAY,GAAG;;;;;;;;;;;;;;CAcrB,CAAC;IAEA,OAAO;SACJ,OAAO,CAAC,MAAM,EAAE,gBAAgB,CAAC;SACjC,IAAI,CAAC,YAAY,CAAC;SAClB,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEL,OAAO;SACJ,OAAO,CAAC,aAAa,EAAE,kCAAkC,CAAC;SAC1D,IAAI,EAAE;SACN,QAAQ,CAAC,eAAe,EAAE,sCAAsC,CAAC;SAC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