@nx/detox 20.4.0-beta.0 → 20.4.0-beta.2
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 +6 -6
- package/src/generators/application/application.js +15 -0
- package/src/generators/application/lib/create-files.js +24 -2
- package/src/generators/application/lib/normalize-options.d.ts +1 -0
- package/src/generators/application/lib/normalize-options.js +2 -0
- /package/src/generators/application/files/{app/tsconfig.e2e.json → non-ts-solution/tsconfig.e2e.json.template} +0 -0
- /package/src/generators/application/files/{app/tsconfig.json → non-ts-solution/tsconfig.json.template} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/detox",
|
|
3
|
-
"version": "20.4.0-beta.
|
|
3
|
+
"version": "20.4.0-beta.2",
|
|
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.4.0-beta.
|
|
31
|
-
"@nx/jest": "20.4.0-beta.
|
|
32
|
-
"@nx/js": "20.4.0-beta.
|
|
33
|
-
"@nx/eslint": "20.4.0-beta.
|
|
34
|
-
"@nx/react": "20.4.0-beta.
|
|
30
|
+
"@nx/devkit": "20.4.0-beta.2",
|
|
31
|
+
"@nx/jest": "20.4.0-beta.2",
|
|
32
|
+
"@nx/js": "20.4.0-beta.2",
|
|
33
|
+
"@nx/eslint": "20.4.0-beta.2",
|
|
34
|
+
"@nx/react": "20.4.0-beta.2",
|
|
35
35
|
"tslib": "^2.3.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -11,6 +11,8 @@ const add_project_1 = require("./lib/add-project");
|
|
|
11
11
|
const create_files_1 = require("./lib/create-files");
|
|
12
12
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
13
13
|
const ensure_dependencies_1 = require("./lib/ensure-dependencies");
|
|
14
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
15
|
+
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
14
16
|
async function detoxApplicationGenerator(host, schema) {
|
|
15
17
|
return await detoxApplicationGeneratorInternal(host, {
|
|
16
18
|
addPlugin: false,
|
|
@@ -31,6 +33,19 @@ async function detoxApplicationGeneratorInternal(host, schema) {
|
|
|
31
33
|
(0, add_git_ignore_entry_1.addGitIgnoreEntry)(host, options);
|
|
32
34
|
const lintingTask = await (0, add_linting_1.addLinting)(host, options);
|
|
33
35
|
const depsTask = (0, ensure_dependencies_1.ensureDependencies)(host, options);
|
|
36
|
+
(0, ts_solution_setup_1.updateTsconfigFiles)(host, options.e2eProjectRoot, 'tsconfig.json', {
|
|
37
|
+
module: 'esnext',
|
|
38
|
+
moduleResolution: 'bundler',
|
|
39
|
+
outDir: 'out-tsc/detox',
|
|
40
|
+
allowJs: true,
|
|
41
|
+
types: ['node', 'jest', 'detox'],
|
|
42
|
+
}, options.linter === 'eslint'
|
|
43
|
+
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
44
|
+
: undefined);
|
|
45
|
+
if (options.isUsingTsSolutionConfig) {
|
|
46
|
+
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.e2eProjectRoot);
|
|
47
|
+
}
|
|
48
|
+
(0, sort_fields_1.sortPackageJsonFields)(host, options.e2eProjectRoot);
|
|
34
49
|
if (!options.skipFormat) {
|
|
35
50
|
await (0, devkit_1.formatFiles)(host);
|
|
36
51
|
}
|
|
@@ -5,12 +5,34 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
function createFiles(host, options) {
|
|
8
|
+
const offsetFromRoot = (0, devkit_1.offsetFromRoot)(options.e2eProjectRoot);
|
|
9
|
+
const rootTsConfigPath = (0, js_1.getRelativePathToRootTsConfig)(host, options.e2eProjectRoot);
|
|
8
10
|
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/app'), options.e2eProjectRoot, {
|
|
9
11
|
...options,
|
|
10
12
|
exec: (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(host.root)).exec,
|
|
11
|
-
offsetFromRoot
|
|
12
|
-
rootTsConfigPath
|
|
13
|
+
offsetFromRoot,
|
|
14
|
+
rootTsConfigPath,
|
|
13
15
|
});
|
|
16
|
+
if (options.isUsingTsSolutionConfig) {
|
|
17
|
+
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'tsconfig.json'), {
|
|
18
|
+
extends: `${offsetFromRoot}tsconfig.base.json`,
|
|
19
|
+
compilerOptions: {
|
|
20
|
+
sourceMap: false,
|
|
21
|
+
outDir: 'out-tsc/detox',
|
|
22
|
+
allowJs: true,
|
|
23
|
+
types: ['node', 'jest', 'detox'],
|
|
24
|
+
},
|
|
25
|
+
include: ['src/**/*.ts', 'src/**/*.js'],
|
|
26
|
+
exclude: ['out-tsc', 'test-output'],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/non-ts-solution'), options.e2eProjectRoot, {
|
|
31
|
+
...options,
|
|
32
|
+
offsetFromRoot,
|
|
33
|
+
rootTsConfigPath,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
14
36
|
if (options.js) {
|
|
15
37
|
(0, devkit_1.toJS)(host);
|
|
16
38
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
6
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
7
|
async function normalizeOptions(host, options) {
|
|
7
8
|
const { projectName: e2eProjectName, projectRoot: e2eProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
8
9
|
name: options.e2eName,
|
|
@@ -25,5 +26,6 @@ async function normalizeOptions(host, options) {
|
|
|
25
26
|
e2eName: e2eProjectName,
|
|
26
27
|
e2eProjectName,
|
|
27
28
|
e2eProjectRoot,
|
|
29
|
+
isUsingTsSolutionConfig: (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host),
|
|
28
30
|
};
|
|
29
31
|
}
|
|
File without changes
|
|
File without changes
|