-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tasks list #69
Tasks list #69
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Besides the small comments I have, I believe the UI needs a bit of improvement. Two things pop in mind:
- There's contention between the package headers (the green ones) and the steps. Once we have the steps, I don't see why we need the package headers. We can have the package headers written in the task header.
- The collapse happens after the phase ends. I believe it's better that it should happen after each step ends.
packages/cli/src/command-build.js
Outdated
} | ||
|
||
/** @type {( linesToDisplay?: number) => (payload: string, showAll?: boolean) => string} */ | ||
const StreamBuffer = (linesToDisplay = 10) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bilt style prefers function
over arrow function, except for cases where the function is trivial (e.g. x => x * 2
), and in this case it isn't trivial. I would prefer you convert this to a function
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/** @type {( linesToDisplay?: number) => (payload: string, showAll?: boolean) => string} */ | ||
const StreamBuffer = (linesToDisplay = 10) => { | ||
/** @type {string[]} */ | ||
let buffer = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name confused me, because buffer
has a very specific meaning in Node.js. Maybe lines
? Or lineBuffer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, It is now LinesBuffer
packages/cli/src/command-build.js
Outdated
childProcess.stdout.pipe(process.stdout) | ||
childProcess.stderr.pipe(process.stderr) | ||
const buffer = StreamBuffer() | ||
childProcess.stdout.on('data', (payload) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part doesn't make sense. Is it true that if an stderr
payload arrives, it will clear the existing stdout
payload? And vice-versa? (I may be misunderstanding task.output =
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
task.output =
is a complete override of the output, the only thing that "has a memory" is the LinesBuffer.
Because both stdout
and stderr
share the same buffer, when an error occurs it'll just append it to the buffer(and will not slice it to 10 lines) so you can see the entire process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! One array for both. Missed that. Thanks!
packages/cli/src/command-build.js
Outdated
} | ||
}, | ||
skip: async () => { | ||
const shouldSkip = !(await stepExecution.shouldSkip()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also fix shouldSkip()
? 😱
We also have a new issue in line 549, the await is not wrapped in try/catch - which can cause unhandled rejections, I still need to decide how to handle those errors. |
@reggev As you can see, the build failed. I cloned your PR, and the |
No description provided.