Skip to content

chore(schematics): improve messages for ng-add #13840

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

Merged

Conversation

devversion
Copy link
Member

In order to make the "failure" or "warning" messages with ng-add look more friendly and structured, we manually wrap the messages. Additionally chalk is being used more often in order to make it clear if something failed/passed or is just a warning.

@devversion devversion added pr: merge safe target: patch This PR is targeted for the next patch release labels Oct 27, 2018
@devversion devversion requested a review from jelbourn as a code owner October 27, 2018 10:43
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 27, 2018
In order to make the "failure" or "warning" messages with `ng-add` look more friendly and structured, we manually wrap the messages. Additionally `chalk` is being used more often in order to make it clear if something failed/passed or is just a warning.
@devversion devversion force-pushed the chore/schematics-ng-add-warnings-better branch from 85ae3e5 to 83069e3 Compare October 27, 2018 11:32
@@ -14,7 +14,7 @@ import {
getProjectStyleFile,
hasNgModuleImport,
} from '@angular/cdk/schematics';
import {red, bold} from 'chalk';
import {red, bold, italic} from 'chalk';
Copy link
Member

Choose a reason for hiding this comment

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

I hadn't thought about this before, but is it a problem that chalk isn't a dependency of our packages? We went through this with parse5

Copy link
Member Author

Choose a reason for hiding this comment

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

It's technically a dependency but chalk has been used before my changes AFAIK and we just assumed that chalk is always present due to the CLI coming with Chalk.

It might be better to be explicit though. Same applies for the @schematics/angular package we depend on.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, doesn't look like the CLI brings chalk in. It's required by:

    "/@babel/highlight",
    "/inquirer",
    "/postcss",
    "/speed-measure-webpack-plugin",
    "/tslint"

So kind of brittle. But the same applies for tslint (for ng-update) and the aforementioned @schematics/angular package. I can look in a follow-up for some API's the devkit provides for terminal colors (I think I saw something about that)

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 31, 2018
@jelbourn jelbourn merged commit 052673c into angular:master Oct 31, 2018
@devversion devversion deleted the chore/schematics-ng-add-warnings-better branch October 31, 2018 16:58
atscott pushed a commit to atscott/components that referenced this pull request Nov 5, 2018
In order to make the "failure" or "warning" messages with `ng-add` look more friendly and structured, we manually wrap the messages. Additionally `chalk` is being used more often in order to make it clear if something failed/passed or is just a warning.
jelbourn pushed a commit that referenced this pull request Nov 6, 2018
In order to make the "failure" or "warning" messages with `ng-add` look more friendly and structured, we manually wrap the messages. Additionally `chalk` is being used more often in order to make it clear if something failed/passed or is just a warning.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants