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(ng-add): respect project default style extension #12618

Merged

Conversation

devversion
Copy link
Member

  • No longer ignores the projects default style extension that has been specified in the ng new command (e.g. new new test --style scss)

* No longer ignores the projects default style extension that has been specified in the `ng new` command (e.g. `new new test --style scss`)
@devversion devversion added pr: merge safe target: major This PR is targeted for the next major release labels Aug 10, 2018
@devversion devversion requested a review from amcdnl as a code owner August 10, 2018 12:06
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 10, 2018
@@ -47,4 +44,17 @@ describe('material-dashboard-schematic', () => {
`import { MatGridListModule, MatCardModule, MatMenuModule, MatIconModule, MatButtonModule } from '@angular/material';`);
});

it('should support passing the style extension option', () => {
const tree = runner.runSchematic('dashboard', {styleext: 'scss', ...baseOptions},
createTestApp());
Copy link
Member

Choose a reason for hiding this comment

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

small nit: prefer line breaking at the higher syntactic level

    const tree = 
        runner.runSchematic('dashboard', {styleext: 'scss', ...baseOptions}, createTestApp());

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense - I've started the wrap after the function name. That's what we do within other Jasmine tests as well (e.g. expectTo() and that's also what CLang proposed me to do.

@@ -41,7 +41,11 @@ describe('material-install-schematic', () => {
'./node_modules/@angular/material/prebuilt-themes/indigo-pink.css');
});

it('should add custom theme', () => {
it('should support adding a custom theme', () => {
// TODO(devversion): currently a "custom" theme does only work for projects using SCSS.
Copy link
Member

Choose a reason for hiding this comment

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

Does the CLI not support mixing scss with other preprocessors?

Copy link
Member Author

@devversion devversion Aug 10, 2018

Choose a reason for hiding this comment

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

It does. The problem with the install schematic right now is that we also just add the custom theme to projects that don't use SCSS.

The schematic does not create a new scss file in a plain css project. It just looks for the default styles.(s)css file and puts the code in there. This is incorrect because the CSS files don't support the SASS syntax.

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 Aug 10, 2018
@ngbot
Copy link

ngbot bot commented Aug 10, 2018

I see that you just added the pr: merge ready label, but the following checks are still failing:
    failure status "continuous-integration/travis-ci/pr" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@mmalerba mmalerba merged commit 5144aa7 into angular:master Aug 13, 2018
@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 9, 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: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants