@@ -13,7 +13,7 @@ import {
13
13
url ,
14
14
} from '@angular-devkit/schematics' ;
15
15
import { parse } from 'jsonc-parser' ;
16
- import { normalizeToKebabOrSnakeCase } from '../../utils/formatting ' ;
16
+ import { inPlaceSortByKeys , normalizeToKebabOrSnakeCase } from '../../utils' ;
17
17
import {
18
18
DEFAULT_LANGUAGE ,
19
19
DEFAULT_LIB_PATH ,
@@ -133,6 +133,8 @@ function updateJestConfig(
133
133
const packageKeyRegex = '^' + packageKey + '(|/.*)$' ;
134
134
const packageRoot = join ( '<rootDir>' as Path , distRoot ) ;
135
135
jestOptions . moduleNameMapper [ packageKeyRegex ] = join ( packageRoot , '$1' ) ;
136
+
137
+ inPlaceSortByKeys ( jestOptions . moduleNameMapper ) ;
136
138
}
137
139
138
140
function updateNpmScripts (
@@ -181,6 +183,8 @@ function updateJestEndToEnd(options: LibraryOptions) {
181
183
const packageRoot = '<rootDir>/../' + distRoot ;
182
184
jestOptions . moduleNameMapper [ deepPackagePath ] = packageRoot + '/$1' ;
183
185
jestOptions . moduleNameMapper [ packageKey ] = packageRoot ;
186
+
187
+ inPlaceSortByKeys ( jestOptions . moduleNameMapper ) ;
184
188
} ,
185
189
) ;
186
190
} ;
@@ -238,6 +242,8 @@ function updateTsConfig(
238
242
tsconfig . compilerOptions . paths [ deepPackagePath ] = [ ] ;
239
243
}
240
244
tsconfig . compilerOptions . paths [ deepPackagePath ] . push ( distRoot + '/*' ) ;
245
+
246
+ inPlaceSortByKeys ( tsconfig . compilerOptions . paths ) ;
241
247
} ,
242
248
) ;
243
249
} ;
@@ -284,6 +290,8 @@ function addLibraryToCliOptions(
284
290
) ;
285
291
}
286
292
optionsFile . projects [ projectName ] = project ;
293
+
294
+ inPlaceSortByKeys ( optionsFile . projects ) ;
287
295
} ,
288
296
) ;
289
297
} ;
0 commit comments