Skip to content

Commit

Permalink
fix(react-native): fix tsc app
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Jul 14, 2023
1 parent 13b7e4b commit d5836f1
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 15 deletions.
18 changes: 18 additions & 0 deletions e2e/expo/src/expo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import {
checkFilesExist,
cleanupProject,
expectTestsPass,
getPackageManagerCommand,
killPorts,
newProject,
promisifiedTreeKill,
readJson,
readResolvedConfiguration,
runCLI,
runCLIAsync,
runCommand,
runCommandUntil,
tmpProjPath,
uniq,
updateFile,
} from '@nx/e2e/utils';
Expand Down Expand Up @@ -129,4 +132,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();
});
});
18 changes: 18 additions & 0 deletions e2e/react-native/src/react-native.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
runCLIAsync,
runCommand,
runCommandUntil,
tmpProjPath,
uniq,
updateFile,
} from '@nx/e2e/utils';
Expand Down Expand Up @@ -194,4 +195,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();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export const App = () => {
<View style={[styles.listItem, styles.marginBottomMd]}>
<Svg width={48} height={48} viewBox="0 0 120 120" stroke="currentColor" fill="transparent">
<Path strokeWidth="2" d="M23 3.75V6.5c-3.036 0-5.5 2.464-5.5 5.5s-2.464 5.5-5.5 5.5-5.5 2.464-5.5 5.5H3.75C2.232 23 1 21.768 1 20.25V3.75C1 2.232 2.232 1 3.75 1h16.5C21.768 1 23 2.232 23 3.75Z" />
<Path strokewidth="2" d="M23 6v14.1667C23 21.7307 21.7307 23 20.1667 23H6c0-3.128 2.53867-5.6667 5.6667-5.6667 3.128 0 5.6666-2.5386 5.6666-5.6666C17.3333 8.53867 19.872 6 23 6Z" />
<Path strokeWidth="2" d="M23 6v14.1667C23 21.7307 21.7307 23 20.1667 23H6c0-3.128 2.53867-5.6667 5.6667-5.6667 3.128 0 5.6666-2.5386 5.6666-5.6666C17.3333 8.53867 19.872 6 23 6Z" />
</Svg>
<View style={styles.listItemTextContainer}>
<Text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}

0 comments on commit d5836f1

Please sign in to comment.