@brunoluizdesiqueira/bbuilder-cli 1.0.20 → 1.0.22
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/build/execute.js +0 -1
- package/dist/ui/output.js +59 -17
- package/package.json +1 -1
package/dist/build/execute.js
CHANGED
|
@@ -42,7 +42,6 @@ const project_1 = require("./project");
|
|
|
42
42
|
const resources_1 = require("./resources");
|
|
43
43
|
async function executeBuild(opts) {
|
|
44
44
|
const totalStages = 5;
|
|
45
|
-
(0, output_1.banner)();
|
|
46
45
|
const { workspaceDir, projectName } = (0, project_1.resolveProject)(opts.project, opts.repoBase);
|
|
47
46
|
(0, output_1.printBuildHeader)(opts, projectName, workspaceDir);
|
|
48
47
|
await (0, output_1.withStep)(1, totalStages, 'Carregando ambiente do Delphi', () => (0, compiler_1.ensureDelphiEnvironment)(opts.delphiDir));
|
package/dist/ui/output.js
CHANGED
|
@@ -12,6 +12,37 @@ exports.withStep = withStep;
|
|
|
12
12
|
exports.withProgress = withProgress;
|
|
13
13
|
exports.fatal = fatal;
|
|
14
14
|
const chalk_1 = __importDefault(require("chalk"));
|
|
15
|
+
const ANSI_PATTERN = /\u001b\[[0-9;]*m/g;
|
|
16
|
+
function visibleLength(value) {
|
|
17
|
+
const text = value.replace(ANSI_PATTERN, '');
|
|
18
|
+
let length = 0;
|
|
19
|
+
for (const char of text) {
|
|
20
|
+
const code = char.codePointAt(0) || 0;
|
|
21
|
+
if ((code >= 0x0300 && code <= 0x036f) ||
|
|
22
|
+
(code >= 0x1ab0 && code <= 0x1aff) ||
|
|
23
|
+
(code >= 0x1dc0 && code <= 0x1dff) ||
|
|
24
|
+
(code >= 0x20d0 && code <= 0x20ff) ||
|
|
25
|
+
(code >= 0xfe20 && code <= 0xfe2f)) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (code >= 0x1100 &&
|
|
29
|
+
(code <= 0x115f ||
|
|
30
|
+
code === 0x2329 ||
|
|
31
|
+
code === 0x232a ||
|
|
32
|
+
(code >= 0x2e80 && code <= 0xa4cf && code !== 0x303f) ||
|
|
33
|
+
(code >= 0xac00 && code <= 0xd7a3) ||
|
|
34
|
+
(code >= 0xf900 && code <= 0xfaff) ||
|
|
35
|
+
(code >= 0xfe10 && code <= 0xfe19) ||
|
|
36
|
+
(code >= 0xfe30 && code <= 0xfe6f) ||
|
|
37
|
+
(code >= 0xff00 && code <= 0xff60) ||
|
|
38
|
+
(code >= 0xffe0 && code <= 0xffe6))) {
|
|
39
|
+
length += 2;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
length += 1;
|
|
43
|
+
}
|
|
44
|
+
return length;
|
|
45
|
+
}
|
|
15
46
|
function banner() {
|
|
16
47
|
const art = [
|
|
17
48
|
' ███ ███ █ █ ███ █ ████ ████ ███ ',
|
|
@@ -37,27 +68,38 @@ function printBuildHeader(opts, projectName, workspaceDir) {
|
|
|
37
68
|
RELEASE: chalk_1.default.green,
|
|
38
69
|
};
|
|
39
70
|
const col = typeColor[opts.type];
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
71
|
+
const rows = [
|
|
72
|
+
`${chalk_1.default.magenta('[ PROJETO ]')} ${chalk_1.default.white(projectName)}`,
|
|
73
|
+
`${chalk_1.default.magenta('[ CAMINHO ]')} ${chalk_1.default.white(workspaceDir)}`,
|
|
74
|
+
`${chalk_1.default.magenta('[ VERSÃO ]')} ${chalk_1.default.yellow(opts.version || '(atual)')} (Base: ${opts.envVersion})`,
|
|
75
|
+
`${chalk_1.default.magenta('[ PROFILE ]')} ${col(opts.type)}`,
|
|
76
|
+
];
|
|
77
|
+
const boxWidth = Math.max(...rows.map(visibleLength));
|
|
78
|
+
console.log(chalk_1.default.gray(` ┌${'─'.repeat(boxWidth + 2)}┐`));
|
|
79
|
+
rows.forEach(row => {
|
|
80
|
+
const padding = ' '.repeat(Math.max(0, boxWidth - visibleLength(row)));
|
|
81
|
+
console.log(chalk_1.default.gray(' │ ') + row + padding + chalk_1.default.gray(' │'));
|
|
82
|
+
});
|
|
83
|
+
console.log(chalk_1.default.gray(` └${'─'.repeat(boxWidth + 2)}┘`));
|
|
45
84
|
console.log('');
|
|
46
85
|
}
|
|
47
86
|
function printSuccess(buildType) {
|
|
48
87
|
console.log('');
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
console.log(chalk_1.default.green('
|
|
88
|
+
const art = [
|
|
89
|
+
' ████ █ █ ███ ███ ████ ████ ████ ',
|
|
90
|
+
' █ █ █ █ █ █ █ █ █ █ ',
|
|
91
|
+
' ███ █ █ █ █ ███ ███ ███ ',
|
|
92
|
+
' █ █ █ █ █ █ █ █ █ █ ',
|
|
93
|
+
' ████ ███ ███ ███ ████ ████ ████ ',
|
|
94
|
+
];
|
|
95
|
+
art.forEach((line, index) => {
|
|
96
|
+
const color = index === 0 || index === art.length - 1 ? chalk_1.default.green : chalk_1.default.white;
|
|
97
|
+
console.log(color(line));
|
|
98
|
+
});
|
|
99
|
+
console.log(chalk_1.default.green(' ──────────────────────────────────────────────────────────────'));
|
|
100
|
+
console.log(chalk_1.default.cyan(' [ok] ') + chalk_1.default.white('Build ') + chalk_1.default.yellow(buildType) + chalk_1.default.white(' finalizado com sucesso.'));
|
|
101
|
+
console.log(chalk_1.default.cyan(' [ok] ') + chalk_1.default.white('Artefatos validados e recursos aplicados.'));
|
|
102
|
+
console.log(chalk_1.default.cyan(' [run]') + chalk_1.default.white(' Pipeline concluído.'));
|
|
61
103
|
console.log('');
|
|
62
104
|
}
|
|
63
105
|
function step(msg) {
|