@nx/expo 24.1.0-beta.1 → 24.1.0-beta.3

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.
@@ -1,5 +1,5 @@
1
- /* eslint-disable jsx-a11y/accessible-emoji */
2
- import React, { useRef, useState } from 'react';
1
+ <% if (usesJsxA11y) { %>/* eslint-disable jsx-a11y/accessible-emoji */
2
+ <% } %>import React, { useRef, useState } from 'react';
3
3
  import {
4
4
  StyleSheet,
5
5
  ScrollView,
@@ -1,5 +1,5 @@
1
- /* eslint-disable jsx-a11y/accessible-emoji */
2
- import React, { useRef, useState } from 'react';
1
+ <% if (usesJsxA11y) { %>/* eslint-disable jsx-a11y/accessible-emoji */
2
+ <% } %>import React, { useRef, useState } from 'react';
3
3
  import {
4
4
  StyleSheet,
5
5
  ScrollView,
@@ -1,5 +1,5 @@
1
- /* eslint-disable jsx-a11y/accessible-emoji */
2
- import React, { useRef, useState } from 'react';
1
+ <% if (usesJsxA11y) { %>/* eslint-disable jsx-a11y/accessible-emoji */
2
+ <% } %>import React, { useRef, useState } from 'react';
3
3
  import {
4
4
  StyleSheet,
5
5
  ScrollView,
@@ -4,7 +4,8 @@ exports.createApplicationFiles = createApplicationFiles;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const path_1 = require("path");
6
6
  const version_utils_1 = require("../../../utils/version-utils");
7
- const internal_1 = require("@nx/devkit/internal");
7
+ const internal_1 = require("@nx/react/internal");
8
+ const internal_2 = require("@nx/devkit/internal");
8
9
  async function createApplicationFiles(host, options) {
9
10
  const packageManager = (0, devkit_1.detectPackageManager)(host.root);
10
11
  // Expo SDK 55+ ships Metro via `@expo/metro` instead of the standalone
@@ -12,9 +13,12 @@ async function createApplicationFiles(host, options) {
12
13
  // installed yet), default to the latest behavior (v56).
13
14
  const installedExpoMajor = await (0, version_utils_1.getInstalledExpoMajor)(host);
14
15
  const usesExpoMetro = installedExpoMajor === null || installedExpoMajor >= 55;
15
- const onBoardingStatus = await (0, internal_1.createNxCloudOnboardingURLForWelcomeApp)(host, options.nxCloudToken);
16
+ const onBoardingStatus = await (0, internal_2.createNxCloudOnboardingURLForWelcomeApp)(host, options.nxCloudToken);
16
17
  const connectCloudUrl = onBoardingStatus === 'unclaimed' &&
17
- (await (0, internal_1.getNxCloudAppOnBoardingUrl)(options.nxCloudToken));
18
+ (await (0, internal_2.getNxCloudAppOnBoardingUrl)(options.nxCloudToken));
19
+ const usesJsxA11y = options.linter === 'eslint' &&
20
+ 'eslint-plugin-jsx-a11y' in
21
+ (0, internal_1.getExtraEslintDependencies)(host).devDependencies;
18
22
  (0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/base'), options.appProjectRoot, {
19
23
  ...options,
20
24
  offsetFromRoot: (0, devkit_1.offsetFromRoot)(options.appProjectRoot),
@@ -26,6 +30,7 @@ async function createApplicationFiles(host, options) {
26
30
  connectCloudUrl,
27
31
  offsetFromRoot: (0, devkit_1.offsetFromRoot)(options.appProjectRoot),
28
32
  packageManager,
33
+ usesJsxA11y,
29
34
  });
30
35
  if (options.unitTestRunner === 'none') {
31
36
  host.delete((0, path_1.join)(options.appProjectRoot, 'src/app/App.spec.tsx'));
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLinting = addLinting;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const react_1 = require("@nx/react");
6
- const internal_1 = require("@nx/eslint/internal");
7
- const internal_2 = require("@nx/js/internal");
5
+ const internal_1 = require("@nx/react/internal");
6
+ const internal_2 = require("@nx/eslint/internal");
7
+ const internal_3 = require("@nx/js/internal");
8
8
  async function addLinting(host, options) {
9
9
  const tasks = [];
10
- tasks.push(await (0, internal_2.addLintingToProject)(host, {
10
+ tasks.push(await (0, internal_3.addLintingToProject)(host, {
11
11
  oxlintPlugins: ['react', 'react-perf'],
12
12
  linter: options.linter,
13
13
  project: options.projectName,
@@ -23,8 +23,8 @@ async function addLinting(host, options) {
23
23
  return (0, devkit_1.runTasksInSerial)(...tasks);
24
24
  }
25
25
  // Add ignored dependencies and files to dependency-checks rule
26
- if ((0, internal_1.isEslintConfigSupported)(host)) {
27
- (0, internal_1.updateOverrideInLintConfig)(host, options.projectRoot, (override) => Boolean(override.rules?.['@nx/dependency-checks']), (override) => {
26
+ if ((0, internal_2.isEslintConfigSupported)(host)) {
27
+ (0, internal_2.updateOverrideInLintConfig)(host, options.projectRoot, (override) => Boolean(override.rules?.['@nx/dependency-checks']), (override) => {
28
28
  const rule = override.rules['@nx/dependency-checks'];
29
29
  if (Array.isArray(rule) && rule.length > 1) {
30
30
  // Ensure ignoredDependencies array exists
@@ -48,23 +48,23 @@ async function addLinting(host, options) {
48
48
  return override;
49
49
  });
50
50
  }
51
- if ((0, internal_1.isEslintConfigSupported)(host)) {
52
- if ((0, internal_1.useFlatConfig)(host)) {
53
- (0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.projectRoot, 'flat/react', { checkBaseConfig: true });
51
+ if ((0, internal_2.isEslintConfigSupported)(host)) {
52
+ if ((0, internal_2.useFlatConfig)(host)) {
53
+ (0, internal_2.addPredefinedConfigToFlatLintConfig)(host, options.projectRoot, 'flat/react', { checkBaseConfig: true });
54
54
  // Add an empty rules object to users know how to add/override rules
55
- (0, internal_1.addOverrideToLintConfig)(host, options.projectRoot, {
55
+ (0, internal_2.addOverrideToLintConfig)(host, options.projectRoot, {
56
56
  files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
57
57
  rules: {},
58
58
  });
59
59
  }
60
60
  else {
61
- const addExtendsTask = (0, internal_1.addExtendsToLintConfig)(host, options.projectRoot, {
61
+ const addExtendsTask = (0, internal_2.addExtendsToLintConfig)(host, options.projectRoot, {
62
62
  name: 'plugin:@nx/react',
63
63
  needCompatFixup: true,
64
64
  });
65
65
  tasks.push(addExtendsTask);
66
66
  }
67
- (0, internal_1.addIgnoresToLintConfig)(host, options.projectRoot, [
67
+ (0, internal_2.addIgnoresToLintConfig)(host, options.projectRoot, [
68
68
  '.expo',
69
69
  'web-build',
70
70
  'cache',
@@ -73,8 +73,7 @@ async function addLinting(host, options) {
73
73
  ]);
74
74
  }
75
75
  if (!options.skipPackageJson) {
76
- const installTask = await (0, devkit_1.addDependenciesToPackageJson)(host, react_1.extraEslintDependencies.dependencies, react_1.extraEslintDependencies.devDependencies, undefined, true);
77
- tasks.push(installTask);
76
+ tasks.push((0, internal_1.addExtraEslintDependencies)(host));
78
77
  }
79
78
  return (0, devkit_1.runTasksInSerial)(...tasks);
80
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/expo",
3
- "version": "24.1.0-beta.1",
3
+ "version": "24.1.0-beta.3",
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": [
@@ -59,10 +59,10 @@
59
59
  }
60
60
  },
61
61
  "dependencies": {
62
- "@nx/devkit": "24.1.0-beta.1",
63
- "@nx/eslint": "24.1.0-beta.1",
64
- "@nx/js": "24.1.0-beta.1",
65
- "@nx/react": "24.1.0-beta.1",
62
+ "@nx/devkit": "24.1.0-beta.3",
63
+ "@nx/eslint": "24.1.0-beta.3",
64
+ "@nx/js": "24.1.0-beta.3",
65
+ "@nx/react": "24.1.0-beta.3",
66
66
  "enhanced-resolve": "^5.8.3",
67
67
  "picocolors": "^1.1.0",
68
68
  "semver": "^7.6.3",
@@ -70,8 +70,8 @@
70
70
  "tslib": "^2.3.0"
71
71
  },
72
72
  "peerDependencies": {
73
- "@nx/cypress": "24.1.0-beta.1",
74
- "@nx/playwright": "24.1.0-beta.1",
73
+ "@nx/cypress": "24.1.0-beta.3",
74
+ "@nx/playwright": "24.1.0-beta.3",
75
75
  "expo": ">=53.0.0",
76
76
  "@expo/metro": ">= 55.0.0",
77
77
  "metro-config": ">= 0.82.0",
@@ -98,11 +98,11 @@
98
98
  }
99
99
  },
100
100
  "devDependencies": {
101
- "nx": "24.1.0-beta.1"
101
+ "nx": "24.1.0-beta.3"
102
102
  },
103
103
  "optionalDependencies": {
104
- "@nx/detox": "24.1.0-beta.1",
105
- "@nx/rollup": "24.1.0-beta.1"
104
+ "@nx/detox": "24.1.0-beta.3",
105
+ "@nx/rollup": "24.1.0-beta.3"
106
106
  },
107
107
  "executors": "./executors.json",
108
108
  "ng-update": {