diff --git a/e2e/expo/src/expo.test.ts b/e2e/expo/src/expo.test.ts index 28ef3fe4f7..029d5f8a9f 100644 --- a/e2e/expo/src/expo.test.ts +++ b/e2e/expo/src/expo.test.ts @@ -2,6 +2,7 @@ import { checkFilesExist, cleanupProject, expectTestsPass, + getPackageManagerCommand, killPorts, newProject, promisifiedTreeKill, @@ -9,6 +10,7 @@ import { readResolvedConfiguration, runCLI, runCLIAsync, + runCommand, runCommandUntil, uniq, updateFile, @@ -129,4 +131,19 @@ describe('expo', () => { checkFilesExist(`dist/libs/${libName}/src/index.d.ts`); }).not.toThrow(); }); + + it('should tsc app', async () => { + expect(() => { + const pmc = getPackageManagerCommand(); + runCommand( + `${pmc.runUninstalledPackage} tsc -p apps/${appName}/tsconfig.app.json` + ); + checkFilesExist( + `dist/out-tsc/apps/${appName}/src/app/App.js`, + `dist/out-tsc/apps/${appName}/src/app/App.d.ts`, + `dist/out-tsc/libs/${libName}/src/index.js`, + `dist/out-tsc/libs/${libName}/src/index.d.ts` + ); + }).not.toThrow(); + }); }); diff --git a/e2e/react-native/src/react-native.test.ts b/e2e/react-native/src/react-native.test.ts index cae7ddc61f..a7b4bf482f 100644 --- a/e2e/react-native/src/react-native.test.ts +++ b/e2e/react-native/src/react-native.test.ts @@ -194,4 +194,21 @@ describe('react native', () => { }, }); }); + + it('should tsc app', async () => { + expect(() => { + const pmc = getPackageManagerCommand(); + runCommand( + `${pmc.runUninstalledPackage} tsc -p apps/${appName}/tsconfig.app.json` + ); + checkFilesExist( + `dist/out-tsc/apps/${appName}/src/main.js`, + `dist/out-tsc/apps/${appName}/src/main.d.ts`, + `dist/out-tsc/apps/${appName}/src/app/App.js`, + `dist/out-tsc/apps/${appName}/src/app/App.d.ts`, + `dist/out-tsc/libs/${libName}/src/index.js`, + `dist/out-tsc/libs/${libName}/src/index.d.ts` + ); + }).not.toThrow(); + }); }); diff --git a/packages/expo/src/generators/application/files/tsconfig.app.json.template b/packages/expo/src/generators/application/files/tsconfig.app.json.template index 7799be4ddb..e6defb5dc1 100644 --- a/packages/expo/src/generators/application/files/tsconfig.app.json.template +++ b/packages/expo/src/generators/application/files/tsconfig.app.json.template @@ -4,6 +4,7 @@ "outDir": "<%= offsetFromRoot %>dist/out-tsc", "types": ["node"] }, + "files": ["<%= offsetFromRoot %>node_modules/@nx/expo/typings/svg.d.ts"], "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.spec.tsx", "test-setup.ts"], "include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"] } diff --git a/packages/expo/src/generators/application/files/tsconfig.json.template b/packages/expo/src/generators/application/files/tsconfig.json.template index db1c7e0b6a..55140e5b8c 100644 --- a/packages/expo/src/generators/application/files/tsconfig.json.template +++ b/packages/expo/src/generators/application/files/tsconfig.json.template @@ -8,19 +8,13 @@ "skipLibCheck": true, "resolveJsonModule": true, "strict": true, - "composite": true, "declaration": true }, - "files": [ - "../../node_modules/@nx/expo/typings/svg.d.ts" - ], + "files": [], "include": [], "references": [ { "path": "./tsconfig.app.json" } - ], - "exclude": [ - "node_modules" ] } diff --git a/packages/react-native/src/generators/application/files/app/src/app/App.tsx.template b/packages/react-native/src/generators/application/files/app/src/app/App.tsx.template index 09a25022ea..88cb31cf2a 100644 --- a/packages/react-native/src/generators/application/files/app/src/app/App.tsx.template +++ b/packages/react-native/src/generators/application/files/app/src/app/App.tsx.template @@ -356,7 +356,7 @@ export const App = () => { - + dist/out-tsc", "types": ["node"] }, + "files": ["<%= offsetFromRoot %>node_modules/@nx/react-native/typings/svg.d.ts"], "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.spec.tsx", "test-setup.ts"], "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx"] } diff --git a/packages/react-native/src/generators/application/files/app/tsconfig.json.template b/packages/react-native/src/generators/application/files/app/tsconfig.json.template index 5fc37a40c7..388b961ab2 100644 --- a/packages/react-native/src/generators/application/files/app/tsconfig.json.template +++ b/packages/react-native/src/generators/application/files/app/tsconfig.json.template @@ -7,19 +7,13 @@ "moduleResolution": "node", "skipLibCheck": true, "resolveJsonModule": true, - "composite": true, "declaration": true }, - "files": [ - "../../node_modules/@nx/react-native/typings/svg.d.ts" - ], + "files": [], "include": [], "references": [ { "path": "./tsconfig.app.json" } - ], - "exclude": [ - "node_modules" ] }