@nx/expo 0.0.0-pr-33612-dfd9ba6 → 0.0.0-pr-33228-ece8d5d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations.json +0 -109
- package/package.json +7 -8
- package/plugins/with-nx-metro.d.ts +1 -1
- package/plugins/with-nx-metro.d.ts.map +1 -1
- package/plugins/with-nx-metro.js +1 -1
- package/src/generators/application/application.js +1 -1
- package/src/generators/application/files/nx-welcome/claimed/src/app/App.tsx.template +10 -7
- package/src/generators/application/files/nx-welcome/not-configured/src/app/App.tsx.template +10 -7
- package/src/generators/application/files/nx-welcome/unclaimed/src/app/App.tsx.template +10 -7
- package/src/generators/init/init.d.ts +1 -1
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +9 -11
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +6 -7
- package/src/utils/ensure-dependencies.d.ts +1 -1
- package/src/utils/ensure-dependencies.d.ts.map +1 -1
- package/src/utils/ensure-dependencies.js +15 -16
- package/src/utils/jest/add-jest.d.ts.map +1 -1
- package/src/utils/jest/add-jest.js +10 -35
- package/src/utils/versions.d.ts +16 -46
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +17 -51
- package/src/migrations/update-22-0-0/add-expo-system-ui.d.ts +0 -8
- package/src/migrations/update-22-0-0/add-expo-system-ui.d.ts.map +0 -1
- package/src/migrations/update-22-0-0/add-expo-system-ui.js +0 -48
- package/src/migrations/update-22-0-0/create-ai-instructions-for-expo-54.d.ts +0 -3
- package/src/migrations/update-22-0-0/create-ai-instructions-for-expo-54.d.ts.map +0 -1
- package/src/migrations/update-22-0-0/create-ai-instructions-for-expo-54.js +0 -16
- package/src/migrations/update-22-0-0/files/ai-instructions-for-expo-54.md +0 -495
- package/src/migrations/update-22-0-0/update-jest-for-expo-54.d.ts +0 -12
- package/src/migrations/update-22-0-0/update-jest-for-expo-54.d.ts.map +0 -1
- package/src/migrations/update-22-0-0/update-jest-for-expo-54.js +0 -150
- package/src/utils/version-utils.d.ts +0 -48
- package/src/utils/version-utils.d.ts.map +0 -1
- package/src/utils/version-utils.js +0 -130
package/migrations.json
CHANGED
|
@@ -17,27 +17,6 @@
|
|
|
17
17
|
"cli": "nx",
|
|
18
18
|
"description": "Add custom Jest resolver to handle Expo winter runtime issues",
|
|
19
19
|
"factory": "./src/migrations/update-21-4-0/add-jest-resolver"
|
|
20
|
-
},
|
|
21
|
-
"update-22-0-0-create-ai-instructions-for-expo-54": {
|
|
22
|
-
"version": "22.0.0-beta.0",
|
|
23
|
-
"cli": "nx",
|
|
24
|
-
"description": "Create AI migration instructions for Expo SDK 54 upgrade",
|
|
25
|
-
"factory": "./src/migrations/update-22-0-0/create-ai-instructions-for-expo-54"
|
|
26
|
-
},
|
|
27
|
-
"update-22-0-0-add-expo-system-ui": {
|
|
28
|
-
"version": "22.0.0-beta.0",
|
|
29
|
-
"cli": "nx",
|
|
30
|
-
"description": "Add expo-system-ui dependency for Expo SDK 54",
|
|
31
|
-
"factory": "./src/migrations/update-22-0-0/add-expo-system-ui"
|
|
32
|
-
},
|
|
33
|
-
"update-22-0-0-update-jest-for-expo-54": {
|
|
34
|
-
"requires": {
|
|
35
|
-
"expo": ">= 54.0.0"
|
|
36
|
-
},
|
|
37
|
-
"version": "22.0.0-beta.2",
|
|
38
|
-
"cli": "nx",
|
|
39
|
-
"description": "Update Jest configuration for Expo SDK 54",
|
|
40
|
-
"factory": "./src/migrations/update-22-0-0/update-jest-for-expo-54"
|
|
41
20
|
}
|
|
42
21
|
},
|
|
43
22
|
"packageJsonUpdates": {
|
|
@@ -190,94 +169,6 @@
|
|
|
190
169
|
"alwaysAddToPackageJson": false
|
|
191
170
|
}
|
|
192
171
|
}
|
|
193
|
-
},
|
|
194
|
-
"22.0.0": {
|
|
195
|
-
"version": "22.0.0-beta.2",
|
|
196
|
-
"requires": {
|
|
197
|
-
"expo": ">= 53.0.0"
|
|
198
|
-
},
|
|
199
|
-
"packages": {
|
|
200
|
-
"expo": {
|
|
201
|
-
"version": "~54.0.0",
|
|
202
|
-
"alwaysAddToPackageJson": false
|
|
203
|
-
},
|
|
204
|
-
"expo-splash-screen": {
|
|
205
|
-
"version": "~31.0.11",
|
|
206
|
-
"alwaysAddToPackageJson": false
|
|
207
|
-
},
|
|
208
|
-
"expo-status-bar": {
|
|
209
|
-
"version": "~3.0.8",
|
|
210
|
-
"alwaysAddToPackageJson": false
|
|
211
|
-
},
|
|
212
|
-
"expo-system-ui": {
|
|
213
|
-
"version": "~6.0.8",
|
|
214
|
-
"alwaysAddToPackageJson": false
|
|
215
|
-
},
|
|
216
|
-
"@expo/cli": {
|
|
217
|
-
"version": "~54.0.16",
|
|
218
|
-
"alwaysAddToPackageJson": false
|
|
219
|
-
},
|
|
220
|
-
"babel-preset-expo": {
|
|
221
|
-
"version": "~54.0.7",
|
|
222
|
-
"alwaysAddToPackageJson": false
|
|
223
|
-
},
|
|
224
|
-
"react": {
|
|
225
|
-
"version": "^19.1.0",
|
|
226
|
-
"alwaysAddToPackageJson": false
|
|
227
|
-
},
|
|
228
|
-
"react-dom": {
|
|
229
|
-
"version": "^19.1.0",
|
|
230
|
-
"alwaysAddToPackageJson": false
|
|
231
|
-
},
|
|
232
|
-
"@types/react": {
|
|
233
|
-
"version": "^19.1.0",
|
|
234
|
-
"alwaysAddToPackageJson": false
|
|
235
|
-
},
|
|
236
|
-
"react-native": {
|
|
237
|
-
"version": "~0.81.5",
|
|
238
|
-
"alwaysAddToPackageJson": false
|
|
239
|
-
},
|
|
240
|
-
"react-native-web": {
|
|
241
|
-
"version": "~0.21.0",
|
|
242
|
-
"alwaysAddToPackageJson": false
|
|
243
|
-
},
|
|
244
|
-
"@expo/metro-config": {
|
|
245
|
-
"version": "~54.0.9",
|
|
246
|
-
"alwaysAddToPackageJson": false
|
|
247
|
-
},
|
|
248
|
-
"@expo/metro-runtime": {
|
|
249
|
-
"version": "~6.1.2",
|
|
250
|
-
"alwaysAddToPackageJson": false
|
|
251
|
-
},
|
|
252
|
-
"react-native-svg-transformer": {
|
|
253
|
-
"version": "~1.5.1",
|
|
254
|
-
"alwaysAddToPackageJson": false
|
|
255
|
-
},
|
|
256
|
-
"react-native-svg": {
|
|
257
|
-
"version": "15.12.1",
|
|
258
|
-
"alwaysAddToPackageJson": false
|
|
259
|
-
},
|
|
260
|
-
"@testing-library/react-native": {
|
|
261
|
-
"version": "~13.2.0",
|
|
262
|
-
"alwaysAddToPackageJson": false
|
|
263
|
-
},
|
|
264
|
-
"jest-expo": {
|
|
265
|
-
"version": "~54.0.13",
|
|
266
|
-
"alwaysAddToPackageJson": false
|
|
267
|
-
},
|
|
268
|
-
"@babel/runtime": {
|
|
269
|
-
"version": "~7.27.6",
|
|
270
|
-
"alwaysAddToPackageJson": false
|
|
271
|
-
},
|
|
272
|
-
"metro-config": {
|
|
273
|
-
"version": "~0.83.0",
|
|
274
|
-
"alwaysAddToPackageJson": false
|
|
275
|
-
},
|
|
276
|
-
"metro-resolver": {
|
|
277
|
-
"version": "~0.83.0",
|
|
278
|
-
"alwaysAddToPackageJson": false
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
172
|
}
|
|
282
173
|
}
|
|
283
174
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/expo",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-33228-ece8d5d",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.",
|
|
6
6
|
"keywords": [
|
|
@@ -28,13 +28,12 @@
|
|
|
28
28
|
"main": "./index.js",
|
|
29
29
|
"types": "index.d.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nx/devkit": "0.0.0-pr-
|
|
32
|
-
"@nx/eslint": "0.0.0-pr-
|
|
33
|
-
"@nx/js": "0.0.0-pr-
|
|
34
|
-
"@nx/react": "0.0.0-pr-
|
|
31
|
+
"@nx/devkit": "0.0.0-pr-33228-ece8d5d",
|
|
32
|
+
"@nx/eslint": "0.0.0-pr-33228-ece8d5d",
|
|
33
|
+
"@nx/js": "0.0.0-pr-33228-ece8d5d",
|
|
34
|
+
"@nx/react": "0.0.0-pr-33228-ece8d5d",
|
|
35
35
|
"enhanced-resolve": "^5.8.3",
|
|
36
36
|
"picocolors": "^1.1.0",
|
|
37
|
-
"semver": "^7.6.3",
|
|
38
37
|
"tsconfig-paths": "^4.1.2",
|
|
39
38
|
"tslib": "^2.3.0"
|
|
40
39
|
},
|
|
@@ -43,8 +42,8 @@
|
|
|
43
42
|
"metro-resolver": ">= 0.82.0"
|
|
44
43
|
},
|
|
45
44
|
"optionalDependencies": {
|
|
46
|
-
"@nx/detox": "0.0.0-pr-
|
|
47
|
-
"@nx/rollup": "0.0.0-pr-
|
|
45
|
+
"@nx/detox": "0.0.0-pr-33228-ece8d5d",
|
|
46
|
+
"@nx/rollup": "0.0.0-pr-33228-ece8d5d"
|
|
48
47
|
},
|
|
49
48
|
"executors": "./executors.json",
|
|
50
49
|
"ng-update": {
|
|
@@ -21,6 +21,6 @@ interface WithNxOptions {
|
|
|
21
21
|
*/
|
|
22
22
|
mainFields?: string[];
|
|
23
23
|
}
|
|
24
|
-
export declare function withNxMetro(userConfig: MetroConfig, opts?: WithNxOptions): any
|
|
24
|
+
export declare function withNxMetro(userConfig: MetroConfig, opts?: WithNxOptions): Promise<any>;
|
|
25
25
|
export {};
|
|
26
26
|
//# sourceMappingURL=with-nx-metro.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-nx-metro.d.ts","sourceRoot":"","sources":["../../../../packages/expo/plugins/with-nx-metro.ts"],"names":[],"mappings":"AAuBA,KAAK,WAAW,GAAG,GAAG,CAAC;AAIvB,UAAU,aAAa;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAKxB,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,
|
|
1
|
+
{"version":3,"file":"with-nx-metro.d.ts","sourceRoot":"","sources":["../../../../packages/expo/plugins/with-nx-metro.ts"],"names":[],"mappings":"AAuBA,KAAK,WAAW,GAAG,GAAG,CAAC;AAIvB,UAAU,aAAa;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAKxB,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAsB,WAAW,CAC/B,UAAU,EAAE,WAAW,EACvB,IAAI,GAAE,aAAkB,gBAoCzB"}
|
package/plugins/with-nx-metro.js
CHANGED
|
@@ -21,7 +21,7 @@ function getMetroConfig() {
|
|
|
21
21
|
return metroConfig;
|
|
22
22
|
}
|
|
23
23
|
const metro_resolver_1 = require("./metro-resolver");
|
|
24
|
-
function withNxMetro(userConfig, opts = {}) {
|
|
24
|
+
async function withNxMetro(userConfig, opts = {}) {
|
|
25
25
|
const extensions = ['', 'ts', 'tsx', 'js', 'jsx', 'json'];
|
|
26
26
|
if (opts.debug)
|
|
27
27
|
process.env.NX_REACT_NATIVE_DEBUG = 'true';
|
|
@@ -39,7 +39,7 @@ async function expoApplicationGeneratorInternal(host, schema) {
|
|
|
39
39
|
const initTask = await (0, init_1.default)(host, { ...options, skipFormat: true });
|
|
40
40
|
tasks.push(initTask);
|
|
41
41
|
if (!options.skipPackageJson) {
|
|
42
|
-
tasks.push(
|
|
42
|
+
tasks.push((0, ensure_dependencies_1.ensureDependencies)(host, options.unitTestRunner));
|
|
43
43
|
}
|
|
44
44
|
(0, init_root_babel_config_1.initRootBabelConfig)(host);
|
|
45
45
|
await (0, create_application_files_1.createApplicationFiles)(host, options);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable jsx-a11y/accessible-emoji */
|
|
2
2
|
import React, { useRef, useState } from 'react';
|
|
3
3
|
import {
|
|
4
|
+
SafeAreaView,
|
|
4
5
|
StyleSheet,
|
|
5
6
|
ScrollView,
|
|
6
7
|
View,
|
|
@@ -16,9 +17,14 @@ export const App = () => {
|
|
|
16
17
|
const scrollViewRef = useRef<null | ScrollView>(null);
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
|
|
20
|
+
<>
|
|
20
21
|
<StatusBar barStyle="dark-content" />
|
|
21
|
-
<
|
|
22
|
+
<SafeAreaView
|
|
23
|
+
style={{
|
|
24
|
+
flex: 1,
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<ScrollView
|
|
22
28
|
ref={(ref) => {
|
|
23
29
|
scrollViewRef.current = ref;
|
|
24
30
|
}}
|
|
@@ -588,14 +594,11 @@ export const App = () => {
|
|
|
588
594
|
</View>
|
|
589
595
|
</View>
|
|
590
596
|
</ScrollView>
|
|
591
|
-
|
|
597
|
+
</SafeAreaView>
|
|
598
|
+
</>
|
|
592
599
|
);
|
|
593
600
|
};
|
|
594
601
|
const styles = StyleSheet.create({
|
|
595
|
-
container: {
|
|
596
|
-
flex: 1,
|
|
597
|
-
backgroundColor: '#ffffff',
|
|
598
|
-
},
|
|
599
602
|
scrollView: {
|
|
600
603
|
backgroundColor: '#ffffff',
|
|
601
604
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable jsx-a11y/accessible-emoji */
|
|
2
2
|
import React, { useRef, useState } from 'react';
|
|
3
3
|
import {
|
|
4
|
+
SafeAreaView,
|
|
4
5
|
StyleSheet,
|
|
5
6
|
ScrollView,
|
|
6
7
|
View,
|
|
@@ -16,9 +17,14 @@ export const App = () => {
|
|
|
16
17
|
const scrollViewRef = useRef<null | ScrollView>(null);
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
|
|
20
|
+
<>
|
|
20
21
|
<StatusBar barStyle="dark-content" />
|
|
21
|
-
<
|
|
22
|
+
<SafeAreaView
|
|
23
|
+
style={{
|
|
24
|
+
flex: 1,
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<ScrollView
|
|
22
28
|
ref={(ref) => {
|
|
23
29
|
scrollViewRef.current = ref;
|
|
24
30
|
}}
|
|
@@ -586,14 +592,11 @@ export const App = () => {
|
|
|
586
592
|
</View>
|
|
587
593
|
</View>
|
|
588
594
|
</ScrollView>
|
|
589
|
-
|
|
595
|
+
</SafeAreaView>
|
|
596
|
+
</>
|
|
590
597
|
);
|
|
591
598
|
};
|
|
592
599
|
const styles = StyleSheet.create({
|
|
593
|
-
container: {
|
|
594
|
-
flex: 1,
|
|
595
|
-
backgroundColor: '#ffffff',
|
|
596
|
-
},
|
|
597
600
|
scrollView: {
|
|
598
601
|
backgroundColor: '#ffffff',
|
|
599
602
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable jsx-a11y/accessible-emoji */
|
|
2
2
|
import React, { useRef, useState } from 'react';
|
|
3
3
|
import {
|
|
4
|
+
SafeAreaView,
|
|
4
5
|
StyleSheet,
|
|
5
6
|
ScrollView,
|
|
6
7
|
View,
|
|
@@ -16,9 +17,14 @@ export const App = () => {
|
|
|
16
17
|
const scrollViewRef = useRef<null | ScrollView>(null);
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
|
|
20
|
+
<>
|
|
20
21
|
<StatusBar barStyle="dark-content" />
|
|
21
|
-
<
|
|
22
|
+
<SafeAreaView
|
|
23
|
+
style={{
|
|
24
|
+
flex: 1,
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<ScrollView
|
|
22
28
|
ref={(ref) => {
|
|
23
29
|
scrollViewRef.current = ref;
|
|
24
30
|
}}
|
|
@@ -588,14 +594,11 @@ export const App = () => {
|
|
|
588
594
|
</View>
|
|
589
595
|
</View>
|
|
590
596
|
</ScrollView>
|
|
591
|
-
|
|
597
|
+
</SafeAreaView>
|
|
598
|
+
</>
|
|
592
599
|
);
|
|
593
600
|
};
|
|
594
601
|
const styles = StyleSheet.create({
|
|
595
|
-
container: {
|
|
596
|
-
flex: 1,
|
|
597
|
-
backgroundColor: '#ffffff',
|
|
598
|
-
},
|
|
599
602
|
scrollView: {
|
|
600
603
|
backgroundColor: '#ffffff',
|
|
601
604
|
},
|
|
@@ -2,6 +2,6 @@ import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
|
2
2
|
import { Schema } from './schema';
|
|
3
3
|
export declare function expoInitGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function expoInitGeneratorInternal(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
5
|
-
export declare function updateDependencies(host: Tree, schema: Schema):
|
|
5
|
+
export declare function updateDependencies(host: Tree, schema: Schema): GeneratorCallback;
|
|
6
6
|
export default expoInitGenerator;
|
|
7
7
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;AAcpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAE3D;AAED,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAwDzE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAkB5D;AAMD,eAAe,iBAAiB,CAAC"}
|
|
@@ -7,7 +7,6 @@ const devkit_1 = require("@nx/devkit");
|
|
|
7
7
|
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
8
8
|
const plugin_1 = require("../../../plugins/plugin");
|
|
9
9
|
const versions_1 = require("../../utils/versions");
|
|
10
|
-
const version_utils_1 = require("../../utils/version-utils");
|
|
11
10
|
const add_git_ignore_entry_1 = require("./lib/add-git-ignore-entry");
|
|
12
11
|
function expoInitGenerator(tree, schema) {
|
|
13
12
|
return expoInitGeneratorInternal(tree, { addPlugin: false, ...schema });
|
|
@@ -48,25 +47,24 @@ async function expoInitGeneratorInternal(host, schema) {
|
|
|
48
47
|
const tasks = [];
|
|
49
48
|
if (!schema.skipPackageJson) {
|
|
50
49
|
tasks.push(moveDependency(host));
|
|
51
|
-
tasks.push(
|
|
50
|
+
tasks.push(updateDependencies(host, schema));
|
|
52
51
|
}
|
|
53
52
|
if (!schema.skipFormat) {
|
|
54
53
|
await (0, devkit_1.formatFiles)(host);
|
|
55
54
|
}
|
|
56
55
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
57
56
|
}
|
|
58
|
-
|
|
59
|
-
const versions = await (0, version_utils_1.getExpoDependenciesVersionsToInstall)(host);
|
|
57
|
+
function updateDependencies(host, schema) {
|
|
60
58
|
return (0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
61
|
-
react:
|
|
62
|
-
'react-dom':
|
|
63
|
-
'react-native':
|
|
64
|
-
expo:
|
|
59
|
+
react: versions_1.reactVersion,
|
|
60
|
+
'react-dom': versions_1.reactDomVersion,
|
|
61
|
+
'react-native': versions_1.reactNativeVersion,
|
|
62
|
+
expo: versions_1.expoVersion,
|
|
65
63
|
}, {
|
|
66
64
|
'@nx/expo': versions_1.nxVersion,
|
|
67
|
-
'@expo/cli':
|
|
68
|
-
'metro-config':
|
|
69
|
-
'metro-resolver':
|
|
65
|
+
'@expo/cli': versions_1.expoCliVersion,
|
|
66
|
+
'metro-config': versions_1.metroVersion,
|
|
67
|
+
'metro-resolver': versions_1.metroVersion,
|
|
70
68
|
}, undefined, schema.keepExistingVersions);
|
|
71
69
|
}
|
|
72
70
|
function moveDependency(host) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAOjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAiBlC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAiH5B;
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAOjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAiBlC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAiH5B;AAsJD,eAAe,oBAAoB,CAAC"}
|
|
@@ -17,7 +17,7 @@ const add_rollup_build_target_1 = require("@nx/react/src/generators/library/lib/
|
|
|
17
17
|
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
18
18
|
const component_1 = require("../component/component");
|
|
19
19
|
const path_1 = require("path");
|
|
20
|
-
const
|
|
20
|
+
const versions_1 = require("../../utils/versions");
|
|
21
21
|
async function expoLibraryGenerator(host, schema) {
|
|
22
22
|
return await expoLibraryGeneratorInternal(host, {
|
|
23
23
|
addPlugin: false,
|
|
@@ -44,7 +44,7 @@ async function expoLibraryGeneratorInternal(host, schema) {
|
|
|
44
44
|
const initTask = await (0, init_1.default)(host, { ...options, skipFormat: true });
|
|
45
45
|
tasks.push(initTask);
|
|
46
46
|
if (!options.skipPackageJson) {
|
|
47
|
-
tasks.push(
|
|
47
|
+
tasks.push((0, ensure_dependencies_1.ensureDependencies)(host, options.unitTestRunner));
|
|
48
48
|
}
|
|
49
49
|
(0, init_root_babel_config_1.initRootBabelConfig)(host);
|
|
50
50
|
createFiles(host, options);
|
|
@@ -101,7 +101,6 @@ async function expoLibraryGeneratorInternal(host, schema) {
|
|
|
101
101
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
102
102
|
}
|
|
103
103
|
async function addProject(host, options) {
|
|
104
|
-
const versions = await (0, version_utils_1.getExpoDependenciesVersionsToInstall)(host);
|
|
105
104
|
const project = {
|
|
106
105
|
root: options.projectRoot,
|
|
107
106
|
sourceRoot: (0, devkit_1.joinPathFragments)(options.projectRoot, 'src'),
|
|
@@ -113,8 +112,8 @@ async function addProject(host, options) {
|
|
|
113
112
|
name: options.importPath,
|
|
114
113
|
version: '0.0.1',
|
|
115
114
|
peerDependencies: {
|
|
116
|
-
react:
|
|
117
|
-
'react-native':
|
|
115
|
+
react: versions_1.reactVersion,
|
|
116
|
+
'react-native': versions_1.reactNativeVersion,
|
|
118
117
|
},
|
|
119
118
|
};
|
|
120
119
|
if (options.isUsingTsSolutionConfig) {
|
|
@@ -159,8 +158,8 @@ async function addProject(host, options) {
|
|
|
159
158
|
(0, devkit_1.updateJson)(host, `${options.projectRoot}/package.json`, (json) => {
|
|
160
159
|
json.peerDependencies = {
|
|
161
160
|
...json.peerDependencies,
|
|
162
|
-
react:
|
|
163
|
-
'react-native':
|
|
161
|
+
react: versions_1.reactVersion,
|
|
162
|
+
'react-native': versions_1.reactNativeVersion,
|
|
164
163
|
};
|
|
165
164
|
return json;
|
|
166
165
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
2
|
-
export declare function ensureDependencies(host: Tree, unitTestRunner: 'jest' | 'none'):
|
|
2
|
+
export declare function ensureDependencies(host: Tree, unitTestRunner: 'jest' | 'none'): GeneratorCallback;
|
|
3
3
|
//# sourceMappingURL=ensure-dependencies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-dependencies.d.ts","sourceRoot":"","sources":["../../../../../packages/expo/src/utils/ensure-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ensure-dependencies.d.ts","sourceRoot":"","sources":["../../../../../packages/expo/src/utils/ensure-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAiBpB,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,MAAM,GAAG,MAAM,GAC9B,iBAAiB,CA+BnB"}
|
|
@@ -2,30 +2,29 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ensureDependencies = ensureDependencies;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const versions = await (0, version_utils_1.getExpoDependenciesVersionsToInstall)(host);
|
|
5
|
+
const versions_1 = require("./versions");
|
|
6
|
+
function ensureDependencies(host, unitTestRunner) {
|
|
8
7
|
const devDependencies = {
|
|
9
|
-
'@types/react':
|
|
10
|
-
'babel-preset-expo':
|
|
8
|
+
'@types/react': versions_1.typesReactVersion,
|
|
9
|
+
'babel-preset-expo': versions_1.babelPresetExpoVersion,
|
|
11
10
|
};
|
|
12
11
|
const isPnpm = (0, devkit_1.detectPackageManager)(host.root) === 'pnpm';
|
|
13
12
|
if (isPnpm) {
|
|
14
|
-
devDependencies['@babel/runtime'] =
|
|
13
|
+
devDependencies['@babel/runtime'] = versions_1.babelRuntimeVersion; // @babel/runtime is used by react-native-svg
|
|
15
14
|
}
|
|
16
15
|
if (unitTestRunner === 'jest') {
|
|
17
16
|
devDependencies['@testing-library/react-native'] =
|
|
18
|
-
|
|
19
|
-
devDependencies['jest-expo'] =
|
|
17
|
+
versions_1.testingLibraryReactNativeVersion;
|
|
18
|
+
devDependencies['jest-expo'] = versions_1.jestExpoVersion;
|
|
20
19
|
}
|
|
21
20
|
return (0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
22
|
-
'expo-splash-screen':
|
|
23
|
-
'expo-status-bar':
|
|
24
|
-
'expo-system-ui':
|
|
25
|
-
'react-native-web':
|
|
26
|
-
'@expo/metro-config':
|
|
27
|
-
'@expo/metro-runtime':
|
|
28
|
-
'react-native-svg-transformer':
|
|
29
|
-
'react-native-svg':
|
|
21
|
+
'expo-splash-screen': versions_1.expoSplashScreenVersion,
|
|
22
|
+
'expo-status-bar': versions_1.expoStatusBarVersion,
|
|
23
|
+
'expo-system-ui': versions_1.expoSystemUiVersion,
|
|
24
|
+
'react-native-web': versions_1.reactNativeWebVersion,
|
|
25
|
+
'@expo/metro-config': versions_1.expoMetroConfigVersion,
|
|
26
|
+
'@expo/metro-runtime': versions_1.expoMetroRuntimeVersion,
|
|
27
|
+
'react-native-svg-transformer': versions_1.reactNativeSvgTransformerVersion,
|
|
28
|
+
'react-native-svg': versions_1.reactNativeSvgVersion,
|
|
30
29
|
}, devDependencies);
|
|
31
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-jest.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/utils/jest/add-jest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAgD,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"add-jest.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/utils/jest/add-jest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAgD,MAAM,YAAY,CAAC;AAKhF,wBAAsB,OAAO,CAC3B,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,MAAM,GAAG,MAAM,EAC/B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,EAAE,EAAE,OAAO,EACX,eAAe,EAAE,OAAO,EACxB,SAAS,EAAE,OAAO,uBAoEnB"}
|
|
@@ -5,7 +5,6 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const update_tsconfig_files_1 = require("../update-tsconfig-files");
|
|
7
7
|
const versions_1 = require("../versions");
|
|
8
|
-
const version_utils_1 = require("../version-utils");
|
|
9
8
|
async function addJest(host, unitTestRunner, projectName, appProjectRoot, js, skipPackageJson, addPlugin) {
|
|
10
9
|
if (unitTestRunner !== 'jest') {
|
|
11
10
|
return () => { };
|
|
@@ -22,21 +21,16 @@ async function addJest(host, unitTestRunner, projectName, appProjectRoot, js, sk
|
|
|
22
21
|
skipFormat: true,
|
|
23
22
|
addPlugin,
|
|
24
23
|
});
|
|
25
|
-
// Check if using Expo v54 to determine Jest configuration approach
|
|
26
|
-
const useExpoV54 = await (0, version_utils_1.isExpoV54)(host);
|
|
27
24
|
// Overwrite the jest.config.ts file because react native needs to have special transform property
|
|
28
25
|
// use preset from https://github.com/expo/expo/blob/main/packages/jest-expo/jest-preset.js
|
|
29
26
|
// Workaround issue where Jest is not picking tyope node nor jest types from tsconfig by using <reference>.
|
|
30
27
|
const configPath = `${appProjectRoot}/jest.config.${js ? 'js' : 'cts'}`;
|
|
31
|
-
// For Expo v54, we don't use the custom resolver - instead we mock ImportMetaRegistry in test-setup
|
|
32
|
-
const resolverLine = useExpoV54
|
|
33
|
-
? ''
|
|
34
|
-
: "resolver: require.resolve('./jest.resolver.js'),\n ";
|
|
35
28
|
const content = `/// <reference types="jest" />
|
|
36
29
|
/// <reference types="node" />
|
|
37
30
|
module.exports = {
|
|
38
31
|
displayName: '${projectName}',
|
|
39
|
-
|
|
32
|
+
resolver: require.resolve('./jest.resolver.js'),
|
|
33
|
+
preset: 'jest-expo',
|
|
40
34
|
moduleFileExtensions: ['ts', 'js', 'html', 'tsx', 'jsx'],
|
|
41
35
|
setupFilesAfterEnv: ['<rootDir>/src/test-setup.${js ? 'js' : 'ts'}'],
|
|
42
36
|
moduleNameMapper: {
|
|
@@ -56,32 +50,13 @@ module.exports = {
|
|
|
56
50
|
coverageDirectory: '${(0, devkit_1.offsetFromRoot)(appProjectRoot)}coverage/${appProjectRoot}'
|
|
57
51
|
};`;
|
|
58
52
|
host.write(configPath, content);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
}));
|
|
69
|
-
|
|
70
|
-
if (typeof global.structuredClone === 'undefined') {
|
|
71
|
-
global.structuredClone = (object) => JSON.parse(JSON.stringify(object));
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
74
|
-
host.write(testSetupPath, testSetupContent);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
// For Expo v53, generate the Jest resolver file from template
|
|
78
|
-
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, 'files'), appProjectRoot, {
|
|
79
|
-
projectName,
|
|
80
|
-
coverageDirectory: `${(0, devkit_1.offsetFromRoot)(appProjectRoot)}coverage/${appProjectRoot}`,
|
|
81
|
-
js,
|
|
82
|
-
});
|
|
83
|
-
// Update tsconfig files to handle jest.resolver.js properly (only for v53)
|
|
84
|
-
(0, update_tsconfig_files_1.updateTsConfigFiles)(host, projectName, appProjectRoot);
|
|
85
|
-
}
|
|
53
|
+
// Generate only the Jest resolver file from template
|
|
54
|
+
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, 'files'), appProjectRoot, {
|
|
55
|
+
projectName,
|
|
56
|
+
coverageDirectory: `${(0, devkit_1.offsetFromRoot)(appProjectRoot)}coverage/${appProjectRoot}`,
|
|
57
|
+
js,
|
|
58
|
+
});
|
|
59
|
+
// Update tsconfig files to handle jest.resolver.js properly
|
|
60
|
+
(0, update_tsconfig_files_1.updateTsConfigFiles)(host, projectName, appProjectRoot);
|
|
86
61
|
return jestTask;
|
|
87
62
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,51 +1,21 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const reactNativeWebV54Version = "~0.21.0";
|
|
17
|
-
export declare const expoV53Version = "~53.0.10";
|
|
18
|
-
export declare const expoV53SplashScreenVersion = "~0.30.9";
|
|
19
|
-
export declare const expoV53StatusBarVersion = "~2.2.3";
|
|
20
|
-
export declare const expoV53SystemUiVersion = "~5.0.8";
|
|
21
|
-
export declare const expoV53CliVersion = "~0.24.14";
|
|
22
|
-
export declare const babelPresetExpoV53Version = "~13.2.0";
|
|
23
|
-
export declare const expoV53MetroConfigVersion = "~0.20.14";
|
|
24
|
-
export declare const expoV53MetroRuntimeVersion = "~5.0.4";
|
|
25
|
-
export declare const jestExpoV53Version = "~53.0.7";
|
|
26
|
-
export declare const reactV53Version = "^19.0.0";
|
|
27
|
-
export declare const reactDomV53Version = "^19.0.0";
|
|
28
|
-
export declare const typesReactV53Version = "~19.0.10";
|
|
29
|
-
export declare const reactNativeV53Version = "0.79.3";
|
|
30
|
-
export declare const metroV53Version = "~0.82.4";
|
|
31
|
-
export declare const reactNativeWebV53Version = "~0.20.0";
|
|
32
|
-
export declare const expoVersion = "~54.0.0";
|
|
33
|
-
export declare const expoSplashScreenVersion = "~31.0.11";
|
|
34
|
-
export declare const expoStatusBarVersion = "~3.0.8";
|
|
35
|
-
export declare const expoSystemUiVersion = "~6.0.8";
|
|
36
|
-
export declare const expoCliVersion = "~54.0.16";
|
|
37
|
-
export declare const babelPresetExpoVersion = "~54.0.7";
|
|
38
|
-
export declare const expoMetroConfigVersion = "~54.0.9";
|
|
39
|
-
export declare const expoMetroRuntimeVersion = "~6.1.2";
|
|
40
|
-
export declare const jestExpoVersion = "~54.0.13";
|
|
41
|
-
export declare const reactVersion = "^19.1.0";
|
|
42
|
-
export declare const reactDomVersion = "^19.1.0";
|
|
43
|
-
export declare const typesReactVersion = "^19.1.0";
|
|
44
|
-
export declare const reactNativeVersion = "0.81.5";
|
|
45
|
-
export declare const metroVersion = "~0.83.0";
|
|
46
|
-
export declare const reactNativeWebVersion = "~0.21.0";
|
|
2
|
+
export declare const expoVersion = "~53.0.10";
|
|
3
|
+
export declare const expoSplashScreenVersion = "~0.30.9";
|
|
4
|
+
export declare const expoStatusBarVersion = "~2.2.3";
|
|
5
|
+
export declare const expoSystemUiVersion = "~5.0.8";
|
|
6
|
+
export declare const expoCliVersion = "~0.24.14";
|
|
7
|
+
export declare const babelPresetExpoVersion = "~13.2.0";
|
|
8
|
+
export declare const reactVersion = "^19.0.0";
|
|
9
|
+
export declare const reactDomVersion = "^19.0.0";
|
|
10
|
+
export declare const typesReactVersion = "~19.0.10";
|
|
11
|
+
export declare const reactNativeVersion = "0.79.3";
|
|
12
|
+
export declare const reactNativeWebVersion = "~0.20.0";
|
|
13
|
+
export declare const expoMetroConfigVersion = "~0.20.14";
|
|
14
|
+
export declare const expoMetroRuntimeVersion = "~5.0.4";
|
|
15
|
+
export declare const metroVersion = "~0.82.4";
|
|
47
16
|
export declare const reactNativeSvgTransformerVersion = "~1.5.1";
|
|
48
|
-
export declare const reactNativeSvgVersion = "15.
|
|
17
|
+
export declare const reactNativeSvgVersion = "~15.11.2";
|
|
49
18
|
export declare const testingLibraryReactNativeVersion = "~13.2.0";
|
|
19
|
+
export declare const jestExpoVersion = "~53.0.7";
|
|
50
20
|
export declare const babelRuntimeVersion = "~7.27.6";
|
|
51
21
|
//# sourceMappingURL=versions.d.ts.map
|