Skip to content
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

feat: print end status in watch mode #408

Merged
merged 6 commits into from
Jan 27, 2024

Conversation

nnecec
Copy link
Contributor

@nnecec nnecec commented Jan 15, 2024

I sometimes wonder if I've built done in watch mode, because it print nothing when built sucessfully.
 
Do we need to print some hint like these in watch mode?

> bunchee -w

Watching project /Users/nnecec/Github/bunchee...
📦 Build in: 1.956s
📦 Build in: 595.334ms
src/bundle.ts(25,3): error TS6133: 'getPackageMeta' is declared but its value is never read.
src/bundle.ts(70,64): error TS2304: Cannot find name 'pkg'.
src/bundle.ts(71,38): error TS2304: Cannot find name 'pkg'.
src/bundle.ts(73,38): error TS2304: Cannot find name 'pkg'.
src/bundle.ts(75,26): error TS2304: Cannot find name 'pkg'.
src/bundle.ts(153,40): error TS2304: Cannot find name 'pkg'.
src/bundle.ts(177,5): error TS18004: No value exists in scope for the shorthand property 'pkg'. Either declare one or provide an initializer.

📦 Build in: 652.215ms
📦 Build in: 512.592ms

@nnecec
Copy link
Contributor Author

nnecec commented Jan 15, 2024

Ignore this feat if you don't think it's necessary, just my personal opinion.

Copy link
Owner

@huozhi huozhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a nice feature.
Can we polish the output to sth like

✓ Built in xxx ms

Without including the emoji and :

@nnecec nnecec force-pushed the feat/print-end-status-in-watch-mode branch from 6a40946 to 0acbaf7 Compare January 16, 2024 02:15
@nnecec
Copy link
Contributor Author

nnecec commented Jan 16, 2024

Now it look like

> bunchee -w
Watching assets in /Users/nnecec/Github/bunchee...
✓ Build in 2875.94ms
src/bundle.ts(30,3): error TS6133: 'formatDuration' is declared but its value is never read.

✓ Build in 1541.16ms
✓ Build in 1727.21ms

Copy link
Owner

@huozhi huozhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, can we add a test? Then I will merge later release this in a minor version. Thank you!

@nnecec nnecec force-pushed the feat/print-end-status-in-watch-mode branch from d35d580 to 5fbad3c Compare January 17, 2024 14:41
@nnecec nnecec force-pushed the feat/print-end-status-in-watch-mode branch from 5fbad3c to 47575d6 Compare January 17, 2024 14:47
test/cli.test.ts Outdated Show resolved Hide resolved
test/cli.test.ts Outdated Show resolved Hide resolved
test/cli.test.ts Outdated Show resolved Hide resolved
@huozhi
Copy link
Owner

huozhi commented Jan 27, 2024

I refactored a bit the code, to leverage the build jobs count instead of using another counter, since that one could be incorrect that it might reaches to 0 ealier

@huozhi huozhi merged commit 42db605 into huozhi:main Jan 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants