Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-native): fix tsc app #18124

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions e2e/expo/src/expo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import {
checkFilesExist,
cleanupProject,
expectTestsPass,
getPackageManagerCommand,
killPorts,
newProject,
promisifiedTreeKill,
readJson,
readResolvedConfiguration,
runCLI,
runCLIAsync,
runCommand,
runCommandUntil,
uniq,
updateFile,
Expand Down Expand Up @@ -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();
});
});
17 changes: 17 additions & 0 deletions e2e/react-native/src/react-native.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
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 @@ -4,6 +4,7 @@
"outDir": "<%= offsetFromRoot %>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"]
}
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"
]
}