Skip to content

Commit fd729ac

Browse files
alan-agius4josephperrott
authored andcommitted
refactor(@schematics/angular): remove stylus from style options
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)
1 parent 656f8d7 commit fd729ac

File tree

5 files changed

+5
-24
lines changed

5 files changed

+5
-24
lines changed

packages/schematics/angular/application/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ function addAppToWorkspaceFile(options: ApplicationOptions, appDir: string): Rul
139139
];
140140
}
141141

142-
const inlineStyleLanguage =
143-
options.style && options.style !== Style.Css && options.style !== Style.Styl
142+
const inlineStyleLanguage = options?.style !== Style.Css
144143
? options.style
145144
: undefined;
146145

packages/schematics/angular/application/index_spec.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -444,21 +444,6 @@ describe('Application Schematic', () => {
444444
expect(testOpt.inlineStyleLanguage).toBeUndefined();
445445
});
446446

447-
it('does not set "inlineStyleLanguage" in angular.json when using Stylus styles', async () => {
448-
const options = { ...defaultOptions, projectRoot: '', style: Style.Styl };
449-
const tree = await schematicRunner
450-
.runSchematicAsync('application', options, workspaceTree)
451-
.toPromise();
452-
const config = JSON.parse(tree.readContent('/angular.json'));
453-
const prj = config.projects.foo;
454-
455-
const buildOpt = prj.architect.build.options;
456-
expect(buildOpt.inlineStyleLanguage).toBeUndefined();
457-
458-
const testOpt = prj.architect.test.options;
459-
expect(testOpt.inlineStyleLanguage).toBeUndefined();
460-
});
461-
462447
it('should set the relative tsconfig paths', async () => {
463448
const options = { ...defaultOptions, projectRoot: '' };
464449
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)

packages/schematics/angular/application/schema.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
"css",
6161
"scss",
6262
"sass",
63-
"less",
64-
"styl"
63+
"less"
6564
],
6665
"x-prompt": {
6766
"message": "Which stylesheet format would you like to use?",
@@ -70,8 +69,7 @@
7069
{ "value": "css", "label": "CSS" },
7170
{ "value": "scss", "label": "SCSS [ https://sass-lang.com/documentation/syntax#scss ]" },
7271
{ "value": "sass", "label": "Sass [ https://sass-lang.com/documentation/syntax#the-indented-syntax ]" },
73-
{ "value": "less", "label": "Less [ http://lesscss.org ]" },
74-
{ "value": "styl", "label": "Stylus [ https://stylus-lang.com ]" }
72+
{ "value": "less", "label": "Less [ http://lesscss.org ]" }
7573
]
7674
},
7775
"x-user-analytics": 5

packages/schematics/angular/component/schema.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@
8484
"css",
8585
"scss",
8686
"sass",
87-
"less",
88-
"styl"
87+
"less"
8988
],
9089
"x-user-analytics": 5
9190
},

packages/schematics/angular/ng-new/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"style": {
108108
"description": "The file extension or preprocessor to use for style files.",
109109
"type": "string",
110-
"enum": ["css", "scss", "sass", "less", "styl"],
110+
"enum": ["css", "scss", "sass", "less"],
111111
"x-user-analytics": 5
112112
},
113113
"skipTests": {

0 commit comments

Comments
 (0)