@@ -65,6 +65,9 @@ export default async function (tree: Tree, schema: SchemaOptions) {
65
65
66
66
updateProject ( tree , projectRoot , name ) ;
67
67
updateTsConfig ( tree , projectRoot ) ;
68
+ updateEslintrc ( tree , projectRoot ) ;
69
+ updateJestConfig ( tree , projectRoot ) ;
70
+ updateProjectJson ( tree , projectRoot ) ;
68
71
updatePackage ( tree , projectRoot , schema ) ;
69
72
updateReleasePleaseConfig ( tree , projectRoot ) ;
70
73
updateReleasePleaseManifest ( tree , projectRoot ) ;
@@ -197,6 +200,36 @@ function updateTsConfig(tree: Tree, projectRoot: string) {
197
200
} ) ;
198
201
}
199
202
203
+ function updateEslintrc ( tree : Tree , projectRoot : string ) {
204
+ // Update .eslintrc.json root location
205
+ updateJson ( tree , joinPathFragments ( projectRoot , '.eslintrc.json' ) , ( json ) => {
206
+ json . extends = `../../${ json . extends } ` ;
207
+ return json ;
208
+ } ) ;
209
+ }
210
+
211
+ function updateJestConfig ( tree : Tree , projectRoot : string ) {
212
+ const configPath = joinPathFragments ( projectRoot , 'jest.config.ts' ) ;
213
+
214
+ // Update jest.preset.js path
215
+ let contents = tree . read ( configPath ) ! . toString ( ) ;
216
+ const replaceJestPresetPath = contents . replace ( '../jest.preset.js' , '../../../jest.preset.js' ) ;
217
+ tree . write ( configPath , replaceJestPresetPath ) ;
218
+
219
+ // Update coverage path
220
+ contents = tree . read ( configPath ) ! . toString ( ) ;
221
+ const replaceCoveragePath = contents . replace ( '../coverage/providers' , `../../../coverage/${ projectRoot } ` ) ;
222
+ tree . write ( configPath , replaceCoveragePath ) ;
223
+ }
224
+
225
+ function updateProjectJson ( tree : Tree , projectRoot : string ) {
226
+ // Update jest.config.ts location
227
+ updateJson ( tree , joinPathFragments ( projectRoot , 'project.json' ) , ( json ) => {
228
+ json . targets . test . options . jestConfig = '{projectRoot}/jest.config.ts' ;
229
+ return json ;
230
+ } ) ;
231
+ }
232
+
200
233
function updateReleasePleaseConfig ( tree : Tree , projectRoot : string ) {
201
234
updateJson ( tree , 'release-please-config.json' , ( json ) => {
202
235
json . packages [ projectRoot ] = {
0 commit comments