Skip to content

Commit 48d4927

Browse files
authored
fix(react-native): fix tsc app (#18124)
1 parent 2c1d4ba commit 48d4927

File tree

7 files changed

+39
-15
lines changed

7 files changed

+39
-15
lines changed

e2e/expo/src/expo.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import {
22
checkFilesExist,
33
cleanupProject,
44
expectTestsPass,
5+
getPackageManagerCommand,
56
killPorts,
67
newProject,
78
promisifiedTreeKill,
89
readJson,
910
readResolvedConfiguration,
1011
runCLI,
1112
runCLIAsync,
13+
runCommand,
1214
runCommandUntil,
1315
uniq,
1416
updateFile,
@@ -129,4 +131,19 @@ describe('expo', () => {
129131
checkFilesExist(`dist/libs/${libName}/src/index.d.ts`);
130132
}).not.toThrow();
131133
});
134+
135+
it('should tsc app', async () => {
136+
expect(() => {
137+
const pmc = getPackageManagerCommand();
138+
runCommand(
139+
`${pmc.runUninstalledPackage} tsc -p apps/${appName}/tsconfig.app.json`
140+
);
141+
checkFilesExist(
142+
`dist/out-tsc/apps/${appName}/src/app/App.js`,
143+
`dist/out-tsc/apps/${appName}/src/app/App.d.ts`,
144+
`dist/out-tsc/libs/${libName}/src/index.js`,
145+
`dist/out-tsc/libs/${libName}/src/index.d.ts`
146+
);
147+
}).not.toThrow();
148+
});
132149
});

e2e/react-native/src/react-native.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,21 @@ describe('react native', () => {
194194
},
195195
});
196196
});
197+
198+
it('should tsc app', async () => {
199+
expect(() => {
200+
const pmc = getPackageManagerCommand();
201+
runCommand(
202+
`${pmc.runUninstalledPackage} tsc -p apps/${appName}/tsconfig.app.json`
203+
);
204+
checkFilesExist(
205+
`dist/out-tsc/apps/${appName}/src/main.js`,
206+
`dist/out-tsc/apps/${appName}/src/main.d.ts`,
207+
`dist/out-tsc/apps/${appName}/src/app/App.js`,
208+
`dist/out-tsc/apps/${appName}/src/app/App.d.ts`,
209+
`dist/out-tsc/libs/${libName}/src/index.js`,
210+
`dist/out-tsc/libs/${libName}/src/index.d.ts`
211+
);
212+
}).not.toThrow();
213+
});
197214
});

packages/expo/src/generators/application/files/tsconfig.app.json.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
55
"types": ["node"]
66
},
7+
"files": ["<%= offsetFromRoot %>node_modules/@nx/expo/typings/svg.d.ts"],
78
"exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.spec.tsx", "test-setup.ts"],
89
"include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
910
}

packages/expo/src/generators/application/files/tsconfig.json.template

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@
88
"skipLibCheck": true,
99
"resolveJsonModule": true,
1010
"strict": true,
11-
"composite": true,
1211
"declaration": true
1312
},
14-
"files": [
15-
"../../node_modules/@nx/expo/typings/svg.d.ts"
16-
],
13+
"files": [],
1714
"include": [],
1815
"references": [
1916
{
2017
"path": "./tsconfig.app.json"
2118
}
22-
],
23-
"exclude": [
24-
"node_modules"
2519
]
2620
}

packages/react-native/src/generators/application/files/app/src/app/App.tsx.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ export const App = () => {
356356
<View style={[styles.listItem, styles.marginBottomMd]}>
357357
<Svg width={48} height={48} viewBox="0 0 120 120" stroke="currentColor" fill="transparent">
358358
<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" />
359-
<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" />
359+
<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" />
360360
</Svg>
361361
<View style={styles.listItemTextContainer}>
362362
<Text

packages/react-native/src/generators/application/files/app/tsconfig.app.json.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
55
"types": ["node"]
66
},
7+
"files": ["<%= offsetFromRoot %>node_modules/@nx/react-native/typings/svg.d.ts"],
78
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.spec.tsx", "test-setup.ts"],
89
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx"]
910
}

packages/react-native/src/generators/application/files/app/tsconfig.json.template

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,13 @@
77
"moduleResolution": "node",
88
"skipLibCheck": true,
99
"resolveJsonModule": true,
10-
"composite": true,
1110
"declaration": true
1211
},
13-
"files": [
14-
"../../node_modules/@nx/react-native/typings/svg.d.ts"
15-
],
12+
"files": [],
1613
"include": [],
1714
"references": [
1815
{
1916
"path": "./tsconfig.app.json"
2017
}
21-
],
22-
"exclude": [
23-
"node_modules"
2418
]
2519
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy