@nx/cypress 18.3.0-beta.1 → 18.3.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/cypress",
|
|
3
|
-
"version": "18.3.0-beta.
|
|
3
|
+
"version": "18.3.0-beta.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Cypress contains executors and generators allowing your workspace to use the powerful Cypress integration testing capabilities.",
|
|
6
6
|
"repository": {
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"migrations": "./migrations.json"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nx/devkit": "18.3.0-beta.
|
|
38
|
-
"@nx/eslint": "18.3.0-beta.
|
|
39
|
-
"@nx/js": "18.3.0-beta.
|
|
37
|
+
"@nx/devkit": "18.3.0-beta.2",
|
|
38
|
+
"@nx/eslint": "18.3.0-beta.2",
|
|
39
|
+
"@nx/js": "18.3.0-beta.2",
|
|
40
40
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
41
41
|
"detect-port": "^1.5.1",
|
|
42
42
|
"semver": "^7.5.3",
|
|
43
43
|
"tslib": "^2.3.0",
|
|
44
|
-
"@nrwl/cypress": "18.3.0-beta.
|
|
44
|
+
"@nrwl/cypress": "18.3.0-beta.2"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"cypress": ">= 3 < 14"
|
|
@@ -22,6 +22,7 @@ async function configurationGeneratorInternal(tree, options) {
|
|
|
22
22
|
const opts = normalizeOptions(tree, options);
|
|
23
23
|
opts.addPlugin ??= process.env.NX_ADD_PLUGINS !== 'false';
|
|
24
24
|
const tasks = [];
|
|
25
|
+
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
25
26
|
if (!(0, cypress_version_1.installedCypressVersion)()) {
|
|
26
27
|
tasks.push(await (0, js_1.initGenerator)(tree, { ...options, skipFormat: true }));
|
|
27
28
|
tasks.push(await (0, init_1.default)(tree, {
|
|
@@ -30,9 +31,8 @@ async function configurationGeneratorInternal(tree, options) {
|
|
|
30
31
|
}));
|
|
31
32
|
}
|
|
32
33
|
else if (opts.addPlugin) {
|
|
33
|
-
(0, init_1.addPlugin)(tree);
|
|
34
|
+
await (0, init_1.addPlugin)(tree, projectGraph, false);
|
|
34
35
|
}
|
|
35
|
-
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
36
36
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
37
37
|
const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
|
|
38
38
|
? p === '@nx/cypress/plugin'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
1
|
+
import { GeneratorCallback, ProjectGraph, Tree } from '@nx/devkit';
|
|
2
2
|
import { Schema } from './schema';
|
|
3
|
-
export declare function addPlugin(tree: Tree): void
|
|
3
|
+
export declare function addPlugin(tree: Tree, graph: ProjectGraph, updatePackageScripts: boolean): Promise<void>;
|
|
4
4
|
export declare function cypressInitGenerator(tree: Tree, options: Schema): Promise<GeneratorCallback>;
|
|
5
5
|
export declare function cypressInitGeneratorInternal(tree: Tree, options: Schema): Promise<GeneratorCallback>;
|
|
6
6
|
export default cypressInitGenerator;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cypressInitGeneratorInternal = exports.cypressInitGenerator = exports.addPlugin = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
6
6
|
const plugin_1 = require("../../plugins/plugin");
|
|
7
7
|
const versions_1 = require("../../utils/versions");
|
|
8
8
|
function setupE2ETargetDefaults(tree) {
|
|
@@ -30,26 +30,17 @@ function updateDependencies(tree, options) {
|
|
|
30
30
|
}, undefined, options.keepExistingVersions));
|
|
31
31
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
32
32
|
}
|
|
33
|
-
function addPlugin(tree) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
plugin: '@nx/cypress/plugin',
|
|
45
|
-
options: {
|
|
46
|
-
targetName: 'e2e',
|
|
47
|
-
componentTestingTargetName: 'component-test',
|
|
48
|
-
ciTargetName: 'e2e-ci',
|
|
49
|
-
openTargetName: 'open-cypress',
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
33
|
+
function addPlugin(tree, graph, updatePackageScripts) {
|
|
34
|
+
return (0, add_plugin_1.addPlugin)(tree, graph, '@nx/cypress/plugin', plugin_1.createNodes, {
|
|
35
|
+
targetName: ['e2e', 'cypress:e2e', 'cypress-e2e'],
|
|
36
|
+
openTargetName: ['open-cypress', 'cypress-open'],
|
|
37
|
+
componentTestingTargetName: [
|
|
38
|
+
'component-test',
|
|
39
|
+
'cypress:component-test',
|
|
40
|
+
'cypress-component-test',
|
|
41
|
+
],
|
|
42
|
+
ciTargetName: ['e2e-ci', 'cypress:e2e-ci', 'cypress-e2e-ci'],
|
|
43
|
+
}, updatePackageScripts);
|
|
53
44
|
}
|
|
54
45
|
exports.addPlugin = addPlugin;
|
|
55
46
|
function updateProductionFileset(tree) {
|
|
@@ -76,7 +67,7 @@ async function cypressInitGeneratorInternal(tree, options) {
|
|
|
76
67
|
process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
77
68
|
nxJson.useInferencePlugins !== false;
|
|
78
69
|
if (options.addPlugin) {
|
|
79
|
-
addPlugin(tree);
|
|
70
|
+
await addPlugin(tree, await (0, devkit_1.createProjectGraphAsync)(), options.updatePackageScripts);
|
|
80
71
|
}
|
|
81
72
|
else {
|
|
82
73
|
setupE2ETargetDefaults(tree);
|
|
@@ -85,11 +76,6 @@ async function cypressInitGeneratorInternal(tree, options) {
|
|
|
85
76
|
if (!options.skipPackageJson) {
|
|
86
77
|
installTask = updateDependencies(tree, options);
|
|
87
78
|
}
|
|
88
|
-
if (options.updatePackageScripts) {
|
|
89
|
-
global.NX_CYPRESS_INIT_GENERATOR_RUNNING = true;
|
|
90
|
-
await (0, update_package_scripts_1.updatePackageScripts)(tree, plugin_1.createNodes);
|
|
91
|
-
global.NX_CYPRESS_INIT_GENERATOR_RUNNING = false;
|
|
92
|
-
}
|
|
93
79
|
if (!options.skipFormat) {
|
|
94
80
|
await (0, devkit_1.formatFiles)(tree);
|
|
95
81
|
}
|