fix(ivy): ngcc - show logging via CLI by default (#29686)
The new logger implementation caused a regression where by default the ngcc CLI did not output any logging messages. PR Close #29686
This commit is contained in:
parent
0f4f315f8e
commit
3246399bff
|
@ -7,7 +7,9 @@ PATH=$PATH:$(npm bin)
|
||||||
ivy-ngcc --help
|
ivy-ngcc --help
|
||||||
|
|
||||||
# node --inspect-brk $(npm bin)/ivy-ngcc -f esm2015
|
# node --inspect-brk $(npm bin)/ivy-ngcc -f esm2015
|
||||||
ivy-ngcc
|
# Run ngcc and check it logged compilation output as expected
|
||||||
|
ivy-ngcc | grep 'Compiling'
|
||||||
|
if [[ $? != 0 ]]; then exit 1; fi
|
||||||
|
|
||||||
# Did it add the appropriate build markers?
|
# Did it add the appropriate build markers?
|
||||||
|
|
||||||
|
@ -60,7 +62,12 @@ ivy-ngcc
|
||||||
if [[ $? != 0 ]]; then exit 1; fi
|
if [[ $? != 0 ]]; then exit 1; fi
|
||||||
|
|
||||||
# Can it be safely run again (as a noop)?
|
# Can it be safely run again (as a noop)?
|
||||||
ivy-ngcc
|
# And check that it logged skipping compilation as expected
|
||||||
|
ivy-ngcc | grep 'Skipping'
|
||||||
|
if [[ $? != 0 ]]; then exit 1; fi
|
||||||
|
|
||||||
|
# Check that running it with logging level error outputs nothing
|
||||||
|
ivy-ngcc -l error | grep '.' && exit 1
|
||||||
|
|
||||||
# Does running it with --formats fail?
|
# Does running it with --formats fail?
|
||||||
ivy-ngcc --formats fesm2015 && exit 1
|
ivy-ngcc --formats fesm2015 && exit 1
|
||||||
|
|
|
@ -60,14 +60,14 @@ if (require.main === module) {
|
||||||
const propertiesToConsider: string[] = options['p'];
|
const propertiesToConsider: string[] = options['p'];
|
||||||
const targetEntryPointPath = options['t'] ? options['t'] : undefined;
|
const targetEntryPointPath = options['t'] ? options['t'] : undefined;
|
||||||
const compileAllFormats = !options['first-only'];
|
const compileAllFormats = !options['first-only'];
|
||||||
const logLevel = options['l'] as keyof typeof LogLevel;
|
const logLevel = options['l'] as keyof typeof LogLevel | undefined;
|
||||||
try {
|
try {
|
||||||
mainNgcc({
|
mainNgcc({
|
||||||
basePath: baseSourcePath,
|
basePath: baseSourcePath,
|
||||||
propertiesToConsider,
|
propertiesToConsider,
|
||||||
targetEntryPointPath,
|
targetEntryPointPath,
|
||||||
compileAllFormats,
|
compileAllFormats,
|
||||||
logger: new ConsoleLogger(LogLevel[logLevel]),
|
logger: logLevel && new ConsoleLogger(LogLevel[logLevel]),
|
||||||
});
|
});
|
||||||
process.exitCode = 0;
|
process.exitCode = 0;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue