@nx/detox 20.2.0-beta.3 → 20.2.0-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/detox",
3
- "version": "20.2.0-beta.3",
3
+ "version": "20.2.0-beta.4",
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": [
@@ -27,11 +27,11 @@
27
27
  "main": "./index",
28
28
  "types": "index.d.ts",
29
29
  "dependencies": {
30
- "@nx/devkit": "20.2.0-beta.3",
31
- "@nx/jest": "20.2.0-beta.3",
32
- "@nx/js": "20.2.0-beta.3",
33
- "@nx/eslint": "20.2.0-beta.3",
34
- "@nx/react": "20.2.0-beta.3",
30
+ "@nx/devkit": "20.2.0-beta.4",
31
+ "@nx/jest": "20.2.0-beta.4",
32
+ "@nx/js": "20.2.0-beta.4",
33
+ "@nx/eslint": "20.2.0-beta.4",
34
+ "@nx/react": "20.2.0-beta.4",
35
35
  "tslib": "^2.3.0"
36
36
  },
37
37
  "peerDependencies": {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.detoxApplicationGenerator = detoxApplicationGenerator;
4
4
  exports.detoxApplicationGeneratorInternal = detoxApplicationGeneratorInternal;
5
5
  const devkit_1 = require("@nx/devkit");
6
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
6
+ const js_1 = require("@nx/js");
7
7
  const init_1 = require("../init/init");
8
8
  const add_git_ignore_entry_1 = require("./lib/add-git-ignore-entry");
9
9
  const add_linting_1 = require("./lib/add-linting");
@@ -18,7 +18,9 @@ async function detoxApplicationGenerator(host, schema) {
18
18
  });
19
19
  }
20
20
  async function detoxApplicationGeneratorInternal(host, schema) {
21
- (0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(host, 'detox', 'application');
21
+ const jsInitTask = await (0, js_1.initGenerator)(host, {
22
+ skipFormat: true,
23
+ });
22
24
  const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
23
25
  const initTask = await (0, init_1.default)(host, {
24
26
  ...options,
@@ -32,6 +34,6 @@ async function detoxApplicationGeneratorInternal(host, schema) {
32
34
  if (!options.skipFormat) {
33
35
  await (0, devkit_1.formatFiles)(host);
34
36
  }
35
- return (0, devkit_1.runTasksInSerial)(initTask, lintingTask, depsTask);
37
+ return (0, devkit_1.runTasksInSerial)(jsInitTask, initTask, lintingTask, depsTask);
36
38
  }
37
39
  exports.default = detoxApplicationGenerator;
@@ -3,19 +3,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addProject = addProject;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const get_targets_1 = require("./get-targets");
6
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
6
7
  function addProject(host, options) {
7
8
  const nxJson = (0, devkit_1.readNxJson)(host);
8
9
  const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
9
10
  ? p === '@nx/detox/plugin'
10
11
  : p.plugin === '@nx/detox/plugin');
11
- (0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
12
- root: options.e2eProjectRoot,
13
- sourceRoot: `${options.e2eProjectRoot}/src`,
14
- projectType: 'application',
15
- targets: hasPlugin ? {} : getTargets(options),
16
- tags: [],
17
- implicitDependencies: [options.appProject],
18
- });
12
+ if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
13
+ (0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), {
14
+ name: options.e2eProjectName,
15
+ version: '0.0.1',
16
+ private: true,
17
+ nx: {
18
+ sourceRoot: `${options.e2eProjectRoot}/src`,
19
+ projectType: 'application',
20
+ targets: hasPlugin ? undefined : getTargets(options),
21
+ implicitDependencies: [options.appProject],
22
+ },
23
+ });
24
+ }
25
+ else {
26
+ (0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
27
+ root: options.e2eProjectRoot,
28
+ sourceRoot: `${options.e2eProjectRoot}/src`,
29
+ projectType: 'application',
30
+ targets: hasPlugin ? {} : getTargets(options),
31
+ tags: [],
32
+ implicitDependencies: [options.appProject],
33
+ });
34
+ }
19
35
  }
20
36
  function getTargets(options) {
21
37
  const targets = {};
@@ -5,14 +5,12 @@ exports.detoxInitGeneratorInternal = detoxInitGeneratorInternal;
5
5
  exports.updateDependencies = updateDependencies;
6
6
  const devkit_1 = require("@nx/devkit");
7
7
  const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
8
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
9
8
  const plugin_1 = require("../../plugins/plugin");
10
9
  const versions_1 = require("../../utils/versions");
11
10
  function detoxInitGenerator(host, schema) {
12
11
  return detoxInitGeneratorInternal(host, { addPlugin: false, ...schema });
13
12
  }
14
13
  async function detoxInitGeneratorInternal(host, schema) {
15
- (0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(host, 'detox', 'init');
16
14
  const tasks = [];
17
15
  const nxJson = (0, devkit_1.readNxJson)(host);
18
16
  const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&