@nx/detox 16.0.0-beta.1
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/.eslintrc.json +19 -0
- package/CHANGELOG.md +8 -0
- package/LICENSE +22 -0
- package/README.md +63 -0
- package/executors.json +14 -0
- package/generators.json +35 -0
- package/index.d.ts +2 -0
- package/index.js +8 -0
- package/index.js.map +1 -0
- package/migrations.json +212 -0
- package/package.json +48 -0
- package/project.json +58 -0
- package/src/executors/build/build.impl.d.ts +7 -0
- package/src/executors/build/build.impl.js +59 -0
- package/src/executors/build/build.impl.js.map +1 -0
- package/src/executors/build/compat.d.ts +2 -0
- package/src/executors/build/compat.js +6 -0
- package/src/executors/build/compat.js.map +1 -0
- package/src/executors/build/schema.json +23 -0
- package/src/executors/test/compat.d.ts +2 -0
- package/src/executors/test/compat.js +6 -0
- package/src/executors/test/compat.js.map +1 -0
- package/src/executors/test/schema.json +149 -0
- package/src/executors/test/test.impl.d.ts +6 -0
- package/src/executors/test/test.impl.js +74 -0
- package/src/executors/test/test.impl.js.map +1 -0
- package/src/generators/application/application.d.ts +5 -0
- package/src/generators/application/application.js +29 -0
- package/src/generators/application/application.js.map +1 -0
- package/src/generators/application/files/app/.babelrc.template +11 -0
- package/src/generators/application/files/app/.detoxrc.json.template +102 -0
- package/src/generators/application/files/app/jest.config.json.template +15 -0
- package/src/generators/application/files/app/src/app.spec.ts.template +11 -0
- package/src/generators/application/files/app/test-setup.ts.template +5 -0
- package/src/generators/application/files/app/tsconfig.e2e.json +10 -0
- package/src/generators/application/files/app/tsconfig.json +10 -0
- package/src/generators/application/lib/add-git-ignore-entry.d.ts +3 -0
- package/src/generators/application/lib/add-git-ignore-entry.js +16 -0
- package/src/generators/application/lib/add-git-ignore-entry.js.map +1 -0
- package/src/generators/application/lib/add-linting.d.ts +3 -0
- package/src/generators/application/lib/add-linting.js +28 -0
- package/src/generators/application/lib/add-linting.js.map +1 -0
- package/src/generators/application/lib/add-project.d.ts +3 -0
- package/src/generators/application/lib/add-project.js +33 -0
- package/src/generators/application/lib/add-project.js.map +1 -0
- package/src/generators/application/lib/create-files.d.ts +3 -0
- package/src/generators/application/lib/create-files.js +14 -0
- package/src/generators/application/lib/create-files.js.map +1 -0
- package/src/generators/application/lib/get-targets.d.ts +58 -0
- package/src/generators/application/lib/get-targets.js +76 -0
- package/src/generators/application/lib/get-targets.js.map +1 -0
- package/src/generators/application/lib/normalize-options.d.ts +18 -0
- package/src/generators/application/lib/normalize-options.js +34 -0
- package/src/generators/application/lib/normalize-options.js.map +1 -0
- package/src/generators/application/schema.json +66 -0
- package/src/generators/init/init.d.ts +6 -0
- package/src/generators/init/init.js +37 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/schema.json +21 -0
- package/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.d.ts +5 -0
- package/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.js +32 -0
- package/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.js.map +1 -0
- package/src/migrations/update-13-5-0/add-build-target-test-13-5-0.d.ts +5 -0
- package/src/migrations/update-13-5-0/add-build-target-test-13-5-0.js +27 -0
- package/src/migrations/update-13-5-0/add-build-target-test-13-5-0.js.map +1 -0
- package/src/migrations/update-13-8-2/remove-types-detox-13-8-2.d.ts +2 -0
- package/src/migrations/update-13-8-2/remove-types-detox-13-8-2.js +25 -0
- package/src/migrations/update-13-8-2/remove-types-detox-13-8-2.js.map +1 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
- package/src/utils/versions.d.ts +3 -0
- package/src/utils/versions.js +7 -0
- package/src/utils/versions.js.map +1 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare function reactNativeBuildTarget(platform: 'ios.sim' | 'android.emu'): {
|
|
2
|
+
options: {
|
|
3
|
+
detoxConfiguration: string;
|
|
4
|
+
};
|
|
5
|
+
configurations: {
|
|
6
|
+
production: {
|
|
7
|
+
detoxConfiguration: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function expoBuildTarget(platform: 'ios.sim' | 'android.emu'): {
|
|
12
|
+
options: {
|
|
13
|
+
detoxConfiguration: string;
|
|
14
|
+
};
|
|
15
|
+
configurations: {
|
|
16
|
+
local: {
|
|
17
|
+
detoxConfiguration: string;
|
|
18
|
+
};
|
|
19
|
+
bare: {
|
|
20
|
+
detoxConfiguration: string;
|
|
21
|
+
};
|
|
22
|
+
production: {
|
|
23
|
+
detoxConfiguration: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare function reactNativeTestTarget(platform: 'ios.sim' | 'android.emu', e2eName: string): {
|
|
28
|
+
options: {
|
|
29
|
+
detoxConfiguration: string;
|
|
30
|
+
buildTarget: string;
|
|
31
|
+
};
|
|
32
|
+
configurations: {
|
|
33
|
+
production: {
|
|
34
|
+
detoxConfiguration: string;
|
|
35
|
+
buildTarget: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare function expoTestTarget(platform: 'ios.sim' | 'android.emu', e2eName: string): {
|
|
40
|
+
options: {
|
|
41
|
+
detoxConfiguration: string;
|
|
42
|
+
buildTarget: string;
|
|
43
|
+
};
|
|
44
|
+
configurations: {
|
|
45
|
+
local: {
|
|
46
|
+
detoxConfiguration: string;
|
|
47
|
+
buildTarget: string;
|
|
48
|
+
};
|
|
49
|
+
bare: {
|
|
50
|
+
detoxConfiguration: string;
|
|
51
|
+
buildTarget: string;
|
|
52
|
+
};
|
|
53
|
+
production: {
|
|
54
|
+
detoxConfiguration: string;
|
|
55
|
+
buildTarget: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.expoTestTarget = exports.reactNativeTestTarget = exports.expoBuildTarget = exports.reactNativeBuildTarget = void 0;
|
|
4
|
+
function reactNativeBuildTarget(platform) {
|
|
5
|
+
return {
|
|
6
|
+
options: {
|
|
7
|
+
detoxConfiguration: `${platform}.debug`,
|
|
8
|
+
},
|
|
9
|
+
configurations: {
|
|
10
|
+
production: {
|
|
11
|
+
detoxConfiguration: `${platform}.release`,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
exports.reactNativeBuildTarget = reactNativeBuildTarget;
|
|
17
|
+
function expoBuildTarget(platform) {
|
|
18
|
+
return {
|
|
19
|
+
options: {
|
|
20
|
+
detoxConfiguration: `${platform}.debug`,
|
|
21
|
+
},
|
|
22
|
+
configurations: {
|
|
23
|
+
local: {
|
|
24
|
+
detoxConfiguration: `${platform}.local`,
|
|
25
|
+
},
|
|
26
|
+
bare: {
|
|
27
|
+
detoxConfiguration: `${platform}.debug`,
|
|
28
|
+
},
|
|
29
|
+
production: {
|
|
30
|
+
detoxConfiguration: `${platform}.release`,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.expoBuildTarget = expoBuildTarget;
|
|
36
|
+
function reactNativeTestTarget(platform, e2eName) {
|
|
37
|
+
const buildPlatform = platform === 'ios.sim' ? 'ios' : 'android';
|
|
38
|
+
return {
|
|
39
|
+
options: {
|
|
40
|
+
detoxConfiguration: `${platform}.debug`,
|
|
41
|
+
buildTarget: `${e2eName}:build-${buildPlatform}`,
|
|
42
|
+
},
|
|
43
|
+
configurations: {
|
|
44
|
+
production: {
|
|
45
|
+
detoxConfiguration: `${platform}.release`,
|
|
46
|
+
buildTarget: `${e2eName}:build-${buildPlatform}:production`,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
exports.reactNativeTestTarget = reactNativeTestTarget;
|
|
52
|
+
function expoTestTarget(platform, e2eName) {
|
|
53
|
+
const buildPlatform = platform === 'ios.sim' ? 'ios' : 'android';
|
|
54
|
+
return {
|
|
55
|
+
options: {
|
|
56
|
+
detoxConfiguration: `${platform}.eas`,
|
|
57
|
+
buildTarget: `${e2eName}:build-${buildPlatform}`,
|
|
58
|
+
},
|
|
59
|
+
configurations: {
|
|
60
|
+
local: {
|
|
61
|
+
detoxConfiguration: `${platform}.local`,
|
|
62
|
+
buildTarget: `${e2eName}:build-${buildPlatform}:local`,
|
|
63
|
+
},
|
|
64
|
+
bare: {
|
|
65
|
+
detoxConfiguration: `${platform}.debug`,
|
|
66
|
+
buildTarget: `${e2eName}:build-${buildPlatform}:bare`,
|
|
67
|
+
},
|
|
68
|
+
production: {
|
|
69
|
+
detoxConfiguration: `${platform}.release`,
|
|
70
|
+
buildTarget: `${e2eName}:build-${buildPlatform}:production`,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
exports.expoTestTarget = expoTestTarget;
|
|
76
|
+
//# sourceMappingURL=get-targets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-targets.js","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/application/lib/get-targets.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CAAC,QAAmC;IACxE,OAAO;QACL,OAAO,EAAE;YACP,kBAAkB,EAAE,GAAG,QAAQ,QAAQ;SACxC;QACD,cAAc,EAAE;YACd,UAAU,EAAE;gBACV,kBAAkB,EAAE,GAAG,QAAQ,UAAU;aAC1C;SACF;KACF,CAAC;AACJ,CAAC;AAXD,wDAWC;AAED,SAAgB,eAAe,CAAC,QAAmC;IACjE,OAAO;QACL,OAAO,EAAE;YACP,kBAAkB,EAAE,GAAG,QAAQ,QAAQ;SACxC;QACD,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AE,GAAG,QAAQ,UAAU;gBACzC,WAAW,EAAE,GAAG,OAAO,UAAU,aAAa,aAAa;aAC5D;SACF;KACF,CAAC;AACJ,CAAC;AA1BD,wCA0BC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
import { Schema } from '../schema';
|
|
3
|
+
export interface NormalizedSchema extends Schema {
|
|
4
|
+
appFileName: string;
|
|
5
|
+
appClassName: string;
|
|
6
|
+
appExpoName: string;
|
|
7
|
+
appRoot: string;
|
|
8
|
+
e2eProjectName: string;
|
|
9
|
+
e2eProjectDirectory: string;
|
|
10
|
+
e2eProjectRoot: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* if options.e2eName = 'my-app-e2e' with no options.directory
|
|
14
|
+
* e2eProjectName = 'my-app', e2eProjectRoot = 'apps/my-app'
|
|
15
|
+
* if options.e2eName = 'my-app' with options.e2eDirectory = 'my-dir'
|
|
16
|
+
* e2eProjectName = 'my-dir-my-app', e2eProjectRoot = 'apps/my-dir/my-apps'
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeOptions(host: Tree, options: Schema): NormalizedSchema;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
/**
|
|
6
|
+
* if options.e2eName = 'my-app-e2e' with no options.directory
|
|
7
|
+
* e2eProjectName = 'my-app', e2eProjectRoot = 'apps/my-app'
|
|
8
|
+
* if options.e2eName = 'my-app' with options.e2eDirectory = 'my-dir'
|
|
9
|
+
* e2eProjectName = 'my-dir-my-app', e2eProjectRoot = 'apps/my-dir/my-apps'
|
|
10
|
+
*/
|
|
11
|
+
function normalizeOptions(host, options) {
|
|
12
|
+
var _a;
|
|
13
|
+
const { appsDir } = (0, devkit_1.getWorkspaceLayout)(host);
|
|
14
|
+
const e2eFileName = (0, devkit_1.names)(options.e2eName).fileName;
|
|
15
|
+
const e2eDirectoryFileName = options.e2eDirectory
|
|
16
|
+
? (0, devkit_1.names)(options.e2eDirectory).fileName
|
|
17
|
+
: '';
|
|
18
|
+
const e2eProjectName = (e2eDirectoryFileName
|
|
19
|
+
? `${e2eDirectoryFileName}-${e2eFileName}`
|
|
20
|
+
: e2eFileName).replace(/\//g, '-');
|
|
21
|
+
const e2eProjectDirectory = e2eDirectoryFileName
|
|
22
|
+
? (0, devkit_1.joinPathFragments)(appsDir, e2eDirectoryFileName)
|
|
23
|
+
: appsDir;
|
|
24
|
+
const e2eProjectRoot = (0, devkit_1.joinPathFragments)(e2eProjectDirectory, e2eFileName);
|
|
25
|
+
const { fileName: appFileName, className: appClassName } = (0, devkit_1.names)(options.appName || options.appProject);
|
|
26
|
+
const project = (0, devkit_1.getProjects)(host).get(options.appProject);
|
|
27
|
+
const appRoot = (project === null || project === void 0 ? void 0 : project.root) || (0, devkit_1.joinPathFragments)(e2eProjectDirectory, appFileName);
|
|
28
|
+
return Object.assign(Object.assign({}, options), { appFileName,
|
|
29
|
+
appClassName, appDisplayName: options.appDisplayName || appClassName, appExpoName: ((_a = options.appDisplayName) === null || _a === void 0 ? void 0 : _a.replace(/\s/g, '')) || appClassName, appRoot, e2eName: e2eFileName, e2eProjectName,
|
|
30
|
+
e2eProjectDirectory,
|
|
31
|
+
e2eProjectRoot });
|
|
32
|
+
}
|
|
33
|
+
exports.normalizeOptions = normalizeOptions;
|
|
34
|
+
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":";;;AAAA,uCAMoB;AAapB;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,2B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,OAAO,EAAE,WAAW,EACpB,cAAc;QACd,mBAAmB;QACnB,cAAc,IACd;AACJ,CAAC;AAtCD,4CAsCC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"title": "Create Detox Configuration for the workspace",
|
|
4
|
+
"description": "Create Detox Configuration for the workspace.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"appProject": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Name of the frontend project to be tested.",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "projectName"
|
|
12
|
+
},
|
|
13
|
+
"x-prompt": "What is the name of the frontend project to test?"
|
|
14
|
+
},
|
|
15
|
+
"e2eName": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Name of the E2E Project.",
|
|
18
|
+
"$default": {
|
|
19
|
+
"$source": "argv",
|
|
20
|
+
"index": 0
|
|
21
|
+
},
|
|
22
|
+
"x-prompt": "What name would you like to use for the E2E project?"
|
|
23
|
+
},
|
|
24
|
+
"appName": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Name of the app to be tested if different from appProject"
|
|
27
|
+
},
|
|
28
|
+
"appDisplayName": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "Display name of the app to be tested if different from appProject"
|
|
31
|
+
},
|
|
32
|
+
"framework": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "App framework to test",
|
|
35
|
+
"enum": ["react-native", "expo"],
|
|
36
|
+
"x-prompt": "What app framework should detox test?"
|
|
37
|
+
},
|
|
38
|
+
"e2eDirectory": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "A directory where the project is placed relative to apps directory."
|
|
41
|
+
},
|
|
42
|
+
"linter": {
|
|
43
|
+
"description": "The tool to use for running lint checks.",
|
|
44
|
+
"type": "string",
|
|
45
|
+
"enum": ["eslint", "none"],
|
|
46
|
+
"default": "eslint"
|
|
47
|
+
},
|
|
48
|
+
"js": {
|
|
49
|
+
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"default": false
|
|
52
|
+
},
|
|
53
|
+
"skipFormat": {
|
|
54
|
+
"description": "Skip formatting files.",
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"default": false,
|
|
57
|
+
"x-priority": "internal"
|
|
58
|
+
},
|
|
59
|
+
"setParserOptionsProject": {
|
|
60
|
+
"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.",
|
|
62
|
+
"default": false
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": ["e2eName", "appProject", "framework"]
|
|
66
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
|
+
import { Schema } from './schema';
|
|
3
|
+
export declare function detoxInitGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
|
+
export declare function updateDependencies(host: Tree): GeneratorCallback;
|
|
5
|
+
export default detoxInitGenerator;
|
|
6
|
+
export declare const detoxInitSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detoxInitSchematic = exports.updateDependencies = exports.detoxInitGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const versions_1 = require("@nx/jest/src/utils/versions");
|
|
7
|
+
const versions_2 = require("../../utils/versions");
|
|
8
|
+
function detoxInitGenerator(host, schema) {
|
|
9
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
const tasks = [];
|
|
11
|
+
if (!schema.skipPackageJson) {
|
|
12
|
+
tasks.push(moveDependency(host));
|
|
13
|
+
tasks.push(updateDependencies(host));
|
|
14
|
+
}
|
|
15
|
+
if (!schema.skipFormat) {
|
|
16
|
+
yield (0, devkit_1.formatFiles)(host);
|
|
17
|
+
}
|
|
18
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
exports.detoxInitGenerator = detoxInitGenerator;
|
|
22
|
+
function updateDependencies(host) {
|
|
23
|
+
return (0, devkit_1.addDependenciesToPackageJson)(host, {}, {
|
|
24
|
+
'@nrwl/detox': versions_2.nxVersion,
|
|
25
|
+
detox: versions_2.detoxVersion,
|
|
26
|
+
'@testing-library/jest-dom': versions_2.testingLibraryJestDom,
|
|
27
|
+
'@types/node': versions_1.typesNodeVersion,
|
|
28
|
+
'jest-circus': versions_1.jestVersion,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
exports.updateDependencies = updateDependencies;
|
|
32
|
+
function moveDependency(host) {
|
|
33
|
+
return (0, devkit_1.removeDependenciesFromPackageJson)(host, ['@nrwl/detox'], []);
|
|
34
|
+
}
|
|
35
|
+
exports.default = detoxInitGenerator;
|
|
36
|
+
exports.detoxInitSchematic = (0, devkit_1.convertNxGenerator)(detoxInitGenerator);
|
|
37
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,uCAQoB;AACpB,0DAA4E;AAG5E,mDAI8B;AAE9B,SAAsB,kBAAkB,CAAC,IAAU,EAAE,MAAc;;QACjE,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;YAC3B,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;SACtC;QAED,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,yBAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAbD,gDAaC;AAED,SAAgB,kBAAkB,CAAC,IAAU;IAC3C,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ,EAAE,EACF;QACE,aAAa,EAAE,oBAAS;QACxB,KAAK,EAAE,uBAAY;QACnB,2BAA2B,EAAE,gCAAqB;QAClD,aAAa,EAAE,2BAAgB;QAC/B,aAAa,EAAE,sBAAW;KAC3B,CACF,CAAC;AACJ,CAAC;AAZD,gDAYC;AAED,SAAS,cAAc,CAAC,IAAU;IAChC,OAAO,IAAA,0CAAiC,EAAC,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,kBAAe,kBAAkB,CAAC;AACrB,QAAA,kBAAkB,GAAG,IAAA,2BAAkB,EAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"title": "Add Detox Schematics",
|
|
4
|
+
"description": "Add Detox Schematics.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"skipFormat": {
|
|
8
|
+
"description": "Skip formatting files.",
|
|
9
|
+
"type": "boolean",
|
|
10
|
+
"default": false,
|
|
11
|
+
"x-priority": "internal"
|
|
12
|
+
},
|
|
13
|
+
"skipPackageJson": {
|
|
14
|
+
"type": "boolean",
|
|
15
|
+
"default": false,
|
|
16
|
+
"description": "Do not add dependencies to `package.json`.",
|
|
17
|
+
"x-priority": "internal"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": []
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
/**
|
|
6
|
+
* Update jest.config.json under detox project, add key verbsoe: true
|
|
7
|
+
*/
|
|
8
|
+
function update(tree) {
|
|
9
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
11
|
+
projects.forEach((project) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
if (((_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a['test-ios']) === null || _b === void 0 ? void 0 : _b.executor) !== '@nrwl/detox:test')
|
|
14
|
+
return;
|
|
15
|
+
updateJestConfig(tree, project);
|
|
16
|
+
});
|
|
17
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
exports.default = update;
|
|
21
|
+
function updateJestConfig(host, project) {
|
|
22
|
+
const jestConfigPath = `${project.root}/jest.config.json`;
|
|
23
|
+
if (!host.exists(jestConfigPath))
|
|
24
|
+
return;
|
|
25
|
+
(0, devkit_1.updateJson)(host, jestConfigPath, (json) => {
|
|
26
|
+
if (!json.verbose) {
|
|
27
|
+
json.verbose = true;
|
|
28
|
+
}
|
|
29
|
+
return json;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=add-verbose-jest-config-13-10-3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-verbose-jest-config-13-10-3.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.ts"],"names":[],"mappings":";;;AAAA,uCAMoB;AAEpB;;GAEG;AACH,SAA8B,MAAM,CAAC,IAAU;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC3B,IAAI,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAG,UAAU,CAAC,0CAAE,QAAQ,MAAK,kBAAkB;gBAAE,OAAO;YAC3E,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AATD,yBASC;AAED,SAAS,gBAAgB,CAAC,IAAU,EAAE,OAA6B;IACjE,MAAM,cAAc,GAAG,GAAG,OAAO,CAAC,IAAI,mBAAmB,CAAC;IAC1D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;QAAE,OAAO;IACzC,IAAA,mBAAU,EAAC,IAAI,EAAE,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;QACxC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;SACrB;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
/**
|
|
6
|
+
* This function buildTarget to test-ios and test-android
|
|
7
|
+
*/
|
|
8
|
+
function update(tree) {
|
|
9
|
+
var _a, _b, _c, _d;
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
12
|
+
for (const [name, config] of projects.entries()) {
|
|
13
|
+
if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['test-ios']) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/detox:test') {
|
|
14
|
+
config.targets['test-ios'].options.buildTarget = `${name}:build-ios`;
|
|
15
|
+
config.targets['test-ios'].configurations.production.buildTarget = `${name}:build-ios:prod`;
|
|
16
|
+
}
|
|
17
|
+
if (((_d = (_c = config.targets) === null || _c === void 0 ? void 0 : _c['test-android']) === null || _d === void 0 ? void 0 : _d.executor) === '@nrwl/detox:test') {
|
|
18
|
+
config.targets['test-android'].options.buildTarget = `${name}:build-android`;
|
|
19
|
+
config.targets['test-android'].configurations.production.buildTarget = `${name}:build-android:prod`;
|
|
20
|
+
}
|
|
21
|
+
(0, devkit_1.updateProjectConfiguration)(tree, name, config);
|
|
22
|
+
}
|
|
23
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.default = update;
|
|
27
|
+
//# sourceMappingURL=add-build-target-test-13-5-0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-build-target-test-13-5-0.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/migrations/update-13-5-0/add-build-target-test-13-5-0.ts"],"names":[],"mappings":";;;AAAA,uCAKoB;AAEpB;;GAEG;AACH,SAA8B,MAAM,CAAC,IAAU;;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE;YAC/C,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAG,UAAU,CAAC,0CAAE,QAAQ,MAAK,kBAAkB,EAAE;gBACjE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,WAAW,GAAG,GAAG,IAAI,YAAY,CAAC;gBACrE,MAAM,CAAC,OAAO,CACZ,UAAU,CACX,CAAC,cAAc,CAAC,UAAU,CAAC,WAAW,GAAG,GAAG,IAAI,iBAAiB,CAAC;aACpE;YAED,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAG,cAAc,CAAC,0CAAE,QAAQ,MAAK,kBAAkB,EAAE;gBACrE,MAAM,CAAC,OAAO,CACZ,cAAc,CACf,CAAC,OAAO,CAAC,WAAW,GAAG,GAAG,IAAI,gBAAgB,CAAC;gBAChD,MAAM,CAAC,OAAO,CACZ,cAAc,CACf,CAAC,cAAc,CAAC,UAAU,CAAC,WAAW,GAAG,GAAG,IAAI,qBAAqB,CAAC;aACxE;YAED,IAAA,mCAA0B,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;SAChD;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;;CACzB;AAxBD,yBAwBC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function update(tree) {
|
|
6
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
7
|
+
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
8
|
+
if (!packageJson.devDependencies['@types/detox']) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
12
|
+
const hasDetoxProject = Array.from(projects)
|
|
13
|
+
.map(([_, project]) => project)
|
|
14
|
+
.some((project) => { var _a, _b; return ((_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a['test-ios']) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/detox:test'; });
|
|
15
|
+
if (!hasDetoxProject) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
(0, devkit_1.updateJson)(tree, 'package.json', (packageJson) => {
|
|
19
|
+
delete packageJson.devDependencies['@types/detox'];
|
|
20
|
+
return packageJson;
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
exports.default = update;
|
|
25
|
+
//# sourceMappingURL=remove-types-detox-13-8-2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-types-detox-13-8-2.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/migrations/update-13-8-2/remove-types-detox-13-8-2.ts"],"names":[],"mappings":";;;AAAA,uCAAqE;AAErE,SAA8B,MAAM,CAAC,IAAU;;QAC7C,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAEnD,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE;YAChD,OAAO;SACR;QAED,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;aACzC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC;aAC9B,IAAI,CACH,CAAC,OAAO,EAAE,EAAE,eACV,OAAA,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAG,UAAU,CAAC,0CAAE,QAAQ,MAAK,kBAAkB,CAAA,EAAA,CACjE,CAAC;QAEJ,IAAI,CAAC,eAAe,EAAE;YACpB,OAAO;SACR;QAED,IAAA,mBAAU,EAAC,IAAI,EAAE,cAAc,EAAE,CAAC,WAAW,EAAE,EAAE;YAC/C,OAAO,WAAW,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;YACnD,OAAO,WAAW,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAvBD,yBAuBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
|
|
6
|
+
function replacePackage(tree) {
|
|
7
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
|
+
yield (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/detox', '@nx/detox');
|
|
9
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
exports.default = replacePackage;
|
|
13
|
+
//# sourceMappingURL=update-16-0-0-add-nx-packages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-16-0-0-add-nx-packages.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts"],"names":[],"mappings":";;;AAAA,uCAA+C;AAC/C,0EAAuF;AAEvF,SAA8B,cAAc,CAAC,IAAU;;QACrD,MAAM,IAAA,iDAA+B,EAAC,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;QAExE,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAJD,iCAIC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.testingLibraryJestDom = exports.detoxVersion = exports.nxVersion = void 0;
|
|
4
|
+
exports.nxVersion = require('../../package.json').version;
|
|
5
|
+
exports.detoxVersion = '~20.5.0';
|
|
6
|
+
exports.testingLibraryJestDom = '5.16.5';
|
|
7
|
+
//# sourceMappingURL=versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/detox/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,YAAY,GAAG,SAAS,CAAC;AACzB,QAAA,qBAAqB,GAAG,QAAQ,CAAC"}
|