Skip to content

Commit

Permalink
refactor(@schematics/angular): remove stylus from style options
Browse files Browse the repository at this point in the history
BREAKING CHANGE:

`styl` (Stylus) is no longer a supported value as `style` in `application`, `component`, `ng-new` schematics. Stylus is not actively maintained and only 0.3% of the Angular CLI users use it.

(cherry picked from commit 0272fc5)
  • Loading branch information
alan-agius4 authored and josephperrott committed Apr 21, 2021
1 parent 656f8d7 commit fd729ac
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 24 deletions.
3 changes: 1 addition & 2 deletions packages/schematics/angular/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ function addAppToWorkspaceFile(options: ApplicationOptions, appDir: string): Rul
];
}

const inlineStyleLanguage =
options.style && options.style !== Style.Css && options.style !== Style.Styl
const inlineStyleLanguage = options?.style !== Style.Css
? options.style
: undefined;

Expand Down
15 changes: 0 additions & 15 deletions packages/schematics/angular/application/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,21 +444,6 @@ describe('Application Schematic', () => {
expect(testOpt.inlineStyleLanguage).toBeUndefined();
});

it('does not set "inlineStyleLanguage" in angular.json when using Stylus styles', async () => {
const options = { ...defaultOptions, projectRoot: '', style: Style.Styl };
const tree = await schematicRunner
.runSchematicAsync('application', options, workspaceTree)
.toPromise();
const config = JSON.parse(tree.readContent('/angular.json'));
const prj = config.projects.foo;

const buildOpt = prj.architect.build.options;
expect(buildOpt.inlineStyleLanguage).toBeUndefined();

const testOpt = prj.architect.test.options;
expect(testOpt.inlineStyleLanguage).toBeUndefined();
});

it('should set the relative tsconfig paths', async () => {
const options = { ...defaultOptions, projectRoot: '' };
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
Expand Down
6 changes: 2 additions & 4 deletions packages/schematics/angular/application/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@
"css",
"scss",
"sass",
"less",
"styl"
"less"
],
"x-prompt": {
"message": "Which stylesheet format would you like to use?",
Expand All @@ -70,8 +69,7 @@
{ "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ https://sass-lang.com/documentation/syntax#scss ]" },
{ "value": "sass", "label": "Sass [ https://sass-lang.com/documentation/syntax#the-indented-syntax ]" },
{ "value": "less", "label": "Less [ http://lesscss.org ]" },
{ "value": "styl", "label": "Stylus [ https://stylus-lang.com ]" }
{ "value": "less", "label": "Less [ http://lesscss.org ]" }
]
},
"x-user-analytics": 5
Expand Down
3 changes: 1 addition & 2 deletions packages/schematics/angular/component/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@
"css",
"scss",
"sass",
"less",
"styl"
"less"
],
"x-user-analytics": 5
},
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/ng-new/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"style": {
"description": "The file extension or preprocessor to use for style files.",
"type": "string",
"enum": ["css", "scss", "sass", "less", "styl"],
"enum": ["css", "scss", "sass", "less"],
"x-user-analytics": 5
},
"skipTests": {
Expand Down

0 comments on commit fd729ac

Please sign in to comment.