@nx/detox 23.2.0-beta.0 → 23.2.0-beta.10

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.
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = detoxTestExecutor;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const internal_1 = require("@nx/devkit/internal");
6
- const devkit_2 = require("@nx/devkit");
7
6
  const path_1 = require("path");
8
7
  const child_process_1 = require("child_process");
9
8
  const build_impl_1 = require("../build/build.impl");
@@ -77,7 +76,7 @@ function createDetoxTestOptions(options) {
77
76
  }
78
77
  }
79
78
  else {
80
- const propertyName = (0, devkit_2.names)(k).fileName; // convert camelCase to kebab-case
79
+ const propertyName = (0, devkit_1.names)(k).fileName; // convert camelCase to kebab-case
81
80
  acc.push(`--${propertyName}`, propertyValue);
82
81
  }
83
82
  return acc;
@@ -1,25 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLinting = addLinting;
4
- const eslint_1 = require("@nx/eslint");
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const react_1 = require("@nx/react");
7
6
  const internal_1 = require("@nx/eslint/internal");
7
+ const internal_2 = require("@nx/js/internal");
8
8
  async function addLinting(host, options) {
9
- if (options.linter === 'none') {
10
- return () => { };
11
- }
12
9
  const tasks = [];
13
- const lintTask = await (0, eslint_1.lintProjectGenerator)(host, {
10
+ tasks.push(await (0, internal_2.addLintingToProject)(host, {
14
11
  linter: options.linter,
15
12
  project: options.e2eProjectName,
16
13
  tsConfigPaths: [
17
14
  (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'tsconfig.app.json'),
18
15
  ],
19
- skipFormat: true,
16
+ enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
20
17
  addPlugin: options.addPlugin,
21
- });
22
- tasks.push(lintTask);
18
+ // Detox e2e specs are Jest; this is what enables the linter's Jest rules.
19
+ unitTestRunner: 'jest',
20
+ }));
21
+ // Everything below configures ESLint — predefined configs, `extends`, ignore
22
+ // entries — which have no equivalent in other linters.
23
+ if (options.linter && options.linter !== 'eslint') {
24
+ return (0, devkit_1.runTasksInSerial)(...tasks);
25
+ }
23
26
  if ((0, internal_1.isEslintConfigSupported)(host)) {
24
27
  if ((0, internal_1.useFlatConfig)(host)) {
25
28
  (0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.e2eProjectRoot, 'flat/react', { checkBaseConfig: true });
@@ -22,6 +22,9 @@ async function normalizeOptions(host, options) {
22
22
  const useProjectJson = options.useProjectJson ?? !isUsingTsSolutionConfig;
23
23
  return {
24
24
  ...options,
25
+ // The two guards downstream spell the check differently and disagree on
26
+ // `undefined`, so resolve it to a concrete linter here.
27
+ linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
25
28
  appFileName,
26
29
  appClassName,
27
30
  appDisplayName: options.appDisplayName || appClassName,
@@ -1,4 +1,4 @@
1
- import type { Linter, LinterType } from '@nx/eslint';
1
+ import type { LinterType } from '@nx/js';
2
2
 
3
3
  export interface Schema {
4
4
  appProject: string; // name of the project app to be tested (directory + app name), case insensitive
@@ -6,9 +6,13 @@ export interface Schema {
6
6
  appName?: string; // name of app to be tested if different form appProject, case insensitive
7
7
  e2eDirectory: string; // the directory where e2e app going to be located
8
8
  e2eName?: string; // name of the e2e app
9
- linter?: Linter | LinterType;
9
+ linter?: LinterType;
10
10
  js?: boolean;
11
11
  skipFormat?: boolean;
12
+ enableTypedLinting?: boolean;
13
+ /**
14
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
15
+ */
12
16
  setParserOptionsProject?: boolean;
13
17
  framework: 'react-native' | 'expo';
14
18
  addPlugin?: boolean;
@@ -40,10 +40,9 @@
40
40
  "x-prompt": "What app framework should detox test?"
41
41
  },
42
42
  "linter": {
43
- "description": "The tool to use for running lint checks.",
43
+ "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
44
44
  "type": "string",
45
- "enum": ["eslint", "none"],
46
- "default": "eslint"
45
+ "enum": ["eslint", "oxlint", "none"]
47
46
  },
48
47
  "js": {
49
48
  "description": "Generate JavaScript files rather than TypeScript files.",
@@ -56,11 +55,17 @@
56
55
  "default": false,
57
56
  "x-priority": "internal"
58
57
  },
59
- "setParserOptionsProject": {
58
+ "enableTypedLinting": {
60
59
  "type": "boolean",
61
- "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
60
+ "description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
62
61
  "default": false
63
62
  },
63
+ "setParserOptionsProject": {
64
+ "type": "boolean",
65
+ "description": "Deprecated alias for `enableTypedLinting`.",
66
+ "default": false,
67
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
68
+ },
64
69
  "useProjectJson": {
65
70
  "type": "boolean",
66
71
  "description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
@@ -5,14 +5,12 @@ const internal_1 = require("@nx/devkit/internal");
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const path_1 = require("path");
7
7
  const js_1 = require("@nx/js");
8
- const cache_directory_1 = require("nx/src/utils/cache-directory");
9
- const devkit_internals_1 = require("nx/src/devkit-internals");
10
8
  const internal_2 = require("@nx/js/internal");
11
9
  exports.createNodes = [
12
10
  '**/{detox.config,.detoxrc}.{json,js}',
13
11
  async (configFiles, options, context) => {
14
- const optionsHash = (0, devkit_internals_1.hashObject)(options);
15
- const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `detox-${optionsHash}.hash`);
12
+ const optionsHash = (0, internal_1.hashObject)(options);
13
+ const cachePath = (0, path_1.join)(internal_1.workspaceDataDirectory, `detox-${optionsHash}.hash`);
16
14
  const targetsCache = new internal_1.PluginCache(cachePath);
17
15
  const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
18
16
  const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
@@ -1,4 +1,4 @@
1
- import type { Tree } from 'nx/src/generators/tree';
1
+ import { type Tree } from '@nx/devkit';
2
2
  /**
3
3
  * Get the installed Expo version from package.json.
4
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/detox",
3
- "version": "23.2.0-beta.0",
3
+ "version": "23.2.0-beta.10",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Detox contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.",
6
6
  "keywords": [
@@ -37,14 +37,14 @@
37
37
  "dependencies": {
38
38
  "semver": "^7.6.3",
39
39
  "tslib": "^2.3.0",
40
- "@nx/devkit": "23.2.0-beta.0",
41
- "@nx/js": "23.2.0-beta.0",
42
- "@nx/jest": "23.2.0-beta.0",
43
- "@nx/react": "23.2.0-beta.0",
44
- "@nx/eslint": "23.2.0-beta.0"
40
+ "@nx/devkit": "23.2.0-beta.10",
41
+ "@nx/jest": "23.2.0-beta.10",
42
+ "@nx/js": "23.2.0-beta.10",
43
+ "@nx/react": "23.2.0-beta.10",
44
+ "@nx/eslint": "23.2.0-beta.10"
45
45
  },
46
46
  "devDependencies": {
47
- "nx": "23.2.0-beta.0"
47
+ "nx": "23.2.0-beta.10"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "detox": "^20.0.0"