Skip to content

Commit

Permalink
fix: update filtering reordering mechanism
Browse files Browse the repository at this point in the history
fix #670

Although this might be not the most performant solution, we are not
expecting to have lots of buffer that has been queued up for the
release.
  • Loading branch information
cenk1cenk2 committed Apr 11, 2023
1 parent 72c6a21 commit a72cc7b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ variables:
NODE_LINT_COMMAND: lint
NODE_TEST_COMMAND: test
GITHUB_STATUS_PROJECT: listr2/listr2
SKIP_GIT_HOOKS: '1'

include:
- project: devops/pipes
Expand Down Expand Up @@ -72,10 +73,8 @@ semantic-release:
stage: publish
extends: .semantic-release
needs:
- install
- build
- lint
- test
dependencies:
- install
- build
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"docs:dev:start:clean": "vuepress dev docs --clean-cache"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged",
"prepare-commit-msg": "[ -t 1 ] && exec < /dev/tty && git cz --hook || true",
"pre-push": "pnpm run test"
"pre-commit": "[ -z $SKIP_GIT_HOOKS ] && pnpm exec lint-staged",
"prepare-commit-msg": "[ -z $SKIP_GIT_HOOKS ] && [ -t 1 ] && exec < /dev/tty && git cz --hook || true",
"pre-push": "[ -z $SKIP_GIT_HOOKS ] && pnpm run test"
},
"lint-staged": {
"*.{ts,js,tsx,jsx,spec.ts}": [
Expand Down
8 changes: 4 additions & 4 deletions src/utils/process-output/process-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ export class ProcessOutput {

public release (): void {
const output = Object.entries(this.stream)
.filter(([ name ]) => this.options.dump.includes(name as keyof ProcessOutputStreamMap))
.map(([ , stream ]) => stream)
.map((stream) => stream.release())
.flat()
.map(([ name, stream ]) => ({ name, buffer: stream.release() }))
.filter((output) => this.options.dump.includes(output.name as keyof ProcessOutputStreamMap))
.flatMap((output) => output.buffer)
.sort((a, b) => a.time - b.time)
.map((message) => {
return {
...message,
entry: cleanseAnsi(message.entry)
}
})
.filter((message) => message.entry)

if (output.length > 0) {
if (this.options.leaveEmptyLine) {
Expand Down

0 comments on commit a72cc7b

Please sign in to comment.