Failing webpack/declaration build does not cause cli process to exit with non-zero code

Open Beginner friendly
#291 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript

Research direction

Locate the CLI entry point that calls buildDeclaration and handles the errors variable. Trace how webpack and declaration failures are currently propagated, then verify that each failure produces a non-zero process exit status in the CI-facing command.

Written by the indexing model from the issue text.

Description

We noticed when the webpack build fails or the typescript declaration emitting step fails, the cli process does not exit with a non-zero code. This is problematic in a CI context as the CI pipeline will continue running the next steps in the job/next job as it doesn't detect the failure.

The following updates should probably be made:

  • Catch errors thrown by buildDeclaration
  • If an error is caught by buildDeclaration or the errors variable has a truthy value, add code to call process.exit with a non-zero code.
Dominant language
TypeScript
Stars
107
Forks
32
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GrapesJS/cli

All issues in GrapesJS/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.