@nx/react-native 19.5.7 → 19.6.0-beta.1

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.
Files changed (25) hide show
  1. package/generators.json +5 -0
  2. package/migrations.json +6 -0
  3. package/package.json +8 -8
  4. package/plugins/plugin.d.ts +1 -1
  5. package/plugins/plugin.js +2 -2
  6. package/src/generators/application/application.js +1 -1
  7. package/src/generators/application/files/nx-welcome/claimed/src/app/App.tsx.template +737 -0
  8. package/src/generators/application/files/{app → nx-welcome/not-configured}/src/app/App.tsx.template +106 -114
  9. package/src/generators/application/files/nx-welcome/unclaimed/src/app/App.tsx.template +737 -0
  10. package/src/generators/application/lib/add-e2e.js +4 -0
  11. package/src/generators/application/lib/create-application-files.d.ts +1 -1
  12. package/src/generators/application/lib/create-application-files.js +12 -1
  13. package/src/generators/application/schema.d.ts +1 -0
  14. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts +7 -0
  15. package/src/generators/convert-to-inferred/convert-to-inferred.js +92 -0
  16. package/src/generators/convert-to-inferred/lib/create-process-options.d.ts +6 -0
  17. package/src/generators/convert-to-inferred/lib/create-process-options.js +39 -0
  18. package/src/generators/convert-to-inferred/lib/post-target-transformer.d.ts +6 -0
  19. package/src/generators/convert-to-inferred/lib/post-target-transformer.js +34 -0
  20. package/src/generators/convert-to-inferred/lib/process-start-options.d.ts +2 -0
  21. package/src/generators/convert-to-inferred/lib/process-start-options.js +23 -0
  22. package/src/generators/convert-to-inferred/schema.json +19 -0
  23. package/src/generators/init/init.js +1 -1
  24. package/src/migrations/update-19-6-0/rename-upgrade-target-name.d.ts +5 -0
  25. package/src/migrations/update-19-6-0/rename-upgrade-target-name.js +25 -0
