chromaui / chromatic-cli

Chromatic CLI: `npx chromatic`
https://www.chromatic.com/docs/cli
MIT License
289 stars 70 forks source link

Add support for `logLevel` and `logPrefix` options, use local timestamp as default prefix #1107

Closed ghengeveld closed 1 month ago

ghengeveld commented 1 month ago

This is to allow the VTA to lower the log level and add a custom prefix to each log line in order to distinguish them from Storybook's own logs. The default prefix is a timestamp (e.g. 14:30:00.123) in the local timezone.

Previously we would prefix each line with a UTC-based timestamp, but that only really worked when explicitly using the --debug or --no-interactive flag, or when writing to a log file. We now properly support debug and interactive as options to the logger as well. The logger no longer directly reads from process.argv but we pass in parsed arguments as flags instead. This doesn't affect existing setups except for GitHub Actions when using the debug: true or interactive: false option. Not a breaking change though.

Also we now preserve colors when using non-interactive or debug mode.

📦 Published PR as canary version: 11.16.0--canary.1107.11483367055.0
:sparkles: Test out this PR locally via: ```bash npm install chromatic@11.16.0--canary.1107.11483367055.0 # or yarn add chromatic@11.16.0--canary.1107.11483367055.0 ```
github-actions[bot] commented 1 month ago

📦 Package Size: 5380 KB

codacy-production[bot] commented 1 month ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 081f5df6bc39e85818f62841abefc3f18e966b8b[^1] :white_check_mark: 81.36% (target: 80.00%)
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (081f5df6bc39e85818f62841abefc3f18e966b8b) | Report Missing | Report Missing | Report Missing | | | Head commit (47b32915215ffe70c883fc725ee432f4db4e5a46) | 7089 | 4821 | 68.01% | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#1107) | 59 | 48 | **81.36%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more [^1]: Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

ghengeveld commented 1 month ago

@codykaup I've restored the original build script. It's only really an issue when developing locally anyway (you might end up in a bad repo state) but it's fairly simple to fix by running yarn clean-package restore.

chromatic-ci-bot commented 1 month ago

:rocket: PR was released in v11.15.0 :rocket: