console/scripts/serializers/cli-output.ts
Kamil Kisiela 68e8c572dd
Native Federation v2 support (#2822)
Closes #712
Closes #1330

Want to opt-in? Create a support ticket.
2023-09-28 12:31:32 +02:00

19 lines
581 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export function normalizeCliOutput(value: string) {
return value
.split('\n')
.map(line =>
line
.replaceAll('✔', 'v')
.replaceAll('', 'i')
// eslint-disable-next-line no-control-regex
.replace(/\x1B[[(?);]{0,2}(;?\d)*./g, '')
.replace(
/http:\/\/localhost:8080\/[$]*\w+\/[$]*\w+\/production/i,
'http://localhost:8080/$organization/$project/production',
)
.replace(/history\/[$]*\w+-\w+-\w+-\w+-\w+/i, 'history/$version')
.trim(),
)
.filter(Boolean)
.join('\n');
}