diff --git a/packages/cli/src/lib/new/execution/writeTemplateContents.ts b/packages/cli/src/lib/new/execution/writeTemplateContents.ts index f5550a1255..f4c90f7935 100644 --- a/packages/cli/src/lib/new/execution/writeTemplateContents.ts +++ b/packages/cli/src/lib/new/execution/writeTemplateContents.ts @@ -46,11 +46,23 @@ export async function writeTemplateContents( templatedValues: template.templateValues, }); - for (const file of template.files) { - if (isMonoRepo && file.path === 'tsconfig.json') { - continue; - } + if (!isMonoRepo) { + await fs.writeJson( + resolvePath(targetDir, 'tsconfig.json'), + { + extends: '@backstage/cli/config/tsconfig.json', + include: ['src', 'dev', 'migrations'], + exclude: ['node_modules'], + compilerOptions: { + outDir: 'dist-types', + rootDir: '.', + }, + }, + { spaces: 2 }, + ); + } + for (const file of template.files) { const destPath = resolvePath(targetDir, file.path); await fs.ensureDir(dirname(destPath)); diff --git a/packages/cli/templates/backend-plugin-module/tsconfig.json b/packages/cli/templates/backend-plugin-module/tsconfig.json deleted file mode 100644 index 5ae9aeb62d..0000000000 --- a/packages/cli/templates/backend-plugin-module/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@backstage/cli/config/tsconfig.json", - "include": ["src"], - "exclude": ["node_modules"], - "compilerOptions": { - "outDir": "dist-types", - "rootDir": "." - } -} diff --git a/packages/cli/templates/backend-plugin/tsconfig.json b/packages/cli/templates/backend-plugin/tsconfig.json deleted file mode 100644 index d77f0fe3b4..0000000000 --- a/packages/cli/templates/backend-plugin/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "@backstage/cli/config/tsconfig.json", - "include": [ - "src", - "dev", - "migrations" - ], - "exclude": ["node_modules"], - "compilerOptions": { - "outDir": "dist-types", - "rootDir": "." - } -} diff --git a/packages/cli/templates/frontend-plugin/tsconfig.json b/packages/cli/templates/frontend-plugin/tsconfig.json deleted file mode 100644 index b61e496175..0000000000 --- a/packages/cli/templates/frontend-plugin/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "@backstage/cli/config/tsconfig.json", - "include": [ - "src", - "dev" - ], - "exclude": ["node_modules"], - "compilerOptions": { - "outDir": "dist-types", - "rootDir": "." - } -} diff --git a/packages/cli/templates/node-library/tsconfig.json b/packages/cli/templates/node-library/tsconfig.json deleted file mode 100644 index ce3409d31f..0000000000 --- a/packages/cli/templates/node-library/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "@backstage/cli/config/tsconfig.json", - "include": [ - "src", - ], - "exclude": ["node_modules"], - "compilerOptions": { - "outDir": "dist-types", - "rootDir": "." - } -} diff --git a/packages/cli/templates/plugin-common-library/tsconfig.json b/packages/cli/templates/plugin-common-library/tsconfig.json deleted file mode 100644 index 5ae9aeb62d..0000000000 --- a/packages/cli/templates/plugin-common-library/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@backstage/cli/config/tsconfig.json", - "include": ["src"], - "exclude": ["node_modules"], - "compilerOptions": { - "outDir": "dist-types", - "rootDir": "." - } -} diff --git a/packages/cli/templates/plugin-node-library/tsconfig.json b/packages/cli/templates/plugin-node-library/tsconfig.json deleted file mode 100644 index 5ae9aeb62d..0000000000 --- a/packages/cli/templates/plugin-node-library/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@backstage/cli/config/tsconfig.json", - "include": ["src"], - "exclude": ["node_modules"], - "compilerOptions": { - "outDir": "dist-types", - "rootDir": "." - } -} diff --git a/packages/cli/templates/plugin-web-library/tsconfig.json b/packages/cli/templates/plugin-web-library/tsconfig.json deleted file mode 100644 index ce3409d31f..0000000000 --- a/packages/cli/templates/plugin-web-library/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "@backstage/cli/config/tsconfig.json", - "include": [ - "src", - ], - "exclude": ["node_modules"], - "compilerOptions": { - "outDir": "dist-types", - "rootDir": "." - } -} diff --git a/packages/cli/templates/scaffolder-backend-module/tsconfig.json b/packages/cli/templates/scaffolder-backend-module/tsconfig.json deleted file mode 100644 index 5ae9aeb62d..0000000000 --- a/packages/cli/templates/scaffolder-backend-module/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@backstage/cli/config/tsconfig.json", - "include": ["src"], - "exclude": ["node_modules"], - "compilerOptions": { - "outDir": "dist-types", - "rootDir": "." - } -} diff --git a/packages/cli/templates/web-library/tsconfig.json b/packages/cli/templates/web-library/tsconfig.json deleted file mode 100644 index ce3409d31f..0000000000 --- a/packages/cli/templates/web-library/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "@backstage/cli/config/tsconfig.json", - "include": [ - "src", - ], - "exclude": ["node_modules"], - "compilerOptions": { - "outDir": "dist-types", - "rootDir": "." - } -}