@nx/detox 20.5.0 → 20.6.0-beta.0
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.
|
|
3
|
+
"version": "20.6.0-beta.0",
|
|
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.
|
|
31
|
-
"@nx/jest": "20.
|
|
32
|
-
"@nx/js": "20.
|
|
33
|
-
"@nx/eslint": "20.
|
|
34
|
-
"@nx/react": "20.
|
|
30
|
+
"@nx/devkit": "20.6.0-beta.0",
|
|
31
|
+
"@nx/jest": "20.6.0-beta.0",
|
|
32
|
+
"@nx/js": "20.6.0-beta.0",
|
|
33
|
+
"@nx/eslint": "20.6.0-beta.0",
|
|
34
|
+
"@nx/react": "20.6.0-beta.0",
|
|
35
35
|
"tslib": "^2.3.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -16,6 +16,7 @@ const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
|
16
16
|
async function detoxApplicationGenerator(host, schema) {
|
|
17
17
|
return await detoxApplicationGeneratorInternal(host, {
|
|
18
18
|
addPlugin: false,
|
|
19
|
+
useProjectJson: true,
|
|
19
20
|
...schema,
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -43,7 +44,7 @@ async function detoxApplicationGeneratorInternal(host, schema) {
|
|
|
43
44
|
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
44
45
|
: undefined);
|
|
45
46
|
if (options.isUsingTsSolutionConfig) {
|
|
46
|
-
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.e2eProjectRoot);
|
|
47
|
+
await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.e2eProjectRoot);
|
|
47
48
|
}
|
|
48
49
|
(0, sort_fields_1.sortPackageJsonFields)(host, options.e2eProjectRoot);
|
|
49
50
|
if (!options.skipFormat) {
|
|
@@ -3,25 +3,24 @@ 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");
|
|
7
6
|
function addProject(host, options) {
|
|
8
7
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
9
8
|
const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
|
|
10
9
|
? p === '@nx/detox/plugin'
|
|
11
10
|
: p.plugin === '@nx/detox/plugin');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
11
|
+
const packageJson = {
|
|
12
|
+
name: options.importPath,
|
|
13
|
+
version: '0.0.1',
|
|
14
|
+
private: true,
|
|
15
|
+
};
|
|
16
|
+
if (!options.useProjectJson) {
|
|
17
|
+
packageJson.nx = {
|
|
18
|
+
name: options.e2eProjectName !== options.importPath
|
|
19
|
+
? options.e2eProjectName
|
|
20
|
+
: undefined,
|
|
21
|
+
targets: hasPlugin ? undefined : getTargets(options),
|
|
22
|
+
implicitDependencies: [options.appProject],
|
|
23
|
+
};
|
|
25
24
|
}
|
|
26
25
|
else {
|
|
27
26
|
(0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
|
|
@@ -33,6 +32,9 @@ function addProject(host, options) {
|
|
|
33
32
|
implicitDependencies: [options.appProject],
|
|
34
33
|
});
|
|
35
34
|
}
|
|
35
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
36
|
+
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
37
|
+
}
|
|
36
38
|
}
|
|
37
39
|
function getTargets(options) {
|
|
38
40
|
const targets = {};
|
|
@@ -18,6 +18,8 @@ async function normalizeOptions(host, options) {
|
|
|
18
18
|
const { root: appRoot } = (0, devkit_1.readProjectConfiguration)(host, options.appProject);
|
|
19
19
|
const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
|
|
20
20
|
const e2eProjectName = !isUsingTsSolutionConfig || options.e2eName ? projectName : importPath;
|
|
21
|
+
// We default to generate a project.json file if the new setup is not being used
|
|
22
|
+
const useProjectJson = options.useProjectJson ?? !isUsingTsSolutionConfig;
|
|
21
23
|
return {
|
|
22
24
|
...options,
|
|
23
25
|
appFileName,
|
|
@@ -30,5 +32,6 @@ async function normalizeOptions(host, options) {
|
|
|
30
32
|
importPath,
|
|
31
33
|
isUsingTsSolutionConfig,
|
|
32
34
|
js: options.js ?? false,
|
|
35
|
+
useProjectJson,
|
|
33
36
|
};
|
|
34
37
|
}
|
|
@@ -60,6 +60,10 @@
|
|
|
60
60
|
"type": "boolean",
|
|
61
61
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
62
62
|
"default": false
|
|
63
|
+
},
|
|
64
|
+
"useProjectJson": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
|
|
63
67
|
}
|
|
64
68
|
},
|
|
65
69
|
"required": ["e2eDirectory", "appProject", "framework"]
|