fix(core): remove strong-log-transformer (#28094)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes https://github.com/nrwl/nx/issues/26904
This commit is contained in:
parent
cc428c7782
commit
7da6f85734
@ -72,7 +72,7 @@ describe('nx init (NPM repo - legacy)', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const output = runCommand('npm run compound TEST');
|
const output = runCommand('npm run compound TEST');
|
||||||
expect(output).toContain('HELLO\n');
|
expect(output).toContain('HELLO');
|
||||||
expect(output).toContain('COMPOUND TEST');
|
expect(output).toContain('COMPOUND TEST');
|
||||||
expect(output).not.toContain('HELLO COMPOUND');
|
expect(output).not.toContain('HELLO COMPOUND');
|
||||||
cleanupProject();
|
cleanupProject();
|
||||||
|
|||||||
@ -370,7 +370,6 @@
|
|||||||
"send": "0.17.1",
|
"send": "0.17.1",
|
||||||
"shadergradient": "^1.2.14",
|
"shadergradient": "^1.2.14",
|
||||||
"string-width": "^4.2.3",
|
"string-width": "^4.2.3",
|
||||||
"strong-log-transformer": "^2.1.0",
|
|
||||||
"tailwind-merge": "^2.4.0",
|
"tailwind-merge": "^2.4.0",
|
||||||
"tailwindcss": "3.4.4",
|
"tailwindcss": "3.4.4",
|
||||||
"three": "^0.166.1",
|
"three": "^0.166.1",
|
||||||
|
|||||||
@ -61,7 +61,6 @@
|
|||||||
"open": "^8.4.0",
|
"open": "^8.4.0",
|
||||||
"semver": "^7.5.3",
|
"semver": "^7.5.3",
|
||||||
"string-width": "^4.2.3",
|
"string-width": "^4.2.3",
|
||||||
"strong-log-transformer": "^2.1.0",
|
|
||||||
"tar-stream": "~2.2.0",
|
"tar-stream": "~2.2.0",
|
||||||
"tmp": "~0.2.1",
|
"tmp": "~0.2.1",
|
||||||
"tsconfig-paths": "^4.1.2",
|
"tsconfig-paths": "^4.1.2",
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import { readFileSync, writeFileSync } from 'fs';
|
import { readFileSync, writeFileSync } from 'fs';
|
||||||
import { ChildProcess, fork, Serializable } from 'child_process';
|
import { ChildProcess, fork, Serializable } from 'child_process';
|
||||||
import * as chalk from 'chalk';
|
import * as chalk from 'chalk';
|
||||||
import * as logTransformer from 'strong-log-transformer';
|
|
||||||
import { DefaultTasksRunnerOptions } from './default-tasks-runner';
|
import { DefaultTasksRunnerOptions } from './default-tasks-runner';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utils/output';
|
||||||
import { getCliPath, getPrintableCommandArgsForTask } from './utils';
|
import { getCliPath, getPrintableCommandArgsForTask } from './utils';
|
||||||
@ -326,15 +325,15 @@ export class ForkedProcessTaskRunner {
|
|||||||
.pipe(
|
.pipe(
|
||||||
logClearLineToPrefixTransformer(color.bold(prefixText) + ' ')
|
logClearLineToPrefixTransformer(color.bold(prefixText) + ' ')
|
||||||
)
|
)
|
||||||
.pipe(logTransformer({ tag: color.bold(prefixText) }))
|
.pipe(addPrefixTransformer(color.bold(prefixText)))
|
||||||
.pipe(process.stdout);
|
.pipe(process.stdout);
|
||||||
p.stderr
|
p.stderr
|
||||||
.pipe(logClearLineToPrefixTransformer(color(prefixText) + ' '))
|
.pipe(logClearLineToPrefixTransformer(color(prefixText) + ' '))
|
||||||
.pipe(logTransformer({ tag: color(prefixText) }))
|
.pipe(addPrefixTransformer(color(prefixText)))
|
||||||
.pipe(process.stderr);
|
.pipe(process.stderr);
|
||||||
} else {
|
} else {
|
||||||
p.stdout.pipe(logTransformer()).pipe(process.stdout);
|
p.stdout.pipe(addPrefixTransformer()).pipe(process.stdout);
|
||||||
p.stderr.pipe(logTransformer()).pipe(process.stderr);
|
p.stderr.pipe(addPrefixTransformer()).pipe(process.stderr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -539,7 +538,7 @@ function getColor(projectName: string) {
|
|||||||
/**
|
/**
|
||||||
* Prevents terminal escape sequence from clearing line prefix.
|
* Prevents terminal escape sequence from clearing line prefix.
|
||||||
*/
|
*/
|
||||||
function logClearLineToPrefixTransformer(prefix) {
|
function logClearLineToPrefixTransformer(prefix: string) {
|
||||||
let prevChunk = null;
|
let prevChunk = null;
|
||||||
return new Transform({
|
return new Transform({
|
||||||
transform(chunk, _encoding, callback) {
|
transform(chunk, _encoding, callback) {
|
||||||
@ -552,3 +551,20 @@ function logClearLineToPrefixTransformer(prefix) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addPrefixTransformer(prefix?: string) {
|
||||||
|
const newLineSeparator = process.platform.startsWith('win') ? '\r\n' : '\n';
|
||||||
|
return new Transform({
|
||||||
|
transform(chunk, _encoding, callback) {
|
||||||
|
const list = chunk.toString().split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g);
|
||||||
|
list
|
||||||
|
.filter(Boolean)
|
||||||
|
.forEach((m) =>
|
||||||
|
this.push(
|
||||||
|
prefix ? prefix + ' ' + m + newLineSeparator : m + newLineSeparator
|
||||||
|
)
|
||||||
|
);
|
||||||
|
callback();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@ -147,9 +147,6 @@ importers:
|
|||||||
string-width:
|
string-width:
|
||||||
specifier: ^4.2.3
|
specifier: ^4.2.3
|
||||||
version: 4.2.3
|
version: 4.2.3
|
||||||
strong-log-transformer:
|
|
||||||
specifier: ^2.1.0
|
|
||||||
version: 2.1.0
|
|
||||||
tailwind-merge:
|
tailwind-merge:
|
||||||
specifier: ^2.4.0
|
specifier: ^2.4.0
|
||||||
version: 2.5.2
|
version: 2.5.2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user