@nx/detox 22.7.0-beta.0 → 22.7.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.
- package/package.json +9 -9
- package/src/executors/build/schema.d.ts +5 -0
- package/src/executors/test/schema.d.ts +39 -0
- package/src/generators/application/application.js +2 -1
- package/src/generators/application/lib/add-linting.d.ts.map +1 -1
- package/src/generators/application/lib/add-linting.js +1 -1
- package/src/generators/application/schema.d.ts +16 -0
- package/src/generators/init/schema.d.ts +7 -0
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +5 -5
- package/.eslintrc.json +0 -32
- package/project.json +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/detox",
|
|
3
|
-
"version": "22.7.0-beta.
|
|
3
|
+
"version": "22.7.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": [
|
|
@@ -25,18 +25,19 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"author": "Victor Savkin",
|
|
27
27
|
"main": "./index.js",
|
|
28
|
+
"type": "commonjs",
|
|
28
29
|
"types": "index.d.ts",
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@nx/devkit": "22.7.0-beta.
|
|
31
|
-
"@nx/jest": "22.7.0-beta.
|
|
32
|
-
"@nx/js": "22.7.0-beta.
|
|
33
|
-
"@nx/eslint": "22.7.0-beta.
|
|
34
|
-
"@nx/react": "22.7.0-beta.
|
|
31
|
+
"@nx/devkit": "22.7.0-beta.10",
|
|
32
|
+
"@nx/jest": "22.7.0-beta.10",
|
|
33
|
+
"@nx/js": "22.7.0-beta.10",
|
|
34
|
+
"@nx/eslint": "22.7.0-beta.10",
|
|
35
|
+
"@nx/react": "22.7.0-beta.10",
|
|
35
36
|
"semver": "^7.6.3",
|
|
36
37
|
"tslib": "^2.3.0"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"nx": "22.7.0-beta.
|
|
40
|
+
"nx": "22.7.0-beta.10"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
42
43
|
"detox": "^20.9.0"
|
|
@@ -49,6 +50,5 @@
|
|
|
49
50
|
"generators": "./generators.json",
|
|
50
51
|
"publishConfig": {
|
|
51
52
|
"access": "public"
|
|
52
|
-
}
|
|
53
|
-
"type": "commonjs"
|
|
53
|
+
}
|
|
54
54
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface DetoxTestOptions {
|
|
2
|
+
// options from https://wix.github.io/Detox/docs/cli/test
|
|
3
|
+
// detox test args: https://github.com/wix/Detox/blob/master/detox/local-cli/testCommand/builder.js
|
|
4
|
+
configPath?: string;
|
|
5
|
+
detoxConfiguration: string;
|
|
6
|
+
loglevel?: 'fatal' | 'error' | 'warn' | 'info' | 'verbose' | 'trace';
|
|
7
|
+
retries?: number;
|
|
8
|
+
reuse: boolean; // default is false
|
|
9
|
+
cleanup?: boolean;
|
|
10
|
+
debugSynchronization?: boolean;
|
|
11
|
+
artifactsLocation?: string;
|
|
12
|
+
recordLogs?: 'failing' | 'all' | 'none';
|
|
13
|
+
takeScreenshots?: 'manual' | 'failing' | 'all' | 'none';
|
|
14
|
+
recordVideos?: 'failing' | 'all' | 'none';
|
|
15
|
+
recordPerformance?: 'all' | 'none';
|
|
16
|
+
captureViewHierarchy?: 'enabled' | 'disabled';
|
|
17
|
+
jestReportSpecs?: boolean;
|
|
18
|
+
headeless?: boolean;
|
|
19
|
+
gpu?: boolean;
|
|
20
|
+
keepLockFile?: boolean;
|
|
21
|
+
deviceName?: string;
|
|
22
|
+
deviceBootArgs?: string;
|
|
23
|
+
appLaunchArgs?: string;
|
|
24
|
+
useCustomLogger?: boolean;
|
|
25
|
+
forceAdbInstall?: boolean;
|
|
26
|
+
inspectBrk?: boolean;
|
|
27
|
+
|
|
28
|
+
// detox cli options
|
|
29
|
+
color?: boolean;
|
|
30
|
+
|
|
31
|
+
// nx build options
|
|
32
|
+
buildTarget?: string;
|
|
33
|
+
|
|
34
|
+
// @deprecated(Emily): removed from Detox 20, remove in next major release
|
|
35
|
+
runnerConfig?: string;
|
|
36
|
+
recordTimeline?: 'all' | 'none';
|
|
37
|
+
workers?: number;
|
|
38
|
+
deviceLaunchArgs?: string;
|
|
39
|
+
}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.detoxApplicationGenerator = detoxApplicationGenerator;
|
|
4
4
|
exports.detoxApplicationGeneratorInternal = detoxApplicationGeneratorInternal;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
const js_1 = require("@nx/js");
|
|
7
|
-
const init_1 = require("../init/init");
|
|
8
|
+
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
8
9
|
const add_git_ignore_entry_1 = require("./lib/add-git-ignore-entry");
|
|
9
10
|
const add_linting_1 = require("./lib/add-linting");
|
|
10
11
|
const add_project_1 = require("./lib/add-project");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-linting.d.ts","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/application/lib/add-linting.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AASvD,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"add-linting.d.ts","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/application/lib/add-linting.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AASvD,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,8BAgDrE"}
|
|
@@ -23,7 +23,7 @@ async function addLinting(host, options) {
|
|
|
23
23
|
tasks.push(lintTask);
|
|
24
24
|
if ((0, eslint_file_1.isEslintConfigSupported)(host)) {
|
|
25
25
|
if ((0, flat_config_1.useFlatConfig)(host)) {
|
|
26
|
-
(0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(host, options.e2eProjectRoot, 'flat/react');
|
|
26
|
+
(0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(host, options.e2eProjectRoot, 'flat/react', { checkBaseConfig: true });
|
|
27
27
|
// Add an empty rules object to users know how to add/override rules
|
|
28
28
|
(0, eslint_file_1.addOverrideToLintConfig)(host, options.e2eProjectRoot, {
|
|
29
29
|
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Linter, LinterType } from '@nx/eslint';
|
|
2
|
+
|
|
3
|
+
export interface Schema {
|
|
4
|
+
appProject: string; // name of the project app to be tested (directory + app name), case insensitive
|
|
5
|
+
appDisplayName?: string; // display name of the app to be tested
|
|
6
|
+
appName?: string; // name of app to be tested if different form appProject, case insensitive
|
|
7
|
+
e2eDirectory: string; // the directory where e2e app going to be located
|
|
8
|
+
e2eName?: string; // name of the e2e app
|
|
9
|
+
linter?: Linter | LinterType;
|
|
10
|
+
js?: boolean;
|
|
11
|
+
skipFormat?: boolean;
|
|
12
|
+
setParserOptionsProject?: boolean;
|
|
13
|
+
framework: 'react-native' | 'expo';
|
|
14
|
+
addPlugin?: boolean;
|
|
15
|
+
useProjectJson?: boolean;
|
|
16
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/detox/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EAOd,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,kBAAkB;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/detox/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EAOd,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,kBAAkB;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAsBD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,kBAAkB,CAsBzD,CAAC;AAEF,eAAO,MAAM,aAAa,mCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -10,7 +10,6 @@ const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculat
|
|
|
10
10
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
11
11
|
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
12
12
|
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
13
|
-
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
14
13
|
function readTargetsCache(cachePath) {
|
|
15
14
|
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
16
15
|
}
|
|
@@ -27,8 +26,9 @@ exports.createNodes = [
|
|
|
27
26
|
const optionsHash = (0, devkit_internals_1.hashObject)(options);
|
|
28
27
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `expo-${optionsHash}.hash`);
|
|
29
28
|
const targetsCache = readTargetsCache(cachePath);
|
|
29
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
|
|
30
30
|
try {
|
|
31
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache), configFiles, options, context);
|
|
31
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, pmc), configFiles, options, context);
|
|
32
32
|
}
|
|
33
33
|
finally {
|
|
34
34
|
writeTargetsToCache(cachePath, targetsCache);
|
|
@@ -36,11 +36,11 @@ exports.createNodes = [
|
|
|
36
36
|
},
|
|
37
37
|
];
|
|
38
38
|
exports.createNodesV2 = exports.createNodes;
|
|
39
|
-
async function createNodesInternal(configFile, options, context, targetsCache) {
|
|
39
|
+
async function createNodesInternal(configFile, options, context, targetsCache, pmc) {
|
|
40
40
|
options = normalizeOptions(options);
|
|
41
41
|
const projectRoot = (0, path_1.dirname)(configFile);
|
|
42
42
|
const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
|
|
43
|
-
targetsCache[hash] ??= buildDetoxTargets(projectRoot, options, context);
|
|
43
|
+
targetsCache[hash] ??= buildDetoxTargets(projectRoot, options, context, pmc);
|
|
44
44
|
return {
|
|
45
45
|
projects: {
|
|
46
46
|
[projectRoot]: {
|
|
@@ -49,7 +49,7 @@ async function createNodesInternal(configFile, options, context, targetsCache) {
|
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function buildDetoxTargets(projectRoot, options, context) {
|
|
52
|
+
function buildDetoxTargets(projectRoot, options, context, pmc) {
|
|
53
53
|
const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
|
|
54
54
|
const targets = {
|
|
55
55
|
[options.buildTargetName]: {
|
package/.eslintrc.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../.eslintrc.json",
|
|
3
|
-
"rules": {},
|
|
4
|
-
"ignorePatterns": ["!**/*", "node_modules"],
|
|
5
|
-
"overrides": [
|
|
6
|
-
{
|
|
7
|
-
"files": [
|
|
8
|
-
"./package.json",
|
|
9
|
-
"./generators.json",
|
|
10
|
-
"./executors.json",
|
|
11
|
-
"./migrations.json"
|
|
12
|
-
],
|
|
13
|
-
"parser": "jsonc-eslint-parser",
|
|
14
|
-
"rules": {
|
|
15
|
-
"@nx/nx-plugin-checks": "error"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"files": ["./package.json"],
|
|
20
|
-
"parser": "jsonc-eslint-parser",
|
|
21
|
-
"rules": {
|
|
22
|
-
"@nx/dependency-checks": [
|
|
23
|
-
"error",
|
|
24
|
-
{
|
|
25
|
-
"buildTargets": ["build-base"],
|
|
26
|
-
"ignoredDependencies": ["nx", "typescript", "detox"]
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
package/project.json
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "detox",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "packages/detox/src",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"targets": {
|
|
7
|
-
"build": {
|
|
8
|
-
"outputs": ["{workspaceRoot}/dist/packages/detox/README.md"],
|
|
9
|
-
"command": "node ./scripts/copy-readme.js detox",
|
|
10
|
-
"dependsOn": ["^build", "build-base", "legacy-post-build"]
|
|
11
|
-
},
|
|
12
|
-
"legacy-post-build": {
|
|
13
|
-
"executor": "@nx/workspace-plugin:legacy-post-build",
|
|
14
|
-
"options": {
|
|
15
|
-
"tsConfig": "./tsconfig.lib.json",
|
|
16
|
-
"assets": [
|
|
17
|
-
{
|
|
18
|
-
"input": "packages/detox",
|
|
19
|
-
"glob": "**/files/**",
|
|
20
|
-
"output": "/"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"input": "packages/detox",
|
|
24
|
-
"glob": "**/files/**/.gitkeep",
|
|
25
|
-
"output": "/"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"input": "packages/detox",
|
|
29
|
-
"glob": "**/files/**/.babelrc.template",
|
|
30
|
-
"output": "/"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"input": "packages/detox",
|
|
34
|
-
"glob": "**/files/**/.detoxrc.json.template",
|
|
35
|
-
"output": "/"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"input": "./packages/detox",
|
|
39
|
-
"glob": "**/*.json",
|
|
40
|
-
"ignore": ["**/tsconfig*.json"],
|
|
41
|
-
"output": "/"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"input": "",
|
|
45
|
-
"glob": "LICENSE",
|
|
46
|
-
"output": "/"
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|