@@ -87,11 +87,18 @@ export function createMigrationSchematicRule(
87
87
logger . warn ( `Could not find TypeScript project for project: ${ projectName } ` ) ;
88
88
continue ;
89
89
}
90
+
91
+ // In some applications, developers will have global stylesheets which are not
92
+ // specified in any Angular component. Therefore we glob up all CSS and SCSS files
93
+ // in the project and migrate them if needed.
94
+ // TODO: rework this to collect global stylesheets from the workspace config. COMP-280.
95
+ const additionalStylesheetPaths = findStylesheetFiles ( tree , project . root ) ;
96
+
90
97
if ( buildTsconfigPath !== null ) {
91
- runMigrations ( project , projectName , buildTsconfigPath , false ) ;
98
+ runMigrations ( project , projectName , buildTsconfigPath , additionalStylesheetPaths , false ) ;
92
99
}
93
100
if ( testTsconfigPath !== null ) {
94
- runMigrations ( project , projectName , testTsconfigPath , true ) ;
101
+ runMigrations ( project , projectName , testTsconfigPath , additionalStylesheetPaths , true ) ;
95
102
}
96
103
}
97
104
@@ -120,7 +127,8 @@ export function createMigrationSchematicRule(
120
127
121
128
/** Runs the migrations for the specified workspace project. */
122
129
function runMigrations ( project : WorkspaceProject , projectName : string ,
123
- tsconfigPath : WorkspacePath , isTestTarget : boolean ) {
130
+ tsconfigPath : WorkspacePath , additionalStylesheetPaths : string [ ] ,
131
+ isTestTarget : boolean ) {
124
132
const program = UpdateProject . createProgramFromTsconfig ( tsconfigPath , fileSystem ) ;
125
133
const updateContext : DevkitContext = {
126
134
isTestTarget,
@@ -137,13 +145,8 @@ export function createMigrationSchematicRule(
137
145
context . logger ,
138
146
) ;
139
147
140
- // In some applications, developers will have global stylesheets which are not
141
- // specified in any Angular component. Therefore we glob up all CSS and SCSS files
142
- // in the project and migrate them if needed.
143
- // TODO: rework this to collect global stylesheets from the workspace config. COMP-280.
144
- const additionalStylesheets = findStylesheetFiles ( tree , project . root ) ;
145
148
const result =
146
- updateProject . migrate ( migrations , targetVersion , upgradeData , additionalStylesheets ) ;
149
+ updateProject . migrate ( migrations , targetVersion , upgradeData , additionalStylesheetPaths ) ;
147
150
148
151
// Commit all recorded edits in the update recorder. We apply the edits after all
149
152
// migrations ran because otherwise offsets in the TypeScript program would be
0 commit comments