Skip to content

fix(schematics): do not generate invalid stylesheet files - #15235

Merged
jelbourn merged 1 commit into
angular:masterfrom
devversion:fix/schematics-do-not-generate-invalid-stylesheet-files
Feb 20, 2019
Merged

fix(schematics): do not generate invalid stylesheet files#15235
jelbourn merged 1 commit into
angular:masterfrom
devversion:fix/schematics-do-not-generate-invalid-stylesheet-files

Conversation

@devversion

Copy link
Copy Markdown
Member

Currently whenever someone specified Stylus or Sass as the
default style extension for their Angular CLI project, the CDK/
Material schematics incorrectly generate files with that given
extension. This is problematic because the schematic style
templates are written in CSS and therefore are not compatible
with Stylus or Sass (which are not supersets of CSS unlike less, scss)

Fixes#15164

@googlebotgooglebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 19, 2019
* List of supported styles which are CSS supersets. All supported CLI style extensions can be
* found here: angular/angular-cli/master/packages/schematics/angular/ng-new/schema.json#L118-L122
*/
const supportedCssSupersets = ['scss', 'less'];

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

@jelbourn I decided to do in a safelist-fashion as "technically" the CLI could add new unsupported style extensions which will then break. This way we guarantee that we never generate invalid stylesheets.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's the right call 👍

@devversiondevversion added pr: merge safe target: patch This PR is targeted for the next patch release labels Feb 19, 2019
* List of supported styles which are CSS supersets. All supported CLI style extensions can be
* found here: angular/angular-cli/master/packages/schematics/angular/ng-new/schema.json#L118-L122
*/
const supportedCssSupersets = ['scss', 'less'];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's the right call 👍

Comment threadsrc/cdk/schematics/utils/build-component.ts Outdated
Currently whenever someone specified Stylus or Sass as the
default style extension for their Angular CLI project, the CDK/
Material schematics incorrectly generate files with that given
extension. This is problematic because the schematic style
templates are written in CSS and therefore are not compatible
with Stylus or Sass (which are not supersets of CSS unlike less, scss)
Fixesangular#15164
@devversion
devversionforce-pushed the fix/schematics-do-not-generate-invalid-stylesheet-files branch from 806479b to c904590CompareFebruary 19, 2019 21:38

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jelbournjelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Feb 19, 2019
@jelbourn
jelbourn merged commit f2cb837 into angular:masterFeb 20, 2019
jelbourn pushed a commit that referenced this pull request Feb 20, 2019
Currently whenever someone specified Stylus or Sass as the
default style extension for their Angular CLI project, the CDK/
Material schematics incorrectly generate files with that given
extension. This is problematic because the schematic style
templates are written in CSS and therefore are not compatible
with Stylus or Sass (which are not supersets of CSS unlike less, scss)
Fixes#15164
@angular-automatic-lock-bot

Copy link
Copy Markdown

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-botangular-automatic-lock-botBot locked and limited conversation to collaborators Sep 10, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: mergeThe PR is ready for merge by the caretakercla: yesPR author has agreed to Google's Contributor License Agreementtarget: patchThis PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Material schematics should generate .css files for some settings

3 participants

@devversion@jelbourn@googlebot