From 63ae4d3fd13d86f14cfa3ea418741962943bd3db Mon Sep 17 00:00:00 2001 From: Tristan Watanabe Date: Tue, 1 Nov 2022 20:54:40 -0700 Subject: [PATCH 1/2] fix: tsconfig.spec.json only adds testing/ path when there's a conformance setup --- .../generators/migrate-converged-pkg/index.spec.ts | 2 -- tools/generators/migrate-converged-pkg/index.ts | 14 +++++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/tools/generators/migrate-converged-pkg/index.spec.ts b/tools/generators/migrate-converged-pkg/index.spec.ts index 5e0124bf699dd..0e0cd016a6fcb 100644 --- a/tools/generators/migrate-converged-pkg/index.spec.ts +++ b/tools/generators/migrate-converged-pkg/index.spec.ts @@ -332,8 +332,6 @@ describe('migrate-converged-pkg generator', () => { '**/*.test.js', '**/*.test.jsx', '**/*.d.ts', - './src/testing/**/*.js', - './src/testing/**/*.jsx', ]); }); diff --git a/tools/generators/migrate-converged-pkg/index.ts b/tools/generators/migrate-converged-pkg/index.ts index 91ffb014520a6..856e7cefb0f02 100644 --- a/tools/generators/migrate-converged-pkg/index.ts +++ b/tools/generators/migrate-converged-pkg/index.ts @@ -262,21 +262,17 @@ const templates = { outDir: 'dist', types: ['jest', 'node'], } as TsConfig['compilerOptions'], - include: [ - '**/*.spec.ts', - '**/*.spec.tsx', - '**/*.test.ts', - '**/*.test.tsx', - '**/*.d.ts', - './src/testing/**/*.ts', - './src/testing/**/*.tsx', - ], + include: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.test.ts', '**/*.test.tsx', '**/*.d.ts'], }; if (options.js) { tsConfig.include = globsToJs(tsConfig.include); } + if (options.hasConformance) { + tsConfig.include.push('./src/testing/**/*.ts', './src/testing/**/*.tsx'); + } + return tsConfig; }, }; From b2f0b55885be7100cd4d797e63b1ee81685df191 Mon Sep 17 00:00:00 2001 From: Tristan Watanabe Date: Tue, 1 Nov 2022 21:09:02 -0700 Subject: [PATCH 2/2] fix: move condition before glob conversion to js --- tools/generators/migrate-converged-pkg/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/generators/migrate-converged-pkg/index.ts b/tools/generators/migrate-converged-pkg/index.ts index 856e7cefb0f02..21d1cd3bf3800 100644 --- a/tools/generators/migrate-converged-pkg/index.ts +++ b/tools/generators/migrate-converged-pkg/index.ts @@ -265,14 +265,14 @@ const templates = { include: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.test.ts', '**/*.test.tsx', '**/*.d.ts'], }; - if (options.js) { - tsConfig.include = globsToJs(tsConfig.include); - } - if (options.hasConformance) { tsConfig.include.push('./src/testing/**/*.ts', './src/testing/**/*.tsx'); } + if (options.js) { + tsConfig.include = globsToJs(tsConfig.include); + } + return tsConfig; }, };