@@ -20,9 +20,10 @@ export const App = () => {
20
20
  <>
21
21
  <StatusBar barStyle="dark-content" />
22
22
  <SafeAreaView
23
- style={{
23
+ style={{
24
24
  flex: 1,
25
- }}>
25
+ }}
26
+ >
26
27
  <ScrollView
27
28
  ref={(ref) => {
28
29
  scrollViewRef.current = ref;
@@ -32,7 +33,11 @@ export const App = () => {
32
33
  >
33
34
  <View style={styles.section}>
34
35
  <Text style={styles.textLg}>Hello there,</Text>
35
- <Text style={[styles.textXL, styles.appTitleText]} testID="heading" role="heading">
36
+ <Text
37
+ style={[styles.textXL, styles.appTitleText]}
38
+ testID="heading"
39
+ role="heading"
40
+ >
36
41
  Welcome <%= displayName %> 👋
37
42
  </Text>
38
43
  </View>
@@ -197,7 +202,7 @@ export const App = () => {
197
202
  style={[styles.listItem, styles.learning]}
198
203
  onPress={() =>
199
204
  Linking.openURL(
200
- 'https://nx.dev/react-tutorial/1-code-generation?utm_source=nx-project'
205
+ 'https://nx.dev/recipes/react/react-native#react-native-with-nx'
201
206
  )
202
207
  }
203
208
  >
@@ -236,52 +241,34 @@ export const App = () => {
236
241
  ></Path>
237
242
  </Svg>
238
243
  </TouchableOpacity>
239
- <TouchableOpacity
240
- style={[styles.listItem, styles.learning]}
241
- onPress={() =>
242
- Linking.openURL(
243
- 'https://nxplaybook.com/?utm_source=nx-project'
244
- )
245
- }
246
- >
247
- <Svg
248
- width={24}
249
- height={24}
250
- stroke="#000000"
251
- fill="none"
252
- viewBox="0 0 24 24"
253
- >
254
- <Path d="M12 14l9-5-9-5-9 5 9 5z"></Path>
255
- <Path d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"></Path>
256
- <Path
257
- strokeLinecap="round"
258
- strokeLinejoin="round"
259
- strokeWidth="2"
260
- d="M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"
261
- ></Path>
244
+ </View>
245
+ </View>
246
+ <View style={styles.section}>
247
+ <TouchableOpacity
248
+ onPress={() =>
249
+ Linking.openURL('https://nx.dev/nx-cloud?utm_source=nx-project')
250
+ }
251
+ >
252
+ <View style={[styles.listItem, styles.shadowBox]}>
253
+ <Svg width={48} height={48} fill="#000000" viewBox="0 0 24 24">
254
+ <Path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
262
255
  </Svg>
263
256
  <View style={styles.listItemTextContainer}>
264
- <Text style={[styles.textMd]}>Video courses</Text>
265
- <Text style={[styles.text2XS, styles.textSubtle]}>
266
- Nx custom courses
257
+ <Text
258
+ style={[
259
+ styles.textMd,
260
+ styles.textBold,
261
+ styles.marginBottomSm,
262
+ ]}
263
+ >
264
+ Nx is open source
265
+ </Text>
266
+ <Text style={[styles.textXS, styles.textLight]}>
267
+ Love Nx? Give us a star!
267
268
  </Text>
268
269
  </View>
269
- <Svg
270
- width={18}
271
- height={18}
272
- stroke="#000000"
273
- fill="none"
274
- viewBox="0 0 24 24"
275
- >
276
- <Path
277
- strokeLinecap="round"
278
- strokeLinejoin="round"
279
- strokeWidth="2"
280
- d="M9 5l7 7-7 7"
281
- ></Path>
282
- </Svg>
283
- </TouchableOpacity>
284
- </View>
270
+ </View>
271
+ </TouchableOpacity>
285
272
  </View>
286
273
  <View style={[styles.section, styles.shadowBox]}>
287
274
  <TouchableOpacity
@@ -318,7 +305,7 @@ export const App = () => {
318
305
  </TouchableOpacity>
319
306
  </View>
320
307
 
321
- <View style={[styles.section, styles.shadowBox]}>
308
+ <View style={[styles.section, styles.shadowBox]}>
322
309
  <TouchableOpacity
323
310
  onPress={() =>
324
311
  Linking.openURL(
@@ -362,14 +349,27 @@ export const App = () => {
362
349
  <View style={styles.section}>
363
350
  <TouchableOpacity
364
351
  onPress={() =>
365
- Linking.openURL('https://nx.app/?utm_source=nx-project')
352
+ Linking.openURL('https://nx.dev/nx-cloud?utm_source=nx-project')
366
353
  }
367
354
  >
368
355
  <View style={styles.shadowBox}>
369
- <View style={[styles.listItem, styles.marginBottomMd]}>
370
- <Svg width={48} height={48} viewBox="0 0 120 120" stroke="currentColor" fill="transparent">
371
- <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" />
372
- <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" />
356
+ <View style={[styles.listItem, styles.learning]}>
357
+ <Svg
358
+ width={48}
359
+ height={48}
360
+ role="img"
361
+ stroke="currentColor"
362
+ fill="transparent"
363
+ viewBox="0 0 24 24"
364
+ >
365
+ <Path
366
+ strokeWidth="2"
367
+ 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"
368
+ />
369
+ <Path
370
+ strokeWidth="2"
371
+ 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"
372
+ />
373
373
  </Svg>
374
374
  <View style={styles.listItemTextContainer}>
375
375
  <Text
@@ -381,44 +381,24 @@ export const App = () => {
381
381
  >
382
382
  Nx Cloud
383
383
  </Text>
384
- <Text style={[styles.textXS, styles.textLight]}>
384
+ <Text style={[styles.textSm, styles.textLight]}>
385
385
  Enable faster CI & better DX
386
386
  </Text>
387
387
  </View>
388
388
  </View>
389
- <View style={styles.codeBlock}>
390
- <Text style={[styles.monospace]}>nx connect</Text>
391
- </View>
392
- </View>
393
- </TouchableOpacity>
394
- </View>
395
- <View style={styles.section}>
396
- <TouchableOpacity
397
- onPress={() =>
398
- Linking.openURL('https://nx.app/?utm_source=nx-project')
399
- }
400
- >
401
- <View style={[styles.listItem, styles.shadowBox]}>
402
- <Svg width={48} height={48} fill="#000000" viewBox="0 0 24 24">
403
- <Path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
404
- </Svg>
405
389
  <View style={styles.listItemTextContainer}>
406
- <Text
407
- style={[
408
- styles.textMd,
409
- styles.textBold,
410
- styles.marginBottomSm,
411
- ]}
412
- >
413
- Nx is open source
414
- </Text>
415
- <Text style={[styles.textXS, styles.textLight]}>
416
- Love Nx? Give us a star!
390
+ <Text style={[styles.textXS, styles.textLight]}>
391
+ You can activate distributed tasks executions and caching by
392
+ running:
417
393
  </Text>
394
+ </View>
395
+ <View style={styles.codeBlock}>
396
+ <Text style={[styles.monospace]}>nx connect</Text>
418
397
  </View>
419
398
  </View>
420
399
  </TouchableOpacity>
421
400
  </View>
401
+
422
402
  <View
423
403
  style={styles.section}
424
404
  onLayout={(event) => {
@@ -451,12 +431,14 @@ export const App = () => {
451
431
  />
452
432
  </Svg>
453
433
  <View style={styles.listItemTextContainer}>
454
- <Text style={styles.textSm}>Add UI library</Text>
434
+ <Text style={styles.textSm}>
435
+ Build, test and lint your app
436
+ </Text>
455
437
  </View>
456
438
  </View>
457
- <View style={[styles.codeBlock, styles.marginBottomLg]}>
439
+ <View style={styles.codeBlock}>
458
440
  <Text style={[styles.textXS, styles.monospace, styles.comment]}>
459
- # Generate UI lib
441
+ # Build
460
442
  </Text>
461
443
  <Text
462
444
  style={[
@@ -465,19 +447,40 @@ export const App = () => {
465
447
  styles.marginBottomMd,
466
448
  ]}
467
449
  >
468
- nx g @nx/react-native:lib ui
450
+ nx build <%= displayName %>
469
451
  </Text>
470
452
  <Text style={[styles.textXS, styles.monospace, styles.comment]}>
471
- # Add a component
453
+ # Test
472
454
  </Text>
473
- <Text style={[styles.textXS, styles.monospace]}>nx g \</Text>
474
- <Text style={[styles.textXS, styles.monospace]}>
475
- @nx/react-native:component \
455
+ <Text
456
+ style={[
457
+ styles.textXS,
458
+ styles.monospace,
459
+ styles.marginBottomMd,
460
+ ]}
461
+ >
462
+ nx test <%= displayName %>
463
+ </Text>
464
+ <Text style={[styles.textXS, styles.monospace, styles.comment]}>
465
+ # Lint
476
466
  </Text>
477
467
  <Text style={[styles.textXS, styles.monospace]}>
478
- ui/src/lib/button
468
+ nx lint <%= displayName %>
469
+ </Text>
470
+ <Text style={[styles.textXS, styles.monospace, styles.comment]}>
471
+ # Run them together!
472
+ </Text>
473
+ <Text
474
+ style={[
475
+ styles.textXS,
476
+ styles.monospace,
477
+ styles.marginBottomMd,
478
+ ]}
479
+ >
480
+ nx run-many -p <%= displayName %> -t build test lint
479
481
  </Text>
480
482
  </View>
483
+
481
484
  <View style={styles.listItem}>
482
485
  <Svg
483
486
  width={24}
@@ -494,13 +497,13 @@ export const App = () => {
494
497
  />
495
498
  </Svg>
496
499
  <View style={styles.listItemTextContainer}>
497
- <Text style={styles.textSm}>
498
- View project details
499
- </Text>
500
+ <Text style={styles.textSm}>View project details</Text>
500
501
  </View>
501
502
  </View>
502
503
  <View style={[styles.codeBlock, styles.marginBottomLg]}>
503
- <Text style={[styles.textXS, styles.monospace]}>nx show project <%= displayName %> --web</Text>
504
+ <Text style={[styles.textXS, styles.monospace]}>
505
+ nx show project <%= displayName %>
506
+ </Text>
504
507
  </View>
505
508
  <View style={styles.listItem}>
506
509
  <Svg
@@ -542,24 +545,12 @@ export const App = () => {
542
545
  />
543
546
  </Svg>
544
547
  <View style={styles.listItemTextContainer}>
545
- <Text style={styles.textSm}>Run affected commands</Text>
548
+ <Text style={styles.textSm}>Add UI library</Text>
546
549
  </View>
547
550
  </View>
548
- <View style={styles.codeBlock}>
549
- <Text style={[styles.textXS, styles.monospace, styles.comment]}>
550
- # See what's affected by changes
551
- </Text>
552
- <Text
553
- style={[
554
- styles.textXS,
555
- styles.monospace,
556
- styles.marginBottomMd,
557
- ]}
558
- >
559
- nx affected:graph
560
- </Text>
551
+ <View style={[styles.codeBlock, styles.marginBottomLg]}>
561
552
  <Text style={[styles.textXS, styles.monospace, styles.comment]}>
562
- # run tests for current changes
553
+ # Generate UI lib
563
554
  </Text>
564
555
  <Text
565
556
  style={[
@@ -568,16 +559,17 @@ export const App = () => {
568
559
  styles.marginBottomMd,
569
560
  ]}
570
561
  >
571
- nx affected:text
562
+ nx g @nx/react-native:lib ui
572
563
  </Text>
573
564
  <Text style={[styles.textXS, styles.monospace, styles.comment]}>
574
- # run e2e tests for current
565
+ # Add a component
575
566
  </Text>
576
- <Text style={[styles.textXS, styles.monospace, styles.comment]}>
577
- # changes
567
+ <Text style={[styles.textXS, styles.monospace]}>nx g \</Text>
568
+ <Text style={[styles.textXS, styles.monospace]}>
569
+ @nx/react-native:component \
578
570
  </Text>
579
571
  <Text style={[styles.textXS, styles.monospace]}>
580
- nx affected:e2e
572
+ ui/src/lib/button
581
573
  </Text>
582
574
  </View>
583
575
  </View>
@@ -665,7 +657,7 @@ const styles = StyleSheet.create({
665
657
  color: '#6b7280',
666
658
  },
667
659
  section: {
668
- marginVertical: 24,
660
+ marginVertical: 12,
669
661
  marginHorizontal: 12,
670
662
  },
671
663
  shadowBox: {